用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/oimiragieo/agent-studio --skill routing-fix-worker命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Agent frontmatter enhancements — disallowedTools, mcpServers scoping, fork_eligible field
Context management — pre-compact persistence, threshold alignment, microcompact/circuit breaker detection
Hook enhancements — updatedInput for bash safety prefixes, suppressOutput for verbose blocks, denial-based routing feedback
正在显示 SKILL.md
基于 SOC 职业分类
| name | routing-fix-worker |
| description | Fixes bugs in the agent-studio routing system (hooks, lib, state management) |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Use for features that fix bugs in the routing system: hooks in .claude/hooks/routing/, library modules in .claude/lib/routing/, and state management in .claude/context/runtime/. These are surgical fixes to specific identified bugs.
Read the feature description — it identifies the specific bug, affected files, and expected behavior.
Trace the bug — Use Grep to find the exact code locations. Read only the specific functions mentioned in the feature. Do NOT read entire 2000+ line files. For example, if fixing resetToRouterMode(), grep for that function name and read only that function.
Read existing tests — Check if tests already exist for this area:
tests/lib/routing/ for routing lib teststests/hooks/ for hook tests.claude/hooks/routing/*.test.cjs for co-located hook testsWrite failing tests FIRST (red) — Create regression tests that demonstrate the bug. Tests use node:test built-in:
const { describe, it } = require('node:test');
const assert = require('node:assert');
Place tests in tests/lib/routing/ or tests/hooks/ matching existing conventions.
Implement the fix (green) — Make the minimal change to fix the bug. Do NOT refactor unrelated code.
CRITICAL: Windows file locking — If fixing race conditions or concurrent writes, use proper-lockfile (already a dependency). See .claude/lib/heartbeat/heartbeat-sentinel.cjs for the pattern. Never use naive fs.openSync locks.
Run tests — Execute node --test tests/lib/routing/ and node --test tests/hooks/ to verify your fix passes and no regressions.
Run validation — Execute pnpm validate:routing to ensure routing consistency.
Manual verification — Grep for the specific pattern you fixed to confirm no other instances remain.
{
"salientSummary": "Fixed resetToRouterMode() in router-state.cjs to preserve session-scoped fields (plannerSpawned, complexity) across prompt boundaries while still resetting transient fields. Added 3 regression tests covering spawn history preservation, complexity persistence, and transient field reset.",
"whatWasImplemented": "Modified resetToRouterMode() to check sessionId before resetting session-scoped fields. Added TRANSIENT_FIELDS and SESSION_SCOPED_FIELDS constants to separate concerns. Updated saveStateWithRetry() to use proper-lockfile for atomic writes.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{
"command": "node --test tests/lib/routing/router-state-reset.test.cjs",
"exitCode": 0,
"observation": "3 tests passing, covers spawn preservation, complexity persistence, and transient reset"
},
{
"command": "node --test tests/lib/routing/",
"exitCode": 0,
"observation": "All 12 routing tests pass, no regressions"