@ias-ai/zhima-spec 1.3.6 → 1.3.8

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 (59) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +206 -206
  3. package/bin/zhima.js +2 -2
  4. package/dist/commands/feedback.js +4 -4
  5. package/dist/commands/schema.js +60 -60
  6. package/dist/core/command-generation/adapters/amazon-q.js +5 -5
  7. package/dist/core/command-generation/adapters/antigravity.js +5 -5
  8. package/dist/core/command-generation/adapters/auggie.js +6 -6
  9. package/dist/core/command-generation/adapters/bob.js +6 -6
  10. package/dist/core/command-generation/adapters/claude.js +8 -8
  11. package/dist/core/command-generation/adapters/cline.js +5 -5
  12. package/dist/core/command-generation/adapters/codebuddy.js +7 -7
  13. package/dist/core/command-generation/adapters/codex.js +6 -6
  14. package/dist/core/command-generation/adapters/continue.js +7 -7
  15. package/dist/core/command-generation/adapters/costrict.js +6 -6
  16. package/dist/core/command-generation/adapters/crush.js +8 -8
  17. package/dist/core/command-generation/adapters/cursor.js +8 -8
  18. package/dist/core/command-generation/adapters/factory.js +6 -6
  19. package/dist/core/command-generation/adapters/gemini.js +5 -5
  20. package/dist/core/command-generation/adapters/github-copilot.js +5 -5
  21. package/dist/core/command-generation/adapters/iflow.js +8 -8
  22. package/dist/core/command-generation/adapters/junie.js +5 -5
  23. package/dist/core/command-generation/adapters/kilocode.js +1 -1
  24. package/dist/core/command-generation/adapters/kiro.js +5 -5
  25. package/dist/core/command-generation/adapters/lingma.js +8 -8
  26. package/dist/core/command-generation/adapters/opencode.js +5 -5
  27. package/dist/core/command-generation/adapters/pi.js +5 -5
  28. package/dist/core/command-generation/adapters/qoder.js +8 -8
  29. package/dist/core/command-generation/adapters/qwen.js +5 -5
  30. package/dist/core/command-generation/adapters/roocode.js +5 -5
  31. package/dist/core/command-generation/adapters/vjsp.d.ts +1 -1
  32. package/dist/core/command-generation/adapters/vjsp.js +8 -8
  33. package/dist/core/command-generation/adapters/windsurf.js +8 -8
  34. package/dist/core/command-generation/registry.js +2 -0
  35. package/dist/core/completions/generators/bash-generator.js +41 -41
  36. package/dist/core/completions/generators/fish-generator.js +7 -7
  37. package/dist/core/completions/generators/powershell-generator.js +29 -29
  38. package/dist/core/completions/generators/zsh-generator.js +33 -33
  39. package/dist/core/completions/templates/bash-templates.js +24 -24
  40. package/dist/core/completions/templates/fish-templates.js +38 -38
  41. package/dist/core/completions/templates/powershell-templates.js +28 -28
  42. package/dist/core/completions/templates/zsh-templates.js +39 -39
  43. package/dist/core/shared/skill-generation.js +12 -12
  44. package/dist/core/templates/workflows/apply-change.js +294 -294
  45. package/dist/core/templates/workflows/archive-change.js +257 -257
  46. package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
  47. package/dist/core/templates/workflows/continue-change.js +214 -214
  48. package/dist/core/templates/workflows/explore.js +439 -439
  49. package/dist/core/templates/workflows/feedback.js +97 -97
  50. package/dist/core/templates/workflows/ff-change.js +180 -180
  51. package/dist/core/templates/workflows/new-change.js +123 -123
  52. package/dist/core/templates/workflows/onboard.js +540 -540
  53. package/dist/core/templates/workflows/propose.js +198 -198
  54. package/dist/core/templates/workflows/sync-specs.js +270 -270
  55. package/dist/core/templates/workflows/verify-change.js +318 -318
  56. package/dist/core/workspace/open-surface.js +11 -11
  57. package/package.json +18 -20
  58. package/schemas/spec-driven/schema.yaml +153 -153
  59. package/schemas/spec-driven/templates/proposal.md +23 -23
