agentleFS
sourcehawksourcehawk/feature-dev-workflow/skills/maintaining-architectural-coherence/SKILL.md

maintaining-architectural-coherence

Skill2 starsChanged 12 days agoMITView on GitHub

Work split across contributors drifts. Each piece is built in isolation against its own slice of the problem, so each contributor optimizes locally — and the union reads as written by a committee: two ways to structure the same thing, two error conventions, an interface shaped one way here and another there. Coherence is the property that the whole reads as one author would have written it. The trap: coherence is invisible to per-piece checks. Every PR passes its own…

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Hand them down: Every dispatched piece gets the conventions and builds against them, not against its own invention.

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

maintaining-architectural-coherence

Overview

Work split across contributors drifts. Each piece is built in isolation against its own slice of the problem, so each contributor optimizes locally — and the union reads as written by a committee: two ways to structure the same thing, two error conventions, an interface shaped one way here and another there. Coherence is the property that the whole reads as one author would have written it.

The trap: coherence is invisible to per-piece checks. Every PR passes its own review and CI; every contract and acceptance criterion is satisfied; the drift lives only in the relationships between pieces. So it has to be designed in up front and audited across the union — neither of which a single diff review does. In decomposed work that is the orchestrator's job, because the orchestrator is the only role that sees the whole surface.

The dimensions of coherence

Naming is the most visible dimension, not the only one. Read the union across all of them:

  • Structure / layout — parallel things live in parallel places; new files and packages land by one rule; no piece sits flat where a sibling nests.
  • Interfaces / API shape — sibling functions, types, and options share a shape; return / error / option conventions match; no asymmetric outlier without a recorded reason.
  • Layering / separation — the same concern is handled in the same layer across pieces (validation, auth, persistence, config access); no piece reaches across a boundary the others respect.
  • Naming — one scheme per kind of thing: files, directories, packages, types, functions, variables, constants, fixtures, tests. Plus the naming firewall below.
  • Vocabulary — the domain's locked terms, with no synonyms for the same concept.
  • Idiom — the same problem solved the same way each time: error handling, logging, config access, test layout.

The discipline

  1. Agree the conventions before dispatch. Pin the decisions every piece inherits — the dimensions above, for the surfaces this work touches — in one place (in this workflow, a plan's ## Conventions block). Most are already implied by the existing codebase; the work is writing them down so N contributors reach the same answer instead of guessing. A convention you can't state in one line isn't agreed yet — agree it before dispatch, not after merge.
  2. Hand them down. Every dispatched piece gets the conventions and builds against them, not against its own invention.
  3. Audit the union, not the pieces. Read what all the pieces shipped together and ask: would one author have written it this way? Inconsistency is a signal, not cosmetic debt — two schemes for one kind of thing, an asymmetric interface, or a structure that's fine for one file but bakes in a no-growth shape usually means a better structure is waiting. Rework toward it now; it is far cheaper than after an external reviewer hits it.

The naming firewall

Organizing labels are navigational only. They never become identifiers.

Flow 1, Phase 2, Wave 3, Part A are scaffolding the plan uses to sequence work and the tracker uses to group it. They are an artifact of how the work was decomposed — not a property of the thing being built. The moment that ordinal lands in a directory name, a runtime id, a function, a package, or a sentinel string, it has leaked: a reader of the code now has to know the planning history to parse it, and the name lies as soon as the plan is renumbered or the thing is reused.

SurfaceFlow N allowed?Name it instead by
Epic / sub-issue title proseyes (a clean prefix: Flow 2: investigation happy path)—
Plan / spec narrative and section headingsyes (it indexes the decomposition)—
Branch / PR titlenothe capability (feature/investigation-e2e)
Directory / file namenothe content or behaviour
Package / type / function / variable / constantnowhat it is or does
Fixture / scenario namenothe state or behaviour it encodes
Test namenothe behaviour under test
Sentinel / marker string, config key, env varnothe thing it marks

The firewall is a one-way membrane: a label may appear in a title or a spec heading, but nothing downstream may inherit it as a name. When you catch yourself about to write flow2-fixture, TestFlow2…, or …_FLOW2_…, that is the leak — name the thing for what it is.

Quick reference

DimensionSmellFix
Structureone piece flat, a sibling nestedone layout rule
Interfacesibling APIs shaped differentlyalign, or record why it differs
Layeringone concern handled in different layersone layer for the concern
Namingtwo schemes for one kind of thingone scheme
Namingan organizing label (Flow N) in an identifiername by what the thing is
Vocabularysynonyms for one conceptthe locked term
Idiomthe same problem solved several waysone way

Common mistakes

  • Declaring "all clean" on per-piece checks. Contracts, CI, and acceptance criteria never see cross-piece coherence. Read the union before claiming clean.
  • Deferring inconsistency as cosmetic. It is a signal that a better structure exists; rework toward it rather than shipping the drift.
  • Dispatching parallel work with no agreed conventions. Each piece invents its own layout and shape; the drift surfaces at integration, where it is expensive.
  • Auditing only names. Structure, interfaces, layering, vocabulary, and idiom drift too — and an inconsistent interface costs more than an inconsistent name.

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.