troykelly/codex-skills/worker-protocol
Claude Code and agent skill by troykelly/codex-skills
- community
Checking that the SKILL.md file is still in the repository.
Defines behavior protocol for spawned worker agents. Injected into worker prompts. Covers startup, progress reporting, exit conditions, and handover preparation.
Install
npx vskill@latest install troykelly/codex-skills/worker-protocolSKILL.md
Worker Protocol
Overview
This skill defines the behavioral contract for spawned worker agents. It is injected into worker prompts and governs how workers operate.
Core principle: Workers are single-purpose, self-documenting, and gracefully exit.
Note: This skill is not invoked directly - it's embedded in worker prompts by worker-dispatch.
Worker Identity
Every worker has:
| Property | Example | Purpose | |
|---|---|---|---|
worker_id | worker-1701523200-123 | Unique identifier | |
issue | 123 | Assigned issue number | |
attempt | 1 | Which attempt this is | |
orchestration_id | orch-2025-12-02-001 | Parent orchestration |
Startup Checklist
Workers MUST execute this checklist before starting work:
Startup Comment Template
Progress Reporting
When to Report
Workers post progress comments:
- On start - Startup checklist complete
- On milestone - Significant progress (e.g., "tests passing")
- On blocker - When encountering impediment
- On completion - PR created or handover needed
Progress Comment Template
Exit Conditions
Workers exit when ANY of these conditions are met:
1. PR Created (Success)
2. Handover Needed (Turn Limit)
When approaching 100 turns (at ~85-90 turns):
See worker-handover skill for handover file format.
3. Blocked (External Dependency)
Only after exhausting all options:
4. Failed (Needs Research)
When implementation fails after good-faith effort:
[Error output or description]
Review Gate (MANDATORY)
Before creating ANY PR, workers MUST:
- Complete
comprehensive-reviewskill (7 criteria) - Post review artifact to issue comment (exact format required)
- Address ALL findings using
apply-all-findingsskill - Verify "Unaddressed: 0" in artifact
- Update artifact status to "COMPLETE"
Review artifact format (machine-parseable):
CRITICAL: The PreToolUse hook will BLOCK gh pr create if:
- No review artifact found in issue comments
- Review status is not COMPLETE
- Unaddressed findings > 0
Security-Sensitive Changes
If worker modifies files matching security-sensitive patterns:
**/auth/**,**/api/**,**/middleware/****/*password*,**/*token*,**/*secret*
Worker MUST:
- Invoke
security-reviewskill OR runcodex-subagent security-reviewer - Include security review in artifact
- Mark "Security-Sensitive: YES" in artifact
Behavioral Rules
DO
- β Work ONLY on assigned issue
- β Follow all project skills (TDD, strict-typing, ipv6-first, etc.)
- β Commit frequently with descriptive messages
- β Update issue with progress comments
- β Test thoroughly before creating PR
- β
Complete
comprehensive-reviewbefore PR - β Post review artifact to issue
- β Address ALL review findings (no exceptions)
- β Prepare handover if approaching turn limit
- β Exit cleanly when done
DO NOT
- β Start work on other issues
- β Modify unrelated code
- β Skip tests to save turns
- β Create PR without passing tests
- β Create PR without review artifact
- β Leave review findings unaddressed
- β Defer findings without tracking issues
- β Ignore project standards
- β Continue past 100 turns
- β Delete or modify other workers' branches
Commit Message Format
Workers use this commit format:
Types:
feat: New featurefix: Bug fixtest: Test additionsrefactor: Code refactoringdocs: Documentation
Example:
PR Creation
PREREQUISITE: Review artifact MUST be posted to issue before PR creation.
Pre-PR Verification
PR Title Format
PR Body Template
Worktree Awareness
Workers operate in isolated worktrees and must:
- Stay in worktree - Don't cd to main repo
- Use relative paths - Worktree is the root
- Commit to branch - Not main
- Push to remote - For PR creation
Turn Awareness
Workers should be aware of their turn budget:
| Turns | Status | Action | |
|---|---|---|---|
| 0-50 | Early | Normal work | |
| 50-80 | Mid | Monitor progress | |
| 80-90 | Late | Prepare handover if needed | |
| 90-100 | Critical | Finalize and handover |
At turn 85+:
Error Recovery
When errors occur:
- Don't panic - Errors are information
- Document - Capture error output
- Analyze - Understand what went wrong
- Retry once - Try an alternative approach
- Report - If still failing, report for research
[error output]
Handover Trigger
Workers MUST create handover when:
- Turn count reaches 90+
- Cannot complete in remaining turns
- Blocked but context valuable for next attempt
See worker-handover skill for handover file format.
Integration
This protocol is used by:
- All spawned workers
This protocol requires workers to follow:
issue-driven-development- Core workflowstrict-typing- Type requirementsipv6-first- Network requirementstdd-full-coverage- Testing approachclean-commits- Commit standardsworker-handover- Handover formatcomprehensive-review- Code review (MANDATORY before PR)apply-all-findings- Address all findingssecurity-review- For security-sensitive filesdeferred-finding- For tracking deferred findingsreview-gate- PR creation gate
This protocol is enforced by:
PreToolUsehook ongh pr create- Blocks without review artifactStophook - Verifies review completion before session end
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/worker-protocol/SKILL.md
Popularity
- Repository stars
- 5
- 7-day trend score
- 9
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/troykelly/codex-skills/worker-protocol)