@zhuan-ai/zhuanspec 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +461 -0
  3. package/README.zh.md +434 -0
  4. package/bin/zhuanspec.js +3 -0
  5. package/dist/cli/index.d.ts +2 -0
  6. package/dist/cli/index.js +356 -0
  7. package/dist/commands/artifact-workflow.d.ts +13 -0
  8. package/dist/commands/artifact-workflow.js +916 -0
  9. package/dist/commands/change.d.ts +35 -0
  10. package/dist/commands/change.js +277 -0
  11. package/dist/commands/completion.d.ts +72 -0
  12. package/dist/commands/completion.js +221 -0
  13. package/dist/commands/config.d.ts +8 -0
  14. package/dist/commands/config.js +198 -0
  15. package/dist/commands/show.d.ts +14 -0
  16. package/dist/commands/show.js +132 -0
  17. package/dist/commands/spec.d.ts +15 -0
  18. package/dist/commands/spec.js +225 -0
  19. package/dist/commands/validate.d.ts +24 -0
  20. package/dist/commands/validate.js +294 -0
  21. package/dist/core/archive.d.ts +30 -0
  22. package/dist/core/archive.js +438 -0
  23. package/dist/core/artifact-graph/graph.d.ts +56 -0
  24. package/dist/core/artifact-graph/graph.js +141 -0
  25. package/dist/core/artifact-graph/index.d.ts +7 -0
  26. package/dist/core/artifact-graph/index.js +13 -0
  27. package/dist/core/artifact-graph/instruction-loader.d.ts +134 -0
  28. package/dist/core/artifact-graph/instruction-loader.js +180 -0
  29. package/dist/core/artifact-graph/resolver.d.ts +61 -0
  30. package/dist/core/artifact-graph/resolver.js +187 -0
  31. package/dist/core/artifact-graph/schema.d.ts +13 -0
  32. package/dist/core/artifact-graph/schema.js +108 -0
  33. package/dist/core/artifact-graph/state.d.ts +12 -0
  34. package/dist/core/artifact-graph/state.js +54 -0
  35. package/dist/core/artifact-graph/types.d.ts +45 -0
  36. package/dist/core/artifact-graph/types.js +43 -0
  37. package/dist/core/completions/command-registry.d.ts +7 -0
  38. package/dist/core/completions/command-registry.js +362 -0
  39. package/dist/core/completions/completion-provider.d.ts +60 -0
  40. package/dist/core/completions/completion-provider.js +102 -0
  41. package/dist/core/completions/factory.d.ts +51 -0
  42. package/dist/core/completions/factory.js +57 -0
  43. package/dist/core/completions/generators/zsh-generator.d.ts +58 -0
  44. package/dist/core/completions/generators/zsh-generator.js +319 -0
  45. package/dist/core/completions/installers/zsh-installer.d.ts +136 -0
  46. package/dist/core/completions/installers/zsh-installer.js +449 -0
  47. package/dist/core/completions/types.d.ts +78 -0
  48. package/dist/core/completions/types.js +2 -0
  49. package/dist/core/config-schema.d.ts +76 -0
  50. package/dist/core/config-schema.js +200 -0
  51. package/dist/core/config.d.ts +16 -0
  52. package/dist/core/config.js +29 -0
  53. package/dist/core/configurators/agents.d.ts +8 -0
  54. package/dist/core/configurators/agents.js +15 -0
  55. package/dist/core/configurators/base.d.ts +7 -0
  56. package/dist/core/configurators/base.js +2 -0
  57. package/dist/core/configurators/claude.d.ts +8 -0
  58. package/dist/core/configurators/claude.js +15 -0
  59. package/dist/core/configurators/cline.d.ts +8 -0
  60. package/dist/core/configurators/cline.js +15 -0
  61. package/dist/core/configurators/codebuddy.d.ts +8 -0
  62. package/dist/core/configurators/codebuddy.js +15 -0
  63. package/dist/core/configurators/costrict.d.ts +8 -0
  64. package/dist/core/configurators/costrict.js +15 -0
  65. package/dist/core/configurators/iflow.d.ts +8 -0
  66. package/dist/core/configurators/iflow.js +15 -0
  67. package/dist/core/configurators/qoder.d.ts +30 -0
  68. package/dist/core/configurators/qoder.js +42 -0
  69. package/dist/core/configurators/qwen.d.ts +24 -0
  70. package/dist/core/configurators/qwen.js +37 -0
  71. package/dist/core/configurators/registry.d.ts +9 -0
  72. package/dist/core/configurators/registry.js +43 -0
  73. package/dist/core/configurators/slash/amazon-q.d.ts +9 -0
  74. package/dist/core/configurators/slash/amazon-q.js +46 -0
  75. package/dist/core/configurators/slash/antigravity.d.ts +9 -0
  76. package/dist/core/configurators/slash/antigravity.js +23 -0
  77. package/dist/core/configurators/slash/auggie.d.ts +9 -0
  78. package/dist/core/configurators/slash/auggie.js +31 -0
  79. package/dist/core/configurators/slash/base.d.ts +19 -0
  80. package/dist/core/configurators/slash/base.js +69 -0
  81. package/dist/core/configurators/slash/claude.d.ts +9 -0
  82. package/dist/core/configurators/slash/claude.js +37 -0
  83. package/dist/core/configurators/slash/cline.d.ts +9 -0
  84. package/dist/core/configurators/slash/cline.js +23 -0
  85. package/dist/core/configurators/slash/codebuddy.d.ts +9 -0
  86. package/dist/core/configurators/slash/codebuddy.js +37 -0
  87. package/dist/core/configurators/slash/codex.d.ts +14 -0
  88. package/dist/core/configurators/slash/codex.js +109 -0
  89. package/dist/core/configurators/slash/costrict.d.ts +9 -0
  90. package/dist/core/configurators/slash/costrict.js +31 -0
  91. package/dist/core/configurators/slash/crush.d.ts +9 -0
  92. package/dist/core/configurators/slash/crush.js +37 -0
  93. package/dist/core/configurators/slash/cursor.d.ts +9 -0
  94. package/dist/core/configurators/slash/cursor.js +37 -0
  95. package/dist/core/configurators/slash/factory.d.ts +10 -0
  96. package/dist/core/configurators/slash/factory.js +35 -0
  97. package/dist/core/configurators/slash/gemini.d.ts +9 -0
  98. package/dist/core/configurators/slash/gemini.js +22 -0
  99. package/dist/core/configurators/slash/github-copilot.d.ts +9 -0
  100. package/dist/core/configurators/slash/github-copilot.js +34 -0
  101. package/dist/core/configurators/slash/iflow.d.ts +9 -0
  102. package/dist/core/configurators/slash/iflow.js +37 -0
  103. package/dist/core/configurators/slash/kilocode.d.ts +9 -0
  104. package/dist/core/configurators/slash/kilocode.js +17 -0
  105. package/dist/core/configurators/slash/opencode.d.ts +12 -0
  106. package/dist/core/configurators/slash/opencode.js +72 -0
  107. package/dist/core/configurators/slash/qoder.d.ts +35 -0
  108. package/dist/core/configurators/slash/qoder.js +76 -0
  109. package/dist/core/configurators/slash/qwen.d.ts +32 -0
  110. package/dist/core/configurators/slash/qwen.js +49 -0
  111. package/dist/core/configurators/slash/registry.d.ts +8 -0
  112. package/dist/core/configurators/slash/registry.js +75 -0
  113. package/dist/core/configurators/slash/roocode.d.ts +9 -0
  114. package/dist/core/configurators/slash/roocode.js +23 -0
  115. package/dist/core/configurators/slash/toml-base.d.ts +10 -0
  116. package/dist/core/configurators/slash/toml-base.js +53 -0
  117. package/dist/core/configurators/slash/windsurf.d.ts +9 -0
  118. package/dist/core/configurators/slash/windsurf.js +23 -0
  119. package/dist/core/converters/json-converter.d.ts +6 -0
  120. package/dist/core/converters/json-converter.js +51 -0
  121. package/dist/core/global-config.d.ts +39 -0
  122. package/dist/core/global-config.js +115 -0
  123. package/dist/core/index.d.ts +2 -0
  124. package/dist/core/index.js +3 -0
  125. package/dist/core/init.d.ts +60 -0
  126. package/dist/core/init.js +861 -0
  127. package/dist/core/list.d.ts +9 -0
  128. package/dist/core/list.js +171 -0
  129. package/dist/core/parsers/change-parser.d.ts +13 -0
  130. package/dist/core/parsers/change-parser.js +193 -0
  131. package/dist/core/parsers/markdown-parser.d.ts +22 -0
  132. package/dist/core/parsers/markdown-parser.js +187 -0
  133. package/dist/core/parsers/requirement-blocks.d.ts +37 -0
  134. package/dist/core/parsers/requirement-blocks.js +201 -0
  135. package/dist/core/project-config.d.ts +34 -0
  136. package/dist/core/project-config.js +79 -0
  137. package/dist/core/schemas/base.schema.d.ts +13 -0
  138. package/dist/core/schemas/base.schema.js +13 -0
  139. package/dist/core/schemas/change.schema.d.ts +73 -0
  140. package/dist/core/schemas/change.schema.js +31 -0
  141. package/dist/core/schemas/index.d.ts +4 -0
  142. package/dist/core/schemas/index.js +4 -0
  143. package/dist/core/schemas/spec.schema.d.ts +18 -0
  144. package/dist/core/schemas/spec.schema.js +15 -0
  145. package/dist/core/skill-discovery.d.ts +24 -0
  146. package/dist/core/skill-discovery.js +153 -0
  147. package/dist/core/specs-apply.d.ts +73 -0
  148. package/dist/core/specs-apply.js +384 -0
  149. package/dist/core/styles/palette.d.ts +7 -0
  150. package/dist/core/styles/palette.js +8 -0
  151. package/dist/core/templates/agents-root-stub.d.ts +2 -0
  152. package/dist/core/templates/agents-root-stub.js +17 -0
  153. package/dist/core/templates/agents-template.d.ts +2 -0
  154. package/dist/core/templates/agents-template.js +706 -0
  155. package/dist/core/templates/claude-template.d.ts +2 -0
  156. package/dist/core/templates/claude-template.js +2 -0
  157. package/dist/core/templates/cline-template.d.ts +2 -0
  158. package/dist/core/templates/cline-template.js +2 -0
  159. package/dist/core/templates/costrict-template.d.ts +2 -0
  160. package/dist/core/templates/costrict-template.js +2 -0
  161. package/dist/core/templates/index.d.ts +17 -0
  162. package/dist/core/templates/index.js +37 -0
  163. package/dist/core/templates/project-template.d.ts +8 -0
  164. package/dist/core/templates/project-template.js +32 -0
  165. package/dist/core/templates/skill-templates.d.ts +103 -0
  166. package/dist/core/templates/skill-templates.js +2131 -0
  167. package/dist/core/templates/slash-command-templates.d.ts +4 -0
  168. package/dist/core/templates/slash-command-templates.js +81 -0
  169. package/dist/core/update.d.ts +4 -0
  170. package/dist/core/update.js +88 -0
  171. package/dist/core/validation/constants.d.ts +34 -0
  172. package/dist/core/validation/constants.js +40 -0
  173. package/dist/core/validation/types.d.ts +18 -0
  174. package/dist/core/validation/types.js +2 -0
  175. package/dist/core/validation/validator.d.ts +33 -0
  176. package/dist/core/validation/validator.js +409 -0
  177. package/dist/core/view.d.ts +8 -0
  178. package/dist/core/view.js +168 -0
  179. package/dist/index.d.ts +3 -0
  180. package/dist/index.js +3 -0
  181. package/dist/utils/change-metadata.d.ts +47 -0
  182. package/dist/utils/change-metadata.js +130 -0
  183. package/dist/utils/change-utils.d.ts +51 -0
  184. package/dist/utils/change-utils.js +100 -0
  185. package/dist/utils/file-system.d.ts +19 -0
  186. package/dist/utils/file-system.js +177 -0
  187. package/dist/utils/index.d.ts +4 -0
  188. package/dist/utils/index.js +5 -0
  189. package/dist/utils/interactive.d.ts +18 -0
  190. package/dist/utils/interactive.js +21 -0
  191. package/dist/utils/item-discovery.d.ts +4 -0
  192. package/dist/utils/item-discovery.js +72 -0
  193. package/dist/utils/match.d.ts +3 -0
  194. package/dist/utils/match.js +22 -0
  195. package/dist/utils/shell-detection.d.ts +20 -0
  196. package/dist/utils/shell-detection.js +41 -0
  197. package/dist/utils/task-progress.d.ts +8 -0
  198. package/dist/utils/task-progress.js +36 -0
  199. package/package.json +81 -0
  200. package/schemas/spec-driven/schema.yaml +205 -0
  201. package/schemas/spec-driven/templates/design.md +19 -0
  202. package/schemas/spec-driven/templates/proposal.md +43 -0
  203. package/schemas/spec-driven/templates/spec.md +8 -0
  204. package/schemas/spec-driven/templates/tasks.md +25 -0
  205. package/schemas/tdd/schema.yaml +213 -0
  206. package/schemas/tdd/templates/docs.md +0 -0
  207. package/schemas/tdd/templates/implementation.md +11 -0
  208. package/schemas/tdd/templates/spec.md +11 -0
  209. package/schemas/tdd/templates/test.md +11 -0
  210. package/scripts/postinstall.js +147 -0
