Agent skill

Architecture Governance

by zai-org in zai-org/ZCode

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.

Apache-2.0Auto-check passedDevelopment

Install Architecture Governance

skills CLI
$ npx skills add zai-org/ZCode --skill architecture-governance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zai-org/ZCode architecture-governance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zai-org/ZCode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/architecture-governance .claude/skills/architecture-governance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
architecture-governance
GitHub stars
7.6k
Token cost
~1.2k tokens
SKILL.md length
592 words
Files
12 (incl. scripts, references)
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

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.

  • Works in 5 steps: Identify changed files and their modules… → Run pnpm architecture:context (or the… → Write or update the spec before… → …
  • Any code change
  • SKILL.md covers Before writing code and During and after editing
  • Runs TypeScript and JavaScript scripts from its folder; calls pnpm and node

What it does

Architecture Governance is an agent skill from zai-org/ZCode. 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.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 15 other files, including scripts and reference files (for example `agents/openai.yaml`, `references/ai-guidance.md` and `references/golden-module/CONTRACT.md`).

It sits in Development, covering Domain-driven design. The repository describes itself as: Z.ai's coding agent harness. Powerful, intelligent, extensible. The licence is Apache-2.0.

When your agent uses it

  • Any code change
  • Skip for documentation-only work

Example prompts

  • “/architecture-governance”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Identify changed files and their modules with pnpm architecture:check --changed.
  2. Run pnpm architecture:context (or the reusable wrapper node .agents/skills/architecture-governance/scripts/context-package.mjs ). Read the…
  3. Write or update the spec before implementation; create its directory when needed. State the behavior, ownership, invariants, failure…
  4. Make a short design decision before coding
  5. If the change crosses modules or changes state ownership, include the decision in the spec and add or update the module contract before…

What it can do on your machine

Read from SKILL.md and the folder at commit 29628c9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (TypeScript and JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • pnpm
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Architecture Governance loads about 1.2k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 592 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from zai-org/ZCode at commit 29628c9, republished under its Apache-2.0 licence (© zai-org). 592 words, ~1,247 tokens.

Download SKILL.mdSave it as .claude/skills/architecture-governance/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
architecture-governance
description
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.

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

  1. Identify changed files and their modules with pnpm architecture:check --changed.
  2. Run pnpm architecture:context <module-id> (or the reusable wrapper node .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.
  3. 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.
  4. 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 layers and layerOrder; a file may import only its own layer or lower ones through their public surface. domain is pure (no IO, no await on the world), app decides side effects through ports, adapters executes them, ui depends only on this module's contract.ts. Quick test: needs await? 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.
  5. 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:

text
input → single owner → command admission → state transition → contract/event
                  └── persistence / replay / projection are derived from the owner

For remote or streaming changes, make the delivery boundary explicit:

text
desktop: continuous ── direct live stream ──┐
                                           ├─ same owner and sequence
mobile: replayable ─ snapshot + gap repair ┘
Show full SKILL.md (214 more words)Show less

During and after editing

  1. Keep changes inside the declared module and its allowed layer direction. Add a module dependency or public contract before introducing a cross-module edge.
  2. Run pnpm architecture:check --changed again 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.

© zai-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references) in .agents/skills/architecture-governance of zai-org/ZCode.

  • SKILL.md
  • agents/openai.yaml
  • references/ai-guidance.md
  • references/golden-module/CONTRACT.md
  • references/golden-module/contract.example.ts
  • references/golden-module/contract.ts
  • references/golden-module/module.ts
  • references/module-contract.md
  • references/policy-schema.md
  • references/rule-catalog.md
  • references/troubleshooting.md
  • scripts/context-package.mjs

Open the folder on GitHubat commit 29628c9

Compare with similar skills

Architecture Governance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Architecture Governance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Architecture Governance this skillzai-org/ZCode7.6k—~1.2kAutomated safety check: PassApache-2.0
Domain Modelingfossasia/eventyay-interpretation1.6k31 repos~821Automated safety check: PassApache-2.0
Evolutionary Modular Architecturetech-leads-club/agent-skills7k—~3.7kAutomated safety check: PassCC-BY-4.0
Domain Modelingbrim-borium/spotify_sdk1665 repos~806Automated safety check: PassApache-2.0
Domain Modeling and Glossarywindmill-labs/windmill18k—~622Automated safety check: PassCustom licence
Dddswamp-club/swamp646—~1.4kAutomated safety check: PassCustom licence

Similar skills

  • Domain Modeling

    fossasia/eventyay-interpretation

    Build and sharpen a project's domain model. An agent skill from fossasia/eventyay-interpretation.

    1.6k GitHub starsUsed in 31 repos~821 tokens
    DevelopmentAuto-check passed
  • Evolutionary Modular Architecture

    tech-leads-club/agent-skills

    Guides design of modular-monolith platforms with DDD, flat-by-aggregate modules, anti-corruption layers, outbox events and resilience, plus an architecture document with SVG diagrams.

    7k GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Domain Modeling

    brim-borium/spotify_sdk

    Build and sharpen a project's domain model. An agent skill from brim-borium/spotify_sdk.

    166 GitHub starsUsed in 5 repos~806 tokens
    DevelopmentAuto-check passed
  • Domain Modeling and Glossary

    windmill-labs/windmill

    Actively challenges vague or conflicting terminology as you design, and keeps a living domain glossary file up to date in real time.

    18k GitHub stars~622 tokensUpdated today
    DevelopmentAuto-check passed
  • Ddd

    swamp-club/swamp

    Domain Driven Design guidance for TypeScript/Deno codebases.

    646 GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Migration Path

    AxonIQ/AxonFramework

    Create a new Axon Framework 4→5 migration path documentation page.

    3.6k GitHub stars~594 tokensUpdated today
    DevelopmentAuto-check passed

More from zai-org/ZCode

  • Map a ZCode behavior change to current UI surfaces, state owners, protocol commands, persistence, and validation.

    7.6k GitHub stars~1.4k tokensUpdated 11 days ago
    Auto-check passed
  • Control Browser

    zai-org/ZCode

    A skill your agent uses when opening, navigating, inspecting, testing, clicking, typing, filling, screenshotting, or verifying web pages and local HTTP targets (localhost, 127.0.0.1, ::1) inside…

    7.6k GitHub stars~4.6k tokensUpdated 11 days ago
    Auto-check passed
  • Dep Refs

    zai-org/ZCode

    A skill your agent uses when needs to inspect TypeScript export references in the z-code workspace, list exports from a file, verify whether an export is unused before deletion, investigate who…

    7.6k GitHub stars~552 tokensUpdated 11 days ago
    Auto-check passed
  • Dynamic Workflows

    zai-org/ZCode

    A skill your agent uses when writing, debugging, or resubmitting a dynamic-workflow script for the CreateWorkflow tool: choosing subagent topology, typing subagent results, fanning out over files or…

    7.6k GitHub stars~23k tokensUpdated 11 days ago
    Auto-check passed

Categories

Questions about Architecture Governance

What does Architecture Governance do?

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. Architecture Governance is an agent skill from zai-org/ZCode. 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.

When should I use Architecture Governance?

Architecture Governance fits situations like: any code change; skip for documentation-only work.

How do I install Architecture Governance in Claude Code?

Run `npx skills add zai-org/ZCode --skill architecture-governance -a claude-code`. Or copy the skill folder (.agents/skills/architecture-governance in zai-org/ZCode) into .claude/skills/architecture-governance in your project. Claude Code loads it when a task matches its description.

How do I install Architecture Governance in Codex?

Run `npx skills add zai-org/ZCode --skill architecture-governance -a codex`. Or copy the skill folder (.agents/skills/architecture-governance in zai-org/ZCode) into .agents/skills/architecture-governance in your project. Codex loads it when a task matches its description.

Can I use Architecture Governance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zai-org/ZCode --skill architecture-governance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/architecture-governance, .gemini/skills/architecture-governance, .github/skills/architecture-governance and .opencode/skills/architecture-governance in your project.

What does Architecture Governance need to run?

Going by SKILL.md and its folder, Architecture Governance needs TypeScript and JavaScript for the scripts in its folder and the command-line tools its instructions call (pnpm and node). Our summary lists: Node.js.

Does Architecture Governance access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Architecture Governance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Architecture Governance use?

Architecture Governance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Architecture Governance use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.1k tokens, read only when the agent opens those files.

What are the alternatives to Architecture Governance?

Skills that share tags, products or a category with Architecture Governance: Domain Modeling (fossasia/eventyay-interpretation, 1.6k stars), Evolutionary Modular Architecture (tech-leads-club/agent-skills, 7k stars), Domain Modeling (brim-borium/spotify_sdk, 166 stars) and Domain Modeling and Glossary (windmill-labs/windmill, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Architecture Governance?

zai-org (a GitHub organization) maintains it in zai-org/ZCode, which has 7,621 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on September 29, 2026.

Source: zai-org/ZCode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.