agentleFS
strikersamstrikersam/autonomous-ai-agency/.claude/skills/ecc-harness-patterns/SKILL.md

ecc-harness-patterns

Skill12 starsChanged 29 days agoMITView on GitHub

Cross-harness agent patterns — standardize agent execution across different coding assistants

The file

Files
SKILL.md

ECC Harness Patterns Skill

Inspired by: ECC — the definitive cross-harness agent orchestration system

Purpose: Integrate multi-harness patterns from ECC into local-llm-server's agent orchestration layer.

What's Unique About ECC

ECC is a production-grade system supporting 7+ agent harnesses (Claude Code, Cursor, Codex, OpenCode, Gemini, Zed, GitHub Copilot) with:

  • Harness abstraction layer — normalize API differences
  • Hook lifecycle — session start/pause/stop/resume
  • Memory persistence — skills learned across sessions
  • Cross-harness routing — intelligent model/capability selection
  • 182K+ stars — battle-tested in real workflows

Patterns to Adopt

1. Harness Detection & Adaptation

# agents/harness_adapter.py
class HarnessAdapter:
    HARNESSES = {
        "claude_code": {"context_key": "workspace", "supports": ["streaming"]},
        "cursor": {"context_key": "editor", "supports": ["streaming", "streaming_chunks"]},
        "codex": {"context_key": "project", "supports": ["completion"]},
    }
    
    def normalize_request(self, harness_id: str, request: dict) -> dict:
        """Convert harness-native request to local-llm-server format"""

2. Session Lifecycle Hooks

ECC's /hooks/session-* pattern applied to local-llm-server:

.claude/hooks/
  ├── session-start/
  │   ├── 10-detect-harness.sh       # Identify active harness
  │   ├── 20-load-harness-prefs.sh   # Load harness-specific settings
  │   └── 30-emit-telemetry.sh       # Send harness telemetry
  ├── session-pause/
  │   └── 10-checkpoint-state.sh
  └── session-stop/
      └── 10-summarize-session.sh

3. Cross-Harness Model Selection

Extend router/model_router.py to consider harness capabilities:

class CrossHarnessRouter(ModelRouter):
    def select_model(self, task: TaskRequest, harness: str) -> str:
        """Route considering harness limits and preferences"""
        # Claude Code + reasoning task → deepseek-r1 (powerful)
        # Cursor + quick fix → qwen3-coder (fast)
        # Codex + completion → fastest available

4. Persistent Harness Registry

Track which harnesses are active and their performance:

# .claude/state/harness-registry.json
{
  "active_harnesses": ["claude_code", "cursor"],
  "session_history": [
    {
      "harness": "claude_code",
      "session_id": "sess_123",
      "model": "deepseek-r1:32b",
      "duration_sec": 1847,
      "tasks_completed": 12,
      "success_rate": 0.92
    }
  ]
}

Implementation Plan

  1. Create agents/harness_adapter.py — adapter pattern for harness differences
  2. Extend .claude/hooks/ — add session lifecycle management
  3. Update router/model_router.py — add cross-harness routing logic
  4. Create services/harness_registry.py — track active harnesses and performance
  5. Update backend/server.py — emit harness metadata in responses
  6. Add tests — tests/test_harness_adapter.py, tests/test_cross_harness_router.py

Files to Create/Modify

  • ✅ .claude/skills/ecc-harness-patterns/SKILL.md (this file)
  • agents/harness_adapter.py (new)
  • services/harness_registry.py (new)
  • .claude/hooks/session-start/10-detect-harness.sh (new)
  • router/model_router.py (extend)
  • docs/architecture/cross-harness-support.md (new)

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.