4.5 KiB
4.5 KiB
description, globs, trigger
| description | globs | trigger |
|---|---|---|
| Agent Skill architecture, documentation layering discipline, and tool-agent boundary principles | skills/**/*.md | manual |
Agent Skill Architecture & Documentation Discipline
When authoring, refactoring, or maintaining Agent Skills under skills/:
1. Document Layering & Single Source of Truth
Agent Skill documentation follows a strict two-tier architecture:
skills/<skill>/
├── SKILL.md # Tier 1: Lightweight Traffic Routing Hub (导流中枢)
└── references/ # Tier 2: Deep Domain Guides & Manuals (业务纵深手册)
├── enterprise-onboarding.md
├── report-templates.md
└── ...
Tier 1: Main SKILL.md (Traffic Routing Hub)
- Role: Lightweight, high-signal, rapid routing hub.
- Allowed Contents:
- Frontmatter metadata (name, description, version);
- Bootstrap & installation guide;
- Universal system invariants (timestamp format
+08:00, data masking, stdout/stderr boundaries); - Core domain navigation (
corps,rules); - Cross-domain terminology contracts;
- Reference Routing Table (
## 参考文档路由): The primary mechanism to guide AI agents to specific deep-dive guides based on user intent and intent triggers; - A strictly limited number of high-frequency single-step aggregate shortcut commands (e.g.
approval-runs diagnose).
- Strict Anti-Patterns:
- ❌ No "Feature Billboard" bloat: NEVER dump multi-step workflows, full section breakdowns, complete schemas, or qualitative debate procedures into
SKILL.md. - ❌ Overcoming "Locality Bias" (就近修改惯性): When adding a new capability (e.g.
--ledger), DO NOT casually expand the mainSKILL.mdjust because it's in front of you. Always route to or expand the correspondingreferences/*.md. - ❌ No Duplicate Maintenance: If a topic is covered in
references/<name>.md, do not duplicate its prose or guidelines inSKILL.md. The routing table row is sufficient.
- ❌ No "Feature Billboard" bloat: NEVER dump multi-step workflows, full section breakdowns, complete schemas, or qualitative debate procedures into
Tier 2: references/*.md (Deep Domain Manuals)
- Role: The authoritative, exhaustive source of truth for deep workflows, business context, and operational troubleshooting.
- Contents:
- Business background, objectives, and audience;
- Multi-step collaborative lifecycles (e.g. human-in-the-loop Tangent reviews);
- Complete column-by-column schema specifications;
- Decision matrices and terminology rules;
- Troubleshooting guides, validation error catalogs (e.g.
HD001~INFO002), and mitigation examples; - Concrete Markdown/JSON payload examples.
2. Tool vs. Agent Boundary Contract (Wrench vs. Discretion)
When designing CLI features and their Skill documentation:
- CLI is a Deterministic Wrench (确定性扳手):
- The CLI provides deterministic, repeatable, pure operations: data extraction, file export/import, offline schema/math validation, and self-contained rendering.
- The CLI MUST NOT overstep into business discretion: it does not guess subjective fault attribution ("who is right/wrong"), nor does it fabricate explanations.
- Agent Exercises Business Discretion (自由裁量权):
- The Agent (together with the user) exercises full discretion: pruning templates, filtering dirty data, conducting review debates (Tangent), and authoring qualitative takeaways.
- Strict Offline Boundary (本地事实源绝不越界):
- When driven by a local artifact (e.g.
--ledger 台账.xlsx), the CLI treats the local file as the absolute and exclusive boundary. - The CLI MUST NEVER reach out to remote cloud APIs to investigate records that were intentionally pruned/deleted from the local ledger.
- The offline validation gatekeeper evaluates only the internal consistency and mathematical harmony of the remaining records in the ledger.
- When driven by a local artifact (e.g.
3. Terminology Precision & Anti-Ambiguity Contract
- Avoid Ambiguous Catch-All Words: Never use vague terms that conflate document status with system performance (e.g. completely retire the ambiguous word "失准").
- Strict Two-Level Separation:
- Level 1: Document Validity / Approval Decision (审批决策): Focuses on the business document itself. Use
通过 (Pass)/驳回 (Reject)/违规拦截 (Interception). Rejection represents rule enforcement, NOT a system defect. - Level 2: Review Verdict / Correctness Judgment (复核裁决): Focuses on whether the AI or human decision was correct upon subsequent review. Use explicit verdicts:
ai_correct,human_correct,both_correct,both_wrong,undecided.
- Level 1: Document Validity / Approval Decision (审批决策): Focuses on the business document itself. Use