How CodyMaster Works โ
Complete workflow guide with diagrams, use cases, and exception handling.
Core Architecture โ
The RARV Execution Cycle โ
The heart of CodyMaster is the enhanced RARV cycle โ a self-correcting autonomous execution loop:
PRE-ACT ATTENTION โ The Drift Preventer โ
Before every action, the agent asks itself 3 critical questions:
| # | Question | If NO |
|---|---|---|
| Q1 | Does my planned action serve the Active Goal? | Return to REASON |
| Q2 | Am I solving the original problem, not a tangent? | Return to REASON |
| Q3 | Have I seen this error pattern before in learnings? | Apply known prevention |
This single check prevents the #1 AI failure mode: goal drift. Without it, AI agents frequently solve tangential problems instead of the actual task.
The 6-Gate Quality System โ
G3 (Blind Review): Reviewer only sees the diff โ no task description, no implementation context. Forces genuine code review.
G4 (Anti-Sycophancy): If G3 says "everything is fine," a Devil's Advocate pass actively hunts for hidden issues.
The Judge Agent Protocol โ
Working Memory System โ
Protocol:
- Session Start โ Read CONTINUITY.md + check learnings
- During Work โ Update current task, add completed items
- On Error โ Capture what failed + why + how to prevent
- Session End โ Save state for next session
Progressive Disclosure (Token Savings) โ
| Approach | Tokens Used | Efficiency |
|---|---|---|
| Load all 30 skills | 120,000 | 0% saved |
| Progressive Disclosure | 6,300 | 94.7% saved |
Common Use Cases โ
1. Build a New Feature (Autonomous) โ
# Start autonomous execution
cm continuity init
/cm-start "Build user management with list, CRUD form, and role-based access"2. Fix a Production Bug (Manual) โ
# Step 1: Investigate
@[/cm-debugging] # Root cause analysis โ don't guess, investigate
# Step 2: Fix with TDD
@[/cm-tdd] # Write test that reproduces bug โ fix โ verify
# Step 3: Deploy safely
@[/cm-safe-deploy] # 8-gate pipeline with rollback strategy3: Setup New Project (Universal Agent Bootstrap) โ
# Verify identity first, then bootstrap
@[/cm-identity-guard] # Ensure right GitHub/Cloudflare account
@[/cm-project-bootstrap] # Full setup: design system, CI, staging, deploy
# + auto-generates configs for selected AI agent platformsPhase 6.5 asks which platforms your team uses:
๐ AGENT PLATFORM SETUP
[x] AGENTS.md (Open Standard) โ Always generated
[x] Claude Desktop / Claude Code โ CLAUDE.md
[x] Cursor โ .cursor/rules/*.mdc
[ ] OpenClaw / MaxClaw โ IDENTITY.md, MEMORY.md, TOOLS.md, SHIELD.md
[ ] OpenFang โ HAND.tomlOne AGENTS.md โ all platform configs derived automatically. Never edit derived files directly.
4. Mass Translation (i18n) โ
# Safe multi-language extraction
@[/cm-safe-i18n] # Extract hardcoded strings โ vi.json + en.json + th.json5. CRO & Marketing Setup โ
# Full conversion tracking
@[/cm-ads-tracker] # Meta Pixel + CAPI, TikTok, Google Ads, GTM
@[/cro-methodology] # Funnel audit + A/B test designException Handling โ
โ What if tests fail continuously? โ
Rule: Max 3 retries per task. After 3 failures โ BLOCKED + ESCALATE to user.
โ What if the agent drifts from the goal? โ
The PRE-ACT ATTENTION check catches this:
- Agent re-reads Active Goal from CONTINUITY.md
- If planned action doesn't serve the goal โ drift logged โ return to REASON
- This happens before every action, not just at the start
โ What if working memory is lost? โ
# CONTINUITY.md gets corrupted or deleted
cm continuity reset # Reset CONTINUITY.md, learnings.json preserved
cm continuity init # Re-create from scratch if neededLearnings survive resets. Architecture decisions survive resets. Only the active session state is cleared.
โ What if deploy fails? โ
The dashboard tracks all deployments with rollback history. Use POST /api/deployments/:id/rollback to rollback via API.
โ What if the wrong agent is assigned? โ
The Judge Agent detects stuck tasks and the Dynamic Agent Selection API suggests the best agent:
curl http://codymaster.localhost:6969/api/agents/suggest?skill=cm-tdd
# โ { "domain": "engineering", "agents": ["claude-code", "cursor", "antigravity"] }โ What if quality gate is too strict? โ
Gates 1-2 (static analysis + tests) are mandatory. Gates 3-6 can be adjusted:
- G3 (Blind Review): Skip only if changes are < 10 lines
- G4 (Anti-Sycophancy): Auto-triggered, cannot skip
- G5 (Security): Skip only for internal tools
- G6 (i18n): Auto-skipped if project has no i18n
API Reference โ
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /api/projects | List projects |
| GET | /api/tasks | List tasks |
| POST | /api/tasks | Create task |
| PUT | /api/tasks/:id/move | Move task (kanban) |
| POST | /api/tasks/:id/dispatch | Dispatch to AI agent |
| GET | /api/judge | Evaluate all tasks |
| GET | /api/judge/:taskId | Evaluate single task |
| GET | /api/agents/suggest?skill=X | Suggest best agents |
| GET | /api/continuity | All projects' memory |
| POST | /api/continuity/:id | Update memory state |
| GET | /api/learnings/:id | Learnings list |
| POST | /api/learnings/:id | Add learning |
| GET | /api/decisions/:id | Decisions list |
| GET | /api/activities | Activity history |
| GET | /api/deployments | Deploy history |
| POST | /api/deployments | Record deployment |
| GET | /api/changelog | Version changelog |
Golden Rules โ
- ๐ Identity First โ
cm-identity-guardbefore push/deploy - ๐ Design Before Code โ
cm-planningalways first - ๐งช Test Before Code โ RED โ GREEN โ REFACTOR
- ๐ก๏ธ PRE-ACT ATTENTION โ check goal alignment every action
- ๐ Evidence Over Claims โ only trust terminal output
- ๐ Deploy via Gates โ all 6 gates must pass
- ๐ง Read Memory First โ CONTINUITY.md at session start
- ๐ Capture Learnings โ every failure becomes wisdom
- ๐ One Source of Truth โ AGENTS.md is the master, platform configs are derived