@haposoft/cafekit 0.16.0-rc.8 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -27
- package/bin/__tests__/codex-hooks-ownership.test.js +239 -0
- package/bin/__tests__/codex-hooks.test.js +50 -0
- package/bin/__tests__/codex-native.test.js +1882 -70
- package/bin/__tests__/develop-contract.test.js +400 -23
- package/bin/__tests__/installer-safety.test.js +3 -3
- package/bin/__tests__/optional-skill-inventory.test.js +249 -0
- package/bin/__tests__/output-styles.test.js +214 -0
- package/bin/__tests__/package-inventory.test.js +1735 -98
- package/bin/__tests__/runtime-schema.test.js +111 -0
- package/bin/__tests__/secret-output-guardrail.test.js +122 -0
- package/bin/__tests__/skill-routing-source.test.js +172 -0
- package/bin/__tests__/specs-v2-execution-closeout.test.js +1 -1
- package/bin/install.js +10 -0
- package/bin/lib/codex-install.js +170 -5
- package/bin/lib/context.js +14 -0
- package/bin/lib/i18n.js +12 -6
- package/bin/lib/skill-deps.js +5 -5
- package/bin/phases/claude-runtime.js +23 -0
- package/bin/phases/claude-settings.js +8 -0
- package/bin/phases/codex-hooks.js +156 -0
- package/bin/phases/codex-runtime.js +29 -38
- package/bin/phases/copy-payload.js +8 -2
- package/bin/phases/select-skill-bundles.js +96 -0
- package/bin/phases/skill-inventory.js +71 -0
- package/bin/phases/skills-setup.js +9 -2
- package/bin/phases/write-metadata.js +8 -5
- package/package.json +8 -2
- package/src/claude/CLAUDE.md +3 -3
- package/src/claude/agents/brainstormer.md +52 -69
- package/src/claude/agents/code-auditor.md +32 -14
- package/src/claude/agents/debugger.md +35 -20
- package/src/claude/agents/deployer.md +12 -5
- package/src/claude/agents/docs-keeper.md +11 -1
- package/src/claude/agents/implementer.md +25 -13
- package/src/claude/agents/inspector.md +6 -3
- package/src/claude/agents/project-manager.md +1 -1
- package/src/claude/agents/researcher.md +26 -55
- package/src/claude/agents/spec-maker.md +12 -7
- package/src/claude/agents/strategist.md +52 -0
- package/src/claude/agents/test-runner.md +117 -132
- package/src/claude/agents/ui-ux-designer.md +1 -1
- package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -0
- package/src/claude/hooks/__tests__/precompact.test.js +158 -0
- package/src/claude/hooks/__tests__/spec-gate.test.js +10 -3
- package/src/claude/hooks/__tests__/state.test.js +5 -0
- package/src/claude/hooks/__tests__/statusline.test.js +196 -0
- package/src/claude/hooks/agent.cjs +1 -1
- package/src/claude/hooks/docs-sync.cjs +12 -10
- package/src/claude/hooks/inspect-block.cjs +1 -1
- package/src/claude/hooks/lib/config.cjs +3 -0
- package/src/claude/hooks/lib/hook-state-dir.cjs +39 -0
- package/src/claude/hooks/lib/secret-keywords.cjs +42 -0
- package/src/claude/hooks/precompact.cjs +105 -0
- package/src/claude/hooks/rules.cjs +1 -1
- package/src/claude/hooks/secret-output-guardrail.cjs +43 -0
- package/src/claude/hooks/session.cjs +27 -1
- package/src/claude/hooks/spec-gate.cjs +3 -3
- package/src/claude/hooks/spec-state.cjs +2 -2
- package/src/claude/hooks/state.cjs +1 -1
- package/src/claude/hooks/task-scaffold-guard.cjs +1 -1
- package/src/claude/hooks/usage.cjs +1 -1
- package/src/claude/migration-manifest.json +29 -15
- package/src/claude/output-styles/coding-level-0-eli5.md +103 -0
- package/src/claude/output-styles/coding-level-1-junior.md +124 -0
- package/src/claude/output-styles/coding-level-2-mid.md +146 -0
- package/src/claude/output-styles/coding-level-3-senior.md +148 -0
- package/src/claude/output-styles/coding-level-4-lead.md +159 -0
- package/src/claude/output-styles/coding-level-5-god.md +91 -0
- package/src/claude/references/debugger/core-philosophy.md +5 -3
- package/src/claude/references/debugger/frontend-verification.md +2 -2
- package/src/claude/references/debugger/log-ci-analysis.md +13 -1
- package/src/claude/references/debugger/parallel-agent-hydration.md +19 -34
- package/src/claude/references/debugger/performance-diagnostics.md +2 -2
- package/src/claude/references/debugger/root-cause-tracing.md +37 -6
- package/src/claude/references/debugger/side-effect-gate.md +3 -1
- package/src/claude/references/debugger/verification-protocol.md +13 -12
- package/src/claude/rules/orchestrator.md +7 -1
- package/src/claude/rules/process-management.md +39 -0
- package/src/claude/rules/review-audit-self-decision.md +48 -0
- package/src/claude/rules/skill-domain-routing.md +26 -24
- package/src/claude/rules/skill-workflow-routing.md +22 -14
- package/src/claude/rules/workflow.md +3 -3
- package/src/claude/runtime.json +1 -0
- package/src/claude/runtime.schema.json +205 -0
- package/src/claude/scripts/generate-skill-catalog.cjs +156 -122
- package/src/claude/scripts/provenance.cjs +18 -5
- package/src/claude/scripts/workflow-policy.cjs +1 -1
- package/src/claude/settings/settings.json +16 -0
- package/src/claude/skills/agent-browser/SKILL.md +1 -1
- package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
- package/src/claude/skills/brainstorm/SKILL.md +193 -172
- package/src/claude/skills/brainstorm/references/question-framework.md +105 -167
- package/src/claude/skills/chrome-devtools/SKILL.md +1 -1
- package/src/claude/skills/code-review/SKILL.md +43 -25
- package/src/claude/skills/code-review/references/spec-compliance-review.md +3 -4
- package/src/claude/skills/code-review/references/verification-gate.md +1 -1
- package/src/claude/skills/debug/SKILL.md +48 -19
- package/src/claude/skills/delegate/SKILL.md +1 -1
- package/src/claude/skills/develop/SKILL.md +92 -65
- package/src/claude/skills/develop/references/parallel-waves.md +36 -63
- package/src/claude/skills/develop/references/quality-gate.md +31 -4
- package/src/claude/skills/develop/references/subagent-patterns.md +21 -7
- package/src/claude/skills/docs/SKILL.md +42 -23
- package/src/claude/skills/docs/references/init-workflow.md +4 -4
- package/src/claude/skills/docs/references/reconstruct-workflow.md +6 -6
- package/src/claude/skills/docs/references/standard-docs-workflow.md +6 -2
- package/src/claude/skills/docs/references/summarize-workflow.md +2 -2
- package/src/claude/skills/docs/references/update-workflow.md +9 -7
- package/src/claude/skills/docs/templates/requirements-as-is.md +1 -1
- package/src/claude/skills/docx/SKILL.md +1 -1
- package/src/claude/skills/git/SKILL.md +1 -1
- package/src/claude/skills/git/references/commit-protocols.md +1 -1
- package/src/claude/skills/git/references/finish-branch.md +1 -1
- package/src/claude/skills/hotfix/SKILL.md +159 -170
- package/src/claude/skills/hotfix/references/diagnosis-protocol.md +14 -9
- package/src/claude/skills/hotfix/references/parallel-patterns.md +27 -13
- package/src/claude/skills/hotfix/references/prevention-gate.md +5 -0
- package/src/claude/skills/hotfix/references/review-cycle.md +21 -15
- package/src/claude/skills/hotfix/references/workflow-specialized.md +53 -21
- package/src/claude/skills/inspect/SKILL.md +55 -46
- package/src/claude/skills/inspect/references/internal-inspection.md +21 -5
- package/src/claude/skills/loop/SKILL.md +114 -0
- package/src/claude/skills/loop/references/bounded-loop-protocol.md +104 -0
- package/src/claude/skills/loop/references/metric-and-guard-contract.md +76 -0
- package/src/claude/skills/pdf/SKILL.md +1 -1
- package/src/claude/skills/pptx/SKILL.md +1 -1
- package/src/claude/skills/question/SKILL.md +16 -13
- package/src/claude/skills/research/SKILL.md +70 -43
- package/src/claude/skills/route/SKILL.md +94 -0
- package/src/claude/skills/route/references/agent-timing.md +46 -0
- package/src/claude/skills/route/references/chaining-patterns.md +53 -0
- package/src/claude/skills/route/references/task-taxonomy.md +48 -0
- package/src/claude/skills/specs/SKILL.md +41 -60
- package/src/claude/skills/specs/references/review.md +11 -8
- package/src/claude/skills/specs/references/templates.md +34 -18
- package/src/claude/skills/specs/templates/requirements-init.md +1 -1
- package/src/claude/skills/specs/templates/research.md +2 -2
- package/src/claude/skills/sync/SKILL.md +6 -6
- package/src/claude/skills/sync/references/sync-protocols.md +1 -1
- package/src/claude/skills/test/SKILL.md +120 -120
- package/src/claude/skills/test/references/execution-strategy.md +208 -361
- package/src/claude/skills/test/references/failure-triage.md +55 -121
- package/src/claude/skills/test/references/test-memory.md +20 -34
- package/src/claude/skills/ui-ux-pro-max/SKILL.md +1 -1
- package/src/claude/skills/web-testing/SKILL.md +1 -1
- package/src/claude/skills/xlsx/SKILL.md +1 -1
- package/src/claude/status.cjs +135 -33
- package/src/codex/AGENTS.md +14 -4
- package/src/codex/hooks/docs-sync.cjs +8 -3
- package/src/codex/hooks/lib/hook-context.cjs +18 -4
- package/src/codex/hooks/rules.cjs +29 -1
- package/src/codex/hooks/secret-output-guardrail.cjs +30 -0
- package/src/codex/hooks/spec-gate.cjs +3 -8
- package/src/codex/hooks/spec-state.cjs +2 -1
- package/src/codex/hooks.json +5 -0
- package/src/codex/runtime.json +2 -0
- package/src/common/.env.example +1 -1
- package/src/claude/skills/backend-development/SKILL.md +0 -101
- package/src/claude/skills/backend-development/references/backend-api-design.md +0 -495
- package/src/claude/skills/backend-development/references/backend-architecture.md +0 -454
- package/src/claude/skills/backend-development/references/backend-authentication.md +0 -338
- package/src/claude/skills/backend-development/references/backend-code-quality.md +0 -659
- package/src/claude/skills/backend-development/references/backend-debugging.md +0 -904
- package/src/claude/skills/backend-development/references/backend-devops.md +0 -491
- package/src/claude/skills/backend-development/references/backend-mindset.md +0 -387
- package/src/claude/skills/backend-development/references/backend-performance.md +0 -397
- package/src/claude/skills/backend-development/references/backend-security.md +0 -342
- package/src/claude/skills/backend-development/references/backend-technologies.md +0 -256
- package/src/claude/skills/backend-development/references/backend-testing.md +0 -429
- package/src/claude/skills/devops/.env.example +0 -76
- package/src/claude/skills/devops/SKILL.md +0 -102
- package/src/claude/skills/devops/references/browser-rendering.md +0 -305
- package/src/claude/skills/devops/references/cloudflare-d1-kv.md +0 -123
- package/src/claude/skills/devops/references/cloudflare-platform.md +0 -271
- package/src/claude/skills/devops/references/cloudflare-r2-storage.md +0 -280
- package/src/claude/skills/devops/references/cloudflare-workers-advanced.md +0 -312
- package/src/claude/skills/devops/references/cloudflare-workers-apis.md +0 -309
- package/src/claude/skills/devops/references/cloudflare-workers-basics.md +0 -418
- package/src/claude/skills/devops/references/docker-basics.md +0 -297
- package/src/claude/skills/devops/references/docker-compose.md +0 -292
- package/src/claude/skills/devops/references/gcloud-platform.md +0 -297
- package/src/claude/skills/devops/references/gcloud-services.md +0 -304
- package/src/claude/skills/devops/references/kubernetes-basics.md +0 -95
- package/src/claude/skills/devops/references/kubernetes-helm-advanced.md +0 -70
- package/src/claude/skills/devops/references/kubernetes-helm.md +0 -81
- package/src/claude/skills/devops/references/kubernetes-kubectl.md +0 -74
- package/src/claude/skills/devops/references/kubernetes-security-advanced.md +0 -94
- package/src/claude/skills/devops/references/kubernetes-security.md +0 -89
- package/src/claude/skills/devops/references/kubernetes-troubleshooting-advanced.md +0 -74
- package/src/claude/skills/devops/references/kubernetes-troubleshooting.md +0 -49
- package/src/claude/skills/devops/references/kubernetes-workflows-advanced.md +0 -75
- package/src/claude/skills/devops/references/kubernetes-workflows.md +0 -76
- package/src/claude/skills/devops/scripts/cloudflare_deploy.py +0 -269
- package/src/claude/skills/devops/scripts/docker_optimize.py +0 -332
- package/src/claude/skills/devops/scripts/requirements.txt +0 -20
- package/src/claude/skills/devops/scripts/tests/requirements.txt +0 -3
- package/src/claude/skills/devops/scripts/tests/test_cloudflare_deploy.py +0 -285
- package/src/claude/skills/devops/scripts/tests/test_docker_optimize.py +0 -436
- package/src/claude/skills/frontend-design/SKILL.md +0 -135
- package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +0 -165
- package/src/claude/skills/frontend-design/references/analysis-best-practices.md +0 -80
- package/src/claude/skills/frontend-design/references/analysis-prompts.md +0 -141
- package/src/claude/skills/frontend-design/references/analysis-techniques.md +0 -118
- package/src/claude/skills/frontend-design/references/animejs.md +0 -396
- package/src/claude/skills/frontend-design/references/anti-slop-rules.md +0 -103
- package/src/claude/skills/frontend-design/references/asset-generation.md +0 -337
- package/src/claude/skills/frontend-design/references/bento-motion-engine.md +0 -142
- package/src/claude/skills/frontend-design/references/design-extraction-overview.md +0 -71
- package/src/claude/skills/frontend-design/references/extraction-best-practices.md +0 -141
- package/src/claude/skills/frontend-design/references/extraction-output-templates.md +0 -162
- package/src/claude/skills/frontend-design/references/extraction-prompts.md +0 -127
- package/src/claude/skills/frontend-design/references/magicui-components.md +0 -129
- package/src/claude/skills/frontend-design/references/performance-guardrails.md +0 -169
- package/src/claude/skills/frontend-design/references/premium-design-patterns.md +0 -93
- package/src/claude/skills/frontend-design/references/redesign-audit-checklist.md +0 -114
- package/src/claude/skills/frontend-design/references/technical-accessibility.md +0 -119
- package/src/claude/skills/frontend-design/references/technical-best-practices.md +0 -97
- package/src/claude/skills/frontend-design/references/technical-optimization.md +0 -44
- package/src/claude/skills/frontend-design/references/technical-overview.md +0 -90
- package/src/claude/skills/frontend-design/references/technical-workflows.md +0 -150
- package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +0 -95
- package/src/claude/skills/frontend-design/references/workflow-3d.md +0 -102
- package/src/claude/skills/frontend-design/references/workflow-describe.md +0 -87
- package/src/claude/skills/frontend-design/references/workflow-immersive.md +0 -87
- package/src/claude/skills/frontend-design/references/workflow-quick.md +0 -57
- package/src/claude/skills/frontend-design/references/workflow-screenshot.md +0 -63
- package/src/claude/skills/frontend-design/references/workflow-video.md +0 -74
- package/src/claude/skills/frontend-development/SKILL.md +0 -406
- package/src/claude/skills/frontend-development/resources/common-patterns.md +0 -331
- package/src/claude/skills/frontend-development/resources/complete-examples.md +0 -872
- package/src/claude/skills/frontend-development/resources/component-patterns.md +0 -502
- package/src/claude/skills/frontend-development/resources/data-fetching.md +0 -767
- package/src/claude/skills/frontend-development/resources/file-organization.md +0 -502
- package/src/claude/skills/frontend-development/resources/loading-and-error-states.md +0 -501
- package/src/claude/skills/frontend-development/resources/performance.md +0 -406
- package/src/claude/skills/frontend-development/resources/routing-guide.md +0 -364
- package/src/claude/skills/frontend-development/resources/styling-guide.md +0 -428
- package/src/claude/skills/frontend-development/resources/typescript-standards.md +0 -418
- package/src/claude/skills/mobile-development/SKILL.md +0 -218
- package/src/claude/skills/mobile-development/references/mobile-android.md +0 -604
- package/src/claude/skills/mobile-development/references/mobile-best-practices.md +0 -544
- package/src/claude/skills/mobile-development/references/mobile-debugging.md +0 -1089
- package/src/claude/skills/mobile-development/references/mobile-frameworks.md +0 -465
- package/src/claude/skills/mobile-development/references/mobile-ios.md +0 -496
- package/src/claude/skills/mobile-development/references/mobile-mindset.md +0 -542
- package/src/claude/skills/react-best-practices/AGENTS.md +0 -2249
- package/src/claude/skills/react-best-practices/README.md +0 -123
- package/src/claude/skills/react-best-practices/SKILL.md +0 -128
- package/src/claude/skills/react-best-practices/metadata.json +0 -15
- package/src/claude/skills/react-best-practices/rules/_sections.md +0 -46
- package/src/claude/skills/react-best-practices/rules/_template.md +0 -28
- package/src/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/src/claude/skills/react-best-practices/rules/advanced-use-latest.md +0 -49
- package/src/claude/skills/react-best-practices/rules/async-api-routes.md +0 -38
- package/src/claude/skills/react-best-practices/rules/async-defer-await.md +0 -80
- package/src/claude/skills/react-best-practices/rules/async-dependencies.md +0 -36
- package/src/claude/skills/react-best-practices/rules/async-parallel.md +0 -28
- package/src/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/src/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +0 -59
- package/src/claude/skills/react-best-practices/rules/bundle-conditional.md +0 -31
- package/src/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/src/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/src/claude/skills/react-best-practices/rules/bundle-preload.md +0 -50
- package/src/claude/skills/react-best-practices/rules/client-event-listeners.md +0 -74
- package/src/claude/skills/react-best-practices/rules/client-swr-dedup.md +0 -56
- package/src/claude/skills/react-best-practices/rules/js-batch-dom-css.md +0 -82
- package/src/claude/skills/react-best-practices/rules/js-cache-function-results.md +0 -80
- package/src/claude/skills/react-best-practices/rules/js-cache-property-access.md +0 -28
- package/src/claude/skills/react-best-practices/rules/js-cache-storage.md +0 -70
- package/src/claude/skills/react-best-practices/rules/js-combine-iterations.md +0 -32
- package/src/claude/skills/react-best-practices/rules/js-early-exit.md +0 -50
- package/src/claude/skills/react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/src/claude/skills/react-best-practices/rules/js-index-maps.md +0 -37
- package/src/claude/skills/react-best-practices/rules/js-length-check-first.md +0 -49
- package/src/claude/skills/react-best-practices/rules/js-min-max-loop.md +0 -82
- package/src/claude/skills/react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/src/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/src/claude/skills/react-best-practices/rules/rendering-activity.md +0 -26
- package/src/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/src/claude/skills/react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/src/claude/skills/react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/src/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/src/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/src/claude/skills/react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/src/claude/skills/react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/src/claude/skills/react-best-practices/rules/rerender-dependencies.md +0 -45
- package/src/claude/skills/react-best-practices/rules/rerender-derived-state.md +0 -29
- package/src/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/src/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/src/claude/skills/react-best-practices/rules/rerender-memo.md +0 -44
- package/src/claude/skills/react-best-practices/rules/rerender-transitions.md +0 -40
- package/src/claude/skills/react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/src/claude/skills/react-best-practices/rules/server-cache-lru.md +0 -41
- package/src/claude/skills/react-best-practices/rules/server-cache-react.md +0 -26
- package/src/claude/skills/react-best-practices/rules/server-parallel-fetching.md +0 -79
- package/src/claude/skills/react-best-practices/rules/server-serialization.md +0 -38
|
@@ -1,43 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Permission-Gated Parallel Reconnaissance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Parallel discovery is optional, not a default Debug phase. Start with focused repository and runtime evidence in the main agent.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Delegation Gate
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Cross-examination Audits:** When you suspect an error heavily involves 2-3 disparate services. You must read Frontend Server logs, API Backend endpoints, and Slow Query PostgreSQL logs concurrently.
|
|
9
|
-
- **Widespread Impact Reconnaissance:** Exploring how many times an entire codebase invokes an API that recently suffered a Deprecation notice.
|
|
10
|
-
- **Polluter Isolation Tactics:** Scanning isolated codebase sectors independently to track down memory leaks or Data Races. Instead of executing Git Bisect linearly, deploy 3 Sub-Agents to investigate 3 separate commit history timelines simultaneously.
|
|
7
|
+
Delegate only when all are true:
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
1. The user explicitly requested or permitted delegation or parallel agents.
|
|
10
|
+
2. The active runtime exposes an Explore/delegation capability.
|
|
11
|
+
3. There are at least two distinct, non-overlapping scopes whose read-only evidence can be collected independently.
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
Otherwise continue sequentially. Lack of delegation must never block diagnosis.
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
When investigating severe system latency/bottleneck incidents, initiate 3 concurrent Agents before executing localized manual sweeps:
|
|
15
|
+
## Good Independent Scopes
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"Files/Context": "src/database/... (assign appropriate CWD)",
|
|
24
|
-
"ExpectedOutput": "A concise text summary published via TaskUpdate."
|
|
25
|
-
}
|
|
17
|
+
- Frontend console/network evidence vs backend request/log evidence
|
|
18
|
+
- Application trace vs database query/lock evidence
|
|
19
|
+
- Failing CI job vs nearest known-good run
|
|
20
|
+
- Independent service or package boundaries in a cascading incident
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
"Goal": "Monitor Network tabs, analyze HAR files or Load Test scripts. Specifically identify any JS Bundle requiring more than 5 seconds to load.",
|
|
30
|
-
"Files/Context": "src/frontend/... "
|
|
31
|
-
}
|
|
22
|
+
## Dispatch Contract
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## 3. Disruption Avoidance Rules (Isolation Paradigms)
|
|
41
|
-
- **Zero Shared Modification Allowed:** Sub-Agents deployed during the "Reconnaissance" Phase (Hydration) are explicitly RESTRICTED TO READ-ONLY OPERATIONS (Read-only, Grep, Log search). Absolutely forbid assigning dual sub-agents to mutate the same `.ts` file simultaneously, an act which guarantees catastrophic Merge Conflicts.
|
|
42
|
-
- **Context Injection (Knowledge Passing):** Do not expect your proxy agents to derive full systemic context from nothing. Inject rich knowledge matrices directly into the Description string during `TaskCreate`: "Navigate exclusively into directory X, execute command Y, locate error line Z. Return report immediately here".
|
|
43
|
-
- **Acknowledge & Gather Pattern (Re-assimilation):** After deploying the fleet, aggressively monitor the grid using `TaskList` or `TaskGet`. Wait for operative `DONE` statuses and updates. Finally, amalgamate returning reports into a master Cross-correlation diagnostic map before passing your final judgment execution.
|
|
24
|
+
- Assign explicit source/log/runtime boundaries with no overlap.
|
|
25
|
+
- Reconnaissance is read-only: no product edits, fix application, migrations, or state mutation.
|
|
26
|
+
- Provide the symptom, known evidence, exact questions, allowed commands, and required provenance.
|
|
27
|
+
- Require findings to distinguish observed fact, inference, and unknown.
|
|
28
|
+
- Join all results before root-cause judgment. Resolve contradictions against primary evidence and record unresolved conflicts.
|
|
@@ -33,7 +33,7 @@ Measure before optimizing. A performance fix without a baseline is guessing.
|
|
|
33
33
|
- Cold starts, cache misses, or dependency latency
|
|
34
34
|
6. **Set verification target**
|
|
35
35
|
- Before metric
|
|
36
|
-
-
|
|
36
|
+
- Required after metric for Fix/Test
|
|
37
37
|
- Acceptable threshold
|
|
38
38
|
- Regression guard if feasible
|
|
39
39
|
|
|
@@ -70,7 +70,7 @@ Check:
|
|
|
70
70
|
- Baseline:
|
|
71
71
|
- Bottleneck layer:
|
|
72
72
|
- Root cause:
|
|
73
|
-
-
|
|
73
|
+
- Cause-aligned fix direction:
|
|
74
74
|
- Verification target:
|
|
75
75
|
- Regression guard:
|
|
76
76
|
```
|
|
@@ -2,16 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
When dealing with deep-rooted system failures, avoid modifying the surface layer where the error was thrown. The true failure often originated several layers deeper.
|
|
4
4
|
|
|
5
|
+
## Trace Backward To The Origin
|
|
6
|
+
|
|
7
|
+
Do not stop at the frame that throws. Trace this chain with evidence:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
symptom -> immediate cause -> caller/data boundary -> origin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
At each boundary, record the input, expected invariant, actual value/state, and evidence source. The origin is the earliest owned invariant whose violation is sufficient to explain the downstream symptom.
|
|
14
|
+
|
|
15
|
+
## Separate Causal Roles
|
|
16
|
+
|
|
17
|
+
- **Trigger:** event or input that activated the failure now.
|
|
18
|
+
- **Root cause:** violated owned invariant that made the failure possible.
|
|
19
|
+
- **Contributing factor:** condition that increased likelihood or impact but is not sufficient by itself.
|
|
20
|
+
|
|
21
|
+
Do not label temporal proximity or a recent commit as causation until the mechanism is demonstrated.
|
|
22
|
+
|
|
5
23
|
## The 5-Whys Deep Dive
|
|
6
|
-
|
|
24
|
+
Ask "Why?" until the chain reaches the responsible invariant:
|
|
7
25
|
- **Symptom:** User cannot log in.
|
|
8
26
|
- *Why?* The Frontend received an `undefined` profile object.
|
|
9
27
|
- *Why?* The Backend API returned null.
|
|
10
28
|
- *Why?* The Database query failed silently.
|
|
11
29
|
- *Why?* The ORM mapping model was updated yesterday, but the database schema migration was never executed.
|
|
12
|
-
- **
|
|
30
|
+
- **Root cause direction:** repair the missing migration contract; a frontend fallback would only mask the symptom.
|
|
31
|
+
|
|
32
|
+
## Call And Data Chain Template
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
- Symptom boundary: [where failure becomes observable]
|
|
36
|
+
- Immediate cause: [throw/invalid state/timeout]
|
|
37
|
+
- Caller or data producer: [who supplied it]
|
|
38
|
+
- Origin: [first violated owned invariant]
|
|
39
|
+
- Trigger: [event/input or unknown]
|
|
40
|
+
- Contributing factors: [conditions or none evidenced]
|
|
41
|
+
- Evidence links: [file:line/log/config/query/trace]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For test pollution, isolate the polluter with the existing runner's subset, order, seed, or bisection support. Change one variable at a time. Temporary instrumentation must state its purpose and be removed before handoff.
|
|
45
|
+
|
|
46
|
+
## History And Bisection
|
|
13
47
|
|
|
14
|
-
|
|
15
|
-
If a bug suddenly appears in a previously working system and the cause is completely obscured, utilize Git history profiling.
|
|
16
|
-
- Command the terminal to run `git log -p path/to/failing-file` to see exactly who altered the logic and what the previous state was.
|
|
17
|
-
- Do not hesitate to use standard Unix commands to track changes over time or locate when a specific variable was dropped.
|
|
48
|
+
Use `git log -p -- path/to/file` to form hypotheses about when behavior changed; history alone is not proof. Use `git bisect run` only in a clean disposable worktree with a deterministic diagnostic command and explicit authorization for the checkout churn. Otherwise provide the bisection plan for Fix/Test to execute.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Side-Effect Gate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Debug designs this sweep; `cf:fix` and the canonical test owner execute it after implementation. A local symptom can disappear while a nearby contract regresses.
|
|
4
4
|
|
|
5
5
|
## Gate Questions
|
|
6
6
|
|
|
@@ -44,5 +44,7 @@ Use this before claiming a fix is complete. A bug can be fixed locally and still
|
|
|
44
44
|
- Contract changes:
|
|
45
45
|
- Runtime checks:
|
|
46
46
|
- Security/privacy:
|
|
47
|
+
- Recurrence invariant:
|
|
48
|
+
- Observability/alerting gap:
|
|
47
49
|
- Residual risk:
|
|
48
50
|
```
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Diagnostic Verification Protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Debug owns the failing baseline and the proof plan. It does not apply or certify the repair.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Ownership Boundary
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
|
|
7
|
+
1. **Debug — reproduce and diagnose:**
|
|
8
|
+
Capture the exact failing command, flow, log trigger, environment, and current output. If reproduction is unsafe or unavailable, state the limitation and use the strongest observable evidence.
|
|
9
9
|
|
|
10
|
-
2. **
|
|
11
|
-
|
|
10
|
+
2. **Debug — design proof:**
|
|
11
|
+
Name the same reproduction, regression guard, transitive checks, side-effect sweep, and acceptance signal that would prove the proposed direction.
|
|
12
12
|
|
|
13
|
-
3. **
|
|
14
|
-
|
|
13
|
+
3. **Fix/Test — mutate and verify:**
|
|
14
|
+
The implementation workflow applies the change. The canonical test owner reruns the baseline and the planned regression and side-effect checks with fresh output.
|
|
15
15
|
|
|
16
16
|
## What constitutes "Invalid Proof"?
|
|
17
17
|
- **"I have reviewed the code and it looks correct."** -> This is hallucinated confidence. Rejected.
|
|
18
18
|
- **"The unit test should pass now."** -> Assuming outcomes without execution. Rejected.
|
|
19
|
+
- A different command that does not exercise the original failure path.
|
|
20
|
+
- Stale logs, screenshots, or output captured before the final implementation.
|
|
21
|
+
- A green health check when the reported business state remains unobserved.
|
|
19
22
|
|
|
20
23
|
## How to execute tests when no test suite exists?
|
|
21
|
-
If the project lacks a formal test suite
|
|
22
|
-
- Use `curl -v http://localhost:...` to prove an endpoint stopped throwing `500`.
|
|
23
|
-
- Inject temporary `console.log()` outputs, trigger the flow, run the script, and grep the output buffer to prove the variable resolves correctly. (Remember to delete the temporary logs after proof is acquired).
|
|
24
|
+
If the project lacks a formal test suite, Debug should define a deterministic native check such as a CLI invocation, read-only query, HTTP request, or browser flow. Temporary diagnostic instrumentation is allowed only to expose hidden state, must not alter product behavior, and must be removed before handoff. Fix/Test executes post-change proof.
|
|
@@ -91,7 +91,13 @@ Task cannot be completed as scoped. Never retry with the same inputs — instead
|
|
|
91
91
|
### `NEEDS_INFO`
|
|
92
92
|
Agent lacks information to proceed. Supply the missing context and re-dispatch.
|
|
93
93
|
|
|
94
|
-
> If an agent fails the same task **3+ times**, stop retrying and escalate
|
|
94
|
+
> If an agent fails the same task **3+ times**, stop retrying and escalate.
|
|
95
|
+
|
|
96
|
+
## Model Escalation
|
|
97
|
+
|
|
98
|
+
When the current session or a subagent runs on a model below `fable` (e.g. `opus`, `sonnet`, `haiku`) and hits a hard problem — repeated failed attempts, a high-stakes design fork, or fuzzy requirements — spawn the `strategist` agent for counsel instead of switching the session model. It runs autonomously on the strongest available model and returns full advice in one reply, with no interview and no user round-trips. Give it the task, evidence gathered so far, approaches tried, and the specific question. It advises only; the caller stays responsible for the implementation.
|
|
99
|
+
|
|
100
|
+
Counsel is not execution proof: it cannot close a task, satisfy a Verification Plan, or stand in for a Receipt. Escalate to the user when the strategist also cannot resolve it, or when the fork is one only the user may decide.
|
|
95
101
|
|
|
96
102
|
---
|
|
97
103
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Process and Resource Management
|
|
2
|
+
|
|
3
|
+
Use this file when a task starts, reuses, or ends long-running processes: dev
|
|
4
|
+
servers, watchers, build daemons, tunnels, test runners, or emulators. It exists
|
|
5
|
+
to prevent orphaned processes from accumulating and exhausting device memory.
|
|
6
|
+
|
|
7
|
+
## The failure mode
|
|
8
|
+
|
|
9
|
+
An agent starts a dev environment, then abandons it. The next run finds the port
|
|
10
|
+
busy and, instead of stopping the stale owner, picks a new port and starts
|
|
11
|
+
another process. Repeat, and the machine fills with duplicate processes and held
|
|
12
|
+
ports. Parallel wave worktrees make it worse: each worktree spawns its own
|
|
13
|
+
processes, and when the user removes the worktree or ends the session those
|
|
14
|
+
processes stay behind.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- Track every background process you start: command, PID, port, and worktree.
|
|
19
|
+
Prefer a background facility whose exit you can observe over an unobservable
|
|
20
|
+
detached run.
|
|
21
|
+
- Before starting a long-running process, check whether one is already running
|
|
22
|
+
for this project or port. Reuse or stop it; do not spawn a duplicate.
|
|
23
|
+
- Bind to a deterministic port per project or worktree. On "address in use",
|
|
24
|
+
identify and stop the stale owner rather than taking another port. Inspect
|
|
25
|
+
with `lsof -i :PORT` or `ss -ltnp` on macOS and Linux, `netstat -ano` on
|
|
26
|
+
Windows.
|
|
27
|
+
- Stop what you started when its task, session, or worktree ends. Before a
|
|
28
|
+
`cf:develop` wave releases a worktree, terminate that worktree's background
|
|
29
|
+
processes so nothing is left orphaned.
|
|
30
|
+
- Reconcile periodically: list your running dev processes (`ps`, `lsof`) and
|
|
31
|
+
stop the ones that no longer map to an active task or worktree.
|
|
32
|
+
- Stop cleanly first (`SIGTERM`, or `taskkill /PID` on Windows), escalating to a
|
|
33
|
+
hard kill only when the process ignores the signal.
|
|
34
|
+
|
|
35
|
+
## Safety
|
|
36
|
+
|
|
37
|
+
Only stop processes you started or clearly own. Never end a process belonging to
|
|
38
|
+
the user, another session, or the operating system without confirmation, and
|
|
39
|
+
never match a kill pattern broad enough to catch unrelated processes.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Review, Audit, and Decision Rules
|
|
2
|
+
|
|
3
|
+
Use this file when reviewing code, applying audit feedback, or cutting scope.
|
|
4
|
+
|
|
5
|
+
## Verified Decisions
|
|
6
|
+
|
|
7
|
+
Once a decision is verified by source, tests, or an empirical check, do not
|
|
8
|
+
reverse it because an audit raises an abstract concern. Reverse only when the
|
|
9
|
+
audit adds new evidence or the context changed.
|
|
10
|
+
|
|
11
|
+
When rejecting an audit concern, name the verification source briefly.
|
|
12
|
+
|
|
13
|
+
## User Decisions
|
|
14
|
+
|
|
15
|
+
Do not silently undo an explicit user decision. This covers the C1 scope choice,
|
|
16
|
+
C2 finding dispositions, and C3 completion judgement, along with thresholds,
|
|
17
|
+
selected libraries, feature scope, schema shape, pricing, timelines, compliance
|
|
18
|
+
choices, and UX trade-offs. Those gates are defined in `workflow.md`; this rule
|
|
19
|
+
governs only how a later review may treat them.
|
|
20
|
+
|
|
21
|
+
If an audit suggests reversing a user decision, present:
|
|
22
|
+
|
|
23
|
+
- the original decision
|
|
24
|
+
- the audit concern
|
|
25
|
+
- the trade-off
|
|
26
|
+
- the concrete options
|
|
27
|
+
|
|
28
|
+
Then wait for the user.
|
|
29
|
+
|
|
30
|
+
## Threat Model
|
|
31
|
+
|
|
32
|
+
Before applying a security or robustness finding, identify what the code
|
|
33
|
+
actually stores, protects, or exposes. Fix real failure modes. Document
|
|
34
|
+
non-issues briefly. Ask when the risk is plausible but depends on product
|
|
35
|
+
intent.
|
|
36
|
+
|
|
37
|
+
## Scout First
|
|
38
|
+
|
|
39
|
+
For questions answerable by reading the repository, scout before asking.
|
|
40
|
+
`cf:scout` owns discovery and `cf:ask` owns the ask-back conditions; do not
|
|
41
|
+
restate that list here.
|
|
42
|
+
|
|
43
|
+
## Stable Code Artifacts
|
|
44
|
+
|
|
45
|
+
Do not add plan IDs, phase numbers, CP or AC identifiers, audit labels, or
|
|
46
|
+
finding codes to code comments, migration names, test names, or commit
|
|
47
|
+
messages. Explain the invariant or behavior directly. Artifacts that already
|
|
48
|
+
carry such identifiers stay as they are.
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
# Skill Domain Routing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This rule is advisory model guidance, not an automatic prompt hook. Generate the
|
|
4
|
+
current runtime catalog first when capability presence is uncertain, then read
|
|
5
|
+
the selected skill's `SKILL.md` before acting.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Resolve a capability slot from catalog `description`, `when_to_use`, `category`,
|
|
8
|
+
and `keywords`; examples below are intent hints, not a copied installed inventory.
|
|
9
|
+
|
|
10
|
+
| Capability slot | Matching intent |
|
|
6
11
|
|---|---|
|
|
7
|
-
| answer
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
| diagnose error / CI failure | `/hapo:debug` |
|
|
24
|
-
| external best practices / tool compare | `/hapo:research` |
|
|
25
|
-
| pptx / docx / pdf / xlsx / multimodal | `/hapo:pptx` / `docx` / `pdf` / `xlsx` / `ai-multimodal` |
|
|
26
|
-
| commit / branch / release prep | `/hapo:git` |
|
|
27
|
-
| review before release | `/hapo:code-review` |
|
|
12
|
+
| evidence answer | factual question requiring source/docs/spec/config/current evidence |
|
|
13
|
+
| repository discovery | files, entrypoints, call path, structure, blast radius |
|
|
14
|
+
| product or architecture decision | unresolved outcome, scope, or material trade-off |
|
|
15
|
+
| technical research | external comparison, conflicting evidence, current best practice |
|
|
16
|
+
| specification | concrete substantial work needing durable plan/tasks |
|
|
17
|
+
| implementation or repair | authorized code/content change or cause-aligned fix |
|
|
18
|
+
| diagnosis | bug, failure, CI, incident, regression, or unexpected behavior |
|
|
19
|
+
| verification or review | test execution, independent correctness/security review |
|
|
20
|
+
| browser evidence | page interaction, snapshots, network, performance, or accessibility |
|
|
21
|
+
| repository delivery | explicitly authorized commit, push, or branch operation |
|
|
22
|
+
| document/artifact work | use only a matching installed optional capability |
|
|
23
|
+
|
|
24
|
+
Choose one primary capability per intent. Add a secondary only when its output is
|
|
25
|
+
an entry condition for the primary. If zero valid capabilities match, continue
|
|
26
|
+
inline when safe or name the gap. If multiple catalog entries expose the same
|
|
27
|
+
public identity, do not auto-route; require explicit user disambiguation.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Never infer an optional document capability from this rule. Never select the
|
|
30
|
+
explicit-only numeric optimization capability unless the user invokes it with
|
|
31
|
+
its required bounded metric/guard contract.
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
# Skill Workflow Routing
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use native semantic selection, not an automatic prompt-scoring hook. The live
|
|
4
|
+
catalog is descriptive evidence only; it never grants authority or forces a
|
|
5
|
+
workflow.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
## Proportional selection
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
1. If the user names a valid installed skill, use it directly.
|
|
10
|
+
2. If one obvious low-risk installed skill covers the intent, use it directly.
|
|
11
|
+
3. For direct factual conversation, answer directly or use the installed
|
|
12
|
+
evidence-answer capability; do not invoke Route or agents for ceremony.
|
|
13
|
+
4. For ambiguous, multi-step, multi-domain, or elevated/high-risk work, use the
|
|
14
|
+
installed Route capability to classify and compose the shortest valid chain.
|
|
8
15
|
|
|
9
|
-
|
|
16
|
+
Resolve every abstract link against the current runtime catalog. An absent,
|
|
17
|
+
invalid, folder-mismatched, duplicate, or retired entry is not routable. Continue
|
|
18
|
+
inline when safe or name the gap; never fabricate a skill or agent.
|
|
19
|
+
|
|
20
|
+
## Chain shape
|
|
10
21
|
|
|
11
22
|
```text
|
|
12
|
-
|
|
23
|
+
understand -> decide -> execute -> verify -> deliver
|
|
13
24
|
```
|
|
14
25
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
Collapse links whose output is already current and evidenced. Preserve one
|
|
27
|
+
owner, entry condition, and observable exit per retained link. Diagnosis does
|
|
28
|
+
not authorize repair; implementation does not authorize commit, push, deploy,
|
|
29
|
+
publish, or release; no route expands the user's existing authority.
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| debug-vs-hotfix | `/hapo:debug` first when root cause unknown | Root cause is known / trivial local fix → `/hapo:hotfix` |
|
|
22
|
-
| question-vs-research | `/hapo:question` to ask about source code, docs, specs, config, dependencies, or project facts | External best-practice comparison / multi-source investigation → `/hapo:research` |
|
|
23
|
-
| question-vs-brainstorm | `/hapo:question` for factual answers with evidence | Vague idea, missing acceptance criteria, unclear scope, multi-approach tradeoffs → `/hapo:brainstorm` |
|
|
24
|
-
| specs-vs-brainstorm | `/hapo:specs` when intent and acceptance are concrete enough | Unclear idea / architecture choices still open → `/hapo:brainstorm` first |
|
|
31
|
+
Use `skill-domain-routing.md` to resolve domain capability slots. The numeric
|
|
32
|
+
optimization capability remains explicit-only and must never be auto-routed.
|
|
@@ -12,12 +12,12 @@ Use the CafeKit loop: **Understand -> Plan -> Execute -> Verify -> Sync**.
|
|
|
12
12
|
|
|
13
13
|
## 2. Plan
|
|
14
14
|
|
|
15
|
-
- For non-trivial features, use `/
|
|
15
|
+
- For non-trivial features, use `/cf:specs` to challenge the minimum scope,
|
|
16
16
|
open C1, and create `specs/<feature>/plan.md` with flat
|
|
17
17
|
`task-NN-*.md` files beside it.
|
|
18
18
|
- After adversarial review, open C2 and apply only the findings the user accepts
|
|
19
19
|
or revises. Specs never starts implementation.
|
|
20
|
-
- Start implementation only after a new explicit `/
|
|
20
|
+
- Start implementation only after a new explicit `/cf:develop` invocation,
|
|
21
21
|
then select one unblocked task at a time.
|
|
22
22
|
- Extract from the active task:
|
|
23
23
|
- `Status`
|
|
@@ -49,7 +49,7 @@ Use the CafeKit loop: **Understand -> Plan -> Execute -> Verify -> Sync**.
|
|
|
49
49
|
|
|
50
50
|
## 5. Sync
|
|
51
51
|
|
|
52
|
-
- Use `/
|
|
52
|
+
- Use `/cf:sync` to edit observed state surgically; the controller is the
|
|
53
53
|
sole writer of task Status and proof.
|
|
54
54
|
- Keep exactly one `Status:` field. Write or replace the task's final inline
|
|
55
55
|
`## Receipt` before setting `Status: done`.
|