claude-code-workflow 6.3.48 → 6.3.49

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.
Files changed (211) hide show
  1. package/.claude/CLAUDE.md +6 -8
  2. package/.claude/agents/action-planning-agent.md +28 -45
  3. package/.claude/agents/cli-lite-planning-agent.md +93 -1
  4. package/.claude/agents/code-developer.md +144 -27
  5. package/.claude/commands/ccw-coordinator.md +175 -21
  6. package/.claude/commands/ccw-debug.md +832 -0
  7. package/.claude/commands/ccw.md +90 -9
  8. package/.claude/commands/cli/cli-init.md +1 -0
  9. package/.claude/commands/issue/convert-to-plan.md +718 -0
  10. package/.claude/commands/issue/from-brainstorm.md +382 -0
  11. package/.claude/commands/memory/tips.md +332 -0
  12. package/.claude/commands/workflow/analyze-with-file.md +804 -0
  13. package/.claude/commands/workflow/brainstorm/auto-parallel.md +18 -43
  14. package/.claude/commands/workflow/brainstorm/role-analysis.md +705 -0
  15. package/.claude/commands/workflow/brainstorm-with-file.md +1153 -0
  16. package/.claude/commands/workflow/debug-with-file.md +7 -5
  17. package/.claude/commands/workflow/execute.md +6 -4
  18. package/.claude/commands/workflow/lite-plan.md +2 -2
  19. package/.claude/commands/workflow/plan-verify.md +162 -327
  20. package/.claude/commands/workflow/plan.md +162 -26
  21. package/.claude/commands/workflow/replan.md +78 -2
  22. package/.claude/commands/workflow/{review-fix.md → review-cycle-fix.md} +6 -6
  23. package/.claude/commands/workflow/review-module-cycle.md +2 -2
  24. package/.claude/commands/workflow/review-session-cycle.md +2 -2
  25. package/.claude/commands/workflow/tools/conflict-resolution.md +16 -26
  26. package/.claude/commands/workflow/tools/context-gather.md +81 -118
  27. package/.claude/commands/workflow/tools/task-generate-agent.md +94 -10
  28. package/.claude/skills/ccw-help/command.json +4 -4
  29. package/.claude/skills/lite-skill-generator/SKILL.md +650 -0
  30. package/.claude/skills/lite-skill-generator/templates/simple-skill.md +68 -0
  31. package/.claude/skills/lite-skill-generator/templates/style-guide.md +64 -0
  32. package/.claude/skills/skill-generator/SKILL.md +277 -85
  33. package/.claude/skills/skill-generator/phases/01-requirements-discovery.md +4 -15
  34. package/.claude/skills/skill-generator/phases/02-structure-generation.md +72 -17
  35. package/.claude/skills/skill-generator/phases/03-phase-generation.md +218 -51
  36. package/.claude/skills/skill-generator/phases/04-specs-templates.md +111 -41
  37. package/.claude/skills/skill-generator/phases/05-validation.md +139 -56
  38. package/.claude/skills/skill-generator/templates/autonomous-action.md +78 -268
  39. package/.claude/skills/skill-generator/templates/autonomous-orchestrator.md +14 -0
  40. package/.claude/skills/skill-generator/templates/code-analysis-action.md +12 -0
  41. package/.claude/skills/skill-generator/templates/llm-action.md +12 -0
  42. package/.claude/skills/skill-generator/templates/script-template.md +368 -0
  43. package/.claude/skills/skill-generator/templates/sequential-phase.md +14 -0
  44. package/.claude/skills/skill-generator/templates/skill-md.md +14 -0
  45. package/.claude/skills/skill-tuning/SKILL.md +130 -266
  46. package/.claude/skills/skill-tuning/phases/orchestrator.md +95 -283
  47. package/.claude/skills/skill-tuning/specs/problem-taxonomy.md +90 -198
  48. package/.claude/skills/skill-tuning/specs/tuning-strategies.md +193 -1345
  49. package/.claude/workflows/cli-templates/schemas/plan-verify-agent-schema.json +47 -0
  50. package/.claude/workflows/cli-templates/schemas/verify-json-schema.json +158 -0
  51. package/.claude/workflows/cli-tools-usage.md +1 -1
  52. package/.codex/AGENTS.md +1 -3
  53. package/.codex/prompts/analyze-with-file.md +607 -0
  54. package/.codex/prompts/brainstorm-to-cycle.md +455 -0
  55. package/.codex/prompts/brainstorm-with-file.md +933 -0
  56. package/.codex/prompts/debug-with-file.md +15 -20
  57. package/.codex/skills/ccw-cli-tools/SKILL.md +559 -0
  58. package/ccw/dist/commands/cli.d.ts.map +1 -1
  59. package/ccw/dist/commands/cli.js +29 -5
  60. package/ccw/dist/commands/cli.js.map +1 -1
  61. package/ccw/dist/commands/issue.d.ts +2 -0
  62. package/ccw/dist/commands/issue.d.ts.map +1 -1
  63. package/ccw/dist/commands/issue.js +62 -20
  64. package/ccw/dist/commands/issue.js.map +1 -1
  65. package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
  66. package/ccw/dist/config/litellm-api-config-manager.js +5 -3
  67. package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
  68. package/ccw/dist/config/litellm-provider-models.d.ts +73 -0
  69. package/ccw/dist/config/litellm-provider-models.d.ts.map +1 -0
  70. package/ccw/dist/config/litellm-provider-models.js +172 -0
  71. package/ccw/dist/config/litellm-provider-models.js.map +1 -0
  72. package/ccw/dist/config/provider-models.d.ts +25 -51
  73. package/ccw/dist/config/provider-models.d.ts.map +1 -1
  74. package/ccw/dist/config/provider-models.js +84 -149
  75. package/ccw/dist/config/provider-models.js.map +1 -1
  76. package/ccw/dist/config/storage-paths.d.ts.map +1 -1
  77. package/ccw/dist/config/storage-paths.js +23 -5
  78. package/ccw/dist/config/storage-paths.js.map +1 -1
  79. package/ccw/dist/core/auth/csrf-middleware.js +3 -3
  80. package/ccw/dist/core/auth/csrf-middleware.js.map +1 -1
  81. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
  82. package/ccw/dist/core/dashboard-generator.js +3 -1
  83. package/ccw/dist/core/dashboard-generator.js.map +1 -1
  84. package/ccw/dist/core/routes/claude-routes.d.ts.map +1 -1
  85. package/ccw/dist/core/routes/claude-routes.js +206 -14
  86. package/ccw/dist/core/routes/claude-routes.js.map +1 -1
  87. package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
  88. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  89. package/ccw/dist/core/routes/commands-routes.d.ts +7 -0
  90. package/ccw/dist/core/routes/commands-routes.d.ts.map +1 -0
  91. package/ccw/dist/core/routes/commands-routes.js +480 -0
  92. package/ccw/dist/core/routes/commands-routes.js.map +1 -0
  93. package/ccw/dist/core/routes/model-routes.d.ts +11 -0
  94. package/ccw/dist/core/routes/model-routes.d.ts.map +1 -0
  95. package/ccw/dist/core/routes/model-routes.js +112 -0
  96. package/ccw/dist/core/routes/model-routes.js.map +1 -0
  97. package/ccw/dist/core/routes/nav-status-routes.d.ts.map +1 -1
  98. package/ccw/dist/core/routes/nav-status-routes.js +84 -1
  99. package/ccw/dist/core/routes/nav-status-routes.js.map +1 -1
  100. package/ccw/dist/core/routes/provider-routes.d.ts +11 -0
  101. package/ccw/dist/core/routes/provider-routes.d.ts.map +1 -0
  102. package/ccw/dist/core/routes/provider-routes.js +67 -0
  103. package/ccw/dist/core/routes/provider-routes.js.map +1 -0
  104. package/ccw/dist/core/routes/skills-routes.d.ts.map +1 -1
  105. package/ccw/dist/core/routes/skills-routes.js +219 -7
  106. package/ccw/dist/core/routes/skills-routes.js.map +1 -1
  107. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  108. package/ccw/dist/core/routes/system-routes.js +58 -6
  109. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  110. package/ccw/dist/core/server.d.ts.map +1 -1
  111. package/ccw/dist/core/server.js +13 -0
  112. package/ccw/dist/core/server.js.map +1 -1
  113. package/ccw/dist/mcp-server/index.js +2 -2
  114. package/ccw/dist/mcp-server/index.js.map +1 -1
  115. package/ccw/dist/tools/claude-cli-tools.d.ts +48 -11
  116. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  117. package/ccw/dist/tools/claude-cli-tools.js +146 -50
  118. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  119. package/ccw/dist/tools/cli-config-manager.d.ts +1 -13
  120. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  121. package/ccw/dist/tools/cli-config-manager.js +3 -27
  122. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  123. package/ccw/dist/tools/cli-executor-core.d.ts.map +1 -1
  124. package/ccw/dist/tools/cli-executor-core.js +7 -2
  125. package/ccw/dist/tools/cli-executor-core.js.map +1 -1
  126. package/ccw/dist/tools/cli-executor-state.d.ts.map +1 -1
  127. package/ccw/dist/tools/cli-history-store.d.ts +11 -0
  128. package/ccw/dist/tools/cli-history-store.d.ts.map +1 -1
  129. package/ccw/dist/tools/cli-history-store.js +82 -2
  130. package/ccw/dist/tools/cli-history-store.js.map +1 -1
  131. package/ccw/dist/tools/command-registry.d.ts +7 -0
  132. package/ccw/dist/tools/command-registry.d.ts.map +1 -1
  133. package/ccw/dist/tools/command-registry.js +14 -1
  134. package/ccw/dist/tools/command-registry.js.map +1 -1
  135. package/ccw/dist/tools/generate-module-docs.d.ts.map +1 -1
  136. package/ccw/dist/tools/generate-module-docs.js +11 -7
  137. package/ccw/dist/tools/generate-module-docs.js.map +1 -1
  138. package/ccw/dist/tools/litellm-executor.d.ts +1 -0
  139. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  140. package/ccw/dist/tools/litellm-executor.js +11 -9
  141. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  142. package/ccw/dist/types/skill-types.d.ts +97 -0
  143. package/ccw/dist/types/skill-types.d.ts.map +1 -0
  144. package/ccw/dist/types/skill-types.js +6 -0
  145. package/ccw/dist/types/skill-types.js.map +1 -0
  146. package/ccw/src/commands/cli.ts +36 -5
  147. package/ccw/src/commands/issue.ts +81 -26
  148. package/ccw/src/config/litellm-api-config-manager.ts +5 -3
  149. package/ccw/src/config/litellm-provider-models.ts +222 -0
  150. package/ccw/src/config/provider-models.ts +91 -190
  151. package/ccw/src/config/storage-paths.ts +20 -5
  152. package/ccw/src/core/auth/csrf-middleware.ts +3 -3
  153. package/ccw/src/core/dashboard-generator.ts +3 -1
  154. package/ccw/src/core/routes/claude-routes.ts +233 -15
  155. package/ccw/src/core/routes/cli-routes.ts +2 -3
  156. package/ccw/src/core/routes/commands-routes.ts +620 -0
  157. package/ccw/src/core/routes/nav-status-routes.ts +95 -1
  158. package/ccw/src/core/routes/provider-routes.ts +78 -0
  159. package/ccw/src/core/routes/skills-routes.ts +266 -45
  160. package/ccw/src/core/routes/system-routes.ts +102 -50
  161. package/ccw/src/core/server.ts +13 -0
  162. package/ccw/src/mcp-server/index.ts +2 -2
  163. package/ccw/src/templates/dashboard-css/18-cli-settings.css +35 -0
  164. package/ccw/src/templates/dashboard-css/37-commands.css +193 -0
  165. package/ccw/src/templates/dashboard-js/components/navigation.js +4 -0
  166. package/ccw/src/templates/dashboard-js/i18n.js +116 -0
  167. package/ccw/src/templates/dashboard-js/views/cli-manager.js +249 -4
  168. package/ccw/src/templates/dashboard-js/views/commands-manager.js +503 -0
  169. package/ccw/src/templates/dashboard-js/views/issue-manager.js +7 -7
  170. package/ccw/src/templates/dashboard-js/views/mcp-manager.js +2 -7
  171. package/ccw/src/templates/dashboard-js/views/skills-manager.js +164 -23
  172. package/ccw/src/templates/dashboard.html +7 -0
  173. package/ccw/src/tools/claude-cli-tools.ts +170 -56
  174. package/ccw/src/tools/cli-config-manager.ts +2 -33
  175. package/ccw/src/tools/cli-executor-core.ts +8 -2
  176. package/ccw/src/tools/cli-history-store.ts +92 -2
  177. package/ccw/src/tools/command-registry.ts +16 -1
  178. package/ccw/src/tools/generate-module-docs.ts +11 -7
  179. package/ccw/src/tools/litellm-executor.ts +13 -9
  180. package/ccw/src/types/skill-types.ts +99 -0
  181. package/package.json +1 -1
  182. package/.claude/commands/enhance-prompt.md +0 -93
  183. package/.claude/commands/memory/code-map-memory.md +0 -687
  184. package/.claude/commands/memory/docs.md +0 -615
  185. package/.claude/commands/memory/load-skill-memory.md +0 -182
  186. package/.claude/commands/memory/skill-memory.md +0 -525
  187. package/.claude/commands/memory/swagger-docs.md +0 -773
  188. package/.claude/commands/memory/tech-research-rules.md +0 -310
  189. package/.claude/commands/memory/workflow-skill-memory.md +0 -517
  190. package/.claude/commands/task/breakdown.md +0 -208
  191. package/.claude/commands/task/create.md +0 -152
  192. package/.claude/commands/task/execute.md +0 -270
  193. package/.claude/commands/task/replan.md +0 -441
  194. package/.claude/commands/version.md +0 -254
  195. package/.claude/commands/workflow/action-plan-verify.md +0 -485
  196. package/.claude/commands/workflow/brainstorm/api-designer.md +0 -587
  197. package/.claude/commands/workflow/brainstorm/data-architect.md +0 -220
  198. package/.claude/commands/workflow/brainstorm/product-manager.md +0 -200
  199. package/.claude/commands/workflow/brainstorm/product-owner.md +0 -200
  200. package/.claude/commands/workflow/brainstorm/scrum-master.md +0 -200
  201. package/.claude/commands/workflow/brainstorm/subject-matter-expert.md +0 -200
  202. package/.claude/commands/workflow/brainstorm/system-architect.md +0 -389
  203. package/.claude/commands/workflow/brainstorm/ui-designer.md +0 -221
  204. package/.claude/commands/workflow/brainstorm/ux-expert.md +0 -221
  205. package/.claude/commands/workflow/debug.md +0 -331
  206. package/.claude/commands/workflow/develop-with-file.md +0 -1044
  207. package/.claude/skills/ccw-loop/README.md +0 -303
  208. package/.claude/skills/skill-generator/templates/script-bash.md +0 -277
  209. package/.claude/skills/skill-generator/templates/script-python.md +0 -198
  210. package/.codex/prompts/debug.md +0 -318
  211. package/ccw/src/core/routes/mcp-routes.ts.backup +0 -549
