Skip to content
Back to skills

Gov Program

BSecurity

Governs a whole architecture as one design doc plus child ADRs that cover it fully, researching each step. Use when the user says "design this system with ADRs" or "split this design into ADRs". Not for one decision (use govern).

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
ai-agentsrustgobashgitapi

Works with

  • api

Security analysis

B75/100
  • criticalSends environment variables or credentials to an external URL

Pro scans all 7 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add DoctorMozg/claude-pipelines --skill gov-program --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gov Program?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gov Program
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/doctormozg-gov-program/badge)](https://www.skillsdirectory.com/skills/doctormozg-gov-program)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gov-program
description: 'Governs a whole architecture as one design doc plus child ADRs that cover it fully, researching each step. Use when the user says "design this system with ADRs" or "split this design into ADRs". Not for one decision (use govern).'
argument-hint: <goal> | from:<design doc or proposal path> | resume[:<task_name>]
allowed-tools: Agent(gov-router), Agent(gov-provenance-recorder), Agent(gov-decomposer), Agent(gov-critic-alternatives), Agent(gov-critic-reversibility), Agent(gov-critic-blast-radius), Agent(gov-critic-assumptions), Agent(gov-critic-quick), Agent(gov-discussion-synthesizer), Agent(gov-critic-consistency), Agent(gov-design-composer), Agent(gov-coverage-auditor), Agent(gov-coverage-prober), Agent(gov-coverage-answerer), Agent(gov-artifact-writer), Agent(pipeline-researcher), Agent(pipeline-web-researcher), AskUserQuestion, Read, Write, Edit, Bash(${CLAUDE_PLUGIN_ROOT}/scripts/gov-program.sh *), Bash(git rev-parse *), Bash(mkdir *), Bash(date *), Bash(printf *), Bash(mv *), Glob, Grep
---

# Gov Program: An Architecture as a Design Doc and Its ADRs

## Overview

A design doc is a collection of decisions. This skill takes a goal, or an existing design doc or proposal, and records it so the ADRs cover the doc completely: every statement in the finished doc is a decision recorded in an ADR or a given with a source, and no question the doc answers is left that its ADRs can't. It interviews the user once, researches the code, prior art and the outside APIs involved, splits the architecture into a decision ledger (Gate 1), researches and drafts each decision as a child ADR through `govern`'s critic panel, checks the ADRs against each other, composes the design doc from them, and proves coverage with a claim audit and a blind probe. Nothing is recorded until a human approves every artifact (Gate 2). After that, the ADRs are the source of truth, and `/gov-design-sync` rebuilds the doc when they change.

## When to Use

- A new system or subsystem whose design will rest on several decisions: "design the comment-reply service and record the decisions".
- An existing design doc or proposal to turn into ADRs plus a doc built from them: `from:docs/design/0001-x.md`.
- A design doc whose decisions were never recorded, where the user wants each one reviewed.

### When NOT to use

- One decision: use `govern`. It can link the new ADR to a design doc with `Part of`.
- ADRs changed and the design doc fell behind: use `gov-design-sync`.
- Reviewing existing records: use `gov-review`. Planning the build of an accepted design: use `/build` or `/orchestrate-plan` with the design doc.

## Input

- `$ARGUMENTS`: a goal in free text, or `from:<path>` naming a design doc or proposal. Empty → ask with AskUserQuestion what to design; never guess.
- A `from:` path that doesn't exist → say so and stop.
- `resume` or `resume:<task_name>`: continue an unfinished run, the newest `gov-program` task dir when no name is given, without asking Resume, Restart or New. It re-enters at the recorded phase; a gate it reaches still needs its own answer.

## Constants

- **PROJECT_ROOT**: resolved once in setup with `echo "${MZ_MEMORY_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"`; expand `<PROJECT_ROOT>` everywhere.
- **TASK_DIR**: `<PROJECT_ROOT>/.mz/task/<task_name>/`, with one folder per child at `<TASK_DIR>/children/<Dn>/`.
- **MAX_QUESTIONS**: 4 per AskUserQuestion call, one call plus at most one follow-up | **MAX_PROGRAM_RESEARCHERS**: 3 web researchers in Phase 1, on prior art and the outside APIs
- **MAX_PROGRAM_WEB_TOPICS**: 12 per-decision research topics, so a large ledger can't fan out without bound; the rest go under `## Gaps`
- **MAX_WAVE**: 6 agents per wave | **MAX_DISCUSS_ITERATIONS**: 6 per child | **MAX_CONSISTENCY_ITERATIONS**: 6
- **MAX_COVERAGE_ITERATIONS**: 6 | **MAX_PROBE_QUESTIONS**: 40 | **MAX_CHILDREN**: 15 decisions, beyond which the ledger is split into two programs at Gate 1
- **DECISIONS_DIR**: `docs/decisions/` | **DESIGN_DIR**: `docs/design/`
- **SCRIPT**: `${CLAUDE_PLUGIN_ROOT}/scripts/gov-program.sh`. **SKILL_DIR**: `${CLAUDE_SKILL_DIR}`. **PLUGIN_ROOT**: `${CLAUDE_PLUGIN_ROOT}`. Phase files write `<SCRIPT>`, `<SKILL_DIR>/...` and `<PLUGIN_ROOT>/...` because files opened with Read get no variable substitution; expand them before running a command or passing a path to an agent.

## Core Process

### Phase Overview

| Phase | Goal                                                   | Details               | Loop?                              |
| ----- | ------------------------------------------------------ | --------------------- | ---------------------------------- |
| 0     | Setup                                                  | inline below          | —                                  |
| 1     | Interview and program research                         | `phases/interview.md` | one follow-up call                 |
| 2     | Decompose into a ledger, Gate 1                        | `phases/decompose.md` | feedback loop                      |
| 3     | Children: research, route, draft, critics, consistency | `phases/children.md`  | per child max 6; consistency max 6 |
| 4     | Compose the design doc                                 | `phases/compose.md`   | —                                  |
| 5     | Coverage, with fixes                                   | `phases/compose.md`   | max 6                              |
| 6     | Gate 2: every artifact signed off                      | `phases/record.md`    | Revise loop                        |
| 7     | Record ADRs, then the doc; resolve links; verify       | `phases/record.md`    | —                                  |

### Phase 0: Setup (inline)

1. Resolve `PROJECT_ROOT` before any `cd`.
1. Parse `$ARGUMENTS` into `Entry: goal` with the goal text, `Entry: from` with the path, or a resume request. For `resume`, find the task dir, read its `state.md`, and skip to the resume handling below as if the user had answered **Resume**. No unfinished run → say so and stop.
1. Derive `task_name` = `<YYYY_MM_DD>_gov-program_<slug>`, `<slug>` a snake_case summary of at most 20 characters; on a same-day collision append `_v2`, `_v3`.
1. **Resume check**: read `<TASK_DIR>/state.md` if it exists. `complete` or `aborted_by_user` → suffix `_v2` and start fresh. Unfinished → ask **Resume**, **Restart** (archive to `<task_name>_archived_<YYYY_MM_DD_HHMMSS>/`) or **New**. On Resume, the program re-enters at its `Phase`, and in Phase 3 each child re-enters at its own row in the child table. Gates never auto-resume; re-present them. Unattended → report the path, `Status` and `what_remains`, and stop.
1. Write `<TASK_DIR>/state.md`: `schema_version: 2`, `Status: running`, `Phase: 0`, `PhaseName: setup`, `Started`, `Iteration: 0`, `FilesWritten: []`, `phase_complete: false`, `what_remains: []`, `Entry`, `Goal` or `Source`, and an empty `## Children` table with columns `id | title | dir | artifact | weight | phase | verdict | number | existing`.
1. Emit a setup block and read `phases/interview.md`.

### Phase 1: Interview and program research

Read the project, its records and the code; ask what is open in one AskUserQuestion call; write `brief.md`. Then one `pipeline-researcher` for the code and up to **MAX_PROGRAM_RESEARCHERS** `pipeline-web-researcher` dispatches for `prior-art` (how existing products and projects solve this) and `api` (how the outside platforms behave), into `research.md`, before anything is proposed. See `phases/interview.md`.

### Phase 2: Decompose, Gate 1

Goal entry: draft `proposal.md` from the brief and the research. From entry: read the source. `gov-decomposer` splits it into `ledger.md`: claims, decisions, minor decisions, givens, what moves out, and research topics tagged `options`, `prior-art` or `api`. Gate 1 shows the ledger and the research plan with Approve and Reject. On approve, `<SCRIPT> reserve` reserves the ADR and design numbers. See `phases/decompose.md`.

### Phase 3: Children

Research the approved topics in waves of at most **MAX_WAVE** `pipeline-web-researcher` dispatches. Route each decision with `gov-router`, draft it into its child folder with `{{gov:<key>}}` link tokens, and run `govern`'s critic panel per child, packing the critics of several children into waves of at most **MAX_WAVE**. Then `gov-critic-consistency` reads all the drafts together. See `phases/children.md`.

### Phases 4 and 5: Compose and coverage

`gov-design-composer` writes `design_draft.md` from the ADR drafts and givens alone, then the shared coverage check runs on it. Doc-side findings go back to the composer. ADR-side findings amend a child draft (back through its critics when the change is structural) or add a new child, which gets its own one-row Gate 1. See `phases/compose.md`.

### Phases 6 and 7: Gate 2 and record

Surface 1 shows every artifact verbatim, ADRs first and the design doc last, with planned numbers, verdicts and coverage. Surface 2 asks Approve or Reject per artifact, in calls of at most 4 questions. Nothing is recorded until every artifact is approved; any reject opens a **Revise** or **Abort** menu. There is no auto-approve. On approval, ADRs are written first, then the doc, then `<SCRIPT> resolve` swaps the tokens for real links, and `stamp` and `check` must come back clean. See `phases/record.md`.

## Red Flags

- You wrote to `docs/` before every artifact was approved, or wrote the design doc before its ADRs.
- The design doc states a choice that no ADR records, or you closed a coverage gap by trusting a quote without running `<SCRIPT> quotes`.
- You drafted a child before the research its topics needed, or answered a topic past the cap from memory instead of listing it under `## Gaps`.
- You dispatched more than **MAX_WAVE** agents in one message, or started a wave before the previous one had returned.
- You auto-approved a gate or treated passing critics as the human's approval.

## Verification

The final block lists every recorded path with its number and status, the coverage counts, the sign-off, and the closing `<SCRIPT> check` output, which reads `ok:`. `state.md` is `complete` with `what_remains: []`.

## References

- `${CLAUDE_SKILL_DIR}/references/program-ledger.md`: the child table, the key map `map.tsv` and the token rules. Read it in Phase 2 and again after compaction.
- `${CLAUDE_PLUGIN_ROOT}/skills/gov-design-sync/references/coverage-check.md`: the coverage engine shared with `gov-design-sync`. Read it in full at Phase 5.
- `${CLAUDE_PLUGIN_ROOT}/skills/govern/references/artifact-router.md`, `adr-nygard-template.md`, `adr-madr-template.md`, `design-doc-template.md` and `status-vocabularies.md`: the router's algorithm, the templates and the status sets, as `govern` uses them. Read a template in full before drafting with it.
- `${CLAUDE_PLUGIN_ROOT}/skills/govern/phases/discuss.md`: the light and heavy critic loops and their dispatch prompts, which each child reuses with its own folder as the task directory. Read it at the start of Phase 3.

## Error Handling

- An agent returns `NEEDS_CONTEXT` → supply what it names, once. `BLOCKED`, or no valid `STATUS:` line → retry once, then escalate with AskUserQuestion; unattended, finish the children that don't depend on it, then stop as `blocked`.
- A child hits **MAX_DISCUSS_ITERATIONS** without a pass → offer accept-with-unresolved, guidance or drop the child (its claims become gaps).
- Consistency or coverage still fails at its cap → `blocked`, with each finding and its suggested fix.
- A write collides with a concurrent run's number → the writer bumps it; `resolve` uses the written paths, so links stay right.
- The closing `check` reports findings → `failed`, with the findings in the final block.

## State Management

State persists to `.mz/task/<task_name>/state.md` under the project root, `${MZ_MEMORY_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}`, resolved once at the start of the run. Schema is **v2**: line 1 is `schema_version: 2`; line 2 is `Status:` with one of `pending`, `running`, `blocked`, `complete`, `aborted_by_user` or `failed`, lowercase and unquoted; then `Phase`, `Started`, `phase_complete` (boolean) and `what_remains` (YAML list of strings), with skill-specific keys below them. Milestones go in `Phase`; the reason for `blocked` or `failed` goes in `what_remains`. Set `phase_complete: false` on phase entry and `true` once the phase's artifacts are written and its gates pass. Refresh `what_remains` on every phase transition; it is `[]` when `Status` is `complete`. Write the file after every phase and before every gate, and re-read it after compaction. Record decisions worth recalling under a heading that reads exactly `## Decisions`, placed before `## Notes`; mz-memory harvests them only once `Status` is `complete`. Under a heading that reads exactly `## Lessons`, add one line whenever a review finding is accepted and fixed, a step fails, gate feedback corrects a mistake, or an approved approach is reversed, in the form `- (review|failure|correction|change) WHEN <situation> → <what to do> — WHY <cause>`, concrete and under about 40 words; mz-memory harvests lessons whatever the `Status`. Treat a legacy `completed` as `complete`. On reading a `schema_version: 1` or unversioned file, put `schema_version: 2` on line 1 and `Status` on line 2, add the missing keys, and log the upgrade. Leave a file with a higher `schema_version` untouched: ask whether to Restart (archive it), start New (`_v2`) or Abort, and stop if nobody can answer.

The `## Children` table is the program's memory across phases: update a child's row whenever its phase, verdict or number changes, and read it rather than recalling a child's state. Append every file the run writes to `FilesWritten`.

Files in this skill

  • SKILL.md13.5 KB
  • phases/children.md7.4 KB
  • phases/compose.md4 KB
  • phases/decompose.md4.5 KB
  • phases/interview.md6.7 KB
  • phases/record.md6.8 KB
  • references/program-ledger.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.