kspec 1.0.7 → 1.0.11

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +70 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kspec",
3
- "version": "1.0.7",
3
+ "version": "1.0.11",
4
4
  "description": "Spec-driven development workflow for Kiro CLI",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -42,7 +42,26 @@ function formatDate(format) {
42
42
  }
43
43
 
44
44
  function slugify(text) {
45
- return text.slice(0, 50).toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '').replace(/^-+|-+$/g, '');
45
+ // Extract key words and create a meaningful short identifier
46
+ const words = text.toLowerCase()
47
+ .replace(/[^a-z0-9\s]/g, ' ') // Replace non-alphanumeric with spaces
48
+ .split(/\s+/)
49
+ .filter(word => word.length > 2) // Remove short words
50
+ .filter(word => !['the', 'and', 'for', 'with', 'app', 'web', 'api'].includes(word)); // Remove common words
51
+
52
+ // Take first 3-4 meaningful words and truncate to max 25 chars total
53
+ let slug = words.slice(0, 4).join('-');
54
+ if (slug.length > 25) {
55
+ slug = words.slice(0, 3).join('-');
56
+ }
57
+ if (slug.length > 25) {
58
+ slug = words.slice(0, 2).join('-');
59
+ }
60
+ if (slug.length > 25) {
61
+ slug = slug.slice(0, 25);
62
+ }
63
+
64
+ return slug.replace(/^-+|-+$/g, '') || 'feature';
46
65
  }
47
66
 
