Claude-skill-registry harness-coder
Main coding agent for autonomous harness system. Continues work from previous sessions, implements one feature per session, coordinates with testing and review skills, and maintains clean handoffs via Archon. This is the workhorse of the harness system for multi-session development.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/harness-coder" ~/.claude/skills/majiayu000-claude-skill-registry-harness-coder && rm -rf "$T"
skills/data/harness-coder/SKILL.mdHarness Coding Agent Skill
Autonomous coding skill for multi-session development projects. Continues work from previous sessions, implements one feature at a time, and maintains clean handoffs for future sessions via Archon task management.
Triggers
Use this skill when:
- Continuing autonomous coding sessions
- Implementing features in multi-session projects
- Working with harness-based development
- Keywords: harness, coder, coding agent, autonomous coding, session continuation, feature implementation
Core Mission
This is a continuation session in a multi-session autonomous development project. You must:
- Get your bearings - Understand current state from Archon
- Verify existing features - Run health checks on completed work
- Implement one feature - Focus on highest priority TODO task
- Coordinate with skills - Use testing and review skills
- Clean handoff - Update Archon and commit for next session
Session Flow
CODING SESSION FLOW ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ Orient │──>│ Verify │──>│Implement│──>│ Test & │ │ & Plan │ │ Health │ │ Feature │ │ Review │ └─────────┘ └─────────┘ └─────────┘ └────┬────┘ │ ┌───────────────┘ v ┌─────────┐ ┌─────────┐ │ Update │──>│ Handoff │ │ Archon │ │ & Commit│ └─────────┘ └─────────┘
Step-by-Step Protocol
STEP 1: Orient & Get Your Bearings (MANDATORY)
This is a FRESH context window - you have no memory of previous sessions.
# 1. Verify working directory pwd # 2. List project files ls -la # 3. Read harness configuration cat .harness/config.json
Then query Archon:
# Get project ID from config PROJECT_ID = "<from .harness/config.json>" # Get session notes for context session_notes = find_documents( project_id=PROJECT_ID, document_type="note", query="Session Notes" ) # Get current task status tasks = find_tasks( filter_by="project", filter_value=PROJECT_ID ) # Find META task for session tracking meta_task = find_tasks( project_id=PROJECT_ID, query="META Session Tracking" )
# Check git history git log --oneline -15 git status
STEP 2: Analyze Current State
From the Archon data, determine:
- Last session summary - What was completed?
- Current task - Is there a task in "doing" status?
- Blockers - Any issues from previous session?
- Test status - Are all completed features passing?
If a task is in "doing" status:
- It was left incomplete from previous session
- Continue working on it (don't start new)
If no "doing" task:
- Select highest priority "todo" task
STEP 3: Verify Health of Completed Features
Before implementing new work, verify existing features work:
# Run test suite npm test # or pytest, go test, etc. # Check for build errors npm run build # or equivalent
If tests fail:
- Identify the failing feature's task in Archon
- Update task status back to "todo"
- Fix the issue BEFORE starting new work
- Re-run tests until passing
If tests pass: Continue to implementation.
STEP 4: Select and Start Task
# Find highest priority TODO task todo_tasks = find_tasks( filter_by="status", filter_value="todo", project_id=PROJECT_ID ) # Select task with highest task_order selected_task = max(todo_tasks, key=lambda t: t["task_order"]) # Mark as doing manage_task("update", task_id=selected_task["id"], status="doing", assignee="Coding Agent" )
STEP 5: Implement the Feature
Read the task description carefully. It contains:
- Requirements
- Acceptance criteria
- Test steps
- Dependencies
Implement the feature following project patterns:
- Write the code - Follow existing patterns in codebase
- Add tests - Unit and integration tests
- Update documentation - If API changes
- Handle errors - Proper error handling
Implementation Guidelines
Do:
- Follow existing code patterns
- Write tests alongside implementation
- Use meaningful variable/function names
- Add comments for complex logic
- Handle edge cases
Don't:
- Change unrelated code
- Remove existing tests
- Skip error handling
- Leave TODO comments
- Create overly complex solutions
STEP 6: Coordinate Testing
After implementation, use the harness-tester skill:
# Run tests directly npm test -- --grep "[feature-related-tests]"
Or invoke the testing workflow per your project's testing strategy.
Wait for test results. If tests fail:
- Fix the issues
- Re-run tests
- Repeat until passing
STEP 7: Coordinate Review (Optional but Recommended)
For complex features, use the harness-reviewer skill to check:
- Code quality
- Architecture consistency
- Security concerns
Address any review feedback before marking complete.
STEP 8: Mark Task Complete
Once tests pass and review (if done) is approved:
# Update task to review status first manage_task("update", task_id="<TASK_ID>", status="review", description="""[ORIGINAL_DESCRIPTION] --- ## Implementation Notes (Session [X]) - Implemented [summary of what was done] - Tests added: [list of test files/cases] - Files changed: [list of key files] ## Test Results - Unit tests: PASSING - Integration: PASSING - E2E: PASSING (if applicable) """ ) # If all tests pass, mark as done manage_task("update", task_id="<TASK_ID>", status="done" )
STEP 9: Update Session Notes
# Get current session notes notes = find_documents( project_id=PROJECT_ID, query="Session Notes" ) # Append new session current_sessions = notes["content"]["sessions"] current_sessions.append({ "session_number": len(current_sessions) + 1, "agent": "harness-coder", "date": "<TIMESTAMP>", "status": "completed", "task_completed": { "id": "<TASK_ID>", "title": "<TASK_TITLE>", "feature": "<FEATURE_GROUP>" }, "files_changed": [ # List of files modified ], "tests_added": [ # List of test files/cases added ], "notes": [ # Any important context ], "next_priority": { "id": "<NEXT_TASK_ID>", "title": "<NEXT_TASK_TITLE>" } }) manage_document("update", project_id=PROJECT_ID, document_id="<NOTES_DOC_ID>", content={ "sessions": current_sessions, "current_focus": "<NEXT_TASK_TITLE>", "blockers": [], "next_steps": [ "Continue with <NEXT_TASK_TITLE>", ], "decisions": notes["content"].get("decisions", []) } )
STEP 10: Update META Task
# Get task stats all_tasks = find_tasks(filter_by="project", filter_value=PROJECT_ID) done_count = len([t for t in all_tasks if t["status"] == "done"]) total_count = len([t for t in all_tasks if t["feature"] != "Meta"]) manage_task("update", task_id="<META_TASK_ID>", description=f"""## Current Session Status - Session: [X] - Agent: harness-coder - Status: Complete ## Session Summary - Completed: [TASK_TITLE] - Tests: All passing - Files changed: [X] files ## Progress - Total Tasks: {total_count} - Completed: {done_count} - Remaining: {total_count - done_count} - Progress: {int(done_count/total_count*100)}% ## Next Session - Task: [NEXT_TASK_TITLE] - Task ID: [NEXT_TASK_ID] - Priority: [PRIORITY] --- Last Updated: <TIMESTAMP>""" )
STEP 11: Commit Changes
git add . git commit -m "[FEATURE_GROUP]: [TASK_TITLE] Implemented: - [Summary point 1] - [Summary point 2] Tests: - Added [X] unit tests - Added [X] integration tests Task: [TASK_ID] - DONE Session: [X] Archon Project: [PROJECT_ID]"
STEP 12: Clean Handoff Summary
Display summary for next session:
## Session [X] Complete ### Task Completed - **Title**: [TASK_TITLE] - **Feature**: [FEATURE_GROUP] - **Status**: Done ### Changes Made | File | Change | |------|--------| | src/... | Added ... | | tests/... | Added ... | ### Test Results - Unit: [X]/[X] passing - Integration: [X]/[X] passing - E2E: [X]/[X] passing ### Progress - Completed: [X]/[TOTAL] tasks ([X]%) - Remaining: [Y] tasks ### Next Task - **Title**: [NEXT_TASK_TITLE] - **Priority**: [PRIORITY] - **Feature**: [FEATURE_GROUP] --- Use /harness-coder skill to continue.
Handling Issues
If You Find Bugs in Existing Features
- Create a new high-priority task:
manage_task("create", project_id=PROJECT_ID, title="Fix: [Bug description]", description="...", status="todo", task_order=98, # High priority feature="Bugfix" ) - Update the affected feature's task status
- Fix before continuing with new features
If Tests Won't Pass
- Spend reasonable time debugging
- If stuck, document the issue:
manage_task("update", task_id="<TASK_ID>", status="todo", # Reset to todo description="""[ORIGINAL + ] --- ## Blocker (Session [X]) - Issue: [Description] - Tried: [What you attempted] - Needs: [What help is needed] """ ) - Update session notes with blocker
- Move to next task if appropriate
If Environment Breaks
- Try to fix using git history:
,git diffgit checkout - Document what happened
- Create high-priority fix task
- Don't leave environment broken
Critical Rules
- ONE FEATURE PER SESSION - Don't try to do too much
- NEVER SKIP TESTS - Always run tests after implementation
- NEVER REMOVE TESTS - Fix code, not tests
- ALWAYS UPDATE ARCHON - Tasks, session notes, META task
- ALWAYS COMMIT - Clean state for next session
- FIX BUGS FIRST - Existing issues before new features
- CLEAN HANDOFF - Next session should understand state immediately
Quick Reference: Archon Commands
# Find tasks find_tasks(filter_by="project", filter_value=PROJECT_ID) find_tasks(filter_by="status", filter_value="todo") find_tasks(task_id="<specific_id>") # Update task status manage_task("update", task_id="...", status="doing") manage_task("update", task_id="...", status="review") manage_task("update", task_id="...", status="done") # Get documents find_documents(project_id=PROJECT_ID, query="Session Notes") # Update documents manage_document("update", project_id=PROJECT_ID, document_id="...", content={...})
Session Time Management
Typical session should:
- First 5 min: Orient and verify health
- Main portion: Implement feature
- Last 10 min: Test, update Archon, commit, handoff
If running low on context/time:
- Stop at a clean point
- Update task with progress notes
- Commit partial work
- Update session notes with "in progress" status
- Handoff for next session to continue