write-adr
Writes a numbered Architecture Decision Record (ADR) for a significant architectural choice in the HypermediaEngine project. Invoked by the software-architect agent whenever a consequential design decision is made or ratified. Saves the ADR to docs/architecture/decisions/.
- License 许可
- GPL-3.0
- 最近更新
- 2026-06-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- write-adr
- model
- claude-opus-4-7
- tools
- Read, Grep, Glob, Write
- description
- Writes a numbered Architecture Decision Record (ADR) for a significant architectural choice in the HypermediaEngine project. Invoked by the software-architect agent whenever a consequential design decision is made or ratified. Saves the ADR to docs/architecture/decisions/.
03 SKILL.md 正文
You are executing the write-adr skill on behalf of the software-architect agent. Your job is to produce a well-formed, numbered Architecture Decision Record and persist it to the repository.
Input
The calling agent will pass:
- Decision title — a short phrase naming the decision (e.g. "Use Result<T> for all service return types")
- Context and decision — a summary of what was decided and why (may come from an
architecture-designoutput or a post-implementationarchitecture-review) - Optionally: specific files, components, or requirements that motivated the decision
Process
Step 1 — Discover Existing ADRs
- Use Glob to list all files matching
docs/architecture/decisions/ADR-*.md - Find the highest existing ADR number; the new ADR number = highest + 1 (start at
ADR-0001if none exist) - Use Read on the two most recent ADRs (if any) to absorb the established tone and any cross-references
Step 2 — Ground the Decision in the Codebase
Use Grep and Read to locate the concrete artifacts this decision affects:
- Files, classes, or interfaces that implement or will implement the decision
- Existing usages of the pattern being decided on (or the pattern being superseded)
- Any related ADRs that this decision builds on or contradicts (mark those as Superseded in Step 4 if needed)
Step 3 — Draft the ADR
Produce the record using this structure:
ADR-{NNNN}: {Title}
Date: {YYYY-MM-DD} Status: Accepted Deciders: software-architect
Context
What situation, requirement, or constraint forced this decision? Describe the problem space in 3–6 sentences. Reference specific project constraints where relevant (e.g. middleware pipeline, { data, error } return shape, DI-only instantiation, async disposal).
Decision
State the decision in one clear sentence beginning with "We will…".
Then explain the chosen approach with enough detail that a new engineer understands what to do and why. Include:
- The specific pattern, component structure, or constraint being adopted
- How it integrates with the existing middleware / DI / filter architecture
- Any naming conventions or file placement rules it implies
Alternatives Considered
For each rejected option:
- Option: Name of the alternative
- Why rejected: One or two sentences — be specific, not vague
Consequences
Positive
- Bullet list of concrete benefits
Negative / Trade-offs
- Bullet list of known costs or constraints introduced
Neutral
- Bullet list of things that change but are neither good nor bad (migration steps, tooling changes, etc.)
Compliance Checklist
- [ ] All affected components identified and listed above
- [ ] Related ADRs cross-referenced (or "None" if first)
- [ ] Return shape
{ data, error }preserved where applicable - [ ] No stack traces exposed
- [ ] DI registration approach specified (if new components introduced)
- [ ] Superseded ADRs updated with
**Status**: Superseded by ADR-{NNNN}
Step 4 — Update Superseded ADRs
If this decision supersedes an existing one:
- Read the superseded ADR file
- Change its
**Status**line to**Status**: Superseded by ADR-{NNNN} - Write the updated file back
Step 5 — Save the ADR
- Ensure the directory
docs/architecture/decisions/exists (create it via Write if absent) - Write the file as
docs/architecture/decisions/ADR-{NNNN}-{kebab-case-title}.md - Report the saved path and ADR number to the calling agent
Output
Return:
- The full ADR text
- The saved file path (e.g.
docs/architecture/decisions/ADR-0003-use-result-t-for-service-returns.md) - A one-line summary: ADR-{NNNN} recorded: {title}
04 同仓库更多 Skills
write-tests
Test implementation skill for HypermediaEngine. Takes a confirmed test plan from design-test-cases and produces compilable, runnable xUnit tests following project conventions. Validates coverage quality through mutation testing. Invoked by the sqa-engineer agent after the test plan is approved.
write-documentation
Structured documentation writing workflow for HypermediaEngine. Writes or updates README.md files at the repo root and in each project directory (src/, tests/, samples/, etc.) based on current implementation, ADRs, and architecture decisions.
tunit-playwright-ui-testing
Comprehensive guidance for writing coded end-to-end UI tests in C# using TUnit.Playwright. Tests inherit from PageTest — the base class manages all browser lifecycle. Covers NuGet setup, PageTest inheritance, Page Object Model, browser configuration, parallelism limiting, and CI integration. Based on the official TUnit docs at https://tunit.dev/docs/examples/playwright.
triage
Task classification, decomposition, dependency mapping, and routing skill. Invoked by the triage-agent to break any user request into discrete, independently-routable work items with assigned priorities and agent chains.
system-design
Expert system design skill. Use PROACTIVELY to design systems, review architectures, and assist software engineers in learning design principles and implementing them in the code with design patterns.
spec-driven-development
Manages the full lifecycle of a feature specification — from collaborative drafting to enforcement during implementation and testing.