@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,375 @@
|
|
|
1
|
+
Execute a complete feature workflow automatically from story to deployment.
|
|
2
|
+
|
|
3
|
+
This command runs the full WYSIWID workflow by evaluating synchronization rules
|
|
4
|
+
after each concept completes and automatically invoking the next concept.
|
|
5
|
+
|
|
6
|
+
## Usage
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
/workflow "Add OAuth authentication"
|
|
10
|
+
/workflow deep "Feature requiring careful analysis"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Reasoning Modes
|
|
14
|
+
|
|
15
|
+
### Standard Mode (default)
|
|
16
|
+
- Architecture: Opus (deep reasoning)
|
|
17
|
+
- All other concepts: Sonnet
|
|
18
|
+
|
|
19
|
+
### Deep Mode (`deep` prefix)
|
|
20
|
+
When the description starts with "deep":
|
|
21
|
+
- **Architecture**: Opus with tree-of-thought exploration
|
|
22
|
+
- **Verification**: Multi-pass with Opus for consensus
|
|
23
|
+
- **Story**: Enhanced requirements analysis
|
|
24
|
+
- **Implementation**: More thorough code review before generation
|
|
25
|
+
|
|
26
|
+
**Detection:**
|
|
27
|
+
```python
|
|
28
|
+
if description.lower().startswith("deep"):
|
|
29
|
+
mode = "deep"
|
|
30
|
+
description = description.split(" ", 1)[1] # Remove prefix
|
|
31
|
+
elif description.lower().startswith("quick"):
|
|
32
|
+
mode = "quick"
|
|
33
|
+
description = description.split(" ", 1)[1]
|
|
34
|
+
else:
|
|
35
|
+
mode = "standard"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Deep Mode Differences:**
|
|
39
|
+
| Concept | Standard | Deep |
|
|
40
|
+
|---------|----------|------|
|
|
41
|
+
| Story | Sonnet | Sonnet + deeper analysis |
|
|
42
|
+
| Architecture | Opus (5 steps) | Opus + tree-of-thought (10 steps) |
|
|
43
|
+
| Verification | Sonnet (if triggered) | Opus + 3-pass consensus |
|
|
44
|
+
| Implementation | Sonnet | Sonnet + pre-review |
|
|
45
|
+
| Quality | Sonnet | Sonnet + extended coverage |
|
|
46
|
+
|
|
47
|
+
## Process
|
|
48
|
+
|
|
49
|
+
When you run this command, you should:
|
|
50
|
+
|
|
51
|
+
1. **Recall Relevant Memories** (automatic, fast)
|
|
52
|
+
- Extract keywords from the feature description
|
|
53
|
+
- Search `koan/memory/semantic/*.yaml` for relevant memories:
|
|
54
|
+
- Architecture patterns that match keywords
|
|
55
|
+
- Conventions related to the feature area
|
|
56
|
+
- Past patterns from similar features
|
|
57
|
+
- Display relevant memories (if any):
|
|
58
|
+
```
|
|
59
|
+
📚 Relevant memories found:
|
|
60
|
+
- [architecture] "Authentication uses JWT with RS256" (high)
|
|
61
|
+
- [patterns] "API endpoints follow /api/v1/{resource} convention"
|
|
62
|
+
```
|
|
63
|
+
- Pass memories as context to subsequent concepts
|
|
64
|
+
|
|
65
|
+
2. **Create Story** (Sonnet)
|
|
66
|
+
- Invoke Story concept to capture requirements
|
|
67
|
+
- Include relevant memories as context
|
|
68
|
+
- Wait for story creation
|
|
69
|
+
- Read `koan/stories/story-{id}.yaml`
|
|
70
|
+
|
|
71
|
+
3. **Evaluate Synchronizations**
|
|
72
|
+
- Read `.claude/synchronizations/feature-development.yaml`
|
|
73
|
+
- Check `story-to-arch` rule:
|
|
74
|
+
- `when`: story.create completed
|
|
75
|
+
- `where`: story.status == 'ready' AND criteria.length > 0
|
|
76
|
+
- `then`: architecture.design
|
|
77
|
+
|
|
78
|
+
4. **Continue Workflow Automatically**
|
|
79
|
+
- After each concept completes, evaluate sync rules
|
|
80
|
+
- Invoke next concept if rules match
|
|
81
|
+
- **Auto-remember architecture decisions** after architecture phase
|
|
82
|
+
- Track flow with flow_id
|
|
83
|
+
- Log provenance for each step
|
|
84
|
+
|
|
85
|
+
5. **Complete Workflow Phases**:
|
|
86
|
+
- Story (Sonnet) → Architecture (Opus) → Implementation (Sonnet) → Quality (Sonnet 2x parallel) → Version (Sonnet)
|
|
87
|
+
- **Auto-remember workflow summary** after version.commit
|
|
88
|
+
|
|
89
|
+
6. **Invoke Subagents Using Task Tool**:
|
|
90
|
+
Each concept MUST be invoked via the Task tool with appropriate subagent_type:
|
|
91
|
+
```
|
|
92
|
+
Task tool invocation:
|
|
93
|
+
subagent_type: "story-concept"
|
|
94
|
+
model: "sonnet"
|
|
95
|
+
prompt: "Create story for: {description}"
|
|
96
|
+
|
|
97
|
+
Task tool invocation:
|
|
98
|
+
subagent_type: "architecture-concept"
|
|
99
|
+
model: "opus" # Always Opus for architecture
|
|
100
|
+
prompt: "Design architecture for story: {story_id}"
|
|
101
|
+
|
|
102
|
+
# ... continue for each concept
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
7. **Handle Parallel Execution**:
|
|
106
|
+
- If multiple rules match with `parallel: true`, invoke all in single message
|
|
107
|
+
- Wait for all parallel actions to complete
|
|
108
|
+
- Evaluate next sync rules with all results
|
|
109
|
+
|
|
110
|
+
## Synchronization Evaluation Logic
|
|
111
|
+
|
|
112
|
+
For each completed concept action:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
# Pseudocode for sync evaluation
|
|
116
|
+
def evaluate_syncs(completed_concept, completed_action):
|
|
117
|
+
syncs = read_yaml(".claude/synchronizations/*.yaml")
|
|
118
|
+
|
|
119
|
+
for sync in syncs:
|
|
120
|
+
# Check when condition
|
|
121
|
+
if sync.when.concept == completed_concept and \
|
|
122
|
+
sync.when.action == completed_action and \
|
|
123
|
+
sync.when.status == "completed":
|
|
124
|
+
|
|
125
|
+
# Read the output state
|
|
126
|
+
state = read_latest_output(completed_concept)
|
|
127
|
+
|
|
128
|
+
# Evaluate where query
|
|
129
|
+
if evaluate_query(sync.where.query, state):
|
|
130
|
+
# Execute then action
|
|
131
|
+
invoke_concept(
|
|
132
|
+
concept=sync.then.concept,
|
|
133
|
+
action=sync.then.action,
|
|
134
|
+
model=sync.then.model,
|
|
135
|
+
inputs=resolve_variables(sync.then.inputs, state)
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
return sync.id # Return which sync triggered
|
|
139
|
+
|
|
140
|
+
return None # No sync matched
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Query Evaluation
|
|
144
|
+
|
|
145
|
+
Parse simple expressions from YAML:
|
|
146
|
+
|
|
147
|
+
- `story.status == 'ready'` → Read story YAML, check status field
|
|
148
|
+
- `architecture.risk != 'high'` → Read architecture YAML, check risk
|
|
149
|
+
- `criteria.length > 0` → Count array items in acceptance_criteria
|
|
150
|
+
|
|
151
|
+
## Example Execution
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
User: /workflow "Add dark mode support"
|
|
155
|
+
|
|
156
|
+
You: I'll execute the complete feature workflow.
|
|
157
|
+
|
|
158
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
159
|
+
Recalling Relevant Memories
|
|
160
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
161
|
+
|
|
162
|
+
📚 Found 2 relevant memories:
|
|
163
|
+
- [patterns] "Theme switching uses React Context" (high)
|
|
164
|
+
- [conventions] "CSS variables for color tokens" (medium)
|
|
165
|
+
|
|
166
|
+
These will be included as context throughout the workflow.
|
|
167
|
+
|
|
168
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
169
|
+
Phase 1: Story Capture (Sonnet)
|
|
170
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
171
|
+
|
|
172
|
+
[Invoke Task tool → story concept → model: sonnet]
|
|
173
|
+
|
|
174
|
+
✓ Story created: story-042
|
|
175
|
+
Status: ready
|
|
176
|
+
Acceptance criteria: 4 defined
|
|
177
|
+
Memory context: 2 items applied
|
|
178
|
+
Cost: $0.003
|
|
179
|
+
|
|
180
|
+
Evaluating synchronizations...
|
|
181
|
+
✓ Matched: story-to-arch
|
|
182
|
+
Condition: status=='ready' AND criteria.length>0
|
|
183
|
+
Next: architecture.design (Opus)
|
|
184
|
+
|
|
185
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
186
|
+
Phase 2: Architecture Design (Opus)
|
|
187
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
188
|
+
|
|
189
|
+
[Invoke Task tool → architecture-concept → model: opus]
|
|
190
|
+
|
|
191
|
+
✓ Architecture created: arch-042
|
|
192
|
+
Approach: Context + CSS-in-JS
|
|
193
|
+
Decisions: 3 documented
|
|
194
|
+
Risks: 2 (both mitigated)
|
|
195
|
+
Risk level: low
|
|
196
|
+
Cost: $0.015
|
|
197
|
+
|
|
198
|
+
💾 Auto-remembered 2 architecture decisions:
|
|
199
|
+
- "Dark mode uses React Context for theme state"
|
|
200
|
+
- "CSS-in-JS with CSS variables for color tokens"
|
|
201
|
+
|
|
202
|
+
Evaluating synchronizations...
|
|
203
|
+
✓ Matched: arch-to-impl
|
|
204
|
+
Condition: decisions.length>0 AND risk!='high'
|
|
205
|
+
Next: implementation.generate (Sonnet)
|
|
206
|
+
|
|
207
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
208
|
+
Phase 3: Implementation (Sonnet)
|
|
209
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
210
|
+
|
|
211
|
+
[Invoke Task tool → implementation concept → model: sonnet]
|
|
212
|
+
|
|
213
|
+
✓ Implementation created: impl-042
|
|
214
|
+
Files changed: 5 (198 lines)
|
|
215
|
+
Tests created: 2
|
|
216
|
+
Status: completed
|
|
217
|
+
Cost: $0.003
|
|
218
|
+
|
|
219
|
+
Evaluating synchronizations...
|
|
220
|
+
✓ Matched: impl-to-quality-review
|
|
221
|
+
Next: quality.review (Sonnet)
|
|
222
|
+
✓ Matched: impl-to-quality-test
|
|
223
|
+
Next: quality.test (Sonnet)
|
|
224
|
+
|
|
225
|
+
Both rules have parallel:true → executing simultaneously...
|
|
226
|
+
|
|
227
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
228
|
+
Phase 4: Quality Assurance (Sonnet) - PARALLEL EXECUTION
|
|
229
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
230
|
+
|
|
231
|
+
[Invoke 2x Task tools in single message → both quality actions]
|
|
232
|
+
|
|
233
|
+
✓ Review completed: review-042
|
|
234
|
+
Status: approved
|
|
235
|
+
Issues: 1 low-severity
|
|
236
|
+
Cost: $0.003
|
|
237
|
+
|
|
238
|
+
✓ Tests completed: test-042
|
|
239
|
+
Passed: 18/18
|
|
240
|
+
Coverage: 94%
|
|
241
|
+
Cost: $0.003
|
|
242
|
+
|
|
243
|
+
Evaluating synchronizations...
|
|
244
|
+
✓ Matched: quality-to-version
|
|
245
|
+
Condition: review.status=='approved' AND tests.passed
|
|
246
|
+
Next: version.commit (Sonnet)
|
|
247
|
+
|
|
248
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
249
|
+
Phase 5: Version Control (Sonnet)
|
|
250
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
251
|
+
|
|
252
|
+
[Invoke Task tool → version concept → model: sonnet]
|
|
253
|
+
|
|
254
|
+
✓ Commit created: abc123def
|
|
255
|
+
Branch: feature/story-042-dark-mode
|
|
256
|
+
Files: 5
|
|
257
|
+
Message: "feat(theme): add dark mode support"
|
|
258
|
+
Cost: $0.003
|
|
259
|
+
|
|
260
|
+
Evaluating synchronizations...
|
|
261
|
+
No further syncs matched. Workflow complete!
|
|
262
|
+
|
|
263
|
+
💾 Auto-remembered workflow summary:
|
|
264
|
+
- Feature: "Add dark mode support"
|
|
265
|
+
- Approach: "React Context + CSS-in-JS"
|
|
266
|
+
- Key files: 5 changed (ThemeContext.tsx, useTheme.ts, etc.)
|
|
267
|
+
|
|
268
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
269
|
+
Workflow Complete ✅
|
|
270
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
271
|
+
|
|
272
|
+
Flow: flow-2025-11-09-22h00m00s
|
|
273
|
+
Total actions: 7
|
|
274
|
+
Total cost: ~$0.030
|
|
275
|
+
Time: 18 minutes
|
|
276
|
+
Memories created: 3
|
|
277
|
+
|
|
278
|
+
Breakdown:
|
|
279
|
+
- Story (Sonnet): $0.003 (10%)
|
|
280
|
+
- Architecture (Opus): $0.015 (50%)
|
|
281
|
+
- Implementation (Sonnet): $0.003 (10%)
|
|
282
|
+
- Quality 2x (Sonnet): $0.006 (20%)
|
|
283
|
+
- Version (Sonnet): $0.003 (10%)
|
|
284
|
+
|
|
285
|
+
Next steps:
|
|
286
|
+
- Review code: See impl-042
|
|
287
|
+
- View trace: /trace flow-2025-11-09-22h00m00s
|
|
288
|
+
- Push changes: git push origin feature/story-042-dark-mode
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Error Handling
|
|
292
|
+
|
|
293
|
+
If a concept fails or returns blocked status:
|
|
294
|
+
|
|
295
|
+
```
|
|
296
|
+
✗ Architecture blocked: arch-042
|
|
297
|
+
Blocker: Unclear requirements for authentication flow
|
|
298
|
+
|
|
299
|
+
Evaluating synchronizations...
|
|
300
|
+
✓ Matched: arch-blocked-to-story-clarify
|
|
301
|
+
Next: story.clarify
|
|
302
|
+
|
|
303
|
+
Pausing workflow for clarification...
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Manual Intervention
|
|
307
|
+
|
|
308
|
+
At any point, you can:
|
|
309
|
+
- `/trace <flow-id>` - See progress
|
|
310
|
+
- `/sync` - Manually evaluate and trigger next step
|
|
311
|
+
- Continue the workflow manually if needed
|
|
312
|
+
|
|
313
|
+
## Parallel Execution
|
|
314
|
+
|
|
315
|
+
**When multiple sync rules match with `parallel: true`**:
|
|
316
|
+
|
|
317
|
+
1. **Detection**: Check if multiple rules match same completion
|
|
318
|
+
```yaml
|
|
319
|
+
impl-to-quality-review: parallel: true
|
|
320
|
+
impl-to-quality-test: parallel: true
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
2. **Execution**: Invoke all concepts in **single message**
|
|
324
|
+
```
|
|
325
|
+
Send ONE message with multiple Task tool calls:
|
|
326
|
+
- Task(quality.review, model=sonnet)
|
|
327
|
+
- Task(quality.test, model=sonnet)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
3. **Wait**: Collect all results before proceeding
|
|
331
|
+
|
|
332
|
+
4. **Benefits**:
|
|
333
|
+
- 50% faster (review+test run simultaneously, not sequentially)
|
|
334
|
+
- Same cost (both actions run anyway)
|
|
335
|
+
- Better resource utilization
|
|
336
|
+
|
|
337
|
+
**Requirements for Safe Parallelization**:
|
|
338
|
+
- ✅ Actions read from same completed concept
|
|
339
|
+
- ✅ Neither action modifies what the other reads
|
|
340
|
+
- ✅ Neither depends on the other's output
|
|
341
|
+
- ✅ Both can execute independently
|
|
342
|
+
|
|
343
|
+
**Example**: Quality review and test are perfect candidates:
|
|
344
|
+
- Both read from completed implementation
|
|
345
|
+
- Neither modifies implementation state
|
|
346
|
+
- Neither needs the other's results
|
|
347
|
+
- Both produce independent quality reports
|
|
348
|
+
|
|
349
|
+
## Performance
|
|
350
|
+
|
|
351
|
+
Expected duration by feature complexity:
|
|
352
|
+
- Simple feature: 5-10 minutes (3-4 min with parallel quality)
|
|
353
|
+
- Medium feature: 15-20 minutes (13-16 min with parallel quality)
|
|
354
|
+
- Complex feature: 30-45 minutes (26-39 min with parallel quality)
|
|
355
|
+
|
|
356
|
+
Most time spent in Architecture phase (deep reasoning).
|
|
357
|
+
|
|
358
|
+
**Parallel Quality Impact**:
|
|
359
|
+
- Traditional: Impl (3min) → Review (2min) → Test (2min) = 7min for impl+quality
|
|
360
|
+
- With Parallel: Impl (3min) → Review+Test (2min) = 5min for impl+quality
|
|
361
|
+
- **Savings**: 2 minutes per feature (29% faster)
|
|
362
|
+
|
|
363
|
+
## Cost Tracking
|
|
364
|
+
|
|
365
|
+
Each workflow creates complete provenance:
|
|
366
|
+
- See `koan/provenance/flows/flow-{id}.yaml`
|
|
367
|
+
- Track cumulative cost
|
|
368
|
+
- Analyze model usage
|
|
369
|
+
- Use `/costs` for aggregated analysis
|
|
370
|
+
|
|
371
|
+
## WYSIWID in Action
|
|
372
|
+
|
|
373
|
+
The synchronization rules ARE the workflow logic.
|
|
374
|
+
Read `.claude/synchronizations/*.yaml` to see exactly what will happen.
|
|
375
|
+
What you see (the rules) is what it does (the execution).
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# Zen Concepts
|
|
2
|
+
|
|
3
|
+
Concepts are independent, stateful services that perform specific actions. They are the building blocks of the Zen WYSIWID architecture.
|
|
4
|
+
|
|
5
|
+
## Core Principle: Concepts Never Call Concepts
|
|
6
|
+
|
|
7
|
+
This is the foundational rule of Zen:
|
|
8
|
+
|
|
9
|
+
❌ **Wrong**: Architecture concept calls Implementation concept
|
|
10
|
+
✅ **Right**: Architecture completes → Synchronization triggers Implementation
|
|
11
|
+
|
|
12
|
+
This enforces true modularity and makes system behavior predictable from reading synchronization rules.
|
|
13
|
+
|
|
14
|
+
## The 10 Concepts
|
|
15
|
+
|
|
16
|
+
### 1. Story (Sonnet) - Requirements Capture
|
|
17
|
+
- **File**: `story.md`
|
|
18
|
+
- **Model**: Sonnet
|
|
19
|
+
- **Purpose**: Capture and validate user requirements
|
|
20
|
+
- **Actions**: create, validate, query
|
|
21
|
+
- **State**: `koan/stories/`
|
|
22
|
+
- **Never knows**: How to implement, architect, or test
|
|
23
|
+
|
|
24
|
+
**When to use**: User requests a new feature or bug fix
|
|
25
|
+
|
|
26
|
+
### 2. Architecture (Opus) - System Design
|
|
27
|
+
- **File**: `architecture.md`
|
|
28
|
+
- **Model**: Opus ⭐
|
|
29
|
+
- **Purpose**: Design technical solutions and make architectural decisions
|
|
30
|
+
- **Actions**: design, evaluate, revise, clarify
|
|
31
|
+
- **State**: `koan/architecture/`
|
|
32
|
+
- **Never knows**: How to write code or run tests
|
|
33
|
+
|
|
34
|
+
**When to use**: Story is validated and ready for design
|
|
35
|
+
|
|
36
|
+
**Why Opus?**: Requires deep reasoning, trade-off analysis, pattern synthesis
|
|
37
|
+
|
|
38
|
+
### 3. Implementation (Sonnet) - Code Generation
|
|
39
|
+
- **File**: `implementation.md`
|
|
40
|
+
- **Model**: Sonnet
|
|
41
|
+
- **Purpose**: Generate code from technical specifications
|
|
42
|
+
- **Actions**: generate, refactor, document
|
|
43
|
+
- **State**: `koan/implementations/`
|
|
44
|
+
- **Never knows**: Architectural decisions (follows specs exactly)
|
|
45
|
+
|
|
46
|
+
**When to use**: Architecture is complete and risk is acceptable
|
|
47
|
+
|
|
48
|
+
**Why Sonnet?**: Clear specs make implementation straightforward
|
|
49
|
+
|
|
50
|
+
### 4. Quality (Sonnet) - Review & Testing
|
|
51
|
+
- **File**: `quality.md`
|
|
52
|
+
- **Model**: Sonnet
|
|
53
|
+
- **Purpose**: Review code, run tests, validate acceptance criteria
|
|
54
|
+
- **Actions**: review, test, validate
|
|
55
|
+
- **State**: `koan/reviews/`
|
|
56
|
+
- **Never knows**: How to fix issues (reports them for Implementation)
|
|
57
|
+
|
|
58
|
+
**When to use**: Implementation is complete
|
|
59
|
+
|
|
60
|
+
**Why Sonnet?**: Pattern matching and rule-based validation
|
|
61
|
+
|
|
62
|
+
### 5. Version (Sonnet) - Git Operations
|
|
63
|
+
- **File**: `version.md`
|
|
64
|
+
- **Model**: Sonnet
|
|
65
|
+
- **Purpose**: Manage version control, commits, branches
|
|
66
|
+
- **Actions**: branch, commit, push, tag
|
|
67
|
+
- **State**: `koan/versions/`
|
|
68
|
+
- **Never knows**: Code quality (commits only after Quality approves)
|
|
69
|
+
|
|
70
|
+
**When to use**: Quality review passes
|
|
71
|
+
|
|
72
|
+
**Why Sonnet?**: Straightforward git commands
|
|
73
|
+
|
|
74
|
+
### 6. Context (Sonnet) - Context Window Management
|
|
75
|
+
- **File**: `context.md`
|
|
76
|
+
- **Model**: Sonnet
|
|
77
|
+
- **Purpose**: Manage Claude Code context window
|
|
78
|
+
- **Actions**: snapshot, estimate, compress, preserve
|
|
79
|
+
- **State**: `koan/session-state/`
|
|
80
|
+
- **Never knows**: Feature logic (focuses on context health)
|
|
81
|
+
|
|
82
|
+
**When to use**: Workflow boundaries, context warnings
|
|
83
|
+
|
|
84
|
+
**Why Sonnet?**: Token counting and compression
|
|
85
|
+
|
|
86
|
+
### 7. Code-Analysis (Sonnet) - Codebase Context
|
|
87
|
+
- **File**: `code-analysis.md`
|
|
88
|
+
- **Model**: Sonnet
|
|
89
|
+
- **Purpose**: Gather codebase context via MCP tools
|
|
90
|
+
- **Actions**: context
|
|
91
|
+
- **State**: `koan/code-analysis/`
|
|
92
|
+
- **Never knows**: How to design or implement (gathers context only)
|
|
93
|
+
|
|
94
|
+
**When to use**: Before architecture, to understand existing patterns
|
|
95
|
+
|
|
96
|
+
**Why Sonnet?**: MCP tool orchestration is straightforward
|
|
97
|
+
|
|
98
|
+
### 8. Verification (Sonnet) - Multi-Pass Review
|
|
99
|
+
- **File**: `verification.md`
|
|
100
|
+
- **Model**: Sonnet
|
|
101
|
+
- **Purpose**: Independent multi-pass verification for accuracy
|
|
102
|
+
- **Actions**: verify_architecture, verify_implementation
|
|
103
|
+
- **State**: `koan/verification/`
|
|
104
|
+
- **Never knows**: How to fix issues (reports findings only)
|
|
105
|
+
|
|
106
|
+
**When to use**: High-risk architectures, complex implementations
|
|
107
|
+
|
|
108
|
+
**Why Sonnet?**: Pattern matching and independent review
|
|
109
|
+
|
|
110
|
+
### 9. Security (Sonnet) - Security Assurance
|
|
111
|
+
- **File**: `security.md`
|
|
112
|
+
- **Model**: Sonnet
|
|
113
|
+
- **Purpose**: Threat modeling, vulnerability scanning, commit gates
|
|
114
|
+
- **Actions**: threat_model, validate_architecture, scan_implementation, verify_commit
|
|
115
|
+
- **State**: `koan/security/`
|
|
116
|
+
- **Never knows**: How to fix vulnerabilities (blocks until fixed)
|
|
117
|
+
|
|
118
|
+
**When to use**: All features (parallel with story), before commits
|
|
119
|
+
|
|
120
|
+
**Why Sonnet?**: Security pattern detection and OWASP validation
|
|
121
|
+
|
|
122
|
+
### 10. Documentation (Sonnet) - Comprehensive Docs
|
|
123
|
+
- **File**: `documentation.md`
|
|
124
|
+
- **Model**: Sonnet
|
|
125
|
+
- **Purpose**: Generate documentation at every workflow phase
|
|
126
|
+
- **Actions**: generate, update_index
|
|
127
|
+
- **State**: `koan/documentation/`
|
|
128
|
+
- **Never knows**: Implementation details (documents from specs)
|
|
129
|
+
|
|
130
|
+
**When to use**: After each major workflow phase
|
|
131
|
+
|
|
132
|
+
**Why Sonnet?**: Technical writing from specifications
|
|
133
|
+
|
|
134
|
+
## Concept Anatomy
|
|
135
|
+
|
|
136
|
+
Each concept has:
|
|
137
|
+
|
|
138
|
+
1. **Frontmatter**: Metadata (name, model, state location, cost tier)
|
|
139
|
+
2. **Purpose**: Why this concept exists
|
|
140
|
+
3. **Actions**: What operations it can perform
|
|
141
|
+
4. **Model Rationale**: Why this model was chosen
|
|
142
|
+
5. **Integration Points**: How it fits in workflows
|
|
143
|
+
6. **Anti-Patterns**: Common mistakes to avoid
|
|
144
|
+
7. **Provenance**: How actions are tracked
|
|
145
|
+
8. **Examples**: Usage demonstrations
|
|
146
|
+
|
|
147
|
+
## Model Assignment Strategy
|
|
148
|
+
|
|
149
|
+
### Sonnet (9/10 concepts) - Balanced Execution
|
|
150
|
+
- Story capture (template filling)
|
|
151
|
+
- Code analysis (MCP-based codebase exploration)
|
|
152
|
+
- Verification (multi-pass review)
|
|
153
|
+
- Code generation from specs (pattern following)
|
|
154
|
+
- Quality checks (pattern matching)
|
|
155
|
+
- Security scanning (vulnerability detection)
|
|
156
|
+
- Git operations (command execution)
|
|
157
|
+
- Context management (token counting)
|
|
158
|
+
- Documentation generation (comprehensive docs)
|
|
159
|
+
|
|
160
|
+
**Rationale**: These tasks benefit from balanced performance and capability
|
|
161
|
+
|
|
162
|
+
### Opus (1/10 concepts) - Deep Reasoning
|
|
163
|
+
- Architecture design (multi-step reasoning)
|
|
164
|
+
- Trade-off evaluation (complex analysis)
|
|
165
|
+
- Novel problem solving (synthesis)
|
|
166
|
+
|
|
167
|
+
**Rationale**: Investment in deep reasoning prevents costly mistakes downstream
|
|
168
|
+
|
|
169
|
+
## Cost Breakdown per Feature
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Story (Sonnet): $0.003 (5%)
|
|
173
|
+
Code-Analysis (Sonnet): $0.003 (5%)
|
|
174
|
+
Architecture (Opus): $0.015 (25%) ⭐
|
|
175
|
+
Verification (Sonnet): $0.003 (5%)
|
|
176
|
+
Implementation (Sonnet): $0.003 (5%)
|
|
177
|
+
Quality x2 (Sonnet): $0.006 (10%)
|
|
178
|
+
Security (Sonnet): $0.003 (5%)
|
|
179
|
+
Version (Sonnet): $0.003 (5%)
|
|
180
|
+
Context (Sonnet): $0.003 (5%)
|
|
181
|
+
Documentation (Sonnet): $0.003 (5%)
|
|
182
|
+
────────────────────────────────────────
|
|
183
|
+
Total: ~$0.045
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Key Insight**: Architecture is the largest investment but prevents rework that would be far more expensive.
|
|
187
|
+
|
|
188
|
+
## Invocation
|
|
189
|
+
|
|
190
|
+
Concepts are invoked via Claude Code's Task tool:
|
|
191
|
+
|
|
192
|
+
```markdown
|
|
193
|
+
I'll use the story concept to capture this requirement.
|
|
194
|
+
[Invokes Task tool with:
|
|
195
|
+
- subagent_type: "story-concept"
|
|
196
|
+
- model: "sonnet"
|
|
197
|
+
- prompt: {inputs}
|
|
198
|
+
]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## State Files
|
|
202
|
+
|
|
203
|
+
Each concept stores state in `koan/`:
|
|
204
|
+
|
|
205
|
+
```yaml
|
|
206
|
+
# koan/stories/story-001.yaml
|
|
207
|
+
story_id: "story-001"
|
|
208
|
+
created_at: "2025-11-09T20:00:00Z"
|
|
209
|
+
title: "Add dark mode support"
|
|
210
|
+
description: "..."
|
|
211
|
+
acceptance_criteria: [...]
|
|
212
|
+
status: "ready"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Benefits:**
|
|
216
|
+
- Human-readable
|
|
217
|
+
- Git-trackable
|
|
218
|
+
- LLM-friendly
|
|
219
|
+
- Easy debugging
|
|
220
|
+
|
|
221
|
+
## Provenance
|
|
222
|
+
|
|
223
|
+
Every concept action creates provenance:
|
|
224
|
+
|
|
225
|
+
```yaml
|
|
226
|
+
# koan/provenance/actions/act-001.yaml
|
|
227
|
+
action_id: "act-001"
|
|
228
|
+
concept: "story"
|
|
229
|
+
model: "sonnet"
|
|
230
|
+
action: "create"
|
|
231
|
+
triggered_by: null # User-initiated
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Anti-Patterns
|
|
235
|
+
|
|
236
|
+
### ❌ Concept Calling Concept
|
|
237
|
+
```python
|
|
238
|
+
# DON'T DO THIS
|
|
239
|
+
class ArchitectureConcept:
|
|
240
|
+
def design(self, story):
|
|
241
|
+
# ...
|
|
242
|
+
impl = ImplementationConcept()
|
|
243
|
+
impl.generate(self) # ❌ Direct call
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
✅ **Do this instead:**
|
|
247
|
+
```yaml
|
|
248
|
+
# synchronizations/feature-development.yaml
|
|
249
|
+
- when: {concept: architecture, status: completed}
|
|
250
|
+
then: {concept: implementation, action: generate}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### ❌ Concept with Knowledge of Others
|
|
254
|
+
```markdown
|
|
255
|
+
# implementation.md
|
|
256
|
+
After generating code, I'll call the quality concept to review it.
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
✅ **Do this instead:**
|
|
260
|
+
```markdown
|
|
261
|
+
# implementation.md
|
|
262
|
+
After generating code, I'll set status="completed".
|
|
263
|
+
(Quality will be triggered by impl-to-quality synchronization)
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### ❌ Wrong Model Assignment
|
|
267
|
+
```yaml
|
|
268
|
+
# Using Opus for routine tasks
|
|
269
|
+
implementation:
|
|
270
|
+
model: "opus" # ❌ Overkill for clear specs
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
✅ **Do this instead:**
|
|
274
|
+
```yaml
|
|
275
|
+
# Use Sonnet for routine tasks
|
|
276
|
+
implementation:
|
|
277
|
+
model: "sonnet" # ✅ Clear specs → straightforward code
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Customization
|
|
281
|
+
|
|
282
|
+
You can customize concepts for your project:
|
|
283
|
+
|
|
284
|
+
1. **Add actions**: Add new actions to existing concepts
|
|
285
|
+
2. **Adjust state format**: Change YAML structure for your needs
|
|
286
|
+
3. **Change model**: Override model for specific concepts (with justification)
|
|
287
|
+
4. **Add validations**: Enhance quality checks for your domain
|
|
288
|
+
|
|
289
|
+
**But never:**
|
|
290
|
+
- Remove the "never calls concepts" principle
|
|
291
|
+
- Skip provenance tracking
|
|
292
|
+
- Hide behavior in imperative code
|
|
293
|
+
|
|
294
|
+
## Validation
|
|
295
|
+
|
|
296
|
+
Zen enforces concept discipline:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
# Check for concept-to-concept calls (should find none)
|
|
300
|
+
grep -r "concept.*\..*(" .claude/concepts/
|
|
301
|
+
|
|
302
|
+
# Verify provenance completeness
|
|
303
|
+
ls koan/provenance/actions/ | wc -l # Should match action count
|
|
304
|
+
|
|
305
|
+
# Validate model assignments
|
|
306
|
+
grep "model:" .claude/config.yaml
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Learning Path
|
|
310
|
+
|
|
311
|
+
1. **Start with Story**: Create a feature with `/feature`
|
|
312
|
+
2. **Observe Architecture**: See how Opus designs the solution
|
|
313
|
+
3. **Watch Implementation**: See how Sonnet generates code from specs
|
|
314
|
+
4. **Review Quality**: See pattern-based validation
|
|
315
|
+
5. **Track Provenance**: Use `/trace` to see the complete chain
|
|
316
|
+
|
|
317
|
+
## Questions?
|
|
318
|
+
|
|
319
|
+
- **"When should I add a new concept?"** - When you have a truly independent concern that doesn't belong in existing concepts
|
|
320
|
+
- **"Can concepts share code?"** - No. Duplicate code is better than hidden coupling
|
|
321
|
+
- **"Why can't concepts call each other?"** - Because it makes behavior unpredictable and breaks legibility
|
|
322
|
+
- **"Is Sonnet really sufficient?"** - For routine tasks with clear specs, absolutely. Try it!
|
|
323
|
+
|
|
324
|
+
## Next Steps
|
|
325
|
+
|
|
326
|
+
- Read individual concept files for detailed documentation
|
|
327
|
+
- Review `.claude/synchronizations/feature-development.yaml` to see how concepts are orchestrated
|
|
328
|
+
- Try `/feature "Your idea"` and watch the workflow
|
|
329
|
+
- Use `/trace` to see the complete provenance chain
|