agentleFS
ayoubben18ayoubben18/ab-method/.agents/skills/sync-architecture/SKILL.md

sync-architecture

Skill192 starsChanged 2 months agoMITView on GitHub

Post-implementation documentation-sync detector. Spins up ONE read-only subagent on a completed task's diff to find everything the change introduced that the architecture docs don't yet know about — new endpoints, patterns, dependencies, domain terms, ADR-worthy decisions — routed to the exact doc each belongs in. Autonomous runs apply only append-only safe additions and defer domain/ADR reshapes; interactive runs present the proposed doc deltas to pick. Use after a task's missions are done (from create-task / start-task / start-roadmap) or standalone on a diff.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep docs/architecture/* and the domain docs live by detecting, from a completed task's diff, what the change introduced that the docs …

    line 8
  2. Distinctive:

    Look for it under the project root (the current working directory) first — a project's own copy is how it customises its paths, so it …

    line 30
  3. Very specific:

    Never document a black box as established practice: If the diff contains TODO(UQ-n) seams recorded in the task's unresolved-questions.md, …

    line 74
  4. Very specific:

    When the question is later answered via /extend-task, the resulting decision syncs like any other.

    line 81
  5. Very specific:

    Commit the doc additions as one docs(<task>): sync architecture docs (repo convention).

    line 109
  6. Distinctive:

    Never prompt in autonomous mode — anything that isn't a pure safe-add stays open for the user.

    line 116
  7. Very specific:

    Check .ab-method/structure/index.yaml for paths.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sync Architecture (post-implementation)

