adapters/hermes/skills/cg-router/SKILL.md
Orchestrates Context Governance role chain. Classifies tasks, determines routes, and executes each role sequentially via delegation. Use this as the entry point for any governed task in Hermes.
npx skillsauth add dominonotesexpert/context-governance cg-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You orchestrate the Context Governance role chain. You classify tasks, determine the correct role sequence, and delegate to each role in order using delegate_task.
You do NOT perform any role's work yourself. You classify, delegate, collect, and hand off.
Call governance_classify_task(description="<user's task description>").
This returns:
task_type: bug, feature, design, or authorityroute: ordered list of roles (e.g., ["system-architect", "module-architect", "implementation", "verification"])confidence: 0.0–1.0requires_user_confirmation: true if confidence < 0.7If requires_user_confirmation is true, present the classification to the user and wait for confirmation before proceeding.
Call MCP governance_start_task(task_type, affected_modules, session_id) to create a receipt.
Store the returned task_id for all subsequent operations.
delegate_task(
goal="Execute System Architect role for task: <user description>",
context="""
Task ID: <task_id>
Task Type: <task_type>
Full Route: <route>
You are the System Architect. Follow the cg-system-architect skill protocol.
Use governance_load_role_context(role="system-architect") to load documents.
Use governance_enforce_hardgate to verify HARD-GATE.
Use governance_check_authority before any file writes.
OUTPUT REQUIRED (structured):
- baseline_constraints: extracted constraints for downstream roles
- governance_mode: current mode
- stale_documents: list of stale docs (if any)
- judgments: any conflict resolutions made
- escalations: any escalations needed (with type and description)
""",
toolsets=["governance-guard", "mcp-context-governance", "file", "terminal"]
)
Extract baseline_constraints from the System Architect's output.
For each remaining role in the route:
delegate_task(
goal="Execute <role> for task: <user description>",
context="""
Task ID: <task_id>
Task Type: <task_type>
Baseline Constraints: <baseline_constraints from SA>
Previous Role Outputs: <accumulated outputs from prior roles>
Target Module: <module name>
You are the <role>. Follow the cg-<role> skill protocol.
Use governance_load_role_context(role="<role>", module="<module>",
baseline_constraints="<baseline_constraints>")
Use governance_enforce_hardgate to verify HARD-GATE.
Use governance_check_authority before any file writes.
OUTPUT REQUIRED (structured):
<role-specific output requirements>
""",
toolsets=["governance-guard", "mcp-context-governance", "file", "terminal"]
)
Accumulate each role's output for the next role in the chain.
When the Debug role completes, check the root_cause_level in its output:
| Level | Remaining Route |
|-------|----------------|
| code | implementation → verification |
| module | implementation → verification |
| cross-module | module-architect → implementation → verification |
| engineering-constraint | system-architect → module-architect → implementation → verification |
| architecture | system-architect → module-architect → implementation → verification |
| baseline | STOP — escalate to user. No further automated routing. |
Replace the remaining route with the level-appropriate route and continue from Step 4.
If any role returns an escalation in its output:
governance_record_escalationAfter the final role (usually Verification) completes:
governance_complete_task(task_id) to finalize the receiptSince each delegate_task creates a fresh agent with no history, ALL needed information must be serialized into the context parameter. Maintain a role_outputs dictionary:
role_outputs = {
"system-architect": { baseline_constraints, governance_mode, judgments },
"module-architect": { module_contract_summary, boundary_notes },
"debug": { root_cause, root_cause_level, debug_case_path, fix_scope },
"implementation": { changes_summary, files_modified },
"verification": { verdict, evidence_list, risks },
}
Each subsequent role receives ALL previous outputs in its context.
If accumulated outputs exceed reasonable size, compress following CG priority:
development
Validates Context Governance compliance — task routing, protected artifact checks, receipt management, and pre-commit gates. For use with Hermes Agent.
testing
Activates when verifying implementation against contracts, when claiming work is complete, or when assessing whether tests actually prove contract satisfaction. Use for evidence-based acceptance.
development
Activates when documents conflict, when historical mitigations are treated as baselines, when code is treated as design truth, when authority hierarchy needs adjudication, or when PROJECT_BASELINE has been created/updated and derived documents need to be generated or refreshed. Use for system-level truth arbitration and baseline derivation.
testing
Activates when defining module contracts, boundaries, dataflow, or workflows. Use when a module's responsibilities, inputs/outputs, or upstream/downstream interfaces need to be specified or updated.