architecture-governance
Skill0 starsChanged 55 days agoApache-2.0View on GitHub
Apply the repository's architecture policy to code changes by generating a bounded context package, checking module and layer boundaries, and reporting baseline-aware violations. Use for any code change; skip for documentation-only work.
5 other projects use a version of this, 4 of them edited.
Adopted by
Most recently taken up by
- skillpie/ZCodeOnlineedited, first seen Nov 5, 2026
- ZCodium-project/ZCodiumedited, first seen Nov 1, 2026
- ccbud/CCBuddyedited, first seen Oct 14, 2026
- zai-org/ZCodeedited, first seen Oct 8, 2026
- Cartograf666/alex-ter-vibeskillstheir own version, first seen Aug 13, 2026
Used with
Projects with it also use e2e-case-lifecycle, zcode-large-task-fixture and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ZCodium-projectSkille2e-case-lifecycle
Plan, maintain, replay, and promote ZCode desktop E2E cases and their fixtures, coverage matrices, and CI admission evidence.
Also in 3 projects that use this
ZCodium-projectSkillzcode-large-task-fixture
Generate, verify, or remove large synthetic ZCode task fixtures in local ~/.zcode persistence for UI/session performance testing. Use when testing big conversation/task rendering, task list performance, snapshot recovery, tool-call rendering, reasoning, patches, todos, and model usage without spending time chatting manually.
Also in 3 projects that use this
WillhongSkillsession-management
Also in 3 projects that use this
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 4
- zai-org/ZCode★ 8.6k49% same
- ZCodium-project/ZCodium★ 24850% same
- ccbud/CCBuddy★ 850% same
- skillpie/ZCodeOnline★ 349% same
Wrote their own version · 1
- Cartograf666/alex-ter-vibeskills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/react-best-practices/AGENTS.mdAGENTS.md
- agent-browserSkill
- ai-elementsSkill
- dep-refsSkill
- dogfoodSkill
- electronSkill
- feature-boundary-plannerSkill
- vercel-react-best-practicesSkill
The file
We split this skill into the rules it gives an agent
8 rules. 2 are common, 3 are distinctive, and 3 are very specific to this project.
2
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Run pnpm architecture:context <module-id> (or the reusable wrapper node .agents/skills/architecture-governance/scripts/context-package.mjs …
- Distinctive: line 14
Write or update the spec before implementation.
- Distinctive: line 20
Bounded context: prefer the generated reading package over copying whole implementations into the prompt.
- Distinctive: line 21
If the change crosses modules or changes state ownership, include the decision in the spec and add or update the module contract before …
- Common: line 23
Use this compact design sketch while planning stateful changes:
- Common: line 40
Keep changes inside the declared module and its allowed layer direction.
- Very specific: line 41
Run pnpm architecture:check --changed again after editing.
- Very specific: line 45
When adding source, identify its owning module.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Architecture governance
Use this skill before editing code in the ZCode repository. It is a design guide as well as a gate: the goal is to make the intended architecture obvious before code is generated, so the checker confirms a decision instead of discovering it for the first time.
Before writing code
- Identify changed files and their modules with
pnpm architecture:check --changed. - Run
pnpm architecture:context <module-id>(or the reusable wrappernode .agents/skills/architecture-governance/scripts/context-package.mjs <module-id>). Read the target contract, directly referenced contracts, and any existing relevant spec and tests before opening broad implementation files. Do not assume a documentation or test path exists; verify it in the checkout. - Write or update the spec before implementation; create its directory when needed. State the behavior, ownership, invariants, failure semantics, and migration boundary in the spec.
- Make a short design decision before coding:
- One owner: name the single component that owns each piece of mutable state. Other layers read through its contract and send commands; they do not keep a second accepted queue, cache, or derived truth.
- One path: reuse an existing command, service, hook, adapter, or contract when it already expresses the behavior. Do not create a parallel helper for the same responsibility.
- Explicit boundaries: choose the layer for every new file and the public contract for every cross-module edge. Use the module's declared
layersandlayerOrder; a file may import only its own layer or lower ones through their public surface.domainis pure (no IO, noawaiton the world),appdecides side effects through ports,adaptersexecutes them,uidepends only on this module'scontract.ts. Quick test: needsawait? not domain. Knows it is sqlite / MessagePort / a timer? adapters. - Explicit time: for asynchronous or remote behavior, write the event order, owner/lease, idempotency key, stale-result rule, replay/resume boundary, and desktop versus mobile delivery kind before implementation.
- Bounded context: prefer the generated reading package over copying whole implementations into the prompt. Read more only when a contract or test proves it is necessary.
- If the change crosses modules or changes state ownership, include the decision in the spec and add or update the module contract before implementation.
Use this compact design sketch while planning stateful changes:
input → single owner → command admission → state transition → contract/event
└── persistence / replay / projection are derived from the ownerFor remote or streaming changes, make the delivery boundary explicit:
desktop: continuous ── direct live stream ──┐
├─ same owner and sequence
mobile: replayable ─ snapshot + gap repair ┘During and after editing
- Keep changes inside the declared module and its allowed layer direction. Add a module dependency or public contract before introducing a cross-module edge.
- Run
pnpm architecture:check --changedagain after editing. Report new violations separately from baseline violations, along with changed modules, tests, state owners, event-order assumptions, and net line changes.
The executable policy is architecture-policy.yaml; do not duplicate its rules in this file or in AGENTS.md. Use pnpm architecture:baseline:update only when a reviewed change intentionally changes the accepted legacy baseline. CI never refreshes baseline automatically.
When adding source, identify its owning module. If a new managed module is required, register its roots, dependencies, layers and public entrypoints in architecture-policy.yaml, and keep the local manifest consistent with that policy. Use the existing managed modules and the fixture below as examples.
For a new managed module, provide module.ts, contract.ts, contract.example.ts, and a short CONTRACT.md. Keep runtime and persistence details behind the contract. Prefer typed service calls for one-to-one interactions, commands for state changes, and typed events for broadcast facts.
See policy-schema.md, module-contract.md, and rule-catalog.md when the change needs their detailed guidance. The golden-module fixture is the smallest compliant example. See ai-guidance.md for the anti-patterns this workflow is designed to prevent and the questions an agent must answer before proposing code.
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
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.

