Rules Curator
Overview
Rules Curator turns conversation-level intent into durable repository guidance. Its job is curation: classify first, write only when the candidate belongs in a high-authority rule file.
Formerly rules-keeper.
Workflow
- Extract the candidate rule.
- Capture the smallest actionable sentence.
- Remove one-off task context, implementation narration, and temporary preference wording.
- Completion criterion: the candidate can stand alone as future-agent guidance.
- Classify the destination.
| Destination |
Use when |
| Root rule |
Long-lived, cross-task, mandatory, agent-actionable guidance |
| Standard doc |
Longer policy, examples, rationale, or project development standard |
| Decision or ADR |
A durable trade-off, architecture choice, tool choice, or reversal |
| Learning |
A useful pattern, pitfall, or operational note that is not mandatory |
| Handoff or context |
Current work state, remaining tasks, blockers, or resume notes |
| No write |
One-off instruction, transient preference, or already-covered rule |
Completion criterion: state the chosen destination and why it fits before writing.
- Apply the root-rule gate.
Write to root instruction files only when all are true:
- The rule is expected to remain valid across future sessions.
- It applies across tasks, modules, pages, or agents.
- It tells future agents what to do or avoid.
- The user explicitly wants durable behavior, or confirms it after review.
- It is concise enough for a root instruction file, or has a concise root summary with a documentation link.
- It does not duplicate or conflict with an existing rule.
If any item fails, route to the better destination instead of forcing a root rule.
- Ask before high-authority writes when confirmation is missing.
- If
request_user_input is available, ask one question with 2-3 choices.
- Put the recommended option first and suffix its label with
(Recommended).
- Stop until the user answers.
- If that tool is unavailable, ask in chat with a numbered list and wait for the reply.
Recommended choices:
Standard doc plus root summary, for longer rules.
Root rule, for short mandatory guidance.
Learning or decision record, for non-mandatory knowledge.
Write the rule.
- Prefer
scripts/update_dynamic_rules.py.
- Root file is
AGENTS.md.
- Mirror to existing
claude.md / CLAUDE.md / gemini.md / GEMINI.md by default.
- Create missing mirror files only when the repository or user explicitly wants mirrored agent files.
- Report the result.
- Destination chosen.
- Exact rule text written or reason no write happened.
- Files changed.
- Duplicate or conflict notes.
Script Usage
Append a root rule:
python "C:\path\to\skills\rules-curator\scripts\update_dynamic_rules.py" --repo-root . --rule "All runtime logs must be English ASCII" --scope "全仓库"
Preview without writing:
python "C:\path\to\skills\rules-curator\scripts\update_dynamic_rules.py" --repo-root . --rule "All runtime logs must be English ASCII" --dry-run
Sync existing mirror files:
python "C:\path\to\skills\rules-curator\scripts\sync_agents.py" --repo-root .
Create missing mirror files only when explicitly requested:
python "C:\path\to\skills\rules-curator\scripts\sync_agents.py" --repo-root . --create-missing
Rule Table
Root rules are appended under:
## 动态更新规则
| 日期 | 规则 | 适用范围 | 来源 | 备注 |
|---|---|---|---|---|
Rows use:
| 日期 | 规则 | 适用范围 | 来源 | 备注 |
Use the note field for replacements, for example supersedes: 2026-07-01 old summary.
Common Mistakes
- Do not write a clear sentence just because it is clear. Clear one-off instructions are still one-off.
- Do not append near-duplicates. Merge, replace, or mark supersession.
- Do not put long rationale in root files. Link to a standard, ADR, or solution doc.
- Do not silently create every possible agent file in a repository that only uses one.
- Do not treat a learning as a rule. Rules are mandatory; learnings are guidance.
1---2name: rules-curator3description: Use when the user wants to sediment durable repository rules or agent instructions, mentions "以后都这样", "全局规则", "沉淀成规则", or asks to update AGENTS.md, CLAUDE.md, or GEMINI.md.4---5# Rules Curator67## Overview8Rules Curator turns conversation-level intent into durable repository guidance. Its job is curation: classify first, write only when the candidate belongs in a high-authority rule file.910Formerly `rules-keeper`.1112## Workflow131. Extract the candidate rule.14- Capture the smallest actionable sentence.15- Remove one-off task context, implementation narration, and temporary preference wording.16- Completion criterion: the candidate can stand alone as future-agent guidance.17182. Classify the destination.1920| Destination | Use when |21|---|---|22| Root rule | Long-lived, cross-task, mandatory, agent-actionable guidance |23| Standard doc | Longer policy, examples, rationale, or project development standard |24| Decision or ADR | A durable trade-off, architecture choice, tool choice, or reversal |25| Learning | A useful pattern, pitfall, or operational note that is not mandatory |26| Handoff or context | Current work state, remaining tasks, blockers, or resume notes |27| No write | One-off instruction, transient preference, or already-covered rule |2829Completion criterion: state the chosen destination and why it fits before writing.30313. Apply the root-rule gate.3233Write to root instruction files only when all are true:34- The rule is expected to remain valid across future sessions.35- It applies across tasks, modules, pages, or agents.36- It tells future agents what to do or avoid.37- The user explicitly wants durable behavior, or confirms it after review.38- It is concise enough for a root instruction file, or has a concise root summary with a documentation link.39- It does not duplicate or conflict with an existing rule.4041If any item fails, route to the better destination instead of forcing a root rule.42434. Ask before high-authority writes when confirmation is missing.44- If `request_user_input` is available, ask one question with 2-3 choices.45- Put the recommended option first and suffix its label with `(Recommended)`.46- Stop until the user answers.47- If that tool is unavailable, ask in chat with a numbered list and wait for the reply.4849Recommended choices:501. Standard doc plus root summary, for longer rules.512. Root rule, for short mandatory guidance.523. Learning or decision record, for non-mandatory knowledge.53545. Write the rule.55- Prefer `scripts/update_dynamic_rules.py`.56- Root file is `AGENTS.md`.57- Mirror to existing `claude.md` / `CLAUDE.md` / `gemini.md` / `GEMINI.md` by default.58- Create missing mirror files only when the repository or user explicitly wants mirrored agent files.59606. Report the result.61- Destination chosen.62- Exact rule text written or reason no write happened.63- Files changed.64- Duplicate or conflict notes.6566## Script Usage67Append a root rule:6869```bash70python "C:\path\to\skills\rules-curator\scripts\update_dynamic_rules.py" --repo-root . --rule "All runtime logs must be English ASCII" --scope "全仓库"71```7273Preview without writing:7475```bash76python "C:\path\to\skills\rules-curator\scripts\update_dynamic_rules.py" --repo-root . --rule "All runtime logs must be English ASCII" --dry-run77```7879Sync existing mirror files:8081```bash82python "C:\path\to\skills\rules-curator\scripts\sync_agents.py" --repo-root .83```8485Create missing mirror files only when explicitly requested:8687```bash88python "C:\path\to\skills\rules-curator\scripts\sync_agents.py" --repo-root . --create-missing89```9091## Rule Table92Root rules are appended under:9394```markdown95## 动态更新规则96| 日期 | 规则 | 适用范围 | 来源 | 备注 |97|---|---|---|---|---|98```99100Rows use:101102`| 日期 | 规则 | 适用范围 | 来源 | 备注 |`103104Use the note field for replacements, for example `supersedes: 2026-07-01 old summary`.105106## Common Mistakes107- Do not write a clear sentence just because it is clear. Clear one-off instructions are still one-off.108- Do not append near-duplicates. Merge, replace, or mark supersession.109- Do not put long rationale in root files. Link to a standard, ADR, or solution doc.110- Do not silently create every possible agent file in a repository that only uses one.111- Do not treat a learning as a rule. Rules are mandatory; learnings are guidance.