@@ -15,12 +15,12 @@ export const auggieAdapter = {
15
15
  return path.join('.augment', 'commands', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: ${content.description}
20
- argument-hint: command arguments
21
- ---
22
-
23
- ${content.body}
18
+ return `---
19
+ description: ${content.description}
20
+ argument-hint: command arguments
21
+ ---
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -33,12 +33,12 @@ export const bobAdapter = {
33
33
  formatFile(content) {
34
34
  // Transform command references from colon to hyphen format for Bob
35
35
  const transformedBody = transformToHyphenCommands(content.body);
36
- return `---
37
- description: ${escapeYamlValue(content.description)}
38
- argument-hint: command arguments
39
- ---
40
-
41
- ${transformedBody}
36
+ return `---
37
+ description: ${escapeYamlValue(content.description)}
38
+ argument-hint: command arguments
39
+ ---
40
+
41
+ ${transformedBody}
42
42
  `;
43
43
  },
44
44
  };
@@ -36,14 +36,14 @@ export const claudeAdapter = {
36
36
  return path.join('.claude', 'commands', 'zm', `${commandId}.md`);
37
37
  },
38
38
  formatFile(content) {
39
- return `---
40
- name: ${escapeYamlValue(content.name)}
41
- description: ${escapeYamlValue(content.description)}
42
- category: ${escapeYamlValue(content.category)}
43
- tags: ${formatTagsArray(content.tags)}
44
- ---
45
-
46
- ${content.body}
39
+ return `---
40
+ name: ${escapeYamlValue(content.name)}
41
+ description: ${escapeYamlValue(content.description)}
42
+ category: ${escapeYamlValue(content.category)}
43
+ tags: ${formatTagsArray(content.tags)}
44
+ ---
45
+
46
+ ${content.body}
47
47
  `;
48
48
  },
49
49
  };
@@ -16,11 +16,11 @@ export const clineAdapter = {
16
16
  return path.join('.clinerules', 'workflows', `zm-${commandId}.md`);
17
17
  },
18
18
  formatFile(content) {
19
- return `# ${content.name}
20
-
21
- ${content.description}
22
-
23
- ${content.body}
19
+ return `# ${content.name}
20
+
21
+ ${content.description}
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -15,13 +15,13 @@ export const codebuddyAdapter = {
15
15
  return path.join('.codebuddy', 'commands', 'zm', `${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- name: ${content.name}
20
- description: "${content.description}"
21
- argument-hint: "[command arguments]"
22
- ---
23
-
24
- ${content.body}
18
+ return `---
19
+ name: ${content.name}
20
+ description: "${content.description}"
21
+ argument-hint: "[command arguments]"
22
+ ---
23
+
24
+ ${content.body}
25
25
  `;
26
26
  },
27
27
  };
@@ -27,12 +27,12 @@ export const codexAdapter = {
27
27
  return path.join(getCodexHome(), 'prompts', `zm-${commandId}.md`);
28
28
  },
