Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
20f8029
chore(porch): 723 init spir
waleedkadous May 5, 2026
f7472e0
[Spec 723] Initial specification draft
waleedkadous May 5, 2026
ec414f4
[Spec 723] Specification with multi-agent review
waleedkadous May 5, 2026
585ffa9
chore(porch): 723 specify build-complete
waleedkadous May 5, 2026
77c7127
chore(porch): 723 spec-approval gate-requested
waleedkadous May 5, 2026
5075542
[Spec 723] Final approved specification
waleedkadous May 5, 2026
42b2363
[Spec 723] Address architect inline review feedback
waleedkadous May 5, 2026
586404b
chore(porch): 723 spec-approval gate-approved
waleedkadous May 5, 2026
dc2aadc
[Spec 723] Mark spec as approved (frontmatter)
waleedkadous May 5, 2026
908f629
chore(porch): 723 plan phase-transition
waleedkadous May 5, 2026
83c9ebc
[Spec 723] Initial plan draft
waleedkadous May 5, 2026
ea00f58
[Spec 723] Plan with multi-agent review
waleedkadous May 5, 2026
c0e3fcf
chore(porch): 723 plan build-complete
waleedkadous May 5, 2026
dd9a0b3
chore(porch): 723 plan review-recorded
waleedkadous May 5, 2026
f6d3102
chore(porch): 723 plan-approval gate-requested
waleedkadous May 5, 2026
1d32eef
chore(porch): 723 plan-approval gate-approved
waleedkadous May 5, 2026
3516cad
[Spec 723] Mark plan as approved (frontmatter)
waleedkadous May 5, 2026
22142ce
chore(porch): 723 plan build-complete
waleedkadous May 5, 2026
99b9f64
chore(porch): 723 implement phase-transition
waleedkadous May 5, 2026
ca003d9
[Spec 723][Phase: phase_1] feat: Author update-arch-docs skill and ri…
waleedkadous May 5, 2026
b0a7c70
chore(porch): 723 implement build-complete
waleedkadous May 5, 2026
3fccc0c
chore(porch): 723 implement review-recorded
waleedkadous May 5, 2026
cf8aac1
chore(porch): 723 advance plan phase β†’ phase_2
waleedkadous May 5, 2026
7e36d98
[Spec 723][Phase: phase_2] feat: Wire update-arch-docs into MAINTAIN …
waleedkadous May 5, 2026
98d5b31
[Spec 723][Phase: phase_2] docs: Add review doc + PR description draft
waleedkadous May 5, 2026
31df191
chore(porch): 723 implement build-complete
waleedkadous May 5, 2026
85fe6f8
chore(porch): 723 implement review-recorded
waleedkadous May 5, 2026
48b7e8f
chore(porch): 723 all plan phases complete β†’ review
waleedkadous May 5, 2026
4d6178b
[Spec 723] Add Architecture Updates / Lessons Learned Updates / Consu…
waleedkadous May 5, 2026
a4cdeae
chore(porch): 723 record PR #724
waleedkadous May 5, 2026
9a8857e
chore(porch): 723 review build-complete
waleedkadous May 5, 2026
e2d0a2d
[Spec 723] Align arch.md propagation note with framework reality
waleedkadous May 5, 2026
5ad300e
chore(porch): 723 pr gate-requested
waleedkadous May 5, 2026
75fa3b6
[Spec 723] SPIR review Step 3: name-drop update-arch-docs skill, add …
waleedkadous May 5, 2026
b94104b
chore(porch): 723 pr gate-approved
waleedkadous May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .claude/skills/update-arch-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: update-arch-docs
description: Audit, prune, and update the project's architecture documentation β€” `codev/resources/arch.md` and `codev/resources/lessons-learned.md`. Use this skill when running MAINTAIN's arch-doc step, or when asked to update / audit / prune `codev/resources/arch.md` or `codev/resources/lessons-learned.md`. The skill is opinionated about what NOT to include in these files (per-spec changelogs, exhaustive enumerations, aspirational state, duplicate meta-spec content) and ships two operating modes: diff-mode (apply a specific change) and audit-mode (propose cuts with reasons). It edits files directly via normal file-edit tooling and does not invoke destructive shell commands.
---

# update-arch-docs

This skill maintains two governance documents:

