CSlawyer1985/legal-skillhub / skills/appeal-docs-generator
appeal-docs-generator
Verified民事二审上诉文本成套生成技能。上传一审判决书后,以民诉法为尺子逐条审查原审判决是否错误(期限/主体程序/诉请判项比对/三段论/说理/新要素六诊),结合元典连接器检索现行有效法条与类案,并做一次「当事人是否已逐条确认事实认定错误、有无新证据」的事实核对互动,最终一次生成民事上诉状、二审证据清单、支持上诉请求的法条与类案检索报告、二审授权委托书、所函、二审接待笔录、待确认事实清单等全套文本。上诉状严格套用德恒格式母版(黑体18pt居中标题/仿宋14pt正文/1.5倍行距),格式100%保留。另提供 scan 轻出口,只做上诉可行性评估与上诉费测算,不出全套文书。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 25.4 KB |
| _meta.json | config | 114 B |
| references/templates-b64.json | config | 148.9 KB |
| references/yuandian_tools_guide.md | markdown | 2.2 KB |
| references/上诉状填充字段表.md | markdown | 4.6 KB |
| references/二审风险告知要点.md | markdown | 2.2 KB |
| references/元典检索姿势.md | markdown | 4.1 KB |
| references/判决书解剖清单.md | markdown | 8.4 KB |
| references/当事人事实核对清单.md | markdown | 4.0 KB |
| references/所函模板.md | markdown | 1.2 KB |
| references/授权委托书模板.md | markdown | 1.7 KB |
| references/接待笔录模板.md | markdown | 4.1 KB |
| references/文件清单及盖章指引模板.md | markdown | 3.3 KB |
| references/检索报告模板.md | markdown | 3.1 KB |
| references/模板与排版规范.md | markdown | 5.5 KB |
| references/民诉法审查尺子表.md | markdown | 9.1 KB |
| scripts/appeal_fee_calc.py | script | 6.3 KB |
| scripts/build_pending_facts_docx.py | script | 6.9 KB |
| scripts/deadline_check.py | script | 5.0 KB |
| scripts/fill_appeal_docx.py | script | 9.8 KB |
| scripts/generate_file_list.py | script | 7.8 KB |
| scripts/render_docx.py | script | 8.6 KB |
| scripts/restore_templates.py | script | 5.7 KB |
scripts/build_pending_facts_docx.py
View on GitHub#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Maintained by Lu Lingyan, Deheng (Wuxi) Law Firm.
"""生成《待确认事实清单》.docx —— H1 事实核对互动的载体。
为什么必须逐条拆条
------------------
判决书认定的事实是对是错,只有当事人知道。但**不能让当事人自由陈述**——自由陈述必然
遗漏、必然跑偏。正确做法是把判决书"本院查明"部分逐条拆开,一条一条给当事人判断。
这份清单就是"要不要开会"的选择权:律师有空就当面过判决书,没空就直接发给当事人逐条勾。
输出:Word 文档(.docx)。**只出 Word** —— 可打印、可签名、可直接发微信。
用法
----
python3 build_pending_facts_docx.py <payload.json> <输出.docx>
payload.json:
{
"案件": "张三与李四房屋买卖合同纠纷",
"上诉人": "张三",
"一审法院": "××市××区人民法院",
"一审案号": "(2024)苏××××民初1234号",
"上诉期届满日": "2026-10-01",
"事实": [
"判决书认定的第 1 条事实原文(照抄,不要转述)",
"判决书认定的第 2 条事实原文"
],
"落款": "××律师事务所 ×××律师"
}
「事实」数组由 agent 从判决书「本院查明」部分逐条摘录后传入,**必须是原文摘录**,
不得转述或概括——当事人要对照的就是判决书原话。
"""
import json
import sys
from docx import Document
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn
from docx.shared import Cm, Pt
HEADERS = ["序号", "判决书认定的事实(原文摘录)", "属实/不属实/部分属实",
"如不属实,真实情况是", "有无证据", "证据名称", "在谁手上", "一审是否已提交"]
COL_W = [Cm(1.0), Cm(4.6), Cm(1.8), Cm(3.4), Cm(1.2), Cm(2.2), Cm(1.4), Cm(1.4)]
INSTRUCTIONS = [
"填写说明",
"1. 请对照判决书原文,逐条判断。不属实的,请在「真实情况」栏写明实际发生的情况。",
"2. 有证据的,请写清证据名称与由谁保管。只写「事实不是这样」但没有证据的,无法作为上诉理由使用。",
"3. 二审提交新证据需要说明为什么一审没有提出,并非所有「新事实」都能在二审提出。",
"4. 如果您的陈述与在案证据相矛盾,可能反过来对己方不利,请如实填写。",
"5. 另请补充:判决书完全没有提到、但对本案重要的事实有哪些(见文末补充栏)。",
]
def _font(run, name="仿宋", size=10.5, bold=False):
run.font.name = name
run.font.size = Pt(size)
run.bold = bold
run._element.rPr.rFonts.set(qn("w:eastAsia"), name)
def _para(doc, text, name="仿宋", size=14, bold=False, align=None, indent=True, space_after=2):
p = doc.add_paragraph()
p.paragraph_format.line_spacing = 1.5
p.paragraph_format.space_after = Pt(space_after)
if indent:
p.paragraph_format.first_line_indent = Pt(size * 2)
if align == "center":
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
elif align == "right":
p.alignment = WD_ALIGN_PARAGRAPH.RIGHT
_font(p.add_run(text), name, size, bold)
return p
def build(payload, out_path):
facts = payload.get("事实") or []
if not facts:
raise SystemExit("❌ payload['事实'] 为空:必须先从判决书「本院查明」部分逐条摘录原文。")
doc = Document()
s = doc.sections[0]
s.page_width, s.page_height = Cm(21.0), Cm(29.7)
s.top_margin = s.bottom_margin = Cm(2.5)
s.left_margin = s.right_margin = Cm(1.8)
_para(doc, "待确认事实清单", name="宋体", size=18, bold=True, align="center",
indent=False, space_after=8)
_para(doc, f"案件:{payload.get('案件', '')}", size=12, indent=False)
_para(doc, f"上诉人:{payload.get('上诉人', '')} 一审法院:{payload.get('一审法院', '')} "
f"一审案号:{payload.get('一审案号', '')}", size=12, indent=False)
if payload.get("上诉期届满日"):
_para(doc, f"上诉期届满日:{payload['上诉期届满日']}", size=12, indent=False)
_para(doc, "", size=6, indent=False)
_para(doc, "填写说明", name="宋体", size=14, bold=True, indent=False)
for line in INSTRUCTIONS[1:]:
_para(doc, line, size=11)
_para(doc, "", size=6, indent=False)
table = doc.add_table(rows=1, cols=len(HEADERS))
table.style = "Table Grid"
table.alignment = WD_TABLE_ALIGNMENT.CENTER
for i, h in enumerate(HEADERS):
cell = table.rows[0].cells[i]
cell.text = ""
p = cell.paragraphs[0]
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
p.paragraph_format.line_spacing = 1.0
_font(p.add_run(h), "宋体", 10.5, True)
for n, fact in enumerate(facts, 1):
row = table.add_row()
row.cells[0].text = ""
p0 = row.cells[0].paragraphs[0]
p0.alignment = WD_ALIGN_PARAGRAPH.CENTER
p0.paragraph_format.line_spacing = 1.0
_font(p0.add_run(str(n)), "仿宋", 10.5)
for i in range(1, len(HEADERS)):
c = row.cells[i]
c.text = ""
p = c.paragraphs[0]
p.paragraph_format.line_spacing = 1.0
if i == 1:
_font(p.add_run(fact), "仿宋", 10.5)
for row in table.rows:
for i, w in enumerate(COL_W):
row.cells[i].width = w
_para(doc, "", size=8, indent=False)
_para(doc, "补充栏", name="宋体", size=14, bold=True, indent=False)
_para(doc, "一、判决书完全没有提到、但对本案重要的事实:", size=12)
for _ in range(5):
_para(doc, " ", size=12, indent=False)
_para(doc, "二、对判决理由(「本院认为」部分)的意见:", size=12)
_para(doc, " □ 认可 □ 不认可,理由是:", size=12)
for _ in range(3):
_para(doc, " ", size=12, indent=False)
_para(doc, "三、本次提供的新证据:", size=12)
_para(doc, " 证据名称/来源/形成时间/拟证明的事实:", size=12)
for _ in range(4):
_para(doc, " ", size=12, indent=False)
_para(doc, "", size=10, indent=False)
_para(doc, f"当事人签名: 日期: 年 月 日", size=12)
_para(doc, payload.get("落款", ""), size=12, align="right", indent=False)
doc.save(out_path)
# 自检:条目数进出一致
got = len(doc.tables[0].rows) - 1
if got != len(facts):
raise SystemExit(f"❌ 自检未通过:输入 {len(facts)} 条事实,输出表格 {got} 行。")
return out_path, len(facts)
if __name__ == "__main__":
if len(sys.argv) != 3:
raise SystemExit(__doc__)
with open(sys.argv[1], encoding="utf-8") as fh:
data = json.load(fh)
path, n = build(data, sys.argv[2])
print(f"✅ {path}({n} 条事实,自检通过)")
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |