Cupdate arch

From joshft/correctless · View interactive version

Cupdate arch is an AI agent skill from the GitHub repository joshft/correctless. Update .correctless/ARCHITECTURE.md after features land. Use after /cdocs or when the codebase structure has changed.

How to use this skill

Skill file

/cupdate-arch — Maintain Architecture Documentation

Shared constraints apply. Before executing, read _shared/constraints.md from the parent of this skill's base directory. All constraints there apply to this skill.

Intensity Gate

This skill requires effective intensity high or above. Compute effective intensity using the procedure in the shared constraints (_shared/constraints.md).

Intensity threshold: /cupdate-arch requires high minimum intensity to activate.

You are the architecture documentation agent. Your job is to keep .correctless/ARCHITECTURE.md current after features land.

Progress Visibility (MANDATORY)

Architecture updates take 5-10 minutes. The user must see progress throughout.

Before starting, create a task list:

  1. Read current architecture docs and recent specs
  2. Validate existing entries (paths, tests, producers/consumers)
  3. Scan codebase for undocumented abstractions
  4. Draft new component entries
  5. Draft new pattern entries
  6. Check size thresholds (fragmentation)
  7. Present entries for approval

Between each step, print a 1-line status: "Scanned codebase — found {N} undocumented abstractions. Drafting entries..." Mark each task complete as it finishes.

Before You Start

  1. Read current .correctless/ARCHITECTURE.md.
  2. Read recent specs in .correctless/specs/.
  3. Read verification reports in .correctless/verification/.
  4. Scan implementation source code for undocumented patterns.

Behavior

Complementarity note: /cverify detects feature-scoped staleness. /cdocs updates entries for the current feature. This skill validates ALL entries, not just those affected by a single feature.

0. Validate Existing Entries

Before scanning for undocumented entries, validate that existing .correctless/ARCHITECTURE.md entries are still accurate. For each ABS-xxx, PAT-xxx, TB-xxx, ENV-xxx entry:

  1. Enforced at paths exist on disk: verify each file path in the Enforced at field exists. When an Enforced at or Test field is empty, skip that entry's path validation.
  2. Test paths exist and reference the entry ID: verify each file path in the Test field exists, and grep it for the entry ID.
  3. Enforced at includes all producers/consumers: check whether the Enforced at paths include all files that actually reference the abstraction as producers or consumers.

Read .correctless/meta/drift-debt.json and surface open drift-debt items as candidates for entry updates or new entries. Open drift-debt items are presented alongside the validation findings. Dormant when drift-debt.json is absent or empty (PAT-019).

Entries with broken paths or missing test references are presented to the human one at a time with options:

  1. Fix (recommended) — update the entry to reflect current paths
  2. Delete — remove the entry (it's no longer relevant)
  3. Skip — investigate later

  Or type your own: ___

1. Scan for Undocumented Entries

Compare the codebase against .correctless/ARCHITECTURE.md:

2. Draft Entries

For each candidate, draft the structured entry:

Trust Boundary:

### TB-xxx: {name}
- **Crosses**: {what boundary}
- **Identity assertion**: {how identity is established}
- **Data sensitivity change**: {from → to}
- **Invariant**: {what must hold}
- **Violated when**: {condition}

Abstraction:

### ABS-xxx: {name}
- **What**: {description}
- **Invariant**: {what must hold}
- **Enforced at**: {file path}
- **Violated when**: {condition}
- **Test**: {how to check}

Pattern:

### PAT-xxx: {name}
- **Pattern**: {name}
- **Rule**: {convention}
- **Violated when**: {condition}
- **Test**: {how to check}

3. Present for Approval

Present each entry to the human one at a time. Don't batch — each entry deserves individual consideration.

4. Check Size

If .correctless/ARCHITECTURE.md exceeds ~5000 words after updates, suggest fragmentation:

Autonomous Defaults

When running in autonomous mode (mode: autonomous in prompt context), use these defaults instead of pausing for human input.

When dispatched by /cauto, return autonomous decisions in the AUTONOMOUS_DECISIONS_START/AUTONOMOUS_DECISIONS_END format provided in the task prompt.

If Something Goes Wrong

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.