| name | agent-core |
| description | Guides the implementation of the ReAct loop, orchestrator, memory, and planner. Use this when working on any file inside backend/agent/. |
Agent Core Skill
ReAct Loop
The agent follows a strict Think → Act → Observe cycle. Never break this pattern.
- THINK: Reason about current state, decide next action
- ACT: Call exactly one tool with precise arguments
- OBSERVE: Read output, update memory, decide next step
- REPEAT until goal is achieved
The agent never outputs free text mid-loop. Only the final DONE step produces a summary.
Orchestrator Rules
- Maintain the ReAct loop until task completion
- Inject
workspace_context into LLM on every step
- Route tool calls through Tool Router, never call tools directly
- Write every observation back to memory
workspace_context Shape
Always injected before each ReAct step:
{
"session_id": "...",
"target": "...",
"completed_tasks": [],
"pending_tasks": [],
"recent_findings": [],
"open_artifacts": []
}
Memory Rules
- Short-term: last N steps of current session (in-memory)
- Long-term:
workspace/.agent/findings.json (persisted)
- Never dump full history into LLM context — only recent + relevant
Planner Rules
- Decompose high-level goal into ordered task list on session start
- Store task list in
workspace/.agent/plan.json
- Tick off tasks as they complete
- Re-plan if a dead end is reached