-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Josemalyson Oliveira edited this page Jun 27, 2026
·
1 revision
Technical architecture reference for HES.
HES is a prompt engineering framework — it is a set of instructions (skill files) that an LLM reads and follows when acting as a coding agent. The LLM IS the runtime.
┌─────────────────────────────────────────────────────────────┐
│ AI Agent (LLM) │
├─────────────────────────────────────────────────────────────┤
│ HES Harness │
├─────────────────────────────────────────────────────────────┤
│ SKILL.md (orchestrator) │
│ ├── skills/XX-name.md (phase skills) │
│ ├── .hes/state/current.json (state machine) │
│ ├── .hes/agents/registry.json (agent registry) │
│ ├── .hes/schemas/*.json (handoff schemas) │
│ └── scripts/hooks/*.sh (automation) │
└─────────────────────────────────────────────────────────────┘
The central mechanism is a phase-locked state machine stored in .hes/state/current.json:
ZERO → DISCOVERY → SPEC → DESIGN → DATA → RED → GREEN → SECURITY → REVIEW → DONE
| State | Condition | Action |
|---|---|---|
| ZERO | No .hes/ directory |
Trigger auto-install |
| ORPHAN |
.hes/ exists but no current.json
|
Trigger legacy recovery |
| LEGACY | No .hes/ but src/ exists |
Trigger inventory + bootstrap |
| INSTALLED_INCOMPLETE |
current.json exists but artifacts missing |
Silent auto-complete |
| HARNESS_READY | Everything in place | Ask "What is the first feature?" |
Based on Martin Fowler's framework (2026):
Internal code quality:
- Coverage ≥ 80%
- Linters
- Complexity checks
Module boundaries:
- Architectural drift detection
- ArchUnit rules
- dependency-cruiser
Code does what the spec says:
- BDD scenarios
- Traceability: BR → scenario → test
Error → write to lessons.md immediately → same lesson 2x → promote to skill file
Analyze events.log → identify patterns → improve guides/sensors
Every state transition is logged to events.log:
{
"timestamp": "2026-06-27T10:00:00Z",
"event": "phase_transition",
"from": "DISCOVERY",
"to": "SPEC",
"feature": "user-auth",
"artifacts": ["docs/discovery.md", "docs/business-rules.md"]
}HES supports multiple concurrent features with dependency tracking:
{
"features": {
"auth": { "status": "GREEN", "depends_on": [] },
"api": { "status": "SPEC", "depends_on": ["auth"] },
"ui": { "status": "ZERO", "depends_on": ["api"] }
}
}The target state transforms HES from a sequential orchestrator into an autonomous software factory:
/hes start --parallel
→ planner.md (task decomposition)
→ orchestrator.md (agent fleet dispatch)
→ [Agent Fleet] (parallel execution in Git worktrees)
→ integration
→ sequential flow (SECURITY → REVIEW → DONE)
| Decision | Rationale |
|---|---|
| Markdown as primary format | Universal, version-controlled, human-readable |
| Phase-locked workflow | Prevents skipping critical steps |
| Step budget | Prevents infinite loops |
| Event sourcing | Full audit trail |
| JSON schemas | Typed handoffs between phases |
| Trust policy | Controlled self-modification |
- Skills — All skill files
- Phases — Detailed phase descriptions
- Rules — The 34 rules
- Agents — Agent registry
Last updated: June 2026