[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77TQESPR3QQKXMJPBH51XHC":3,"skill-same:01M77TQESPR3QQKXMJPBH51XHC":46},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M77TQESPR3QQKXMJPBH51XHC","shift",null,"Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fshift\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: shift\ndescription: Multi-identity delegation for OpenClaw. Turns a single agent into a system of specialized sub-identities (coding, research, quick tasks) each powered by different AI models. Use when: (1) the user asks a coding task (write, debug, implement, refactor, explain code), (2) the user asks for research, analysis, comparison, or explanation, (3) the user asks a quick question, lookup, or reminder, (4) the user asks anything that would benefit from a specialized model. NOT for: trivial greetings, acknowledgments, or meta-conversation about the chat itself. SHIFT handles routing, delegation, sub-identity-to-sub-identity consultation, synthesis, and cost management entirely within one conversation.\n---\n\n# SHIFT — Multi-Identity Delegation Skill\n\n**One agent. Many specialists. One conversation.**\n\n---\n\n## ⚠️ SECURITY AND PRIVACY — READ BEFORE ENABLING\n\n### What SHIFT Accesses\n\nSHIFT reads from your OpenClaw workspace:\n- `~\u002F.openclaw\u002Fworkspace\u002FMEMORY.md` — excerpts attached to delegation context\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fconfig.yaml` — your persona and cost settings\n- Session files it creates in `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F`\n\nSHIFT writes to:\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F\u003CrunId>\u002F` — per-delegation session files\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fcost-tracking.json` — delegation cost tracking\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fpersonas\u002F*.yaml` — your persona overrides\n\n### What SHIFT Transmits\n\nWhen you enable delegation, the following are sent to whatever model providers you configure for each persona:\n- Your message content\n- Conversation history (last N turns, controlled by `contextBridge.historyTurns`)\n- Active file contents and MEMORY.md excerpts relevant to the task\n- Delegation metadata (runId, timestamps, persona name)\n\n**You control which models are used.** SHIFT does not ship with or store credentials — it uses the model providers configured in your OpenClaw agent config. Review your provider's data handling policy.\n\n### Data Exposure Risk\n\nIf your workspace files or MEMORY.md contain secrets (API keys, credentials, private data), and those files are referenced in a delegated task, that content will be transmitted to your configured model provider.\n\n**Mitigations:**\n- Do not delegate tasks that reference sensitive file paths\n- Set `contextBridge.historyTurns` to a low number (e.g., 3)\n- Use `costManagement.trackOnly: true` during evaluation to observe behavior without enforcement\n- Use trusted or self-hosted model providers for sensitive work\n\n### Setup Script\n\n`scripts\u002Fsetup.sh` creates local directories only. It does NOT:\n- Make network calls\n- Escalate privileges\n- Modify system files\n- Access credentials\n\n### Cost and Consultations\n\nConsultations spawn additional model calls. Costs are tracked in `cost-tracking.json` per delegation. Set `costManagement.trackOnly: true` to monitor before enforcing limits.\n\n### Recommendations\n\n1. Start with `costManagement.trackOnly: true` to observe costs\n2. Set `contextBridge.historyTurns` to a small number (5 or less)\n3. Set `contextBridge.archiveAfterMinutes: 30` for faster cleanup\n4. Do not delegate tasks referencing sensitive file paths\n5. Review model providers' data policies before sensitive work\n\n---\n\nTriggers on: any message that might benefit from specialized handling — coding tasks, research, analysis, quick lookups, or anything that warrants delegating to a sub-identity.\n\nWhen SHIFT triggers, you read and follows the procedures below to: classify the task, delegate to the right sub-identity, handle consultation between sub-identities, and synthesize the final response in his own voice.\n\n---\n\n# SHIFT Procedures\n\nFollow these steps for every message that triggers SHIFT.\n\n---\n\n## STEP 1 — Fast Path Check\n\nBefore anything, check if this message is trivially handled by you directly.\n\n**Bypass delegation (return `none`) if message is ONLY:**\n- Greetings: `hi`, `hey`, `hello`, `yo`, `sup`\n- Acknowledgments: `thanks`, `thank you`, `ty`, `ok`, `sure`, `got it`, `makes sense`, `cool`, `nice`\n- Meta: `that was fast`, `nice one`, `lol`, `haha`\n\n**If none of those match, proceed to STEP 2.**\n\n---\n\n## STEP 2 — Load Config\n\nRead the SHIFT config at:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fconfig.yaml\n```\n\nIf the file doesn't exist, run the setup script first:\n```bash\nbash ~\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fshift\u002Fscripts\u002Fsetup.sh\n```\n\nFrom config, extract:\n- `displayMode` — `hidden` or `transparent`\n- `fastPath` — `conservative` or `off`\n- `costManagement.enabled`, `costManagement.costBudgetPerHour`, `costManagement.alertThreshold`\n- `contextBridge.historyTurns`, `contextBridge.sessionFolder`\n- `personas` — enabled personas and their settings\n\n---\n\n## STEP 3 — Cost Budget Check\n\nIf `costManagement.enabled: true`:\n\nRead `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fcost-tracking.json`:\n\n```json\n{\n  \"hourStart\": \"2026-03-18T15:00:00Z\",\n  \"totalSpend\": 0.87,\n  \"delegations\": [...]\n}\n```\n\n**If current UTC hour > hourStart (new hour):**\n→ Reset `totalSpend: 0`, update `hourStart` to current hour.\n\n**If `totalSpend >= costBudgetPerHour`:**\n→ You handle the task directly. Say: *\"Handling this one myself to stay within your cost budget.\"*\nReturn `budget_exceeded`.\n\n**If `totalSpend >= alertThreshold * costBudgetPerHour`:**\n→ Send a quiet warning: *\"Approaching delegation budget limit for this hour.\"*\n\n---\n\n## STEP 4 — Route to Persona\n\nUsing the enabled personas from config, classify the user's message.\n\n### Keyword Scoring\n\nFor each enabled persona, count keyword matches in the user's message (case-insensitive, whole-word). Raw score = matches \u002F total keywords.\n\n**If raw score >= `minConfidence`:** Add to candidates.\n\n**Runner special case:** Runner has `requireExplicit: true`. It only triggers if the message is predominantly a Runner task, not just containing a keyword. If the message has strong code\u002Fresearch keywords, Runner is NOT a match even if it has Runner keywords.\n\n### Tie-Breaking\n\nIf multiple personas score above threshold:\n→ Higher score wins. If tied: codex > researcher > runner.\n\n### Default\n\nIf no persona scores above threshold → You handle directly. Return `none`.\n\n---\n\n## STEP 5 — Prepare Delegation Context\n\nGenerate a unique `runId`:\n```\nrun-{YYYYMMDD}-{HHMM}-{persona}-{sequence}\nExample: run-20260318-1551-codex-001\n```\n\nCreate the session folder:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002F\n```\n\n### Write INBOUND.json\n\n```json\n{\n  \"runId\": \"\u003CrunId>\",\n  \"timestamp\": \"\u003CISO UTC>\",\n  \"persona\": \"\u003Cmatched persona>\",\n  \"userMessage\": \"\u003Cexact user message>\",\n  \"masterConversationHistory\": \u003Clast N turns from conversation>,\n  \"activeFiles\": \u003Cfiles mentioned>,\n  \"masterSummary\": \"\u003Cbrief summary of conversation so far>\"\n}\n```\n\n### Write CONTEXT.md\n\nPull from:\n- `~\u002F.openclaw\u002Fworkspace\u002FMEMORY.md` (keyword-matched relevant sections)\n- Any active file contents mentioned in the conversation\n- Persona-specific context needs (from the persona definition in config)\n\nFormat:\n```markdown\n# Context for {persona}\n\n## Project\u002FMemory (relevant)\n...\n\n## Active Files\n...\n\n## Persona Context Needs\n...\n```\n\n---\n\n## STEP 6 — Build Task Prompt\n\nConstruct the prompt for the sub-agent:\n\n```markdown\n# You are {persona_name}\n\n## Persona\n{persona voice, tone, strengths, blind spots from config}\n\n## Your Task\n{user's exact message}\n\n## Context\nBefore starting, read:\n- \u002Fpath\u002Fto\u002FINBOUND.json — your input and conversation history\n- \u002Fpath\u002Fto\u002FCONTEXT.md — relevant project context\n\n## Your Protocol\n1. Read INBOUND.json and CONTEXT.md\n2. Execute your task\n3. If you need to consult another sub-identity and your persona allows it:\n   - Write your question to the session folder as CONSULT-INBOUND.md\n   - Set a timeout: min(remaining_time * 0.5, your consultationTimeout)\n   - Spawn the target sub-identity using sessions_spawn\n   - Wait for them to write CONSULT-OUTBOUND.md\n   - Read their response and continue with that context\n4. Write your final result to \u002Fpath\u002Fto\u002FOUTBOUND.md\n5. Include a ConsultationLog if you consulted anyone\n6. End your response with [DONE]\n```\n\n---\n\n## STEP 7 — Spawn Sub-Agent\n\n```javascript\nsessions_spawn({\n  model: personaConfig.model,\n  task: taskPrompt,\n  label: `shift-${persona}-${runId}`,\n  timeoutSeconds: personaConfig.timeout,\n  attachments: [\n    { name: \"INBOUND.json\", content: \u003CinboundJsonString> },\n    { name: \"CONTEXT.md\", content: \u003CcontextMdString> }\n  ]\n})\n```\n\n**Track elapsed time.** If `elapsed > timeout * 0.7`:\n→ Send status to user: *\"{persona} is still working on this...\"*\n\n---\n\n## STEP 8 — Wait and Read Result\n\nWait for `sessions_spawn` to complete.\n\n### Read OUTBOUND.md\n\nFrom the session folder:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002FOUTBOUND.md\n```\n\nParse:\n- `Status`: `complete` | `error` | `escalation`\n- `Result`: the actual response content\n- `ConsultationLog`: if sub-identity consulted another\n- `Cost`: token counts if available\n\n### Check for ESCALATE.md (Runner only)\n\nIf `Status: escalation`:\n→ Runner detected the task was too complex. You take over directly.\n→ Read `reason`, `summary`, `partialAnswer` from ESCALATE.md.\n→ Incorporate any partial work Runner did.\n\n---\n\n## STEP 9 — Update Cost Tracking\n\nAfter successful delegation, update `cost-tracking.json`:\n\n```json\n{\n  \"hourStart\": \"\u003Ccurrent hour UTC>\",\n  \"totalSpend\": \u003Cprevious + estimated cost>,\n  \"delegations\": [\n    {\n      \"runId\": \"\u003CrunId>\",\n      \"persona\": \"\u003Cpersona>\",\n      \"inputTokens\": \u003Cfrom sub-agent result if available>,\n      \"outputTokens\": \u003Cfrom sub-agent result if available>,\n      \"estimatedCost\": \u003Ccalculate from model cost config>,\n      \"timestamp\": \"\u003Cnow>\"\n    }\n  ]\n}\n```\n\n---\n\n## STEP 10 — Synthesize Response\n\nTransform the sub-identity's output into your voice.\n\n### Detection\n\nIf `ConsultationLog` is present and non-empty:\n→ Build consultation mention (ALWAYS shown):\n```\n{parent persona} consulted {target persona} on {topic}...\n```\n\n### Transformation Rules\n\n| Sub-identity output | your transformation |\n|---|---|\n| Code | Explain what it does in plain English, highlight key parts, offer to add tests |\n| Analysis\u002FResearch | Pull 2-3 key insights, bullet-point them, note caveats |\n| Quick answer (Runner) | Relay directly with warmth added |\n\n### Display Mode\n\n**Hidden (default):**\n```\n[Assistant]: Here's the {implementation\u002Fanalysis\u002Fanswer}...\n```\n\n**Transparent:**\n```\n[Assistant] → [{persona}] working on this...\n[Assistant] ← [{persona}] done.\n[Assistant]: Here's the...\n```\n\nConsultation mentions are ALWAYS shown in both modes.\n\n---\n\n## STEP 11 — Handle Errors\n\n| Scenario | Response |\n|---|---|\n| Sub-agent timeout | *\"Looks like this one is taking longer than expected — let me work through it directly.\"* |\n| Sub-agent error | *\"Hit a snag with the specialist — let me handle this myself.\"* |\n| sessions_spawn fails | Fall back to your handling directly |\n| OUTBOUND.md missing | Assume sub-agent failed, You handle directly |\n| Model unavailable | Log warning, You handle directly |\n\n---\n\n# Consultation Protocol (Master-Orchestrated)\n\n**Key insight:** Sub-agent sessions cannot cleanly spawn child sessions and wait. The solution: You orchestrate the consultation from the master level.\n\n## Flow\n\n```\nCodex needs context\n        ↓\nCodex writes CONSULT-INBOUND.md + OUTBOUND.md (Status: needs_consultation)\n        ↓\nYou detect needs_consultation flag in OUTBOUND.md\n        ↓\nYou tell user (transparent mode): \"Codex ↔ [Codex → Researcher]...\"\n        ↓\nYou spawn Researcher with CONSULT-INBOUND.md\n        ↓\nResearcher writes CONSULT-OUTBOUND.md\n        ↓\nYou read it, appends to Codex's CONTEXT.md\n        ↓\nYou re-spawn Codex with enriched context (brief task: \"continue with this context\")\n        ↓\nCodex writes final OUTBOUND.md with ConsultationLog\n        ↓\nYou synthesize — mentions the consultation (always visible)\n```\n\n## Sub-Agent Side (Codex\u002FResearcher)\n\nWhen a sub-agent needs to consult another sub-identity:\n\n1. Check: is target in my `consults` list? Is target NOT in my `consultsNever`?\n2. Write `CONSULT-INBOUND.md` to the session folder with the question + context\n3. Write `OUTBOUND.md` with:\n   ```markdown\n   ## Status: needs_consultation\n   \n   ## PartialResult\n   (what Codex has done\u002Funderstood so far)\n   \n   ## ConsultationLog\n   - consulted: researcher\n   - question: \"...\"\n   - status: pending\n   ```\n4. End response with `[NEEDS_CONSULTATION]` instead of `[DONE]`\n5. Stop — You will take over from here\n\n## Master Side\n\nWhen reading OUTBOUND.md after a sub-agent returns:\n\n### STEP 8a — Detect Consultation Need\n\nIf `Status: needs_consultation` is present:\n1. Read `ConsultationLog` to get target and question\n2. Read `CONSULT-INBOUND.md` for full context\n3. Send user update (transparent mode): `[Assistant] ↔ [{persona} → {target}] consulting on {topic}...`\n4. Proceed to STEP 8b\n\n### STEP 8b — Run Consultation\n\n```javascript\n\u002F\u002F Spawn the target sub-identity as a one-shot consultation\nsessions_spawn({\n  model: targetPersonaConfig.model,\n  task: `You are ${target}.\nRead the consultation question from: \u003Cpath to CONSULT-INBOUND.md>\nWrite your answer to: \u003Cpath to CONSULT-OUTBOUND.md>\nEnd with [DONE].`,\n  label: `shift-consult-${runId}`,\n  timeoutSeconds: targetPersonaConfig.consultationTimeout\n})\n```\n\n### STEP 8c — Feed Result Back\n\nAfter consultation completes:\n1. Read `CONSULT-OUTBOUND.md`\n2. Append consultation answer to `CONTEXT.md`:\n   ```markdown\n   ## Consultation Answer from {target}\n   {answer from CONSULT-OUTBOUND.md}\n   ```\n3. Re-spawn the original sub-agent with enriched context:\n   ```javascript\n   sessions_spawn({\n     model: originalPersonaConfig.model,\n     task: `${originalPersonaPrompt}\n     \n## Additional Context (from consultation)\nThe ${target} provided the following guidance:\n\u003Canswer from CONSULT-OUTBOUND.md>\n\nContinue your task using this context. Write your final result to OUTBOUND.md. End with [DONE].`,\n     label: `shift-${originalPersona}-consult-continue-${runId}`,\n     timeoutSeconds: originalPersonaConfig.timeout \u002F 2  \u002F\u002F Half remaining time\n   })\n   ```\n\n### STEP 8d — Final Result\n\nWhen re-spawned sub-agent completes:\n1. Read final `OUTBOUND.md`\n2. `ConsultationLog.status` should now be `complete`\n3. Proceed to STEP 10 (Synthesis)\n\nConsultation is **always mentioned** to the user — not gated by display mode.\n\n## Depth Limit\n\n**Max consultation depth = 1.** A sub-agent that was consulted CANNOT consult anyone else. This is enforced by: the consultation re-spawn prompt does NOT include the consultation protocol section. Only the first-level sub-agent has it.\n\n## Timeout Handling\n\n- If consultation times out: You fall back to Codex's partial result + own knowledge\n- You warn: *\"{target} took too long — Codex will continue without that context.\"*\n- Partial result (if any) is still used\n\n---\n\n# Commands\n\n## \u002Fshift status\n\nShow current SHIFT status:\n- Which personas are enabled\n- Current cost budget status\n- Display mode\n\n## \u002Fshift mode hidden|transparent\n\nToggle display mode. Updates config.yaml.\n\n## \u002Fshift fastpath on|off\n\nToggle fast-path mode.\n\n## \u002Fdelegate \\\u003Cpersona\\> \\\u003Ctask\\>\n\nExplicitly delegate a task to a specific persona, ignoring keyword routing.\n\n---\n\n# Config Reference\n\nFull schema at: `~\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fshift\u002Fconfig\u002FSCHEMA.yaml`\n\nKey settings:\n\n```yaml\ndisplayMode: hidden          # hidden | transparent\nfastPath: conservative       # conservative | off\ncostManagement:\n  enabled: true\n  costBudgetPerHour: 2.00   # USD\n  alertThreshold: 0.75       # warn at 75%\npersonas:\n  codex:\n    model: \u003Cyour coding model>\n    timeout: 60\n    consults: [researcher]\n    consultationTimeout: 45\n  researcher:\n    model: \u003Cyour research model>\n    timeout: 90\n    consults: []\n    consultationTimeout: 45\n  runner:\n    model: \u003Cyour fast model>\n    timeout: 30\n    consults: []\n    consultationTimeout: 20\n```\n\n---\n\n# Session Files\n\nAll delegation session files live at:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002F\n```\n\nFiles:\n- `INBOUND.json` — delegation input\n- `CONTEXT.md` — project context\n- `OUTBOUND.md` — sub-identity result\n- `ESCALATE.md` — Runner escalation (if any)\n- `CONSULT-INBOUND.md` — consultation input\n- `CONSULT-OUTBOUND.md` — consultation result\n\nAuto-archived after `contextBridge.archiveAfterMinutes` (default: 60min).\n\n---\n\n*SHIFT — one brain, many specialists.*\n","# SHIFT — Multi-Identity Delegation Skill\n\n**One agent. Many specialists. One conversation.**\n\n---\n\n## ⚠️ SECURITY AND PRIVACY — READ BEFORE ENABLING\n\n### What SHIFT Accesses\n\nSHIFT reads from your OpenClaw workspace:\n- `~\u002F.openclaw\u002Fworkspace\u002FMEMORY.md` — excerpts attached to delegation context\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fconfig.yaml` — your persona and cost settings\n- Session files it creates in `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F`\n\nSHIFT writes to:\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F\u003CrunId>\u002F` — per-delegation session files\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fcost-tracking.json` — delegation cost tracking\n- `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fpersonas\u002F*.yaml` — your persona overrides\n\n### What SHIFT Transmits\n\nWhen you enable delegation, the following are sent to whatever model providers you configure for each persona:\n- Your message content\n- Conversation history (last N turns, controlled by `contextBridge.historyTurns`)\n- Active file contents and MEMORY.md excerpts relevant to the task\n- Delegation metadata (runId, timestamps, persona name)\n\n**You control which models are used.** SHIFT does not ship with or store credentials — it uses the model providers configured in your OpenClaw agent config. Review your provider's data handling policy.\n\n### Data Exposure Risk\n\nIf your workspace files or MEMORY.md contain secrets (API keys, credentials, private data), and those files are referenced in a delegated task, that content will be transmitted to your configured model provider.\n\n**Mitigations:**\n- Do not delegate tasks that reference sensitive file paths\n- Set `contextBridge.historyTurns` to a low number (e.g., 3)\n- Use `costManagement.trackOnly: true` during evaluation to observe behavior without enforcement\n- Use trusted or self-hosted model providers for sensitive work\n\n### Setup Script\n\n`scripts\u002Fsetup.sh` creates local directories only. It does NOT:\n- Make network calls\n- Escalate privileges\n- Modify system files\n- Access credentials\n\n### Cost and Consultations\n\nConsultations spawn additional model calls. Costs are tracked in `cost-tracking.json` per delegation. Set `costManagement.trackOnly: true` to monitor before enforcing limits.\n\n### Recommendations\n\n1. Start with `costManagement.trackOnly: true` to observe costs\n2. Set `contextBridge.historyTurns` to a small number (5 or less)\n3. Set `contextBridge.archiveAfterMinutes: 30` for faster cleanup\n4. Do not delegate tasks referencing sensitive file paths\n5. Review model providers' data policies before sensitive work\n\n---\n\nTriggers on: any message that might benefit from specialized handling — coding tasks, research, analysis, quick lookups, or anything that warrants delegating to a sub-identity.\n\nWhen SHIFT triggers, you read and follows the procedures below to: classify the task, delegate to the right sub-identity, handle consultation between sub-identities, and synthesize the final response in his own voice.\n\n---\n\n# SHIFT Procedures\n\nFollow these steps for every message that triggers SHIFT.\n\n---\n\n## STEP 1 — Fast Path Check\n\nBefore anything, check if this message is trivially handled by you directly.\n\n**Bypass delegation (return `none`) if message is ONLY:**\n- Greetings: `hi`, `hey`, `hello`, `yo`, `sup`\n- Acknowledgments: `thanks`, `thank you`, `ty`, `ok`, `sure`, `got it`, `makes sense`, `cool`, `nice`\n- Meta: `that was fast`, `nice one`, `lol`, `haha`\n\n**If none of those match, proceed to STEP 2.**\n\n---\n\n## STEP 2 — Load Config\n\nRead the SHIFT config at:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fconfig.yaml\n```\n\nIf the file doesn't exist, run the setup script first:\n```bash\nbash ~\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fshift\u002Fscripts\u002Fsetup.sh\n```\n\nFrom config, extract:\n- `displayMode` — `hidden` or `transparent`\n- `fastPath` — `conservative` or `off`\n- `costManagement.enabled`, `costManagement.costBudgetPerHour`, `costManagement.alertThreshold`\n- `contextBridge.historyTurns`, `contextBridge.sessionFolder`\n- `personas` — enabled personas and their settings\n\n---\n\n## STEP 3 — Cost Budget Check\n\nIf `costManagement.enabled: true`:\n\nRead `~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fcost-tracking.json`:\n\n```json\n{\n  \"hourStart\": \"2026-03-18T15:00:00Z\",\n  \"totalSpend\": 0.87,\n  \"delegations\": [...]\n}\n```\n\n**If current UTC hour > hourStart (new hour):**\n→ Reset `totalSpend: 0`, update `hourStart` to current hour.\n\n**If `totalSpend >= costBudgetPerHour`:**\n→ You handle the task directly. Say: *\"Handling this one myself to stay within your cost budget.\"*\nReturn `budget_exceeded`.\n\n**If `totalSpend >= alertThreshold * costBudgetPerHour`:**\n→ Send a quiet warning: *\"Approaching delegation budget limit for this hour.\"*\n\n---\n\n## STEP 4 — Route to Persona\n\nUsing the enabled personas from config, classify the user's message.\n\n### Keyword Scoring\n\nFor each enabled persona, count keyword matches in the user's message (case-insensitive, whole-word). Raw score = matches \u002F total keywords.\n\n**If raw score >= `minConfidence`:** Add to candidates.\n\n**Runner special case:** Runner has `requireExplicit: true`. It only triggers if the message is predominantly a Runner task, not just containing a keyword. If the message has strong code\u002Fresearch keywords, Runner is NOT a match even if it has Runner keywords.\n\n### Tie-Breaking\n\nIf multiple personas score above threshold:\n→ Higher score wins. If tied: codex > researcher > runner.\n\n### Default\n\nIf no persona scores above threshold → You handle directly. Return `none`.\n\n---\n\n## STEP 5 — Prepare Delegation Context\n\nGenerate a unique `runId`:\n```\nrun-{YYYYMMDD}-{HHMM}-{persona}-{sequence}\nExample: run-20260318-1551-codex-001\n```\n\nCreate the session folder:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002F\n```\n\n### Write INBOUND.json\n\n```json\n{\n  \"runId\": \"\u003CrunId>\",\n  \"timestamp\": \"\u003CISO UTC>\",\n  \"persona\": \"\u003Cmatched persona>\",\n  \"userMessage\": \"\u003Cexact user message>\",\n  \"masterConversationHistory\": \u003Clast N turns from conversation>,\n  \"activeFiles\": \u003Cfiles mentioned>,\n  \"masterSummary\": \"\u003Cbrief summary of conversation so far>\"\n}\n```\n\n### Write CONTEXT.md\n\nPull from:\n- `~\u002F.openclaw\u002Fworkspace\u002FMEMORY.md` (keyword-matched relevant sections)\n- Any active file contents mentioned in the conversation\n- Persona-specific context needs (from the persona definition in config)\n\nFormat:\n```markdown\n# Context for {persona}\n\n## Project\u002FMemory (relevant)\n...\n\n## Active Files\n...\n\n## Persona Context Needs\n...\n```\n\n---\n\n## STEP 6 — Build Task Prompt\n\nConstruct the prompt for the sub-agent:\n\n```markdown\n# You are {persona_name}\n\n## Persona\n{persona voice, tone, strengths, blind spots from config}\n\n## Your Task\n{user's exact message}\n\n## Context\nBefore starting, read:\n- \u002Fpath\u002Fto\u002FINBOUND.json — your input and conversation history\n- \u002Fpath\u002Fto\u002FCONTEXT.md — relevant project context\n\n## Your Protocol\n1. Read INBOUND.json and CONTEXT.md\n2. Execute your task\n3. If you need to consult another sub-identity and your persona allows it:\n   - Write your question to the session folder as CONSULT-INBOUND.md\n   - Set a timeout: min(remaining_time * 0.5, your consultationTimeout)\n   - Spawn the target sub-identity using sessions_spawn\n   - Wait for them to write CONSULT-OUTBOUND.md\n   - Read their response and continue with that context\n4. Write your final result to \u002Fpath\u002Fto\u002FOUTBOUND.md\n5. Include a ConsultationLog if you consulted anyone\n6. End your response with [DONE]\n```\n\n---\n\n## STEP 7 — Spawn Sub-Agent\n\n```javascript\nsessions_spawn({\n  model: personaConfig.model,\n  task: taskPrompt,\n  label: `shift-${persona}-${runId}`,\n  timeoutSeconds: personaConfig.timeout,\n  attachments: [\n    { name: \"INBOUND.json\", content: \u003CinboundJsonString> },\n    { name: \"CONTEXT.md\", content: \u003CcontextMdString> }\n  ]\n})\n```\n\n**Track elapsed time.** If `elapsed > timeout * 0.7`:\n→ Send status to user: *\"{persona} is still working on this...\"*\n\n---\n\n## STEP 8 — Wait and Read Result\n\nWait for `sessions_spawn` to complete.\n\n### Read OUTBOUND.md\n\nFrom the session folder:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002FOUTBOUND.md\n```\n\nParse:\n- `Status`: `complete` | `error` | `escalation`\n- `Result`: the actual response content\n- `ConsultationLog`: if sub-identity consulted another\n- `Cost`: token counts if available\n\n### Check for ESCALATE.md (Runner only)\n\nIf `Status: escalation`:\n→ Runner detected the task was too complex. You take over directly.\n→ Read `reason`, `summary`, `partialAnswer` from ESCALATE.md.\n→ Incorporate any partial work Runner did.\n\n---\n\n## STEP 9 — Update Cost Tracking\n\nAfter successful delegation, update `cost-tracking.json`:\n\n```json\n{\n  \"hourStart\": \"\u003Ccurrent hour UTC>\",\n  \"totalSpend\": \u003Cprevious + estimated cost>,\n  \"delegations\": [\n    {\n      \"runId\": \"\u003CrunId>\",\n      \"persona\": \"\u003Cpersona>\",\n      \"inputTokens\": \u003Cfrom sub-agent result if available>,\n      \"outputTokens\": \u003Cfrom sub-agent result if available>,\n      \"estimatedCost\": \u003Ccalculate from model cost config>,\n      \"timestamp\": \"\u003Cnow>\"\n    }\n  ]\n}\n```\n\n---\n\n## STEP 10 — Synthesize Response\n\nTransform the sub-identity's output into your voice.\n\n### Detection\n\nIf `ConsultationLog` is present and non-empty:\n→ Build consultation mention (ALWAYS shown):\n```\n{parent persona} consulted {target persona} on {topic}...\n```\n\n### Transformation Rules\n\n| Sub-identity output | your transformation |\n|---|---|\n| Code | Explain what it does in plain English, highlight key parts, offer to add tests |\n| Analysis\u002FResearch | Pull 2-3 key insights, bullet-point them, note caveats |\n| Quick answer (Runner) | Relay directly with warmth added |\n\n### Display Mode\n\n**Hidden (default):**\n```\n[Assistant]: Here's the {implementation\u002Fanalysis\u002Fanswer}...\n```\n\n**Transparent:**\n```\n[Assistant] → [{persona}] working on this...\n[Assistant] ← [{persona}] done.\n[Assistant]: Here's the...\n```\n\nConsultation mentions are ALWAYS shown in both modes.\n\n---\n\n## STEP 11 — Handle Errors\n\n| Scenario | Response |\n|---|---|\n| Sub-agent timeout | *\"Looks like this one is taking longer than expected — let me work through it directly.\"* |\n| Sub-agent error | *\"Hit a snag with the specialist — let me handle this myself.\"* |\n| sessions_spawn fails | Fall back to your handling directly |\n| OUTBOUND.md missing | Assume sub-agent failed, You handle directly |\n| Model unavailable | Log warning, You handle directly |\n\n---\n\n# Consultation Protocol (Master-Orchestrated)\n\n**Key insight:** Sub-agent sessions cannot cleanly spawn child sessions and wait. The solution: You orchestrate the consultation from the master level.\n\n## Flow\n\n```\nCodex needs context\n        ↓\nCodex writes CONSULT-INBOUND.md + OUTBOUND.md (Status: needs_consultation)\n        ↓\nYou detect needs_consultation flag in OUTBOUND.md\n        ↓\nYou tell user (transparent mode): \"Codex ↔ [Codex → Researcher]...\"\n        ↓\nYou spawn Researcher with CONSULT-INBOUND.md\n        ↓\nResearcher writes CONSULT-OUTBOUND.md\n        ↓\nYou read it, appends to Codex's CONTEXT.md\n        ↓\nYou re-spawn Codex with enriched context (brief task: \"continue with this context\")\n        ↓\nCodex writes final OUTBOUND.md with ConsultationLog\n        ↓\nYou synthesize — mentions the consultation (always visible)\n```\n\n## Sub-Agent Side (Codex\u002FResearcher)\n\nWhen a sub-agent needs to consult another sub-identity:\n\n1. Check: is target in my `consults` list? Is target NOT in my `consultsNever`?\n2. Write `CONSULT-INBOUND.md` to the session folder with the question + context\n3. Write `OUTBOUND.md` with:\n   ```markdown\n   ## Status: needs_consultation\n   \n   ## PartialResult\n   (what Codex has done\u002Funderstood so far)\n   \n   ## ConsultationLog\n   - consulted: researcher\n   - question: \"...\"\n   - status: pending\n   ```\n4. End response with `[NEEDS_CONSULTATION]` instead of `[DONE]`\n5. Stop — You will take over from here\n\n## Master Side\n\nWhen reading OUTBOUND.md after a sub-agent returns:\n\n### STEP 8a — Detect Consultation Need\n\nIf `Status: needs_consultation` is present:\n1. Read `ConsultationLog` to get target and question\n2. Read `CONSULT-INBOUND.md` for full context\n3. Send user update (transparent mode): `[Assistant] ↔ [{persona} → {target}] consulting on {topic}...`\n4. Proceed to STEP 8b\n\n### STEP 8b — Run Consultation\n\n```javascript\n\u002F\u002F Spawn the target sub-identity as a one-shot consultation\nsessions_spawn({\n  model: targetPersonaConfig.model,\n  task: `You are ${target}.\nRead the consultation question from: \u003Cpath to CONSULT-INBOUND.md>\nWrite your answer to: \u003Cpath to CONSULT-OUTBOUND.md>\nEnd with [DONE].`,\n  label: `shift-consult-${runId}`,\n  timeoutSeconds: targetPersonaConfig.consultationTimeout\n})\n```\n\n### STEP 8c — Feed Result Back\n\nAfter consultation completes:\n1. Read `CONSULT-OUTBOUND.md`\n2. Append consultation answer to `CONTEXT.md`:\n   ```markdown\n   ## Consultation Answer from {target}\n   {answer from CONSULT-OUTBOUND.md}\n   ```\n3. Re-spawn the original sub-agent with enriched context:\n   ```javascript\n   sessions_spawn({\n     model: originalPersonaConfig.model,\n     task: `${originalPersonaPrompt}\n     \n## Additional Context (from consultation)\nThe ${target} provided the following guidance:\n\u003Canswer from CONSULT-OUTBOUND.md>\n\nContinue your task using this context. Write your final result to OUTBOUND.md. End with [DONE].`,\n     label: `shift-${originalPersona}-consult-continue-${runId}`,\n     timeoutSeconds: originalPersonaConfig.timeout \u002F 2  \u002F\u002F Half remaining time\n   })\n   ```\n\n### STEP 8d — Final Result\n\nWhen re-spawned sub-agent completes:\n1. Read final `OUTBOUND.md`\n2. `ConsultationLog.status` should now be `complete`\n3. Proceed to STEP 10 (Synthesis)\n\nConsultation is **always mentioned** to the user — not gated by display mode.\n\n## Depth Limit\n\n**Max consultation depth = 1.** A sub-agent that was consulted CANNOT consult anyone else. This is enforced by: the consultation re-spawn prompt does NOT include the consultation protocol section. Only the first-level sub-agent has it.\n\n## Timeout Handling\n\n- If consultation times out: You fall back to Codex's partial result + own knowledge\n- You warn: *\"{target} took too long — Codex will continue without that context.\"*\n- Partial result (if any) is still used\n\n---\n\n# Commands\n\n## \u002Fshift status\n\nShow current SHIFT status:\n- Which personas are enabled\n- Current cost budget status\n- Display mode\n\n## \u002Fshift mode hidden|transparent\n\nToggle display mode. Updates config.yaml.\n\n## \u002Fshift fastpath on|off\n\nToggle fast-path mode.\n\n## \u002Fdelegate \\\u003Cpersona\\> \\\u003Ctask\\>\n\nExplicitly delegate a task to a specific persona, ignoring keyword routing.\n\n---\n\n# Config Reference\n\nFull schema at: `~\u002F.openclaw\u002Fworkspace\u002Fskills\u002Fshift\u002Fconfig\u002FSCHEMA.yaml`\n\nKey settings:\n\n```yaml\ndisplayMode: hidden          # hidden | transparent\nfastPath: conservative       # conservative | off\ncostManagement:\n  enabled: true\n  costBudgetPerHour: 2.00   # USD\n  alertThreshold: 0.75       # warn at 75%\npersonas:\n  codex:\n    model: \u003Cyour coding model>\n    timeout: 60\n    consults: [researcher]\n    consultationTimeout: 45\n  researcher:\n    model: \u003Cyour research model>\n    timeout: 90\n    consults: []\n    consultationTimeout: 45\n  runner:\n    model: \u003Cyour fast model>\n    timeout: 30\n    consults: []\n    consultationTimeout: 20\n```\n\n---\n\n# Session Files\n\nAll delegation session files live at:\n```\n~\u002F.openclaw\u002Fworkspace\u002F.shift\u002Fsessions\u002F{runId}\u002F\n```\n\nFiles:\n- `INBOUND.json` — delegation input\n- `CONTEXT.md` — project context\n- `OUTBOUND.md` — sub-identity result\n- `ESCALATE.md` — Runner escalation (if any)\n- `CONSULT-INBOUND.md` — consultation input\n- `CONSULT-OUTBOUND.md` — consultation result\n\nAuto-archived after `contextBridge.archiveAfterMinutes` (default: 60min).\n\n---\n\n*SHIFT — one brain, many specialists.*\n",{},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fs\u002Fshift",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill shift",{"tool":38,"command":39},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill shift",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill shift","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fs\u002Fshift\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]