Prime
/flow-next:prime runs a structured assessment of how ready a repo is for agentic work.
It is inspired by Factory.ai’s Agent Readiness framework. Nine sonnet scouts run in parallel, verify that test and build commands actually execute, score the repo across eight pillars, and produce a maturity level. Agent-readiness gaps get an interactive remediation step; production-readiness gaps are reported for awareness.
Why this matters
Section titled “Why this matters”Agents waste cycles when the environment fights them:
- No pre-commit hooks → 10-minute CI wait instead of 5-second local feedback.
- Undocumented env vars → guesses, fails, guesses again.
- Missing
CLAUDE.md→ re-discovers conventions on every run. - No reliable test command → cannot verify changes work.
These are environment problems, not agent problems. Prime helps fix them.
The eight pillars
Section titled “The eight pillars”Agent readiness (1-5) is scored and fixed. Production readiness (6-8) is reported only.
| # | Pillar | What it checks |
|---|---|---|
| 1 | Style & validation | Linters, formatters, type checking, pre-commit hooks. |
| 2 | Build system | Build tools, commands, lock files, monorepo tooling. |
| 3 | Testing | Test framework, commands, coverage, verification. |
| 4 | Documentation | README, CLAUDE.md, setup docs, architecture. |
| 5 | Dev environment | .env.example, Docker, devcontainer, runtime version. |
| 6 | Observability | Logging, tracing, metrics, error tracking, health endpoints. |
| 7 | Security | Branch protection, secret scanning, CODEOWNERS, Dependabot. |
| 8 | Workflow & process | CI/CD, PR templates, issue templates, release automation. |
Maturity levels
Section titled “Maturity levels”| Level | Name | Score | Description |
|---|---|---|---|
| 1 | Minimal | <30% | Basic project structure only. |
| 2 | Functional | 30–49% | Can build and run; limited docs. |
| 3 | Standardized | 50–69% | Agent-ready for routine work. |
| 4 | Optimized | 70–84% | Fast feedback, comprehensive docs. |
| 5 | Autonomous | 85%+ | Capable of full autonomous operation. |
Level 3 is the target for most teams. Higher levels have diminishing returns relative to the engineering cost.
SE1: branch protection (1.1.6+)
Section titled “SE1: branch protection (1.1.6+)”The Pillar 7 security scout checks for branch protection on the default branch.
From Flow-Next 1.1.6, SE1 accepts both classic GitHub branch protection and ruleset-based enforcement. GHE Enterprise repos protected via repo / org / enterprise rulesets correctly show SE1 ✅ instead of a false-negative gap.
| Mode | Behavior |
|---|---|
| Default | Full scan, interactive remediation for pillars 1–5. |
--report-only | Scan and report; offer no fixes. |
--fix-all | Apply every agent-readiness fix without asking. |
A path argument scans a different repo root.
What gets fixed vs reported
Section titled “What gets fixed vs reported”| Pillars | Category | Remediation |
|---|---|---|
| 1–5 | Agent readiness | Fixes offered via blocking questions. |
| 6–8 | Production readiness | Reported only; address independently. |
Next step
Section titled “Next step”After remediation, re-run prime to confirm the score improved. Then move on to whatever spec the readiness gap was blocking.