DEV Community

Cover image for govctl: Opinionated CLI tool to enforce RFC-driven AI coding
Gabriel Wu
Gabriel Wu

Posted on

govctl: Opinionated CLI tool to enforce RFC-driven AI coding

The Problem

AI coding assistants are fast. They're also completely undisciplined.

Here's a pattern I've seen (and lived) too many times:

Day 1:  "Let's add caching!"
Day 2:  AI generates 500 lines of Redis integration
Day 7:  "Wait, did we agree on Redis or Memcached?"
Day 14: Half the team implements one, half the other
Day 30: Two incompatible caching layers, no spec, nobody knows why
Enter fullscreen mode Exit fullscreen mode

The AI didn't cause this. We did — by skipping the specification phase.

AI amplifies whatever workflow you feed it. Feed it chaos, get chaos faster. Feed it discipline, get discipline faster.

I chose discipline.


The Insight

Every sustainable software project I've worked on had one thing in common: specification preceded implementation.

Not because of bureaucracy. Because clarity compounds.

When you write down what you're building before how, you:

  • Force yourself to think through edge cases
  • Give reviewers something to review before 5,000 lines of code exist
  • Create an audit trail for future maintainers (including future you)

The problem? Nothing enforces this. "Best practices" are suggestions. Suggestions get skipped when deadlines hit.

So I built a tool that doesn't suggest. It enforces.


The Solution: govctl

govctl is a governance CLI that enforces phase discipline on software development.

The core model:

┌─────────┐     ┌──────────┐     ┌──────────┐     ┌──────────┐
│  SPEC   │ ──► │   IMPL   │ ──► │   TEST   │ ──► │  STABLE  │
└─────────┘     └──────────┘     └──────────┘     └──────────┘
Enter fullscreen mode Exit fullscreen mode

Phases cannot be skipped. Gates are checked, not suggested.

The Workflow

# Start with a specification (RFC)
govctl new rfc "Caching Strategy"

# Add clauses — atomic units of specification
govctl new clause RFC-0001:C-SCOPE "Scope" -s "Specification" -k normative

# Edit the clause
govctl edit RFC-0001:C-SCOPE --stdin <<'EOF'
The system MUST use Redis for session caching.
The TTL MUST be configurable via environment variable.
Cache invalidation MUST occur on user logout.
EOF

# Lock the spec
govctl finalize RFC-0001 normative

# NOW you can implement
govctl advance RFC-0001 impl

# Validate everything
govctl check
Enter fullscreen mode Exit fullscreen mode

If you try to implement against a draft RFC, govctl check fails. That's the point.


What It Manages

govctl handles three artifact types:

Artifact Purpose
RFCs Normative specifications — what will be built
ADRs Architecture Decision Records — why decisions were made
Work Items Task tracking with acceptance criteria

All stored as structured data (JSON/TOML), rendered to human-readable Markdown.


The Proof: Dogfooding

govctl governs itself.

Every feature in the CLI was specified in an RFC before I wrote a line of code:

You can trace any line of code back to its specification. This isn't documentation — it's proof that the model works.


Who This Is For

  • ✅ Teams frustrated by AI "code now, think later" patterns
  • ✅ Projects where specs drift from implementations
  • ✅ Organizations needing audit trails for AI-generated code
  • ✅ Developers who believe discipline enables velocity
  • ❌ Not for "move fast and break things" workflows
  • ❌ Not for projects without review processes

This isn't for everyone, and that's okay.


Getting Started

# Install
cargo install govctl

# With TUI dashboard
cargo install govctl --features tui

# Initialize
govctl init

# Create your first RFC
govctl new rfc "My Feature"

# Validate
govctl check
Enter fullscreen mode Exit fullscreen mode

Full documentation: govctl User Guide


Why a CLI?

I considered building an MCP integration, a VS Code extension, a web app.

Then I realized: every AI coding agent already speaks shell.

Claude, Cursor, Codex, Copilot — they can all run commands. The CLI is the universal interface. No JSON-RPC negotiation. No custom protocols. Just:

govctl new rfc "Feature Title"
govctl check
govctl advance RFC-0010 impl
Enter fullscreen mode Exit fullscreen mode

Complexity avoided. Capability preserved.


AI-Native: Embedded Claude Commands

govctl ships with a built-in Claude command that teaches AI agents the complete governed workflow.

Just type /gov add user authentication and Claude will:

  1. Create or activate a work item
  2. Check if an RFC is needed
  3. Create the RFC with proper clauses
  4. Ask permission before advancing phases
  5. Implement the feature
  6. Run tests
  7. Tick acceptance criteria
  8. Mark the work item done

The command encodes the entire workflow — phase discipline, RFC supremacy, commit conventions — so the AI follows governance rules automatically.

# In Cursor or Claude Code
/gov implement caching with Redis
Enter fullscreen mode Exit fullscreen mode

The AI becomes a constrained autonomous agent that respects your governance model.


Built With

  • Rust (edition 2024) — for correctness and speed
  • Clap — CLI framework
  • Serde — serialization
  • Ratatui — optional TUI dashboard

MIT licensed. Contributions welcome.


Final Thought

AI coding tools are here to stay. The question isn't whether to use them — it's how to use them without losing control.

govctl is my answer: specification-first, phase-gated, governance as code.

If that resonates, give it a try:

👉 github.com/govctl-org/govctl


"Discipline is not the opposite of creativity. It is the foundation."

Top comments (0)