원클릭으로
dialectical-autocoder
Orchestrate adversarial player-coach loop for high-quality code synthesis. Based on dialectical autocoding methodology.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Orchestrate adversarial player-coach loop for high-quality code synthesis. Based on dialectical autocoding methodology.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Argue against proposed actions to test judgment quality. Not "is the code correct" but "should we be doing this at all?" Aligned with robustness, not performance.
Orchestrate Claude Code agent teams for parallel multi-agent collaboration
Learn and integrate new APIs, creating permanent skills for external service access.
Create and update CHANGELOG.md with entries that include AI model/CLI attribution, PRD context, and task references.
Audit decisions for judgment quality, compliance bias, and manipulation vulnerability. Inspired by Anthropic's Project Vend Phase 2 finding that helpfulness training creates exploitable attack surface.
Extract visual style from reference UI screenshot and codify into reusable design system.
| name | dialectical-autocoder |
| description | Orchestrate adversarial player-coach loop for high-quality code synthesis. Based on dialectical autocoding methodology. |
| config | {"max_turns":5,"escalate_on_timeout":true,"fresh_context":true} |
This skill implements an adversarial cooperation pattern between two agents:
The loop continues until the coach approves or max turns are reached.
Required:
Agents Used:
.gemini/agents/tdd-developer.md - Player role.gemini/agents/coach.md - Coach roleBefore starting a dialectical session, verify:
When Gemini CLI executes this skill, it orchestrates the player-coach loop using run_shell_command to launch fresh agent instances each turn.
1. Load requirements document into context
2. Initialize: turn_count = 0, max_turns = 5, verdict = null
3. WHILE verdict != "APPROVED" AND turn_count < max_turns:
a. turn_count += 1
b. Launch Player (fresh instance):
gemini --approval-mode=yolo "You are the PLAYER..."
Prompt includes:
- Requirements document path
- Previous coach feedback (if turn > 1)
- List of issues to address
- Request: implement and provide evidence
c. Capture player output:
- Files changed
- Test results
- Implementation summary
- Evidence provided
d. Launch Coach (fresh instance):
gemini --approval-mode=yolo "You are the COACH..."
Prompt includes:
- Requirements document path
- Player's implementation summary
- Files to review
- Test output
- Request: validate and issue verdict
e. Parse coach verdict from output:
Look for: <!-- VERDICT:APPROVED|REVISE|REJECTED -->
f. If verdict == "APPROVED": break loop
4. IF verdict != "APPROVED":
Trigger escalation protocol
5. Document turn history
Player Turn:
# Prefer positional prompts; `-p/--prompt` is deprecated.
gemini --approval-mode=yolo "$(cat <<'EOF'
You are the PLAYER in a dialectical autocoding session.
Requirements: [path/to/requirements.md]
Turn: 2 of 5
Previous coach feedback:
- Rate limiting not implemented
- Account lockout missing
Your task:
1. Read the requirements document
2. Address the coach's feedback
3. Implement with TDD approach
4. Run tests and ensure they pass
5. Report: files changed, tests added, evidence
Do NOT review your own work. The coach will validate.
EOF
)"
Coach Turn:
# Prefer positional prompts; `-p/--prompt` is deprecated.
gemini --approval-mode=yolo "$(cat <<'EOF'
You are the COACH in a dialectical autocoding session.
Requirements: [path/to/requirements.md]
Turn: 2 of 5
Player's implementation summary:
- Added rate limiting to auth endpoints
- Added account lockout after 10 failures
- 12 new tests passing
Files to review: [list of files]
Test output: [test results]
Your task:
1. Compare implementation to EACH requirement
2. Verify evidence provided
3. Identify any gaps or issues
4. Issue verdict with structured marker
End your review with exactly one of:
<!-- VERDICT:APPROVED -->
<!-- VERDICT:REVISE -->
<!-- VERDICT:REJECTED -->
EOF
)"
"Fresh context" means each agent turn uses a NEW Gemini CLI execution:
The orchestrator MUST:
turn = 0turn += 1if turn > max_turns: escalate()Each turn starts with fresh context to prevent:
The requirements document serves as the constant anchor across turns.
The loop has explicit limits:
The requirements document is the source of truth:
TURN 1:
├── Player: Read requirements, implement solution
├── Player: Write tests, run tests, commit
├── Coach: Review against requirements
├── Coach: Issue verdict (REJECTED/REVISE/APPROVED)
└── If not APPROVED → continue to Turn 2
TURN 2:
├── Player: Address coach feedback (fresh context)
├── Player: Fix issues, add tests, run tests
├── Coach: Re-review with fresh perspective
├── Coach: Issue verdict
└── If not APPROVED → continue to Turn 3
... (repeat until APPROVED or max turns)
FINAL:
├── If APPROVED: Proceed to merge
├── If max turns reached: Escalate to human
└── Document the turn history
When coach issues APPROVED:
## Starting Dialectical Autocoding Session
**Requirements:** [path to PRD or spec]
**Max Turns:** 5
**Turn:** 1 of 5
### Player Task
Using the tdd-developer agent, implement the requirements:
1. Read the requirements document thoroughly
2. Implement the solution with TDD approach
3. Run all tests and ensure they pass
4. Commit your changes
5. Report what you've implemented
### Coach Review
After player completes, using the coach agent:
1. Review implementation against requirements
2. Check all acceptance criteria
3. Demand evidence for claims
4. Issue verdict: REJECTED, REVISE, or APPROVED
## Turn [N] of [MAX]
### Previous Turn Summary
- **Verdict:** [REVISE/REJECTED]
- **Issues to address:**
1. [Issue 1]
2. [Issue 2]
### Player Task (Fresh Context)
Address the coach's feedback:
- Requirements document: [path]
- Issues to fix: [list from coach]
- Evidence to provide: [what coach demanded]
Implement fixes and provide evidence.
### Coach Review
Re-review with fresh perspective:
- Verify issues are actually fixed
- Check for new issues introduced
- Validate evidence provided
- Issue new verdict
| Turn | Expected State |
|---|---|
| 1 | Initial implementation, likely REVISE |
| 2 | Major issues fixed, minor remain |
| 3 | Most issues resolved |
| 4 | Polish and edge cases |
| 5 | Must be APPROVED or escalate |
If Turn 5 results in REVISE or REJECTED:
Document the impasse
Human review required
Options for human
Dialectical autocoding can be used within task-processor workflows:
### Task 1.1: Implement Feature X
- **Agent:** dialectical-autocoder
- **Requirements:** docs/PRD_feature_x.md
- **Max Turns:** 5
The dialectical loop runs as a sub-workflow:
1. Player implements (tdd-developer)
2. Coach validates (coach)
3. Loop until approved
4. Then mark task complete
Player Output:
Implemented user authentication per PRD section 3.2:
- Login endpoint at /api/auth/login
- JWT token generation
- Password hashing with bcrypt
- Tests: 15 passing
Evidence:
- Test: `bun test src/auth/__tests__/login.test.ts`
- All 15 assertions pass
Coach Review:
## Coach Review: Turn 1
### Requirements Checked
- [x] Login endpoint exists
- [x] JWT tokens generated
- [x] Password hashing used
- [ ] Rate limiting NOT IMPLEMENTED (PRD 3.2.4)
- [ ] Account lockout NOT IMPLEMENTED (PRD 3.2.5)
### Verdict: REVISE
**To proceed, player must:**
- [ ] Implement rate limiting (5 attempts/minute)
- [ ] Implement account lockout after 10 failed attempts
- [ ] Add tests for both features
Player Output:
Addressed coach feedback:
- Added rate limiting: 5 attempts per minute per IP
- Added account lockout: 10 failures = 30 min lock
- Added 12 new tests for these features
- Total: 27 tests passing
Evidence:
- Rate limit test: blocks 6th attempt within 1 minute
- Lockout test: locks account after 10 failures
- Unlock test: account accessible after 30 minutes
Coach Review:
## Coach Review: Turn 2
### Requirements Checked
- [x] Login endpoint exists
- [x] JWT tokens generated
- [x] Password hashing used
- [x] Rate limiting implemented (5/min verified)
- [x] Account lockout implemented (10 attempts verified)
- [x] All edge cases tested
### Verdict: APPROVED
All requirements met with evidence.
Ready for PR creation.
After session completes, save:
# Dialectical Session: [Feature Name]
**Requirements:** [path]
**Total Turns:** [N]
**Final Verdict:** [APPROVED/ESCALATED]
## Turn-by-Turn Summary
### Turn 1
- Player: [summary of implementation]
- Coach: REVISE - [issues found]
### Turn 2
- Player: [what was fixed]
- Coach: APPROVED
## Final Implementation
- Files created: [list]
- Tests added: [count]
- Coverage: [percentage]
## Lessons Learned
- [Any patterns or issues for future reference]
If coach and player disagree on requirement interpretation:
If same issues repeat across turns:
If implementation is blocked by technical issues:
.gemini/agents/coach.md for coach agent details.gemini/agents/tdd-developer.md for player agent details.gemini/skills/task-processor/SKILL.md for task integrationreference.md for methodology background