48
67
  function detectCli() {
@@ -52,7 +71,7 @@ function detectCli() {
52
71
  }
53
72
 
54
73
  function requireCli() {
55
- const cli = requireCli();
74
+ const cli = detectCli();
56
75
  if (!cli) die("Neither 'kiro-cli' nor 'q' found. Install Kiro CLI first.");
57
76
  return cli;
58
77
  }
@@ -185,6 +204,13 @@ const agentTemplates = {
185
204
  'kspec-analyse.json': {
186
205
  name: 'kspec-analyse',
187
206
  description: 'Analyse codebase and update steering docs',
207
+ model: 'claude-sonnet-4',
208
+ tools: ['read', 'write'],
209
+ allowedTools: ['read', 'write'],
210
+ resources: [
211
+ 'file://.kiro/steering/**/*.md',
212
+ 'file://.kspec/**/*.md'
213
+ ],
188
214
  prompt: `You are the kspec analyser. Your job:
189
215
  1. Analyse the codebase structure, tech stack, patterns
190
216
  2. Review .kiro/steering/ docs
@@ -192,18 +218,20 @@ const agentTemplates = {
192
218
  4. Identify risks, tech debt, improvement areas
193
219
 
194
220
  Output a clear analysis report. Propose specific steering doc updates.`,
195
- allowedTools: ['read', 'write'],
196
221
  keyboardShortcut: 'ctrl+a',
197
- welcomeMessage: 'Analysing codebase...',
198
- toolsSettings: {
199
- read: { allowedPaths: ['./**'] },
200
- write: { allowedPaths: ['.kiro/steering/**'] }
201
- }
222
+ welcomeMessage: 'Analysing codebase...'
202
223
  },
203
224
 
204
225
  'kspec-spec.json': {
205
226
  name: 'kspec-spec',
206
227
  description: 'Create feature specifications',
228
+ model: 'claude-sonnet-4',
229
+ tools: ['read', 'write'],
230
+ allowedTools: ['read', 'write'],
231
+ resources: [
232
+ 'file://.kiro/steering/**/*.md',
233
+ 'file://.kspec/**/*.md'
234
+ ],
207
235
  prompt: `You are the kspec specification writer. Your job:
208
236
  1. Read .kiro/steering/ for project context
209
237
  2. Create a comprehensive spec.md with:
@@ -218,18 +246,20 @@ Output a clear analysis report. Propose specific steering doc updates.`,
218
246
  - Used for context after compression
219
247
 
220
248
  Always create both files. spec-lite.md is critical for context retention.`,
221
- allowedTools: ['read', 'write'],
222
249
  keyboardShortcut: 'ctrl+s',
223
- welcomeMessage: 'Ready to create specification.',
224
- toolsSettings: {
225
- read: { allowedPaths: ['./**'] },
226
- write: { allowedPaths: ['.kspec/specs/**'] }
227
- }
250
+ welcomeMessage: 'Ready to create specification.'
228
251
  },
229
252
 
230
253
  'kspec-tasks.json': {
231
254
  name: 'kspec-tasks',
232
255
  description: 'Generate implementation tasks from spec',
256
+ model: 'claude-sonnet-4',
257
+ tools: ['read', 'write'],
258
+ allowedTools: ['read', 'write'],
259
+ resources: [
260
+ 'file://.kiro/steering/**/*.md',
261
+ 'file://.kspec/**/*.md'
262
+ ],
233
263
  prompt: `You are the kspec task generator. Your job:
234
264
  1. Read spec.md and spec-lite.md from the spec folder
235
265
  2. Generate tasks.md with:
@@ -240,18 +270,20 @@ Always create both files. spec-lite.md is critical for context retention.`,
240
270
  - File paths where changes occur
241
271
 
242
272
  Tasks must be atomic and independently verifiable.`,
243
- allowedTools: ['read', 'write'],
244
273
  keyboardShortcut: 'ctrl+t',
245
- welcomeMessage: 'Generating tasks from spec...',
246
- toolsSettings: {
247
- read: { allowedPaths: ['./**'] },
248
- write: { allowedPaths: ['.kspec/specs/**'] }
249
- }
274
+ welcomeMessage: 'Generating tasks from spec...'
250
275
  },
251
276
 
252
277
  'kspec-build.json': {
253
278
  name: 'kspec-build',
254
279
  description: 'Execute tasks with TDD',
280
+ model: 'claude-sonnet-4',
281
+ tools: ['read', 'write', 'shell'],
282
+ allowedTools: ['read', 'write', 'shell'],
283
+ resources: [
284
+ 'file://.kiro/steering/**/*.md',
285
+ 'file://.kspec/**/*.md'
286
+ ],
255
287
  prompt: `You are the kspec builder. Your job:
256
288
  1. Read tasks.md, find first uncompleted task (- [ ])
257
289
  2. For each task:
@@ -265,19 +297,20 @@ Tasks must be atomic and independently verifiable.`,
265
297
  CRITICAL: Always update tasks.md after completing each task.
266
298
  NEVER delete .kiro or .kspec folders.
267
299
  Use non-interactive flags for commands (--yes, -y).`,
268
- allowedTools: ['read', 'write', 'shell'],
269
300
  keyboardShortcut: 'ctrl+b',
270
- welcomeMessage: 'Building from tasks...',
271
- toolsSettings: {
272
- read: { allowedPaths: ['./**'] },
273
- write: { allowedPaths: ['./**'] },
274
- shell: { autoAllowReadonly: true }
275
- }
301
+ welcomeMessage: 'Building from tasks...'
276
302
  },
277
303
 
278
304
  'kspec-verify.json': {
279
305
  name: 'kspec-verify',
280
306
  description: 'Verify spec, tasks, or implementation',
307
+ model: 'claude-sonnet-4',
308
+ tools: ['read', 'shell'],
309
+ allowedTools: ['read', 'shell'],
310
+ resources: [
311
+ 'file://.kiro/steering/**/*.md',
312
+ 'file://.kspec/**/*.md'
313
+ ],
281
314
  prompt: `You are the kspec verifier. Based on what you're asked to verify:
282
315
 
283
316
  VERIFY-SPEC:
@@ -299,18 +332,20 @@ VERIFY-IMPLEMENTATION:
299
332
  - List any gaps between spec and implementation
300
333
 
301
334
  Output a clear verification report with pass/fail status.`,
302
- allowedTools: ['read', 'shell'],
303
335
  keyboardShortcut: 'ctrl+v',
304
- welcomeMessage: 'What should I verify?',
305
- toolsSettings: {
306
- read: { allowedPaths: ['./**'] },
307
- shell: { autoAllowReadonly: true }
308
- }
336
+ welcomeMessage: 'What should I verify?'
309
337
  },
310
338
 
311
339
  'kspec-review.json': {
312
340
  name: 'kspec-review',
313
341
  description: 'Code review',
342
+ model: 'claude-sonnet-4',
343
+ tools: ['read', 'shell'],
344
+ allowedTools: ['read', 'shell'],
345
+ resources: [
346
+ 'file://.kiro/steering/**/*.md',
347
+ 'file://.kspec/**/*.md'
348
+ ],
314
349
  prompt: `You are the kspec code reviewer. Your job:
315
350
  1. Review code changes (git diff or specified files)
316
351
  2. Check compliance with .kiro/steering/
@@ -322,13 +357,8 @@ Output a clear verification report with pass/fail status.`,
322
357
  4. Provide actionable feedback
323
358
 
324
359
  Output: APPROVE / REQUEST_CHANGES with specific issues.`,
325
- allowedTools: ['read', 'shell'],
326
360
  keyboardShortcut: 'ctrl+r',
327
- welcomeMessage: 'Ready to review. What should I look at?',
328
- toolsSettings: {
329
- read: { allowedPaths: ['./**'] },
330
- shell: { allowedCommands: ['git diff*', 'git log*', 'git status*', 'git show*'], autoAllowReadonly: true }
331
- }
361
+ welcomeMessage: 'Ready to review. What should I look at?'
332
362
  }
333
363
  };
334
364
 
@@ -687,4 +717,4 @@ async function run(args) {
687
717
  }
688
718
  }
689
719
 
690
- module.exports = { run, commands, loadConfig };
720
+ module.exports = { run, commands, loadConfig, detectCli, requireCli, agentTemplates };