Unified alignment command (--project, --docs, --retrofit)
/plugin marketplace add akaszubski/autonomous-dev/plugin install autonomous-dev@autonomous-devPurpose: Validate and fix alignment between PROJECT.md, documentation, and codebase.
Default: /align runs full alignment check (docs + code + hooks review)
Modes:
/align - Full alignment (PROJECT.md + CLAUDE.md + README vs code + hooks review)/align --docs - Documentation only (ensure all docs consistent with PROJECT.md)/align --retrofit - Brownfield retrofit (5-phase project transformation)# Default: Full alignment check
/align
# Documentation consistency only
/align --docs
# Brownfield project retrofit
/align --retrofit
/align --retrofit --dry-run
/align --retrofit --auto
Purpose: Comprehensive check that PROJECT.md, CLAUDE.md, README, and codebase are all aligned.
Time: 10-30 minutes
What it does:
Run manifest alignment validation:
# With OpenRouter (recommended - cheap GenAI validation)
OPENROUTER_API_KEY=sk-or-... python plugins/autonomous-dev/lib/genai_validate.py manifest-alignment
# Without API key (regex fallback)
python plugins/autonomous-dev/lib/validate_manifest_doc_alignment.py
Validates:
Options:
Run alignment-analyzer agent to check:
PROJECT.md vs Code:
CLAUDE.md vs Reality:
README vs Reality:
Check for inflation in validation hooks:
For each conflict found, determine which source is correct:
Documentation vs Reality conflicts:
CONFLICT: CLAUDE.md says "10 active commands"
Reality: 7 commands exist (example - already fixed)
What should we do?
A) Update CLAUDE.md to say "7 commands"
B) This is correct (explain why)
Your choice [A/B]:
Code vs PROJECT.md conflicts (Bidirectional):
CONFLICT: /create-issue exists in code/docs but not in PROJECT.md SCOPE
Which is correct?
A) Code/docs are right → Update PROJECT.md to include /create-issue
B) PROJECT.md is right → This shouldn't have been built (flag for removal)
Your choice [A/B]:
If A: Propose PROJECT.md update (requires approval) If B: Log conflict for manual resolution
/align
Phase 1: Quick Scan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Scanning file system for truth...
Agents: 20, Commands: 7, Hooks: 45, Skills: 28
Found 5 count mismatches, 3 dead refs
→ Will address in Phase 4
Phase 2: Semantic Validation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Checking PROJECT.md alignment...
✓ GOALS: 4/4 implemented
✓ SCOPE: No out-of-scope code found
⚠ ARCHITECTURE: docs/ structure doesn't match documented pattern
Checking CLAUDE.md alignment...
✓ Workflow descriptions accurate
⚠ Agent count outdated (says 18, actual 20)
⚠ Command list missing /create-issue
Checking README alignment...
✓ Installation instructions work
✓ Examples are accurate
Phase 3: Hooks Review
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reviewing 45 hooks for inflation...
⚠ validate_claude_alignment.py duplicates alignment_fixer.py logic
⚠ 3 hooks reference archived commands
Phase 4: Resolution
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Found 8 issues to resolve...
[Interactive fixing begins]
--docs)Purpose: Ensure all documentation is internally consistent and matches PROJECT.md (source of truth).
Time: 5-15 minutes
What it does:
PROJECT.md as Source of Truth
Internal Doc Consistency
Architecture Documentation
Count/Reference Accuracy
/align for that)/align --docs
Validating documentation consistency...
Source of Truth: PROJECT.md
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Last updated: 2025-12-13
✓ Version: v3.40.0
Cross-Reference Check
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ CLAUDE.md references PROJECT.md correctly
✓ README.md and PROJECT.md both say 7 commands
✓ docs/AGENTS.md matches agents/ directory
Architecture Docs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ File structure documented correctly
⚠ docs/LIBRARIES.md missing 5 new libraries
Count Validation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Running alignment_fixer.py...
Found 3 count mismatches in documentation
Summary: 3 issues found
Fix with: /align --docs --fix
--retrofit)Purpose: Transform existing projects to autonomous-dev standards for /auto-implement compatibility.
Time: 30-90 minutes
Workflow: 5-phase process with backup/rollback safety
codebase_analyzer.pyalignment_assessor.pymigration_planner.pyretrofit_executor.py--dry-run (preview), default (step-by-step), --auto (all at once)retrofit_verifier.py# Preview what would change
/align --retrofit --dry-run
# Step-by-step with confirmations (safest)
/align --retrofit
# Automatic execution (fastest)
/align --retrofit --auto
.claude/ structure# Automatic on failure
# Manual rollback:
python plugins/autonomous-dev/lib/retrofit_executor.py --rollback <timestamp>
| Scenario | Mode |
|---|---|
| Regular development check | /align |
| After adding/removing components | /align |
| Before major release | /align |
| Updating documentation only | /align --docs |
| Onboarding new developers | /align --docs |
| Adopting autonomous-dev | /align --retrofit |
| Legacy codebase migration | /align --retrofit |
Based on arguments, invoke the appropriate alignment workflow:
/align or /align --project): Invoke the alignment-analyzer agent to validate PROJECT.md and fix conflicts/align --docs): Run documentation consistency validation via alignment_fixer.py/align --retrofit): Execute 5-phase brownfield retrofit workflowParse arguments from user input:
IF --retrofit flag:
→ Run 5-phase brownfield retrofit
→ Check for --dry-run or --auto sub-flags
ELIF --docs flag:
→ Run documentation consistency check
→ alignment_fixer.py + cross-reference validation
→ No code changes, docs only
ELSE (default):
→ Phase 1: alignment_fixer.py (quick scan)
→ Phase 2: alignment-analyzer agent (semantic validation)
→ Phase 3: Hook inflation review
→ Phase 4: Interactive resolution
Default mode:
validate_manifest_doc_alignment.py - Quick count/reference scanalignment-analyzer agent - Semantic validation (via Claude Code)--docs mode:
alignment_fixer.py - Count validation--retrofit mode:
codebase_analyzer.py - Phase 1alignment_assessor.py - Phase 2migration_planner.py - Phase 3retrofit_executor.py - Phase 4retrofit_verifier.py - Phase 5Use --docs for faster documentation-only check:
/align --docs # 5-15 min vs 10-30 min
Run in batches:
/align --docs # Fix docs first
/align # Then full check (fewer issues)
Automatic rollback should restore backup. Manual rollback:
ls ~/.autonomous-dev/backups/
python plugins/autonomous-dev/lib/retrofit_executor.py --rollback <timestamp>
/auto-implement - Uses PROJECT.md for feature alignment/setup - Initial project setup (calls /align --retrofit internally)/health-check - Plugin integrity validation| Old Command | New Command |
|---|---|
/align-project | /align (default) |
/align-claude | /align --docs |
/align-project-retrofit | /align --retrofit |
Note: Old commands archived to commands/archive/ (Issue #121).