Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion skills/request-basis/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ This skill routes PRC civil request-right basis work. It is not a shortcut to a
4. For each request basis analyzed in detail, apply the request lifecycle: right arises, not extinguished, exercisable, defenses/counter-defenses.
5. Use controlled concept cards for professional terms when available; create a temporary concept card when absent.
6. Use rule-obligation groups as scaffolding, not as verified law.
7. If no local rule-obligation group fits, generate a temporary candidate group and label it `model_inference`.
7. If no local rule-obligation group fits, generate a temporary candidate group and label it `model_inference`; when neither a rule-obligation group nor a request-basis seed matches, build the schema from the main norm via `reference.generation_protocol`.
8. Search local materials only for targeted snippets.
9. For new materials, extract atomic source assertions before merging them into concept cards or rule-obligation groups.
10. For reference integration work, use source synthesis to group sources by request-basis family before changing runtime rules.
11. Output uncertainty, verification needs, and excluded paths explicitly.
12. For real case pilots, use the real-case-testing reference and keep reusable lessons abstract.
13. In litigation/exam work, hold the fact–question–norm valve and two user-confirmation gates (candidate list, lifecycle outline) before drafting: `reference.staged_gates`.
14. When an element reaches an indeterminate concept (过错 / 合理 / 显失公平 / 善意), route it through `reference.interpretation_toolkit` instead of asserting it.
15. Match argument depth to how contested each element is: `reference.proportionality`.
16. Before drafting or converting to a report, pass the output pre-check gate: `reference.output_precheck`.

## Scenario Router

Expand Down Expand Up @@ -72,6 +76,7 @@ Keep schema details, resource manifest mechanics, generated indexes, candidate b
- Do not suppress a plausible path just because it is absent from seed data. Keep it as a labeled candidate if trigger facts, norm function, evidence target, and verification need can be explained.
- Do not store real case facts as skill examples; convert only abstract, repeatable failure patterns into evals or references.
- Without MCP or another authoritative source, do not state current law as verified.
- Resolve concrete tools through `reference.capability_slots` ([SLOT-LEGAL-DB], [SLOT-DOC-PARSE], [SLOT-WEB-SEARCH], [SLOT-WORD-OUTPUT]); when a slot is unset, degrade through the source labels rather than guessing.
- Without case-law research, do not say courts usually or generally hold a position.
- Do not treat party statements as found facts.
- Every analyzed request basis must visibly pass through: right arises, not extinguished, exercisable, defenses/counter-defenses.
Expand Down Expand Up @@ -111,6 +116,12 @@ Read only what is needed, resolved by logical role:
- `reference.retrieval`: searching local source materials without loading large files.
- `reference.methodology`: request-basis method, three layers/four steps, practice-vs-study distinction.
- `reference.output_templates`: reusable output skeletons.
- `reference.generation_protocol`: build a review schema from norms when no seed group or base matches (查字典→会造句 fallback).
- `reference.staged_gates`: fact–question–norm valve, two user-confirmation gates, and parallel-drafting premise injection.
- `reference.proportionality`: match argument depth to how contested each element is.
- `reference.interpretation_toolkit`: indeterminate-concept hook routing to interpretation ranks and the legal-interpretation-argument / analogical-reasoning skills.
- `reference.output_precheck`: pre-drafting gate for coverage, citation verification, delivery-format conformance, and one-pass revision.
- `reference.capability_slots`: tool-to-slot mapping for portability; degradation routes through the source labels.

## Data Files

Expand Down
45 changes: 45 additions & 0 deletions skills/request-basis/references/capability_slots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Capability Slots

Use this reference to keep the request-basis method portable across tool stacks. The skill describes *what* capability is needed at each step (a slot); the slot table maps each slot to the concrete tool in the current environment. Methodology files refer to slots by `[SLOT-X]` placeholders, never to a tool name. To move the skill to another stack, change only the slot table below — not the method.

## Why slots

- Portability: methodology, source labels, and lifecycle gates stay stable; swapping `mineru-ocr` for another parser is a one-line table edit.
- Honest degradation: a missing slot does not silently fail. It downgrades through this skill's own discipline (five-tier source label + verification task), not through ad-hoc inline text.
- Single source of tool truth: do not hardcode tool names inside other references; resolve them here.