@@ -0,0 +1,200 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod schema for global ZhuanSpec configuration.
4
+ * Uses passthrough() to preserve unknown fields for forward compatibility.
5
+ */
6
+ export const GlobalConfigSchema = z
7
+ .object({
8
+ featureFlags: z
9
+ .record(z.string(), z.boolean())
10
+ .optional()
11
+ .default({}),
12
+ })
13
+ .passthrough();
14
+ /**
15
+ * Default configuration values.
16
+ */
17
+ export const DEFAULT_CONFIG = {
18
+ featureFlags: {},
19
+ };
20
+ const KNOWN_TOP_LEVEL_KEYS = new Set(Object.keys(DEFAULT_CONFIG));
21
+ /**
22
+ * Validate a config key path for CLI set operations.
23
+ * Unknown top-level keys are rejected unless explicitly allowed by the caller.
24
+ */
25
+ export function validateConfigKeyPath(path) {
26
+ const rawKeys = path.split('.');
27
+ if (rawKeys.length === 0 || rawKeys.some((key) => key.trim() === '')) {
28
+ return { valid: false, reason: 'Key path must not be empty' };
29
+ }
30
+ const rootKey = rawKeys[0];
31
+ if (!KNOWN_TOP_LEVEL_KEYS.has(rootKey)) {
32
+ return { valid: false, reason: `Unknown top-level key "${rootKey}"` };
33
+ }
34
+ if (rootKey === 'featureFlags') {
35
+ if (rawKeys.length > 2) {
36
+ return { valid: false, reason: 'featureFlags values are booleans and do not support nested keys' };
37
+ }
38
+ return { valid: true };
39
+ }
40
+ if (rawKeys.length > 1) {
41
+ return { valid: false, reason: `"${rootKey}" does not support nested keys` };
42
+ }
43
+ return { valid: true };
44
+ }
45
+ /**
46
+ * Get a nested value from an object using dot notation.
47
+ *
48
+ * @param obj - The object to access
49
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
50
+ * @returns The value at the path, or undefined if not found
51
+ */
52
+ export function getNestedValue(obj, path) {
53
+ const keys = path.split('.');
54
+ let current = obj;
55
+ for (const key of keys) {
56
+ if (current === null || current === undefined) {
57
+ return undefined;
58
+ }
59
+ if (typeof current !== 'object') {
60
+ return undefined;
61
+ }
62
+ current = current[key];
63
+ }
64
+ return current;
65
+ }
66
+ /**
67
+ * Set a nested value in an object using dot notation.
68
+ * Creates intermediate objects as needed.
69
+ *
70
+ * @param obj - The object to modify (mutated in place)
71
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
72
+ * @param value - The value to set
73
+ */
74
+ export function setNestedValue(obj, path, value) {
75
+ const keys = path.split('.');
76
+ let current = obj;
77
+ for (let i = 0; i < keys.length - 1; i++) {
78
+ const key = keys[i];
79
+ if (current[key] === undefined || current[key] === null || typeof current[key] !== 'object') {
80
+ current[key] = {};
81
+ }
82
+ current = current[key];
83
+ }
84
+ const lastKey = keys[keys.length - 1];
85
+ current[lastKey] = value;
86
+ }
87
+ /**
88
+ * Delete a nested value from an object using dot notation.
89
+ *
90
+ * @param obj - The object to modify (mutated in place)
91
+ * @param path - Dot-separated path (e.g., "featureFlags.someFlag")
92
+ * @returns true if the key existed and was deleted, false otherwise
93
+ */
94
+ export function deleteNestedValue(obj, path) {
95
+ const keys = path.split('.');
96
+ let current = obj;
97
+ for (let i = 0; i < keys.length - 1; i++) {
98
+ const key = keys[i];
99
+ if (current[key] === undefined || current[key] === null || typeof current[key] !== 'object') {
100
+ return false;
101
+ }
102
+ current = current[key];
103
+ }
104
+ const lastKey = keys[keys.length - 1];
105
+ if (lastKey in current) {
106
+ delete current[lastKey];
107
+ return true;
108
+ }
109
+ return false;
110
+ }
111
+ /**
112
+ * Coerce a string value to its appropriate type.
113
+ * - "true" / "false" -> boolean
114
+ * - Numeric strings -> number
115
+ * - Everything else -> string
116
+ *
117
+ * @param value - The string value to coerce
118
+ * @param forceString - If true, always return the value as a string
119
+ * @returns The coerced value
120
+ */
121
+ export function coerceValue(value, forceString = false) {
122
+ if (forceString) {
123
+ return value;
124
+ }
125
+ // Boolean coercion
126
+ if (value === 'true') {
127
+ return true;
128
+ }
129
+ if (value === 'false') {
130
+ return false;
131
+ }
132
+ // Number coercion - must be a valid finite number
133
+ const num = Number(value);
134
+ if (!isNaN(num) && isFinite(num) && value.trim() !== '') {
135
+ return num;
136
+ }
137
+ return value;
138
+ }
139
+ /**
140
+ * Format a value for YAML-like display.
141
+ *
142
+ * @param value - The value to format
143
+ * @param indent - Current indentation level
144
+ * @returns Formatted string
145
+ */
146
+ export function formatValueYaml(value, indent = 0) {
147
+ const indentStr = ' '.repeat(indent);
148
+ if (value === null || value === undefined) {
149
+ return 'null';
150
+ }
151
+ if (typeof value === 'boolean' || typeof value === 'number') {
152
+ return String(value);
153
+ }
154
+ if (typeof value === 'string') {
155
+ return value;
156
+ }
157
+ if (Array.isArray(value)) {
158
+ if (value.length === 0) {
159
+ return '[]';
160
+ }
161
+ return value.map((item) => `${indentStr}- ${formatValueYaml(item, indent + 1)}`).join('\n');
162
+ }
163
+ if (typeof value === 'object') {
164
+ const entries = Object.entries(value);
165
+ if (entries.length === 0) {
166
+ return '{}';
167
+ }
168
+ return entries
169
+ .map(([key, val]) => {
170
+ const formattedVal = formatValueYaml(val, indent + 1);
171
+ if (typeof val === 'object' && val !== null && Object.keys(val).length > 0) {
172
+ return `${indentStr}${key}:\n${formattedVal}`;
173
+ }
174
+ return `${indentStr}${key}: ${formattedVal}`;
175
+ })
176
+ .join('\n');
177
+ }
178
+ return String(value);
179
+ }
180
+ /**
181
+ * Validate a configuration object against the schema.
182
+ *
183
+ * @param config - The configuration to validate
184
+ * @returns Validation result with success status and optional error message
185
+ */
186
+ export function validateConfig(config) {
187
+ try {
188
+ GlobalConfigSchema.parse(config);
189
+ return { success: true };
190
+ }
191
+ catch (error) {
192
+ if (error instanceof z.ZodError) {
193
+ const zodError = error;
194
+ const messages = zodError.issues.map((e) => `${e.path.join('.')}: ${e.message}`);
195
+ return { success: false, error: messages.join('; ') };
196
+ }
197
+ return { success: false, error: 'Unknown validation error' };
198
+ }
199
+ }
200
+ //# sourceMappingURL=config-schema.js.map
@@ -0,0 +1,16 @@
1
+ export declare const ZHUANSPEC_DIR_NAME = "zhuanspec";
2
+ export declare const ZHUANSPEC_MARKERS: {
3
+ start: string;
4
+ end: string;
5
+ };
6
+ export interface ZhuanSpecConfig {
7
+ aiTools: string[];
8
+ }
9
+ export interface AIToolOption {
10
+ name: string;
11
+ value: string;
12
+ available: boolean;
13
+ successLabel?: string;
14
+ }
15
+ export declare const AI_TOOLS: AIToolOption[];
16
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,29 @@
1
+ export const ZHUANSPEC_DIR_NAME = 'zhuanspec';
2
+ export const ZHUANSPEC_MARKERS = {
3
+ start: '<!-- ZHUANSPEC:START -->',
4
+ end: '<!-- ZHUANSPEC:END -->'
5
+ };
6
+ export const AI_TOOLS = [
7
+ { name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer' },
8
+ { name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity' },
9
+ { name: 'Auggie (Augment CLI)', value: 'auggie', available: true, successLabel: 'Auggie' },
10
+ { name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code' },
11
+ { name: 'Cline', value: 'cline', available: true, successLabel: 'Cline' },
12
+ { name: 'Codex', value: 'codex', available: true, successLabel: 'Codex' },
13
+ { name: 'CodeBuddy Code (CLI)', value: 'codebuddy', available: true, successLabel: 'CodeBuddy Code' },
14
+ { name: 'CoStrict', value: 'costrict', available: true, successLabel: 'CoStrict' },
15
+ { name: 'Crush', value: 'crush', available: true, successLabel: 'Crush' },
16
+ { name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor' },
17
+ { name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid' },
18
+ { name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI' },
19
+ { name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot' },
20
+ { name: 'iFlow', value: 'iflow', available: true, successLabel: 'iFlow' },
21
+ { name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' },
22
+ { name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
23
+ { name: 'Qoder (CLI)', value: 'qoder', available: true, successLabel: 'Qoder' },
24
+ { name: 'Qwen Code', value: 'qwen', available: true, successLabel: 'Qwen Code' },
25
+ { name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode' },
26
+ { name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf' },
27
+ { name: 'AGENTS.md (works with Amp, VS Code, …)', value: 'agents', available: false, successLabel: 'your AGENTS.md-compatible assistant' }
28
+ ];
29
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class AgentsStandardConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, _zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=agents.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ export class AgentsStandardConfigurator {
6
+ name = 'AGENTS.md standard';
7
+ configFileName = 'AGENTS.md';
8
+ isAvailable = true;
9
+ async configure(projectPath, _zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getAgentsStandardTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=agents.js.map
@@ -0,0 +1,7 @@
1
+ export interface ToolConfigurator {
2
+ name: string;
3
+ configFileName: string;
4
+ isAvailable: boolean;
5
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
6
+ }
7
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class ClaudeConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=claude.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ export class ClaudeConfigurator {
6
+ name = 'Claude Code';
7
+ configFileName = 'CLAUDE.md';
8
+ isAvailable = true;
9
+ async configure(projectPath, zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getClaudeTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=claude.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class ClineConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=cline.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ export class ClineConfigurator {
6
+ name = 'Cline';
7
+ configFileName = 'CLINE.md';
8
+ isAvailable = true;
9
+ async configure(projectPath, zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getClineTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=cline.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class CodeBuddyConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=codebuddy.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ export class CodeBuddyConfigurator {
6
+ name = 'CodeBuddy';
7
+ configFileName = 'CODEBUDDY.md';
8
+ isAvailable = true;
9
+ async configure(projectPath, zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getClaudeTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=codebuddy.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class CostrictConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=costrict.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ export class CostrictConfigurator {
6
+ name = 'CoStrict';
7
+ configFileName = 'COSTRICT.md';
8
+ isAvailable = true;
9
+ async configure(projectPath, zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getCostrictTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=costrict.js.map
@@ -0,0 +1,8 @@
1
+ import { ToolConfigurator } from "./base.js";
2
+ export declare class IflowConfigurator implements ToolConfigurator {
3
+ name: string;
4
+ configFileName: string;
5
+ isAvailable: boolean;
6
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=iflow.d.ts.map
@@ -0,0 +1,15 @@
1
+ import path from "path";
2
+ import { FileSystemUtils } from "../../utils/file-system.js";
3
+ import { TemplateManager } from "../templates/index.js";
4
+ import { ZHUANSPEC_MARKERS } from "../config.js";
5
+ export class IflowConfigurator {
6
+ name = "iFlow";
7
+ configFileName = "IFLOW.md";
8
+ isAvailable = true;
9
+ async configure(projectPath, zhuanspecDir) {
10
+ const filePath = path.join(projectPath, this.configFileName);
11
+ const content = TemplateManager.getClaudeTemplate();
12
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
13
+ }
14
+ }
15
+ //# sourceMappingURL=iflow.js.map
@@ -0,0 +1,30 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ /**
3
+ * Qoder AI Tool Configurator
4
+ *
5
+ * Configures ZhuanSpec integration for Qoder AI coding assistant.
6
+ * Creates and manages QODER.md configuration file with ZhuanSpec instructions.
7
+ *
8
+ * @implements {ToolConfigurator}
9
+ */
10
+ export declare class QoderConfigurator implements ToolConfigurator {
11
+ /** Display name for the Qoder tool */
12
+ name: string;
13
+ /** Configuration file name at project root */
14
+ configFileName: string;
15
+ /** Indicates tool is available for configuration */
16
+ isAvailable: boolean;
17
+ /**
18
+ * Configure Qoder integration for a project
19
+ *
20
+ * Creates or updates QODER.md file with ZhuanSpec instructions.
21
+ * Uses Claude-compatible template for instruction content.
22
+ * Wrapped with ZhuanSpec markers for future updates.
23
+ *
24
+ * @param {string} projectPath - Absolute path to project root directory
25
+ * @param {string} zhuanspecDir - Path to zhuanspec directory (unused but required by interface)
26
+ * @returns {Promise<void>} Resolves when configuration is complete
27
+ */
28
+ configure(projectPath: string, zhuanspecDir: string): Promise<void>;
29
+ }
30
+ //# sourceMappingURL=qoder.d.ts.map
@@ -0,0 +1,42 @@
1
+ import path from 'path';
2
+ import { FileSystemUtils } from '../../utils/file-system.js';
3
+ import { TemplateManager } from '../templates/index.js';
4
+ import { ZHUANSPEC_MARKERS } from '../config.js';
5
+ /**
6
+ * Qoder AI Tool Configurator
7
+ *
8
+ * Configures ZhuanSpec integration for Qoder AI coding assistant.
9
+ * Creates and manages QODER.md configuration file with ZhuanSpec instructions.
10
+ *
11
+ * @implements {ToolConfigurator}
12
+ */
13
+ export class QoderConfigurator {
14
+ /** Display name for the Qoder tool */
15
+ name = 'Qoder';
16
+ /** Configuration file name at project root */
17
+ configFileName = 'QODER.md';
18
+ /** Indicates tool is available for configuration */
19
+ isAvailable = true;
20
+ /**
21
+ * Configure Qoder integration for a project
22
+ *
23
+ * Creates or updates QODER.md file with ZhuanSpec instructions.
24
+ * Uses Claude-compatible template for instruction content.
25
+ * Wrapped with ZhuanSpec markers for future updates.
26
+ *
27
+ * @param {string} projectPath - Absolute path to project root directory
28
+ * @param {string} zhuanspecDir - Path to zhuanspec directory (unused but required by interface)
29
+ * @returns {Promise<void>} Resolves when configuration is complete
30
+ */
31
+ async configure(projectPath, zhuanspecDir) {
32
+ // Construct full path to QODER.md at project root
33
+ const filePath = path.join(projectPath, this.configFileName);
34
+ // Get Claude-compatible instruction template
35
+ // This ensures Qoder receives the same high-quality ZhuanSpec instructions
36
+ const content = TemplateManager.getClaudeTemplate();
37
+ // Write or update file with managed content between markers
38
+ // This allows future updates to refresh instructions automatically
39
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
40
+ }
41
+ }
42
+ //# sourceMappingURL=qoder.js.map
@@ -0,0 +1,24 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ /**
3
+ * QwenConfigurator class provides integration with Qwen Code
4
+ * by creating and managing the necessary configuration files.
5
+ * Currently configures the QWEN.md file with ZhuanSpec instructions.
6
+ */
7
+ export declare class QwenConfigurator implements ToolConfigurator {
8
+ /** Display name for the Qwen Code tool */
9
+ name: string;
10
+ /** Configuration file name for Qwen Code */
11
+ configFileName: string;
12
+ /** Availability status for the Qwen Code tool */
13
+ isAvailable: boolean;
14
+ /**
15
+ * Configures the Qwen Code integration by creating or updating the QWEN.md file
16
+ * with ZhuanSpec instructions and markers.
17
+ *
18
+ * @param {string} projectPath - The path to the project root
19
+ * @param {string} _zhuanspecDir - The path to the zhuanspec directory (unused)
20
+ * @returns {Promise<void>} A promise that resolves when configuration is complete
21
+ */
22
+ configure(projectPath: string, _zhuanspecDir: string): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=qwen.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Qwen Code configurator for ZhuanSpec integration.
3
+ * This class handles the configuration of Qwen Code as an AI tool within ZhuanSpec.
4
+ *
5
+ * @implements {ToolConfigurator}
6
+ */
7
+ import path from 'path';
8
+ import { FileSystemUtils } from '../../utils/file-system.js';
9
+ import { TemplateManager } from '../templates/index.js';
10
+ import { ZHUANSPEC_MARKERS } from '../config.js';
11
+ /**
12
+ * QwenConfigurator class provides integration with Qwen Code
13
+ * by creating and managing the necessary configuration files.
14
+ * Currently configures the QWEN.md file with ZhuanSpec instructions.
15
+ */
16
+ export class QwenConfigurator {
17
+ /** Display name for the Qwen Code tool */
18
+ name = 'Qwen Code';
19
+ /** Configuration file name for Qwen Code */
20
+ configFileName = 'QWEN.md';
21
+ /** Availability status for the Qwen Code tool */
22
+ isAvailable = true;
23
+ /**
24
+ * Configures the Qwen Code integration by creating or updating the QWEN.md file
25
+ * with ZhuanSpec instructions and markers.
26
+ *
27
+ * @param {string} projectPath - The path to the project root
28
+ * @param {string} _zhuanspecDir - The path to the zhuanspec directory (unused)
29
+ * @returns {Promise<void>} A promise that resolves when configuration is complete
30
+ */
31
+ async configure(projectPath, _zhuanspecDir) {
32
+ const filePath = path.join(projectPath, this.configFileName);
33
+ const content = TemplateManager.getAgentsStandardTemplate();
34
+ await FileSystemUtils.updateFileWithMarkers(filePath, content, ZHUANSPEC_MARKERS.start, ZHUANSPEC_MARKERS.end);
35
+ }
36
+ }
37
+ //# sourceMappingURL=qwen.js.map
@@ -0,0 +1,9 @@
1
+ import { ToolConfigurator } from './base.js';
2
+ export declare class ToolRegistry {
3
+ private static tools;
4
+ static register(tool: ToolConfigurator): void;
5
+ static get(toolId: string): ToolConfigurator | undefined;
6
+ static getAll(): ToolConfigurator[];
7
+ static getAvailable(): ToolConfigurator[];
8
+ }
9
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1,43 @@
1
+ import { ClaudeConfigurator } from './claude.js';
2
+ import { ClineConfigurator } from './cline.js';
3
+ import { CodeBuddyConfigurator } from './codebuddy.js';
4
+ import { CostrictConfigurator } from './costrict.js';
5
+ import { QoderConfigurator } from './qoder.js';
6
+ import { IflowConfigurator } from './iflow.js';
7
+ import { AgentsStandardConfigurator } from './agents.js';
8
+ import { QwenConfigurator } from './qwen.js';
9
+ export class ToolRegistry {
10
+ static tools = new Map();
11
+ static {
12
+ const claudeConfigurator = new ClaudeConfigurator();
13
+ const clineConfigurator = new ClineConfigurator();
14
+ const codeBuddyConfigurator = new CodeBuddyConfigurator();
15
+ const costrictConfigurator = new CostrictConfigurator();
16
+ const qoderConfigurator = new QoderConfigurator();
17
+ const iflowConfigurator = new IflowConfigurator();
18
+ const agentsConfigurator = new AgentsStandardConfigurator();
19
+ const qwenConfigurator = new QwenConfigurator();
20
+ // Register with the ID that matches the checkbox value
21
+ this.tools.set('claude', claudeConfigurator);
22
+ this.tools.set('cline', clineConfigurator);
23
+ this.tools.set('codebuddy', codeBuddyConfigurator);
24
+ this.tools.set('costrict', costrictConfigurator);
25
+ this.tools.set('qoder', qoderConfigurator);
26
+ this.tools.set('iflow', iflowConfigurator);
27
+ this.tools.set('agents', agentsConfigurator);
28
+ this.tools.set('qwen', qwenConfigurator);
29
+ }
30
+ static register(tool) {
31
+ this.tools.set(tool.name.toLowerCase().replace(/\s+/g, '-'), tool);
32
+ }
33
+ static get(toolId) {
34
+ return this.tools.get(toolId);
35
+ }
36
+ static getAll() {
37
+ return Array.from(this.tools.values());
38
+ }
39
+ static getAvailable() {
40
+ return this.getAll().filter(tool => tool.isAvailable);
41
+ }
42
+ }
43
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1,9 @@
1
+ import { SlashCommandConfigurator } from './base.js';
2
+ import { SlashCommandId } from '../../templates/index.js';
3
+ export declare class AmazonQSlashCommandConfigurator extends SlashCommandConfigurator {
4
+ readonly toolId = "amazon-q";
5
+ readonly isAvailable = true;
6
+ protected getRelativePath(id: SlashCommandId): string;
7
+ protected getFrontmatter(id: SlashCommandId): string;
8
+ }
9
+ //# sourceMappingURL=amazon-q.d.ts.map