v3/implementation/adrs/ADR-045-guidance-system-v31-integration.md
Status: Accepted Date: 2026-02-02 Author: Claude Flow Architecture Version: 3.1.0-alpha.1
The @claude-flow/guidance package (published as 3.0.0-alpha.1) provides a governance control plane for Claude Code sessions:
Currently, @claude-flow/guidance is:
v3/@claude-flow/guidance/@claude-flow/cli via dynamic import() — but NOT declared as a dependencyclaude-flow package's files arraynpx claude-flow@alphaThis means the guidance CLI commands silently fail at runtime when installed from npm.
Integrate @claude-flow/guidance as a first-class dependency in both @claude-flow/cli and the claude-flow umbrella package, making it a core component of Claude Flow v3.1.
claude-flow (umbrella v3.1.0-alpha.1)
└── @claude-flow/cli (v3.1.0-alpha.1)
├── @claude-flow/guidance (v3.0.0-alpha.1) ← NEW
├── @claude-flow/shared
├── @claude-flow/mcp
└── @claude-flow/aidefence
@claude-flow/cli/package.json:
{
"dependencies": {
"@claude-flow/guidance": "^3.0.0-alpha.1"
}
}
claude-flow/package.json (umbrella):
{
"files": [
"v3/@claude-flow/guidance/dist/**/*.js",
"v3/@claude-flow/guidance/dist/**/*.d.ts",
"v3/@claude-flow/guidance/package.json"
]
}
The guidance command becomes a top-level CLI command with 6 subcommands:
| Subcommand | Description |
|---|---|
guidance compile | Compile CLAUDE.md into constitution + shards + manifest |
guidance retrieve | Query compiled rule shards by semantic similarity |
guidance gates | Run enforcement gates against tool calls |
guidance evolve | Evolve rules based on session outcomes |
guidance optimize | Analyze and optimize CLAUDE.md for higher governance score |
guidance ab-test | Run A/B comparative benchmark between configurations |
The CLAUDE.md generator (claudemd-generator.ts) now:
runtime.claudeMdTemplate optioninit --wizard| Package | Current | v3.1 |
|---|---|---|
claude-flow (umbrella) | 3.0.0-alpha.185 | 3.1.0-alpha.1 |
@claude-flow/cli | 3.0.0-alpha.185 | 3.1.0-alpha.1 |
@claude-flow/guidance | 3.0.0-alpha.1 | 3.0.0-alpha.1 (unchanged) |
The guidance package itself stays at 3.0.0-alpha.1 since its API is stable. The CLI and umbrella bump to 3.1.0 to reflect the governance integration as a feature milestone.
guidance commands work out-of-the-box for all users@claude-flow/guidance to CLI's dependenciesfiles array