# supersaiyane/loopengineering architecture

> Architecture diagram of the GitHub repository supersaiyane/loopengineering, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/supersaiyane/loopengineering
- Repository: https://github.com/supersaiyane/loopengineering

## Overview

Loop Engineering is a Kiro IDE orchestration system that turns a prompt into appropriately sized engineering work: the hook classifies the task and selects an execution mode, loads steering and role-specific skills, then agents execute under quality gates. The documented workflow also covers discovery for ambiguous requests and persistence of lessons and decisions across sessions. The README describes the high-level wiring; source excerpts here are from a separate nested HealthGuard Pro project, so implementation-level links for Loop Engineering are limited to documented relationships.

Main entry points: [`kiro/steering/loop-engine.md`](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/loop-engine.md) (Plan Do Verify), [`kiro/hooks/elite-team-orchestrator.json`](https://github.com/supersaiyane/loopengineering/blob/main/kiro/hooks/elite-team-orchestrator.json) (Orchestrator Hook), [`kiro/skills`](https://github.com/supersaiyane/loopengineering/tree/main/kiro/skills) (Agent Roles), [`kiro/memory`](https://github.com/supersaiyane/loopengineering/tree/main/kiro/memory) (Session Memory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Task Routing"]
  node_hook["Orchestrator Hook"]
  node_discovery["Discovery Engine"]
  node_modes["Execution Modes"]
end

subgraph group_guidance["Agent Guidance"]
  node_steering["Steering Rules"]
  node_skill_matrix["Skill Selection"]
  node_skills["Role Skills"]
end

subgraph group_execution["Execution and Quality"]
  node_roles["Agent Roles"]
  node_execution_loop["Plan Do Verify<br/>[loop-engine.md]"]
  node_gates["Quality Gates<br/>[session-guards.md]"]
  node_bad_loop["Risk Guards<br/>[session-guards.md]"]
  node_ponytail["Reuse Ladder<br/>[ponytail.md]"]
end

subgraph group_memory["Persistent Context"]
  node_memory["Session Memory"]
  node_lessons["Lessons<br/>[lessons.md]"]
  node_checkpoint["Checkpoint<br/>[checkpoint.md]"]
  node_decisions["Decisions<br/>[decisions.md]"]
end

node_engineer(("Engineer"))
node_result(("Engineering Work"))

node_engineer -->|"submits prompt"| node_hook
node_hook -->|"selects mode"| node_modes
node_hook -->|"invokes when unclear"| node_discovery
node_hook -->|"loads"| node_steering
node_hook -->|"activates"| node_roles
node_skill_matrix -->|"maps labels to"| node_skills
node_roles -->|"uses"| node_skills
node_roles -->|"executes"| node_execution_loop
node_execution_loop -->|"runs checks"| node_gates
node_bad_loop -->|"requires confirmation"| node_execution_loop
node_ponytail -->|"guides reuse"| node_execution_loop
node_execution_loop -->|"produces"| node_result
node_execution_loop -->|"updates"| node_memory
node_memory -->|"records lessons"| node_lessons
node_memory -->|"records progress"| node_checkpoint
node_steering -.->|"preserves decisions"| node_decisions

click node_hook "https://github.com/supersaiyane/loopengineering/blob/main/kiro/hooks/elite-team-orchestrator.json"
click node_discovery "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/discovery-engine.md"
click node_modes "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/orchestrator-routing.md"
click node_steering "https://github.com/supersaiyane/loopengineering/tree/main/kiro/steering"
click node_skill_matrix "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/skill-selection-matrix.md"
click node_skills "https://github.com/supersaiyane/loopengineering/tree/main/kiro/skills"
click node_roles "https://github.com/supersaiyane/loopengineering/tree/main/kiro/skills"
click node_execution_loop "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/loop-engine.md"
click node_gates "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/session-guards.md"
click node_bad_loop "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/session-guards.md"
click node_ponytail "https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/ponytail.md"
click node_memory "https://github.com/supersaiyane/loopengineering/tree/main/kiro/memory"
click node_lessons "https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/lessons.md"
click node_checkpoint "https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/checkpoint.md"
click node_decisions "https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/decisions.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hook,node_discovery,node_modes toneBlue
class node_steering,node_skill_matrix,node_skills toneAmber
class node_roles,node_execution_loop,node_gates,node_bad_loop,node_ponytail toneMint
class node_memory,node_lessons,node_checkpoint,node_decisions toneRose
class node_engineer,node_result toneIndigo
```

## Components

### Task Routing

- [Orchestrator Hook](https://github.com/supersaiyane/loopengineering/blob/main/kiro/hooks/elite-team-orchestrator.json): `kiro/hooks/elite-team-orchestrator.json`
- [Discovery Engine](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/discovery-engine.md): `kiro/steering/discovery-engine.md`
- [Execution Modes](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/orchestrator-routing.md): `kiro/steering/orchestrator-routing.md`

### Agent Guidance

- [Steering Rules](https://github.com/supersaiyane/loopengineering/tree/main/kiro/steering): `kiro/steering`
- [Skill Selection](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/skill-selection-matrix.md): `kiro/steering/skill-selection-matrix.md`
- [Role Skills](https://github.com/supersaiyane/loopengineering/tree/main/kiro/skills): `kiro/skills`

### Execution and Quality

- [Agent Roles](https://github.com/supersaiyane/loopengineering/tree/main/kiro/skills): `kiro/skills`
- [Plan Do Verify](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/loop-engine.md): `kiro/steering/loop-engine.md`
- [Quality Gates](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/session-guards.md): `kiro/steering/session-guards.md`
- [Risk Guards](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/session-guards.md): `kiro/steering/session-guards.md`
- [Reuse Ladder](https://github.com/supersaiyane/loopengineering/blob/main/kiro/steering/ponytail.md): `kiro/steering/ponytail.md`

### Persistent Context

- [Session Memory](https://github.com/supersaiyane/loopengineering/tree/main/kiro/memory): `kiro/memory`
- [Lessons](https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/lessons.md): `kiro/memory/lessons.md`
- [Checkpoint](https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/checkpoint.md): `kiro/memory/checkpoint.md`
- [Decisions](https://github.com/supersaiyane/loopengineering/blob/main/kiro/memory/decisions.md): `kiro/memory/decisions.md`

### Other components

- **Engineer**
- **Engineering Work**

## Connections

- Engineer → Orchestrator Hook: submits prompt (evidence: `README.md`)
- Orchestrator Hook → Execution Modes: selects mode (evidence: `README.md`)
- Orchestrator Hook → Discovery Engine: invokes when unclear (evidence: `README.md`)
- Orchestrator Hook → Steering Rules: loads (evidence: `README.md`)
- Orchestrator Hook → Agent Roles: activates (evidence: `README.md`)
- Skill Selection → Role Skills: maps labels to (evidence: `README.md`)
- Agent Roles → Role Skills: uses (evidence: `README.md`)
- Agent Roles → Plan Do Verify: executes (evidence: `README.md`)
- Plan Do Verify → Quality Gates: runs checks (evidence: `README.md`)
- Risk Guards → Plan Do Verify: requires confirmation (evidence: `README.md`)
- Reuse Ladder → Plan Do Verify: guides reuse (evidence: `README.md`)
- Plan Do Verify → Engineering Work: produces (evidence: `README.md`)
- Plan Do Verify → Session Memory: updates (evidence: `README.md`)
- Session Memory → Lessons: records lessons (evidence: `README.md`)
- Session Memory → Checkpoint: records progress (evidence: `README.md`)
- Steering Rules → Decisions: preserves decisions
