一键导入
adr
Capture an Architecture Decision Record documenting context, reasoning, alternatives, and consequences of a significant technical decision.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Capture an Architecture Decision Record documenting context, reasoning, alternatives, and consequences of a significant technical decision.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End-of-session routine. Ensures test coverage, performs self-review, runs validation, and commits cleanly. Use when finishing a unit of work.
Full feature implementation workflow with explore, plan, code, test, validate, and commit phases. Use for new features, enhancements, or significant code changes.
Iterate on an open PR until CI passes and all review feedback is addressed. Fetches status, categorizes findings by severity, applies fixes, and loops until clean.
Create a detailed implementation plan without writing code. Read-only analysis and planning with user approval gate. Use before implementing features or making significant changes.
Systematic security audit with confidence-based reporting. Analyzes attack surfaces, checks against OWASP categories, and reports only confirmed or likely vulnerabilities. Use for pre-merge security review or periodic audits.
Run validation checks to ensure code quality, security, and correctness. Supports quick (scoped), full (CI pipeline), fix (auto-correct), and CI mirror modes.
| name | adr |
| description | Capture an Architecture Decision Record documenting context, reasoning, alternatives, and consequences of a significant technical decision. |
| category | meta |
| triggers | ["architecture decision","record decision","document decision","adr","why did we choose","design rationale"] |
Purpose: Capture Architecture Decision Records documenting the reasoning behind significant technical choices Usage:
/adr [title]or/adr --from-todo <todo-file>
Requires .ai-project/decisions/ directory (created by /init). If it does not exist, create it.
Before interviewing or creating anything, read all existing ADRs in .ai-project/decisions/:
ls .ai-project/decisions/
For each existing ADR, note:
If a related ADR exists with status "Accepted": Confirm with the user whether the new decision supersedes it.
If --from-todo <todo-file> is provided, read the todo file to extract:
Otherwise, interview for context:
Skip the interview if the user provided sufficient detail in the command.
Search existing ADRs for references to the decision topic:
grep -ril "<topic keyword>" .ai-project/decisions/ 2>/dev/null
Any ADR that references the topic domain should be noted in the "Related Decisions" section of the new ADR, with a brief note about whether it needs updating as a consequence.
If the decision is trivial or forced (see "When NOT to Create"): Suggest skipping the ADR and explain why:
| Scope | Characteristics | ADR Depth |
|---|---|---|
| Local | Affects 1-2 files, single module | Brief — context + decision + key consequence |
| Cross-cutting | Affects multiple modules, 3-10 files | Standard — full template with alternatives |
| Architectural | Affects project structure, conventions, or data model | Comprehensive — full template + migration notes + diagrams |
File location: .ai-project/decisions/{descriptive-name}.md
Naming conventions:
api-client-pattern.md, state-management.mdjwt-authentication.md). Do NOT reuse the old ADR's filename — even though git history preserves the old content, having two distinct files makes the superseding relationship explicit and both decisions discoverable.Template:
# ADR: {Title}
**Date:** {YYYY-MM-DD}
**Status:** Accepted
## Context
[What problem or need prompted this decision? What constraints existed?
Include relevant technical context — the reader should understand the situation
without needing to look at other documents.]
## Decision
[What was decided? Be specific about the approach, pattern, or technology chosen.
Include code examples if they clarify the decision.]
## Consequences
### Positive
- [Concrete benefit with explanation]
### Negative
- [Concrete drawback with explanation]
### Migration
- [What needs to change to adopt this decision, if anything]
- [Files affected, patterns to update, data to migrate]
## Alternatives Considered
### {Alternative 1}
- **Approach:** [Brief description]
- **Pros:** [Why it was attractive]
- **Cons:** [Why it was rejected]
### {Alternative 2}
- **Approach:** [Brief description]
- **Pros:** [Why it was attractive]
- **Cons:** [Why it was rejected]
For Architectural scope, also include:
## Migration Plan
| Phase | Action | Files Affected |
|-------|--------|----------------|
| 1 | [First step] | [files] |
| 2 | [Second step] | [files] |
## Related Decisions
- [Link to related ADRs if they exist]
Before presenting, check:
ADR written to `.ai-project/decisions/{name}.md`
**Review the ADR?** (looks good / edit / cancel)
| Status | Meaning |
|---|---|
| Accepted | Decision is current and active |
| Deprecated | No longer recommended but still exists in codebase |
| Superseded | Replaced by a newer ADR (link to replacement) |
When superseding an ADR:
Superseded by [new-adr-name.md].ai-project/decisions/ — the old content is preserved in place, not just in git historyWhen invoked with --from-todo, the workflow adapts:
| ID | Type | Prompt / Condition | Expected |
|---|---|---|---|
| ADR-T1 | Positive | "Record why we chose React over Vue" | Skill triggers |
| ADR-T2 | Positive | "Create an ADR for the API pattern" | Skill triggers |
| ADR-T3 | Positive | "Document the architecture decision" | Skill triggers |
| ADR-T4 | Negative | "How does the API work?" | Does NOT trigger (-> /explore) |
| ADR-T5 | Negative | "Add documentation to the codebase" | Does NOT trigger (-> /docs) |
| ADR-T6 | Negative | "Note this tech debt for later" | Does NOT trigger (-> /add-todo) |
| ADR-T7 | Boundary | "Why did we choose this approach?" | Context-dependent — if asking about an existing decision, route to /explore; if recording a new decision, trigger /adr |
| ADR-T8 | Positive | /adr when existing ADR will be superseded | Agent reads existing ADRs, detects superseding relationship, creates new file (does NOT reuse old filename), updates old ADR status |
| ADR-T9 | Boundary | /adr for a trivial formatting decision | Agent suggests skipping — too granular for an ADR per "When NOT to Create" |
| ADR-T10 | Boundary | /adr for a forced security patch | Agent suggests skipping — forced decision with no real alternatives |