29
29
  formatFile(content) {
30
- return `---
31
- description: ${content.description}
32
- argument-hint: command arguments
33
- ---
34
-
35
- ${content.body}
30
+ return `---
31
+ description: ${content.description}
32
+ argument-hint: command arguments
33
+ ---
34
+
35
+ ${content.body}
36
36
  `;
37
37
  },
38
38
  };
@@ -15,13 +15,13 @@ export const continueAdapter = {
15
15
  return path.join('.continue', 'prompts', `zm-${commandId}.prompt`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- name: zm-${content.id}
20
- description: ${content.description}
21
- invokable: true
22
- ---
23
-
24
- ${content.body}
18
+ return `---
19
+ name: zm-${content.id}
20
+ description: ${content.description}
21
+ invokable: true
22
+ ---
23
+
24
+ ${content.body}
25
25
  `;
26
26
  },
27
27
  };
@@ -15,12 +15,12 @@ export const costrictAdapter = {
15
15
  return path.join('.cospec', 'zhima', 'commands', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: "${content.description}"
20
- argument-hint: command arguments
21
- ---
22
-
23
- ${content.body}
18
+ return `---
19
+ description: "${content.description}"
20
+ argument-hint: command arguments
21
+ ---
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -16,14 +16,14 @@ export const crushAdapter = {
16
16
  },
17
17
  formatFile(content) {
18
18
  const tagsStr = content.tags.join(', ');
19
- return `---
20
- name: ${content.name}
21
- description: ${content.description}
22
- category: ${content.category}
23
- tags: [${tagsStr}]
24
- ---
25
-
26
- ${content.body}
19
+ return `---
20
+ name: ${content.name}
21
+ description: ${content.description}
22
+ category: ${content.category}
23
+ tags: [${tagsStr}]
24
+ ---
25
+
26
+ ${content.body}
27
27
  `;
28
28
  },
29
29
  };
@@ -30,14 +30,14 @@ export const cursorAdapter = {
30
30
  return path.join('.cursor', 'commands', `zm-${commandId}.md`);
31
31
  },
32
32
  formatFile(content) {
33
- return `---
34
- name: /zm-${content.id}
35
- id: zm-${content.id}
36
- category: ${escapeYamlValue(content.category)}
37
- description: ${escapeYamlValue(content.description)}
38
- ---
39
-
40
- ${content.body}
33
+ return `---
34
+ name: /zm-${content.id}
35
+ id: zm-${content.id}
36
+ category: ${escapeYamlValue(content.category)}
37
+ description: ${escapeYamlValue(content.description)}
38
+ ---
39
+
40
+ ${content.body}
41
41
  `;
42
42
  },
43
43
  };
@@ -15,12 +15,12 @@ export const factoryAdapter = {
15
15
  return path.join('.factory', 'commands', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: ${content.description}
20
- argument-hint: command arguments
21
- ---
22
-
23
- ${content.body}
18
+ return `---
19
+ description: ${content.description}
20
+ argument-hint: command arguments
21
+ ---
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -15,11 +15,11 @@ export const geminiAdapter = {
15
15
  return path.join('.gemini', 'commands', 'zm', `${commandId}.toml`);
16
16
  },
17
17
  formatFile(content) {
18
- return `description = "${content.description}"
19
-
20
- prompt = """
21
- ${content.body}
22
- """
18
+ return `description = "${content.description}"
19
+
20
+ prompt = """
21
+ ${content.body}
22
+ """
23
23
  `;
24
24
  },
25
25
  };
@@ -15,11 +15,11 @@ export const githubCopilotAdapter = {
15
15
  return path.join('.github', 'prompts', `zm-${commandId}.prompt.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: ${content.description}
20
- ---
21
-
22
- ${content.body}
18
+ return `---
19
+ description: ${content.description}
20
+ ---
21
+
22
+ ${content.body}
23
23
  `;
24
24
  },
25
25
  };
@@ -15,14 +15,14 @@ export const iflowAdapter = {
15
15
  return path.join('.iflow', 'commands', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- name: /zm-${content.id}
20
- id: zm-${content.id}
21
- category: ${content.category}
22
- description: ${content.description}
23
- ---
24
-
25
- ${content.body}
18
+ return `---
19
+ name: /zm-${content.id}
20
+ id: zm-${content.id}
21
+ category: ${content.category}
22
+ description: ${content.description}
23
+ ---
24
+
25
+ ${content.body}
26
26
  `;
27
27
  },
28
28
  };
@@ -15,11 +15,11 @@ export const junieAdapter = {
15
15
  return path.join('.junie', 'commands', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: ${content.description}
20
- ---
21
-
22
- ${content.body}
18
+ return `---
19
+ description: ${content.description}
20
+ ---
21
+
22
+ ${content.body}
23
23
  `;
24
24
  },
25
25
  };
@@ -16,7 +16,7 @@ export const kilocodeAdapter = {
16
16
  return path.join('.kilocode', 'workflows', `zm-${commandId}.md`);
17
17
  },
18
18
  formatFile(content) {
19
- return `${content.body}
19
+ return `${content.body}
20
20
  `;
21
21
  },
22
22
  };