@@ -11,8 +11,6 @@ import {
11
11
  saveClaudeCliTools,
12
12
  getToolConfig as getToolConfigFromClaude,
13
13
  updateToolConfig as updateToolConfigFromClaude,
14
- getPredefinedModels as getPredefinedModelsFromClaude,
15
- getAllPredefinedModels,
16
14
  getPrimaryModel as getPrimaryModelFromClaude,
17
15
  getSecondaryModel as getSecondaryModelFromClaude,
18
16
  isToolEnabled as isToolEnabledFromClaude,
@@ -39,27 +37,6 @@ export interface CliConfig {
39
37
 
40
38
  export type { CliToolName };
41
39
 
42
- // ========== Re-exported Constants ==========
43
-
44
- /**
45
- * @deprecated Use getPredefinedModels() or getAllPredefinedModels() instead
46
- */
47
- export const PREDEFINED_MODELS = getAllPredefinedModels();
48
-
49
- /**
50
- * @deprecated Default config is now managed in claude-cli-tools.ts
51
- */
52
- export const DEFAULT_CONFIG: CliConfig = {
53
- version: 1,
54
- tools: {
55
- gemini: { enabled: true, primaryModel: 'gemini-2.5-pro', secondaryModel: 'gemini-2.5-flash' },
56
- qwen: { enabled: true, primaryModel: 'coder-model', secondaryModel: 'coder-model' },
57
- codex: { enabled: true, primaryModel: 'gpt-5.2', secondaryModel: 'gpt-5.2' },
58
- claude: { enabled: true, primaryModel: 'sonnet', secondaryModel: 'haiku' },
59
- opencode: { enabled: true, primaryModel: 'opencode/glm-4.7-free', secondaryModel: 'opencode/glm-4.7-free' }
60
- }
61
- };
62
-
63
40
  // ========== Re-exported Functions ==========
64
41
 
65
42
  /**
@@ -162,19 +139,12 @@ export function getSecondaryModel(baseDir: string, tool: string): string {
162
139
  return getSecondaryModelFromClaude(baseDir, tool);
163
140
  }
164
141
 
165
- /**
166
- * Get all predefined models for a tool
167
- */
168
- export function getPredefinedModels(tool: string): string[] {
169
- return getPredefinedModelsFromClaude(tool);
170
- }
171
-
172
142
  /**
173
143
  * Get full config response for API
144
+ * Note: Provider model reference has been moved to system reference (see provider-routes.ts)
174
145
  */
175
146
  export function getFullConfigResponse(baseDir: string): {
176
147
  config: CliConfig;
177
- predefinedModels: Record<string, string[]>;
178
148
  } {
179
149
  const response = getFullConfigResponseFromClaude(baseDir);
180
150
 
@@ -194,7 +164,6 @@ export function getFullConfigResponse(baseDir: string): {
194
164
  config: {
195
165
  version: parseFloat(response.config.version) || 1,
196
166
  tools
197
- },
198
- predefinedModels: response.predefinedModels
167
+ }
199
168
  };
200
169
  }
@@ -557,6 +557,11 @@ async function executeCliTool(
557
557
  // id field is the LiteLLM endpoint ID (e.g., "g25")
558
558
  const litellmEndpointId = toolConfig.id || toolName;
559
559
 
560
+ // Use configured primary model if no explicit model provided
561
+ // This allows --model parameter to override the tool's primaryModel
562
+ // Use undefined if primaryModel is empty string (endpoint.model will be used as fallback)
563
+ const apiEndpointEffectiveModel = model || (toolConfig.primaryModel || undefined);
564
+
560
565
  // Find LiteLLM endpoint configuration
561
566
  const litellmEndpoint = findEndpointById(workingDir, litellmEndpointId);
562
567
  if (litellmEndpoint) {
@@ -568,13 +573,14 @@ async function executeCliTool(
568
573
  });
569
574
  }
570
575
 
571
- // Execute via LiteLLM
576
+ // Execute via LiteLLM with model override
572
577
  const result = await executeLiteLLMEndpoint({
573
578
  prompt,
574
579
  endpointId: litellmEndpointId,
575
580
  baseDir: workingDir,
576
581
  cwd: cd || workingDir,
577
582
  includeDirs: includeDirs ? includeDirs.split(',').map(d => d.trim()) : undefined,
583
+ model: apiEndpointEffectiveModel, // Pass effective model (--model or primaryModel)
578
584
  onOutput: onOutput || undefined,
579
585
  });
580
586
 
@@ -587,7 +593,7 @@ async function executeCliTool(
587
593
  id: customId || `${Date.now()}-litellm`,
588
594
  timestamp: new Date(startTime).toISOString(),
589
595
  tool: toolName,
590
- model: litellmEndpoint.model,
596
+ model: result.model, // Use effective model from result (reflects any override)
591
597
  mode,
592
598
  prompt,
593
599
  status: result.success ? 'success' : 'error',
@@ -5,9 +5,9 @@
5
5
 
6
6
  import Database from 'better-sqlite3';
7
7
  import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, unlinkSync, rmdirSync } from 'fs';
8
- import { join } from 'path';
8
+ import { join, dirname, resolve } from 'path';
9
9
  import { parseSessionFile, formatConversation, extractConversationPairs, type ParsedSession, type ParsedTurn } from './session-content-parser.js';
10
- import { StoragePaths, ensureStorageDir, getProjectId } from '../config/storage-paths.js';
10
+ import { StoragePaths, ensureStorageDir, getProjectId, getCCWHome } from '../config/storage-paths.js';
11
11
  import type { CliOutputUnit } from './cli-output-converter.js';
12
12
 
13
13
  // Types
@@ -1404,5 +1404,95 @@ export function closeAllStores(): void {
1404
1404
  storeCache.clear();
1405
1405
  }
1406
1406
 
1407
+ /**
1408
+ * Find project path that contains the given execution
1409
+ * Searches upward through parent directories and all registered projects
1410
+ * @param conversationId - Execution ID to search for
1411
+ * @param startDir - Starting directory (default: process.cwd())
1412
+ * @returns Object with projectPath and projectId if found, null otherwise
1413
+ */
1414
+ export function findProjectWithExecution(
1415
+ conversationId: string,
1416
+ startDir: string = process.cwd()
1417
+ ): { projectPath: string; projectId: string } | null {
1418
+ // Strategy 1: Search upward in parent directories
1419
+ let currentPath = resolve(startDir);
1420
+ const visited = new Set<string>();
1421
+
1422
+ while (true) {
1423
+ // Avoid infinite loops
1424
+ if (visited.has(currentPath)) break;
1425
+ visited.add(currentPath);
1426
+
1427
+ const projectId = getProjectId(currentPath);
1428
+ const paths = StoragePaths.project(currentPath);
1429
+
1430
+ // Check if database exists for this path
1431
+ if (existsSync(paths.historyDb)) {
1432
+ try {
1433
+ const store = getHistoryStore(currentPath);
1434
+ const result = store.getCachedOutput(conversationId);
1435
+ if (result) {
1436
+ return { projectPath: currentPath, projectId };
1437
+ }
1438
+ } catch {
1439
+ // Database might be locked or corrupted, continue searching
1440
+ }
1441
+ }
1442
+
1443
+ // Move to parent directory
1444
+ const parentPath = dirname(currentPath);
1445
+ if (parentPath === currentPath) {
1446
+ // Reached filesystem root
1447
+ break;
1448
+ }
1449
+ currentPath = parentPath;
1450
+ }
1451
+
1452
+ // Strategy 2: Search in all registered projects (global search)
1453
+ // This covers cases where execution might be in a completely different project tree
1454
+ const projectsDir = join(getCCWHome(), 'projects');
1455
+ if (existsSync(projectsDir)) {
1456
+ try {
1457
+ const entries = readdirSync(projectsDir, { withFileTypes: true });
1458
+
1459
+ for (const entry of entries) {
1460
+ if (!entry.isDirectory()) continue;
1461
+
1462
+ const projectId = entry.name;
1463
+ const historyDb = join(projectsDir, projectId, 'cli-history', 'history.db');
1464
+
1465
+ if (!existsSync(historyDb)) continue;
1466
+
1467
+ try {
1468
+ // Open and query this database directly
1469
+ const db = new Database(historyDb, { readonly: true });
1470
+ const turn = db.prepare(`
1471
+ SELECT * FROM turns
1472
+ WHERE conversation_id = ?
1473
+ ORDER BY turn_number DESC
1474
+ LIMIT 1
1475
+ `).get(conversationId);
1476
+
1477
+ db.close();
1478
+
1479
+ if (turn) {
1480
+ // Found in this project - return the projectId
1481
+ // Note: projectPath is set to projectId since we don't have the original path stored
1482
+ return { projectPath: projectId, projectId };
1483
+ }
1484
+ } catch {
1485
+ // Skip this database (might be corrupted or locked)
1486
+ continue;
1487
+ }
1488
+ }
1489
+ } catch {
1490
+ // Failed to read projects directory
1491
+ }
1492
+ }
1493
+
1494
+ return null;
1495
+ }
1496
+
1407
1497
  // Re-export types from session-content-parser
1408
1498
  export type { ParsedSession, ParsedTurn } from './session-content-parser.js';
@@ -19,6 +19,7 @@ export interface CommandMetadata {
19
19
  argumentHint: string;
20
20
  allowedTools: string[];
21
21
  filePath: string;
22
+ group?: string;
22
23
  }
23
24
 
24
25
  export interface CommandSummary {
@@ -103,6 +104,7 @@ export class CommandRegistry {
103
104
  .join(','); // Keep as comma-separated for now, will convert in getCommand
104
105
  }
105
106
 
107
+ // Note: 'group' field is automatically extracted like other fields
106
108
  result[key] = cleanValue;
107
109
  }
108
110
  } catch (error) {
@@ -159,7 +161,8 @@ export class CommandRegistry {
159
161
  description: header.description || '',
160
162
  argumentHint: header['argument-hint'] || '',
161
163
  allowedTools: allowedTools,
162
- filePath: filePath
164
+ filePath: filePath,
165
+ group: header.group || undefined
163
166
  };
164
167
 
165
168
  // Cache result
@@ -207,6 +210,9 @@ export class CommandRegistry {
207
210
  const files = readdirSync(this.commandDir);
208
211
 
209
212
  for (const file of files) {
213
+ // Skip _disabled directory
214
+ if (file === '_disabled') continue;
215
+
210
216
  if (!file.endsWith('.md')) continue;
211
217
 
212
218
  const filePath = join(this.commandDir, file);
@@ -282,6 +288,15 @@ export class CommandRegistry {
282
288
  }
283
289
  return result;
284
290
  }
291
+
292
+ /**
293
+ * Clear the command cache
294
+ * Use this to invalidate cached commands after enable/disable operations
295
+ * @returns void
296
+ */
297
+ public clearCache(): void {
298
+ this.cache.clear();
299
+ }
285
300
  }
286
301
 
287
302
  /**
@@ -280,11 +280,12 @@ export async function handler(params: Record<string, unknown>): Promise<ToolResu
280
280
  // Scan directory
281
281
  const { info: structureInfo, folderType } = scanDirectoryStructure(targetPath);
282
282
 
283
- // Calculate output path
283
+ // Calculate output path (relative for display, absolute for CLI prompt)
284
284
  const outputPath = calculateOutputPath(targetPath, projectName, process.cwd());
285
+ const absOutputPath = resolve(process.cwd(), outputPath);
285
286
 
286
287
  // Ensure output directory exists
287
- mkdirSync(outputPath, { recursive: true });
288
+ mkdirSync(absOutputPath, { recursive: true });
288
289
 
289
290
  // Build prompt based on strategy
290
291
  let prompt: string;
@@ -304,7 +305,7 @@ Generate documentation files:
304
305
  - API.md: Code API documentation
305
306
  - README.md: Module overview and usage
306
307
 
307
- Output directory: ${outputPath}
308
+ Output directory: ${absOutputPath}
308
309
 
309
310
  Template Guidelines:
310
311
  ${templateContent}`;
@@ -318,7 +319,7 @@ Read: @*/API.md @*/README.md
318
319
  Generate documentation file:
319
320
  - README.md: Navigation overview of subdirectories
320
321
 
321
- Output directory: ${outputPath}
322
+ Output directory: ${absOutputPath}
322
323
 
323
324
  Template Guidelines:
324
325
  ${templateContent}`;
@@ -327,12 +328,13 @@ ${templateContent}`;
327
328
 
328
329
  case 'project-readme':
329
330
  templateContent = loadTemplate('project-readme');
331
+ const projectDocsDir = resolve(process.cwd(), '.workflow', 'docs', projectName);
330
332
  prompt = `Read all module documentation:
331
333
  @.workflow/docs/${projectName}/**/API.md
332
334
  @.workflow/docs/${projectName}/**/README.md
333
335
 
334
336
  Generate project-level documentation:
335
- - README.md in .workflow/docs/${projectName}/
337
+ - README.md in ${projectDocsDir}/
336
338
 
337
339
  Template Guidelines:
338
340
  ${templateContent}`;
@@ -340,6 +342,7 @@ ${templateContent}`;
340
342
 
341
343
  case 'project-architecture':
342
344
  templateContent = loadTemplate('project-architecture');
345
+ const projectArchDir = resolve(process.cwd(), '.workflow', 'docs', projectName);
343
346
  prompt = `Read project documentation:
344
347
  @.workflow/docs/${projectName}/README.md
345
348
  @.workflow/docs/${projectName}/**/API.md
@@ -348,13 +351,14 @@ Generate:
348
351
  - ARCHITECTURE.md: System design documentation
349
352
  - EXAMPLES.md: Usage examples
350
353
 
351
- Output directory: .workflow/docs/${projectName}/
354
+ Output directory: ${projectArchDir}/
352
355
 
353
356
  Template Guidelines:
354
357
  ${templateContent}`;
355
358
  break;
356
359
 
357
360
  case 'http-api':
361
+ const apiDocsDir = resolve(process.cwd(), '.workflow', 'docs', projectName, 'api');
358
362
  prompt = `Read API route files:
359
363
  @**/routes/**/*.ts @**/routes/**/*.js
360
364
  @**/api/**/*.ts @**/api/**/*.js
@@ -362,7 +366,7 @@ ${templateContent}`;
362
366
  Generate HTTP API documentation:
363
367
  - api/README.md: REST API endpoints documentation
364
368
 
365
- Output directory: .workflow/docs/${projectName}/api/`;
369
+ Output directory: ${apiDocsDir}/`;
366
370
  break;
367
371
  }
368
372
 
@@ -19,6 +19,7 @@ export interface LiteLLMExecutionOptions {
19
19
  cwd?: string; // Working directory for file resolution
20
20
  includeDirs?: string[]; // Additional directories for @patterns
21
21
  enableCache?: boolean; // Override endpoint cache setting
22
+ model?: string; // Override model for this execution (if not specified, uses endpoint.model)
22
23
  onOutput?: (unit: CliOutputUnit) => void;
23
24
  /** Number of retries after the initial attempt (default: 0) */
24
25
  maxRetries?: number;
@@ -56,7 +57,7 @@ export function extractPatterns(prompt: string): string[] {
56
57
  export async function executeLiteLLMEndpoint(
57
58
  options: LiteLLMExecutionOptions
58
59
  ): Promise<LiteLLMExecutionResult> {
59
- const { prompt, endpointId, baseDir, cwd, includeDirs, enableCache, onOutput } = options;
60
+ const { prompt, endpointId, baseDir, cwd, includeDirs, enableCache, model: modelOverride, onOutput } = options;
60
61
 
61
62
  // 1. Find endpoint configuration
62
63
  const endpoint = findEndpointById(baseDir, endpointId);
@@ -96,7 +97,10 @@ export async function executeLiteLLMEndpoint(
96
97
  };
97
98
  }
98
99
 
99
- // 3. Process context cache if enabled
100
+ // 3. Determine effective model: use override if provided, otherwise use endpoint.model
101
+ const effectiveModel = modelOverride || endpoint.model;
102
+
103
+ // 4. Process context cache if enabled
100
104
  let finalPrompt = prompt;
101
105
  let cacheUsed = false;
102
106
  let cachedFiles: string[] = [];
@@ -168,12 +172,12 @@ export async function executeLiteLLMEndpoint(
168
172
  }
169
173
  }
170
174
 
171
- // 4. Call LiteLLM
175
+ // 5. Call LiteLLM
172
176
  try {
173
177
  if (onOutput) {
174
178
  onOutput({
175
179
  type: 'stderr',
176
- content: `[LiteLLM: Calling ${provider.type}/${endpoint.model}]\n`,
180
+ content: `[LiteLLM: Calling ${provider.type}/${effectiveModel}]\n`,
177
181
  timestamp: new Date().toISOString()
178
182
  });
179
183
  }
@@ -206,14 +210,14 @@ export async function executeLiteLLMEndpoint(
206
210
  delete process.env['CCW_LITELLM_EXTRA_HEADERS'];
207
211
  }
208
212
 
209
- // Use litellm-client to call chat
213
+ // Use litellm-client to call chat with effective model
210
214
  const response = await callWithRetries(
211
- () => client.chat(finalPrompt, endpoint.model),
215
+ () => client.chat(finalPrompt, effectiveModel),
212
216
  {
213
217
  maxRetries: options.maxRetries ?? 0,
214
218
  baseDelayMs: options.retryBaseDelayMs ?? 1000,
215
219
  onOutput,
216
- rateLimitKey: `${provider.type}:${endpoint.model}`,
220
+ rateLimitKey: `${provider.type}:${effectiveModel}`,
217
221
  },
218
222
  );
219
223
 
@@ -228,7 +232,7 @@ export async function executeLiteLLMEndpoint(
228
232
  return {
229
233
  success: true,
230
234
  output: response,
231
- model: endpoint.model,
235
+ model: effectiveModel,
232
236
  provider: provider.type,
233
237
  cacheUsed,
234
238
  cachedFiles,
@@ -246,7 +250,7 @@ export async function executeLiteLLMEndpoint(
246
250
  return {
247
251
  success: false,
248
252
  output: '',
249
- model: endpoint.model,
253
+ model: effectiveModel,
250
254
  provider: provider.type,
251
255
  cacheUsed,
252
256
  error: errorMsg,
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Skill Types Definition
3
+ * Types for skill management including enable/disable functionality
4
+ */
5
+
6
+ /**
7
+ * Skill location type
8
+ */
9
+ export type SkillLocation = 'project' | 'user';
10
+
11
+ /**
12
+ * Result of a skill operation (enable/disable)
13
+ */
14
+ export interface SkillOperationResult {
15
+ success: boolean;
16
+ message?: string;
17
+ skillName?: string;
18
+ location?: SkillLocation;
19
+ status?: number;
20
+ }
21
+
22
+ /**
23
+ * Summary information for an active skill
24
+ */
25
+ export interface SkillSummary {
26
+ /** Skill name from SKILL.md frontmatter */
27
+ name: string;
28
+ /** Folder name (actual directory name) */
29
+ folderName: string;
30
+ /** Skill description */
31
+ description: string;
32
+ /** Skill version if specified */
33
+ version: string | null;
34
+ /** Allowed tools list */
35
+ allowedTools: string[];
36
+ /** Skill location (project or user) */
37
+ location: SkillLocation;
38
+ /** Full path to skill directory */
39
+ path: string;
40
+ /** Supporting files in the skill folder */
41
+ supportingFiles: string[];
42
+ }
43
+
44
+ /**
45
+ * Summary information for a disabled skill
46
+ */
47
+ export interface DisabledSkillSummary extends SkillSummary {
48
+ /** When the skill was disabled */
49
+ disabledAt: string;
50
+ /** Optional reason for disabling */
51
+ reason?: string;
52
+ }
53
+
54
+ /**
55
+ * Skills configuration for active skills only (backward compatible)
56
+ */
57
+ export interface SkillsConfig {
58
+ projectSkills: SkillSummary[];
59
+ userSkills: SkillSummary[];
60
+ }
61
+
62
+ /**
63
+ * Extended skills configuration including disabled skills
64
+ */
65
+ export interface ExtendedSkillsConfig extends SkillsConfig {
66
+ /** Disabled project skills */
67
+ disabledProjectSkills: DisabledSkillSummary[];
68
+ /** Disabled user skills */
69
+ disabledUserSkills: DisabledSkillSummary[];
70
+ }
71
+
72
+ /**
73
+ * Parsed skill frontmatter from SKILL.md
74
+ */
75
+ export interface ParsedSkillFrontmatter {
76
+ name: string;
77
+ description: string;
78
+ version: string | null;
79
+ allowedTools: string[];
80
+ content: string;
81
+ }
82
+
83
+ /**
84
+ * Skill info extracted from validation
85
+ */
86
+ export interface SkillInfo {
87
+ name: string;
88
+ description: string;
89
+ version: string | null;
90
+ allowedTools: string[];
91
+ supportingFiles: string[];
92
+ }
93
+
94
+ /**
95
+ * Skill folder validation result
96
+ */
97
+ export type SkillFolderValidation =
98
+ | { valid: true; errors: string[]; skillInfo: SkillInfo }
99
+ | { valid: false; errors: string[]; skillInfo: null };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-workflow",
3
- "version": "6.3.48",
3
+ "version": "6.3.49",
4
4
  "description": "JSON-driven multi-agent development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution",
5
5
  "type": "module",
6
6
  "main": "ccw/src/index.js",
@@ -1,93 +0,0 @@
1
- ---
2
- name: enhance-prompt
3
- description: Enhanced prompt transformation using session memory and intent analysis with --enhance flag detection
4
- argument-hint: "user input to enhance"
5
- ---
6
-
7
- ## Overview
8
-
9
- Systematically enhances user prompts by leveraging session memory context and intent analysis, translating ambiguous requests into actionable specifications.
10
-
11
- ## Core Protocol
12
-
13
- **Enhancement Pipeline:**
14
- `Intent Translation` → `Context Integration` → `Structured Output`
15
-
16
- **Context Sources:**
17
- - Session memory (conversation history, previous analysis)
18
- - Implicit technical requirements
19
- - User intent patterns
20
-
21
- ## Enhancement Rules
22
-
23
- ### Intent Translation
24
-
25
- | User Says | Translate To | Focus |
26
- |-----------|--------------|-------|
27
- | "fix" | Debug and resolve | Root cause → preserve behavior |
28
- | "improve" | Enhance/optimize | Performance/readability |
29
- | "add" | Implement feature | Integration + edge cases |
30
- | "refactor" | Restructure quality | Maintain behavior |
31
- | "update" | Modernize | Version compatibility |
32
-
33
- ### Context Integration Strategy
34
-
35
- **Session Memory:**
36
- - Reference recent conversation context
37
- - Reuse previously identified patterns
38
- - Build on established understanding
39
- - Infer technical requirements from discussion
40
-
41
- **Example:**
42
- ```bash
43
- # User: "add login"
44
- # Session Memory: Previous auth discussion, JWT mentioned
45
- # Inferred: JWT-based auth, integrate with existing session management
46
- # Action: Implement JWT authentication with session persistence
47
- ```
48
-
49
- ## Output Structure
50
-
51
- ```bash
52
- INTENT: [Clear technical goal]
53
- CONTEXT: [Session memory + codebase patterns]
54
- ACTION: [Specific implementation steps]
55
- ATTENTION: [Critical constraints]
56
- ```
57
-
58
- ### Output Examples
59
-
60
- **Example 1:**
61
- ```bash
62
- # Input: "fix login button"
63
- INTENT: Debug non-functional login button
64
- CONTEXT: From session - OAuth flow discussed, known state issue
65
- ACTION: Check event binding → verify state updates → test auth flow
66
- ATTENTION: Preserve existing OAuth integration
67
- ```
68
-
69
- **Example 2:**
70
- ```bash
71
- # Input: "refactor payment code"
72
- INTENT: Restructure payment module for maintainability
73
- CONTEXT: Session memory - PCI compliance requirements, Stripe integration patterns
74
- ACTION: Extract reusable validators → isolate payment gateway logic → maintain adapter pattern
75
- ATTENTION: Zero behavior change, maintain PCI compliance, full test coverage
76
- ```
77
-
78
- ## Enhancement Triggers
79
-
80
- - Ambiguous language: "fix", "improve", "clean up"
81
- - Vague requests requiring clarification
82
- - Complex technical requirements
83
- - Architecture changes
84
- - Critical systems: auth, payment, security
85
- - Multi-step refactoring
86
-
87
- ## Key Principles
88
-
89
- 1. **Session Memory First**: Leverage conversation context and established understanding
90
- 2. **Context Reuse**: Build on previous discussions and decisions
91
- 3. **Clear Output**: Structured, actionable specifications
92
- 4. **Intent Clarification**: Transform vague requests into specific technical goals
93
- 5. **Avoid Duplication**: Reference existing context, don't repeat