Orchestration & Rules

Orchestration & Rules

Operational governance layer: multi-agent coordination, IDE conventions, repository context, task directives, and hardcoded safety gates.


AGENTS ๐Ÿค– Ego Playbook

Codebase architecture, multi-agent coordination rules, and mandatory boot/memory sequences.

Agent Types

TypeRoleSpawn MethodAutonomy
PrimaryMain hermes-agent (this instance)Gateway startupFull
Subagent (leaf)Isolated reasoning taskdelegate_taskTask-scoped
Subagent (orchestrator)Coordinates multiple leavesdelegate_task(role='orchestrator')Workflow-scoped
Cron AgentScheduled autonomous runcronjobPrompt-scoped
Skill AgentSkill-execution contextSkill invocationSkill-scoped

Coordination Rules

1
2
3
4
5
6
coordination:
  max_concurrent_children: 3
  max_spawn_depth: 1  # No nested delegation
  orchestrator_enabled: false
  context_isolation: true  # Subagents know nothing of parent
  verification_required: true  # All external side-effects must return handles

Mandatory Boot Sequence

1
2
3
4
5
6
7
8
graph TD
    A[Gateway Start] --> B[Load config.yaml]
    B --> C[Source ~/.hermes/.env]
    C --> D[Load pinned skills]
    D --> E[Inject MEMORY]
    E --> F[Inject USER profile]
    F --> G[Verify IDENTITY_HASH]
    G --> H[Ready]

Memory Injection Protocol

Every agent turn receives:

  1. MEMORY (semantic base) โ€” full
  2. USER profile โ€” full
  3. IDENTITY_HASH markers โ€” full
  4. Recent FEEDBACK-LOG โ€” last 5 entries
  5. Active PLAN โ€” current goal state

CLAUDE ๐Ÿ“œ Cascading Conventions

IDE/directory-scoped guidelines for build steps, testing, and linting (loads local > global).

Hierarchy

1
2
3
4
5
6
7
8
9
Global (~/.claude/CLAUDE.md)
    โ”‚
    โ”œโ”€ Project (~/.hermes/hermes-agent/CLAUDE.md)
    โ”‚
    โ”œโ”€ Project (~/hugo-llm-wiki/CLAUDE.md)
    โ”‚
    โ”œโ”€ Project (~/svelte-flexiboards-dashboard/CLAUDE.md)
    โ”‚
    โ””โ”€ Project (~/.hermes/plugins/omp-suite/CLAUDE.md)

Convention Categories

CategoryScopeExample
BuildPer-projecthugo --minify, npm run build, cargo build --release
TestPer-projectpytest -n 4, vitest run, cargo test
LintPer-projectruff check, eslint ., cargo clippy
FormatPer-projectruff format, prettier --write, cargo fmt
TypecheckPer-projectpyright, tsc --noEmit, cargo check

Loading Protocol

  1. Search upward from working directory for CLAUDE.md
  2. Merge: global โ†’ project โ†’ subdirectory (last wins)
  3. Apply to all terminal/execute_code operations in that context

CONTEXT ๐ŸŒ Background Scope

General repository background and project scope discovered upward from working directory.

Discovery Process

1
2
# On session start or workdir change
find . -maxdepth 3 -name "README*" -o -name "AGENTS.md" -o -name "CLAUDE.md" -o -name ".cursorrules" | head -20

Context Package

ElementSourceInjected
Project typepackage.json, Cargo.toml, go.mod, pyproject.tomlYes
ArchitectureARCHITECTURE.md, docs/architecture/Yes
ConventionsCLAUDE.md, .cursorrules, AGENTS.mdYes
Scriptspackage.json scripts, Makefile, justfileYes
Dependencieslock files, requirements.txtSummary only

guidelines โš–๏ธ Task Directives

Technical instructions nested in .junie/ defining exactly how the agent updates checklists.

Structure

1
2
3
4
5
.junie/
โ”œโ”€โ”€ guidelines.md          # Master directives
โ”œโ”€โ”€ checklist-updates.md   # How to modify tasks
โ”œโ”€โ”€ verification.md        # Verification standards
โ””โ”€โ”€ handoff.md             # Subagent handoff protocol

Core Directives

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# .junie/guidelines.md

## Checklist Updates
- Only ONE item `in_progress` at a time
- Mark `completed` IMMEDIATELY when done
- If failed โ†’ `cancelled` + add revised item
- Never batch-complete without verification

## Verification Standards
- External writes: return handle (URL, path, HTTP status)
- Verify handle before reporting success
- Internal state: read back to confirm

## Subagent Handoff
- Pass ALL context: paths, errors, constraints
- Specify language/tone if non-English
- Require verifiable handles in summary

OPS ๐Ÿ”ง Protocol Gates

Hardcoded operational boundaries, credentials, and safety validation checks for execution.

Hard Boundaries

GateCheckAction on Fail
Model ConfigValid provider/model in config.yamlFallback to owl-alpha
Env Sourcingsource ~/.hermes/.env in cronAbort with error
Token SafetyNo token-like strings in execute_codeWrite file โ†’ python3 /tmp/x.py
Background Lifenotify_on_complete=true for bounded bgWarn, auto-convert
Cross-Profilecross_profile=true required for other profilesBlock with warning
Skill PinningPinned skills need hermes curator unpinRefuse delete

Credential Handling

1
2
3
4
5
# NEVER in execute_code heredocs
# ALWAYS via Python env=dict
import os
env = {k: v for k, v in (line.split('=', 1) for line in open('.env'))}
subprocess.run(cmd, env={**os.environ, **env})

Safety Validation Checklist


Cross-References


Orchestration & Rules is the constitutional layer โ€” it governs HOW the system operates, not WHAT it knows.