# Gov Init

> ALWAYS invoke when the user wants to install or update the governance policy in CLAUDE.md. Triggers:"gov init","install governance policy","set up governance". NOT for running a decision (use govern) or auditing artifacts (use gov-review).

- **Type:** Skill
- **Install:** `agentstack add skill-doctormozg-claude-pipelines-gov-init`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [DoctorMozg](https://agentstack.voostack.com/s/doctormozg)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [DoctorMozg](https://github.com/DoctorMozg)
- **Source:** https://github.com/DoctorMozg/claude-pipelines/tree/master/plugins/mz-gov/skills/gov-init

## Install

```sh
agentstack add skill-doctormozg-claude-pipelines-gov-init
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Gov Init

## Overview

Install the `mz-gov` governance policy into `CLAUDE.md` so Claude proactively reaches for the `govern` pipeline on substantial, ambiguous decisions. The policy is injected as a single sentinel-wrapped block — idempotent on re-run, cleanly removable on `--uninstall`. This is the only delivery mode: the block goes into `CLAUDE.md`, nothing else.

## When to Use

Triggers: "gov init", "install governance policy", "set up governance", "add govern policy to CLAUDE.md".

### When NOT to use

- The user wants to run a governance decision on a change — use `govern`.
- The user wants to audit existing artifacts — use `gov-review`.
- The user wants to edit the policy text itself — open the injected block in `CLAUDE.md` directly, or re-run with `--force` after editing the source.
- `CLAUDE.md` is managed by another tool and must not be touched.

## Arguments

- `project` (default) → inject into `./CLAUDE.md`
- `global` → inject into `~/.claude/CLAUDE.md`
- `--force` → replace the existing policy block in place (only between the sentinels)
- `--uninstall` → remove the policy block previously installed by this skill

Parse from `$ARGUMENTS`. Unknown or conflicting tokens → AskUserQuestion; never guess.

## Core Process

| Phase | Goal                         | Details         |
| ----- | ---------------------------- | --------------- |
| 0     | Setup                        | Inline below    |
| 1     | Install / update / uninstall | `phases/run.md` |

### Phase 0: Setup

1. Parse `$ARGUMENTS`: scope (`project`/`global`, default `project`), `--force`, `--uninstall`. Unknown or conflicting token → AskUserQuestion.
1. `task_name` = `_gov-init_` where `` is today's date (underscores) and `` is a snake_case summary of the args (e.g. `project`, `global_uninstall`, max 20 chars). On same-day collision append `_v2`, `_v3`.
1. Create `.mz/task//`.
1. Write `state.md` with `schema_version: 2` as its first line, then `Status: running`, `Phase: 0`, `Started: `, `phase_complete: false`, `what_remains: []`, `Scope: `, `Force: `, `Uninstall: `, `Action: `, `Target: `.
1. Emit setup block: task_name, scope, resolved target path, mode flags.

The approval gate in `phases/run.md` must run before any write to `CLAUDE.md`. A single run-level confirmation covers the write.

Read `phases/run.md` and proceed to Phase 1.

## Techniques

Techniques: delegated to phase file — see the Phase Overview table above.

## Common Rationalizations

N/A — this is a setup/reference skill, not a discipline gate.

## Red Flags

Red Flags: delegated to phase file — see the Phase Overview table above.

## Verification

Verification: delegated to phase file — after install, grep `CLAUDE.md` for exactly one `mz-gov:governance-policy` start sentinel (zero after uninstall). See `phases/run.md`.

## Error Handling

- **Empty / ambiguous / conflicting argument** → AskUserQuestion; never guess.
- **Missing tooling** — if `${CLAUDE_PLUGIN_ROOT}` is unset or `skills/gov-init/policy/governance-policy.md` is not readable, AskUserQuestion with the failing path.
- **`CLAUDE.md` unreadable or unwritable** → AskUserQuestion with the exact path and error; never fall back silently.
- **Duplicate `mz-gov:governance-policy` sentinels found** (manual edit or prior bug) → stop, report the conflicting lines, ask the user to resolve before re-running.
- **Plugin version unreadable** → use the literal `unknown` for the version tag and note it in the report.

## State Management

State persists to `.mz/task//state.md`. Schema is **v2**: the file's first line is `schema_version: 2`, and alongside the skill's existing `Status` / `Phase` / `Started` keys it carries `phase_complete` (boolean) and `what_remains` (YAML list of strings). 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; `what_remains` MUST be `[]` when `Status: complete`. On reading a `schema_version: 1` or unversioned file, add the missing keys, set `schema_version: 2`, and log the upgrade.

Record `Action:` (`installed` | `replaced` | `skipped` | `removed`) and the resolved `Target:` after Phase 1. Never rely on conversation memory for cross-phase state — context compaction destroys specific paths and decisions.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [DoctorMozg](https://github.com/DoctorMozg)
- **Source:** [DoctorMozg/claude-pipelines](https://github.com/DoctorMozg/claude-pipelines)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-doctormozg-claude-pipelines-gov-init
- Seller: https://agentstack.voostack.com/s/doctormozg
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
