Imported from acgs-ai/ACGS (
.agents/skills/govern-zone/SKILL.md). Install upstream withnpx skills add acgs-ai/ACGS --skill govern-zone. Copyright stays with the author.
govern-zone Development Patterns
Originally generated from repository analysis; maintained by hand since — there is no generator for this file.
Overview
This skill covers the core development patterns, coding conventions, and operational workflows for the govern-zone repository. The codebase is primarily Python (with some frontend JavaScript/TypeScript), organized as a monorepo with multiple Python packages and a frontend app. It emphasizes strong workspace hygiene, contract-driven development, and robust CI/CD practices. This guide will help you contribute new features, maintain packages, manage readiness evidence, and keep the repository clean and production-ready.
CLAUDE.md and AGENTS.md at the repo root are authoritative, and MONOREPO.md is the
registry of record for what exists and what is gated where. Where this skill and a
package-local CLAUDE.md / AGENTS.md disagree, the package-local file wins inside its own
directory.
Hard Constraints
Read these before changing anything. They are not style preferences.
- Constitutional hashes are sealed. Files carrying a constitutional-hash marker,
@generated,DO NOT EDIT, or lock-file semantics must not be hand-edited. Change the generator and regenerate;scripts/verify_constitutional_hashes.pygates every PR. - Nested git repos are real boundaries.
packages/acgs-lite,packages/Acgs-Swarm,packages/clinicalguard, andpackages/ACGS-agency-agentsare independent repos registered in.gitmodules. Rungit add/git commitfrom inside the package, never from the parent. Parent gitlink pointer drift is out of scope unless that is the task.packages/acgs-control-planeis not among them — it is an ordinary tracked directory (040000 tree), so stage it from the parent like any other path. Confirm against.gitmodulesandgit ls-treerather than assuming; extraction to a submodule is proposed but not landed. acgs-liteis published to PyPI. Do not break its public API or its publishedrequires-python = ">=3.10"floor. The workspace-local floor is 3.11; the difference is deliberate.- The console origin is privileged. Never extend public-only patterns (CDN fonts,
third-party scripts, anonymous endpoints) into
acgi-ai/src/routes/console/**. Seeacgi-ai/CLAUDE.mdandacgi-ai/DEPLOY.md§4–§7. - Never weaken fail-closed governance. Do not bypass receipt validation, let execution
precede audit, treat
DENY/ESCALATEas executable, or drop actor/action/policy binding checks. - Claim safety. Never describe ACGS as compliance-certified, regulator-approved, formally verified, or production-ready without external evidence. Safe wording: "local receipt-gated kernel", "alpha / production-shaped foundation", "tamper-evident JSONL audit chain", "opt-in Ed25519 signing mode". Numeric claims (test counts, benchmarks) require literal command output.
- Stage explicit paths only. Never
git add -Aorgit add .in this workspace.git pushandgh releaseare human-gated — prepare the branch and hand off.
Verification Gates
Run the package-local gate before claiming work complete. A passing unit test does not prove handler wiring — trace one request from the dispatcher to the handler.
# Root documentation smoke
uv run python -m pytest tests/docs --import-mode=importlib -q
# gove-zone runtime — the main kernel gate
uv run --package gove-zone python -m pytest packages/gove-zone/tests --import-mode=importlib -q
# Root docs invariants
make lint-docs
# Frontend / console — run inside acgi-ai/
pnpm run lint && pnpm run typecheck && pnpm run test
# Whole workspace — only when intentionally validating every package
make verify
Fast kernel proof commands:
tmp=$(mktemp -d) && uv run --package gove-zone gove-zone smoke --audit "$tmp/smoke-audit.jsonl"
uv run --package gove-zone python packages/gove-zone/examples/receipt-gated-execution/demo.py
uv run --package gove-zone python examples/tamper_demo/demo.py
Coding Conventions
File Naming
- Python modules:
snake_case, with a leading underscore for private helpers.- Example:
replay_store.py,benchmark_adapters.py,_locking.py
- Example:
- Python package directories: kebab-case on disk,
snake_casefor the importable module.- Example:
packages/gove-zone/src/gove_zone/
- Example:
- Frontend (JS/TS):
PascalCase.tsxfor React components,camelCase.tsfor modules.- Example:
UserDashboard.tsx,src/api/client.ts
- Example:
Imports
- Python: Use relative imports within packages.
from .utils import fetch_data - Frontend: Standard ES module imports, often relative.
import { fetchUser } from './api/client'
Exports
- Python: Named exports via explicit imports in
__init__.py.# __init__.py from .replay_store import ReplayStore - Frontend: Named exports.
export function useUserData() { ... }
Commit Patterns
- Conventional Commits:
feat,fix,docs,test,chore,ci,refactor, with an optional scope. (implappears a handful of times in older history; do not use it.) - Example:
fix(gateway): correct package registration in pyproject.toml - The default branch is
master, notmain. Open PRs with--base master.
Workflows
Add New Workspace Python Package
Trigger: When introducing a new governed agent runtime or analyzer package.
Command: /new-python-package
- Create a new directory under
packages/{package}/. - Add
pyproject.toml,README.md,.gitignore, andMakefile. - Implement source files in
src/{package}/. - Add tests in
tests/. - Register the package in the root
pyproject.tomlunder[tool.uv.workspace].members. - Update
tests/test_monorepo_invariants.pyto include the new member. - Add or update
.github/workflows/python-{package}.ymlfor CI.
Example:
mkdir -p packages/my-new-agent/src/my_new_agent
touch packages/my-new-agent/pyproject.toml
echo "# My New Agent" > packages/my-new-agent/README.md
# ...etc
Add New Frontend Console Surface
Trigger: When adding a new operator-facing page or feature to the acgi-ai console.
Command: /new-console-page
- Create a new route file in
acgi-ai/src/routes/console/{Feature}.tsx. - Register the route in
acgi-ai/src/routes/Console.tsx(and sometimesApp.tsx). A new page without routing plumbing in the same commit is an orphan and will be rejected. - Update or add API client in
src/api/client.tsand types insrc/api/types.ts. - Add React Query hooks in
src/api/hooks.ts. - Add or update MSW mock data and handlers in
src/mocks/data/andsrc/mocks/handlers.ts. - Add or update CSS in
src/App.css. - Add/extend invariant or smoke scripts in
scripts/. - Update
package.jsontest scripts if needed.
Example:
// acgi-ai/src/routes/console/MyFeature.tsx
export function MyFeaturePage() {
// ...
}
Spec, Plan, and Implement Feature with Contracts and Tests
Trigger: When delivering a new major feature with traceable requirements and acceptance.
Command: /new-feature-spec-plan
- Draft feature spec and requirements in
specs/{feature}/. - Write implementation plan, data model, and contracts (JSON Schema, OpenAPI).
- Add
tasks.mdwith granular task breakdown. - Implement backend package (see "Add New Workspace Python Package").
- Implement frontend surface (see "Add New Frontend Console Surface").
- Add/extend tests for backend and frontend.
- Add/extend acceptance/README.md documenting evidence and acceptance.
- Update readiness docs and evidence packet.
Example:
# specs/agent-bus-analysis/spec.md
## Overview
...
CI Gate Tighten or Fix
Trigger: When fixing failing CI, aligning root/package gates, or updating verification scope.
Command: /ci-align
- Update
Makefileto include/exclude packages in lint/test/typecheck fan-out. - Update root
pyproject.tomlworkspace.members. - Update or add
.github/workflows/*.ymlfor affected packages. - Update
tests/test_monorepo_invariants.pyto match current package inventory. - Fix or update package-level test/lint/typecheck scripts as needed.
A required status check is satisfied by success, skipped, or neutral. A job skipped
by an if: conditional reports Success and will not block a merge. Read the run; never treat
a green context as proof the gate executed.
Change Receipt, Policy, Audit, Signing, or Executor Behavior
Trigger: When touching the security-sensitive modules under
packages/gove-zone/src/gove_zone/ — receipt, executor, kernel, audit, replay,
replay_store, signing, policy, tenant, integration.
- Read the implementation and its tests before touching any claim.
- Add or update negative-path tests asserting the guarded side effect did not run — an empty call list, not merely a raised exception.
- Prove dispatcher-level wiring, not just direct unit calls.
- Run the gove-zone package gate.
- Only then update
docs/DECISION_RECEIPT_SPEC.md,docs/SECURITY_MODEL.md, anddocs/CLAIMS.md. - State explicitly whether unsigned mode, signing mode, policy-bundle binding, expiry, actor binding, audit replay, or executor enforcement changed.
Add or Update Readiness Evidence and Boundaries
Trigger: When updating readiness docs, adding evidence, or changing preflight/launch gating.
Command: /refresh-readiness-evidence
- Update
docs/readiness-evidence-matrix-*.mdanddocs/readiness-evidence-packet-*.md. - Update scripts like
scripts/build_release_evidence.pyandscripts/platform_readiness_report.py. - Update or add tests for readiness evidence and preflight in
tests/. - Update
acgi-ai/DEPLOY.md,PRODUCTION-LAUNCH.md, and related docs. - Add or update Makefile targets for evidence/report generation.
Readiness gates assert literal doc strings. If a gate fails after a doc edit, restore the literal — never edit the gate to match the new prose.
Update or Add .gitignore for Tool or Build Artifacts
Trigger: When preventing accidental commit of tool outputs, caches, or local artifacts.
Command: /update-gitignore
- Edit
.gitignoreorpackages/{package}/.gitignoreto add new patterns. - Document rationale in commit message.
- Review with
git statusor similar.
Example:
# .gitignore
__pycache__/
*.pyc
dist/
Remove or Extract Inactive or Experimental Package
Trigger: When cleaning up the workspace by removing unmaintained or experimental packages.
Command: /remove-package
- Delete the package directory and all files under it.
- Remove the package from root
pyproject.tomlworkspace.members if present. - Update docs or manifests referencing the package.
- Archive externally if needed.
- If extracting to a private repo, register it in
.gitmodulesand confirm the CISUBMODULE_TOKENcarries Contents: Read on the new repo before merging — otherwise the submodule-aware gates red every subsequent PR.
Testing Patterns
- Framework: vitest (frontend JS/TS), pytest (Python)
- Pattern: frontend tests are
*.test.ts/*.test.tsx; Python tests aretest_*.py - Python: Tests are placed in
tests/directories within each package and at the repo root for monorepo invariants. - Example (TS):
// receipt.test.ts import { expect, test } from 'vitest' import { formatReceipt } from './receipt' test('formats a denied receipt', () => { expect(formatReceipt({ decision: 'DENY' })).toContain('DENY') }) - Example (Python):
# packages/gove-zone/tests/test_replay_store.py from gove_zone.replay_store import ReplayStore def test_replay_store_rejects_tampered_chain() -> None: ...
Commands
| Command | Purpose |
|---|---|
| /new-python-package | Scaffold and register a new Python package in the workspace |
| /new-console-page | Add a new operator-facing console page or feature |
| /new-feature-spec-plan | Deliver a new feature from spec to acceptance |
| /ci-align | Align or fix CI gates, Makefile, and invariants |
| /refresh-readiness-evidence | Update readiness docs, evidence, and preflight scripts |
| /update-gitignore | Add or update .gitignore for tool/build artifacts |
| /remove-package | Remove or extract an inactive or experimental package |