Keep docs/architecture/* and the domain docs live by detecting, from a completed task's diff, what the change introduced that the docs haven't caught up with — then proposing the exact doc deltas. It runs in the same post-implementation phase as ../review-implementation/SKILL.md, but asks a different question:

review-implementation asks "is this diff good code?" — this skill asks "does this diff introduce anything the docs don't yet know about?" The first is code debt; this is documentation drift.

It is the automated detection half of the manual /update-architecture workflow. Where /update-architecture is a heavy, human-invoked pass (and also runs the improve-codebase-architecture deepening loop), this skill is a lightweight detector that runs automatically after each task so the docs stop silently drifting. It reuses /update-architecture's routing table — it does not invent its own.

Silence is the default output. A task that introduced nothing doc-worthy (a bug fix, styling, a trivial CRUD following existing patterns) produces no deltas — that is the normal case. A finding survives only if the docs are genuinely now wrong or incomplete. Never invent doc churn to look thorough.

ALWAYS check .ab-method/structure/index.yaml FIRST for where the architecture and domain docs live — paths are user-configurable. Sweep only what this task changed — the cohesive diff across its missions (git diff for the commit range) plus its progress-tracker.md mission summaries. This is not a whole-repo doc audit.

Look for it under the project root (the current working directory) first — a project's own copy is how it customises its paths, so it always wins. Only if the project has none (AB Method installed as a plugin rather than with npx ab-method), read the bundled default: ../../../.ab-method/structure/index.yaml relative to this SKILL.md. Either way, every path the index names is relative to the project root, never to the folder the bundled file lives in.

Process

1. Gather diff + context

  • The changed files and their git diff for the task's commit range.
  • The task's progress-tracker.md Mission Summaries — the per-mission Files / Built / Integrates with bullets already enumerate most of what's new.
  • The current architecture + domain docs, so the detector proposes only what's genuinely missing (skip files that don't exist): docs/architecture/tech-stack.md, frontend-patterns.md, backend-patterns.md, UBIQUITOUS_LANGUAGE.md, CONTEXT.md, docs/adr/.

2. Spin up ONE read-only detector subagent

Spawn a single subagent — architecture-sync — with the diff, the mission summaries, the current docs, and the task's unresolved-questions.md if it has one. It is read-only: it returns a routed findings list (often empty) and edits nothing. Isolating it keeps the doc analysis out of the orchestrator's context. On Codex (spawn_agent is one level deep) spawn it at the orchestrator's own level; on Claude it may nest. One detector is enough — the whole point is a single sweep of the change.

Its brief — detect only what the docs don't already capture, routed with /update-architecture's table:

FindingRoutes to (update-architecture step)
New / renamed / moved endpoint, CLI command, cron, webhook, queue consumertech-stack.md Entry Points (2a) — and backend-patterns.md § API if a convention shifted
New component / service / state / auth pattern, or a pattern swappedfrontend-patterns.md / backend-patterns.md (2b)
New dependency, third-party API/queue, new limit/budget, test-framework shifttech-stack.md Stack / External Services / Constraints / Testing (2c)
New domain term used in code, or a term whose meaning shiftedUBIQUITOUS_LANGUAGE.md (+ CONTEXT.md if meaning shifted) (2d)
A hard-to-reverse, surprising, trade-off-carrying decisionADR candidate (2e) — never written inline; defer to /domain-model

For each finding return: What (the concrete thing the diff introduced, citing the file/mission), Doc (the exact target file + section), Proposed delta (the append-only line or short section to add), Class (see Step 3).

Example: "New endpoint POST /charges (src/api/charges.ts, mission 2) — not in tech-stack.md Entry Points. Proposed delta: add POST /charges — create a charge (auth: bearer) under Entry Points. Class: safe-add."

Never document a black box as established practice. If the diff contains TODO(UQ-n) seams recorded in the task's unresolved-questions.md, the placeholder behind them is provisional by construction — do not write it into tech-stack.md as a constraint, into a patterns doc as "the way we do this", or into UBIQUITOUS_LANGUAGE.md as a term. A parked question is also never an ADR candidate: an ADR records a decision that was made, and this one wasn't. The real thing the docs may be missing is what the change built around the black box (the new endpoint, the new dependency, the seam's existence) — route that normally, and describe the placeholder only as what it is, e.g. "currency is fixed to USD pending UQ-1". When the question is later answered via /extend-task, the resulting decision syncs like any other.

Out of scope — do not raise: code-quality issues (that's review-implementation), whole-repo deepening opportunities (that's /improve-codebase-architecture), or rewrites of existing prose. With nothing the docs are missing, return exactly: Docs in sync — no architecture updates needed.

3. Classify each finding

  • safe-add — an append-only addition that follows /update-architecture's "add, don't rewrite" rule: a new Entry Points line, a new dependency, a new pattern subsection, a new glossary term. Purely additive, no existing prose touched.
  • needs-judgment — anything that would change or deprecate existing prose (a pattern was swapped, a term's meaning shifted, an endpoint convention moved), a new bounded context, or an ADR candidate. These reshape the docs and belong to a human — route them to /domain-model (domain / ADR) or /update-architecture (prose deprecation), don't apply them here.

4. Act — by mode

Interactive (manual create-task tail, or standalone): present the proposed deltas grouped by target doc, each marked safe-add / needs-judgment. Apply the safe-adds the user approves; for needs-judgment findings, point at the right workflow (/domain-model, /update-architecture) rather than editing. Report what landed.

Autonomous (start-task / start-roadmap — afk): the orchestrator (not the detector) applies:

  1. Apply every safe-add to its target doc — append-only, preserving format and tone, with a ### Recent Updates (YYYY-MM-DD) block for a notable shift (per /update-architecture Step 3). Docs are prose, not code, so there is no test to re-run — but never rewrite or delete existing content; if a finding can't be expressed as a pure addition, it isn't a safe-add — leave it open.
  2. Commit the doc additions as one docs(<task>): sync architecture docs (repo convention). Nothing to add → no commit.
  3. Leave every needs-judgment finding for the user — record them in the task's review.md (the review-implementation skill's file, if it ran) under an Architecture sync heading, or in a short note in the run report. Never write an ADR and never deprecate prose autonomously — those need /domain-model / /update-architecture.

Never prompt in autonomous mode — anything that isn't a pure safe-add stays open for the user.

Key Principles

  • Documentation drift, not code quality — a distinct lens from review-implementation; the two run side by side in the post-impl phase.
  • Detection half of /update-architecture — reuses its routing table (2a–2e) and its "add, don't rewrite" rule; the full manual workflow still owns prose deprecation + the deepening loop.
  • Silent by default — most tasks introduce nothing doc-worthy; produce no deltas then.
  • Autonomous stays conservative — append-only safe-adds only; domain reshapes and ADRs are always deferred to a human, so the docs never fill with noise.
  • Scoped to the task's diff — never a whole-repo doc audit.

Remember

  • Check .ab-method/structure/index.yaml for paths.
  • The task's mission summaries already list Files / Built — start there, confirm against the diff.
  • Always check Entry Points for API drift, even when the diff didn't obviously touch routing — the most common stale-doc victim (inherited from /update-architecture).
  • Defer anything that rewrites prose, reshapes the domain, or is ADR-worthy to /domain-model / /update-architecture — this skill only adds.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.