How this skill is triggered — by the user, by Claude, or both
Slash command
/on-loop:loop-stateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill manages the session `state.json` lifecycle — creation, valid transitions, and persistence. Each session's state lives at `.on-loop/sessions/<session-name>/state.json` where `<session-name>` is `YYYYMMDD_HHMMSS_<branch-slug>` (e.g., `20260426_143052_user-management-api`).
This skill manages the session state.json lifecycle — creation, valid transitions, and persistence. Each session's state lives at .on-loop/sessions/<session-name>/state.json where <session-name> is YYYYMMDD_HHMMSS_<branch-slug> (e.g., 20260426_143052_user-management-api).
INIT → SPEC
SPEC → PLAN
PLAN → CODE
CODE → TEST
TEST → CODE (retry: test failures)
TEST → SECURITY (pass)
SECURITY → CODE (retry: security blockers)
SECURITY → DOC (pass, parallel with BUILD)
SECURITY → BUILD (pass, parallel with DOC)
DOC → REVIEW (when BUILD also complete)
BUILD → REVIEW (when DOC also complete)
REVIEW → CODE (retry: changes requested)
REVIEW → GIT (approved)
GIT → COMPLETE (commit, push, PR done)
ANY → FAILED (unrecoverable error)
FAILED → ANY (resume)
{
"version": "1.1",
"loop_id": "<uuid>",
"session_id": "<uuid>",
"prompt": "<user prompt>",
"phase": "INIT",
"started_at": "<ISO 8601>",
"updated_at": "<ISO 8601>",
"retries": {
"test_to_code": 0,
"security_to_code": 0,
"review_to_code": 0
},
"max_retries": {
"test_to_code": 3,
"security_to_code": 2,
"review_to_code": 2
},
"branch": null,
"worktree_path": ".claude/worktrees/<branch-slug>",
"session_dir": ".on-loop/sessions/<session-name>",
"pr_url": null,
"phases_completed": [],
"current_agent": "orchestrator",
"error": null,
"todos": []
}
New fields in v1.1:
session_id: UUID v4 identifying this session (same as the session directory name)worktree_path: Relative path to the git worktree for this sessionsession_dir: Relative path to the session log directory under .on-loop/sessions/When transitioning:
phases_completed (if not already there)phase to the new phaseupdated_at to current timestampcurrent_agent to the agent for the new phasestate.jsonWhen a retry is triggered:
When retry limit is exhausted:
{
"phase": "<phase that failed>",
"description": "<what wasn't resolved>",
"severity": "<CRITICAL|HIGH|MEDIUM|LOW>",
"details": "<specific issues>"
}
When an unrecoverable error occurs:
phase to "FAILED"error to a description of what went wrongupdated_at/on-loop-resume| Phase | Agent | Notes |
|---|---|---|
| INIT | orchestrator | Workspace setup |
| SPEC | architect | Spec generation |
| PLAN | orchestrator | Plan from spec |
| CODE | coding | Implementation or remediation |
| TEST | testing | Test generation and execution |
| SECURITY | security | Security audit (read-only) |
| DOC | documentation | Documentation generation |
| BUILD | build | Build infrastructure |
| REVIEW | reviewer | Final review gate (read-only) |
| GIT | orchestrator | Commit, push, create PR |
| COMPLETE | orchestrator | Summary and cleanup |
state.jsonstate.json to understand contextversion field enables future schema migrationsnpx claudepluginhub joestein/on-loop --plugin on-loopProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.