一键导入
arch-sync
Use after any ADR status change or new ADR creation to regenerate the machine-readable architecture constraints document from all ADRs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after any ADR status change or new ADR creation to regenerate the machine-readable architecture constraints document from all ADRs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use after any code, Kconfig, DTS, or config change — before committing. Runs the mandatory build + test gate for the weather-station project.
Use when adding a new library under lib/. Creates the full scaffold with Kconfig, CMakeLists.txt, header, source, and wires it into the build system. Invoke when the user says "add library", "new lib", "create library", or similar.
Use when adding a new fake sensor type to the weather-station project — a new physical quantity with a Q31 encoding. Invoke when the user says "add sensor type", "new sensor", "fake sensor", or mentions a quantity not yet supported.
Use when completing tasks, implementing major features, or before merging. Spawns parallel review agents for architecture, security, C quality, embedded, and test coverage. Invoke when the user says "review code", "code review", "check my work", or before creating a PR.
Use when running the pytest integration test suite against a built gateway. Optionally filter by marker. Invoke when the user says "run tests", "run integration tests", "test gateway", or "twister".
Use after every implementation subtask, build iteration, or when asked to audit changed code. Runs pre-commit gate, then reviews against project-specific constraints from ADRs and CLAUDE.md. Invoke when the user says "check standards", "audit code", "ADR compliance", or "standards check".
| name | arch-sync |
| description | Use after any ADR status change or new ADR creation to regenerate the machine-readable architecture constraints document from all ADRs. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Regenerate the machine-readable architecture constraints document from all ADRs. This is the bridge between ADRs (WHY decisions were made) and other agents that need to enforce those decisions (standards-check, dev-plan, arch-validate).
Argument (optional): --dry-run to preview changes without writing.
Read docs/adr/README.md. Parse the index table to extract every ADR file path and its Status column.
Expected table format:
| [ADR-NNN](ADR-NNN-kebab-title.md) | Title | Status |
Note: some entries may have Superseded by ADR-NNN in the Status column.
Read every ADR file listed in the index. For each ADR, extract:
Accepted, Proposed, Deprecated, Superseded by ADR-NNN)**Constrained:** subheading in the Consequences section. Capture verbatim or in tight paraphrase.# ADR-NNN — Title heading.If an ADR has **Status** = Superseded by ADR-NNN, extract only the title and which ADR superseded it.
Sort ADRs into three buckets:
| Bucket | Status values |
|---|---|
| Active | Accepted |
| Proposed | Proposed |
| Superseded | Superseded by ADR-NNN, Deprecated |
Proposed ADRs are documented but their constraints are NOT binding. Mark them in the output clearly.
Write docs/architecture/architecture-constraints.md with this exact structure:
# Architecture Constraints
> Auto-generated by arch-sync from N ADRs on YYYY-MM-DD.
> Do not edit manually. Run /arch-sync to regenerate.
## Active Constraints (N ADRs accepted)
| ADR | Decision | Implementation Constraints |
|---|---|---|
| [ADR-NNN](../adr/ADR-NNN-title.md) | One-sentence decision summary. | • Constraint 1 (from Consequences/Constrained) • Constraint 2 |
### Constraint reference (by topic)
Group constraints by architectural concern for easy lookup by other agents:
- **zbus / IPC:** ADR-002 — ...
- **Data model:** ADR-003 — ...
- **Sensor architecture:** ADR-004, ADR-005 — ...
- **App composition:** ADR-008 — ...
- ... (add groups as ADRs warrant)
## Proposed Decisions (N ADRs proposed)
| ADR | Title | Status |
|---|---|---|
| [ADR-NNN](../adr/ADR-NNN-title.md) | Title | Proposed |
## Superseded Decisions
| ADR | Superseded by | Title |
|---|---|---|
| [ADR-NNN](../adr/ADR-NNN-title.md) | ADR-NNN | Title |
Rules for content:
Count the ADRs in the generated file. The total must equal the number of ADRs found in the index. If the counts differ, re-read the ADRs and find the discrepancy.
Check that every ADR referenced in the "Constraint reference by topic" section has a corresponding row in the "Active Constraints" table.
Edit docs/architecture/README.md. Add a row to the index table:
| [architecture-constraints.md](architecture-constraints.md) | Auto-generated constraint summary from all ADRs |
Insert it as the first row (table position 1) so agents find it first.
If the row already exists, leave it in place — the content is auto-generated so the index entry never changes.
Print a one-line report:
docs/architecture/architecture-constraints.mdIf --dry-run: display the generated content in chat. Do not write files. Do not ask for confirmation — the dry run IS the preview.
| Feeling | Reality |
|---|---|
| "The index hasn't changed, skip it" | New ADRs change the constraint landscape. Always regenerate. |
| "I remember what ADR-003 says" | Re-read it. ADRs may have been updated. |
docs/adr/.docs/architecture/architecture-constraints.md and edit docs/architecture/README.md.standards-check, explore-adrs) can read the generated constraints file for up-to-date ADR information.Terminal state: docs/architecture/architecture-constraints.md regenerated, docs/architecture/README.md updated, counts validated.