@@ -15,11 +15,11 @@ export const kiroAdapter = {
15
15
  return path.join('.kiro', 'prompts', `zm-${commandId}.prompt.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- description: ${content.description}
20
- ---
21
-
22
- ${content.body}
18
+ return `---
19
+ description: ${content.description}
20
+ ---
21
+
22
+ ${content.body}
23
23
  `;
24
24
  },
25
25
  };
@@ -16,14 +16,14 @@ export const lingmaAdapter = {
16
16
  },
17
17
  formatFile(content) {
18
18
  const tagsStr = content.tags.join(', ');
19
- return `---
20
- name: ${content.name}
21
- description: ${content.description}
22
- category: ${content.category}
23
- tags: [${tagsStr}]
24
- ---
25
-
26
- ${content.body}
19
+ return `---
20
+ name: ${content.name}
21
+ description: ${content.description}
22
+ category: ${content.category}
23
+ tags: [${tagsStr}]
24
+ ---
25
+
26
+ ${content.body}
27
27
  `;
28
28
  },
29
29
  };
@@ -18,11 +18,11 @@ export const opencodeAdapter = {
18
18
  formatFile(content) {
19
19
  // Transform command references from colon to hyphen format for OpenCode
20
20
  const transformedBody = transformToHyphenCommands(content.body);
21
- return `---
22
- description: ${content.description}
23
- ---
24
-
25
- ${transformedBody}
21
+ return `---
22
+ description: ${content.description}
23
+ ---
24
+
25
+ ${transformedBody}
26
26
  `;
27
27
  },
28
28
  };
@@ -44,11 +44,11 @@ export const piAdapter = {
44
44
  formatFile(content) {
45
45
  // Transform /zm: references to /zm- and inject $@ for template args
46
46
  const transformedBody = transformToHyphenCommands(content.body);
47
- return `---
48
- description: ${escapeYamlValue(content.description)}
49
- ---
50
-
51
- ${injectPiArgs(transformedBody)}
47
+ return `---
48
+ description: ${escapeYamlValue(content.description)}
49
+ ---
50
+
51
+ ${injectPiArgs(transformedBody)}
52
52
  `;
53
53
  },
54
54
  };
@@ -16,14 +16,14 @@ export const qoderAdapter = {
16
16
  },
17
17
  formatFile(content) {
18
18
  const tagsStr = content.tags.join(', ');
19
- return `---
20
- name: ${content.name}
21
- description: ${content.description}
22
- category: ${content.category}
23
- tags: [${tagsStr}]
24
- ---
25
-
26
- ${content.body}
19
+ return `---
20
+ name: ${content.name}
21
+ description: ${content.description}
22
+ category: ${content.category}
23
+ tags: [${tagsStr}]
24
+ ---
25
+
26
+ ${content.body}
27
27
  `;
28
28
  },
29
29
  };
@@ -15,11 +15,11 @@ export const qwenAdapter = {
15
15
  return path.join('.qwen', 'commands', `zm-${commandId}.toml`);
16
16
  },
17
17
  formatFile(content) {
18
- return `description = "${content.description}"
19
-
20
- prompt = """
21
- ${content.body}
22
- """
18
+ return `description = "${content.description}"
19
+
20
+ prompt = """
21
+ ${content.body}
22
+ """
23
23
  `;
24
24
  },