## Prefilled Default Slot Table

This environment is a single fixed tool stack, so the slots are prefilled — no cold-start interview is run. The defaults below apply directly.

| Slot | Capability | Default tool | Fallback |
| --- | --- | --- | --- |
| `[SLOT-LEGAL-DB]` | Authoritative law / judicial interpretation / case-law lookup | `yuandian-law-search` | `regulation-search`; 北大法宝 |
| `[SLOT-DOC-PARSE]` | Convert PDF/Word/image case files to Markdown | `mineru-ocr` | `case-files-to-md-fast` (sensitive / no-upload / offline) |
| `[SLOT-WEB-SEARCH]` | Open-web search for practice articles, context, leads | built-in WebSearch | — |
| `[SLOT-WORD-OUTPUT]` | Render a finished report to .docx | `md2word` (legal report uses `rules/common/legal-report-delivery-format.md`, 《法学研究》-style) | output Markdown + note manual conversion |
| `[SLOT-ACADEMIC]` | Academic paper retrieval | (optional, unset) | route the need through `[SLOT-WEB-SEARCH]` |

Routing notes:

- `[SLOT-LEGAL-DB]` is the verification engine. It is what closes a `verification.md` task from `pending_mcp` to `mcp_verified`. Without it, no statute/interpretation is `verified_law`.
- `[SLOT-DOC-PARSE]`: default to `mineru-ocr`; when material is confidential or must not be uploaded, use `case-files-to-md-fast` instead.
- `[SLOT-WORD-OUTPUT]` is only invoked at final delivery; analysis stays in Markdown until then.

## Degradation Rules

When a slot is unset or its tool is unavailable, degrade through this skill's existing machinery — do **not** introduce inline text markers such as `[未经校验]`. The five-tier label schema (`source_policy.md`) is stronger and already covers this.

- `[SLOT-LEGAL-DB]` missing: do not state any current-law claim as `verified_law`. Keep cited statutes/interpretations at `judicial_interpretation` / `source_extracted` with `verification_status: unverified` (or `pending_mcp` once queued), and open a `verification.md` task per `mcp_verification_required` claim. This is the existing Global Rule "Without MCP… do not state current law as verified", expressed through the slot.
- `[SLOT-DOC-PARSE]` missing: work only from text the user supplied; mark any reconstructed table/figure claim `ocr_risk: true` and label it `source_extracted` / `needs_human_review`. Do not invent case-file content.
- `[SLOT-WEB-SEARCH]` missing: do not assert court-practice generalizations; keep them `model_inference` and queue a `case_law_reference` verification task.
- `[SLOT-WORD-OUTPUT]` missing: deliver Markdown and note that conversion is pending; this is a delivery-format gap, not a substance gap, so no label change.
- `[SLOT-ACADEMIC]` unset: fold the need into `[SLOT-WEB-SEARCH]`; scholarly propositions stay `scholarly_reference` / `academic_paper` and unverified until checked.

In every case the degraded claim still passes through the four request-lifecycle gates and carries an explicit source label and, where verification is required, a verification task. Degradation narrows confidence; it never bypasses the labels.

## Portability Note

When distributing this skill to another environment, clear the prefilled table back to empty slots and either run a first-use slot interview (ask the user which tool fills each slot) or apply the degradation rules above until slots are registered. The methodology and label schema do not change; only the slot table does.

> 能力槽思想借鉴 Youchu-lawhub/gutachten-civil-case(Apache-2.0);本 skill 改为单栈预填、沿用自有五档证据标签。
49 changes: 49 additions & 0 deletions skills/request-basis/references/classification.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,52 @@ Only after that, ask:
```text
Which candidate causes of action help retrieve materials, draft pleadings, or compare cases?
```

## Five-Level Norm Retrieval

When finding the candidate norm from raw facts, walk five levels (this is the
"找法" front end to `reference.generation_protocol`):

1. **Party relations** — build the party-pair matrix (A→B, B→A, A→C …); each
pair is a separate analysis unit.
2. **Relief sought** — what each claimant wants (给付 / 确认 / 形成 / 非讼).
3. **Norm class** — place the relief in one of the norm-basis classes below.
4. **Specific norm** — the exact 条文 inside that class (verify via `[SLOT-LEGAL-DB]`).
5. **Review schema** — build the four-gate 检视程式 for that norm
(`reference.request_lifecycle` / `reference.generation_protocol`).

