VajbCoder is the agent that writes production code. It scaffolds modules, adds features, fixes bugs, and refactors existing code. It has the most tools, the most iterations, the strongest model, and the strictest execution workflow of any agent.
Full Tool Set
read_file, grep_codebase, list_files → Understand existing code
write_file, generate_patch → Create/modify code
bash → php -l, phpunit, phpstan
database_schema → Know the DB structure
+ Deferred: PMUpdateTaskTool, PMCreateSubtaskTool, SharedContextTool, ManageScheduleTool, DelegateAgentTool
VajbCoder can read, write, lint, test, analyze, patch, delegate sub-tasks, and update PM subtask statuses — all in a single execution.
Write Boundaries
$allowedPaths = [
'moduli/', // Business modules
'app/Controllers/', // App controllers
'app/Models/', // App models
'app/Jobs/', // Background jobs
];
$blockedPaths = [
'app/baseKRIZAN/', // Framework core — never touch
];
VajbCoder can write anywhere in business code but cannot modify framework internals. This boundary exists because framework changes affect every module — a bad change to DatabaseConnection.php could break the entire platform. Framework changes require human development, not agent automation.
Execution Config
max_iterations: 30 // Code generation needs room (increased from 15 for complex tasks + validation loop)
model profile: 'power' // Opus-class (strongest available)
temperature: 0.3 // Predictable code, not creative
extended thinking: true // Deep reasoning before generating
thinking budget: 16000 // 16K tokens of internal reasoning
30 iterations because the write-lint-test-fix loop needs multiple rounds. The typical pattern: 2-3 iterations to read and understand (or 1 with batch_read/architecture_query), 3-5 to write, 2-4 for PHPStan validation loop (agent writes → PHPStan finds errors → agent fixes → PHPStan re-checks), 1 to finalize. Complex multi-file tasks can use 15-20 iterations. The increase from 15 to 30 accounts for the post-completion validation feedback loop and consult_agent mid-task consultations.
Extended thinking with 16K tokens lets the model reason about architecture before generating code — "this controller needs dependency injection, the model needs these columns, the routes need these patterns" — all internally before the first write_file call.
VajbCoderOrchestrator: Git Branch Isolation
VajbCoder never writes directly to the working branch. The run interceptor routes execution through VajbCoderOrchestrator:
1. git checkout -b scaffold/{task-slug}-{hex}
2. Run VajbCoder agent (30 iterations max)
3. git add + git commit
4. git checkout {original-branch}
5. Log to AgentLog
6. Notify via Telegram: [Approve] [Reject] [Diff]
If the agent writes bad code, the scaffold branch is deleted — no trace on the working branch. If the code is good, merge with --no-ff for clean revert capability.
The Self-Check Loop in Practice
A real execution for "add a search endpoint to ProjectController":
Iteration 1: read_file → ProjectController.php (understand existing patterns)
Iteration 2: read_file → pm_routes.php (find route conventions)
Iteration 3: grep_codebase → "function search" (find search patterns in other controllers)
Iteration 4: database_schema → describe pm_projects (know columns for WHERE clause)
Iteration 5: write_file → ProjectController.php (add search method)
Iteration 6: write_file → pm_routes.php (add route)
Iteration 7: bash → php -l ProjectController.php → PASS
Iteration 8: bash → phpstan analyze ProjectController.php → 1 error (missing return type)
Iteration 9: write_file → ProjectController.php (fix return type)
Iteration 10: bash → phpstan analyze ProjectController.php → PASS
Iteration 11: generate_patch → applied → AUTO-EXIT
11 iterations. The agent read 4 files, wrote 3 times, ran 3 checks, and produced a clean patch. Without the self-check loop (iterations 7-10), the missing return type would have been caught by the human reviewer — wasting their time on something the agent could have fixed itself.
Up Next
Next up: TestAgent and ReviewAgent: Bounded Access by Design — why TestAgent can only write to tests/ and ReviewAgent has zero write tools, and how PM pipelines use ReviewAgent's VERDICT for loop-to cycles.
Comments (0)
No comments yet. Be the first to share your thoughts!
Leave a Comment