src/skills/x-update-architecture/SKILL.md
Incrementally updates the service or system architecture document; never regenerative.
npx skillsauth add edercnj/ia-dev-environment x-update-architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Incrementally updates an architecture document from project artifacts, in two scopes that share one invariant — never regenerative (RULE-008: existing content is only inserted or appended, never removed or rewritten):
--scope service (default) — updates the service architecture doc
(steering/service-architecture.md) from a per-story architecture plan.--scope system — updates the system architecture doc (docs/architecture/system.md)
after a feature completes, via <!-- AUTO-FILL --> markers (Sections 1-10) + a Decision
Log append with ## ID: marker dedup (§11)./x-update-architecture <STORY-ID> — update the service doc from the story's architecture plan (default scope)./x-update-architecture <architecture-plan-path> — update the service doc from a specific plan file./x-update-architecture <FEATURE-ID> --scope system — update the system doc from the feature's artifacts./x-update-architecture <FEATURE-ID> --scope system --dry-run — preview the system-doc diff without writing.x-implement-story; system scope runs after the final feature PR (x-close-feature) merges.| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| <input> | String | Yes | — | Service scope: STORY-ID or architecture-plan-path. System scope: FEATURE-ID (4-digit, e.g. 0099; feature- prefix accepted). |
| --scope | Enum | No | service | service → steering/service-architecture.md; system → docs/architecture/system.md. |
| --system-md-path | String | No | docs/architecture/system.md | (system scope) Override path to the system architecture doc. |
| --dry-run | Boolean | No | false | (system scope) Print the diff without writing. |
Dispatch on --scope. Full step-by-step procedures live in
references/full-protocol.md.
--scope service (references/full-protocol.md §Scope service):
steering/service-architecture.md (create from
_TEMPLATE-SERVICE-ARCHITECTURE.md if absent).general-purpose Documentation Engineer subagent.--scope system (references/full-protocol.md §Scope system):
system.md exists; locate .aikittools/features/feature-<ID>-*/).Edit, deduped by the ## ID: feature-<ID> marker.<!-- AUTO-FILL: <key> --> markers in Sections 1-10,
guarded by SHA-256 content-hash checks.--dry-run prints the diff and exits without writing.Both scopes are idempotent: re-running with the same input yields a byte-identical document.
| Scope | Scenario | Action |
|-------|----------|--------|
| service | Architecture plan not found | Skip with log: "No architecture plan found; skipping architecture doc update" |
| service | Service architecture doc not found | Create from template (Document Creation from Scratch) |
| service | Template not found | Use inline fallback structure, log warning |
| service | Section heading mismatch | Match by numeric prefix, warn if heading text differs |
| service | Merge conflict in Mermaid diagram | Preserve both versions, add comment marking conflict |
| system | SYSTEM_MD_MISSING | docs/architecture/system.md (or --system-md-path) not found → abort |
| system | FEATURE_DIR_MISSING | .aikittools/features/feature-<ID>-*/ not found → abort |
| system | No architectural decisions detected | INFO log; exit 0 without modifying system.md |
| Skill | Relationship | Context |
|-------|-------------|---------|
| x-implement-story | called-by | Service scope invoked during Phase 3 (Documentation). |
| x-close-feature | called-by | System scope invoked after the final feature PR merges. |
| x-generate-docs | called-by | May invoke the system scope as one of its doc targets. |
| x-validate-docs | peer | Freshness gate that references the system architecture doc. |
| x-internal-plan-arch-story | reads | Generates the input architecture plans consumed by the service scope. |
| x-generate-adr | calls | Service scope may trigger ADR generation for new architectural decisions. |
Notes: Rule 45 (CI-Watch) not applicable — this skill does not create PRs.
_TEMPLATE-ARCHITECTURE-SYSTEM.md should carry <!-- AUTO-FILL: <key> --> markers at the
appropriate section locations to enable the system-scope surgical inserts.
| Pack | Files | Purpose |
|------|-------|---------|
| architecture | patterns/backend/software-architecture/hexagonal/patterns.md | Architecture principles and patterns |
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.
testing
DAST gate: ZAP + Nuclei (passive/active); SARIF + Markdown; blocks on HIGH/CRITICAL.