## Norm-Basis Classes (taxonomy)

A working class list for level 3. Treat it as a retrieval index, not a closed set;
add a class if the facts need one.

| # | 类别 | 典型请求/规范 |
| --- | --- | --- |
| 1 | 合同 | 履行 / 违约 / 解除返还 |
| 2 | 准合同(无因管理·不当得利) | 返还 / 费用偿还 |
| 3 | 物权请求权 | 返还原物 / 排除妨害 / 消除危险 |
| 4 | 占有保护 | 占有返还 / 妨害除去 |
| 5 | 人格权 | 停止侵害 / 赔礼道歉 / 损害赔偿 |
| 6 | 知识产权 | 停止侵害 / 赔偿 |
| 7 | 侵权 | 损害赔偿(含人身/财产/精神) |
| 8 | 缔约过失 | 信赖利益赔偿 |
| 9 | 后合同义务 | 协助 / 保密 / 损害赔偿 |
| 10 | 婚姻家庭 | 抚养 / 分割 / 损害赔偿 |
| 11 | 继承 | 继承权确认 / 遗产分割 |
| 12 | 债的保全 | 代位权 / 撤销权 |
| 13 | 债权债务移转 | 债权转让 / 债务承担 |
| 14 | 担保物权 | 优先受偿 / 实现担保物权 |
| 15 | 确认之诉 | 确认权利/法律关系存在或不存在 |
| 16 | 形成之诉 | 撤销 / 解除 / 变更 |
| 17 | 非讼 | 宣告失踪/死亡 / 指定监护 等 |
| 18 | 程序性 | 管辖 / 保全 / 执行 等(非请求权基础,单列) |

Class #2 bundles 无因管理 and 不当得利 as a retrieval index only; in the outer
examination order they stay distinct — 无因管理 is checked before 物权, and
不当得利 is the residual/兜底 basis checked last (`reference.methodology`).

Terminology discipline: 请求权基础 is for 给付之诉; 确认 / 形成 / 非讼 / 程序 rest on
a 规范基础 that is not a 请求权基础 — keep the words distinct
(`reference.request_basis_concept`).

> 方法借鉴 Youchu-lawhub/gutachten-civil-case(Apache-2.0),已按本 skill 的双轨入口与术语纪律改写。
83 changes: 83 additions & 0 deletions skills/request-basis/references/generation_protocol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Generation Protocol

Use this reference only as a fallback. When `rule_obligation_seed` and `request_basis_seed` both miss — no local rule-obligation group fits the claim and no seed request basis matches — this protocol lets the skill build a review schema (检视程式) from the norm itself instead of stopping.

This is the move from 查字典 (look up a prebuilt schema) to 造句 (construct one from first principles). It does not produce verified law.

## Activation Gate

Run this protocol only when all are true:

- The scenario and claim goal are already fixed (see `reference.methodology`).
- No `rule_obligation_seed` group bridges the claim to bases/elements/defenses.
- No `request_basis_seed` entry names a matching base.

If a seed exists, prefer it and use this protocol only to cross-check coverage.

## Output Discipline (non-negotiable)

Every node this protocol generates is a method scaffold, not located law:

```yaml
source_status: model_inference
verification_status: pending_mcp
mcp_verification_required: true
```

- Carry these labels through to the final output; do not present a generated base, element, or article number as settled law (`reference.source_policy`, `reference.discretion_policy`).
- For each generated main norm and each defense/auxiliary citation, write a verification task into the queue (`reference.verification`): exact article-number check, current-version check, and any 配套司法解释.
- A generated schema is a candidate path, never a "located request basis" until the queue clears.

## Step 1 — Find Candidate Main Norms

From the fixed claim goal, locate candidate main norms (请求权基础条文) by structured discovery, not by guessing articles.

