claude-code-workflow 6.1.4 → 6.2.2
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/CLAUDE.md +10 -0
- package/.claude/agents/action-planning-agent.md +857 -778
- package/.claude/agents/cli-execution-agent.md +266 -269
- package/.claude/agents/cli-explore-agent.md +2 -2
- package/.claude/agents/cli-lite-planning-agent.md +142 -92
- package/.claude/agents/cli-planning-agent.md +4 -4
- package/.claude/agents/code-developer.md +7 -6
- package/.claude/agents/conceptual-planning-agent.md +2 -2
- package/.claude/agents/context-search-agent.md +31 -32
- package/.claude/agents/doc-generator.md +4 -4
- package/.claude/agents/memory-bridge.md +93 -93
- package/.claude/agents/test-context-search-agent.md +8 -7
- package/.claude/agents/test-fix-agent.md +7 -6
- package/.claude/commands/clean.md +516 -0
- package/.claude/commands/memory/compact.md +383 -0
- package/.claude/commands/memory/docs-full-cli.md +471 -471
- package/.claude/commands/memory/docs-related-cli.md +386 -386
- package/.claude/commands/memory/docs.md +615 -615
- package/.claude/commands/memory/load.md +5 -5
- package/.claude/commands/memory/tech-research-rules.md +310 -0
- package/.claude/commands/memory/update-full.md +332 -332
- package/.claude/commands/memory/workflow-skill-memory.md +4 -4
- package/.claude/commands/task/create.md +151 -151
- package/.claude/commands/version.md +254 -254
- package/.claude/commands/workflow/brainstorm/api-designer.md +587 -585
- package/.claude/commands/workflow/brainstorm/artifacts.md +1 -0
- package/.claude/commands/workflow/brainstorm/auto-parallel.md +443 -443
- package/.claude/commands/workflow/brainstorm/data-architect.md +220 -220
- package/.claude/commands/workflow/brainstorm/product-manager.md +200 -200
- package/.claude/commands/workflow/brainstorm/product-owner.md +200 -200
- package/.claude/commands/workflow/brainstorm/scrum-master.md +200 -200
- package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
- package/.claude/commands/workflow/brainstorm/system-architect.md +389 -387
- package/.claude/commands/workflow/brainstorm/ui-designer.md +221 -221
- package/.claude/commands/workflow/brainstorm/ux-expert.md +221 -221
- package/.claude/commands/workflow/debug.md +321 -0
- package/.claude/commands/workflow/execute.md +13 -0
- package/.claude/commands/workflow/init.md +165 -164
- package/.claude/commands/workflow/lite-execute.md +119 -13
- package/.claude/commands/workflow/lite-fix.md +623 -621
- package/.claude/commands/workflow/lite-plan.md +610 -592
- package/.claude/commands/workflow/plan.md +5 -5
- package/.claude/commands/workflow/review-module-cycle.md +2 -0
- package/.claude/commands/workflow/review-session-cycle.md +2 -0
- package/.claude/commands/workflow/review.md +297 -291
- package/.claude/commands/workflow/session/complete.md +153 -500
- package/.claude/commands/workflow/session/list.md +95 -95
- package/.claude/commands/workflow/session/resume.md +60 -60
- package/.claude/commands/workflow/session/start.md +199 -199
- package/.claude/commands/workflow/tdd-plan.md +3 -3
- package/.claude/commands/workflow/tdd-verify.md +23 -9
- package/.claude/commands/workflow/test-cycle-execute.md +2 -0
- package/.claude/commands/workflow/test-fix-gen.md +699 -699
- package/.claude/commands/workflow/tools/conflict-resolution.md +104 -18
- package/.claude/commands/workflow/tools/context-gather.md +436 -434
- package/.claude/commands/workflow/tools/task-generate-agent.md +490 -291
- package/.claude/commands/workflow/tools/task-generate-tdd.md +18 -10
- package/.claude/commands/workflow/tools/test-concept-enhanced.md +2 -1
- package/.claude/commands/workflow/tools/test-context-gather.md +1 -0
- package/.claude/commands/workflow/tools/test-task-generate.md +1 -0
- package/.claude/commands/workflow/ui-design/import-from-code.md +9 -6
- package/.claude/skills/command-guide/SKILL.md +5 -5
- package/.claude/skills/command-guide/index/all-commands.json +1 -1
- package/.claude/skills/command-guide/index/by-category.json +1 -1
- package/.claude/skills/command-guide/index/by-use-case.json +1 -1
- package/.claude/skills/command-guide/reference/agents/action-planning-agent.md +857 -778
- package/.claude/skills/command-guide/reference/agents/cli-execution-agent.md +266 -269
- package/.claude/skills/command-guide/reference/agents/cli-explore-agent.md +2 -2
- package/.claude/skills/command-guide/reference/agents/cli-lite-planning-agent.md +142 -92
- package/.claude/skills/command-guide/reference/agents/cli-planning-agent.md +4 -4
- package/.claude/skills/command-guide/reference/agents/code-developer.md +7 -6
- package/.claude/skills/command-guide/reference/agents/conceptual-planning-agent.md +2 -2
- package/.claude/skills/command-guide/reference/agents/context-search-agent.md +31 -32
- package/.claude/skills/command-guide/reference/agents/doc-generator.md +4 -4
- package/.claude/skills/command-guide/reference/agents/memory-bridge.md +93 -93
- package/.claude/skills/command-guide/reference/agents/test-context-search-agent.md +8 -7
- package/.claude/skills/command-guide/reference/agents/test-fix-agent.md +7 -6
- package/.claude/skills/command-guide/reference/commands/memory/docs-full-cli.md +471 -471
- package/.claude/skills/command-guide/reference/commands/memory/docs-related-cli.md +386 -386
- package/.claude/skills/command-guide/reference/commands/memory/docs.md +17 -16
- package/.claude/skills/command-guide/reference/commands/memory/load.md +5 -5
- package/.claude/skills/command-guide/reference/commands/memory/tech-research.md +194 -357
- package/.claude/skills/command-guide/reference/commands/memory/update-full.md +332 -332
- package/.claude/skills/command-guide/reference/commands/memory/workflow-skill-memory.md +4 -4
- package/.claude/skills/command-guide/reference/commands/task/create.md +151 -151
- package/.claude/skills/command-guide/reference/commands/version.md +254 -254
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/api-designer.md +585 -585
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/auto-parallel.md +443 -443
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/data-architect.md +220 -220
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-manager.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/product-owner.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/scrum-master.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/subject-matter-expert.md +200 -200
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/system-architect.md +387 -387
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ui-designer.md +221 -221
- package/.claude/skills/command-guide/reference/commands/workflow/brainstorm/ux-expert.md +221 -221
- package/.claude/skills/command-guide/reference/commands/workflow/execute.md +25 -20
- package/.claude/skills/command-guide/reference/commands/workflow/init.md +164 -164
- package/.claude/skills/command-guide/reference/commands/workflow/lite-execute.md +748 -686
- package/.claude/skills/command-guide/reference/commands/workflow/lite-fix.md +664 -621
- package/.claude/skills/command-guide/reference/commands/workflow/lite-plan.md +645 -592
- package/.claude/skills/command-guide/reference/commands/workflow/plan.md +5 -5
- package/.claude/skills/command-guide/reference/commands/workflow/review.md +25 -18
- package/.claude/skills/command-guide/reference/commands/workflow/session/complete.md +547 -500
- package/.claude/skills/command-guide/reference/commands/workflow/session/list.md +45 -27
- package/.claude/skills/command-guide/reference/commands/workflow/session/resume.md +35 -19
- package/.claude/skills/command-guide/reference/commands/workflow/session/start.md +90 -33
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-plan.md +3 -3
- package/.claude/skills/command-guide/reference/commands/workflow/tdd-verify.md +23 -9
- package/.claude/skills/command-guide/reference/commands/workflow/test-fix-gen.md +699 -699
- package/.claude/skills/command-guide/reference/commands/workflow/tools/conflict-resolution.md +103 -17
- package/.claude/skills/command-guide/reference/commands/workflow/tools/context-gather.md +434 -434
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-agent.md +487 -291
- package/.claude/skills/command-guide/reference/commands/workflow/tools/task-generate-tdd.md +17 -10
- package/.claude/skills/command-guide/reference/commands/workflow/tools/test-concept-enhanced.md +1 -1
- package/.claude/skills/command-guide/reference/commands/workflow/ui-design/import-from-code.md +6 -6
- package/.claude/workflows/chinese-response.md +38 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-api.txt +122 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-components.txt +122 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-config.txt +89 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-core.txt +60 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-patterns.txt +70 -0
- package/.claude/workflows/cli-templates/prompts/rules/rule-testing.txt +81 -0
- package/.claude/workflows/cli-templates/prompts/rules/tech-rules-agent-prompt.txt +89 -0
- package/.claude/workflows/cli-templates/prompts/workflow/gemini-solution-design.txt +131 -131
- package/.claude/workflows/cli-templates/prompts/workflow/skill-conflict-patterns.txt +5 -9
- package/.claude/workflows/cli-templates/prompts/workflow/skill-lessons-learned.txt +5 -9
- package/.claude/workflows/cli-templates/protocols/analysis-protocol.md +112 -0
- package/.claude/workflows/cli-templates/protocols/write-protocol.md +201 -0
- package/.claude/workflows/cli-templates/schemas/conflict-resolution-schema.json +137 -0
- package/.claude/workflows/cli-templates/schemas/debug-log-json-schema.json +127 -0
- package/.claude/workflows/cli-templates/schemas/fix-plan-json-schema.json +25 -0
- package/.claude/workflows/cli-templates/schemas/plan-json-schema.json +25 -0
- package/.claude/workflows/cli-tools-usage.md +526 -0
- package/{CLAUDE.md → .claude/workflows/coding-philosophy.md} +24 -45
- package/.claude/workflows/context-tools.md +84 -0
- package/.claude/workflows/file-modification.md +64 -0
- package/.claude/workflows/tool-strategy.md +216 -79
- package/.claude/workflows/windows-platform.md +16 -0
- package/.claude/workflows/workflow-architecture.md +942 -942
- package/.codex/AGENTS.md +63 -330
- package/.codex/prompts/debug.md +318 -0
- package/.codex/prompts/execute.md +273 -0
- package/.codex/prompts/lite-execute.md +164 -0
- package/.codex/prompts/lite-plan.md +469 -0
- package/.codex/prompts.zip +0 -0
- package/.gemini/GEMINI.md +25 -164
- package/.qwen/QWEN.md +0 -139
- package/README.md +29 -9
- package/ccw/README.md +30 -6
- package/ccw/bin/ccw-mcp.js +7 -0
- package/ccw/bin/ccw.js +9 -9
- package/ccw/package.json +65 -47
- package/ccw/src/.workflow/.cli-history/history.db +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-shm +0 -0
- package/ccw/src/.workflow/.cli-history/history.db-wal +0 -0
- package/ccw/src/cli.ts +244 -0
- package/ccw/src/commands/cli.ts +740 -0
- package/ccw/src/commands/core-memory.ts +770 -0
- package/ccw/src/commands/hook.ts +315 -0
- package/ccw/src/commands/install.ts +519 -0
- package/ccw/src/commands/{list.js → list.ts} +1 -1
- package/ccw/src/commands/memory.ts +1090 -0
- package/ccw/src/commands/{serve.js → serve.ts} +14 -5
- package/ccw/src/commands/session-path-resolver.ts +372 -0
- package/ccw/src/commands/session.ts +1141 -0
- package/ccw/src/commands/{stop.js → stop.ts} +16 -6
- package/ccw/src/commands/tool.ts +201 -0
- package/ccw/src/commands/{uninstall.js → uninstall.ts} +89 -40
- package/ccw/src/commands/{upgrade.js → upgrade.ts} +68 -23
- package/ccw/src/commands/{view.js → view.ts} +22 -8
- package/ccw/src/config/storage-paths.ts +670 -0
- package/ccw/src/core/cache-manager.ts +294 -0
- package/ccw/src/core/claude-freshness.ts +319 -0
- package/ccw/src/core/core-memory-store.ts +1528 -0
- package/ccw/src/core/{dashboard-generator-patch.js → dashboard-generator-patch.ts} +18 -0
- package/ccw/src/core/{dashboard-generator.js → dashboard-generator.ts} +69 -12
- package/ccw/src/core/data-aggregator.ts +584 -0
- package/ccw/src/core/history-importer.ts +625 -0
- package/ccw/src/core/{lite-scanner.js → lite-scanner-complete.ts} +162 -66
- package/ccw/src/core/lite-scanner.ts +469 -0
- package/ccw/src/core/{manifest.js → manifest.ts} +104 -34
- package/ccw/src/core/memory-embedder-bridge.ts +262 -0
- package/ccw/src/core/memory-store.ts +978 -0
- package/ccw/src/core/routes/ccw-routes.ts +96 -0
- package/ccw/src/core/routes/claude-routes.ts +1183 -0
- package/ccw/src/core/routes/cli-routes.ts +561 -0
- package/ccw/src/core/routes/codexlens-routes.ts +806 -0
- package/ccw/src/core/routes/core-memory-routes.ts +605 -0
- package/ccw/src/core/routes/files-routes.ts +428 -0
- package/ccw/src/core/routes/graph-routes.md +164 -0
- package/ccw/src/core/routes/graph-routes.ts +626 -0
- package/ccw/src/core/routes/help-routes.ts +308 -0
- package/ccw/src/core/routes/hooks-routes.ts +405 -0
- package/ccw/src/core/routes/mcp-routes.ts +1271 -0
- package/ccw/src/core/routes/mcp-routes.ts.backup +550 -0
- package/ccw/src/core/routes/mcp-templates-db.ts +268 -0
- package/ccw/src/core/routes/memory-routes.ts +1206 -0
- package/ccw/src/core/routes/rules-routes.ts +526 -0
- package/ccw/src/core/routes/session-routes.ts +467 -0
- package/ccw/src/core/routes/skills-routes.ts +599 -0
- package/ccw/src/core/routes/status-routes.ts +57 -0
- package/ccw/src/core/routes/system-routes.ts +427 -0
- package/ccw/src/core/server.ts +431 -0
- package/ccw/src/core/session-clustering-service.ts +1258 -0
- package/ccw/src/core/session-scanner.ts +283 -0
- package/ccw/src/core/websocket.ts +190 -0
- package/ccw/src/{index.js → index.ts} +1 -0
- package/ccw/src/mcp-server/index.ts +186 -0
- package/ccw/src/templates/assets/css/github-dark.min.css +10 -0
- package/ccw/src/templates/assets/css/github.min.css +10 -0
- package/ccw/src/templates/assets/js/cytoscape.min.js +32 -0
- package/ccw/src/templates/assets/js/d3.min.js +2 -0
- package/ccw/src/templates/assets/js/highlight.min.js +1244 -0
- package/ccw/src/templates/assets/js/lucide.min.js +12 -0
- package/ccw/src/templates/assets/js/marked.min.js +69 -0
- package/ccw/src/templates/assets/js/tailwind.js +83 -0
- package/ccw/src/templates/dashboard-css/01-base.css +11 -0
- package/ccw/src/templates/dashboard-css/02-session.css +22 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +10 -0
- package/ccw/src/templates/dashboard-css/06-cards.css +10 -4
- package/ccw/src/templates/dashboard-css/07-managers.css +1178 -7
- package/ccw/src/templates/dashboard-css/09-explorer.css +23 -12
- package/ccw/src/templates/dashboard-css/10-cli-status.css +337 -0
- package/ccw/src/templates/dashboard-css/11-cli-history.css +271 -0
- package/ccw/src/templates/dashboard-css/12-cli-legacy.css +796 -0
- package/ccw/src/templates/dashboard-css/13-cli-ccw.css +199 -0
- package/ccw/src/templates/dashboard-css/14-cli-modals.css +258 -0
- package/ccw/src/templates/dashboard-css/15-cli-endpoints.css +305 -0
- package/ccw/src/templates/dashboard-css/16-cli-session.css +241 -0
- package/ccw/src/templates/dashboard-css/17-cli-conversation.css +283 -0
- package/ccw/src/templates/dashboard-css/18-cli-settings.css +160 -0
- package/ccw/src/templates/dashboard-css/19-cli-native-session.css +496 -0
- package/ccw/src/templates/dashboard-css/20-cli-taskqueue.css +188 -0
- package/ccw/src/templates/dashboard-css/21-cli-toolmgmt.css +310 -0
- package/ccw/src/templates/dashboard-css/22-cli-semantic.css +240 -0
- package/ccw/src/templates/dashboard-css/23-memory.css +2390 -0
- package/ccw/src/templates/dashboard-css/24-prompt-history.css +1089 -0
- package/ccw/src/templates/dashboard-css/25-skills-rules.css +326 -0
- package/ccw/src/templates/dashboard-css/26-claude-manager.css +908 -0
- package/ccw/src/templates/dashboard-css/27-graph-explorer.css +1678 -0
- package/ccw/src/templates/dashboard-css/28-mcp-manager.css +748 -0
- package/ccw/src/templates/dashboard-css/29-help.css +264 -0
- package/ccw/src/templates/dashboard-css/30-core-memory.css +1700 -0
- package/ccw/src/templates/dashboard-js/api.js +162 -142
- package/ccw/src/templates/dashboard-js/components/carousel.js +4 -4
- package/ccw/src/templates/dashboard-js/components/cli-history.js +876 -0
- package/ccw/src/templates/dashboard-js/components/cli-status.js +978 -0
- package/ccw/src/templates/dashboard-js/components/global-notifications.js +508 -219
- package/ccw/src/templates/dashboard-js/components/hook-manager.js +1277 -282
- package/ccw/src/templates/dashboard-js/components/index-manager.js +302 -0
- package/ccw/src/templates/dashboard-js/components/mcp-manager.js +718 -27
- package/ccw/src/templates/dashboard-js/components/modals.js +66 -0
- package/ccw/src/templates/dashboard-js/components/navigation.js +80 -12
- package/ccw/src/templates/dashboard-js/components/notifications.js +758 -194
- package/ccw/src/templates/dashboard-js/components/storage-manager.js +478 -0
- package/ccw/src/templates/dashboard-js/components/tabs-other.js +157 -6
- package/ccw/src/templates/dashboard-js/components/task-queue-sidebar.js +716 -0
- package/ccw/src/templates/dashboard-js/help-i18n.js +272 -0
- package/ccw/src/templates/dashboard-js/i18n.js +2807 -0
- package/ccw/src/templates/dashboard-js/main.js +15 -0
- package/ccw/src/templates/dashboard-js/state.js +243 -42
- package/ccw/src/templates/dashboard-js/utils.js +47 -1
- package/ccw/src/templates/dashboard-js/views/claude-manager.js +912 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +2272 -0
- package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +964 -0
- package/ccw/src/templates/dashboard-js/views/core-memory-clusters.js +503 -0
- package/ccw/src/templates/dashboard-js/views/core-memory.js +782 -0
- package/ccw/src/templates/dashboard-js/views/explorer.js +888 -852
- package/ccw/src/templates/dashboard-js/views/graph-explorer.js +1157 -0
- package/ccw/src/templates/dashboard-js/views/help.js +856 -0
- package/ccw/src/templates/dashboard-js/views/history.js +337 -0
- package/ccw/src/templates/dashboard-js/views/home.js +61 -15
- package/ccw/src/templates/dashboard-js/views/hook-manager.js +311 -43
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +204 -28
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2187 -411
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.backup +1729 -0
- package/ccw/src/templates/dashboard-js/views/mcp-manager.js.new +928 -0
- package/ccw/src/templates/dashboard-js/views/memory.js +1221 -0
- package/ccw/src/templates/dashboard-js/views/prompt-history.js +713 -0
- package/ccw/src/templates/dashboard-js/views/rules-manager.js +828 -0
- package/ccw/src/templates/dashboard-js/views/session-detail.js +54 -53
- package/ccw/src/templates/dashboard-js/views/skills-manager.js +819 -0
- package/ccw/src/templates/dashboard.html +185 -85
- package/ccw/src/templates/hooks-config-example.json +60 -0
- package/ccw/src/tools/classify-folders.ts +245 -0
- package/ccw/src/tools/cli-config-manager.ts +268 -0
- package/ccw/src/tools/cli-executor.ts +2014 -0
- package/ccw/src/tools/cli-history-store.ts +1195 -0
- package/ccw/src/tools/codex-lens.ts +1141 -0
- package/ccw/src/tools/{convert-tokens-to-css.js → convert-tokens-to-css.ts} +73 -23
- package/ccw/src/tools/core-memory.ts +444 -0
- package/ccw/src/tools/detect-changed-modules.ts +325 -0
- package/ccw/src/tools/{discover-design-files.js → discover-design-files.ts} +74 -24
- package/ccw/src/tools/edit-file.ts +568 -0
- package/ccw/src/tools/{generate-module-docs.js → generate-module-docs.ts} +207 -185
- package/ccw/src/tools/{get-modules-by-depth.js → get-modules-by-depth.ts} +120 -79
- package/ccw/src/tools/index.ts +370 -0
- package/ccw/src/tools/native-session-discovery.ts +795 -0
- package/ccw/src/tools/notifier.ts +129 -0
- package/ccw/src/tools/read-file.ts +410 -0
- package/ccw/src/tools/resume-strategy.ts +345 -0
- package/ccw/src/tools/session-content-parser.ts +619 -0
- package/ccw/src/tools/session-manager.ts +1026 -0
- package/ccw/src/tools/smart-context.ts +228 -0
- package/ccw/src/tools/smart-search.ts +2065 -0
- package/ccw/src/tools/smart-search.ts.backup +1233 -0
- package/ccw/src/tools/storage-manager.ts +455 -0
- package/ccw/src/tools/write-file.ts +222 -0
- package/ccw/src/types/config.ts +11 -0
- package/ccw/src/types/index.ts +3 -0
- package/ccw/src/types/session.ts +25 -0
- package/ccw/src/types/tool.ts +41 -0
- package/ccw/src/utils/{browser-launcher.js → browser-launcher.ts} +10 -8
- package/ccw/src/utils/file-utils.ts +48 -0
- package/ccw/src/utils/{path-resolver.js → path-resolver.ts} +114 -78
- package/ccw/src/utils/path-validator.ts +153 -0
- package/ccw/src/utils/{ui.js → ui.ts} +32 -25
- package/codex-lens/pyproject.toml +48 -0
- package/codex-lens/src/codexlens/.workflow/.cli-history/history.db +0 -0
- package/codex-lens/src/codexlens/__init__.py +28 -0
- package/codex-lens/src/codexlens/__main__.py +14 -0
- package/codex-lens/src/codexlens/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/__main__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/__pycache__/errors.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__init__.py +27 -0
- package/codex-lens/src/codexlens/cli/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/commands.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/embedding_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/model_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/__pycache__/output.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/cli/commands.py +1931 -0
- package/codex-lens/src/codexlens/cli/embedding_manager.py +620 -0
- package/codex-lens/src/codexlens/cli/model_manager.py +289 -0
- package/codex-lens/src/codexlens/cli/output.py +124 -0
- package/codex-lens/src/codexlens/config.py +201 -0
- package/codex-lens/src/codexlens/entities.py +121 -0
- package/codex-lens/src/codexlens/errors.py +55 -0
- package/codex-lens/src/codexlens/indexing/README.md +77 -0
- package/codex-lens/src/codexlens/indexing/__init__.py +4 -0
- package/codex-lens/src/codexlens/indexing/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -0
- package/codex-lens/src/codexlens/parsers/__init__.py +8 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/encoding.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/tokenizer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/parsers/encoding.py +202 -0
- package/codex-lens/src/codexlens/parsers/factory.py +256 -0
- package/codex-lens/src/codexlens/parsers/tokenizer.py +98 -0
- package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -0
- package/codex-lens/src/codexlens/search/__init__.py +15 -0
- package/codex-lens/src/codexlens/search/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/query_parser.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/search/chain_search.py +647 -0
- package/codex-lens/src/codexlens/search/enrichment.py +150 -0
- package/codex-lens/src/codexlens/search/hybrid_search.py +313 -0
- package/codex-lens/src/codexlens/search/query_parser.py +242 -0
- package/codex-lens/src/codexlens/search/ranking.py +274 -0
- package/codex-lens/src/codexlens/semantic/__init__.py +39 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/ann_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/chunker.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/code_extractor.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/graph_analyzer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/llm_enhancer.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/semantic/ann_index.py +414 -0
- package/codex-lens/src/codexlens/semantic/chunker.py +448 -0
- package/codex-lens/src/codexlens/semantic/code_extractor.py +274 -0
- package/codex-lens/src/codexlens/semantic/embedder.py +185 -0
- package/codex-lens/src/codexlens/semantic/vector_store.py +955 -0
- package/codex-lens/src/codexlens/storage/__init__.py +29 -0
- package/codex-lens/src/codexlens/storage/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/file_cache.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/migration_manager.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/path_mapper.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/registry.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/__pycache__/sqlite_utils.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/dir_index.py +1850 -0
- package/codex-lens/src/codexlens/storage/file_cache.py +32 -0
- package/codex-lens/src/codexlens/storage/index_tree.py +776 -0
- package/codex-lens/src/codexlens/storage/migration_manager.py +154 -0
- package/codex-lens/src/codexlens/storage/migrations/__init__.py +1 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/__init__.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_001_normalize_keywords.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_002_add_token_metadata.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_003_code_relationships.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_004_dual_fts.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_005_cleanup_unused_fields.cpython-313.pyc +0 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_001_normalize_keywords.py +123 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_002_add_token_metadata.py +48 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_004_dual_fts.py +232 -0
- package/codex-lens/src/codexlens/storage/migrations/migration_005_cleanup_unused_fields.py +196 -0
- package/codex-lens/src/codexlens/storage/path_mapper.py +274 -0
- package/codex-lens/src/codexlens/storage/registry.py +670 -0
- package/codex-lens/src/codexlens/storage/sqlite_store.py +576 -0
- package/codex-lens/src/codexlens/storage/sqlite_utils.py +64 -0
- package/package.json +4 -1
- package/.claude/commands/memory/tech-research.md +0 -477
- package/.claude/scripts/classify-folders.sh +0 -39
- package/.claude/scripts/convert_tokens_to_css.sh +0 -229
- package/.claude/scripts/detect_changed_modules.sh +0 -161
- package/.claude/scripts/discover-design-files.sh +0 -87
- package/.claude/scripts/extract-animations.js +0 -243
- package/.claude/scripts/extract-computed-styles.js +0 -118
- package/.claude/scripts/extract-layout-structure.js +0 -411
- package/.claude/scripts/generate_module_docs.sh +0 -717
- package/.claude/scripts/get_modules_by_depth.sh +0 -170
- package/.claude/scripts/ui-generate-preview.sh +0 -395
- package/.claude/scripts/ui-instantiate-prototypes.sh +0 -815
- package/.claude/scripts/update_module_claude.sh +0 -337
- package/.claude/workflows/context-search-strategy.md +0 -77
- package/.claude/workflows/intelligent-tools-strategy.md +0 -662
- package/ccw/src/cli.js +0 -119
- package/ccw/src/commands/install.js +0 -324
- package/ccw/src/commands/tool.js +0 -138
- package/ccw/src/core/data-aggregator.js +0 -409
- package/ccw/src/core/server.js +0 -2063
- package/ccw/src/core/session-scanner.js +0 -235
- package/ccw/src/tools/classify-folders.js +0 -204
- package/ccw/src/tools/detect-changed-modules.js +0 -288
- package/ccw/src/tools/edit-file.js +0 -266
- package/ccw/src/tools/index.js +0 -176
- package/ccw/src/utils/file-utils.js +0 -48
|
@@ -1,592 +1,610 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lite-plan
|
|
3
|
-
description: Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation
|
|
4
|
-
argument-hint: "[-e|--explore] \"task description\"|file.md"
|
|
5
|
-
allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*)
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Workflow Lite-Plan Command (/workflow:lite-plan)
|
|
9
|
-
|
|
10
|
-
## Overview
|
|
11
|
-
|
|
12
|
-
Intelligent lightweight planning command with dynamic workflow adaptation based on task complexity. Focuses on planning phases (exploration, clarification, planning, confirmation) and delegates execution to `/workflow:lite-execute`.
|
|
13
|
-
|
|
14
|
-
**Core capabilities:**
|
|
15
|
-
- Intelligent task analysis with automatic exploration detection
|
|
16
|
-
- Dynamic code exploration (cli-explore-agent) when codebase understanding needed
|
|
17
|
-
- Interactive clarification after exploration to gather missing information
|
|
18
|
-
- Adaptive planning strategy (direct Claude vs cli-lite-planning-agent) based on complexity
|
|
19
|
-
- Two-step confirmation: plan display → multi-dimensional input collection
|
|
20
|
-
- Execution dispatch with complete context handoff to lite-execute
|
|
21
|
-
|
|
22
|
-
## Usage
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
/workflow:lite-plan [FLAGS] <TASK_DESCRIPTION>
|
|
26
|
-
|
|
27
|
-
# Flags
|
|
28
|
-
-e, --explore Force code exploration phase (overrides auto-detection)
|
|
29
|
-
|
|
30
|
-
# Arguments
|
|
31
|
-
<task-description> Task description or path to .md file (required)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Execution Process
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
Phase 1: Task Analysis & Exploration
|
|
38
|
-
├─ Parse input (description or .md file)
|
|
39
|
-
├─ intelligent complexity assessment (Low/Medium/High)
|
|
40
|
-
├─ Exploration decision (auto-detect or --explore flag)
|
|
41
|
-
├─ ⚠️ Context protection: If file reading ≥50k chars → force cli-explore-agent
|
|
42
|
-
└─ Decision:
|
|
43
|
-
├─ needsExploration=true → Launch parallel cli-explore-agents (1-4 based on complexity)
|
|
44
|
-
└─ needsExploration=false → Skip to Phase 2/3
|
|
45
|
-
|
|
46
|
-
Phase 2: Clarification (optional, multi-round)
|
|
47
|
-
├─ Aggregate clarification_needs from all exploration angles
|
|
48
|
-
├─ Deduplicate similar questions
|
|
49
|
-
└─ Decision:
|
|
50
|
-
├─ Has clarifications → AskUserQuestion (max 4 questions per round, multiple rounds allowed)
|
|
51
|
-
└─ No clarifications → Skip to Phase 3
|
|
52
|
-
|
|
53
|
-
Phase 3: Planning (NO CODE EXECUTION - planning only)
|
|
54
|
-
└─ Decision (based on Phase 1 complexity):
|
|
55
|
-
├─ Low → Load schema: cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json → Direct Claude planning (following schema) → plan.json → MUST proceed to Phase 4
|
|
56
|
-
└─ Medium/High → cli-lite-planning-agent → plan.json → MUST proceed to Phase 4
|
|
57
|
-
|
|
58
|
-
Phase 4: Confirmation & Selection
|
|
59
|
-
├─ Display plan summary (tasks, complexity, estimated time)
|
|
60
|
-
└─ AskUserQuestion:
|
|
61
|
-
├─ Confirm: Allow / Modify / Cancel
|
|
62
|
-
├─ Execution: Agent / Codex / Auto
|
|
63
|
-
└─ Review: Gemini / Agent / Skip
|
|
64
|
-
|
|
65
|
-
Phase 5: Dispatch
|
|
66
|
-
├─ Build executionContext (plan + explorations + clarifications + selections)
|
|
67
|
-
└─ SlashCommand("/workflow:lite-execute --in-memory")
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Implementation
|
|
71
|
-
|
|
72
|
-
### Phase 1: Intelligent Multi-Angle Exploration
|
|
73
|
-
|
|
74
|
-
**Session Setup** (MANDATORY - follow exactly):
|
|
75
|
-
```javascript
|
|
76
|
-
// Helper: Get UTC+8 (China Standard Time) ISO string
|
|
77
|
-
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
78
|
-
|
|
79
|
-
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
|
80
|
-
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
|
|
81
|
-
|
|
82
|
-
const sessionId = `${taskSlug}-${dateStr}` // e.g., "implement-jwt-refresh-2025-11-29"
|
|
83
|
-
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
|
84
|
-
|
|
85
|
-
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
**Exploration Decision Logic**:
|
|
89
|
-
```javascript
|
|
90
|
-
needsExploration = (
|
|
91
|
-
flags.includes('--explore') || flags.includes('-e') ||
|
|
92
|
-
task.mentions_specific_files ||
|
|
93
|
-
task.requires_codebase_context ||
|
|
94
|
-
task.needs_architecture_understanding ||
|
|
95
|
-
task.modifies_existing_code
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
if (!needsExploration) {
|
|
99
|
-
// Skip to Phase 2 (Clarification) or Phase 3 (Planning)
|
|
100
|
-
proceed_to_next_phase()
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
**⚠️ Context Protection**: File reading ≥50k chars → force `needsExploration=true` (delegate to cli-explore-agent)
|
|
105
|
-
|
|
106
|
-
**Complexity Assessment** (Intelligent Analysis):
|
|
107
|
-
```javascript
|
|
108
|
-
// analyzes task complexity based on:
|
|
109
|
-
// - Scope: How many systems/modules are affected?
|
|
110
|
-
// - Depth: Surface change vs architectural impact?
|
|
111
|
-
// - Risk: Potential for breaking existing functionality?
|
|
112
|
-
// - Dependencies: How interconnected is the change?
|
|
113
|
-
|
|
114
|
-
const complexity = analyzeTaskComplexity(task_description)
|
|
115
|
-
// Returns: 'Low' | 'Medium' | 'High'
|
|
116
|
-
// Low: Single file, isolated change, minimal risk
|
|
117
|
-
// Medium: Multiple files, some dependencies, moderate risk
|
|
118
|
-
// High: Cross-module, architectural, high risk
|
|
119
|
-
|
|
120
|
-
// Angle assignment based on task type (orchestrator decides, not agent)
|
|
121
|
-
const ANGLE_PRESETS = {
|
|
122
|
-
architecture: ['architecture', 'dependencies', 'modularity', 'integration-points'],
|
|
123
|
-
security: ['security', 'auth-patterns', 'dataflow', 'validation'],
|
|
124
|
-
performance: ['performance', 'bottlenecks', 'caching', 'data-access'],
|
|
125
|
-
bugfix: ['error-handling', 'dataflow', 'state-management', 'edge-cases'],
|
|
126
|
-
feature: ['patterns', 'integration-points', 'testing', 'dependencies']
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
function selectAngles(taskDescription, count) {
|
|
130
|
-
const text = taskDescription.toLowerCase()
|
|
131
|
-
let preset = 'feature' // default
|
|
132
|
-
|
|
133
|
-
if (/refactor|architect|restructure|modular/.test(text)) preset = 'architecture'
|
|
134
|
-
else if (/security|auth|permission|access/.test(text)) preset = 'security'
|
|
135
|
-
else if (/performance|slow|optimi|cache/.test(text)) preset = 'performance'
|
|
136
|
-
else if (/fix|bug|error|issue|broken/.test(text)) preset = 'bugfix'
|
|
137
|
-
|
|
138
|
-
return ANGLE_PRESETS[preset].slice(0, count)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const selectedAngles = selectAngles(task_description, complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1))
|
|
142
|
-
|
|
143
|
-
console.log(`
|
|
144
|
-
## Exploration Plan
|
|
145
|
-
|
|
146
|
-
Task Complexity: ${complexity}
|
|
147
|
-
Selected Angles: ${selectedAngles.join(', ')}
|
|
148
|
-
|
|
149
|
-
Launching ${selectedAngles.length} parallel explorations...
|
|
150
|
-
`)
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
**Launch Parallel Explorations** - Orchestrator assigns angle to each agent:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
**Step
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
|
|
189
|
-
**Step
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
- [ ]
|
|
219
|
-
- [ ]
|
|
220
|
-
- [ ]
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
//
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
//
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
**
|
|
353
|
-
|
|
354
|
-
**
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
//
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
```
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
##
|
|
438
|
-
|
|
439
|
-
2
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
**
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
**
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
**
|
|
469
|
-
|
|
470
|
-
`)
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
**
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
```
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
1
|
+
---
|
|
2
|
+
name: lite-plan
|
|
3
|
+
description: Lightweight interactive planning workflow with in-memory planning, code exploration, and execution dispatch to lite-execute after user confirmation
|
|
4
|
+
argument-hint: "[-e|--explore] \"task description\"|file.md"
|
|
5
|
+
allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*)
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Workflow Lite-Plan Command (/workflow:lite-plan)
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Intelligent lightweight planning command with dynamic workflow adaptation based on task complexity. Focuses on planning phases (exploration, clarification, planning, confirmation) and delegates execution to `/workflow:lite-execute`.
|
|
13
|
+
|
|
14
|
+
**Core capabilities:**
|
|
15
|
+
- Intelligent task analysis with automatic exploration detection
|
|
16
|
+
- Dynamic code exploration (cli-explore-agent) when codebase understanding needed
|
|
17
|
+
- Interactive clarification after exploration to gather missing information
|
|
18
|
+
- Adaptive planning strategy (direct Claude vs cli-lite-planning-agent) based on complexity
|
|
19
|
+
- Two-step confirmation: plan display → multi-dimensional input collection
|
|
20
|
+
- Execution dispatch with complete context handoff to lite-execute
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
/workflow:lite-plan [FLAGS] <TASK_DESCRIPTION>
|
|
26
|
+
|
|
27
|
+
# Flags
|
|
28
|
+
-e, --explore Force code exploration phase (overrides auto-detection)
|
|
29
|
+
|
|
30
|
+
# Arguments
|
|
31
|
+
<task-description> Task description or path to .md file (required)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Execution Process
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
Phase 1: Task Analysis & Exploration
|
|
38
|
+
├─ Parse input (description or .md file)
|
|
39
|
+
├─ intelligent complexity assessment (Low/Medium/High)
|
|
40
|
+
├─ Exploration decision (auto-detect or --explore flag)
|
|
41
|
+
├─ ⚠️ Context protection: If file reading ≥50k chars → force cli-explore-agent
|
|
42
|
+
└─ Decision:
|
|
43
|
+
├─ needsExploration=true → Launch parallel cli-explore-agents (1-4 based on complexity)
|
|
44
|
+
└─ needsExploration=false → Skip to Phase 2/3
|
|
45
|
+
|
|
46
|
+
Phase 2: Clarification (optional, multi-round)
|
|
47
|
+
├─ Aggregate clarification_needs from all exploration angles
|
|
48
|
+
├─ Deduplicate similar questions
|
|
49
|
+
└─ Decision:
|
|
50
|
+
├─ Has clarifications → AskUserQuestion (max 4 questions per round, multiple rounds allowed)
|
|
51
|
+
└─ No clarifications → Skip to Phase 3
|
|
52
|
+
|
|
53
|
+
Phase 3: Planning (NO CODE EXECUTION - planning only)
|
|
54
|
+
└─ Decision (based on Phase 1 complexity):
|
|
55
|
+
├─ Low → Load schema: cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json → Direct Claude planning (following schema) → plan.json → MUST proceed to Phase 4
|
|
56
|
+
└─ Medium/High → cli-lite-planning-agent → plan.json → MUST proceed to Phase 4
|
|
57
|
+
|
|
58
|
+
Phase 4: Confirmation & Selection
|
|
59
|
+
├─ Display plan summary (tasks, complexity, estimated time)
|
|
60
|
+
└─ AskUserQuestion:
|
|
61
|
+
├─ Confirm: Allow / Modify / Cancel
|
|
62
|
+
├─ Execution: Agent / Codex / Auto
|
|
63
|
+
└─ Review: Gemini / Agent / Skip
|
|
64
|
+
|
|
65
|
+
Phase 5: Dispatch
|
|
66
|
+
├─ Build executionContext (plan + explorations + clarifications + selections)
|
|
67
|
+
└─ SlashCommand("/workflow:lite-execute --in-memory")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Implementation
|
|
71
|
+
|
|
72
|
+
### Phase 1: Intelligent Multi-Angle Exploration
|
|
73
|
+
|
|
74
|
+
**Session Setup** (MANDATORY - follow exactly):
|
|
75
|
+
```javascript
|
|
76
|
+
// Helper: Get UTC+8 (China Standard Time) ISO string
|
|
77
|
+
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
|
78
|
+
|
|
79
|
+
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
|
80
|
+
const dateStr = getUtc8ISOString().substring(0, 10) // Format: 2025-11-29
|
|
81
|
+
|
|
82
|
+
const sessionId = `${taskSlug}-${dateStr}` // e.g., "implement-jwt-refresh-2025-11-29"
|
|
83
|
+
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
|
84
|
+
|
|
85
|
+
bash(`mkdir -p ${sessionFolder} && test -d ${sessionFolder} && echo "SUCCESS: ${sessionFolder}" || echo "FAILED: ${sessionFolder}"`)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Exploration Decision Logic**:
|
|
89
|
+
```javascript
|
|
90
|
+
needsExploration = (
|
|
91
|
+
flags.includes('--explore') || flags.includes('-e') ||
|
|
92
|
+
task.mentions_specific_files ||
|
|
93
|
+
task.requires_codebase_context ||
|
|
94
|
+
task.needs_architecture_understanding ||
|
|
95
|
+
task.modifies_existing_code
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
if (!needsExploration) {
|
|
99
|
+
// Skip to Phase 2 (Clarification) or Phase 3 (Planning)
|
|
100
|
+
proceed_to_next_phase()
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**⚠️ Context Protection**: File reading ≥50k chars → force `needsExploration=true` (delegate to cli-explore-agent)
|
|
105
|
+
|
|
106
|
+
**Complexity Assessment** (Intelligent Analysis):
|
|
107
|
+
```javascript
|
|
108
|
+
// analyzes task complexity based on:
|
|
109
|
+
// - Scope: How many systems/modules are affected?
|
|
110
|
+
// - Depth: Surface change vs architectural impact?
|
|
111
|
+
// - Risk: Potential for breaking existing functionality?
|
|
112
|
+
// - Dependencies: How interconnected is the change?
|
|
113
|
+
|
|
114
|
+
const complexity = analyzeTaskComplexity(task_description)
|
|
115
|
+
// Returns: 'Low' | 'Medium' | 'High'
|
|
116
|
+
// Low: Single file, isolated change, minimal risk
|
|
117
|
+
// Medium: Multiple files, some dependencies, moderate risk
|
|
118
|
+
// High: Cross-module, architectural, high risk
|
|
119
|
+
|
|
120
|
+
// Angle assignment based on task type (orchestrator decides, not agent)
|
|
121
|
+
const ANGLE_PRESETS = {
|
|
122
|
+
architecture: ['architecture', 'dependencies', 'modularity', 'integration-points'],
|
|
123
|
+
security: ['security', 'auth-patterns', 'dataflow', 'validation'],
|
|
124
|
+
performance: ['performance', 'bottlenecks', 'caching', 'data-access'],
|
|
125
|
+
bugfix: ['error-handling', 'dataflow', 'state-management', 'edge-cases'],
|
|
126
|
+
feature: ['patterns', 'integration-points', 'testing', 'dependencies']
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function selectAngles(taskDescription, count) {
|
|
130
|
+
const text = taskDescription.toLowerCase()
|
|
131
|
+
let preset = 'feature' // default
|
|
132
|
+
|
|
133
|
+
if (/refactor|architect|restructure|modular/.test(text)) preset = 'architecture'
|
|
134
|
+
else if (/security|auth|permission|access/.test(text)) preset = 'security'
|
|
135
|
+
else if (/performance|slow|optimi|cache/.test(text)) preset = 'performance'
|
|
136
|
+
else if (/fix|bug|error|issue|broken/.test(text)) preset = 'bugfix'
|
|
137
|
+
|
|
138
|
+
return ANGLE_PRESETS[preset].slice(0, count)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const selectedAngles = selectAngles(task_description, complexity === 'High' ? 4 : (complexity === 'Medium' ? 3 : 1))
|
|
142
|
+
|
|
143
|
+
console.log(`
|
|
144
|
+
## Exploration Plan
|
|
145
|
+
|
|
146
|
+
Task Complexity: ${complexity}
|
|
147
|
+
Selected Angles: ${selectedAngles.join(', ')}
|
|
148
|
+
|
|
149
|
+
Launching ${selectedAngles.length} parallel explorations...
|
|
150
|
+
`)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Launch Parallel Explorations** - Orchestrator assigns angle to each agent:
|
|
154
|
+
|
|
155
|
+
**⚠️ CRITICAL - NO BACKGROUND EXECUTION**:
|
|
156
|
+
- **MUST NOT use `run_in_background: true`** - exploration results are REQUIRED before planning
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
```javascript
|
|
160
|
+
// Launch agents with pre-assigned angles
|
|
161
|
+
const explorationTasks = selectedAngles.map((angle, index) =>
|
|
162
|
+
Task(
|
|
163
|
+
subagent_type="cli-explore-agent",
|
|
164
|
+
run_in_background=false, // ⚠️ MANDATORY: Must wait for results
|
|
165
|
+
description=`Explore: ${angle}`,
|
|
166
|
+
prompt=`
|
|
167
|
+
## Task Objective
|
|
168
|
+
Execute **${angle}** exploration for task planning context. Analyze codebase from this specific angle to discover relevant structure, patterns, and constraints.
|
|
169
|
+
|
|
170
|
+
## Assigned Context
|
|
171
|
+
- **Exploration Angle**: ${angle}
|
|
172
|
+
- **Task Description**: ${task_description}
|
|
173
|
+
- **Exploration Index**: ${index + 1} of ${selectedAngles.length}
|
|
174
|
+
- **Output File**: ${sessionFolder}/exploration-${angle}.json
|
|
175
|
+
|
|
176
|
+
## MANDATORY FIRST STEPS (Execute by Agent)
|
|
177
|
+
**You (cli-explore-agent) MUST execute these steps in order:**
|
|
178
|
+
1. Run: ccw tool exec get_modules_by_depth '{}' (project structure)
|
|
179
|
+
2. Run: rg -l "{keyword_from_task}" --type ts (locate relevant files)
|
|
180
|
+
3. Execute: cat ~/.claude/workflows/cli-templates/schemas/explore-json-schema.json (get output schema reference)
|
|
181
|
+
|
|
182
|
+
## Exploration Strategy (${angle} focus)
|
|
183
|
+
|
|
184
|
+
**Step 1: Structural Scan** (Bash)
|
|
185
|
+
- get_modules_by_depth.sh → identify modules related to ${angle}
|
|
186
|
+
- find/rg → locate files relevant to ${angle} aspect
|
|
187
|
+
- Analyze imports/dependencies from ${angle} perspective
|
|
188
|
+
|
|
189
|
+
**Step 2: Semantic Analysis** (Gemini CLI)
|
|
190
|
+
- How does existing code handle ${angle} concerns?
|
|
191
|
+
- What patterns are used for ${angle}?
|
|
192
|
+
- Where would new code integrate from ${angle} viewpoint?
|
|
193
|
+
|
|
194
|
+
**Step 3: Write Output**
|
|
195
|
+
- Consolidate ${angle} findings into JSON
|
|
196
|
+
- Identify ${angle}-specific clarification needs
|
|
197
|
+
|
|
198
|
+
## Expected Output
|
|
199
|
+
|
|
200
|
+
**File**: ${sessionFolder}/exploration-${angle}.json
|
|
201
|
+
|
|
202
|
+
**Schema Reference**: Schema obtained in MANDATORY FIRST STEPS step 3, follow schema exactly
|
|
203
|
+
|
|
204
|
+
**Required Fields** (all ${angle} focused):
|
|
205
|
+
- project_structure: Modules/architecture relevant to ${angle}
|
|
206
|
+
- relevant_files: Files affected from ${angle} perspective
|
|
207
|
+
**IMPORTANT**: Use object format with relevance scores for synthesis:
|
|
208
|
+
\`[{path: "src/file.ts", relevance: 0.85, rationale: "Core ${angle} logic"}]\`
|
|
209
|
+
Scores: 0.7+ high priority, 0.5-0.7 medium, <0.5 low
|
|
210
|
+
- patterns: ${angle}-related patterns to follow
|
|
211
|
+
- dependencies: Dependencies relevant to ${angle}
|
|
212
|
+
- integration_points: Where to integrate from ${angle} viewpoint (include file:line locations)
|
|
213
|
+
- constraints: ${angle}-specific limitations/conventions
|
|
214
|
+
- clarification_needs: ${angle}-related ambiguities (options array + recommended index)
|
|
215
|
+
- _metadata.exploration_angle: "${angle}"
|
|
216
|
+
|
|
217
|
+
## Success Criteria
|
|
218
|
+
- [ ] Schema obtained via cat explore-json-schema.json
|
|
219
|
+
- [ ] get_modules_by_depth.sh executed
|
|
220
|
+
- [ ] At least 3 relevant files identified with ${angle} rationale
|
|
221
|
+
- [ ] Patterns are actionable (code examples, not generic advice)
|
|
222
|
+
- [ ] Integration points include file:line locations
|
|
223
|
+
- [ ] Constraints are project-specific to ${angle}
|
|
224
|
+
- [ ] JSON output follows schema exactly
|
|
225
|
+
- [ ] clarification_needs includes options + recommended
|
|
226
|
+
|
|
227
|
+
## Output
|
|
228
|
+
Write: ${sessionFolder}/exploration-${angle}.json
|
|
229
|
+
Return: 2-3 sentence summary of ${angle} findings
|
|
230
|
+
`
|
|
231
|
+
)
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
// Execute all exploration tasks in parallel
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Auto-discover Generated Exploration Files**:
|
|
238
|
+
```javascript
|
|
239
|
+
// After explorations complete, auto-discover all exploration-*.json files
|
|
240
|
+
const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json" -type f`)
|
|
241
|
+
.split('\n')
|
|
242
|
+
.filter(f => f.trim())
|
|
243
|
+
|
|
244
|
+
// Read metadata to build manifest
|
|
245
|
+
const explorationManifest = {
|
|
246
|
+
session_id: sessionId,
|
|
247
|
+
task_description: task_description,
|
|
248
|
+
timestamp: getUtc8ISOString(),
|
|
249
|
+
complexity: complexity,
|
|
250
|
+
exploration_count: explorationCount,
|
|
251
|
+
explorations: explorationFiles.map(file => {
|
|
252
|
+
const data = JSON.parse(Read(file))
|
|
253
|
+
const filename = path.basename(file)
|
|
254
|
+
return {
|
|
255
|
+
angle: data._metadata.exploration_angle,
|
|
256
|
+
file: filename,
|
|
257
|
+
path: file,
|
|
258
|
+
index: data._metadata.exploration_index
|
|
259
|
+
}
|
|
260
|
+
})
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
Write(`${sessionFolder}/explorations-manifest.json`, JSON.stringify(explorationManifest, null, 2))
|
|
264
|
+
|
|
265
|
+
console.log(`
|
|
266
|
+
## Exploration Complete
|
|
267
|
+
|
|
268
|
+
Generated exploration files in ${sessionFolder}:
|
|
269
|
+
${explorationManifest.explorations.map(e => `- exploration-${e.angle}.json (angle: ${e.angle})`).join('\n')}
|
|
270
|
+
|
|
271
|
+
Manifest: explorations-manifest.json
|
|
272
|
+
Angles explored: ${explorationManifest.explorations.map(e => e.angle).join(', ')}
|
|
273
|
+
`)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Output**:
|
|
277
|
+
- `${sessionFolder}/exploration-{angle1}.json`
|
|
278
|
+
- `${sessionFolder}/exploration-{angle2}.json`
|
|
279
|
+
- ... (1-4 files based on complexity)
|
|
280
|
+
- `${sessionFolder}/explorations-manifest.json`
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
### Phase 2: Clarification (Optional, Multi-Round)
|
|
285
|
+
|
|
286
|
+
**Skip if**: No exploration or `clarification_needs` is empty across all explorations
|
|
287
|
+
|
|
288
|
+
**⚠️ CRITICAL**: AskUserQuestion tool limits max 4 questions per call. **MUST execute multiple rounds** to exhaust all clarification needs - do NOT stop at round 1.
|
|
289
|
+
|
|
290
|
+
**Aggregate clarification needs from all exploration angles**:
|
|
291
|
+
```javascript
|
|
292
|
+
// Load manifest and all exploration files
|
|
293
|
+
const manifest = JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
|
|
294
|
+
const explorations = manifest.explorations.map(exp => ({
|
|
295
|
+
angle: exp.angle,
|
|
296
|
+
data: JSON.parse(Read(exp.path))
|
|
297
|
+
}))
|
|
298
|
+
|
|
299
|
+
// Aggregate clarification needs from all explorations
|
|
300
|
+
const allClarifications = []
|
|
301
|
+
explorations.forEach(exp => {
|
|
302
|
+
if (exp.data.clarification_needs?.length > 0) {
|
|
303
|
+
exp.data.clarification_needs.forEach(need => {
|
|
304
|
+
allClarifications.push({
|
|
305
|
+
...need,
|
|
306
|
+
source_angle: exp.angle
|
|
307
|
+
})
|
|
308
|
+
})
|
|
309
|
+
}
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
// Intelligent deduplication: analyze allClarifications by intent
|
|
313
|
+
// - Identify questions with similar intent across different angles
|
|
314
|
+
// - Merge similar questions: combine options, consolidate context
|
|
315
|
+
// - Produce dedupedClarifications with unique intents only
|
|
316
|
+
const dedupedClarifications = intelligentMerge(allClarifications)
|
|
317
|
+
|
|
318
|
+
// Multi-round clarification: batch questions (max 4 per round)
|
|
319
|
+
if (dedupedClarifications.length > 0) {
|
|
320
|
+
const BATCH_SIZE = 4
|
|
321
|
+
const totalRounds = Math.ceil(dedupedClarifications.length / BATCH_SIZE)
|
|
322
|
+
|
|
323
|
+
for (let i = 0; i < dedupedClarifications.length; i += BATCH_SIZE) {
|
|
324
|
+
const batch = dedupedClarifications.slice(i, i + BATCH_SIZE)
|
|
325
|
+
const currentRound = Math.floor(i / BATCH_SIZE) + 1
|
|
326
|
+
|
|
327
|
+
console.log(`### Clarification Round ${currentRound}/${totalRounds}`)
|
|
328
|
+
|
|
329
|
+
AskUserQuestion({
|
|
330
|
+
questions: batch.map(need => ({
|
|
331
|
+
question: `[${need.source_angle}] ${need.question}\n\nContext: ${need.context}`,
|
|
332
|
+
header: need.source_angle.substring(0, 12),
|
|
333
|
+
multiSelect: false,
|
|
334
|
+
options: need.options.map((opt, index) => ({
|
|
335
|
+
label: need.recommended === index ? `${opt} ★` : opt,
|
|
336
|
+
description: need.recommended === index ? `Recommended` : `Use ${opt}`
|
|
337
|
+
}))
|
|
338
|
+
}))
|
|
339
|
+
})
|
|
340
|
+
|
|
341
|
+
// Store batch responses in clarificationContext before next round
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Output**: `clarificationContext` (in-memory)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### Phase 3: Planning
|
|
351
|
+
|
|
352
|
+
**Planning Strategy Selection** (based on Phase 1 complexity):
|
|
353
|
+
|
|
354
|
+
**IMPORTANT**: Phase 3 is **planning only** - NO code execution. All execution happens in Phase 5 via lite-execute.
|
|
355
|
+
|
|
356
|
+
**Executor Assignment** (Claude 智能分配,plan 生成后执行):
|
|
357
|
+
|
|
358
|
+
```javascript
|
|
359
|
+
// 分配规则(优先级从高到低):
|
|
360
|
+
// 1. 用户明确指定:"用 gemini 分析..." → gemini, "codex 实现..." → codex
|
|
361
|
+
// 2. 任务类型推断:
|
|
362
|
+
// - 分析|审查|评估|探索 → gemini
|
|
363
|
+
// - 实现|创建|修改|修复 → codex (复杂) 或 agent (简单)
|
|
364
|
+
// 3. 默认 → agent
|
|
365
|
+
|
|
366
|
+
const executorAssignments = {} // { taskId: { executor: 'gemini'|'codex'|'agent', reason: string } }
|
|
367
|
+
plan.tasks.forEach(task => {
|
|
368
|
+
// Claude 根据上述规则语义分析,为每个 task 分配 executor
|
|
369
|
+
executorAssignments[task.id] = { executor: '...', reason: '...' }
|
|
370
|
+
})
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Low Complexity** - Direct planning by Claude:
|
|
374
|
+
```javascript
|
|
375
|
+
// Step 1: Read schema
|
|
376
|
+
const schema = Bash(`cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json`)
|
|
377
|
+
|
|
378
|
+
// Step 2: ⚠️ MANDATORY - Read and review ALL exploration files
|
|
379
|
+
const manifest = JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
|
|
380
|
+
manifest.explorations.forEach(exp => {
|
|
381
|
+
const explorationData = Read(exp.path)
|
|
382
|
+
console.log(`\n### Exploration: ${exp.angle}\n${explorationData}`)
|
|
383
|
+
})
|
|
384
|
+
|
|
385
|
+
// Step 3: Generate plan following schema (Claude directly, no agent)
|
|
386
|
+
// ⚠️ Plan MUST incorporate insights from exploration files read in Step 2
|
|
387
|
+
const plan = {
|
|
388
|
+
summary: "...",
|
|
389
|
+
approach: "...",
|
|
390
|
+
tasks: [...], // Each task: { id, title, scope, ..., depends_on, execution_group, complexity }
|
|
391
|
+
estimated_time: "...",
|
|
392
|
+
recommended_execution: "Agent",
|
|
393
|
+
complexity: "Low",
|
|
394
|
+
_metadata: { timestamp: getUtc8ISOString(), source: "direct-planning", planning_mode: "direct" }
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Step 4: Write plan to session folder
|
|
398
|
+
Write(`${sessionFolder}/plan.json`, JSON.stringify(plan, null, 2))
|
|
399
|
+
|
|
400
|
+
// Step 5: MUST continue to Phase 4 (Confirmation) - DO NOT execute code here
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
**Medium/High Complexity** - Invoke cli-lite-planning-agent:
|
|
404
|
+
|
|
405
|
+
```javascript
|
|
406
|
+
Task(
|
|
407
|
+
subagent_type="cli-lite-planning-agent",
|
|
408
|
+
run_in_background=false,
|
|
409
|
+
description="Generate detailed implementation plan",
|
|
410
|
+
prompt=`
|
|
411
|
+
Generate implementation plan and write plan.json.
|
|
412
|
+
|
|
413
|
+
## Output Schema Reference
|
|
414
|
+
Execute: cat ~/.claude/workflows/cli-templates/schemas/plan-json-schema.json (get schema reference before generating plan)
|
|
415
|
+
|
|
416
|
+
## Task Description
|
|
417
|
+
${task_description}
|
|
418
|
+
|
|
419
|
+
## Multi-Angle Exploration Context
|
|
420
|
+
|
|
421
|
+
${manifest.explorations.map(exp => `### Exploration: ${exp.angle} (${exp.file})
|
|
422
|
+
Path: ${exp.path}
|
|
423
|
+
|
|
424
|
+
Read this file for detailed ${exp.angle} analysis.`).join('\n\n')}
|
|
425
|
+
|
|
426
|
+
Total explorations: ${manifest.exploration_count}
|
|
427
|
+
Angles covered: ${manifest.explorations.map(e => e.angle).join(', ')}
|
|
428
|
+
|
|
429
|
+
Manifest: ${sessionFolder}/explorations-manifest.json
|
|
430
|
+
|
|
431
|
+
## User Clarifications
|
|
432
|
+
${JSON.stringify(clarificationContext) || "None"}
|
|
433
|
+
|
|
434
|
+
## Complexity Level
|
|
435
|
+
${complexity}
|
|
436
|
+
|
|
437
|
+
## Requirements
|
|
438
|
+
Generate plan.json following the schema obtained above. Key constraints:
|
|
439
|
+
- tasks: 2-7 structured tasks (**group by feature/module, NOT by file**)
|
|
440
|
+
- _metadata.exploration_angles: ${JSON.stringify(manifest.explorations.map(e => e.angle))}
|
|
441
|
+
|
|
442
|
+
## Task Grouping Rules
|
|
443
|
+
1. **Group by feature**: All changes for one feature = one task (even if 3-5 files)
|
|
444
|
+
2. **Group by context**: Tasks with similar context or related functional changes can be grouped together
|
|
445
|
+
3. **Minimize agent count**: Simple, unrelated tasks can also be grouped to reduce agent execution overhead
|
|
446
|
+
4. **Avoid file-per-task**: Do NOT create separate tasks for each file
|
|
447
|
+
5. **Substantial tasks**: Each task should represent 15-60 minutes of work
|
|
448
|
+
6. **True dependencies only**: Only use depends_on when Task B cannot start without Task A's output
|
|
449
|
+
7. **Prefer parallel**: Most tasks should be independent (no depends_on)
|
|
450
|
+
|
|
451
|
+
## Execution
|
|
452
|
+
1. Read schema file (cat command above)
|
|
453
|
+
2. Execute CLI planning using Gemini (Qwen fallback)
|
|
454
|
+
3. Read ALL exploration files for comprehensive context
|
|
455
|
+
4. Synthesize findings and generate plan following schema
|
|
456
|
+
5. Write JSON: Write('${sessionFolder}/plan.json', jsonContent)
|
|
457
|
+
6. Return brief completion summary
|
|
458
|
+
`
|
|
459
|
+
)
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**Output**: `${sessionFolder}/plan.json`
|
|
463
|
+
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
### Phase 4: Task Confirmation & Execution Selection
|
|
467
|
+
|
|
468
|
+
**Step 4.1: Display Plan**
|
|
469
|
+
```javascript
|
|
470
|
+
const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))
|
|
471
|
+
|
|
472
|
+
console.log(`
|
|
473
|
+
## Implementation Plan
|
|
474
|
+
|
|
475
|
+
**Summary**: ${plan.summary}
|
|
476
|
+
**Approach**: ${plan.approach}
|
|
477
|
+
|
|
478
|
+
**Tasks** (${plan.tasks.length}):
|
|
479
|
+
${plan.tasks.map((t, i) => `${i+1}. ${t.title} (${t.file})`).join('\n')}
|
|
480
|
+
|
|
481
|
+
**Complexity**: ${plan.complexity}
|
|
482
|
+
**Estimated Time**: ${plan.estimated_time}
|
|
483
|
+
**Recommended**: ${plan.recommended_execution}
|
|
484
|
+
`)
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
**Step 4.2: Collect Confirmation**
|
|
488
|
+
```javascript
|
|
489
|
+
AskUserQuestion({
|
|
490
|
+
questions: [
|
|
491
|
+
{
|
|
492
|
+
question: `Confirm plan? (${plan.tasks.length} tasks, ${plan.complexity})`,
|
|
493
|
+
header: "Confirm",
|
|
494
|
+
multiSelect: true,
|
|
495
|
+
options: [
|
|
496
|
+
{ label: "Allow", description: "Proceed as-is" },
|
|
497
|
+
{ label: "Modify", description: "Adjust before execution" },
|
|
498
|
+
{ label: "Cancel", description: "Abort workflow" }
|
|
499
|
+
]
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
question: "Execution method:",
|
|
503
|
+
header: "Execution",
|
|
504
|
+
multiSelect: false,
|
|
505
|
+
options: [
|
|
506
|
+
{ label: "Agent", description: "@code-developer agent" },
|
|
507
|
+
{ label: "Codex", description: "codex CLI tool" },
|
|
508
|
+
{ label: "Auto", description: `Auto: ${plan.complexity === 'Low' ? 'Agent' : 'Codex'}` }
|
|
509
|
+
]
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
question: "Code review after execution?",
|
|
513
|
+
header: "Review",
|
|
514
|
+
multiSelect: false,
|
|
515
|
+
options: [
|
|
516
|
+
{ label: "Gemini Review", description: "Gemini CLI" },
|
|
517
|
+
{ label: "Agent Review", description: "@code-reviewer" },
|
|
518
|
+
{ label: "Skip", description: "No review" }
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
]
|
|
522
|
+
})
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
---
|
|
526
|
+
|
|
527
|
+
### Phase 5: Dispatch to Execution
|
|
528
|
+
|
|
529
|
+
**CRITICAL**: lite-plan NEVER executes code directly. ALL execution MUST go through lite-execute.
|
|
530
|
+
|
|
531
|
+
**Step 5.1: Build executionContext**
|
|
532
|
+
|
|
533
|
+
```javascript
|
|
534
|
+
// Load manifest and all exploration files
|
|
535
|
+
const manifest = JSON.parse(Read(`${sessionFolder}/explorations-manifest.json`))
|
|
536
|
+
const explorations = {}
|
|
537
|
+
|
|
538
|
+
manifest.explorations.forEach(exp => {
|
|
539
|
+
if (file_exists(exp.path)) {
|
|
540
|
+
explorations[exp.angle] = JSON.parse(Read(exp.path))
|
|
541
|
+
}
|
|
542
|
+
})
|
|
543
|
+
|
|
544
|
+
const plan = JSON.parse(Read(`${sessionFolder}/plan.json`))
|
|
545
|
+
|
|
546
|
+
executionContext = {
|
|
547
|
+
planObject: plan,
|
|
548
|
+
explorationsContext: explorations,
|
|
549
|
+
explorationAngles: manifest.explorations.map(e => e.angle),
|
|
550
|
+
explorationManifest: manifest,
|
|
551
|
+
clarificationContext: clarificationContext || null,
|
|
552
|
+
executionMethod: userSelection.execution_method, // 全局默认,可被 executorAssignments 覆盖
|
|
553
|
+
codeReviewTool: userSelection.code_review_tool,
|
|
554
|
+
originalUserInput: task_description,
|
|
555
|
+
|
|
556
|
+
// 任务级 executor 分配(优先于全局 executionMethod)
|
|
557
|
+
executorAssignments: executorAssignments, // { taskId: { executor, reason } }
|
|
558
|
+
|
|
559
|
+
session: {
|
|
560
|
+
id: sessionId,
|
|
561
|
+
folder: sessionFolder,
|
|
562
|
+
artifacts: {
|
|
563
|
+
explorations: manifest.explorations.map(exp => ({
|
|
564
|
+
angle: exp.angle,
|
|
565
|
+
path: exp.path
|
|
566
|
+
})),
|
|
567
|
+
explorations_manifest: `${sessionFolder}/explorations-manifest.json`,
|
|
568
|
+
plan: `${sessionFolder}/plan.json`
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
**Step 5.2: Dispatch**
|
|
575
|
+
|
|
576
|
+
```javascript
|
|
577
|
+
SlashCommand(command="/workflow:lite-execute --in-memory")
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
## Session Folder Structure
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
.workflow/.lite-plan/{task-slug}-{YYYY-MM-DD}/
|
|
584
|
+
├── exploration-{angle1}.json # Exploration angle 1
|
|
585
|
+
├── exploration-{angle2}.json # Exploration angle 2
|
|
586
|
+
├── exploration-{angle3}.json # Exploration angle 3 (if applicable)
|
|
587
|
+
├── exploration-{angle4}.json # Exploration angle 4 (if applicable)
|
|
588
|
+
├── explorations-manifest.json # Exploration index
|
|
589
|
+
└── plan.json # Implementation plan
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
**Example**:
|
|
593
|
+
```
|
|
594
|
+
.workflow/.lite-plan/implement-jwt-refresh-2025-11-25-14-30-25/
|
|
595
|
+
├── exploration-architecture.json
|
|
596
|
+
├── exploration-auth-patterns.json
|
|
597
|
+
├── exploration-security.json
|
|
598
|
+
├── explorations-manifest.json
|
|
599
|
+
└── plan.json
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
## Error Handling
|
|
603
|
+
|
|
604
|
+
| Error | Resolution |
|
|
605
|
+
|-------|------------|
|
|
606
|
+
| Exploration agent failure | Skip exploration, continue with task description only |
|
|
607
|
+
| Planning agent failure | Fallback to direct planning by Claude |
|
|
608
|
+
| Clarification timeout | Use exploration findings as-is |
|
|
609
|
+
| Confirmation timeout | Save context, display resume instructions |
|
|
610
|
+
| Modify loop > 3 times | Suggest breaking task or using /workflow:plan |
|