[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758HG4H408VB589577149S1":3,"skill-same:01M758HG4H408VB589577149S1":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M758HG4H408VB589577149S1","autonomous-loop",null,"How Cavekit's autonomous execution loop works — state machine, stop hook,\ncompletion sentinel, lock, budgets, iteration cap. Read this skill any time\nyou are about to run \u002Fck:make, debug a stuck session, or write a new command\nthat needs the loop. Trigger phrases: \"how does the loop work\", \"stop hook\",\n\"autonomous\", \"completion sentinel\", \"why is the session looping\".","davidcoachdev\u002Fdcfiles","davidcoachdev","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F69812733?v=4","01M758C4BR16TAV1N47W319E9V","David H. Caycedo Blum.","01M758C4CCZA2ZYGA0BGMXCDRH",1,"MIT","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fautonomous-loop\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: autonomous-loop\ndescription: |\n  How Cavekit's autonomous execution loop works — state machine, stop hook,\n  completion sentinel, lock, budgets, iteration cap. Read this skill any time\n  you are about to run \u002Fck:make, debug a stuck session, or write a new command\n  that needs the loop. Trigger phrases: \"how does the loop work\", \"stop hook\",\n  \"autonomous\", \"completion sentinel\", \"why is the session looping\".\n---\n\n# Autonomous Loop\n\nThe loop lets a single `\u002Fck:make` invocation run dozens of agent iterations\nwithout user intervention, while still respecting per-task budgets, session\nbudgets, and explicit user-approval gates.\n\n## Architecture\n\n```\n┌─────────────────┐  Stop event   ┌────────────────────┐\n│  Claude Code    │──────────────▶│   stop-hook.sh     │\n│   session       │               │  (.cavekit\u002Floop    │\n└─────────────────┘               │   active?)         │\n        ▲                         └─────────┬──────────┘\n        │                                   │ route()\n        │ next prompt injected              ▼\n        │                         ┌────────────────────┐\n        │                         │ cavekit-tools.cjs  │\n        │                         │  routeDecision()   │\n        │                         │  + status-block    │\n        │                         │  + backprop-       │\n        │                         │    directive       │\n        │                         └─────────┬──────────┘\n        │                                   │\n        └───────── {decision:\"block\",       │\n                    reason:\u003Cnext prompt>} ◀─┘\n```\n\n## Files the loop touches\n\nAll under `\u003Cproject>\u002F.cavekit\u002F`:\n\n| File                            | Writer                | Purpose                                      |\n|---------------------------------|-----------------------|----------------------------------------------|\n| `.loop.json`                    | setup-loop            | Sentinel; stop-hook no-ops without it.       |\n| `.loop.lock`                    | stop-hook (heartbeat) | Single-writer lock. PID + hostname + ts.     |\n| `state.md`                      | cavekit-tools         | `phase`, `current_task`, `iteration`.        |\n| `token-ledger.json`             | token-monitor hook    | Session + per-task token tallies.            |\n| `task-status.json`              | commands              | Authoritative task registry.                 |\n| `.progress.json`                | progress-tracker      | Zero-context UI snapshot.                    |\n| `.auto-backprop-pending.json`   | auto-backprop hook    | Flag file from failed tests.                 |\n| `history\u002Fbackprop-log.md`       | backprop skill        | Append-only trace log.                       |\n| `capabilities.json`             | discover command      | MCP + CLI tool detection.                    |\n\n## Lifecycle\n\n1. **Setup** — `\u002Fck:make` calls:\n   ```\n   node \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" setup-loop\n   ```\n   This writes `.loop.json` (activating the stop hook) and resets `state.md`.\n\n2. **Work** — the agent does one wave of task execution per iteration.\n\n3. **Stop fires** — Claude Code's Stop event triggers `stop-hook.sh`. The hook:\n   - reads stdin for `session_id` and `transcript_path`\n   - acquires \u002F refreshes the lock\n   - scans the last 20 transcript lines for `\u003Cpromise>CAVEKIT COMPLETE\u003C\u002Fpromise>`\n   - if sentinel found → teardown + exit silently\n   - else → asks `routeDecision()` for the next prompt\n   - prepends the backprop directive if the flag file exists\n   - returns `{\"decision\":\"block\",\"reason\":\u003Cnext prompt>}`\n\n4. **Repeat** — Claude Code treats `decision:block` + `reason:...` as a new\n   user message, so the session continues.\n\n5. **Teardown** — one of:\n   - completion sentinel detected\n   - max-iterations reached (`CAVEKIT_MAX_ITERATIONS`)\n   - session budget exhausted (`CAVEKIT_BUDGET_EXHAUSTED`)\n   - lock stolen by another session (`CAVEKIT_LOCK_CONFLICT`)\n   - user interrupt (hook returns no output; session stops normally)\n\n## Completion sentinel\n\nTo end the loop cleanly, emit exactly:\n\n```\n\u003Cpromise>CAVEKIT COMPLETE\u003C\u002Fpromise>\n```\n\nThe hook searches for this literal in the last 20 transcript lines. Put it on\nits own line at the very end of the final message. Do not wrap it in code\nfences or paraphrase it — the search is a literal substring match.\n\n## Terminal sentinels\n\nWhen `routeDecision()` cannot safely continue, it returns one of these\nstrings instead of a prompt:\n\n| Sentinel                     | Meaning                               |\n|------------------------------|---------------------------------------|\n| `CAVEKIT_LOOP_DONE`          | All tasks complete. Hook exits silent.|\n| `CAVEKIT_MAX_ITERATIONS`     | Iteration cap hit. Loop halted.       |\n| `CAVEKIT_BUDGET_EXHAUSTED`   | Session budget exhausted.             |\n| `CAVEKIT_LOCK_CONFLICT`      | Another session owns the lock.        |\n\nThe hook translates each into a short user-facing message before returning.\n\n## Lock protocol\n\nThe lock is a JSON file (`.loop.lock`) with `{owner, pid, host, heartbeat_at}`.\n\n- **Owner tag**: `session:\u003Csession_id>`.\n- **Heartbeat**: every Stop invocation refreshes `heartbeat_at`.\n- **Stale**: > 5 minutes since last heartbeat. A new session may steal a stale\n  lock.\n- **Conflict**: non-owner with fresh lock → returns `CAVEKIT_LOCK_CONFLICT`.\n\nNever delete `.loop.lock` while a session might be active. Use\n`cavekit-tools release-lock --owner \u003Ctag>` instead.\n\n## Debugging a stuck loop\n\n```bash\n# Inspect current state\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" status\n\n# Who holds the lock?\ncat .cavekit\u002F.loop.lock\n\n# What would the router do right now?\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" route\n\n# Drop the loop entirely (safe after a crash)\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" teardown-loop\n```\n\nTurn on debug logging by exporting `CAVEKIT_DEBUG=1`. The hook will write to\n`.cavekit\u002F.debug.log`.\n\n## What not to do\n\n- Do **not** hand-edit `state.md`'s `phase` field while a loop is active. The\n  hook assumes single-writer semantics and will overwrite you.\n- Do **not** set your own stop hook that also blocks. Multiple blocking hooks\n  race, and Claude Code picks one arbitrarily.\n- Do **not** emit the completion sentinel unless every task in the registry is\n  truly `complete`. The hook trusts the sentinel and tears down immediately.\n","# Autonomous Loop\n\nThe loop lets a single `\u002Fck:make` invocation run dozens of agent iterations\nwithout user intervention, while still respecting per-task budgets, session\nbudgets, and explicit user-approval gates.\n\n## Architecture\n\n```\n┌─────────────────┐  Stop event   ┌────────────────────┐\n│  Claude Code    │──────────────▶│   stop-hook.sh     │\n│   session       │               │  (.cavekit\u002Floop    │\n└─────────────────┘               │   active?)         │\n        ▲                         └─────────┬──────────┘\n        │                                   │ route()\n        │ next prompt injected              ▼\n        │                         ┌────────────────────┐\n        │                         │ cavekit-tools.cjs  │\n        │                         │  routeDecision()   │\n        │                         │  + status-block    │\n        │                         │  + backprop-       │\n        │                         │    directive       │\n        │                         └─────────┬──────────┘\n        │                                   │\n        └───────── {decision:\"block\",       │\n                    reason:\u003Cnext prompt>} ◀─┘\n```\n\n## Files the loop touches\n\nAll under `\u003Cproject>\u002F.cavekit\u002F`:\n\n| File                            | Writer                | Purpose                                      |\n|---------------------------------|-----------------------|----------------------------------------------|\n| `.loop.json`                    | setup-loop            | Sentinel; stop-hook no-ops without it.       |\n| `.loop.lock`                    | stop-hook (heartbeat) | Single-writer lock. PID + hostname + ts.     |\n| `state.md`                      | cavekit-tools         | `phase`, `current_task`, `iteration`.        |\n| `token-ledger.json`             | token-monitor hook    | Session + per-task token tallies.            |\n| `task-status.json`              | commands              | Authoritative task registry.                 |\n| `.progress.json`                | progress-tracker      | Zero-context UI snapshot.                    |\n| `.auto-backprop-pending.json`   | auto-backprop hook    | Flag file from failed tests.                 |\n| `history\u002Fbackprop-log.md`       | backprop skill        | Append-only trace log.                       |\n| `capabilities.json`             | discover command      | MCP + CLI tool detection.                    |\n\n## Lifecycle\n\n1. **Setup** — `\u002Fck:make` calls:\n   ```\n   node \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" setup-loop\n   ```\n   This writes `.loop.json` (activating the stop hook) and resets `state.md`.\n\n2. **Work** — the agent does one wave of task execution per iteration.\n\n3. **Stop fires** — Claude Code's Stop event triggers `stop-hook.sh`. The hook:\n   - reads stdin for `session_id` and `transcript_path`\n   - acquires \u002F refreshes the lock\n   - scans the last 20 transcript lines for `\u003Cpromise>CAVEKIT COMPLETE\u003C\u002Fpromise>`\n   - if sentinel found → teardown + exit silently\n   - else → asks `routeDecision()` for the next prompt\n   - prepends the backprop directive if the flag file exists\n   - returns `{\"decision\":\"block\",\"reason\":\u003Cnext prompt>}`\n\n4. **Repeat** — Claude Code treats `decision:block` + `reason:...` as a new\n   user message, so the session continues.\n\n5. **Teardown** — one of:\n   - completion sentinel detected\n   - max-iterations reached (`CAVEKIT_MAX_ITERATIONS`)\n   - session budget exhausted (`CAVEKIT_BUDGET_EXHAUSTED`)\n   - lock stolen by another session (`CAVEKIT_LOCK_CONFLICT`)\n   - user interrupt (hook returns no output; session stops normally)\n\n## Completion sentinel\n\nTo end the loop cleanly, emit exactly:\n\n```\n\u003Cpromise>CAVEKIT COMPLETE\u003C\u002Fpromise>\n```\n\nThe hook searches for this literal in the last 20 transcript lines. Put it on\nits own line at the very end of the final message. Do not wrap it in code\nfences or paraphrase it — the search is a literal substring match.\n\n## Terminal sentinels\n\nWhen `routeDecision()` cannot safely continue, it returns one of these\nstrings instead of a prompt:\n\n| Sentinel                     | Meaning                               |\n|------------------------------|---------------------------------------|\n| `CAVEKIT_LOOP_DONE`          | All tasks complete. Hook exits silent.|\n| `CAVEKIT_MAX_ITERATIONS`     | Iteration cap hit. Loop halted.       |\n| `CAVEKIT_BUDGET_EXHAUSTED`   | Session budget exhausted.             |\n| `CAVEKIT_LOCK_CONFLICT`      | Another session owns the lock.        |\n\nThe hook translates each into a short user-facing message before returning.\n\n## Lock protocol\n\nThe lock is a JSON file (`.loop.lock`) with `{owner, pid, host, heartbeat_at}`.\n\n- **Owner tag**: `session:\u003Csession_id>`.\n- **Heartbeat**: every Stop invocation refreshes `heartbeat_at`.\n- **Stale**: > 5 minutes since last heartbeat. A new session may steal a stale\n  lock.\n- **Conflict**: non-owner with fresh lock → returns `CAVEKIT_LOCK_CONFLICT`.\n\nNever delete `.loop.lock` while a session might be active. Use\n`cavekit-tools release-lock --owner \u003Ctag>` instead.\n\n## Debugging a stuck loop\n\n```bash\n# Inspect current state\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" status\n\n# Who holds the lock?\ncat .cavekit\u002F.loop.lock\n\n# What would the router do right now?\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" route\n\n# Drop the loop entirely (safe after a crash)\nnode \"${CLAUDE_PLUGIN_ROOT}\u002Fscripts\u002Fcavekit-tools.cjs\" teardown-loop\n```\n\nTurn on debug logging by exporting `CAVEKIT_DEBUG=1`. The hook will write to\n`.cavekit\u002F.debug.log`.\n\n## What not to do\n\n- Do **not** hand-edit `state.md`'s `phase` field while a loop is active. The\n  hook assumes single-writer semantics and will overwrite you.\n- Do **not** set your own stop hook that also blocks. Multiple blocking hooks\n  race, and Claude Code picks one arbitrarily.\n- Do **not** emit the completion sentinel unless every task in the registry is\n  truly `complete`. The hook trusts the sentinel and tears down immediately.\n",{"name":5,"description":7},"main","5dc86f90a5cbe45db3acd917825461b3ed6937fb","config\u002F.config\u002Fopencode\u002Fskills\u002Fautonomous-loop",0,"https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev","🌐 Apasionado por crear soluciones web escalables y eficientes. \r\n🧑‍🏫 Coach Dev.\r\n💻 Frontend Dev. \r\n🎚️Backend Dev.\r\n📊 Agile\u002FScrum.\r\n🚀100% remoto.","2026-08-26 07:28:05",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add davidcoachdev\u002Fdcfiles --skill autonomous-loop",{"tool":38,"command":39},"bunx","bunx skills add davidcoachdev\u002Fdcfiles --skill autonomous-loop",{"tool":41,"command":42},"pnpm","pnpm dlx skills add davidcoachdev\u002Fdcfiles --skill autonomous-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fautonomous-loop\u002FSKILL.md",true,[],[47,55,62,69,76,83],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7740FETMZY1VTYAEFY1TWY7","zustand-5","Zustand 5 state management patterns. Trigger: When managing React state with Zustand.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzustand-5\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M773ZZM9V68SA1AKP4WF4J29","zod-4","Zod 4 schema validation patterns. Trigger: When using Zod for validation - breaking changes from v3.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fzod-4\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M773ZJFR90CQAY0N9QR40QVP","x-bookmark-quote-posts","Workflow para revisar bookmarks de X\u002FTwitter y convertirlos en drafts de quote posts. Accede a la sección de bookmarks vía browser headless, extrae posts recientes, y genera drafts con voz personal del usuario. No publica ni muta X — solo genera contenido para revisión. Trigger: X bookmarks, Twitter bookmarks, quote posts, bookmark automation, crear quote posts, revisar bookmarks, growth content X.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fx-bookmark-quote-posts\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M773Z2RGV3786FV310SDB0YD","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M773YJH3KDSW467CSS63CSRJ","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":51,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M773Y3S3H2CPRK5S8YFHWB5C","work-unit-commits","Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.","https:\u002F\u002Fgithub.com\u002Fdavidcoachdev\u002Fdcfiles\u002Fblob\u002Fmain\u002Fconfig\u002F.config\u002Fopencode\u002Fskills\u002Fwork-unit-commits\u002FSKILL.md",[],[]]