Skip to content

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:

#QuestionIf NO
Q1Does my planned action serve the Active Goal?Return to REASON
Q2Am I solving the original problem, not a tangent?Return to REASON
Q3Have 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:

  1. Session Start โ†’ Read CONTINUITY.md + check learnings
  2. During Work โ†’ Update current task, add completed items
  3. On Error โ†’ Capture what failed + why + how to prevent
  4. Session End โ†’ Save state for next session

Progressive Disclosure (Token Savings) โ€‹

ApproachTokens UsedEfficiency
Load all 30 skills120,0000% saved
Progressive Disclosure6,30094.7% saved

Common Use Cases โ€‹

1. Build a New Feature (Autonomous) โ€‹

bash
# 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) โ€‹

bash
# 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 strategy

3: Setup New Project (Universal Agent Bootstrap) โ€‹

bash
# 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 platforms

Phase 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.toml

One AGENTS.md โ†’ all platform configs derived automatically. Never edit derived files directly.

4. Mass Translation (i18n) โ€‹

bash
# Safe multi-language extraction
@[/cm-safe-i18n]  # Extract hardcoded strings โ†’ vi.json + en.json + th.json

5. CRO & Marketing Setup โ€‹

bash
# Full conversion tracking
@[/cm-ads-tracker]    # Meta Pixel + CAPI, TikTok, Google Ads, GTM
@[/cro-methodology]   # Funnel audit + A/B test design

Exception 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:

  1. Agent re-reads Active Goal from CONTINUITY.md
  2. If planned action doesn't serve the goal โ†’ drift logged โ†’ return to REASON
  3. This happens before every action, not just at the start

โŒ What if working memory is lost? โ€‹

bash
# CONTINUITY.md gets corrupted or deleted
cm continuity reset    # Reset CONTINUITY.md, learnings.json preserved
cm continuity init     # Re-create from scratch if needed

Learnings 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:

bash
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 โ€‹

MethodEndpointPurpose
GET/api/projectsList projects
GET/api/tasksList tasks
POST/api/tasksCreate task
PUT/api/tasks/:id/moveMove task (kanban)
POST/api/tasks/:id/dispatchDispatch to AI agent
GET/api/judgeEvaluate all tasks
GET/api/judge/:taskIdEvaluate single task
GET/api/agents/suggest?skill=XSuggest best agents
GET/api/continuityAll projects' memory
POST/api/continuity/:idUpdate memory state
GET/api/learnings/:idLearnings list
POST/api/learnings/:idAdd learning
GET/api/decisions/:idDecisions list
GET/api/activitiesActivity history
GET/api/deploymentsDeploy history
POST/api/deploymentsRecord deployment
GET/api/changelogVersion changelog

Golden Rules โ€‹

  1. ๐Ÿ”’ Identity First โ€” cm-identity-guard before push/deploy
  2. ๐Ÿ“ Design Before Code โ€” cm-planning always first
  3. ๐Ÿงช Test Before Code โ€” RED โ†’ GREEN โ†’ REFACTOR
  4. ๐Ÿ›ก๏ธ PRE-ACT ATTENTION โ€” check goal alignment every action
  5. ๐Ÿ“Š Evidence Over Claims โ€” only trust terminal output
  6. ๐Ÿš€ Deploy via Gates โ€” all 6 gates must pass
  7. ๐Ÿง  Read Memory First โ€” CONTINUITY.md at session start
  8. ๐Ÿ“š Capture Learnings โ€” every failure becomes wisdom
  9. ๐ŸŒ One Source of Truth โ€” AGENTS.md is the master, platform configs are derived

Open Source AI Agent Skills Framework