@ias-ai/zhima-spec 1.3.6 → 1.3.9

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 (64) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +206 -206
  3. package/bin/zhima.js +1 -1
  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/index.d.ts +1 -0
  23. package/dist/core/command-generation/adapters/index.js +1 -0
  24. package/dist/core/command-generation/adapters/junie.js +5 -5
  25. package/dist/core/command-generation/adapters/kilocode.js +1 -1
  26. package/dist/core/command-generation/adapters/kiro.js +5 -5
  27. package/dist/core/command-generation/adapters/lingma.js +8 -8
  28. package/dist/core/command-generation/adapters/opencode.js +5 -5
  29. package/dist/core/command-generation/adapters/pi.js +5 -5
  30. package/dist/core/command-generation/adapters/qoder.js +8 -8
  31. package/dist/core/command-generation/adapters/qwen.js +5 -5
  32. package/dist/core/command-generation/adapters/roocode.js +5 -5
  33. package/dist/core/command-generation/adapters/vjsp.d.ts +1 -1
  34. package/dist/core/command-generation/adapters/vjsp.js +8 -8
  35. package/dist/core/command-generation/adapters/windsurf.js +8 -8
  36. package/dist/core/command-generation/adapters/zcode.d.ts +13 -0
  37. package/dist/core/command-generation/adapters/zcode.js +27 -0
  38. package/dist/core/command-generation/registry.js +4 -0
  39. package/dist/core/completions/generators/bash-generator.js +41 -41
  40. package/dist/core/completions/generators/fish-generator.js +7 -7
  41. package/dist/core/completions/generators/powershell-generator.js +29 -29
  42. package/dist/core/completions/generators/zsh-generator.js +33 -33
  43. package/dist/core/completions/templates/bash-templates.js +24 -24
  44. package/dist/core/completions/templates/fish-templates.js +38 -38
  45. package/dist/core/completions/templates/powershell-templates.js +28 -28
  46. package/dist/core/completions/templates/zsh-templates.js +39 -39
  47. package/dist/core/config.js +1 -0
  48. package/dist/core/shared/skill-generation.js +12 -12
  49. package/dist/core/templates/workflows/apply-change.js +294 -294
  50. package/dist/core/templates/workflows/archive-change.js +257 -257
  51. package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
  52. package/dist/core/templates/workflows/continue-change.js +214 -214
  53. package/dist/core/templates/workflows/explore.js +439 -439
  54. package/dist/core/templates/workflows/feedback.js +97 -97
  55. package/dist/core/templates/workflows/ff-change.js +180 -180
  56. package/dist/core/templates/workflows/new-change.js +123 -123
  57. package/dist/core/templates/workflows/onboard.js +540 -540
  58. package/dist/core/templates/workflows/propose.js +198 -198
  59. package/dist/core/templates/workflows/sync-specs.js +270 -270
  60. package/dist/core/templates/workflows/verify-change.js +318 -318
  61. package/dist/core/workspace/open-surface.js +11 -11
  62. package/package.json +82 -82
  63. package/schemas/spec-driven/schema.yaml +153 -153
  64. 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
  };
@@ -30,4 +30,5 @@ export { qwenAdapter } from './qwen.js';
30
30
  export { roocodeAdapter } from './roocode.js';
31
31
  export { windsurfAdapter } from './windsurf.js';
32
32
  export { vjspAdapter } from './vjsp.js';
33
+ export { zcodeAdapter } from './zcode.js';
33
34
  //# sourceMappingURL=index.d.ts.map
@@ -30,4 +30,5 @@ export { qwenAdapter } from './qwen.js';
30
30
  export { roocodeAdapter } from './roocode.js';
31
31
  export { windsurfAdapter } from './windsurf.js';
32
32
  export { vjspAdapter } from './vjsp.js';
33
+ export { zcodeAdapter } from './zcode.js';
33
34
  //# sourceMappingURL=index.js.map
@@ -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
  };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Z-Code Command Adapter
3
+ *
4
+ * Formats commands for Z-Code following its specification.
5
+ */
6
+ import type { ToolCommandAdapter } from '../types.js';
7
+ /**
8
+ * Z-Code adapter for command generation.
9
+ * File path: .zcode/workflows/zm-<id>.md
10
+ * Format: Markdown with frontmatter (name, description)
11
+ */
12
+ export declare const zcodeAdapter: ToolCommandAdapter;
13
+ //# sourceMappingURL=zcode.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Z-Code Command Adapter
3
+ *
4
+ * Formats commands for Z-Code following its specification.
5
+ */
6
+ import path from 'path';
7
+ /**
8
+ * Z-Code adapter for command generation.
9
+ * File path: .zcode/workflows/zm-<id>.md
10
+ * Format: Markdown with frontmatter (name, description)
11
+ */
12
+ export const zcodeAdapter = {
13
+ toolId: 'zcode',
14
+ getFilePath(commandId) {
15
+ return path.join('.zcode', 'workflows', `zm-${commandId}.md`);
16
+ },
17
+ formatFile(content) {
18
+ return `---
19
+ name: ${content.name}
20
+ description: "${content.description}"
21
+ ---
22
+
23
+ ${content.body}
24
+ `;
25
+ },
26
+ };
27
+ //# sourceMappingURL=zcode.js.map
@@ -30,6 +30,8 @@ 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';
34
+ import { zcodeAdapter } from './adapters/zcode.js';
33
35
  /**
34
36
  * Registry for looking up tool command adapters.
35
37
  */
@@ -63,6 +65,8 @@ export class CommandAdapterRegistry {
63
65
  CommandAdapterRegistry.register(qwenAdapter);
64
66
  CommandAdapterRegistry.register(roocodeAdapter);
65
67
  CommandAdapterRegistry.register(windsurfAdapter);
68
+ CommandAdapterRegistry.register(vjspAdapter);
69
+ CommandAdapterRegistry.register(zcodeAdapter);
66
70
  }
67
71
  /**
68
72
  * Register a tool command adapter.