25
25
  };
@@ -16,11 +16,11 @@ export const roocodeAdapter = {
16
16
  return path.join('.roo', 'commands', `zm-${commandId}.md`);
17
17
  },
18
18
  formatFile(content) {
19
- return `# ${content.name}
20
-
21
- ${content.description}
22
-
23
- ${content.body}
19
+ return `# ${content.name}
20
+
21
+ ${content.description}
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -6,7 +6,7 @@
6
6
  import type { ToolCommandAdapter } from '../types.js';
7
7
  /**
8
8
  * VJSP adapter for command generation.
9
- * File path: .vjsp/commands/zm-<id>.md
9
+ * File path: .vjsp/workflows/zm-<id>.md
10
10
  * Format: Markdown with frontmatter (name, description)
11
11
  */
12
12
  export declare const vjspAdapter: ToolCommandAdapter;
@@ -6,21 +6,21 @@
6
6
  import path from 'path';
7
7
  /**
8
8
  * VJSP adapter for command generation.
9
- * File path: .vjsp/commands/zm-<id>.md
9
+ * File path: .vjsp/workflows/zm-<id>.md
10
10
  * Format: Markdown with frontmatter (name, description)
11
11
  */
12
12
  export const vjspAdapter = {
13
13
  toolId: 'vjsp',
14
14
  getFilePath(commandId) {
15
- return path.join('.vjsp', 'commands', `zm-${commandId}.md`);
15
+ return path.join('.vjsp', 'workflows', `zm-${commandId}.md`);
16
16
  },
17
17
  formatFile(content) {
18
- return `---
19
- name: ${content.name}
20
- description: "${content.description}"
21
- ---
22
-
23
- ${content.body}
18
+ return `---
19
+ name: ${content.name}
20
+ description: "${content.description}"
21
+ ---
22
+
23
+ ${content.body}
24
24
  `;
25
25
  },
26
26
  };
@@ -37,14 +37,14 @@ export const windsurfAdapter = {
37
37
  return path.join('.windsurf', 'workflows', `zm-${commandId}.md`);
38
38
  },
39
39
  formatFile(content) {
40
- return `---
41
- name: ${escapeYamlValue(content.name)}
42
- description: ${escapeYamlValue(content.description)}
43
- category: ${escapeYamlValue(content.category)}
44
- tags: ${formatTagsArray(content.tags)}
45
- ---
46
-
47
- ${content.body}
40
+ return `---
41
+ name: ${escapeYamlValue(content.name)}
42
+ description: ${escapeYamlValue(content.description)}
43
+ category: ${escapeYamlValue(content.category)}
44
+ tags: ${formatTagsArray(content.tags)}
45
+ ---
46
+
47
+ ${content.body}
48
48
  `;
49
49
  },
50
50
  };
@@ -30,6 +30,7 @@ import { lingmaAdapter } from './adapters/lingma.js';
30
30
  import { qwenAdapter } from './adapters/qwen.js';
31
31
  import { roocodeAdapter } from './adapters/roocode.js';
32
32
  import { windsurfAdapter } from './adapters/windsurf.js';
33
+ import { vjspAdapter } from './adapters/vjsp.js';
33
34
  /**
34
35
  * Registry for looking up tool command adapters.
35
36
  */
@@ -63,6 +64,7 @@ export class CommandAdapterRegistry {
63
64
  CommandAdapterRegistry.register(qwenAdapter);
64
65
  CommandAdapterRegistry.register(roocodeAdapter);
65
66
  CommandAdapterRegistry.register(windsurfAdapter);
67
+ CommandAdapterRegistry.register(vjspAdapter);
66
68
  }
67
69
  /**
68
70
  * Register a tool command adapter.
@@ -25,47 +25,47 @@ export class BashGenerator {
25
25
  // Dynamic completion helpers from template
26
26
  const helpers = BASH_DYNAMIC_HELPERS;
27
27
  // Assemble final script with template literal
28
- return `# Bash completion script for ZhiMa CLI
29
- # Auto-generated - do not edit manually
30
-
31
- _zhima_completion() {
32
- local cur prev words cword
33
-
34
- # Use _init_completion if available (from bash-completion package)
35
- # The -n : option prevents colons from being treated as word separators
36
- # (important for spec/change IDs that may contain colons)
37
- # Otherwise, fall back to manual initialization
38
- if declare -F _init_completion >/dev/null 2>&1; then
39
- _init_completion -n : || return
40
- else
41
- # Manual fallback when bash-completion is not installed
42
- COMPREPLY=()
43
- cur="\${COMP_WORDS[COMP_CWORD]}"
44
- prev="\${COMP_WORDS[COMP_CWORD-1]}"
45
- words=("\${COMP_WORDS[@]}")
46
- cword=$COMP_CWORD
47
- fi
48
-
49
- local cmd="\${words[1]}"
50
- local subcmd="\${words[2]}"
51
-
52
- # Top-level commands
53
- if [[ $cword -eq 1 ]]; then
54
- local commands="${commandList}"
55
- COMPREPLY=($(compgen -W "$commands" -- "$cur"))
56
- return 0
57
- fi
58
-
59
- # Command-specific completion
60
- case "$cmd" in
61
- ${commandCases}
62
- esac
63
-
64
- return 0
65
- }
66
-
67
- ${helpers}
68
- complete -F _zhima_completion zhima
28
+ return `# Bash completion script for ZhiMa CLI
29
+ # Auto-generated - do not edit manually
30
+
31
+ _zhima_completion() {
32
+ local cur prev words cword
33
+
34
+ # Use _init_completion if available (from bash-completion package)
35
+ # The -n : option prevents colons from being treated as word separators
36
+ # (important for spec/change IDs that may contain colons)
37
+ # Otherwise, fall back to manual initialization
38
+ if declare -F _init_completion >/dev/null 2>&1; then
39
+ _init_completion -n : || return
40
+ else
41
+ # Manual fallback when bash-completion is not installed
42
+ COMPREPLY=()
43
+ cur="\${COMP_WORDS[COMP_CWORD]}"
44
+ prev="\${COMP_WORDS[COMP_CWORD-1]}"
45
+ words=("\${COMP_WORDS[@]}")
46
+ cword=$COMP_CWORD
47
+ fi
48
+
49
+ local cmd="\${words[1]}"
50
+ local subcmd="\${words[2]}"
51
+
52
+ # Top-level commands
53
+ if [[ $cword -eq 1 ]]; then
54
+ local commands="${commandList}"
55
+ COMPREPLY=($(compgen -W "$commands" -- "$cur"))
56
+ return 0
57
+ fi
58
+
59
+ # Command-specific completion
60
+ case "$cmd" in
61
+ ${commandCases}
62
+ esac
63
+
64
+ return 0
65
+ }
66
+
67
+ ${helpers}
68
+ complete -F _zhima_completion zhima
69
69
  `;
70
70
  }
71
71
  /**
@@ -31,13 +31,13 @@ export class FishGenerator {
31
31
  // Dynamic completion helpers from template
32
32
  const dynamicHelpers = FISH_DYNAMIC_HELPERS;
33
33
  // Assemble final script with template literal
34
- return `# Fish completion script for ZhiMa CLI
35
- # Auto-generated - do not edit manually
36
-
37
- ${helperFunctions}
38
- ${dynamicHelpers}
39
- ${topLevelCommands}
40
-
34
+ return `# Fish completion script for ZhiMa CLI
35
+ # Auto-generated - do not edit manually
36
+
37
+ ${helperFunctions}
38
+ ${dynamicHelpers}
39
+ ${topLevelCommands}
40
+
41
41
  ${commandCompletions}`;
42
42
  }
43
43
  /**