- `codev/resources/arch.md` β€” the project's architecture document.
- `codev/resources/lessons-learned.md` β€” durable engineering wisdom extracted from reviews.

It is invoked by the MAINTAIN protocol's documentation step, and ad-hoc whenever someone needs to update, audit, or prune either file. The skill is opinionated about *what does not belong* in these files. Use it whenever a doc change touches arch.md or lessons-learned.md, even if the change is just an addition.

## What this skill does NOT do

These are the patterns that have, in practice, caused arch.md and lessons-learned.md to grow without bound. Treat them as bright-line rejections during both audit-mode and diff-mode work.

### In arch.md

- **Per-file enumerations** that go stale the moment they're written. Document the *shape* of a directory and the handful of load-bearing files; do not list every file. `git ls-files` is authoritative; the doc is for orientation.
- **Per-spec changelog sections** ("Spec 0042 added X, Spec 0073 changed Y"). Architecture is current state, not history. The git log + the spec/review documents own the changelog framing.
- **Specs/plans tables** that mirror the contents of `codev/specs/` and `codev/plans/`. These are duplicative and rot quickly. Link to the directory; do not paginate it into the doc.
- **Aspirational state** ("we plan to…", "in the next phase we'll…"). That belongs in the relevant meta-spec or roadmap doc, not in the architecture body. arch.md describes what *is*, not what *might be*.
- **Date-stamped narrative** ("As of 2026-Q2, the system uses…"). Dates make the doc look fresh while making it harder to maintain. Use git log + commit dates for temporal context.
- **Duplication of meta-spec content**. If a subsystem has its own meta-spec under `codev/architecture/<domain>.md` or under `codev/specs/`, arch.md should carry a 1-paragraph summary plus a pointer β€” not a copy.
- **Retired-component graveyards**. When a component is removed, delete its section. `git log` retains history; an arch.md that describes things that no longer exist is misleading.

### In lessons-learned.md

- **Spec-narrow recipes** that only matter inside the originating feature ("In spec 0073 we found that the rate limiter needs X"). These belong in the spec's review document, not in lessons-learned.md. lessons-learned.md captures patterns that apply *across* specs.
- **Multi-paragraph entries**. If a lesson needs more than 1–3 sentences to land, it is either two lessons fused together or it is documentation that belongs elsewhere.
- **Duplicate adjacent entries**. Fold variations of the same lesson into one entry. Two entries that say the same thing are louder, not clearer.
- **Spec-numbered narrative entries** ("Lesson from #0468:…"). Link to the review if needed; the lesson itself should be stated as a general principle.

### In either file (process)

- **Destructive shell commands**. The skill must not invoke `rm -rf`, `git rm`, or destructive `sed` scripts. All edits go through the normal Edit tool. The MAINTAIN PR diff is the human-confirmation step; that's enough.

## arch.md vs. lessons-learned.md (two-doc framing)

Treat the two files as siblings with different purposes. When in doubt about which file a fact belongs in, route by purpose:

| Purpose | Goes in |
|---|---|
| Current system shape β€” services, transports, key mental models | `arch.md` |
| Mechanism for a unique subsystem | `arch.md` (subsystem section) β€” or its own meta-spec if the mechanism is large enough to warrant one, with arch.md keeping a 1-paragraph summary + pointer |
| Pointers ("see meta-spec X for details") | `arch.md` |
| A durable engineering pattern that applies across multiple specs | `lessons-learned.md` |
| A system-shape surprise verified-wrong in production ("looks like X but isn't") | `arch.md` Β§ "Verified-Wrong Assumptions" β€” *not* lessons-learned.md, because it's a property of the system, not a general pattern |

The "system-shape surprise" routing is the one most often gotten wrong. If a future reader needs to know "the system *looks* like X but actually does Y", that is system shape and lives in arch.md. If they need to know "we learned that doing X is generally a bad idea", that is engineering wisdom and lives in lessons-learned.md.

## Sizing by purpose, not by line count

There is no line-count budget for either file. The right size for each section is determined by what the section needs to do. If a subsystem genuinely has unique mechanism that takes 80 lines to explain clearly, 80 lines is the right size. If a subsystem can be described in 5 lines and a pointer to a meta-spec, 5 lines is right.

