aidd-context:03:context-generate
Generate Claude Code context artifacts - skills (router-based: SKILL.md + atomic testable actions + minimal evals), agents, and rules. Use when the user wants to create, refactor, add or remove actions in a skill, migrate a slash command into a skill, or generate a new agent or rule. Do NOT use for editing a single action inside an existing skill (edit directly), creating slash commands (no router needed), writing MCP servers, or modifying project-level CLAUDE.md files.
ai-driven-dev · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add ai-driven-dev/framework --skill aidd-context:03:context-generate技能说明
name: aidd-context:03:context-generate description: Generate Claude Code context artifacts - skills (router-based: SKILL.md + atomic testable actions + minimal evals), agents, and rules. Use when the user wants to create, refactor, add or remove actions in a skill, migrate a slash command into a skill, or generate a new agent or rule. Do NOT use for editing a single action inside an existing skill (edit directly), creating slash commands (no router needed), writing MCP servers, or modifying project-level CLAUDE.md files.
Context Generate
Generates the three context artifacts a project consumes:
- Skills - router-based:
SKILL.mdrouter + atomic testable actions, evaluations declared before implementation. - Agents - single-file agent definitions following the framework's agent template.
- Rules - framework rule files that govern editor/agent behavior.
Skill-generation actions
| # | Action | Role | Input |
|---|---|---|---|
| 01 | capture-intent | Clarify output + decide generate vs modify | user intent |
| 02 | design-evals | Write minimal scenarios.json | expected output |
| 03 | decompose-actions | List actions + their tests | evals + output |
| 04 | draft-skill | Write SKILL.md router | decomposed actions |
| 05 | write-actions | Write each action file | validated SKILL.md |
| 06 | validate | Spawn one agent per action, run its ## Test, aggregate into a pass/fail report | complete skill |
Files: actions/skills/01-capture-intent.md … actions/skills/06-validate.md.
Other generation actions
actions/agents/01-generate-agent.md- generate a project agent file fromassets/agents/agent-template.md.actions/rules/01-generate-rules.md- generate framework rules fromassets/rules/rule-template.md.
Default skill flow
01 → 02 → 03 → 04 → 05 → 06. After each action, run its ## Test before moving to the next. Action 02 self-skips when 01 outputs invocation_mode = manual.
Modify flow
01 (detects modify) → 03 (re-decompose if structure changes) → 05 (targeted edit) → 06 (re-validate).
Runtime tracking
Materialize the flow as a task list at skill entry; a task closes only when its ## Test passes.
Rules
- R1 - SKILL.md is a pure router: description + action table + transversal rules. Zero business logic.
- R2 - One skill = one domain (tool OR activity). Tool → singular noun (
slack); activity → action verb (review). Seereferences/naming-conventions.md. - R3 - References one-level deep. Never chain reference → reference.
- R4 - SKILL.md ≤ 500 lines. If exceeded, split into references.
- R5 - Description must include: what, explicit triggers, "Do NOT use for..." clause.
- R6 - Zero duplication. Templates live in
assets/; actions point to them via@<path>. - R7 -
references/= documents to READ (conventions, cheatsheets).assets/= files to COPY or INJECT (templates, ID tables). - R8 - Every action has a
## Test: one sentence describing how to verify its intent - a command to run, a concrete check on the produced artifact, or an observable side-effect (API/MCP/state). - R9 - Auto-trigger skills (
disable-model-invocation: false, default) shipevals/scenarios.json= JSON array of at least 3{prompt, expect_action}. Manual-only skills skip. - R10 - Generated skills are written in English only (frontmatter, body, actions, references, assets). Holds regardless of conversation language.
References
references/naming-conventions.md- tool vs activity naming, hard constraintsreferences/skill-structure.md- skill anatomyreferences/agents-coordination.md- multi-agent coordination patternsreferences/rule-structure.md- rule file anatomyreferences/rule-writing.md- rule authoring conventionsreferences/ide-mapping.md- syntax and file location reference for AI files (agents, commands, rules, skills)
Assets (templates to copy)
assets/skills/skill-template.md- SKILL.md skeletonassets/skills/action-template.md- action file skeletonassets/skills/evals-template.md-scenarios.jsonminimal schemaassets/agents/agent-template.md- agent file skeletonassets/rules/rule-template.md- rule file skeleton