@dragonflymcp/plugin 1.0.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/.claude-plugin/plugin.json +26 -0
- package/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/core/annotations.d.ts +71 -0
- package/dist/core/annotations.d.ts.map +1 -0
- package/dist/core/annotations.js +61 -0
- package/dist/core/annotations.js.map +1 -0
- package/dist/core/config.d.ts +66 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +131 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/dispatcher.d.ts +77 -0
- package/dist/core/dispatcher.d.ts.map +1 -0
- package/dist/core/dispatcher.js +132 -0
- package/dist/core/dispatcher.js.map +1 -0
- package/dist/core/server.d.ts +24 -0
- package/dist/core/server.d.ts.map +1 -0
- package/dist/core/server.js +41 -0
- package/dist/core/server.js.map +1 -0
- package/dist/core/store.d.ts +91 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +157 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/types.d.ts +128 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/dist/test-utils/store-harness.d.ts +41 -0
- package/dist/test-utils/store-harness.d.ts.map +1 -0
- package/dist/test-utils/store-harness.js +61 -0
- package/dist/test-utils/store-harness.js.map +1 -0
- package/dist/tools/analytics/aggregators.d.ts +18 -0
- package/dist/tools/analytics/aggregators.d.ts.map +1 -0
- package/dist/tools/analytics/aggregators.js +260 -0
- package/dist/tools/analytics/aggregators.js.map +1 -0
- package/dist/tools/analytics/aggregators.test.d.ts +2 -0
- package/dist/tools/analytics/aggregators.test.d.ts.map +1 -0
- package/dist/tools/analytics/aggregators.test.js +177 -0
- package/dist/tools/analytics/aggregators.test.js.map +1 -0
- package/dist/tools/analytics/drift.d.ts +15 -0
- package/dist/tools/analytics/drift.d.ts.map +1 -0
- package/dist/tools/analytics/drift.js +135 -0
- package/dist/tools/analytics/drift.js.map +1 -0
- package/dist/tools/analytics/drift.test.d.ts +2 -0
- package/dist/tools/analytics/drift.test.d.ts.map +1 -0
- package/dist/tools/analytics/drift.test.js +99 -0
- package/dist/tools/analytics/drift.test.js.map +1 -0
- package/dist/tools/analytics/index.d.ts +10 -0
- package/dist/tools/analytics/index.d.ts.map +1 -0
- package/dist/tools/analytics/index.js +192 -0
- package/dist/tools/analytics/index.js.map +1 -0
- package/dist/tools/analytics/learner.d.ts +29 -0
- package/dist/tools/analytics/learner.d.ts.map +1 -0
- package/dist/tools/analytics/learner.js +135 -0
- package/dist/tools/analytics/learner.js.map +1 -0
- package/dist/tools/analytics/learner.test.d.ts +2 -0
- package/dist/tools/analytics/learner.test.d.ts.map +1 -0
- package/dist/tools/analytics/learner.test.js +118 -0
- package/dist/tools/analytics/learner.test.js.map +1 -0
- package/dist/tools/analytics/observe.d.ts +22 -0
- package/dist/tools/analytics/observe.d.ts.map +1 -0
- package/dist/tools/analytics/observe.js +143 -0
- package/dist/tools/analytics/observe.js.map +1 -0
- package/dist/tools/analytics/observe.test.d.ts +2 -0
- package/dist/tools/analytics/observe.test.d.ts.map +1 -0
- package/dist/tools/analytics/observe.test.js +95 -0
- package/dist/tools/analytics/observe.test.js.map +1 -0
- package/dist/tools/analytics/store.d.ts +29 -0
- package/dist/tools/analytics/store.d.ts.map +1 -0
- package/dist/tools/analytics/store.js +192 -0
- package/dist/tools/analytics/store.js.map +1 -0
- package/dist/tools/analytics/types.d.ts +290 -0
- package/dist/tools/analytics/types.d.ts.map +1 -0
- package/dist/tools/analytics/types.js +7 -0
- package/dist/tools/analytics/types.js.map +1 -0
- package/dist/tools/ast/index.d.ts +8 -0
- package/dist/tools/ast/index.d.ts.map +1 -0
- package/dist/tools/ast/index.js +242 -0
- package/dist/tools/ast/index.js.map +1 -0
- package/dist/tools/ast/indexer.d.ts +41 -0
- package/dist/tools/ast/indexer.d.ts.map +1 -0
- package/dist/tools/ast/indexer.js +617 -0
- package/dist/tools/ast/indexer.js.map +1 -0
- package/dist/tools/ast/store.d.ts +87 -0
- package/dist/tools/ast/store.d.ts.map +1 -0
- package/dist/tools/ast/store.js +280 -0
- package/dist/tools/ast/store.js.map +1 -0
- package/dist/tools/ast/store.test.d.ts +6 -0
- package/dist/tools/ast/store.test.d.ts.map +1 -0
- package/dist/tools/ast/store.test.js +257 -0
- package/dist/tools/ast/store.test.js.map +1 -0
- package/dist/tools/bridge/bridge.d.ts +37 -0
- package/dist/tools/bridge/bridge.d.ts.map +1 -0
- package/dist/tools/bridge/bridge.js +82 -0
- package/dist/tools/bridge/bridge.js.map +1 -0
- package/dist/tools/bridge/bridge.test.d.ts +2 -0
- package/dist/tools/bridge/bridge.test.d.ts.map +1 -0
- package/dist/tools/bridge/bridge.test.js +119 -0
- package/dist/tools/bridge/bridge.test.js.map +1 -0
- package/dist/tools/bridge/index.d.ts +8 -0
- package/dist/tools/bridge/index.d.ts.map +1 -0
- package/dist/tools/bridge/index.js +153 -0
- package/dist/tools/bridge/index.js.map +1 -0
- package/dist/tools/bridge/store.d.ts +45 -0
- package/dist/tools/bridge/store.d.ts.map +1 -0
- package/dist/tools/bridge/store.js +307 -0
- package/dist/tools/bridge/store.js.map +1 -0
- package/dist/tools/bridge/store.test.d.ts +2 -0
- package/dist/tools/bridge/store.test.d.ts.map +1 -0
- package/dist/tools/bridge/store.test.js +180 -0
- package/dist/tools/bridge/store.test.js.map +1 -0
- package/dist/tools/bridge/types.d.ts +44 -0
- package/dist/tools/bridge/types.d.ts.map +1 -0
- package/dist/tools/bridge/types.js +6 -0
- package/dist/tools/bridge/types.js.map +1 -0
- package/dist/tools/evolve/algorithm.d.ts +33 -0
- package/dist/tools/evolve/algorithm.d.ts.map +1 -0
- package/dist/tools/evolve/algorithm.js +64 -0
- package/dist/tools/evolve/algorithm.js.map +1 -0
- package/dist/tools/evolve/algorithm.test.d.ts +6 -0
- package/dist/tools/evolve/algorithm.test.d.ts.map +1 -0
- package/dist/tools/evolve/algorithm.test.js +138 -0
- package/dist/tools/evolve/algorithm.test.js.map +1 -0
- package/dist/tools/evolve/index.d.ts +11 -0
- package/dist/tools/evolve/index.d.ts.map +1 -0
- package/dist/tools/evolve/index.js +300 -0
- package/dist/tools/evolve/index.js.map +1 -0
- package/dist/tools/evolve/store.d.ts +27 -0
- package/dist/tools/evolve/store.d.ts.map +1 -0
- package/dist/tools/evolve/store.js +147 -0
- package/dist/tools/evolve/store.js.map +1 -0
- package/dist/tools/evolve/store.test.d.ts +6 -0
- package/dist/tools/evolve/store.test.d.ts.map +1 -0
- package/dist/tools/evolve/store.test.js +162 -0
- package/dist/tools/evolve/store.test.js.map +1 -0
- package/dist/tools/evolve/types.d.ts +38 -0
- package/dist/tools/evolve/types.d.ts.map +1 -0
- package/dist/tools/evolve/types.js +6 -0
- package/dist/tools/evolve/types.js.map +1 -0
- package/dist/tools/framework/content-loader.d.ts +45 -0
- package/dist/tools/framework/content-loader.d.ts.map +1 -0
- package/dist/tools/framework/content-loader.js +258 -0
- package/dist/tools/framework/content-loader.js.map +1 -0
- package/dist/tools/framework/content-loader.test.d.ts +5 -0
- package/dist/tools/framework/content-loader.test.d.ts.map +1 -0
- package/dist/tools/framework/content-loader.test.js +262 -0
- package/dist/tools/framework/content-loader.test.js.map +1 -0
- package/dist/tools/framework/index.d.ts +30 -0
- package/dist/tools/framework/index.d.ts.map +1 -0
- package/dist/tools/framework/index.js +517 -0
- package/dist/tools/framework/index.js.map +1 -0
- package/dist/tools/framework/session.d.ts +85 -0
- package/dist/tools/framework/session.d.ts.map +1 -0
- package/dist/tools/framework/session.js +311 -0
- package/dist/tools/framework/session.js.map +1 -0
- package/dist/tools/framework/session.test.d.ts +5 -0
- package/dist/tools/framework/session.test.d.ts.map +1 -0
- package/dist/tools/framework/session.test.js +291 -0
- package/dist/tools/framework/session.test.js.map +1 -0
- package/dist/tools/framework/sync-evaluator.d.ts +41 -0
- package/dist/tools/framework/sync-evaluator.d.ts.map +1 -0
- package/dist/tools/framework/sync-evaluator.js +298 -0
- package/dist/tools/framework/sync-evaluator.js.map +1 -0
- package/dist/tools/framework/sync-evaluator.test.d.ts +5 -0
- package/dist/tools/framework/sync-evaluator.test.d.ts.map +1 -0
- package/dist/tools/framework/sync-evaluator.test.js +288 -0
- package/dist/tools/framework/sync-evaluator.test.js.map +1 -0
- package/dist/tools/framework/types.d.ts +279 -0
- package/dist/tools/framework/types.d.ts.map +1 -0
- package/dist/tools/framework/types.js +6 -0
- package/dist/tools/framework/types.js.map +1 -0
- package/dist/tools/framework/workflow-intelligence.d.ts +55 -0
- package/dist/tools/framework/workflow-intelligence.d.ts.map +1 -0
- package/dist/tools/framework/workflow-intelligence.js +199 -0
- package/dist/tools/framework/workflow-intelligence.js.map +1 -0
- package/dist/tools/framework/workflow-intelligence.test.d.ts +6 -0
- package/dist/tools/framework/workflow-intelligence.test.d.ts.map +1 -0
- package/dist/tools/framework/workflow-intelligence.test.js +257 -0
- package/dist/tools/framework/workflow-intelligence.test.js.map +1 -0
- package/dist/tools/framework/workflow-planner.d.ts +10 -0
- package/dist/tools/framework/workflow-planner.d.ts.map +1 -0
- package/dist/tools/framework/workflow-planner.js +214 -0
- package/dist/tools/framework/workflow-planner.js.map +1 -0
- package/dist/tools/framework/workflow-planner.test.d.ts +5 -0
- package/dist/tools/framework/workflow-planner.test.d.ts.map +1 -0
- package/dist/tools/framework/workflow-planner.test.js +137 -0
- package/dist/tools/framework/workflow-planner.test.js.map +1 -0
- package/dist/tools/knowledge/bridge.d.ts +34 -0
- package/dist/tools/knowledge/bridge.d.ts.map +1 -0
- package/dist/tools/knowledge/bridge.js +249 -0
- package/dist/tools/knowledge/bridge.js.map +1 -0
- package/dist/tools/knowledge/bridge.test.d.ts +5 -0
- package/dist/tools/knowledge/bridge.test.d.ts.map +1 -0
- package/dist/tools/knowledge/bridge.test.js +221 -0
- package/dist/tools/knowledge/bridge.test.js.map +1 -0
- package/dist/tools/knowledge/extractor.d.ts +22 -0
- package/dist/tools/knowledge/extractor.d.ts.map +1 -0
- package/dist/tools/knowledge/extractor.js +154 -0
- package/dist/tools/knowledge/extractor.js.map +1 -0
- package/dist/tools/knowledge/index.d.ts +12 -0
- package/dist/tools/knowledge/index.d.ts.map +1 -0
- package/dist/tools/knowledge/index.js +505 -0
- package/dist/tools/knowledge/index.js.map +1 -0
- package/dist/tools/knowledge/retrieval.d.ts +28 -0
- package/dist/tools/knowledge/retrieval.d.ts.map +1 -0
- package/dist/tools/knowledge/retrieval.js +164 -0
- package/dist/tools/knowledge/retrieval.js.map +1 -0
- package/dist/tools/knowledge/store.d.ts +96 -0
- package/dist/tools/knowledge/store.d.ts.map +1 -0
- package/dist/tools/knowledge/store.js +562 -0
- package/dist/tools/knowledge/store.js.map +1 -0
- package/dist/tools/knowledge/store.test.d.ts +6 -0
- package/dist/tools/knowledge/store.test.d.ts.map +1 -0
- package/dist/tools/knowledge/store.test.js +385 -0
- package/dist/tools/knowledge/store.test.js.map +1 -0
- package/dist/tools/knowledge/types.d.ts +168 -0
- package/dist/tools/knowledge/types.d.ts.map +1 -0
- package/dist/tools/knowledge/types.js +6 -0
- package/dist/tools/knowledge/types.js.map +1 -0
- package/dist/tools/memory/evolution.d.ts +31 -0
- package/dist/tools/memory/evolution.d.ts.map +1 -0
- package/dist/tools/memory/evolution.js +130 -0
- package/dist/tools/memory/evolution.js.map +1 -0
- package/dist/tools/memory/index.d.ts +11 -0
- package/dist/tools/memory/index.d.ts.map +1 -0
- package/dist/tools/memory/index.js +239 -0
- package/dist/tools/memory/index.js.map +1 -0
- package/dist/tools/memory/store.d.ts +75 -0
- package/dist/tools/memory/store.d.ts.map +1 -0
- package/dist/tools/memory/store.js +398 -0
- package/dist/tools/memory/store.js.map +1 -0
- package/dist/tools/memory/store.test.d.ts +6 -0
- package/dist/tools/memory/store.test.d.ts.map +1 -0
- package/dist/tools/memory/store.test.js +429 -0
- package/dist/tools/memory/store.test.js.map +1 -0
- package/dist/tools/memory/types.d.ts +171 -0
- package/dist/tools/memory/types.d.ts.map +1 -0
- package/dist/tools/memory/types.js +6 -0
- package/dist/tools/memory/types.js.map +1 -0
- package/dist/tools/pipeline/composer.d.ts +29 -0
- package/dist/tools/pipeline/composer.d.ts.map +1 -0
- package/dist/tools/pipeline/composer.js +225 -0
- package/dist/tools/pipeline/composer.js.map +1 -0
- package/dist/tools/pipeline/composer.test.d.ts +2 -0
- package/dist/tools/pipeline/composer.test.d.ts.map +1 -0
- package/dist/tools/pipeline/composer.test.js +162 -0
- package/dist/tools/pipeline/composer.test.js.map +1 -0
- package/dist/tools/pipeline/index.d.ts +8 -0
- package/dist/tools/pipeline/index.d.ts.map +1 -0
- package/dist/tools/pipeline/index.js +102 -0
- package/dist/tools/pipeline/index.js.map +1 -0
- package/dist/tools/pipeline/planner.d.ts +10 -0
- package/dist/tools/pipeline/planner.d.ts.map +1 -0
- package/dist/tools/pipeline/planner.js +147 -0
- package/dist/tools/pipeline/planner.js.map +1 -0
- package/dist/tools/pipeline/planner.test.d.ts +2 -0
- package/dist/tools/pipeline/planner.test.d.ts.map +1 -0
- package/dist/tools/pipeline/planner.test.js +96 -0
- package/dist/tools/pipeline/planner.test.js.map +1 -0
- package/dist/tools/pipeline/preconditions.d.ts +14 -0
- package/dist/tools/pipeline/preconditions.d.ts.map +1 -0
- package/dist/tools/pipeline/preconditions.js +65 -0
- package/dist/tools/pipeline/preconditions.js.map +1 -0
- package/dist/tools/pipeline/preconditions.test.d.ts +2 -0
- package/dist/tools/pipeline/preconditions.test.d.ts.map +1 -0
- package/dist/tools/pipeline/preconditions.test.js +74 -0
- package/dist/tools/pipeline/preconditions.test.js.map +1 -0
- package/dist/tools/pipeline/types.d.ts +105 -0
- package/dist/tools/pipeline/types.d.ts.map +1 -0
- package/dist/tools/pipeline/types.js +6 -0
- package/dist/tools/pipeline/types.js.map +1 -0
- package/dist/tools/repair/index.d.ts +8 -0
- package/dist/tools/repair/index.d.ts.map +1 -0
- package/dist/tools/repair/index.js +384 -0
- package/dist/tools/repair/index.js.map +1 -0
- package/dist/tools/repair/repairer.d.ts +67 -0
- package/dist/tools/repair/repairer.d.ts.map +1 -0
- package/dist/tools/repair/repairer.js +257 -0
- package/dist/tools/repair/repairer.js.map +1 -0
- package/dist/tools/repair/repairer.test.d.ts +6 -0
- package/dist/tools/repair/repairer.test.d.ts.map +1 -0
- package/dist/tools/repair/repairer.test.js +159 -0
- package/dist/tools/repair/repairer.test.js.map +1 -0
- package/dist/tools/semantic/chunker.d.ts +23 -0
- package/dist/tools/semantic/chunker.d.ts.map +1 -0
- package/dist/tools/semantic/chunker.js +244 -0
- package/dist/tools/semantic/chunker.js.map +1 -0
- package/dist/tools/semantic/embedder.d.ts +16 -0
- package/dist/tools/semantic/embedder.d.ts.map +1 -0
- package/dist/tools/semantic/embedder.js +88 -0
- package/dist/tools/semantic/embedder.js.map +1 -0
- package/dist/tools/semantic/index.d.ts +8 -0
- package/dist/tools/semantic/index.d.ts.map +1 -0
- package/dist/tools/semantic/index.js +144 -0
- package/dist/tools/semantic/index.js.map +1 -0
- package/dist/tools/semantic/store.d.ts +31 -0
- package/dist/tools/semantic/store.d.ts.map +1 -0
- package/dist/tools/semantic/store.js +168 -0
- package/dist/tools/semantic/store.js.map +1 -0
- package/dist/tools/semantic/store.test.d.ts +6 -0
- package/dist/tools/semantic/store.test.d.ts.map +1 -0
- package/dist/tools/semantic/store.test.js +240 -0
- package/dist/tools/semantic/store.test.js.map +1 -0
- package/dist/tools/spec/generator.d.ts +32 -0
- package/dist/tools/spec/generator.d.ts.map +1 -0
- package/dist/tools/spec/generator.js +278 -0
- package/dist/tools/spec/generator.js.map +1 -0
- package/dist/tools/spec/generator.test.d.ts +6 -0
- package/dist/tools/spec/generator.test.d.ts.map +1 -0
- package/dist/tools/spec/generator.test.js +208 -0
- package/dist/tools/spec/generator.test.js.map +1 -0
- package/dist/tools/spec/index.d.ts +11 -0
- package/dist/tools/spec/index.d.ts.map +1 -0
- package/dist/tools/spec/index.js +426 -0
- package/dist/tools/spec/index.js.map +1 -0
- package/dist/tools/spec/store.d.ts +24 -0
- package/dist/tools/spec/store.d.ts.map +1 -0
- package/dist/tools/spec/store.js +104 -0
- package/dist/tools/spec/store.js.map +1 -0
- package/dist/tools/spec/store.test.d.ts +6 -0
- package/dist/tools/spec/store.test.d.ts.map +1 -0
- package/dist/tools/spec/store.test.js +173 -0
- package/dist/tools/spec/store.test.js.map +1 -0
- package/dist/tools/spec/types.d.ts +61 -0
- package/dist/tools/spec/types.d.ts.map +1 -0
- package/dist/tools/spec/types.js +6 -0
- package/dist/tools/spec/types.js.map +1 -0
- package/dist/tools/state/index.d.ts +11 -0
- package/dist/tools/state/index.d.ts.map +1 -0
- package/dist/tools/state/index.js +386 -0
- package/dist/tools/state/index.js.map +1 -0
- package/dist/tools/state/migrate.d.ts +39 -0
- package/dist/tools/state/migrate.d.ts.map +1 -0
- package/dist/tools/state/migrate.js +242 -0
- package/dist/tools/state/migrate.js.map +1 -0
- package/dist/tools/state/migrate.test.d.ts +2 -0
- package/dist/tools/state/migrate.test.d.ts.map +1 -0
- package/dist/tools/state/migrate.test.js +265 -0
- package/dist/tools/state/migrate.test.js.map +1 -0
- package/dist/tools/state/store.d.ts +107 -0
- package/dist/tools/state/store.d.ts.map +1 -0
- package/dist/tools/state/store.js +365 -0
- package/dist/tools/state/store.js.map +1 -0
- package/dist/tools/state/store.test.d.ts +5 -0
- package/dist/tools/state/store.test.d.ts.map +1 -0
- package/dist/tools/state/store.test.js +293 -0
- package/dist/tools/state/store.test.js.map +1 -0
- package/dist/tools/state/types.d.ts +90 -0
- package/dist/tools/state/types.d.ts.map +1 -0
- package/dist/tools/state/types.js +6 -0
- package/dist/tools/state/types.js.map +1 -0
- package/dist/tools/testing/analyzer.d.ts +44 -0
- package/dist/tools/testing/analyzer.d.ts.map +1 -0
- package/dist/tools/testing/analyzer.js +280 -0
- package/dist/tools/testing/analyzer.js.map +1 -0
- package/dist/tools/testing/generator.d.ts +57 -0
- package/dist/tools/testing/generator.d.ts.map +1 -0
- package/dist/tools/testing/generator.js +478 -0
- package/dist/tools/testing/generator.js.map +1 -0
- package/dist/tools/testing/generator.test.d.ts +6 -0
- package/dist/tools/testing/generator.test.d.ts.map +1 -0
- package/dist/tools/testing/generator.test.js +285 -0
- package/dist/tools/testing/generator.test.js.map +1 -0
- package/dist/tools/testing/index.d.ts +8 -0
- package/dist/tools/testing/index.d.ts.map +1 -0
- package/dist/tools/testing/index.js +373 -0
- package/dist/tools/testing/index.js.map +1 -0
- package/dist/utils/embedder.d.ts +7 -0
- package/dist/utils/embedder.d.ts.map +1 -0
- package/dist/utils/embedder.js +13 -0
- package/dist/utils/embedder.js.map +1 -0
- package/dist/utils/execution.d.ts +68 -0
- package/dist/utils/execution.d.ts.map +1 -0
- package/dist/utils/execution.js +467 -0
- package/dist/utils/execution.js.map +1 -0
- package/dist/utils/graph.d.ts +26 -0
- package/dist/utils/graph.d.ts.map +1 -0
- package/dist/utils/graph.js +32 -0
- package/dist/utils/graph.js.map +1 -0
- package/dist/utils/guards.d.ts +32 -0
- package/dist/utils/guards.d.ts.map +1 -0
- package/dist/utils/guards.js +40 -0
- package/dist/utils/guards.js.map +1 -0
- package/dist/utils/ids.d.ts +5 -0
- package/dist/utils/ids.d.ts.map +1 -0
- package/dist/utils/ids.js +7 -0
- package/dist/utils/ids.js.map +1 -0
- package/dist/utils/languages.d.ts +34 -0
- package/dist/utils/languages.d.ts.map +1 -0
- package/dist/utils/languages.js +153 -0
- package/dist/utils/languages.js.map +1 -0
- package/dist/utils/lazy.d.ts +17 -0
- package/dist/utils/lazy.d.ts.map +1 -0
- package/dist/utils/lazy.js +35 -0
- package/dist/utils/lazy.js.map +1 -0
- package/dist/utils/project.d.ts +41 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +82 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/responses.d.ts +27 -0
- package/dist/utils/responses.d.ts.map +1 -0
- package/dist/utils/responses.js +72 -0
- package/dist/utils/responses.js.map +1 -0
- package/dist/utils/vectors.d.ts +33 -0
- package/dist/utils/vectors.d.ts.map +1 -0
- package/dist/utils/vectors.js +80 -0
- package/dist/utils/vectors.js.map +1 -0
- package/dist/utils/vectors.test.d.ts +6 -0
- package/dist/utils/vectors.test.d.ts.map +1 -0
- package/dist/utils/vectors.test.js +96 -0
- package/dist/utils/vectors.test.js.map +1 -0
- package/package.json +69 -0
- package/scripts/init.js +142 -0
- package/templates/CLAUDE.md.template +96 -0
- package/templates/agents/architecture-concept.md +237 -0
- package/templates/agents/checkpoint-concept.md +218 -0
- package/templates/agents/code-analysis-concept.md +171 -0
- package/templates/agents/compete-control.md +44 -0
- package/templates/agents/compete-evaluator.md +87 -0
- package/templates/agents/compete-treatment.md +55 -0
- package/templates/agents/context-concept.md +254 -0
- package/templates/agents/debate-advocate.md +127 -0
- package/templates/agents/debate-critic.md +119 -0
- package/templates/agents/debate-synthesis.md +160 -0
- package/templates/agents/documentation-concept.md +294 -0
- package/templates/agents/implementation-concept.md +165 -0
- package/templates/agents/quality-concept.md +299 -0
- package/templates/agents/research-concept.md +169 -0
- package/templates/agents/security-concept.md +255 -0
- package/templates/agents/story-concept.md +207 -0
- package/templates/agents/verification-concept.md +456 -0
- package/templates/agents/version-concept.md +163 -0
- package/templates/anchors/directory.anchor.yaml.template +53 -0
- package/templates/anchors/rules.anchor.yaml.template +70 -0
- package/templates/anchors/safety.anchor.yaml.template +96 -0
- package/templates/claude-md-managed.template +105 -0
- package/templates/commands/cache.md.template +439 -0
- package/templates/commands/checkpoint.md.template +121 -0
- package/templates/commands/classify.md.template +138 -0
- package/templates/commands/compete.md.template +90 -0
- package/templates/commands/costs.md.template +111 -0
- package/templates/commands/estimate.md.template +196 -0
- package/templates/commands/explore.md.template +186 -0
- package/templates/commands/feature.md.template +216 -0
- package/templates/commands/forget.md.template +104 -0
- package/templates/commands/global-recall.md.template +250 -0
- package/templates/commands/global-remember.md.template +187 -0
- package/templates/commands/health.md.template +107 -0
- package/templates/commands/help.md.template +253 -0
- package/templates/commands/observe.md.template +211 -0
- package/templates/commands/pr-review.md.template +164 -0
- package/templates/commands/predict-cost.md.template +251 -0
- package/templates/commands/profile.md.template +142 -0
- package/templates/commands/reasoning.md.template +228 -0
- package/templates/commands/recall.md.template +197 -0
- package/templates/commands/remember.md.template +148 -0
- package/templates/commands/replay.md.template +449 -0
- package/templates/commands/restore.md.template +87 -0
- package/templates/commands/retrospective.md.template +47 -0
- package/templates/commands/slo.md.template +286 -0
- package/templates/commands/spec.md.template +164 -0
- package/templates/commands/status.md.template +53 -0
- package/templates/commands/sync.md.template +321 -0
- package/templates/commands/task.md.template +86 -0
- package/templates/commands/trace.md.template +86 -0
- package/templates/commands/visualize.md.template +216 -0
- package/templates/commands/workflow.md.template +375 -0
- package/templates/concepts/README.md +329 -0
- package/templates/concepts/architecture.md.template +74 -0
- package/templates/concepts/code-analysis.md.template +186 -0
- package/templates/concepts/context-compactor.md.template +393 -0
- package/templates/concepts/context.md.template +62 -0
- package/templates/concepts/documentation.md.template +452 -0
- package/templates/concepts/estimator.md.template +214 -0
- package/templates/concepts/exploration.md.template +257 -0
- package/templates/concepts/global-memory.md.template +222 -0
- package/templates/concepts/implementation.md.template +62 -0
- package/templates/concepts/pr-review.md.template +277 -0
- package/templates/concepts/project-profile.md.template +358 -0
- package/templates/concepts/quality.md.template +63 -0
- package/templates/concepts/react-fallback.md.template +286 -0
- package/templates/concepts/research.md.template +221 -0
- package/templates/concepts/retrospective.md.template +93 -0
- package/templates/concepts/security.md.template +442 -0
- package/templates/concepts/slo.md.template +274 -0
- package/templates/concepts/spec.md.template +71 -0
- package/templates/concepts/story.md.template +50 -0
- package/templates/concepts/tool-router.md.template +289 -0
- package/templates/concepts/verification-synthesizer.md.template +279 -0
- package/templates/concepts/version.md.template +61 -0
- package/templates/config.yaml.template +347 -0
- package/templates/examples/README.md +77 -0
- package/templates/examples/architecture/api-design.yaml.template +286 -0
- package/templates/examples/architecture/oauth-authentication.yaml.template +305 -0
- package/templates/health/status.yaml.template +120 -0
- package/templates/hooks/concept-complete.sh.template +45 -0
- package/templates/hooks/lib/common.sh.template +160 -0
- package/templates/hooks/post-commit.sh.template +37 -0
- package/templates/hooks/post-concept-action.template +39 -0
- package/templates/hooks/post-tool-structure-check.sh.template +138 -0
- package/templates/hooks/post-tool-use.sh.template +51 -0
- package/templates/hooks/pre-compact.sh.template +48 -0
- package/templates/hooks/pre-tool-grounding.template +148 -0
- package/templates/hooks/session-exit-checkpoint.sh.template +35 -0
- package/templates/hooks/session-start.sh.template +67 -0
- package/templates/hooks/statusline.sh.template +148 -0
- package/templates/hooks/stop.sh.template +45 -0
- package/templates/hooks/subagent-stop.sh.template +40 -0
- package/templates/hooks/sync-blocked.sh.template +45 -0
- package/templates/hooks/timeout.sh.template +48 -0
- package/templates/hooks/user-prompt-submit.sh.template +68 -0
- package/templates/koan/README.md +58 -0
- package/templates/memory/index.yaml.template +48 -0
- package/templates/memory/procedural/debugging.yaml.template +24 -0
- package/templates/memory/procedural/workflows.yaml.template +22 -0
- package/templates/memory/semantic/architecture.yaml.template +21 -0
- package/templates/memory/semantic/conventions.yaml.template +18 -0
- package/templates/memory/semantic/patterns.yaml.template +21 -0
- package/templates/memory/semantic/preferences.yaml.template +18 -0
- package/templates/prompts/architecture.yaml.template +349 -0
- package/templates/prompts/context.yaml.template +384 -0
- package/templates/prompts/implementation.yaml.template +365 -0
- package/templates/prompts/planning.yaml.template +303 -0
- package/templates/prompts/quality.yaml.template +345 -0
- package/templates/prompts/retrospective.yaml.template +231 -0
- package/templates/prompts/slo.yaml.template +360 -0
- package/templates/prompts/story.yaml.template +236 -0
- package/templates/prompts/tree-of-thoughts.yaml.template +299 -0
- package/templates/prompts/verification.yaml.template +286 -0
- package/templates/prompts/version.yaml.template +279 -0
- package/templates/schemas/agent-schema.json +98 -0
- package/templates/schemas/architecture.schema.json +69 -0
- package/templates/schemas/config-schema.json +165 -0
- package/templates/schemas/implementation.schema.json +75 -0
- package/templates/schemas/planning.schema.json +243 -0
- package/templates/schemas/provenance.schema.json +111 -0
- package/templates/schemas/retrospective.schema.json +174 -0
- package/templates/schemas/review.schema.json +284 -0
- package/templates/schemas/slo.schema.json +443 -0
- package/templates/schemas/story.schema.json +68 -0
- package/templates/schemas/sync-schema.json +196 -0
- package/templates/schemas/task.schema.json +127 -0
- package/templates/schemas/tree-of-thoughts.schema.json +175 -0
- package/templates/schemas/verification.schema.json +106 -0
- package/templates/settings.full.json.template +135 -0
- package/templates/settings.minimal.json.template +68 -0
- package/templates/settings.standard.json.template +135 -0
- package/templates/skills/acceptance-criteria-generation.md.template +330 -0
- package/templates/skills/accessibility-checking.md.template +341 -0
- package/templates/skills/api-design-patterns.md.template +395 -0
- package/templates/skills/batch-processing.md.template +605 -0
- package/templates/skills/branch-strategy.md.template +362 -0
- package/templates/skills/changelog-generation.md.template +403 -0
- package/templates/skills/code-coverage-analysis.md.template +362 -0
- package/templates/skills/code-style-enforcement.md.template +294 -0
- package/templates/skills/code-template-patterns.md.template +419 -0
- package/templates/skills/concept-development.md.template +159 -0
- package/templates/skills/context-prioritization.md.template +306 -0
- package/templates/skills/cost-optimization.md.template +482 -0
- package/templates/skills/cross-project-knowledge.md.template +316 -0
- package/templates/skills/dependency-impact-analysis.md.template +263 -0
- package/templates/skills/documentation-generation.md.template +409 -0
- package/templates/skills/effort-estimation.md.template +350 -0
- package/templates/skills/error-classification.md.template +709 -0
- package/templates/skills/error-messages.md.template +339 -0
- package/templates/skills/ide-diagnostics.md.template +480 -0
- package/templates/skills/incremental-loading.md.template +574 -0
- package/templates/skills/output-caching.md.template +524 -0
- package/templates/skills/performance-estimation.md.template +325 -0
- package/templates/skills/performance-testing-patterns.md.template +341 -0
- package/templates/skills/phase2-optimizations-summary.md.template +458 -0
- package/templates/skills/progressive-disclosure-pattern.md.template +190 -0
- package/templates/skills/project-structure.md.template +372 -0
- package/templates/skills/provenance-analysis.md.template +609 -0
- package/templates/skills/react-executor.md.template +366 -0
- package/templates/skills/refactoring-patterns.md.template +422 -0
- package/templates/skills/release-management.md.template +373 -0
- package/templates/skills/requirement-prioritization.md.template +357 -0
- package/templates/skills/schema-validation.md.template +321 -0
- package/templates/skills/security-design-patterns.md.template +692 -0
- package/templates/skills/security-vulnerability-scanning.md.template +663 -0
- package/templates/skills/semantic-memory.md.template +266 -0
- package/templates/skills/semantic-versioning.md.template +371 -0
- package/templates/skills/smart-retry.md.template +676 -0
- package/templates/skills/smart-summarization.md.template +358 -0
- package/templates/skills/story-decomposition.md.template +278 -0
- package/templates/skills/synchronization-patterns.md.template +303 -0
- package/templates/skills/test-generation-strategy.md.template +247 -0
- package/templates/skills/workflow-replay.md.template +478 -0
- package/templates/skills/wysiwid-principles.md.template +364 -0
- package/templates/skills-manifest.yaml.template +526 -0
- package/templates/stubs/agents/architecture-concept.md +20 -0
- package/templates/stubs/agents/checkpoint-concept.md +19 -0
- package/templates/stubs/agents/code-analysis-concept.md +36 -0
- package/templates/stubs/agents/context-concept.md +37 -0
- package/templates/stubs/agents/debate-advocate.md +12 -0
- package/templates/stubs/agents/debate-critic.md +12 -0
- package/templates/stubs/agents/debate-synthesis.md +12 -0
- package/templates/stubs/agents/documentation-concept.md +39 -0
- package/templates/stubs/agents/implementation-concept.md +41 -0
- package/templates/stubs/agents/quality-concept.md +41 -0
- package/templates/stubs/agents/research-concept.md +35 -0
- package/templates/stubs/agents/security-concept.md +40 -0
- package/templates/stubs/agents/spec-concept.md +35 -0
- package/templates/stubs/agents/story-concept.md +36 -0
- package/templates/stubs/agents/verification-concept.md +39 -0
- package/templates/stubs/agents/version-concept.md +37 -0
- package/templates/stubs/commands/cache.md.template +2 -0
- package/templates/stubs/commands/checkpoint.md.template +2 -0
- package/templates/stubs/commands/classify.md.template +2 -0
- package/templates/stubs/commands/compete.md.template +2 -0
- package/templates/stubs/commands/costs.md.template +2 -0
- package/templates/stubs/commands/estimate.md.template +2 -0
- package/templates/stubs/commands/explore.md.template +2 -0
- package/templates/stubs/commands/feature.md.template +2 -0
- package/templates/stubs/commands/forget.md.template +2 -0
- package/templates/stubs/commands/global-recall.md.template +2 -0
- package/templates/stubs/commands/global-remember.md.template +2 -0
- package/templates/stubs/commands/health.md.template +2 -0
- package/templates/stubs/commands/help.md.template +2 -0
- package/templates/stubs/commands/observe.md.template +2 -0
- package/templates/stubs/commands/pr-review.md.template +2 -0
- package/templates/stubs/commands/predict-cost.md.template +2 -0
- package/templates/stubs/commands/profile.md.template +2 -0
- package/templates/stubs/commands/reasoning.md.template +2 -0
- package/templates/stubs/commands/recall.md.template +2 -0
- package/templates/stubs/commands/remember.md.template +2 -0
- package/templates/stubs/commands/replay.md.template +2 -0
- package/templates/stubs/commands/restore.md.template +2 -0
- package/templates/stubs/commands/retrospective.md.template +2 -0
- package/templates/stubs/commands/slo.md.template +2 -0
- package/templates/stubs/commands/spec.md.template +2 -0
- package/templates/stubs/commands/sync.md.template +2 -0
- package/templates/stubs/commands/task.md.template +2 -0
- package/templates/stubs/commands/trace.md.template +2 -0
- package/templates/stubs/commands/visualize.md.template +2 -0
- package/templates/stubs/commands/workflow.md.template +2 -0
- package/templates/synchronizations/archive/adaptive-learning.yaml.template +595 -0
- package/templates/synchronizations/archive/code-understanding-flow.yaml.template +533 -0
- package/templates/synchronizations/archive/collaboration-flow.yaml.template +521 -0
- package/templates/synchronizations/archive/context-folding.yaml.template +353 -0
- package/templates/synchronizations/archive/dead-letter-queue.yaml.template +530 -0
- package/templates/synchronizations/archive/documentation-flow.yaml.template +560 -0
- package/templates/synchronizations/archive/error-recovery-flow.yaml.template +1031 -0
- package/templates/synchronizations/archive/execution-loop.yaml.template +336 -0
- package/templates/synchronizations/archive/exploration-flow.yaml.template +369 -0
- package/templates/synchronizations/archive/feature-development.yaml.template +2145 -0
- package/templates/synchronizations/archive/learning-loop.yaml.template +657 -0
- package/templates/synchronizations/archive/multi-verify.yaml.template +346 -0
- package/templates/synchronizations/archive/planning-flow.yaml.template +312 -0
- package/templates/synchronizations/archive/retrospective-flow.yaml.template +277 -0
- package/templates/synchronizations/archive/security-flow.yaml.template +477 -0
- package/templates/synchronizations/archive/slo-monitoring.yaml.template +209 -0
- package/templates/synchronizations/archive/task-routing.yaml.template +489 -0
- package/templates/synchronizations/archive/test-driven.yaml.template +291 -0
- package/templates/synchronizations/archive/tool-routing.yaml.template +326 -0
- package/templates/synchronizations/archive/verification-flow.yaml.template +407 -0
- package/templates/synchronizations/error-policy.yaml.template +188 -0
- package/templates/synchronizations/main.sync.template +319 -0
- package/templates/synchronizations/slo-registry.yaml.template +229 -0
- package/templates/tasks/task.yaml.template +67 -0
- package/templates/zen-profile.yaml.template +14 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Run a competitive evaluation comparing Zen-assisted vs vanilla Claude Code generation.
|
|
2
|
+
|
|
3
|
+
When the user runs this command, you should:
|
|
4
|
+
|
|
5
|
+
1. **Resolve the spec**
|
|
6
|
+
- If the user provides a spec ID directly, use it
|
|
7
|
+
- If they provide a spec name, use `zen_spec_get` with `name` to find the ID
|
|
8
|
+
- If no argument, use `zen_spec_get` with `latest: true`
|
|
9
|
+
|
|
10
|
+
2. **Start the competition**
|
|
11
|
+
- Call `compete_start` with the spec_id
|
|
12
|
+
- Display the session ID and configuration
|
|
13
|
+
- Show the evaluation dimensions and weights
|
|
14
|
+
|
|
15
|
+
3. **Run rounds in parallel**
|
|
16
|
+
For each round (1 to N):
|
|
17
|
+
- Launch a **control arm** subagent (worktree, model: sonnet) with the control_prompt
|
|
18
|
+
- The control agent generates code from the spec with NO MCP tools
|
|
19
|
+
- Launch a **treatment arm** subagent (worktree, model: sonnet) with the treatment_prompt
|
|
20
|
+
- The treatment agent uses full zen MCP tools
|
|
21
|
+
- Both run in parallel via Task tool with `isolation: "worktree"`
|
|
22
|
+
|
|
23
|
+
4. **Evaluate each arm**
|
|
24
|
+
After both arms complete for a round:
|
|
25
|
+
- Use the evaluation_instructions to score each output
|
|
26
|
+
- Call `compete_submit` for each arm with the 6-dimension scores
|
|
27
|
+
- Display round results as they complete
|
|
28
|
+
|
|
29
|
+
5. **Report results**
|
|
30
|
+
- After all rounds, display the CompeteSummary:
|
|
31
|
+
- Overall winner
|
|
32
|
+
- Per-dimension p-values and effect sizes
|
|
33
|
+
- Composite statistics
|
|
34
|
+
- If treatment wins, offer to run ablation testing
|
|
35
|
+
|
|
36
|
+
6. **Optional: Ablation testing**
|
|
37
|
+
If the user agrees to ablation:
|
|
38
|
+
- Call `compete_ablate_start` to get per-category prompts
|
|
39
|
+
- For each category × rounds, launch subagents with ablation prompts
|
|
40
|
+
- Call `compete_ablate_submit` for each run
|
|
41
|
+
- Display the minimal effective toolset
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
/compete <spec-id> # Run with specific spec
|
|
47
|
+
/compete string-utils # Run with spec by name
|
|
48
|
+
/compete # Run with latest spec
|
|
49
|
+
/compete <spec-id> --rounds 10 # Override round count
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## What It Measures
|
|
53
|
+
|
|
54
|
+
| Dimension | Weight | Go Command |
|
|
55
|
+
|-----------|--------|------------|
|
|
56
|
+
| correctness | 0.30 | `go test -race -count=1 ./...` |
|
|
57
|
+
| contracts | 0.20 | `go test -run TestProperty ./...` |
|
|
58
|
+
| security | 0.20 | `gosec ./...` |
|
|
59
|
+
| performance | 0.10 | `go test -bench=. -benchmem ./...` |
|
|
60
|
+
| complexity | 0.10 | `gocyclo -avg .` |
|
|
61
|
+
| lint | 0.10 | `go vet ./... && staticcheck ./...` |
|
|
62
|
+
|
|
63
|
+
## Statistical Methods
|
|
64
|
+
|
|
65
|
+
- **Welch's t-test**: Unequal variance comparison between arms
|
|
66
|
+
- **Cohen's d**: Effect size measurement (small=0.2, medium=0.5, large=0.8)
|
|
67
|
+
- **Significance level**: Default α=0.05 (configurable)
|
|
68
|
+
|
|
69
|
+
## Example Output
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Competition Complete: 5 rounds
|
|
73
|
+
|
|
74
|
+
Overall Winner: treatment (p=0.003, d=1.42)
|
|
75
|
+
|
|
76
|
+
Dimension Analysis:
|
|
77
|
+
correctness: treatment wins (p=0.01, d=1.1)
|
|
78
|
+
contracts: treatment wins (p=0.02, d=0.9)
|
|
79
|
+
security: inconclusive (p=0.15, d=0.4)
|
|
80
|
+
performance: inconclusive (p=0.08, d=0.5)
|
|
81
|
+
complexity: treatment wins (p=0.04, d=0.8)
|
|
82
|
+
lint: inconclusive (p=0.22, d=0.3)
|
|
83
|
+
|
|
84
|
+
Run ablation testing? (y/n)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Related Commands
|
|
88
|
+
|
|
89
|
+
- `/spec` - Define specifications for evaluation
|
|
90
|
+
- `/feature` - Start a new feature workflow
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Show cost analysis for AI model usage across flows and concepts.
|
|
2
|
+
|
|
3
|
+
When the user runs this command, you should:
|
|
4
|
+
|
|
5
|
+
1. Aggregate provenance data from koan/provenance/
|
|
6
|
+
2. Calculate costs by concept, model, and time period
|
|
7
|
+
3. Show cost efficiency metrics and trends
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
- `/costs` - Show all-time costs
|
|
11
|
+
- `/costs --last-week` - Show last 7 days
|
|
12
|
+
- `/costs --by-concept` - Break down by concept
|
|
13
|
+
- `/costs --by-flow` - Break down by flow
|
|
14
|
+
|
|
15
|
+
Process:
|
|
16
|
+
1. Read all provenance files from koan/provenance/actions/
|
|
17
|
+
2. Aggregate cost data
|
|
18
|
+
3. Calculate metrics
|
|
19
|
+
4. Present insights
|
|
20
|
+
|
|
21
|
+
Example output:
|
|
22
|
+
```
|
|
23
|
+
Zen Cost Analysis
|
|
24
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
25
|
+
|
|
26
|
+
Period: All time
|
|
27
|
+
Total flows: 15
|
|
28
|
+
Total actions: 87
|
|
29
|
+
Total cost: $0.2475
|
|
30
|
+
|
|
31
|
+
By Concept:
|
|
32
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
33
|
+
|
|
34
|
+
story (sonnet) 15 actions $0.045 (5%)
|
|
35
|
+
code-analysis (sonnet) 15 actions $0.045 (5%)
|
|
36
|
+
architecture (opus) 15 actions $0.225 (25%) ⭐
|
|
37
|
+
verification (sonnet) 15 actions $0.045 (5%)
|
|
38
|
+
implementation (sonnet) 15 actions $0.045 (5%)
|
|
39
|
+
quality (sonnet) 30 actions $0.090 (10%)
|
|
40
|
+
security (sonnet) 15 actions $0.045 (5%)
|
|
41
|
+
version (sonnet) 15 actions $0.045 (5%)
|
|
42
|
+
context (sonnet) 5 actions $0.015 (2%)
|
|
43
|
+
documentation (sonnet) 15 actions $0.045 (5%)
|
|
44
|
+
|
|
45
|
+
By Model:
|
|
46
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
+
|
|
48
|
+
Opus: 15 actions $0.225 (25%)
|
|
49
|
+
Sonnet: 140 actions $0.420 (75%)
|
|
50
|
+
|
|
51
|
+
Cost Efficiency:
|
|
52
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
|
|
54
|
+
Smart model assignment savings:
|
|
55
|
+
- Actual cost: $0.2475
|
|
56
|
+
- All-sonnet cost: $1.4850
|
|
57
|
+
- Savings: $1.2375 (83%)
|
|
58
|
+
|
|
59
|
+
Average cost per feature:
|
|
60
|
+
- With smart assignment: $0.0165
|
|
61
|
+
- With all-sonnet: $0.0990
|
|
62
|
+
- Savings per feature: $0.0825
|
|
63
|
+
|
|
64
|
+
Cost breakdown per feature:
|
|
65
|
+
┌─────────────────┬────────┬──────────┬──────────┐
|
|
66
|
+
│ Concept │ Model │ Cost │ % Total │
|
|
67
|
+
├─────────────────┼────────┼──────────┼──────────┤
|
|
68
|
+
│ Story │ Sonnet │ $0.003 │ 5% │
|
|
69
|
+
│ Code-Analysis │ Sonnet │ $0.003 │ 5% │
|
|
70
|
+
│ Architecture │ Opus │ $0.015 │ 25% ⭐ │
|
|
71
|
+
│ Verification │ Sonnet │ $0.003 │ 5% │
|
|
72
|
+
│ Implementation │ Sonnet │ $0.003 │ 5% │
|
|
73
|
+
│ Quality (x2) │ Sonnet │ $0.006 │ 10% │
|
|
74
|
+
│ Security │ Sonnet │ $0.003 │ 5% │
|
|
75
|
+
│ Version │ Sonnet │ $0.003 │ 5% │
|
|
76
|
+
│ Context │ Sonnet │ $0.003 │ 5% │
|
|
77
|
+
│ Documentation │ Sonnet │ $0.003 │ 5% │
|
|
78
|
+
└─────────────────┴────────┴──────────┴──────────┘
|
|
79
|
+
|
|
80
|
+
Insights:
|
|
81
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
|
|
83
|
+
✓ Smart model assignment working as designed
|
|
84
|
+
✓ Architecture (Opus) accounts for 25% of cost
|
|
85
|
+
✓ This is expected - architecture requires deep reasoning
|
|
86
|
+
✓ Other 9 concepts efficiently use Sonnet (major cost savings)
|
|
87
|
+
|
|
88
|
+
Recent Trends (Last 7 Days):
|
|
89
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
90
|
+
|
|
91
|
+
Features completed: 3
|
|
92
|
+
Total cost: $0.0495
|
|
93
|
+
Average cost per feature: $0.0165
|
|
94
|
+
Model usage: 25% Opus, 75% Sonnet
|
|
95
|
+
Cost efficiency: Consistent 83% savings
|
|
96
|
+
|
|
97
|
+
Top Flows by Cost:
|
|
98
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
99
|
+
|
|
100
|
+
1. flow-001 "Add dark mode" - $0.0165
|
|
101
|
+
2. flow-002 "User auth" - $0.0185 (arch revision +$0.002)
|
|
102
|
+
3. flow-003 "API endpoints" - $0.0155
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Key Insights:
|
|
106
|
+
- Architecture is expensive but necessary (prevents costly rework)
|
|
107
|
+
- Sonnet is sufficient for 9/10 concepts (major cost savings)
|
|
108
|
+
- Consistent cost per feature enables budget forecasting
|
|
109
|
+
- Can identify outliers (e.g., flow-002 with arch revision)
|
|
110
|
+
|
|
111
|
+
This command helps validate the smart model assignment strategy and identify opportunities for optimization.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# /estimate Command
|
|
2
|
+
|
|
3
|
+
Get predictive estimates before executing a task.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/estimate "Add OAuth authentication"
|
|
9
|
+
/estimate --workflow refactor "Reorganize the auth module"
|
|
10
|
+
/estimate --compare est-20250106 # Compare prediction to actual
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
This command predicts outcomes BEFORE execution:
|
|
16
|
+
- Expected duration
|
|
17
|
+
- Expected cost
|
|
18
|
+
- Risk factors
|
|
19
|
+
- Optimization suggestions
|
|
20
|
+
- SLO pass/fail likelihood
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
When you run `/estimate "<task>"`:
|
|
25
|
+
|
|
26
|
+
1. **Load Historical Data**
|
|
27
|
+
```bash
|
|
28
|
+
cat koan/slo/metrics/*/*.yaml # Monthly performance data
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. **Classify Task**
|
|
32
|
+
- Use task-routing.yaml patterns
|
|
33
|
+
- Determine base complexity
|
|
34
|
+
|
|
35
|
+
3. **Analyze Complexity**
|
|
36
|
+
- Count acceptance criteria (from story)
|
|
37
|
+
- Check code analysis results (if available)
|
|
38
|
+
- Identify scope indicators
|
|
39
|
+
|
|
40
|
+
4. **Match Historical Tasks**
|
|
41
|
+
- Find similar past tasks by type + complexity
|
|
42
|
+
- Calculate statistical distributions
|
|
43
|
+
|
|
44
|
+
5. **Generate Predictions**
|
|
45
|
+
- Expected values (mean)
|
|
46
|
+
- P50 (median)
|
|
47
|
+
- P95 (worst case)
|
|
48
|
+
- Confidence level
|
|
49
|
+
|
|
50
|
+
6. **Assess SLO Risk**
|
|
51
|
+
- Compare predictions to SLO thresholds
|
|
52
|
+
- Flag potential violations
|
|
53
|
+
|
|
54
|
+
7. **Suggest Optimizations**
|
|
55
|
+
- Skills to enable
|
|
56
|
+
- Cached patterns to use
|
|
57
|
+
- Workflow adjustments
|
|
58
|
+
|
|
59
|
+
## Output Format
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
+
Predictive Estimate
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
|
|
66
|
+
Task: "Add OAuth authentication"
|
|
67
|
+
Type: NEW FEATURE (full-feature-flow)
|
|
68
|
+
|
|
69
|
+
┌─────────────────────────────────────────────────┐
|
|
70
|
+
│ Predictions │
|
|
71
|
+
├─────────────────────────────────────────────────┤
|
|
72
|
+
│ Duration: 15-25 min (expected: 18 min) │
|
|
73
|
+
│ Cost: $0.02-0.05 (expected: $0.03) │
|
|
74
|
+
│ Quality: 85% likely to pass review │
|
|
75
|
+
│ Context: ~8,500 tokens (15% overflow risk) │
|
|
76
|
+
│ │
|
|
77
|
+
│ Confidence: 75% (based on 12 similar tasks) │
|
|
78
|
+
└─────────────────────────────────────────────────┘
|
|
79
|
+
|
|
80
|
+
SLO Assessment:
|
|
81
|
+
Duration: ✅ LIKELY PASS (< 20 min SLO)
|
|
82
|
+
Cost: ⚠️ AT RISK ($0.03 approaches $0.05 budget)
|
|
83
|
+
Quality: ✅ LIKELY PASS (> 80% target)
|
|
84
|
+
|
|
85
|
+
Risk Factors:
|
|
86
|
+
• OAuth complexity varies by provider count
|
|
87
|
+
• No cached architecture pattern found
|
|
88
|
+
• First auth feature in this project
|
|
89
|
+
|
|
90
|
+
Recommendations:
|
|
91
|
+
1. Enable 'incremental-loading' skill
|
|
92
|
+
→ Expected 40% context reduction
|
|
93
|
+
|
|
94
|
+
2. Use oauth-authentication example
|
|
95
|
+
→ Path: .claude/examples/architecture/oauth-authentication.yaml
|
|
96
|
+
→ Expected 50% faster architecture phase
|
|
97
|
+
|
|
98
|
+
3. Consider breaking into phases:
|
|
99
|
+
→ Phase 1: Google OAuth only
|
|
100
|
+
→ Phase 2: Add GitHub provider
|
|
101
|
+
→ Reduces per-task complexity
|
|
102
|
+
|
|
103
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
104
|
+
|
|
105
|
+
Proceed? [y] Yes [o] Optimize first [n] Cancel
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Comparing Predictions
|
|
109
|
+
|
|
110
|
+
After a task completes, compare predictions to actuals:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
/estimate --compare est-20250106-143052
|
|
114
|
+
|
|
115
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
+
Prediction Accuracy Report
|
|
117
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
118
|
+
|
|
119
|
+
Estimate: est-20250106-143052
|
|
120
|
+
Task: "Add OAuth authentication"
|
|
121
|
+
|
|
122
|
+
Predicted Actual Accuracy
|
|
123
|
+
Duration: 18 min 22 min 82%
|
|
124
|
+
Cost: $0.03 $0.028 107%
|
|
125
|
+
Quality: 85% passed ✓
|
|
126
|
+
|
|
127
|
+
Analysis:
|
|
128
|
+
• Duration underestimated by 4 min
|
|
129
|
+
• Reason: Provider-specific error handling took longer
|
|
130
|
+
• Learning: Add +20% buffer for multi-provider OAuth
|
|
131
|
+
|
|
132
|
+
Updated Model:
|
|
133
|
+
• oauth-related tasks: duration_factor += 0.2
|
|
134
|
+
• Confidence for similar tasks: now 78%
|
|
135
|
+
|
|
136
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Historical Data Requirements
|
|
140
|
+
|
|
141
|
+
Estimates work best with historical data in:
|
|
142
|
+
```
|
|
143
|
+
koan/slo/metrics/
|
|
144
|
+
├── architecture/
|
|
145
|
+
│ └── 2025-01.yaml
|
|
146
|
+
├── implementation/
|
|
147
|
+
│ └── 2025-01.yaml
|
|
148
|
+
└── quality/
|
|
149
|
+
└── 2025-01.yaml
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Without historical data, estimates use:
|
|
153
|
+
- Task type base complexity
|
|
154
|
+
- Industry benchmarks
|
|
155
|
+
- Conservative confidence (50%)
|
|
156
|
+
|
|
157
|
+
## Complexity Indicators
|
|
158
|
+
|
|
159
|
+
| Indicator | Low | Medium | High |
|
|
160
|
+
|-----------|-----|--------|------|
|
|
161
|
+
| Acceptance criteria | 1-3 | 4-6 | 7+ |
|
|
162
|
+
| Affected files | 1-3 | 4-10 | 11+ |
|
|
163
|
+
| Call graph depth | 1-2 | 3-4 | 5+ |
|
|
164
|
+
| New vs existing | Existing | Mixed | All new |
|
|
165
|
+
|
|
166
|
+
## Integration with /workflow
|
|
167
|
+
|
|
168
|
+
Estimates can auto-run before workflows:
|
|
169
|
+
|
|
170
|
+
```yaml
|
|
171
|
+
# In config.yaml
|
|
172
|
+
workflow:
|
|
173
|
+
pre_flight_estimate: true # Auto-estimate before execution
|
|
174
|
+
estimate_approval_threshold: "at_risk" # Ask user if AT RISK
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
When enabled:
|
|
178
|
+
```
|
|
179
|
+
/workflow "Add OAuth"
|
|
180
|
+
|
|
181
|
+
Running pre-flight estimate...
|
|
182
|
+
|
|
183
|
+
⚠️ Cost prediction ($0.03) is AT RISK vs budget ($0.05)
|
|
184
|
+
|
|
185
|
+
Recommendations available. View estimate? [y/n]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## WYSIWID Principle
|
|
189
|
+
|
|
190
|
+
Estimates are fully transparent:
|
|
191
|
+
- All complexity factors shown
|
|
192
|
+
- Historical data sources cited
|
|
193
|
+
- Confidence levels explained
|
|
194
|
+
- Recommendations include reasoning
|
|
195
|
+
|
|
196
|
+
What you see in the estimate is exactly what informed the predictions.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explore
|
|
3
|
+
description: "Explore multiple solution approaches using Tree-of-Thoughts reasoning"
|
|
4
|
+
usage: "/explore <problem description>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Explore Command
|
|
8
|
+
|
|
9
|
+
Use Tree-of-Thoughts reasoning to explore multiple approaches to a complex problem before committing to a solution.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
/explore "Design a caching strategy for the API"
|
|
15
|
+
/explore "Refactor the user service for better testability"
|
|
16
|
+
/explore "Debug the intermittent authentication failures"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- Complex architectural decisions with multiple valid approaches
|
|
22
|
+
- Debugging problems where the root cause is unclear
|
|
23
|
+
- Refactoring with multiple strategies to consider
|
|
24
|
+
- Any decision where the stakes are high and reversal is costly
|
|
25
|
+
|
|
26
|
+
## Process
|
|
27
|
+
|
|
28
|
+
When you invoke `/explore`, the following happens:
|
|
29
|
+
|
|
30
|
+
### 1. Problem Analysis
|
|
31
|
+
|
|
32
|
+
The problem is decomposed into:
|
|
33
|
+
- Sub-goals that need to be achieved
|
|
34
|
+
- Constraints that must be satisfied
|
|
35
|
+
- Decision points where alternatives exist
|
|
36
|
+
|
|
37
|
+
### 2. Branch Generation
|
|
38
|
+
|
|
39
|
+
Multiple solution approaches are generated:
|
|
40
|
+
- Each branch is a coherent strategy
|
|
41
|
+
- Branches are meaningfully different (not minor variations)
|
|
42
|
+
- Typically 2-4 branches are explored
|
|
43
|
+
|
|
44
|
+
### 3. Evaluation
|
|
45
|
+
|
|
46
|
+
Each branch is scored on:
|
|
47
|
+
- **Feasibility** (1-10): Can we actually build this?
|
|
48
|
+
- **Maintainability** (1-10): Will it be easy to maintain?
|
|
49
|
+
- **Scalability** (1-10): Will it grow with our needs?
|
|
50
|
+
- **Security** (1-10): Are there security concerns?
|
|
51
|
+
- **Complexity** (1-10): How hard is implementation?
|
|
52
|
+
|
|
53
|
+
### 4. Selection
|
|
54
|
+
|
|
55
|
+
The highest-scoring path is selected:
|
|
56
|
+
- Clear winners (>1.5 point lead) are chosen confidently
|
|
57
|
+
- Close scores may trigger hybrid consideration
|
|
58
|
+
- Low confidence (<0.7) triggers deeper evaluation
|
|
59
|
+
|
|
60
|
+
### 5. Documentation
|
|
61
|
+
|
|
62
|
+
Results are stored in `koan/explorations/` for future reference.
|
|
63
|
+
|
|
64
|
+
## Output Format
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
Exploration: Design a caching strategy for the API
|
|
69
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
70
|
+
|
|
71
|
+
Problem Decomposition:
|
|
72
|
+
- Goal: Reduce API latency for frequent queries
|
|
73
|
+
- Constraints: Must invalidate on data changes
|
|
74
|
+
- Decision Points: Cache location, invalidation strategy
|
|
75
|
+
|
|
76
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
|
+
Branch 1: Redis with TTL
|
|
78
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
79
|
+
Score: 8.5/10
|
|
80
|
+
|
|
81
|
+
Steps:
|
|
82
|
+
1. Set up Redis cluster
|
|
83
|
+
2. Implement cache-aside pattern
|
|
84
|
+
3. TTL-based expiration
|
|
85
|
+
|
|
86
|
+
Pros:
|
|
87
|
+
✓ Proven technology
|
|
88
|
+
✓ Good performance
|
|
89
|
+
✓ Easy to debug
|
|
90
|
+
|
|
91
|
+
Cons:
|
|
92
|
+
✗ Requires Redis infrastructure
|
|
93
|
+
✗ TTL may serve stale data
|
|
94
|
+
|
|
95
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
96
|
+
Branch 2: In-memory with event invalidation
|
|
97
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
98
|
+
Score: 7.8/10
|
|
99
|
+
|
|
100
|
+
Steps:
|
|
101
|
+
1. Use in-memory cache per instance
|
|
102
|
+
2. Pub/sub for invalidation events
|
|
103
|
+
3. Background refresh
|
|
104
|
+
|
|
105
|
+
Pros:
|
|
106
|
+
✓ No external dependencies
|
|
107
|
+
✓ Immediate invalidation
|
|
108
|
+
✓ Simpler ops
|
|
109
|
+
|
|
110
|
+
Cons:
|
|
111
|
+
✗ Memory pressure per instance
|
|
112
|
+
✗ Cold start problem
|
|
113
|
+
|
|
114
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
115
|
+
Branch 3: CDN edge caching
|
|
116
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
117
|
+
Score: 6.2/10
|
|
118
|
+
|
|
119
|
+
Steps:
|
|
120
|
+
1. Configure CDN cache headers
|
|
121
|
+
2. Implement cache purge API
|
|
122
|
+
3. Vary headers for personalization
|
|
123
|
+
|
|
124
|
+
Pros:
|
|
125
|
+
✓ Global distribution
|
|
126
|
+
✓ Offloads origin
|
|
127
|
+
|
|
128
|
+
Cons:
|
|
129
|
+
✗ Limited control
|
|
130
|
+
✗ Personalization challenges
|
|
131
|
+
✗ Purge latency
|
|
132
|
+
|
|
133
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
134
|
+
Selected: Branch 1 - Redis with TTL
|
|
135
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
136
|
+
Confidence: 0.85
|
|
137
|
+
|
|
138
|
+
Rationale:
|
|
139
|
+
Clear winner with best balance of performance and reliability.
|
|
140
|
+
TTL staleness mitigated by short expiration for volatile data.
|
|
141
|
+
|
|
142
|
+
Why others rejected:
|
|
143
|
+
- In-memory: Memory constraints with large datasets
|
|
144
|
+
- CDN: Personalization needs make edge caching impractical
|
|
145
|
+
|
|
146
|
+
Next Steps:
|
|
147
|
+
1. Set up Redis cluster in staging
|
|
148
|
+
2. Implement cache service wrapper
|
|
149
|
+
3. Add cache hit/miss metrics
|
|
150
|
+
|
|
151
|
+
Exploration saved: koan/explorations/exp-001.yaml
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Options
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
/explore "problem" --branches 5 # Explore 5 paths instead of default 3
|
|
158
|
+
/explore "problem" --depth 3 # Explore deeper (more steps per path)
|
|
159
|
+
/explore "problem" --quick # Faster evaluation, less thorough
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Backtracking
|
|
163
|
+
|
|
164
|
+
If you later discover the chosen path doesn't work:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
/explore --backtrack "Redis scaling is problematic"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This will:
|
|
171
|
+
1. Document the failure
|
|
172
|
+
2. Store the learning
|
|
173
|
+
3. Re-evaluate remaining paths
|
|
174
|
+
4. Suggest alternative
|
|
175
|
+
|
|
176
|
+
## Integration
|
|
177
|
+
|
|
178
|
+
Exploration integrates with:
|
|
179
|
+
- **Architecture**: Complex designs trigger exploration automatically
|
|
180
|
+
- **Debugging**: Repeated failures trigger exploration
|
|
181
|
+
- **Retrospective**: Learnings from explorations stored for future
|
|
182
|
+
|
|
183
|
+
## Files Created
|
|
184
|
+
|
|
185
|
+
- `koan/explorations/exp-{id}.yaml` - Full exploration record
|
|
186
|
+
- `koan/learnings/patterns/` - Extracted decision patterns
|