graph-engineeringlisted
Install: claude install-skill BhaveshKhaple/bhavesh-claude-skills
# Graph Engineering — Agent Workflow Design
> **Invoke this skill whenever you are designing any multi-step LLM or agent task.**
> The goal: replace fragile linear chains with resilient graphs where agents can reflect, branch, and self-correct.
---
## The Problem This Fixes
Most people who build a multi-step agent end up with a **straight line**:
```
prompt → step 1 → step 2 → step 3 → output
```
When step 1 emits imperfect output, everything downstream compounds the error — silently.
**Graph Engineering** turns that chain into a *network* where:
- Nodes can loop and self-correct (**reflection**)
- Agents can reach outside themselves for fresh data (**tool use**)
- Intent is made explicit before execution (**planning**)
- Responsibilities are split across specialists (**multi-agent**)
- Output quality is verified against a rubric before shipping (**critique**)
> Core insight from Andrew Ng's 4-agentic-patterns paper + codila's framing:
> **Loops let agents think. Graphs let agents remember.**
---
## The 5 Layers
Apply these in order. **Do NOT add all 5 by default** — each layer adds latency and cost. Add only what a real failure mode demands.
---
### Layer 1 — Reflection Loop
**What:** Agent generates → second prompt critiques its own output → agent revises.
**Add when:**
- First draft is almost-right but has a fixable, predictable flaw (wrong tone, missed edge case, minor hallucination)
- The task is creative or open-ended (writing, code architecture, explanat