What's *wrong* is bulk that comes from any of the patterns in "What this skill does NOT do" above. Strip those, and the file's size will land where it belongs.

When proposing a section, ask: "Could a future reader skip this section without losing anything load-bearing?" If yes, the section should not exist. The doc's purpose is orientation, not completeness.

## Mode: diff-mode (apply a specific change)

Use diff-mode when the request is specific: "add a section about the new caching layer," "update the Glossary entry for Tower," "remove the reference to the deleted dashboard-server."

In diff-mode:

1. Find the smallest section that needs to change.
2. Apply the change via the Edit tool.
3. If the change adds new content, run a quick sanity check against "What this skill does NOT do" before saving β€” make sure the new content is current state, not aspirational; not duplicative of a meta-spec; not a per-spec changelog entry.
4. Surface the resulting diff for review.

Diff-mode is fast. It is the right mode for ~80% of post-MAINTAIN documentation work.

## Mode: audit-mode (identify what to cut)

Use audit-mode when the request is general: "the doc feels stale," "MAINTAIN says it's time to prune," "review arch.md against the principles."

In audit-mode:

1. Read the file end-to-end.
2. For each section in arch.md, run through the per-section pruning checklist (from the MAINTAIN protocol):
- Does it describe *current state*? If aspirational, the section moves to a meta-spec; the arch.md keeps a 1-paragraph summary + pointer (or nothing, if the meta-spec stands on its own).
- Does it duplicate a meta-spec? If yes, replace with a 1-paragraph summary + pointer.
- Is it a per-file enumeration that's gone stale? If yes, prune to the directory shape + a few key files.
- Is it a changelog/narrative section ("Spec 0042 added X")? If yes, absorb the architecturally-relevant facts and remove the spec-numbered framing.
- Is the component still alive? If retired, delete the section entirely.
3. For each entry in lessons-learned.md, run the per-entry checklist:
- Is it cross-applicable beyond the spec that produced it? If no, remove (the lesson belongs in the spec's review).
- Is it terse (1–3 sentences)? If multi-paragraph, split or compress.
- Is the topic section the right one? If filed under "Architecture (continued)" or a spec-numbered section, move it to the right topical home.
- Is it a duplicate of an adjacent entry? If yes, fold them.
4. **When in doubt, KEEP.** This rule comes from the MAINTAIN protocol and applies in audit-mode too. A confident cut is better than three speculative ones. Bias toward fewer, higher-confidence proposals with clear rationale; do not chase a maximum cut count.
5. Apply the cuts via the Edit tool β€” the skill does not produce a "candidate-cuts list and stop." The diff *is* the proposal. The MAINTAIN PR review is the human-confirmation step.
6. Surface a short reason alongside each cut in the run file (`codev/maintain/NNNN.md`) so PR reviewers can evaluate intent ("removed because: per-spec changelog framing"; "compressed because: duplicates the orchestrator meta-spec").

Audit-mode is slower than diff-mode and produces larger diffs. Reserve it for explicit audit invocations, not for routine doc updates.

## Output contract

The skill commits to the following:

- It edits `codev/resources/arch.md` and `codev/resources/lessons-learned.md` directly via the Edit tool.
- It does not invoke destructive shell commands (no `rm -rf`, no `git rm`, no destructive `sed`). File deletions happen only through Edit removing the relevant content; whole-file removal would be a structural change that is out of scope for this skill.
- In audit-mode, every removal is paired with a one-line reason in the MAINTAIN run file's `## Audit Findings` section. Rationale lives there so reviewers can evaluate intent without re-deriving it from the diff.
- The skill does not modify other files (specs, plans, reviews, source code). If a fact belongs somewhere else, the skill flags it; it does not move it.
- The skill does not edit live arch.md or lessons-learned.md content as a side effect of being read or invoked β€” only when the user/MAINTAIN protocol explicitly asks for an update or audit.
107 changes: 107 additions & 0 deletions codev-skeleton/.claude/skills/update-arch-docs/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: update-arch-docs
description: Audit, prune, and update the project's architecture documentation β€” `codev/resources/arch.md` and `codev/resources/lessons-learned.md`. Use this skill when running MAINTAIN's arch-doc step, or when asked to update / audit / prune `codev/resources/arch.md` or `codev/resources/lessons-learned.md`. The skill is opinionated about what NOT to include in these files (per-spec changelogs, exhaustive enumerations, aspirational state, duplicate meta-spec content) and ships two operating modes: diff-mode (apply a specific change) and audit-mode (propose cuts with reasons). It edits files directly via normal file-edit tooling and does not invoke destructive shell commands.
---

# update-arch-docs

This skill maintains two governance documents:

- `codev/resources/arch.md` β€” the project's architecture document.
- `codev/resources/lessons-learned.md` β€” durable engineering wisdom extracted from reviews.

It is invoked by the MAINTAIN protocol's documentation step, and ad-hoc whenever someone needs to update, audit, or prune either file. The skill is opinionated about *what does not belong* in these files. Use it whenever a doc change touches arch.md or lessons-learned.md, even if the change is just an addition.

## What this skill does NOT do

These are the patterns that have, in practice, caused arch.md and lessons-learned.md to grow without bound. Treat them as bright-line rejections during both audit-mode and diff-mode work.

### In arch.md

- **Per-file enumerations** that go stale the moment they're written. Document the *shape* of a directory and the handful of load-bearing files; do not list every file. `git ls-files` is authoritative; the doc is for orientation.
- **Per-spec changelog sections** ("Spec 0042 added X, Spec 0073 changed Y"). Architecture is current state, not history. The git log + the spec/review documents own the changelog framing.
- **Specs/plans tables** that mirror the contents of `codev/specs/` and `codev/plans/`. These are duplicative and rot quickly. Link to the directory; do not paginate it into the doc.
- **Aspirational state** ("we plan to…", "in the next phase we'll…"). That belongs in the relevant meta-spec or roadmap doc, not in the architecture body. arch.md describes what *is*, not what *might be*.
- **Date-stamped narrative** ("As of 2026-Q2, the system uses…"). Dates make the doc look fresh while making it harder to maintain. Use git log + commit dates for temporal context.
- **Duplication of meta-spec content**. If a subsystem has its own meta-spec under `codev/architecture/<domain>.md` or under `codev/specs/`, arch.md should carry a 1-paragraph summary plus a pointer β€” not a copy.
- **Retired-component graveyards**. When a component is removed, delete its section. `git log` retains history; an arch.md that describes things that no longer exist is misleading.

### In lessons-learned.md

- **Spec-narrow recipes** that only matter inside the originating feature ("In spec 0073 we found that the rate limiter needs X"). These belong in the spec's review document, not in lessons-learned.md. lessons-learned.md captures patterns that apply *across* specs.
- **Multi-paragraph entries**. If a lesson needs more than 1–3 sentences to land, it is either two lessons fused together or it is documentation that belongs elsewhere.
- **Duplicate adjacent entries**. Fold variations of the same lesson into one entry. Two entries that say the same thing are louder, not clearer.
- **Spec-numbered narrative entries** ("Lesson from #0468:…"). Link to the review if needed; the lesson itself should be stated as a general principle.

### In either file (process)

- **Destructive shell commands**. The skill must not invoke `rm -rf`, `git rm`, or destructive `sed` scripts. All edits go through the normal Edit tool. The MAINTAIN PR diff is the human-confirmation step; that's enough.

## arch.md vs. lessons-learned.md (two-doc framing)

Treat the two files as siblings with different purposes. When in doubt about which file a fact belongs in, route by purpose:

| Purpose | Goes in |
|---|---|
| Current system shape β€” services, transports, key mental models | `arch.md` |
| Mechanism for a unique subsystem | `arch.md` (subsystem section) β€” or its own meta-spec if the mechanism is large enough to warrant one, with arch.md keeping a 1-paragraph summary + pointer |
| Pointers ("see meta-spec X for details") | `arch.md` |
| A durable engineering pattern that applies across multiple specs | `lessons-learned.md` |
| A system-shape surprise verified-wrong in production ("looks like X but isn't") | `arch.md` Β§ "Verified-Wrong Assumptions" β€” *not* lessons-learned.md, because it's a property of the system, not a general pattern |

The "system-shape surprise" routing is the one most often gotten wrong. If a future reader needs to know "the system *looks* like X but actually does Y", that is system shape and lives in arch.md. If they need to know "we learned that doing X is generally a bad idea", that is engineering wisdom and lives in lessons-learned.md.

## Sizing by purpose, not by line count

There is no line-count budget for either file. The right size for each section is determined by what the section needs to do. If a subsystem genuinely has unique mechanism that takes 80 lines to explain clearly, 80 lines is the right size. If a subsystem can be described in 5 lines and a pointer to a meta-spec, 5 lines is right.

What's *wrong* is bulk that comes from any of the patterns in "What this skill does NOT do" above. Strip those, and the file's size will land where it belongs.

When proposing a section, ask: "Could a future reader skip this section without losing anything load-bearing?" If yes, the section should not exist. The doc's purpose is orientation, not completeness.

## Mode: diff-mode (apply a specific change)

Use diff-mode when the request is specific: "add a section about the new caching layer," "update the Glossary entry for Tower," "remove the reference to the deleted dashboard-server."

In diff-mode:

1. Find the smallest section that needs to change.
2. Apply the change via the Edit tool.
3. If the change adds new content, run a quick sanity check against "What this skill does NOT do" before saving β€” make sure the new content is current state, not aspirational; not duplicative of a meta-spec; not a per-spec changelog entry.
4. Surface the resulting diff for review.

Diff-mode is fast. It is the right mode for ~80% of post-MAINTAIN documentation work.

## Mode: audit-mode (identify what to cut)

Use audit-mode when the request is general: "the doc feels stale," "MAINTAIN says it's time to prune," "review arch.md against the principles."

In audit-mode:

1. Read the file end-to-end.
2. For each section in arch.md, run through the per-section pruning checklist (from the MAINTAIN protocol):
- Does it describe *current state*? If aspirational, the section moves to a meta-spec; the arch.md keeps a 1-paragraph summary + pointer (or nothing, if the meta-spec stands on its own).
- Does it duplicate a meta-spec? If yes, replace with a 1-paragraph summary + pointer.
- Is it a per-file enumeration that's gone stale? If yes, prune to the directory shape + a few key files.
- Is it a changelog/narrative section ("Spec 0042 added X")? If yes, absorb the architecturally-relevant facts and remove the spec-numbered framing.
- Is the component still alive? If retired, delete the section entirely.
3. For each entry in lessons-learned.md, run the per-entry checklist:
- Is it cross-applicable beyond the spec that produced it? If no, remove (the lesson belongs in the spec's review).
- Is it terse (1–3 sentences)? If multi-paragraph, split or compress.
- Is the topic section the right one? If filed under "Architecture (continued)" or a spec-numbered section, move it to the right topical home.
- Is it a duplicate of an adjacent entry? If yes, fold them.
4. **When in doubt, KEEP.** This rule comes from the MAINTAIN protocol and applies in audit-mode too. A confident cut is better than three speculative ones. Bias toward fewer, higher-confidence proposals with clear rationale; do not chase a maximum cut count.
5. Apply the cuts via the Edit tool β€” the skill does not produce a "candidate-cuts list and stop." The diff *is* the proposal. The MAINTAIN PR review is the human-confirmation step.
6. Surface a short reason alongside each cut in the run file (`codev/maintain/NNNN.md`) so PR reviewers can evaluate intent ("removed because: per-spec changelog framing"; "compressed because: duplicates the orchestrator meta-spec").

Audit-mode is slower than diff-mode and produces larger diffs. Reserve it for explicit audit invocations, not for routine doc updates.

## Output contract

The skill commits to the following:

- It edits `codev/resources/arch.md` and `codev/resources/lessons-learned.md` directly via the Edit tool.
- It does not invoke destructive shell commands (no `rm -rf`, no `git rm`, no destructive `sed`). File deletions happen only through Edit removing the relevant content; whole-file removal would be a structural change that is out of scope for this skill.
- In audit-mode, every removal is paired with a one-line reason in the MAINTAIN run file's `## Audit Findings` section. Rationale lives there so reviewers can evaluate intent without re-deriving it from the diff.
- The skill does not modify other files (specs, plans, reviews, source code). If a fact belongs somewhere else, the skill flags it; it does not move it.
- The skill does not edit live arch.md or lessons-learned.md content as a side effect of being read or invoked β€” only when the user/MAINTAIN protocol explicitly asks for an update or audit.
Loading
Loading