[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78DN2GNF2SGRH1AQF4MP8YS":3,"skill-same:01M78DN2GNF2SGRH1AQF4MP8YS":45},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78DN2GNF2SGRH1AQF4MP8YS","orchestra-loop",null,"Multi-agent orchestra — plan → implement → verify → review. Cursor: ambient hooks + Task subagent_type. OpenCode: orchestra conductor + subagent tool. Use for build\u002Ffix\u002Frefactor, agent loop, or cross-platform orchestra setup.","P-Core-System\u002Fpcore-orchestra","P-Core-System","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F316099351?v=4","01M78DJ0920WA62RQ0Q00B81HQ","P Core System","01M78DJ09XWRZS3VDK927QW72Z",0,"MIT","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fopencode\u002Fskills\u002Forchestra-loop\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: orchestra-loop\ndescription: >-\n  Multi-agent orchestra — plan → implement → verify → review. Cursor: ambient\n  hooks + Task subagent_type. OpenCode: orchestra conductor + subagent tool. Use for\n  build\u002Ffix\u002Frefactor, agent loop, or cross-platform orchestra setup.\n---\n\n# Orchestra Loop (Cursor + OpenCode + Qoder)\n\n- **Cursor:** runs via `~\u002F.cursor\u002F` hooks — ambient auto-start; spawn with **Task** + `subagent_type`.\n- **OpenCode:** runs via `~\u002F.config\u002Fopencode\u002F` — user talks to **orchestra** conductor; spawn with **subagent** + `agent` name (V1 `task` is retired; runtime requires OpenCode V2).\n- **Qoder:** runs via `~\u002F.qoder\u002Fsettings.json` hooks like Cursor — spawn with **Agent** + `subagent_type`.\n\nYou do not need `\u002Forchestra` on Cursor when ambient mode is ON.\n\n## Cross-platform (Cursor + OpenCode)\n\nSame four phase agent names; **different spawn tool and chaining**.\n\n| | **Cursor IDE** | **OpenCode CLI \u002F desktop** |\n|---|----------------|----------------------------|\n| User entry | Main Agent (ambient hooks) or `orchestra` conductor | `orchestra` only (`default_agent`) |\n| Spawn tool | **Task** (capital T) | **subagent** (V2; V1 `task` retired) |\n| Spawn param | `subagent_type=\"orchestra-planner\"` | `agent=\"orchestra-planner\"` + `description` |\n| Phase chain | Hooks `subagentStop` auto-advance | Conductor calls **subagent** once per phase |\n| Phase visibility | Task picker | `hidden: true` — not in @ menu |\n\nFull matrix: `docs\u002Forchestra-cross-platform.md` · agent ref: `references\u002Forchestra-spawn-matrix.md`\n\n## Cursor Task limitation (conductor fallback)\n\nIf Cursor `Task` rejects `subagent_type=orchestra-*` (enum \u002F unknown agent), the parent **MUST** keep the loop alive: run phases itself **or** spawn `generalPurpose` loaded with instructions from `~\u002F.cursor\u002Fagents\u002Forchestra-*.md`. Do **not** stop the loop. Hooks still match those names when custom agents work.\n\n### Anti-stop (CRITICAL — Cursor conductor)\n\nWhen orchestra is **active**, or the user said **continue \u002F until finish \u002F do all \u002F don't stop**:\n\n1. **Do not** end turns with “Done \u002F Next (1)(2)(3)” choice menus that wait for the user.\n2. After `PLAN_READY` → immediately implement → commit → verify → review in the **same** run (conductor fallback).\n3. After `ORCHESTRA_COMPLETE`, if the plan **Handoff** \u002F user goal still has unfinished work → `orchestra-enable.js start \"\u003Cnext goal>\"` and run the next loop **immediately**.\n4. Only stop when: user goal is fully done, user says **stop**, or 5 resumes fail on one phase — then one short summary (no multi-option Next menu).\n5. Small-tasks “Done + Next” does **not** apply while orchestra is active or “continue until finish” is in effect.\n\n## Conductor-first entry\n\n> **Do NOT pick `orchestra-planner`, `orchestra-implementer`, `orchestra-verifier`, or `orchestra-reviewer` as the user entry on OpenCode.** On Cursor, ambient hooks may launch the first phase directly; optional `orchestra` conductor uses **Task** + `subagent_type`. Hook matchers require exact `orchestra-*` names — do not rename them.\n\n## Models & preflight\n\nModel IDs are **assigned dynamically** — no hardcoded free-model IDs here.\nAgents **inherit** the main\u002Fglobal `model` (and `small_model`) from `opencode.json`.\nPer-agent `model:` frontmatter is stripped by `--apply`.\n\n| Role | Primary model | Fallback chain |\n|------|--------------|----------------|\n| all agents (inherit) | global `model` (set by `--apply` from highest-stability probe-reachable free model) | global `small_model` \u002F heavy free pool fallback |\n| frontend variants | same global model | frontend pool head only if explicitly set in config |\n\n**Before use:** run `bash scripts\u002Fupdate-free-models.sh --refresh` then `bash scripts\u002Fupdate-free-models.sh --probe` to validate configured models respond (not just listed).\n\n**Auto pools:** `--refresh` regenerates `~\u002F.config\u002Fopencode\u002Fstate\u002Fmodel-pools.json` ordered by `probes.json` reachability\u002Fstability; `--pools` prints them; `--apply` rewrites **global** model only and strips agent hardcodes; `--schedule` installs the weekly refresh timer.\n\n**On model error:** run `--refresh --probe --apply` to re-fetch, re-probe, and re-assign the global model, then retry.\n\n## Ambient mode (default ON)\n\nWhen the user asks to **add, fix, build, refactor, deploy, install, configure, migrate, integrate, debug, continue, improve, or finish** something:\n\n1. `beforeSubmitPrompt` classifies the prompt and selects a **route**:\n   - **core** (default) — plan → implement → verify → review\n   - **enterprise** — full SDLC when `\u002Fenterprise` or high complexity signals (architecture, migration, multi-service, security audit, etc.)\n   - **informal** — short\u002Fcasual goals still start **core** with `inferFromContext` (planner expands from progress-tracker\u002Fgit)\n2. Parent launches the first agent (**orchestra-planner** for core; discovery agent for enterprise idea).\n3. Hooks chain subsequent phases via `subagentStop`.\n\n**Skipped for:** explain-only questions, \"what is\u002Fhow does\", \"no orchestra\", \"just explain\", trivial hi\u002Fthanks.\n\n## Adaptive routing\n\n| Route | Trigger | Start phase | Loop |\n|-------|---------|-------------|------|\n| core | Normal implement\u002Ffix\u002Fbuild | `plan` | 4 core agents |\n| enterprise | `\u002Fenterprise` or complexity signals (beats informal shortness) | `idea` | 32-phase SDLC specialists |\n| informal | Short\u002Fcasual (\"fix it\", \"pls\", \"next improve\") | plan | Infer from progress-tracker\u002Fgit; planner expands |\n\nPlanner (or discovery planning) always runs before implementation.\n\n**Project-type specialist inserts** (core loop): for medium\u002Fcomplex `PROJECT SCOPE`, the conductor inserts the type's missing specialists into the spine — e.g. web\u002Fmobile\u002Fsaas → product-owner + ui-ux-designer + project-manager before implement, frontend\u002Fmobile-engineer in implement, qa\u002Faccessibility in verify; api → product-manager + architect + project-manager, backend\u002Fdatabase-engineer, api-contract-validator. See the conductor routing table. Inserts end with their own tokens (`DESIGN_SPEC_COMPLETE`, `TASK_BREAKDOWN_COMPLETE`).\n\n**Corporate tier** (large org \u002F multi-team \u002F program \u002F portfolio): conductor escalates to agent-selector → project-type-classifier → workflow-orchestrator → per-track Full Delivery loops each with its own scrum-master + project-manager, a governance committee (business-strategist, product-owner, product-manager, stakeholder-advocate at design; compliance-officer, legal-advisor, security-executive-advisor at release), and corporate close (release-manager, ops-manager, documentation-writer, sre\u002Fobserver, incident-responder).\n\nAfter updating hooks, always re-run `bash install.sh` (it replaces `hooks\u002Flib`). Restart Cursor.\n\n## Phases\n\n| # | Subagent | Role | Git workflow |\n|---|----------|------|-------------|\n| 1 | `orchestra-planner` | Plan only (`readonly`) | No commit — plan → `.cursor\u002Forchestra-plan.md` |\n| 2 | `orchestra-implementer` | Minimal implementation | **Must commit before** `IMPLEMENT_DONE` \u002F before verify |\n| 3 | `orchestra-verifier` | Tests \u002F lint \u002F smoke | No commit — **VERIFY_FAIL if dirty tree** |\n| 4 | `orchestra-reviewer` | Final gate (`readonly`) | Suggest docs commit; parent commits docs if dirty |\n\n`FIX_REQUIRED` \u002F `VERIFY_FAIL` → hooks loop back to **orchestra-implementer** (which **commits** fixes before re-verify).\n\n## Phase commit gate (hard rule)\n\n**Commit each part before the next part starts.**\n\n1. Parent runs `git status --porcelain` before launching the next subagent\n2. Dirty tree (except `.cursor\u002Forchestra-plan.md`) → commit\u002Fdiscard first — do not advance\n3. Implementer: empty porcelain required before `IMPLEMENT_DONE`\n4. Verifier: dirty code → `VERIFY_FAIL`\n5. After `ORCHESTRA_COMPLETE`: parent commits remaining docs (`progress-tracker`) if dirty\n\n## Git commit convention\n\nAll commits follow: `\u003Ctype>(\u003Cscope>): \u003Cdescription>`\n\nTypes: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`\n\n- **Planner** includes commit strategy in the plan (phase-gated commits)\n- **Implementer** commits after ALL changes (not mid-implementation) — required before next phase\n- **Verifier** checks `git status --porcelain` for clean tree\n- **Reviewer** reviews commit messages; parent may make a docs commit after ORCHESTRA_COMPLETE\n\n## Self-review & error-free rules\n\nEach subagent has a self-review checklist and error-free rules:\n\n| Subagent | Key self-review | Error-free rule |\n|----------|----------------|-----------------|\n| Planner | Goal clear, files exist, done-when testable | No assumptions about undocumented behavior |\n| Implementer | All plan items done, no scope creep, committed | Zero tolerance: syntax, debug code, secrets |\n| Verifier | All checks run, git clean, verdict clear | Never skip, never assume PASS, never fix code |\n| Reviewer | Read actual diff, findings are file:line, verdict matches | Never approve if tests fail or secrets in code |\n\n## User commands\n\n| Command | Action |\n|---------|--------|\n| *(normal coding prompt)* | Auto-orchestrate if implement\u002Ffix\u002Fbuild |\n| `\u002Forchestra \u003Cgoal>` | Force start (core route) |\n| `\u002Fenterprise \u003Cgoal>` | Force enterprise SDLC route |\n| `\u002Forchestra stop` | Stop active loop |\n| `disable orchestra` | Turn ambient off |\n| `enable orchestra` | Turn ambient on |\n| `no orchestra` | Skip for this prompt |\n\n## CLI\n\n```powershell\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js status\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js tokens\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js ambient-off\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js ambient-on\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js stop\n```\n\n## Parent agent rules\n\n- Use Task with **`orchestra-*` names** — hooks matchers require exact names.\n- Do not nest orchestra inside orchestra.\n- After `ORCHESTRA_COMPLETE`, summarize and run `orchestra-enable.js stop`.\n- **Do not modify files between phases** — let subagents handle their own work.\n- **Do not commit between phases** — implementer commits, others are read-only.\n- Works in **Cursor IDE Agent** (user hooks). Not cloud agents unless project hooks copied.\n\n## Hooks\n\n| Event | Role |\n|-------|------|\n| `sessionStart` | Inject ambient policy every session |\n| `beforeSubmitPrompt` | Auto-start on implement prompts |\n| `subagentStop` | Chain next phase |\n| `stop` | Nudge if parent stalled |\n\n## Opt out\n\nSay **\"no orchestra\"** or run `ambient-off`. Pure Q&A never triggers the chain.\n\n## Heartbeat & stall detection\n\nHeartbeat timestamps are written on every hook execution. If a phase runs >5min (configurable), stall detection emits recovery nudges. After 2 stalls, orchestration aborts.\n\n## Memory\n\n- **Short-term**: Tracked during each run (phases, files, errors, decisions). Available to subagents.\n- **Long-term**: Persistent `~\u002F.cursor\u002Fhooks\u002Fstate\u002Forchestra-memory.json`. Planner reads past goals\u002Ferrors; reviewer writes lessons.\n\n```bash\nnode ~\u002F.cursor\u002Fhooks\u002Forchestra-enable.js memory          # View\nnode ~\u002F.cursor\u002Fhooks\u002Forchestra-enable.js memory clear    # Clear\n```\n\n## Resumable tasks\n\n- **Crash recovery**: `sessionStart` detects stale state, offers resume via \"resume orchestra\"\n- **Manual pause\u002Fresume**: `pause [reason]` \u002F `resume` commands or chat\n- **Checkpoint**: `checkpoint` saves state without pausing\n\n## Lifecycle events\n\nEvery phase transition recorded to state. Last 200 events retained. Phase durations tracked.\n\n## Six-File Context\n\nIf the workspace has `context\u002Fproject-overview.md` (Six-File Context Methodology), hooks inject read order at session start. Subagents read present `context\u002F*.md` files before acting.\n\nFor product UI: use skills `ui-ux-pro-max`, `brand`, `design-system`, `ui-styling`, `web-design-master`; persist tokens into `context\u002Fui-context.md` (see template Skills section).\n\nBootstrap in any project:\n\n```bash\nbash \u002Fpath\u002Fto\u002Fpcore-orchestra\u002Fscripts\u002Finit-context.sh \u002Fpath\u002Fto\u002Fyour-app --bridge\n```\n\n## Token efficiency\n\nOrchestra cycles cost **3–10×** a single chat turn. Default policy:\n\n| Phase | Web | Tool focus | Budget |\n|-------|-----|------------|--------|\n| Planner | Avoid | grep\u002Fglob → targeted read | ~10k |\n| Implementer | Plan only | scoped reads, parallel batch | ~30k |\n| Verifier | Never | shell checks, one-line failures | ~15k |\n| Reviewer | Never | diff only | ~8k |\n\n**Parent rules:** pass concise goal + plan summary to subagents; no file reads between phases; subagents may use websearch\u002Fwebfetch freely (targeted queries) and must honor the latest-stable-only version policy.\n\nFull guide: `docs\u002Ftoken-optimization.md`. OpenCode: copy `docs\u002Fopencode.json.example` or run `bash scripts\u002Fsetup-opencode-optimal.sh --balanced`.\n\nHarness \u002F agents \u002F prompts: `docs\u002Fagent-harness-recommendations.md`.\n\n## Concurrent Session Guard (session-claims)\n\nOther AI sessions may be editing the same repo at the same time. Before\nimplementing, and again before committing:\n\n```bash\nbash \u003Corchestra>\u002Fscripts\u002Fsession-claims.sh check \"$PWD\" \u003Cpaths-you-will-touch>\n```\n\n- Exit 1 = another LIVE session holds a claim on those paths → coordinate or wait.\n- Claim your own work at phase start, renew on long operations, release when done:\n\n```bash\nbash scripts\u002Fsession-claims.sh claim  \"$PWD\" --scope \"app\u002F,packages\u002F\" --task \"goal text\"\nbash scripts\u002Fsession-claims.sh renew  \"$PWD\"\nbash scripts\u002Fsession-claims.sh release \"$PWD\"\n```\n\nClaims auto-expire after 30 min without heartbeat (`gc` purges them). Set\n`PCORE_SESSION_ID` in your session env for stable identity across shells.\n\n","# Orchestra Loop (Cursor + OpenCode + Qoder)\n\n- **Cursor:** runs via `~\u002F.cursor\u002F` hooks — ambient auto-start; spawn with **Task** + `subagent_type`.\n- **OpenCode:** runs via `~\u002F.config\u002Fopencode\u002F` — user talks to **orchestra** conductor; spawn with **subagent** + `agent` name (V1 `task` is retired; runtime requires OpenCode V2).\n- **Qoder:** runs via `~\u002F.qoder\u002Fsettings.json` hooks like Cursor — spawn with **Agent** + `subagent_type`.\n\nYou do not need `\u002Forchestra` on Cursor when ambient mode is ON.\n\n## Cross-platform (Cursor + OpenCode)\n\nSame four phase agent names; **different spawn tool and chaining**.\n\n| | **Cursor IDE** | **OpenCode CLI \u002F desktop** |\n|---|----------------|----------------------------|\n| User entry | Main Agent (ambient hooks) or `orchestra` conductor | `orchestra` only (`default_agent`) |\n| Spawn tool | **Task** (capital T) | **subagent** (V2; V1 `task` retired) |\n| Spawn param | `subagent_type=\"orchestra-planner\"` | `agent=\"orchestra-planner\"` + `description` |\n| Phase chain | Hooks `subagentStop` auto-advance | Conductor calls **subagent** once per phase |\n| Phase visibility | Task picker | `hidden: true` — not in @ menu |\n\nFull matrix: `docs\u002Forchestra-cross-platform.md` · agent ref: `references\u002Forchestra-spawn-matrix.md`\n\n## Cursor Task limitation (conductor fallback)\n\nIf Cursor `Task` rejects `subagent_type=orchestra-*` (enum \u002F unknown agent), the parent **MUST** keep the loop alive: run phases itself **or** spawn `generalPurpose` loaded with instructions from `~\u002F.cursor\u002Fagents\u002Forchestra-*.md`. Do **not** stop the loop. Hooks still match those names when custom agents work.\n\n### Anti-stop (CRITICAL — Cursor conductor)\n\nWhen orchestra is **active**, or the user said **continue \u002F until finish \u002F do all \u002F don't stop**:\n\n1. **Do not** end turns with “Done \u002F Next (1)(2)(3)” choice menus that wait for the user.\n2. After `PLAN_READY` → immediately implement → commit → verify → review in the **same** run (conductor fallback).\n3. After `ORCHESTRA_COMPLETE`, if the plan **Handoff** \u002F user goal still has unfinished work → `orchestra-enable.js start \"\u003Cnext goal>\"` and run the next loop **immediately**.\n4. Only stop when: user goal is fully done, user says **stop**, or 5 resumes fail on one phase — then one short summary (no multi-option Next menu).\n5. Small-tasks “Done + Next” does **not** apply while orchestra is active or “continue until finish” is in effect.\n\n## Conductor-first entry\n\n> **Do NOT pick `orchestra-planner`, `orchestra-implementer`, `orchestra-verifier`, or `orchestra-reviewer` as the user entry on OpenCode.** On Cursor, ambient hooks may launch the first phase directly; optional `orchestra` conductor uses **Task** + `subagent_type`. Hook matchers require exact `orchestra-*` names — do not rename them.\n\n## Models & preflight\n\nModel IDs are **assigned dynamically** — no hardcoded free-model IDs here.\nAgents **inherit** the main\u002Fglobal `model` (and `small_model`) from `opencode.json`.\nPer-agent `model:` frontmatter is stripped by `--apply`.\n\n| Role | Primary model | Fallback chain |\n|------|--------------|----------------|\n| all agents (inherit) | global `model` (set by `--apply` from highest-stability probe-reachable free model) | global `small_model` \u002F heavy free pool fallback |\n| frontend variants | same global model | frontend pool head only if explicitly set in config |\n\n**Before use:** run `bash scripts\u002Fupdate-free-models.sh --refresh` then `bash scripts\u002Fupdate-free-models.sh --probe` to validate configured models respond (not just listed).\n\n**Auto pools:** `--refresh` regenerates `~\u002F.config\u002Fopencode\u002Fstate\u002Fmodel-pools.json` ordered by `probes.json` reachability\u002Fstability; `--pools` prints them; `--apply` rewrites **global** model only and strips agent hardcodes; `--schedule` installs the weekly refresh timer.\n\n**On model error:** run `--refresh --probe --apply` to re-fetch, re-probe, and re-assign the global model, then retry.\n\n## Ambient mode (default ON)\n\nWhen the user asks to **add, fix, build, refactor, deploy, install, configure, migrate, integrate, debug, continue, improve, or finish** something:\n\n1. `beforeSubmitPrompt` classifies the prompt and selects a **route**:\n   - **core** (default) — plan → implement → verify → review\n   - **enterprise** — full SDLC when `\u002Fenterprise` or high complexity signals (architecture, migration, multi-service, security audit, etc.)\n   - **informal** — short\u002Fcasual goals still start **core** with `inferFromContext` (planner expands from progress-tracker\u002Fgit)\n2. Parent launches the first agent (**orchestra-planner** for core; discovery agent for enterprise idea).\n3. Hooks chain subsequent phases via `subagentStop`.\n\n**Skipped for:** explain-only questions, \"what is\u002Fhow does\", \"no orchestra\", \"just explain\", trivial hi\u002Fthanks.\n\n## Adaptive routing\n\n| Route | Trigger | Start phase | Loop |\n|-------|---------|-------------|------|\n| core | Normal implement\u002Ffix\u002Fbuild | `plan` | 4 core agents |\n| enterprise | `\u002Fenterprise` or complexity signals (beats informal shortness) | `idea` | 32-phase SDLC specialists |\n| informal | Short\u002Fcasual (\"fix it\", \"pls\", \"next improve\") | plan | Infer from progress-tracker\u002Fgit; planner expands |\n\nPlanner (or discovery planning) always runs before implementation.\n\n**Project-type specialist inserts** (core loop): for medium\u002Fcomplex `PROJECT SCOPE`, the conductor inserts the type's missing specialists into the spine — e.g. web\u002Fmobile\u002Fsaas → product-owner + ui-ux-designer + project-manager before implement, frontend\u002Fmobile-engineer in implement, qa\u002Faccessibility in verify; api → product-manager + architect + project-manager, backend\u002Fdatabase-engineer, api-contract-validator. See the conductor routing table. Inserts end with their own tokens (`DESIGN_SPEC_COMPLETE`, `TASK_BREAKDOWN_COMPLETE`).\n\n**Corporate tier** (large org \u002F multi-team \u002F program \u002F portfolio): conductor escalates to agent-selector → project-type-classifier → workflow-orchestrator → per-track Full Delivery loops each with its own scrum-master + project-manager, a governance committee (business-strategist, product-owner, product-manager, stakeholder-advocate at design; compliance-officer, legal-advisor, security-executive-advisor at release), and corporate close (release-manager, ops-manager, documentation-writer, sre\u002Fobserver, incident-responder).\n\nAfter updating hooks, always re-run `bash install.sh` (it replaces `hooks\u002Flib`). Restart Cursor.\n\n## Phases\n\n| # | Subagent | Role | Git workflow |\n|---|----------|------|-------------|\n| 1 | `orchestra-planner` | Plan only (`readonly`) | No commit — plan → `.cursor\u002Forchestra-plan.md` |\n| 2 | `orchestra-implementer` | Minimal implementation | **Must commit before** `IMPLEMENT_DONE` \u002F before verify |\n| 3 | `orchestra-verifier` | Tests \u002F lint \u002F smoke | No commit — **VERIFY_FAIL if dirty tree** |\n| 4 | `orchestra-reviewer` | Final gate (`readonly`) | Suggest docs commit; parent commits docs if dirty |\n\n`FIX_REQUIRED` \u002F `VERIFY_FAIL` → hooks loop back to **orchestra-implementer** (which **commits** fixes before re-verify).\n\n## Phase commit gate (hard rule)\n\n**Commit each part before the next part starts.**\n\n1. Parent runs `git status --porcelain` before launching the next subagent\n2. Dirty tree (except `.cursor\u002Forchestra-plan.md`) → commit\u002Fdiscard first — do not advance\n3. Implementer: empty porcelain required before `IMPLEMENT_DONE`\n4. Verifier: dirty code → `VERIFY_FAIL`\n5. After `ORCHESTRA_COMPLETE`: parent commits remaining docs (`progress-tracker`) if dirty\n\n## Git commit convention\n\nAll commits follow: `\u003Ctype>(\u003Cscope>): \u003Cdescription>`\n\nTypes: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`\n\n- **Planner** includes commit strategy in the plan (phase-gated commits)\n- **Implementer** commits after ALL changes (not mid-implementation) — required before next phase\n- **Verifier** checks `git status --porcelain` for clean tree\n- **Reviewer** reviews commit messages; parent may make a docs commit after ORCHESTRA_COMPLETE\n\n## Self-review & error-free rules\n\nEach subagent has a self-review checklist and error-free rules:\n\n| Subagent | Key self-review | Error-free rule |\n|----------|----------------|-----------------|\n| Planner | Goal clear, files exist, done-when testable | No assumptions about undocumented behavior |\n| Implementer | All plan items done, no scope creep, committed | Zero tolerance: syntax, debug code, secrets |\n| Verifier | All checks run, git clean, verdict clear | Never skip, never assume PASS, never fix code |\n| Reviewer | Read actual diff, findings are file:line, verdict matches | Never approve if tests fail or secrets in code |\n\n## User commands\n\n| Command | Action |\n|---------|--------|\n| *(normal coding prompt)* | Auto-orchestrate if implement\u002Ffix\u002Fbuild |\n| `\u002Forchestra \u003Cgoal>` | Force start (core route) |\n| `\u002Fenterprise \u003Cgoal>` | Force enterprise SDLC route |\n| `\u002Forchestra stop` | Stop active loop |\n| `disable orchestra` | Turn ambient off |\n| `enable orchestra` | Turn ambient on |\n| `no orchestra` | Skip for this prompt |\n\n## CLI\n\n```powershell\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js status\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js tokens\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js ambient-off\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js ambient-on\nnode $env:USERPROFILE\\.cursor\\hooks\\orchestra-enable.js stop\n```\n\n## Parent agent rules\n\n- Use Task with **`orchestra-*` names** — hooks matchers require exact names.\n- Do not nest orchestra inside orchestra.\n- After `ORCHESTRA_COMPLETE`, summarize and run `orchestra-enable.js stop`.\n- **Do not modify files between phases** — let subagents handle their own work.\n- **Do not commit between phases** — implementer commits, others are read-only.\n- Works in **Cursor IDE Agent** (user hooks). Not cloud agents unless project hooks copied.\n\n## Hooks\n\n| Event | Role |\n|-------|------|\n| `sessionStart` | Inject ambient policy every session |\n| `beforeSubmitPrompt` | Auto-start on implement prompts |\n| `subagentStop` | Chain next phase |\n| `stop` | Nudge if parent stalled |\n\n## Opt out\n\nSay **\"no orchestra\"** or run `ambient-off`. Pure Q&A never triggers the chain.\n\n## Heartbeat & stall detection\n\nHeartbeat timestamps are written on every hook execution. If a phase runs >5min (configurable), stall detection emits recovery nudges. After 2 stalls, orchestration aborts.\n\n## Memory\n\n- **Short-term**: Tracked during each run (phases, files, errors, decisions). Available to subagents.\n- **Long-term**: Persistent `~\u002F.cursor\u002Fhooks\u002Fstate\u002Forchestra-memory.json`. Planner reads past goals\u002Ferrors; reviewer writes lessons.\n\n```bash\nnode ~\u002F.cursor\u002Fhooks\u002Forchestra-enable.js memory          # View\nnode ~\u002F.cursor\u002Fhooks\u002Forchestra-enable.js memory clear    # Clear\n```\n\n## Resumable tasks\n\n- **Crash recovery**: `sessionStart` detects stale state, offers resume via \"resume orchestra\"\n- **Manual pause\u002Fresume**: `pause [reason]` \u002F `resume` commands or chat\n- **Checkpoint**: `checkpoint` saves state without pausing\n\n## Lifecycle events\n\nEvery phase transition recorded to state. Last 200 events retained. Phase durations tracked.\n\n## Six-File Context\n\nIf the workspace has `context\u002Fproject-overview.md` (Six-File Context Methodology), hooks inject read order at session start. Subagents read present `context\u002F*.md` files before acting.\n\nFor product UI: use skills `ui-ux-pro-max`, `brand`, `design-system`, `ui-styling`, `web-design-master`; persist tokens into `context\u002Fui-context.md` (see template Skills section).\n\nBootstrap in any project:\n\n```bash\nbash \u002Fpath\u002Fto\u002Fpcore-orchestra\u002Fscripts\u002Finit-context.sh \u002Fpath\u002Fto\u002Fyour-app --bridge\n```\n\n## Token efficiency\n\nOrchestra cycles cost **3–10×** a single chat turn. Default policy:\n\n| Phase | Web | Tool focus | Budget |\n|-------|-----|------------|--------|\n| Planner | Avoid | grep\u002Fglob → targeted read | ~10k |\n| Implementer | Plan only | scoped reads, parallel batch | ~30k |\n| Verifier | Never | shell checks, one-line failures | ~15k |\n| Reviewer | Never | diff only | ~8k |\n\n**Parent rules:** pass concise goal + plan summary to subagents; no file reads between phases; subagents may use websearch\u002Fwebfetch freely (targeted queries) and must honor the latest-stable-only version policy.\n\nFull guide: `docs\u002Ftoken-optimization.md`. OpenCode: copy `docs\u002Fopencode.json.example` or run `bash scripts\u002Fsetup-opencode-optimal.sh --balanced`.\n\nHarness \u002F agents \u002F prompts: `docs\u002Fagent-harness-recommendations.md`.\n\n## Concurrent Session Guard (session-claims)\n\nOther AI sessions may be editing the same repo at the same time. Before\nimplementing, and again before committing:\n\n```bash\nbash \u003Corchestra>\u002Fscripts\u002Fsession-claims.sh check \"$PWD\" \u003Cpaths-you-will-touch>\n```\n\n- Exit 1 = another LIVE session holds a claim on those paths → coordinate or wait.\n- Claim your own work at phase start, renew on long operations, release when done:\n\n```bash\nbash scripts\u002Fsession-claims.sh claim  \"$PWD\" --scope \"app\u002F,packages\u002F\" --task \"goal text\"\nbash scripts\u002Fsession-claims.sh renew  \"$PWD\"\nbash scripts\u002Fsession-claims.sh release \"$PWD\"\n```\n\nClaims auto-expire after 30 min without heartbeat (`gc` purges them). Set\n`PCORE_SESSION_ID` in your session env for stable identity across shells.\n\n",{"name":5,"description":7},"main","5a348537f6ee031f76c168e397c0d023f35ef333","bundle\u002Fopencode\u002Fskills\u002Forchestra-loop","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra","https:\u002F\u002Fgithub.com\u002FP-Core-System","P Core System — the P-Core family: trading, AI brain, assistant, orchestration, and web AI server.","2026-11-13 11:33:11",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add P-Core-System\u002Fpcore-orchestra --skill orchestra-loop",{"tool":37,"command":38},"bunx","bunx skills add P-Core-System\u002Fpcore-orchestra --skill orchestra-loop",{"tool":40,"command":41},"pnpm","pnpm dlx skills add P-Core-System\u002Fpcore-orchestra --skill orchestra-loop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fopencode\u002Fskills\u002Forchestra-loop\u002FSKILL.md",true,[],[46,53,60,67,74,81],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M78DYATRNCN2NFKA4YRBG0T9","wrangler","Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fwrangler\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M78DY6XPJ7B09HWH01PGQTJZ","workers-best-practices","Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fworkers-best-practices\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M78DY267V5PK9KD65ENG451F","web-perf","Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fweb-perf\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78DXXT4TWE2K8M0E9V417J9","web-design-master","Professional web design standard (\"AI Professional Web Design Master Prompt\") covering page\u002Fsection\u002Flayout design, visual hierarchy, color systems, typography scales, 8-point grid spacing, responsive breakpoints, accessibility, and design QA review. Use when designing or building any page, section, or layout so it looks deliberately designed by a professional product team rather than a generic AI template.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fweb-design-master\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78DXTPQ1XARW18D46JFY5AP","verification-before-completion","Require command evidence before claiming done. Use proactively before VERIFY_PASS, ORCHESTRA_COMPLETE, or \"all fixed\" statements. Run tests, lint, health, or git checks — never trust claims without output.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M78DXKFTZ00TJRWK84FNHGVH","ui-ux-pro-max","UI\u002FUX design intelligence for web and mobile. Searchable local database with 84 styles, 192 color palettes, 74 font pairings, 192 product types, 98 UX guidelines, 104 icon entries, 16 GSAP motion presets, and 25 chart types across 22 stacks (React, Next.js, Vue, Nuxt, Svelte, Astro, SwiftUI, React Native, Flutter, Tailwind, shadcn\u002Fui, Jetpack Compose, Angular, Laravel, JavaFX, WPF, WinUI, Avalonia, Uno Platform, UWP, Three.js, and HTML\u002FCSS). Use when designing, building, or reviewing UI: pages, components, color schemes, typography, layout, accessibility, animation, or data visualization.","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fui-ux-pro-max\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FP-Core-System\u002Fpcore-orchestra\u002Fblob\u002Fmain\u002Fbundle\u002Fskills\u002Fui-ux-pro-max\u002FSKILL.md",[],[]]