1. **Party-pair matrix.** List every party and its legal role (natural person, legal person, consumer/operator, possessor/物权人, guarantor, etc.). Pair them both directions: A→B (forward claim), B→A (defense/counterclaim), and any third-party leg. Keep only pairs joined by a connection point: contract, property/possession, tort, unjust enrichment, negotiorum gestio, or status relationship.
2. **Claim type.** For each live pair, classify the claim: 给付之诉 / 确认之诉 / 形成之诉. Inside 给付, separate 原给付 / 次给付 (违约) / 物权请求权 / 损害赔偿 / 返还 (不当得利) / 费用偿还.
3. **Norm class then article.** Walk the typical outer order (`reference.methodology`): contract → contract-like → negotiorum gestio → property/possession → unjust enrichment → tort. For each plausible class, pull candidate articles. Apply the priorities: 有合同先检合同; 物权优先于债权; 不当得利兜底; flag 竞合 and 聚合.

Output: a candidate list keyed by party-pair and claim, each entry `model_inference`.

## Step 2 — Classify Norm Function

For each candidate, judge its function before building anything (`reference.norm_decomposition` vocabulary):

- `main_norm` / `incomplete_main_norm`: directly supports the claim (incomplete if a legal act or another norm must fill the effect). Only these seed a schema spine.
- `auxiliary_norm`: defines an element, status, scope, time point, or consequence of a main norm.
- `defense_norm`: blocks arising, extinguishes, or blocks exercisability.
- cross-class signals (`counter_defense_norm`, `referral_norm`, `principle_norm`, `burden_norm`): note but do not promote to spine.

Demote anything that only "looks related." Keep only genuine main norms as Step 3 anchors; hold the rest for mounting.

## Step 3 — Build the Lifecycle Schema

Take each confirmed main norm and raise the four-gate review spine (`reference.request_lifecycle`). Do not match an external template library; build the spine directly from this skill's lifecycle.

For the main norm:

1. Load the article, isolate the legal effect ("……的,应当/有权/可以……"), and treat everything before it as positive elements.
2. Lay the elements under `产生` (right arises). If the base rests on a legal act, do not collapse the gate — identify the act model (unilateral/bilateral/resolution/...) and select formation + effectiveness facts (`reference.request_lifecycle` legal-act gate).
3. Mount the gates and hang the held norms from Step 2:
- `产生`: positive elements + auxiliary norms + 权利障碍抗辩 (无效/可撤销/效力待定; tort: 阻却违法/无过错).
- `未消灭`: 清偿/抵销/提存/混同/免除/解除/撤销 consequences (anchor on 债的通用消灭事由).
- `可行使`: 诉讼时效 + 同时/先履行/不安抗辩 + 约定条件 + 程序前提.
- `抗辩/反抗辩`: counter-defenses, waiver, 时效中断/中止, defense-unavailable.
4. For 损害赔偿 bases, split 责任成立 from 责任范围 inside `产生`.

Mark each defense/auxiliary with its burden holder. Tag branches the facts do not touch as `[本案不涉及]` and fold them — do not delete, to keep the spine complete and auditable.

## Step 4 — Decompose Elements and Flag Open Concepts

Break each gate's elements into smallest 涵摄 units and hand the soft ones to the concept layer (`reference.concept_cards`).

- Split on connectors: 和/以及/同时 → AND (each independent); 或者/或 → OR (alternative); 但……除外 → carve the 但书 into a defense norm.
- Surface implied elements the text omits: 因果关系, 过错, 违法性, 行为能力.
- Tag each element type (主体/行为/客体/主观/因果/结果/程序) and certainty (确定 / 不确定法律概念 / 一般条款).
- For every 不确定法律概念 (重大、合理、显失公平、善意、根本违约、不可抗力, ...): mark **需法律解释**, name the dispute focus, and route to a concept card — create a temporary card when none exists (`reference.concept_cards`). Do not let the term float on model intuition.
- Apply the 否认 vs 抗辩 distinction: a norm denying an element fact sits under that element marked 否认; a norm introducing an independent blocking/extinguishing fact stands alone marked 抗辩. Note any 跨阶段双重挂载 (one norm serving two gates).

## Handoff

The product is a candidate schema: four-gate spine + decomposed elements + concept-card hooks + a populated verification queue, all `model_inference` / `pending_mcp`. It feeds the same gates and output skeletons as a seed-sourced base (`reference.output_templates`), and must clear `reference.verification` before any node is stated as law. If a real seed later appears, compare the two and reconcile.

> 方法借鉴 Youchu-lawhub/gutachten-civil-case(Apache-2.0),已按本 skill 的四阶层 lifecycle 与证据标签体系改写。
Loading