@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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Metric and Guard contract
|
|
2
|
+
|
|
3
|
+
Freeze this contract before mutation. If any field changes, stop for drift; do
|
|
4
|
+
not silently recompute the baseline under new rules.
|
|
5
|
+
|
|
6
|
+
## Required Metric fields
|
|
7
|
+
|
|
8
|
+
- `argv`: nonempty trusted argv vector; no shell string.
|
|
9
|
+
- `cwd`: canonical detached worktree root, fixed by Loop.
|
|
10
|
+
- `unit`: one nonempty unit label.
|
|
11
|
+
- `direction`: exactly `higher` or `lower`.
|
|
12
|
+
- `sample_count`: integer at least 3, identical for baseline and candidates.
|
|
13
|
+
- `timeout_ms`: positive integer per sample.
|
|
14
|
+
- `minimum_delta`: finite nonnegative number in the declared unit.
|
|
15
|
+
- `numeric_format`: exactly IEEE-754 binary64, roundTiesToEven after every
|
|
16
|
+
operation, with negative zero normalized to positive zero.
|
|
17
|
+
- `environment`: fixed allowlisted names and redacted non-secret values; no
|
|
18
|
+
inherited credential or mutable random/time seed unless explicitly frozen.
|
|
19
|
+
|
|
20
|
+
Each successful sample must emit exactly one trimmed UTF-8 line matching
|
|
21
|
+
`^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$`. Reject empty,
|
|
22
|
+
multi-line, multi-value, `NaN`, `Infinity`, unit-suffixed, nonzero exit, signaled,
|
|
23
|
+
or timed-out output. Parse to a finite number without locale-dependent separators.
|
|
24
|
+
Reject a decimal with a nonzero significand when binary64 parsing underflows it
|
|
25
|
+
to zero.
|
|
26
|
+
|
|
27
|
+
## Fixed calculation
|
|
28
|
+
|
|
29
|
+
For each sample set:
|
|
30
|
+
|
|
31
|
+
1. Sort binary64 values and calculate the median. For an even count with central
|
|
32
|
+
values `lower <= upper`, use `lower + (upper - lower) / 2` when both have the
|
|
33
|
+
same sign (zero may join either sign); otherwise use
|
|
34
|
+
`lower / 2 + upper / 2`. Apply binary64 roundTiesToEven after every operation
|
|
35
|
+
and normalize negative zero to positive zero.
|
|
36
|
+
2. Calculate noise as the maximum absolute distance from that median.
|
|
37
|
+
3. For `higher`, improvement is `candidate_median - best_median`; for `lower`,
|
|
38
|
+
improvement is `best_median - candidate_median`.
|
|
39
|
+
4. Calculate `required_delta = max(minimum_delta, best_noise + candidate_noise)`.
|
|
40
|
+
5. Accept only when `improvement > required_delta` and Guard passes on the exact
|
|
41
|
+
candidate bytes. Equality is not an improvement.
|
|
42
|
+
|
|
43
|
+
After every operation, require median, noise, improvement, and required delta to
|
|
44
|
+
remain finite. A parsed nonzero value that became zero, an overflow, or a
|
|
45
|
+
non-finite derived value blocks the baseline or rejects the candidate; never
|
|
46
|
+
store it as current best. A rounded zero produced by subtraction is handled
|
|
47
|
+
conservatively as no improvement, never as a win.
|
|
48
|
+
|
|
49
|
+
The initial current best is the pinned baseline. Keep the accepted candidate's
|
|
50
|
+
median and noise as the next current best. Never compare a candidate against an
|
|
51
|
+
older, more favorable baseline or select one sample from a noisy set.
|
|
52
|
+
|
|
53
|
+
## Guard independence
|
|
54
|
+
|
|
55
|
+
For code mutation, Guard is mandatory, fixed before baseline, and distinct from
|
|
56
|
+
Metric. It must validate correctness beyond the optimized outcome—for example a
|
|
57
|
+
relevant real test command, typecheck, or invariant checker. A second invocation
|
|
58
|
+
of Metric, a threshold over the same output, or an oracle the loop may edit is
|
|
59
|
+
not an independent Guard.
|
|
60
|
+
|
|
61
|
+
Run Guard after Metric on the identical candidate fingerprint. Guard passes only
|
|
62
|
+
with its predeclared literal exit/oracle and zero required skips; `NO_TESTS`,
|
|
63
|
+
warning-only, partial, flaky-history waiver, or changed Guard bytes do not pass.
|
|
64
|
+
Metric and Guard may create disposable caches only at exact predeclared paths.
|
|
65
|
+
Snapshot the complete detached-worktree tracked/untracked state around each
|
|
66
|
+
oracle, subtract only that fixed cache allowlist, and treat every other byte,
|
|
67
|
+
mode, type, or path mutation—including outside Scope—as drift.
|
|
68
|
+
|
|
69
|
+
## Reproducibility and drift
|
|
70
|
+
|
|
71
|
+
Record tool versions, immutable Metric/Guard/test/benchmark/dataset digests,
|
|
72
|
+
fixed inputs/data digest, relevant configuration digest,
|
|
73
|
+
base OID, scoped byte manifest digest, and environment fingerprint. Stop when any
|
|
74
|
+
of them changes. Report variance and raw sample values; do not hide outliers or
|
|
75
|
+
retry only bad samples. A failed sample rejects the candidate rather than being
|
|
76
|
+
dropped from aggregation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: cf:pdf
|
|
3
3
|
description: Extract text/tables, create, merge, split PDFs. Fill PDF forms programmatically. Use for PDF processing, generation, form filling, document analysis, batch operations.
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
user-invocable: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: cf:pptx
|
|
3
3
|
description: Create, edit, analyze .pptx PowerPoint files. Use for presentations, slides, layouts, speaker notes, template modification, content extraction, slide generation.
|
|
4
4
|
license: Proprietary. LICENSE.txt has complete terms
|
|
5
5
|
user-invocable: true
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: cf:ask
|
|
3
3
|
description: "Answer questions with evidence. Use when the user asks about project behavior, source code, specs, docs, configuration, dependencies, or external technical information; inspect the repo first, use internet/current docs when repo evidence is insufficient, and ask back only when the question cannot be answered safely."
|
|
4
4
|
user-invocable: true
|
|
5
5
|
when_to_use: "Invoke to answer project or technical questions with repo-first evidence."
|
|
6
6
|
category: utilities
|
|
7
|
-
keywords: [question, evidence, answer, research]
|
|
7
|
+
keywords: [ask, question, evidence, answer, research]
|
|
8
8
|
argument-hint: "<question> [--repo|--web|--both|--brief|--deep]"
|
|
9
9
|
metadata:
|
|
10
10
|
author: haposoft
|
|
11
11
|
version: "1.0.0"
|
|
12
12
|
---
|
|
13
|
-
#
|
|
13
|
+
# Ask Skill
|
|
14
14
|
|
|
15
|
-
`
|
|
15
|
+
`cf:ask` is an evidence-backed question-answering skill. It answers user questions by checking the local project first, then external/current sources when the repository cannot answer the question.
|
|
16
16
|
|
|
17
17
|
## Core Stance
|
|
18
18
|
|
|
@@ -29,7 +29,7 @@ The output is an answer, evidence, confidence, and a follow-up only when needed.
|
|
|
29
29
|
|
|
30
30
|
## When To Use
|
|
31
31
|
|
|
32
|
-
Use `
|
|
32
|
+
Use `cf:ask` when the user asks:
|
|
33
33
|
- "What does X do in this system?"
|
|
34
34
|
- "Where is this flow handled?"
|
|
35
35
|
- "What is the current config/version/package?"
|
|
@@ -41,10 +41,13 @@ Use `hapo:question` when the user asks:
|
|
|
41
41
|
|
|
42
42
|
Do not use it when:
|
|
43
43
|
- The user asks to implement, fix, debug, test, commit, or publish.
|
|
44
|
-
- The user wants ideation/tradeoff exploration; use `
|
|
45
|
-
- The user wants a formal spec; use `
|
|
46
|
-
- The user wants full legacy documentation reconstruction
|
|
47
|
-
|
|
44
|
+
- The user wants ideation/tradeoff exploration; use `cf:brainstorm`.
|
|
45
|
+
- The user wants a formal spec; use `cf:specs`.
|
|
46
|
+
- The user wants full legacy documentation reconstruction: use
|
|
47
|
+
`cf:docs --reconstruct` when the optional document bundle is installed;
|
|
48
|
+
otherwise use `cf:scout` plus source evidence, or explain how to install the
|
|
49
|
+
bundle with `npx @haposoft/cafekit --with-document-skills`.
|
|
50
|
+
- The user wants root-cause diagnosis for a failure; use `cf:debug`.
|
|
48
51
|
|
|
49
52
|
## Modes
|
|
50
53
|
|
|
@@ -77,7 +80,7 @@ Repo evidence priority:
|
|
|
77
80
|
3. source files, tests, scripts, package manifests, config files
|
|
78
81
|
4. git history only when the question asks about changes or provenance
|
|
79
82
|
|
|
80
|
-
Use focused search (`rg`, targeted file reads) instead of broad scans. Use `
|
|
83
|
+
Use focused search (`rg`, targeted file reads) instead of broad scans. Use `cf:scout` when the user asks where something lives or the source surface is unclear.
|
|
81
84
|
|
|
82
85
|
External evidence:
|
|
83
86
|
- Use external/current docs when repo evidence is absent, stale, or not authoritative.
|
|
@@ -138,7 +141,7 @@ Use `templates/question.md` when the user asks to save or document the answer.
|
|
|
138
141
|
### Source Question
|
|
139
142
|
|
|
140
143
|
```text
|
|
141
|
-
/
|
|
144
|
+
/cf:ask "In this system, which file does cafekit use to toggle skill routing?"
|
|
142
145
|
```
|
|
143
146
|
|
|
144
147
|
Expected behavior:
|
|
@@ -149,7 +152,7 @@ Expected behavior:
|
|
|
149
152
|
### Mixed Source + Web Question
|
|
150
153
|
|
|
151
154
|
```text
|
|
152
|
-
/
|
|
155
|
+
/cf:ask "Which React version does this project use, and does that version still match current best practice?" --both
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
Expected behavior:
|
|
@@ -160,7 +163,7 @@ Expected behavior:
|
|
|
160
163
|
### Ask Back
|
|
161
164
|
|
|
162
165
|
```text
|
|
163
|
-
/
|
|
166
|
+
/cf:ask "Is this system stable?"
|
|
164
167
|
```
|
|
165
168
|
|
|
166
169
|
Expected behavior:
|
|
@@ -1,58 +1,85 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: "Research technical
|
|
2
|
+
name: cf:research
|
|
3
|
+
description: "Research technical decisions with proportional depth, traceable evidence, explicit uncertainty, and project-fit recommendations."
|
|
4
4
|
user-invocable: true
|
|
5
|
-
when_to_use: "
|
|
5
|
+
when_to_use: "Use for external technical facts, architecture comparisons, or decisions whose uncertainty needs multi-source evidence."
|
|
6
6
|
category: research
|
|
7
|
-
keywords: [research, evaluation,
|
|
8
|
-
argument-hint: "<
|
|
7
|
+
keywords: [research, evidence, evaluation, architecture, comparison]
|
|
8
|
+
argument-hint: "<topic_or_decision>"
|
|
9
9
|
metadata:
|
|
10
10
|
author: haposoft
|
|
11
|
-
version: "
|
|
11
|
+
version: "3.0.0"
|
|
12
12
|
---
|
|
13
|
-
# Research
|
|
13
|
+
# Research — proportional evidence for a decision
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Return a decision-ready answer, not a search diary or an unsorted option list.
|
|
16
|
+
Research evaluates choices; it does not implement them or invent certainty.
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
## 1. Frame the decision
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
Restate the decision, project constraints, affected consumers, and what evidence
|
|
21
|
+
would change the answer. Inspect current repository sources first whenever local
|
|
22
|
+
fit matters. Ask the user only when a missing choice materially changes scope or
|
|
23
|
+
safety; otherwise label bounded assumptions and continue.
|
|
20
24
|
|
|
21
|
-
|
|
22
|
-
Before delegating, briefly assess the `[topic]`.
|
|
23
|
-
- Is it vague? (e.g. "Research React"). If yes, immediately reject and demand the user specify the context (e.g. "Research SEO capabilities of React Server Components").
|
|
24
|
-
- If solid, proceed.
|
|
25
|
+
## 2. Select depth
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
Call the `Agent` tool to invoke the `researcher` subagent. Use `TaskCreate` only for task-list tracking when the workflow needs persistent task state.
|
|
28
|
-
**Instructions to pass to Researcher:**
|
|
29
|
-
```text
|
|
30
|
-
Conduct comprehensive research on: [topic]
|
|
31
|
-
Constraint 1: ALWAYS use native `WebSearch` as the primary search method.
|
|
32
|
-
Constraint 2: Validate key claims with multiple credible sources. Prioritize official docs, maintainers, release notes, and strong production references.
|
|
33
|
-
Constraint 3: Use direct `WebFetch` only when search results are insufficient or raw source inspection is required.
|
|
34
|
-
Constraint 4: Limit total search calls to a maximum of 5 distinct queries.
|
|
35
|
-
Constraint 5: Stop excessive "chain-searching". Synthesize decisively once the evidence is sufficient.
|
|
36
|
-
Output Format: Must strictly follow the 'Standard Research Report' layout.
|
|
37
|
-
```
|
|
27
|
+
Choose the smallest depth that can support the decision:
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
| Depth | Route when | Evidence work |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| Quick | One low-risk, reversible fact or known option | Resolve the fact from one authoritative source; add a repository anchor when project fit matters. |
|
|
32
|
+
| Standard | Several viable options or a material integration choice | Verify material claims across at least two independent authoritative sources where available; compare fit and tradeoffs. |
|
|
33
|
+
| Deep | High blast radius, hard-to-reverse architecture, security/compliance, substantial cost, or conflicting evidence | Complete Standard, then run a separate contradiction-and-gap round; use at least three independent sources for disputed material claims where available. |
|
|
41
34
|
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
Escalate depth when evidence conflicts, a primary source is missing, or a finding
|
|
36
|
+
changes the decision boundary. Do not inflate source counts with mirrors or
|
|
37
|
+
articles that repeat the same upstream claim. Stop when new evidence no longer
|
|
38
|
+
changes the ranking, limitations, or unresolved gaps.
|
|
44
39
|
|
|
45
|
-
##
|
|
46
|
-
Once the `researcher` completes the Task and returns the Markdown output, save it based on context:
|
|
40
|
+
## 3. Gather evidence
|
|
47
41
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
- Repository claims: cite a resolvable `path:line` anchor from current bytes.
|
|
43
|
+
- External claims: prefer current official documentation, standards, research
|
|
44
|
+
papers, maintainer material, and release notes. Browse when facts may have
|
|
45
|
+
changed; record the source date or applicable version.
|
|
46
|
+
- For each material claim record: claim, URL or repository anchor, authority,
|
|
47
|
+
date/version, applicability to this project, and status
|
|
48
|
+
`confirmed | inferred | unresolved`.
|
|
49
|
+
- A source count is not confidence. Explain conflicts, missing primary evidence,
|
|
50
|
+
version mismatch, and why a source does or does not apply.
|
|
51
|
+
|
|
52
|
+
Use delegated researchers only as optional acceleration when two or more
|
|
53
|
+
independent evidence tracks can be bounded. The controller owns the question,
|
|
54
|
+
source reconciliation, and final recommendation. If delegation is unavailable,
|
|
55
|
+
unauthorized, or not useful, research sequentially with the same evidence bar.
|
|
56
|
+
|
|
57
|
+
## 4. Synthesize
|
|
58
|
+
|
|
59
|
+
For comparisons, rank only viable options and name a winner when evidence and
|
|
60
|
+
project fit support one. For every ranked option include fit, decisive evidence,
|
|
61
|
+
tradeoffs, adoption/operational risks, and limitations. If evidence cannot choose
|
|
62
|
+
a winner, return `unresolved` plus the smallest fact or experiment that would.
|
|
63
|
+
|
|
64
|
+
Use the four mandatory H2 sections from
|
|
65
|
+
`.claude/skills/specs/templates/research.md`. Keep claim records and comparisons
|
|
66
|
+
inside `## Evidence Summary`; do not add or reorder mandatory H2 headings.
|
|
67
|
+
|
|
68
|
+
## 5. Output and persistence
|
|
69
|
+
|
|
70
|
+
Default to a concise answer in chat. Persist only when:
|
|
71
|
+
|
|
72
|
+
1. one explicitly resolved active Spec requires durable `research.md`; save to
|
|
73
|
+
that exact `specs/<feature>/research.md`, preserving its existing lifecycle; or
|
|
74
|
+
2. the user explicitly requests a durable report and approves its destination.
|
|
75
|
+
|
|
76
|
+
Do not create a Spec or `_shared` archive merely to save an answer. The
|
|
77
|
+
controller performs any authorized write after reviewing and redacting the
|
|
78
|
+
output; delegated researchers never write reports or task state. Always state
|
|
79
|
+
depth used, decisive evidence, recommendation, limitations, and unresolved gaps.
|
|
80
|
+
|
|
81
|
+
## Handoff boundary
|
|
82
|
+
|
|
83
|
+
Research may recommend Brainstorm or Specs when a material product/design choice
|
|
84
|
+
remains. It never starts Develop, edits implementation code, claims user approval,
|
|
85
|
+
or presents source/installed evidence as live-system proof.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cf:route
|
|
3
|
+
description: "Route ambiguous, multi-step, multi-domain, or risk-elevated work through the shortest valid chain of installed CafeKit skills and agents."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
when_to_use: "Use when no single obvious installed skill covers the request; skip for an explicitly named skill, one clear low-risk intent, or a direct factual answer."
|
|
6
|
+
category: utilities
|
|
7
|
+
keywords: [routing, workflow, orchestration, delegation, risk]
|
|
8
|
+
argument-hint: "<task>"
|
|
9
|
+
metadata:
|
|
10
|
+
author: haposoft
|
|
11
|
+
version: "1.0.0"
|
|
12
|
+
---
|
|
13
|
+
# Route — proportional native routing
|
|
14
|
+
|
|
15
|
+
Choose the shortest valid path through capabilities that are installed now.
|
|
16
|
+
Route is a decision layer: it classifies, composes, and hands off; each selected
|
|
17
|
+
skill or agent still owns its domain contract and evidence.
|
|
18
|
+
|
|
19
|
+
## 1. Proportional gate
|
|
20
|
+
|
|
21
|
+
Apply these exits before discovery, classification, or delegation:
|
|
22
|
+
|
|
23
|
+
1. **Explicit installed skill:** when the user names a valid installed skill,
|
|
24
|
+
invoke that skill directly. Do not reclassify it or add routing ceremony.
|
|
25
|
+
2. **One obvious intent:** when exactly one installed skill clearly covers a
|
|
26
|
+
low-risk request, use it directly without constructing a chain.
|
|
27
|
+
3. **Direct factual conversation:** answer a factual question directly, or use
|
|
28
|
+
the installed evidence-answering skill when repository or current evidence is
|
|
29
|
+
needed. Do not create a route chain or spawn agents merely to answer it.
|
|
30
|
+
4. Continue in Route only for ambiguity, multiple dependent steps, multiple
|
|
31
|
+
domains, elevated/high risk, or no obvious installed capability.
|
|
32
|
+
|
|
33
|
+
An explicitly named capability that is absent, invalid, duplicate, ambiguous,
|
|
34
|
+
or retired is not an installed route. Name the gap; do not invent a substitute
|
|
35
|
+
with broader authority.
|
|
36
|
+
|
|
37
|
+
## 2. Classify material work
|
|
38
|
+
|
|
39
|
+
Load `references/task-taxonomy.md`. Record exactly one class based on the final
|
|
40
|
+
deliverable, then record size (`trivial | standard | epic`), the highest-link
|
|
41
|
+
risk (`low | elevated | high`), and the number of material domains. Never
|
|
42
|
+
average risk down across links.
|
|
43
|
+
|
|
44
|
+
Use the runtime's live installed skill and agent catalogs. Never synthesize a
|
|
45
|
+
skill, agent, command, or optional bundle from examples in these instructions.
|
|
46
|
+
If inventory is unavailable, use only capabilities the runtime visibly exposes;
|
|
47
|
+
otherwise name the capability gap and keep the path inline where safe.
|
|
48
|
+
|
|
49
|
+
## 3. Compose the shortest valid chain
|
|
50
|
+
|
|
51
|
+
Load `references/chaining-patterns.md` only when two or more links are required.
|
|
52
|
+
Start from `understand -> decide -> execute -> verify -> deliver`, remove every
|
|
53
|
+
link whose output is already evidenced, and add a link only when a modifier
|
|
54
|
+
requires it. Every retained link has an entry condition, an observable exit
|
|
55
|
+
artifact, and exactly one owner.
|
|
56
|
+
|
|
57
|
+
Prefer the user-named skill, then the narrowest domain skill, then a generic
|
|
58
|
+
workflow skill. One intent has one primary skill. Supporting skills may produce
|
|
59
|
+
inputs for it but may not compete for ownership.
|
|
60
|
+
|
|
61
|
+
## 4. Agents and risk gates
|
|
62
|
+
|
|
63
|
+
Load `references/agent-timing.md` only when delegation may materially improve
|
|
64
|
+
fresh context, specialization, tool isolation, or safe parallel work. Discover
|
|
65
|
+
agents from the current runtime; if the preferred agent is missing, continue
|
|
66
|
+
inline when safe or return the named gap. Never synthesize an unavailable agent.
|
|
67
|
+
|
|
68
|
+
- `low`: the owning link's normal proof is sufficient.
|
|
69
|
+
- `elevated`: add explicit verification appropriate to the changed surface.
|
|
70
|
+
- `high`: require independent review and user confirmation before advancing
|
|
71
|
+
past the high-risk gate. When an irreversible or external action is present,
|
|
72
|
+
obtain that confirmation immediately before the action.
|
|
73
|
+
|
|
74
|
+
## 5. Authority is monotonic
|
|
75
|
+
|
|
76
|
+
The route may narrow user authority but never expand it. Read-only stays
|
|
77
|
+
read-only; diagnosis does not authorize repair; implementation does not
|
|
78
|
+
authorize commit, push, deploy, publish, or release; local work does not
|
|
79
|
+
authorize an external action. Stop before any mutation or delivery link that
|
|
80
|
+
the user did not already authorize and state what authority is missing.
|
|
81
|
+
|
|
82
|
+
## 6. Return and handoff
|
|
83
|
+
|
|
84
|
+
Return a compact route record before the first material handoff:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
Route: <class> | size=<trivial|standard|epic> | risk=<low|elevated|high> | domains=<n>
|
|
88
|
+
Chain: <owner: entry -> exit> [-> ...]
|
|
89
|
+
Gates: <authority, verification, confirmation, or named gap>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Do not claim that source text or installed projection proves live-model
|
|
93
|
+
adherence. That behavior remains `[UNPROVEN]` until a separate host run observes
|
|
94
|
+
it.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Agent timing
|
|
2
|
+
|
|
3
|
+
Delegation is optional acceleration, not a mandatory stage. Keep work inline
|
|
4
|
+
when it is small, tightly coupled, dependent on shared evolving context, or no
|
|
5
|
+
installed specialist offers a material advantage.
|
|
6
|
+
|
|
7
|
+
Delegate only when at least one trigger is evidenced:
|
|
8
|
+
|
|
9
|
+
- a specialist needs fresh isolated context;
|
|
10
|
+
- a distinct tool or runtime boundary must be owned separately;
|
|
11
|
+
- two or more scopes are genuinely independent and can run in parallel;
|
|
12
|
+
- an independent reviewer or tester is required by risk.
|
|
13
|
+
|
|
14
|
+
Discover the current runtime's installed agent catalog before delegation. Use
|
|
15
|
+
Claude-native agent types in Claude Code and Codex-native agents/subagents in
|
|
16
|
+
Codex. If the preferred agent is absent, do the work inline when safe or name
|
|
17
|
+
the gap and stop; never synthesize a role or pretend delegation occurred.
|
|
18
|
+
|
|
19
|
+
## Delegation brief
|
|
20
|
+
|
|
21
|
+
Every delegated link receives exactly these seven fields:
|
|
22
|
+
|
|
23
|
+
1. **Outcome** — observable result.
|
|
24
|
+
2. **Scope** — owned files, systems, or questions.
|
|
25
|
+
3. **Inputs** — current evidence and prerequisite artifacts.
|
|
26
|
+
4. **Constraints** — safety, compatibility, authority, and non-goals.
|
|
27
|
+
5. **Acceptance** — proof required for completion.
|
|
28
|
+
6. **Handoff** — expected returned artifact and destination.
|
|
29
|
+
7. **Status vocabulary** — `DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT`.
|
|
30
|
+
|
|
31
|
+
Parallel delegates require disjoint write ownership and no hidden dependency.
|
|
32
|
+
The controller reconciles their outputs and remains responsible for route state;
|
|
33
|
+
an agent never gains commit, push, deploy, publish, release, or other mutation
|
|
34
|
+
authority from delegation alone.
|
|
35
|
+
|
|
36
|
+
## Status handling
|
|
37
|
+
|
|
38
|
+
- `DONE`: validate the exit artifact, then advance.
|
|
39
|
+
- `DONE_WITH_CONCERNS`: resolve correctness or scope concerns before advancing;
|
|
40
|
+
record observational concerns without inventing failure.
|
|
41
|
+
- `BLOCKED`: change evidence, owner, scope, or dependency before retrying.
|
|
42
|
+
- `NEEDS_CONTEXT`: supply the missing bounded context before retrying.
|
|
43
|
+
|
|
44
|
+
Never blindly retry `BLOCKED` or `NEEDS_CONTEXT`. A retry without a material
|
|
45
|
+
change preserves the same normalized cause and therefore the same route failure
|
|
46
|
+
key.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Chaining patterns
|
|
2
|
+
|
|
3
|
+
Use a chain only when one link's output is required by another. The default
|
|
4
|
+
skeleton is:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
understand -> decide -> execute -> verify -> deliver
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Link contract
|
|
11
|
+
|
|
12
|
+
Every retained link must state:
|
|
13
|
+
|
|
14
|
+
- **Entry:** the evidence or artifact required to start.
|
|
15
|
+
- **Exit:** one observable artifact or decision passed forward.
|
|
16
|
+
- **Owner:** exactly one installed skill, installed agent, or the controller.
|
|
17
|
+
|
|
18
|
+
Pass only the exit artifact plus the target, constraints, authority, acceptance,
|
|
19
|
+
and unresolved gaps needed by the next owner. For one or two short links, chat
|
|
20
|
+
context is enough. For longer or interruption-prone work, use an already
|
|
21
|
+
authorized repository artifact; routing never grants permission to create one.
|
|
22
|
+
|
|
23
|
+
## Collapse and insertion
|
|
24
|
+
|
|
25
|
+
Remove a link when its exit is already current and evidenced. An explicit valid
|
|
26
|
+
skill or one obvious low-risk intent normally collapses to one link. Do not keep
|
|
27
|
+
Scout, Brainstorm, Research, Specs, Test, Review, Git, or delivery merely for
|
|
28
|
+
ceremony.
|
|
29
|
+
|
|
30
|
+
Insert a link only for a real modifier:
|
|
31
|
+
|
|
32
|
+
- unresolved repository shape -> discovery;
|
|
33
|
+
- unresolved material choice -> decision;
|
|
34
|
+
- implementation or repair -> execution;
|
|
35
|
+
- elevated risk or changed behavior -> verification;
|
|
36
|
+
- high risk -> independent review and confirmation;
|
|
37
|
+
- commit, push, deploy, publish, or release -> delivery, only with matching
|
|
38
|
+
user authority.
|
|
39
|
+
|
|
40
|
+
## Failure detours and stop
|
|
41
|
+
|
|
42
|
+
On a failed link, preserve its valid exit evidence, normalize the root cause,
|
|
43
|
+
and choose one bounded detour that can change that cause. Track the failure key
|
|
44
|
+
as `(link, owner, normalized cause)` within the current chain.
|
|
45
|
+
|
|
46
|
+
Two failures with the same failure key stop the chain and return `BLOCKED` with
|
|
47
|
+
the evidence and missing decision or capability. Different normalized causes do
|
|
48
|
+
not share a key and must not stop early merely because the link name matches.
|
|
49
|
+
This route-level stop does not replace a separate orchestrator's authoritative
|
|
50
|
+
task-retry budget.
|
|
51
|
+
|
|
52
|
+
No detour may add authority. In particular, review cannot imply push,
|
|
53
|
+
diagnosis cannot imply repair, and build cannot imply deploy.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Task taxonomy
|
|
2
|
+
|
|
3
|
+
Classify by the final deliverable the user expects, not by the first verb, file
|
|
4
|
+
type, or tool mentioned. Choose exactly one class; use domains as modifiers.
|
|
5
|
+
|
|
6
|
+
| Class | Final deliverable |
|
|
7
|
+
|---|---|
|
|
8
|
+
| `answer` | Evidence-backed explanation or factual response |
|
|
9
|
+
| `discover` | Located files, call path, inventory, or blast-radius map |
|
|
10
|
+
| `decide` | Chosen product, architecture, or technical direction |
|
|
11
|
+
| `specify` | Approved bounded plan and executable task packet |
|
|
12
|
+
| `change` | Working implementation or content change |
|
|
13
|
+
| `diagnose` | Root cause and verification-ready repair plan |
|
|
14
|
+
| `repair` | Cause-aligned fix plus regression proof |
|
|
15
|
+
| `verify` | Test or review verdict with owned evidence |
|
|
16
|
+
| `deliver` | Authorized commit, push, deploy, publish, or release result |
|
|
17
|
+
|
|
18
|
+
When a request contains several verbs, classify by its terminal observable
|
|
19
|
+
result. For example, “research options and implement the winner” is `change`,
|
|
20
|
+
while research is a decision link. “Inspect this failure and tell me why” is
|
|
21
|
+
`diagnose`, not `repair`.
|
|
22
|
+
|
|
23
|
+
## Size
|
|
24
|
+
|
|
25
|
+
- `trivial`: one clear reversible outcome, normally one owner and one link.
|
|
26
|
+
- `standard`: multiple dependent links or a bounded cross-file/domain change.
|
|
27
|
+
- `epic`: three or more independently deliverable subsystems; split them into
|
|
28
|
+
bounded routes instead of creating one oversized chain.
|
|
29
|
+
|
|
30
|
+
## Risk
|
|
31
|
+
|
|
32
|
+
Risk is the maximum risk of any retained link, never an average:
|
|
33
|
+
|
|
34
|
+
- `low`: local, reversible, no material compatibility or data boundary.
|
|
35
|
+
- `elevated`: shared contract, integration, migration, sensitive data, or a
|
|
36
|
+
meaningful regression surface.
|
|
37
|
+
- `high`: security boundary, irreversible data/action, production delivery,
|
|
38
|
+
public compatibility, or large blast radius.
|
|
39
|
+
|
|
40
|
+
## Domains and ambiguity
|
|
41
|
+
|
|
42
|
+
Count only material domains that need distinct evidence or ownership. A file
|
|
43
|
+
extension alone is not a domain. Ambiguity adds an understand or decide link
|
|
44
|
+
only when unresolved information can change the final deliverable, authority,
|
|
45
|
+
or verification; otherwise choose the shortest valid direct path.
|
|
46
|
+
|
|
47
|
+
Modifiers constrain a route. They never grant mutation, external-action,
|
|
48
|
+
commit, push, deploy, publish, or release authority.
|