@nolrm/contextkit 0.14.0 → 0.15.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.
package/README.md CHANGED
@@ -114,7 +114,7 @@ Each platform generates bridge files that the AI tool auto-reads. If a bridge fi
114
114
  /fix # diagnose and fix bugs
115
115
  ```
116
116
 
117
- **Claude Code** — `CLAUDE.md` uses `@` imports to auto-load all standards into context every session (no manual reads needed, saves tokens). Slash commands in `.claude/commands/`.
117
+ **Claude Code** — `CLAUDE.md` uses `@` imports to auto-load all standards into context every session (no manual reads needed, saves tokens). Skills in `.claude/skills/`.
118
118
 
119
119
  ```bash
120
120
  /analyze # scan codebase and generate standards
@@ -171,7 +171,7 @@ ContextKit installs reusable slash commands for supported platforms:
171
171
  | `/context-budget` | Prioritized guide for which standards files to load for a given task |
172
172
  | `/standards-aware` | Decide whether and how to add a newly discovered pattern to the project's standards files |
173
173
 
174
- **Claude Code** — available as `/analyze`, `/review`, etc. in `.claude/commands/`
174
+ **Claude Code** — available as `/analyze`, `/review`, etc. via `.claude/skills/`
175
175
  **Cursor** — available as slash commands in Chat via `.cursor/prompts/`
176
176
 
177
177
  Both platforms delegate to the universal command files in `.contextkit/commands/`, so you maintain one set of workflows.
package/bin/contextkit.js CHANGED
@@ -7,7 +7,6 @@ const analyze = require('../lib/commands/analyze');
7
7
  const check = require('../lib/commands/check');
8
8
  const note = require('../lib/commands/note');
9
9
  const run = require('../lib/commands/run');
10
- const GatesCommand = require('../lib/commands/gates');
11
10
 
12
11
  const packageJson = require('../package.json');
13
12
  const { checkForUpdates } = require('../lib/utils/notifier');
@@ -113,23 +112,6 @@ program
113
112
  }
114
113
  });
115
114
 
116
- // Gates command
117
- program
118
- .command('gates')
119
- .description('Inspect and manage quality gate configuration')
120
- .option('--disable <key>', 'Disable a specific gate by key')
121
- .option('--enable <key>', 'Enable a specific gate by key')
122
- .option('--list', 'List all gates and their status (default)')
123
- .action(async (options) => {
124
- try {
125
- const cmd = new GatesCommand();
126
- await cmd.run(options);
127
- } catch (error) {
128
- console.error(chalk.red('Gates command failed:'), error.message);
129
- process.exit(1);
130
- }
131
- });
132
-
133
115
  // Run command
134
116
  program
135
117
  .command('run <workflow>')
@@ -69,6 +69,7 @@ class InstallCommand {
69
69
  console.log(chalk.blue(`🔧 Adding ${requestedPlatform} integration...`));
70
70
  console.log('');
71
71
  await this.installPlatformIntegration(requestedPlatform);
72
+ await this.addContextKitGitignoreEntries();
72
73
  return;
73
74
  }
74
75
 
@@ -153,6 +154,9 @@ class InstallCommand {
153
154
  await this.installPlatformIntegration(chosenPlatform);
154
155
  }
155
156
 
157
+ // Add ephemeral ContextKit entries to .gitignore
158
+ await this.addContextKitGitignoreEntries();
159
+
156
160
  // Success message
157
161
  this.showSuccessMessage(hookChoices, chosenPlatform, projectType, packageManager);
158
162
  }
@@ -184,6 +188,31 @@ class InstallCommand {
184
188
  }
185
189
  }
186
190
 
191
+ async addContextKitGitignoreEntries() {
192
+ if (!(await fs.pathExists('.gitignore'))) return;
193
+
194
+ const entries = [
195
+ '.contextkit/status.json',
196
+ '.contextkit/status.yml',
197
+ '.contextkit/context.md',
198
+ '.contextkit/squad/',
199
+ '.contextkit/squad-done-*/',
200
+ ];
201
+
202
+ try {
203
+ const content = await fs.readFile('.gitignore', 'utf-8');
204
+ const missing = entries.filter((e) => !content.includes(e));
205
+ if (missing.length === 0) return;
206
+
207
+ const hasHeader = content.includes('# ContextKit');
208
+ const header = hasHeader ? '' : '\n# ContextKit\n';
209
+ const separator = content.endsWith('\n') ? '' : '\n';
210
+ await fs.appendFile('.gitignore', `${separator}${header}${missing.join('\n')}\n`);
211
+ } catch (error) {
212
+ console.log(chalk.yellow('⚠️ Could not update .gitignore:'), error.message);
213
+ }
214
+ }
215
+
187
216
  showPlatformUsage(platform) {
188
217
  const { getIntegration } = require('../integrations');
189
218
  const integration = getIntegration(platform);
@@ -86,7 +86,11 @@ class UpdateCommand {
86
86
  await this.refreshIntegrations();
87
87
 
88
88
  // Update version in config
89
- await this.updateConfigVersion(updateInfo.latestVersion || '1.0.0');
89
+ await this.updateConfigVersion(
90
+ updateInfo.latestVersion && updateInfo.latestVersion !== 'unknown'
91
+ ? updateInfo.latestVersion
92
+ : require('../../package.json').version
93
+ );
90
94
 
91
95
  console.log(chalk.green('✅ ContextKit updated successfully!'));
92
96
  } catch (error) {
@@ -102,16 +106,15 @@ class UpdateCommand {
102
106
  }
103
107
 
104
108
  async checkForUpdates() {
109
+ const pkg = require('../../package.json');
105
110
  try {
106
111
  const axios = require('axios');
107
112
  const response = await axios.get(
108
- 'https://api.github.com/repos/nolrm/contextkit/releases/latest',
109
- {
110
- timeout: 5000,
111
- }
113
+ `https://registry.npmjs.org/${pkg.name}/latest`,
114
+ { timeout: 5000 }
112
115
  );
113
116
 
114
- const latestVersion = response.data.tag_name.replace('v', '');
117
+ const latestVersion = response.data.version;
115
118
  const currentVersion = await this.getCurrentVersion();
116
119
  const hasUpdate = this.isNewerVersion(latestVersion, currentVersion);
117
120
 
@@ -121,10 +124,11 @@ class UpdateCommand {
121
124
  latestVersion,
122
125
  };
123
126
  } catch (error) {
127
+ // Can't reach npm registry — skip update rather than blindly running
124
128
  return {
125
- hasUpdate: true, // Assume update available if we can't check
129
+ hasUpdate: false,
126
130
  currentVersion: await this.getCurrentVersion(),
127
- latestVersion: 'latest',
131
+ latestVersion: 'unknown',
128
132
  error: error.message,
129
133
  };
130
134
  }
@@ -133,9 +137,9 @@ class UpdateCommand {
133
137
  async getCurrentVersion() {
134
138
  try {
135
139
  const config = await this.parseConfig();
136
- return config.version || '1.0.0';
140
+ return config.version || require('../../package.json').version;
137
141
  } catch {
138
- return '1.0.0';
142
+ return require('../../package.json').version;
139
143
  }
140
144
  }
141
145
 
package/lib/index.js CHANGED
@@ -1,11 +1,9 @@
1
1
  const install = require('./commands/install');
2
2
  const update = require('./commands/update');
3
3
  const status = require('./commands/status');
4
- const GatesCommand = require('./commands/gates');
5
4
 
6
5
  module.exports = {
7
6
  install,
8
7
  update,
9
8
  status,
10
- gates: GatesCommand,
11
9
  };
@@ -11,6 +11,59 @@ class ClaudeIntegration extends BaseIntegration {
11
11
  '.claude/rules/contextkit-standards.md',
12
12
  '.claude/rules/contextkit-testing.md',
13
13
  '.claude/rules/contextkit-code-style.md',
14
+ '.claude/skills/analyze/SKILL.md',
15
+ '.claude/skills/review/SKILL.md',
16
+ '.claude/skills/fix/SKILL.md',
17
+ '.claude/skills/refactor/SKILL.md',
18
+ '.claude/skills/test/SKILL.md',
19
+ '.claude/skills/doc/SKILL.md',
20
+ '.claude/skills/squad/SKILL.md',
21
+ '.claude/skills/squad-architect/SKILL.md',
22
+ '.claude/skills/squad-dev/SKILL.md',
23
+ '.claude/skills/squad-test/SKILL.md',
24
+ '.claude/skills/squad-review/SKILL.md',
25
+ '.claude/skills/squad-auto/SKILL.md',
26
+ '.claude/skills/squad-auto-parallel/SKILL.md',
27
+ '.claude/skills/squad-reset/SKILL.md',
28
+ '.claude/skills/squad-doc/SKILL.md',
29
+ '.claude/skills/spec/SKILL.md',
30
+ '.claude/skills/ck/SKILL.md',
31
+ '.claude/skills/doc-arch/SKILL.md',
32
+ '.claude/skills/doc-feature/SKILL.md',
33
+ '.claude/skills/doc-component/SKILL.md',
34
+ '.claude/skills/agent-push-checklist/SKILL.md',
35
+ '.claude/skills/context-budget/SKILL.md',
36
+ '.claude/skills/standards-aware/SKILL.md',
37
+ ];
38
+ this.platformDir = '.claude/rules';
39
+ }
40
+
41
+ async install() {
42
+ await super.install();
43
+ const fs = require('fs-extra');
44
+ await fs.ensureDir('.claude/skills');
45
+ await this.addToGitignore('.claude/settings.local.json');
46
+ await this.removeLegacyFiles();
47
+ }
48
+
49
+ async addToGitignore(entry) {
50
+ const fs = require('fs-extra');
51
+ if (!fs.existsSync('.gitignore')) return;
52
+ const content = await fs.readFile('.gitignore', 'utf-8');
53
+ if (content.includes(entry)) return;
54
+ const separator = content.endsWith('\n') ? '' : '\n';
55
+ await fs.appendFile('.gitignore', `${separator}${entry}\n`);
56
+ }
57
+
58
+ async removeLegacyFiles() {
59
+ const fs = require('fs-extra');
60
+ const legacyFiles = [
61
+ '.claude/rules/vibe-kit-standards.md',
62
+ '.claude/rules/vibe-kit-testing.md',
63
+ '.claude/rules/vibe-kit-code-style.md',
64
+ '.claude/commands/squad-batch.md',
65
+ '.claude/commands/squad-peer-review.md',
66
+ // Migrated to .claude/skills/ in 0.15.0
14
67
  '.claude/commands/analyze.md',
15
68
  '.claude/commands/review.md',
16
69
  '.claude/commands/fix.md',
@@ -31,25 +84,9 @@ class ClaudeIntegration extends BaseIntegration {
31
84
  '.claude/commands/doc-arch.md',
32
85
  '.claude/commands/doc-feature.md',
33
86
  '.claude/commands/doc-component.md',
34
- ];
35
- this.platformDir = '.claude/rules';
36
- }
37
-
38
- async install() {
39
- await super.install();
40
- const fs = require('fs-extra');
41
- await fs.ensureDir('.claude/commands');
42
- await this.removeLegacyFiles();
43
- }
44
-
45
- async removeLegacyFiles() {
46
- const fs = require('fs-extra');
47
- const legacyFiles = [
48
- '.claude/rules/vibe-kit-standards.md',
49
- '.claude/rules/vibe-kit-testing.md',
50
- '.claude/rules/vibe-kit-code-style.md',
51
- '.claude/commands/squad-batch.md',
52
- '.claude/commands/squad-peer-review.md',
87
+ '.claude/commands/agent-push-checklist.md',
88
+ '.claude/commands/context-budget.md',
89
+ '.claude/commands/standards-aware.md',
53
90
  ];
54
91
  for (const file of legacyFiles) {
55
92
  if (await fs.pathExists(file)) {
@@ -78,11 +115,11 @@ The following standards are auto-loaded into context via @imports:
78
115
 
79
116
  ## Commands
80
117
 
81
- - \`.contextkit/commands/analyze.md\` — Analyze and customize standards
82
- - \`.contextkit/commands/create-component.md\` — Create components
83
- - \`.contextkit/commands/create-feature.md\` — Create features
84
- - \`.contextkit/commands/run-tests.md\` — Run tests
85
- - \`.contextkit/commands/quality-check.md\` — Quality checks`;
118
+ - \`.contextkit/commands/dev/analyze.md\` — Analyze and customize standards
119
+ - \`.contextkit/commands/dev/create-component.md\` — Create components
120
+ - \`.contextkit/commands/dev/create-feature.md\` — Create features
121
+ - \`.contextkit/commands/dev/run-tests.md\` — Run tests
122
+ - \`.contextkit/commands/dev/quality-check.md\` — Quality checks`;
86
123
  }
87
124
 
88
125
  async generateFiles() {
@@ -163,83 +200,137 @@ Follow the code style standards auto-loaded via CLAUDE.md (from code-style.md).
163
200
  `;
164
201
  await this.writeGeneratedFile('.claude/rules/contextkit-code-style.md', codeStyleRule);
165
202
 
166
- // Slash commands thin wrappers that delegate to .contextkit/commands/
203
+ // Skills — delegate to .contextkit/commands/ with rich frontmatter for Claude Code
167
204
  await this.writeGeneratedFile(
168
- '.claude/commands/analyze.md',
169
- `# Analyze Project
205
+ '.claude/skills/analyze/SKILL.md',
206
+ `---
207
+ description: Analyze project and generate customized standards
208
+ argument-hint: "[optional: scope or package path]"
209
+ allowed-tools: Read, Glob, Grep, Write, Bash
210
+ effort: high
211
+ ---
170
212
 
171
- Read \`.contextkit/commands/analyze.md\` and execute the analysis workflow for this project.
213
+ Read \`.contextkit/commands/dev/analyze.md\` and execute the analysis workflow for this project.
172
214
 
173
215
  Scan the codebase structure, detect frameworks and patterns, then generate customized standards files in \`.contextkit/standards/\`.
174
216
  `
175
217
  );
176
218
 
177
219
  await this.writeGeneratedFile(
178
- '.claude/commands/review.md',
179
- `# Code Review
220
+ '.claude/skills/review/SKILL.md',
221
+ `---
222
+ description: Review current changes for correctness and standards compliance
223
+ argument-hint: "[optional: file or directory]"
224
+ allowed-tools: Read, Glob, Grep, Bash
225
+ effort: normal
226
+ ---
180
227
 
181
- Read \`.contextkit/commands/review.md\` and execute the review workflow.
228
+ Read \`.contextkit/commands/dev/review.md\` and execute the review workflow.
182
229
 
183
230
  Review current changes for correctness, standards compliance, and potential issues.
184
231
  `
185
232
  );
186
233
 
187
234
  await this.writeGeneratedFile(
188
- '.claude/commands/fix.md',
189
- `# Fix Bug
235
+ '.claude/skills/fix/SKILL.md',
236
+ `---
237
+ description: Diagnose root cause and implement a minimal bug fix with regression test
238
+ argument-hint: "<description of the bug>"
239
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
240
+ effort: normal
241
+ ---
190
242
 
191
- Read \`.contextkit/commands/fix.md\` and execute the bug fix workflow.
243
+ Read \`.contextkit/commands/dev/fix.md\` and execute the bug fix workflow.
192
244
 
193
245
  Diagnose the root cause, implement the minimal fix, and add a regression test.
194
246
  `
195
247
  );
196
248
 
197
249
  await this.writeGeneratedFile(
198
- '.claude/commands/refactor.md',
199
- `# Refactor
250
+ '.claude/skills/refactor/SKILL.md',
251
+ `---
252
+ description: Improve code structure without changing behavior
253
+ argument-hint: "[optional: file or scope]"
254
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
255
+ effort: normal
256
+ ---
200
257
 
201
- Read \`.contextkit/commands/refactor.md\` and execute the refactoring workflow.
258
+ Read \`.contextkit/commands/dev/refactor.md\` and execute the refactoring workflow.
202
259
 
203
260
  Improve code structure without changing behavior, keeping tests green at every step.
204
261
  `
205
262
  );
206
263
 
207
264
  await this.writeGeneratedFile(
208
- '.claude/commands/test.md',
209
- `# Run Tests
265
+ '.claude/skills/test/SKILL.md',
266
+ `---
267
+ description: Generate or run tests covering happy paths, edge cases, and errors
268
+ argument-hint: "[optional: file or function]"
269
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
270
+ effort: normal
271
+ ---
210
272
 
211
- Read \`.contextkit/commands/run-tests.md\` and execute the testing workflow.
273
+ Read \`.contextkit/commands/dev/run-tests.md\` and execute the testing workflow.
212
274
 
213
275
  Generate or run tests for the specified code, covering happy paths, edge cases, and errors.
214
276
  `
215
277
  );
216
278
 
217
279
  await this.writeGeneratedFile(
218
- '.claude/commands/doc.md',
219
- `# Add Documentation
280
+ '.claude/skills/doc/SKILL.md',
281
+ `---
282
+ description: Add inline docs, README sections, and usage examples
283
+ argument-hint: "[optional: file or module]"
284
+ allowed-tools: Read, Edit, Write, Glob, Grep
285
+ effort: normal
286
+ ---
220
287
 
221
- Read \`.contextkit/commands/add-documentation.md\` and execute the documentation workflow.
288
+ Read \`.contextkit/commands/docs/add-documentation.md\` and execute the documentation workflow.
222
289
 
223
290
  Add inline docs, README sections, and usage examples for the specified code.
224
291
  `
225
292
  );
226
293
 
227
294
  await this.writeGeneratedFile(
228
- '.claude/commands/spec.md',
229
- `# Spec
295
+ '.claude/skills/spec/SKILL.md',
296
+ `---
297
+ description: Write a component spec (MD-first) before coding begins
298
+ argument-hint: "<component or feature name>"
299
+ allowed-tools: Read, Write, Glob, Grep
300
+ effort: normal
301
+ ---
230
302
 
231
- Read \`.contextkit/commands/spec.md\` and execute the spec workflow.
303
+ Read \`.contextkit/commands/dev/spec.md\` and execute the spec workflow.
232
304
 
233
305
  Write a component spec (MD-first) before any code is created. Scaffold the spec file colocated with the component and wait for review before coding begins.
234
306
  `
235
307
  );
236
308
 
237
- // Squad slash commands
238
309
  await this.writeGeneratedFile(
239
- '.claude/commands/squad.md',
240
- `# Squad — Kickoff (start here)
310
+ '.claude/skills/ck/SKILL.md',
311
+ `---
312
+ description: Check project setup, standards status, and integrations
313
+ allowed-tools: Read, Glob, Grep, Bash
314
+ effort: low
315
+ ---
316
+
317
+ Read \`.contextkit/commands/dev/health-check.md\` and execute the health check workflow.
318
+
319
+ Check project setup, standards status, and integrations. Report what needs attention.
320
+ `
321
+ );
322
+
323
+ // Squad skills
324
+ await this.writeGeneratedFile(
325
+ '.claude/skills/squad/SKILL.md',
326
+ `---
327
+ description: Squad pipeline kickoff — create handoff file and write PO spec
328
+ argument-hint: '"<task description>"'
329
+ allowed-tools: Read, Write, Glob, Grep
330
+ effort: normal
331
+ ---
241
332
 
242
- Read \`.contextkit/commands/squad.md\` and execute the squad kickoff workflow.
333
+ Read \`.contextkit/commands/squad/squad.md\` and execute the squad kickoff workflow.
243
334
 
244
335
  Create the handoff file and write the PO spec for the given task. Pass the user's task description as the input.
245
336
 
@@ -248,101 +339,130 @@ After kickoff, run \`/squad-auto\` to auto-run the full pipeline hands-free, or
248
339
  );
249
340
 
250
341
  await this.writeGeneratedFile(
251
- '.claude/commands/squad-architect.md',
252
- `# Squad — Architect (manual step 1/4)
342
+ '.claude/skills/squad-architect/SKILL.md',
343
+ `---
344
+ description: Write technical implementation plan from PO spec (manual step 1/4)
345
+ allowed-tools: Read, Write, Glob, Grep, Bash
346
+ effort: normal
347
+ ---
253
348
 
254
- Read \`.contextkit/commands/squad-architect.md\` and execute the architect workflow.
349
+ Read \`.contextkit/commands/squad/squad-architect.md\` and execute the architect workflow.
255
350
 
256
351
  Read the PO spec from the handoff file, design the technical approach, and write the implementation plan. Use \`/squad-auto\` instead to run all steps automatically.
257
352
  `
258
353
  );
259
354
 
260
355
  await this.writeGeneratedFile(
261
- '.claude/commands/squad-dev.md',
262
- `# Squad — Dev (manual step 2/4)
356
+ '.claude/skills/squad-dev/SKILL.md',
357
+ `---
358
+ description: Implement code changes following architect plan (manual step 2/4)
359
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
360
+ effort: normal
361
+ ---
263
362
 
264
- Read \`.contextkit/commands/squad-dev.md\` and execute the dev workflow.
363
+ Read \`.contextkit/commands/squad/squad-dev.md\` and execute the dev workflow.
265
364
 
266
365
  Follow the architect's plan to implement the code changes. Use \`/squad-auto\` instead to run all steps automatically.
267
366
  `
268
367
  );
269
368
 
270
369
  await this.writeGeneratedFile(
271
- '.claude/commands/squad-test.md',
272
- `# Squad — Test (manual step 3/4)
370
+ '.claude/skills/squad-test/SKILL.md',
371
+ `---
372
+ description: Write and run tests against acceptance criteria (manual step 3/4)
373
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
374
+ effort: normal
375
+ ---
273
376
 
274
- Read \`.contextkit/commands/squad-test.md\` and execute the test workflow.
377
+ Read \`.contextkit/commands/squad/squad-test.md\` and execute the test workflow.
275
378
 
276
379
  Write and run tests against the PO's acceptance criteria. Use \`/squad-auto\` instead to run all steps automatically.
277
380
  `
278
381
  );
279
382
 
280
383
  await this.writeGeneratedFile(
281
- '.claude/commands/squad-review.md',
282
- `# Squad — Review (manual step 4/4)
384
+ '.claude/skills/squad-review/SKILL.md',
385
+ `---
386
+ description: Review full handoff and write pass/needs-work verdict (manual step 4/4)
387
+ allowed-tools: Read, Write, Glob, Grep, Bash
388
+ effort: normal
389
+ ---
283
390
 
284
- Read \`.contextkit/commands/squad-review.md\` and execute the review workflow.
391
+ Read \`.contextkit/commands/squad/squad-review.md\` and execute the review workflow.
285
392
 
286
393
  Review the full handoff (spec, plan, implementation, tests) and write the final verdict. Use \`/squad-auto\` instead to run all steps automatically.
287
394
  `
288
395
  );
289
396
 
290
397
  await this.writeGeneratedFile(
291
- '.claude/commands/squad-auto.md',
292
- `# Squad Auto — Full Pipeline (recommended)
398
+ '.claude/skills/squad-auto/SKILL.md',
399
+ `---
400
+ description: Auto-run full squad pipeline hands-free (architect → dev → test → review → doc)
401
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
402
+ effort: high
403
+ context: fork
404
+ ---
293
405
 
294
- Read \`.contextkit/commands/squad-auto.md\` and execute the pipeline runner workflow.
406
+ Read \`.contextkit/commands/squad/squad-auto.md\` and execute the pipeline runner workflow.
295
407
 
296
408
  Run after \`/squad\` kickoff. Automatically runs architect → dev → test → review for all tasks sequentially, hands-free.
297
409
  `
298
410
  );
299
411
 
300
412
  await this.writeGeneratedFile(
301
- '.claude/commands/squad-auto-parallel.md',
302
- `# Squad Auto — Parallel Agents (batch, fastest)
413
+ '.claude/skills/squad-auto-parallel/SKILL.md',
414
+ `---
415
+ description: Auto-run squad pipeline with parallel agents — one per task per phase (fastest)
416
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
417
+ effort: high
418
+ context: fork
419
+ ---
303
420
 
304
- Read \`.contextkit/commands/squad-auto-parallel.md\` and execute the parallel pipeline workflow.
421
+ Read \`.contextkit/commands/squad/squad-auto-parallel.md\` and execute the parallel pipeline workflow.
305
422
 
306
423
  Spawn one subagent per task per phase using the Task tool, so all tasks progress simultaneously instead of sequentially. Use this after \`/squad\` batch kickoff for faster execution on multi-task batches.
307
424
  `
308
425
  );
309
426
 
310
427
  await this.writeGeneratedFile(
311
- '.claude/commands/squad-reset.md',
312
- `# Squad — Reset
428
+ '.claude/skills/squad-reset/SKILL.md',
429
+ `---
430
+ description: Delete squad state to start fresh
431
+ allowed-tools: Read, Write, Glob
432
+ effort: low
433
+ ---
313
434
 
314
- Read \`.contextkit/commands/squad-reset.md\` and execute the reset workflow.
435
+ Read \`.contextkit/commands/squad/squad-reset.md\` and execute the reset workflow.
315
436
 
316
437
  Delete the current squad state (.contextkit/squad/) so you can start fresh. Use when the squad folder is in a mixed or stuck state.
317
438
  `
318
439
  );
319
440
 
320
441
  await this.writeGeneratedFile(
321
- '.claude/commands/squad-doc.md',
322
- `# Squad — Doc (manual step 5/5)
442
+ '.claude/skills/squad-doc/SKILL.md',
443
+ `---
444
+ description: Document changes after review passes (manual step 5/5)
445
+ allowed-tools: Read, Edit, Write, Glob, Grep
446
+ effort: normal
447
+ ---
323
448
 
324
- Read \`.contextkit/commands/squad-doc.md\` and execute the doc workflow.
449
+ Read \`.contextkit/commands/squad/squad-doc.md\` and execute the doc workflow.
325
450
 
326
451
  After review passes, create or update companion .md files for every new/modified code file in this task. Use \`/squad-auto\` instead to run all steps automatically.
327
452
  `
328
453
  );
329
454
 
455
+ // Doc family skills
330
456
  await this.writeGeneratedFile(
331
- '.claude/commands/ck.md',
332
- `# ContextKit Health Check
333
-
334
- Read \`.contextkit/commands/health-check.md\` and execute the health check workflow.
335
-
336
- Check project setup, standards status, and integrations. Report what needs attention.
337
- `
338
- );
339
-
340
- // Doc family slash commands
341
- await this.writeGeneratedFile(
342
- '.claude/commands/doc-arch.md',
343
- `# Doc — Architecture (Level 1)
457
+ '.claude/skills/doc-arch/SKILL.md',
458
+ `---
459
+ description: Generate or update architecture documentation (Level 1)
460
+ argument-hint: "[optional: PR number]"
461
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
462
+ effort: high
463
+ ---
344
464
 
345
- Read \`.contextkit/commands/doc-arch.md\` and execute the architecture documentation workflow.
465
+ Read \`.contextkit/commands/docs/doc-arch.md\` and execute the architecture documentation workflow.
346
466
 
347
467
  Detect the project stack, then generate or update \`docs/architecture.md\` with system boundaries, key flows, and stack-appropriate artifacts (Mermaid diagrams, component trees, service maps).
348
468
 
@@ -351,10 +471,15 @@ Pass an optional PR number to scope to that PR's changes.
351
471
  );
352
472
 
353
473
  await this.writeGeneratedFile(
354
- '.claude/commands/doc-feature.md',
355
- `# Doc — Feature (Level 2)
474
+ '.claude/skills/doc-feature/SKILL.md',
475
+ `---
476
+ description: Generate or update feature documentation (Level 2)
477
+ argument-hint: "[optional: feature name, path, or PR number]"
478
+ allowed-tools: Read, Edit, Write, Glob, Grep, Bash
479
+ effort: high
480
+ ---
356
481
 
357
- Read \`.contextkit/commands/doc-feature.md\` and execute the feature documentation workflow.
482
+ Read \`.contextkit/commands/docs/doc-feature.md\` and execute the feature documentation workflow.
358
483
 
359
484
  Detect the project stack, identify the target feature from the argument or current branch, then generate or update \`docs/features/<name>.md\` with purpose, components/modules, data flow, and user flows.
360
485
 
@@ -363,14 +488,62 @@ Pass a feature name, directory path, or PR number to scope the documentation.
363
488
  );
364
489
 
365
490
  await this.writeGeneratedFile(
366
- '.claude/commands/doc-component.md',
367
- `# Doc — Component (Level 3)
491
+ '.claude/skills/doc-component/SKILL.md',
492
+ `---
493
+ description: Generate or update component documentation (Level 3)
494
+ argument-hint: "[optional: file path or directory]"
495
+ allowed-tools: Read, Edit, Write, Glob, Grep
496
+ effort: normal
497
+ ---
368
498
 
369
- Read \`.contextkit/commands/doc-component.md\` and execute the component documentation workflow.
499
+ Read \`.contextkit/commands/docs/doc-component.md\` and execute the component documentation workflow.
370
500
 
371
501
  Detect the project stack, read the target file or directory, then create or update a colocated \`<name>.md\` with API/props, usage examples, behavior, and edge cases.
372
502
 
373
503
  Pass a file path or directory to target. Omit to infer from current context.
504
+ `
505
+ );
506
+
507
+ // Agent skills
508
+ await this.writeGeneratedFile(
509
+ '.claude/skills/agent-push-checklist/SKILL.md',
510
+ `---
511
+ description: Pre-push quality checklist for agents before git push
512
+ allowed-tools: Read, Glob, Grep, Bash
513
+ effort: low
514
+ ---
515
+
516
+ Read \`.contextkit/commands/agents/agent-push-checklist.md\` and execute the agent push checklist workflow.
517
+
518
+ Run before pushing from an AI agent. Validates that changes are safe, tests pass, and the push is ready.
519
+ `
520
+ );
521
+
522
+ await this.writeGeneratedFile(
523
+ '.claude/skills/context-budget/SKILL.md',
524
+ `---
525
+ description: Check context consumption and advise on compact, summarise, or continue
526
+ allowed-tools: Read, Glob, Grep
527
+ effort: low
528
+ ---
529
+
530
+ Read \`.contextkit/commands/agents/context-budget.md\` and execute the context budget workflow.
531
+
532
+ Check how much context has been consumed and advise on whether to compact, summarise, or continue.
533
+ `
534
+ );
535
+
536
+ await this.writeGeneratedFile(
537
+ '.claude/skills/standards-aware/SKILL.md',
538
+ `---
539
+ description: Load and apply project standards before acting in an agentic context
540
+ allowed-tools: Read, Glob, Grep
541
+ effort: low
542
+ ---
543
+
544
+ Read \`.contextkit/commands/agents/standards-aware.md\` and execute the standards-aware workflow.
545
+
546
+ Load and apply the project's ContextKit standards before taking action in an agentic context.
374
547
  `
375
548
  );
376
549
  }
@@ -132,8 +132,8 @@ Reference: @.contextkit/standards/code-style.md
132
132
 
133
133
  ## Commands
134
134
 
135
- - @.contextkit/commands/create-component.md — Create component workflow
136
- - @.contextkit/commands/spec.md — Write a component spec before coding
135
+ - @.contextkit/commands/dev/create-component.md — Create component workflow
136
+ - @.contextkit/commands/dev/spec.md — Write a component spec before coding
137
137
  `;
138
138
  await this.writeGeneratedFile('.cursor/rules/contextkit-components.mdc', componentsRule);
139
139
 
@@ -154,7 +154,7 @@ Reference: @.contextkit/standards/architecture.md
154
154
 
155
155
  ## Commands
156
156
 
157
- - @.contextkit/commands/create-feature.md — Create feature workflow
157
+ - @.contextkit/commands/dev/create-feature.md — Create feature workflow
158
158
  `;
159
159
  await this.writeGeneratedFile('.cursor/rules/contextkit-api.mdc', apiRule);
160
160
 
@@ -163,7 +163,7 @@ Reference: @.contextkit/standards/architecture.md
163
163
  '.cursor/prompts/analyze.md',
164
164
  `# Analyze Project
165
165
 
166
- Read \`.contextkit/commands/analyze.md\` and execute the analysis workflow for this project.
166
+ Read \`.contextkit/commands/dev/analyze.md\` and execute the analysis workflow for this project.
167
167
 
168
168
  Scan the codebase structure, detect frameworks and patterns, then generate customized standards files in \`.contextkit/standards/\`.
169
169
  `
@@ -173,7 +173,7 @@ Scan the codebase structure, detect frameworks and patterns, then generate custo
173
173
  '.cursor/prompts/review.md',
174
174
  `# Code Review
175
175
 
176
- Read \`.contextkit/commands/review.md\` and execute the review workflow.
176
+ Read \`.contextkit/commands/dev/review.md\` and execute the review workflow.
177
177
 
178
178
  Review current changes for correctness, standards compliance, and potential issues. Flag bugs, security concerns, and standards violations.
179
179
  `
@@ -183,7 +183,7 @@ Review current changes for correctness, standards compliance, and potential issu
183
183
  '.cursor/prompts/fix.md',
184
184
  `# Fix Bug
185
185
 
186
- Read \`.contextkit/commands/fix.md\` and execute the bug fix workflow.
186
+ Read \`.contextkit/commands/dev/fix.md\` and execute the bug fix workflow.
187
187
 
188
188
  Diagnose the root cause, implement the minimal fix, and add a regression test.
189
189
  `
@@ -193,7 +193,7 @@ Diagnose the root cause, implement the minimal fix, and add a regression test.
193
193
  '.cursor/prompts/refactor.md',
194
194
  `# Refactor
195
195
 
196
- Read \`.contextkit/commands/refactor.md\` and execute the refactoring workflow.
196
+ Read \`.contextkit/commands/dev/refactor.md\` and execute the refactoring workflow.
197
197
 
198
198
  Improve code structure without changing behavior, keeping tests green at every step.
199
199
  `
@@ -203,7 +203,7 @@ Improve code structure without changing behavior, keeping tests green at every s
203
203
  '.cursor/prompts/test.md',
204
204
  `# Run Tests
205
205
 
206
- Read \`.contextkit/commands/run-tests.md\` and execute the testing workflow.
206
+ Read \`.contextkit/commands/dev/run-tests.md\` and execute the testing workflow.
207
207
 
208
208
  Generate or run tests for the specified code, covering happy paths, edge cases, and errors.
209
209
  `
@@ -213,7 +213,7 @@ Generate or run tests for the specified code, covering happy paths, edge cases,
213
213
  '.cursor/prompts/doc.md',
214
214
  `# Add Documentation
215
215
 
216
- Read \`.contextkit/commands/add-documentation.md\` and execute the documentation workflow.
216
+ Read \`.contextkit/commands/docs/add-documentation.md\` and execute the documentation workflow.
217
217
 
218
218
  Add inline docs, README sections, and usage examples for the specified code.
219
219
  `
@@ -224,7 +224,7 @@ Add inline docs, README sections, and usage examples for the specified code.
224
224
  '.cursor/prompts/squad.md',
225
225
  `# Squad — Kickoff
226
226
 
227
- Read \`.contextkit/commands/squad.md\` and execute the squad kickoff workflow.
227
+ Read \`.contextkit/commands/squad/squad.md\` and execute the squad kickoff workflow.
228
228
 
229
229
  Create the handoff file and write the PO spec for the given task. Pass the user's task description as the input.
230
230
  `
@@ -234,7 +234,7 @@ Create the handoff file and write the PO spec for the given task. Pass the user'
234
234
  '.cursor/prompts/squad-architect.md',
235
235
  `# Squad — Architect
236
236
 
237
- Read \`.contextkit/commands/squad-architect.md\` and execute the architect workflow.
237
+ Read \`.contextkit/commands/squad/squad-architect.md\` and execute the architect workflow.
238
238
 
239
239
  Read the PO spec from the handoff file, design the technical approach, and write the implementation plan.
240
240
  `
@@ -244,7 +244,7 @@ Read the PO spec from the handoff file, design the technical approach, and write
244
244
  '.cursor/prompts/squad-dev.md',
245
245
  `# Squad — Dev
246
246
 
247
- Read \`.contextkit/commands/squad-dev.md\` and execute the dev workflow.
247
+ Read \`.contextkit/commands/squad/squad-dev.md\` and execute the dev workflow.
248
248
 
249
249
  Follow the architect's plan to implement the code changes.
250
250
  `
@@ -254,7 +254,7 @@ Follow the architect's plan to implement the code changes.
254
254
  '.cursor/prompts/squad-test.md',
255
255
  `# Squad — Test
256
256
 
257
- Read \`.contextkit/commands/squad-test.md\` and execute the test workflow.
257
+ Read \`.contextkit/commands/squad/squad-test.md\` and execute the test workflow.
258
258
 
259
259
  Write and run tests against the PO's acceptance criteria.
260
260
  `
@@ -264,7 +264,7 @@ Write and run tests against the PO's acceptance criteria.
264
264
  '.cursor/prompts/squad-review.md',
265
265
  `# Squad — Review
266
266
 
267
- Read \`.contextkit/commands/squad-review.md\` and execute the review workflow.
267
+ Read \`.contextkit/commands/squad/squad-review.md\` and execute the review workflow.
268
268
 
269
269
  Review the full handoff (spec, plan, implementation, tests) and write the final verdict.
270
270
  `
@@ -274,7 +274,7 @@ Review the full handoff (spec, plan, implementation, tests) and write the final
274
274
  '.cursor/prompts/squad-auto.md',
275
275
  `# Squad Auto — Full Pipeline (recommended)
276
276
 
277
- Read \`.contextkit/commands/squad-auto.md\` and execute the pipeline runner workflow.
277
+ Read \`.contextkit/commands/squad/squad-auto.md\` and execute the pipeline runner workflow.
278
278
 
279
279
  Run after kickoff. Automatically runs architect → dev → test → review for all tasks sequentially, hands-free.
280
280
  `
@@ -284,7 +284,7 @@ Run after kickoff. Automatically runs architect → dev → test → review for
284
284
  '.cursor/prompts/spec.md',
285
285
  `# Spec
286
286
 
287
- Read \`.contextkit/commands/spec.md\` and execute the spec workflow.
287
+ Read \`.contextkit/commands/dev/spec.md\` and execute the spec workflow.
288
288
 
289
289
  Write a component spec (MD-first) before any code is created. Scaffold the spec file colocated with the component and wait for review before coding begins.
290
290
  `
@@ -294,7 +294,7 @@ Write a component spec (MD-first) before any code is created. Scaffold the spec
294
294
  '.cursor/prompts/ck.md',
295
295
  `# ContextKit Health Check
296
296
 
297
- Read \`.contextkit/commands/health-check.md\` and execute the health check workflow.
297
+ Read \`.contextkit/commands/dev/health-check.md\` and execute the health check workflow.
298
298
 
299
299
  Check project setup, standards status, and integrations. Report what needs attention.
300
300
  `
@@ -11,7 +11,10 @@ class MigrationRunner {
11
11
  * @param {string} configPath - path to config.yml
12
12
  */
13
13
  async run(currentVersion, configPath) {
14
- const from = currentVersion === undefined || currentVersion === null ? 0 : currentVersion;
14
+ const from =
15
+ currentVersion === undefined || currentVersion === null || Number.isNaN(currentVersion)
16
+ ? 0
17
+ : currentVersion;
15
18
 
16
19
  if (from > CURRENT_FORMAT_VERSION) {
17
20
  console.log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolrm/contextkit",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "ContextKit - Context Engineering for AI Development. Provide rich context to AI through structured MD files with standards, code guides, and documentation. Works with Cursor, Claude, Aider, VS Code Copilot, and more.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -1,119 +0,0 @@
1
- const chalk = require('chalk');
2
- const fs = require('fs-extra');
3
- const yaml = require('js-yaml');
4
-
5
- const KNOWN_GATES = {
6
- 'Node.js': ['typescript', 'eslint', 'prettier', 'format', 'lint', 'build', 'test', 'e2e'],
7
- Python: ['ruff-lint', 'typecheck', 'ruff-format', 'pytest'],
8
- Rust: ['cargo-check', 'clippy', 'cargo-test'],
9
- Go: ['go-vet', 'golangci-lint', 'go-test'],
10
- PHP: ['phpstan', 'phpunit'],
11
- Ruby: ['rubocop', 'rspec'],
12
- 'Java / Kotlin': ['maven-verify', 'gradle-check', 'ktlint', 'kotlin-test'],
13
- Swift: ['swiftlint', 'swift-test'],
14
- '.NET': ['dotnet-build', 'dotnet-test'],
15
- };
16
-
17
- const ALL_GATE_KEYS = Object.values(KNOWN_GATES).flat();
18
- const GATES_CONFIG_PATH = '.contextkit/quality-gates.yml';
19
-
20
- class GatesCommand {
21
- async run(options = {}) {
22
- if (!(await fs.pathExists('.contextkit/config.yml'))) {
23
- console.log(chalk.red('ContextKit not installed. Run: ck install'));
24
- process.exit(1);
25
- }
26
-
27
- if (options.disable) {
28
- await this.disable(options.disable);
29
- } else if (options.enable) {
30
- await this.enable(options.enable);
31
- } else {
32
- await this.list();
33
- }
34
- }
35
-
36
- async list() {
37
- const disabled = await this.readDisabled();
38
- console.log(chalk.bold('\nQuality Gates\n'));
39
- for (const [stack, keys] of Object.entries(KNOWN_GATES)) {
40
- console.log(chalk.cyan(` ${stack}`));
41
- for (const key of keys) {
42
- const isDisabled = disabled.includes(key);
43
- const status = isDisabled ? chalk.yellow('[disabled]') : chalk.green('[enabled] ');
44
- console.log(` ${status} ${key}`);
45
- }
46
- }
47
- console.log('');
48
- console.log(chalk.yellow(' To disable a gate: ck gates --disable <key>'));
49
- console.log(chalk.yellow(' To enable a gate: ck gates --enable <key>'));
50
- console.log('');
51
- }
52
-
53
- async disable(key) {
54
- if (!ALL_GATE_KEYS.includes(key)) {
55
- this.printInvalidKey(key);
56
- process.exit(1);
57
- }
58
- const disabled = await this.readDisabled();
59
- if (disabled.includes(key)) {
60
- console.log(chalk.yellow(`Gate "${key}" is already disabled.`));
61
- return;
62
- }
63
- disabled.push(key);
64
- await this.writeDisabled(disabled);
65
- console.log(chalk.green(`✅ Gate "${key}" disabled.`));
66
- }
67
-
68
- async enable(key) {
69
- if (!ALL_GATE_KEYS.includes(key)) {
70
- this.printInvalidKey(key);
71
- process.exit(1);
72
- }
73
- const disabled = await this.readDisabled();
74
- const idx = disabled.indexOf(key);
75
- if (idx === -1) {
76
- console.log(chalk.yellow(`Gate "${key}" is already enabled.`));
77
- return;
78
- }
79
- disabled.splice(idx, 1);
80
- await this.writeDisabled(disabled);
81
- console.log(chalk.green(`✅ Gate "${key}" enabled.`));
82
- }
83
-
84
- async readDisabled() {
85
- if (!(await fs.pathExists(GATES_CONFIG_PATH))) return [];
86
- try {
87
- const content = await fs.readFile(GATES_CONFIG_PATH, 'utf-8');
88
- const parsed = yaml.load(content);
89
- return Array.isArray(parsed && parsed.disabled) ? parsed.disabled : [];
90
- } catch (err) {
91
- console.error(chalk.red('Error reading quality-gates.yml:'), err.message);
92
- process.exit(1);
93
- }
94
- }
95
-
96
- async writeDisabled(disabled) {
97
- if (!(await fs.pathExists(GATES_CONFIG_PATH))) {
98
- await fs.writeFile(GATES_CONFIG_PATH, `# Quality Gates Configuration\n\ndisabled:\n`);
99
- }
100
- const content = await fs.readFile(GATES_CONFIG_PATH, 'utf-8');
101
- // Replace or append the disabled block, preserving comments above it
102
- const withoutDisabled = content.replace(/^disabled:[\s\S]*$/m, '').trimEnd();
103
- const disabledBlock =
104
- disabled.length > 0
105
- ? `\ndisabled:\n${disabled.map((k) => ` - ${k}`).join('\n')}\n`
106
- : `\ndisabled:\n`;
107
- await fs.writeFile(GATES_CONFIG_PATH, withoutDisabled + disabledBlock);
108
- }
109
-
110
- printInvalidKey(key) {
111
- console.error(chalk.red(`Unknown gate key: "${key}"`));
112
- console.log(chalk.yellow('\nValid gate keys:'));
113
- for (const [stack, keys] of Object.entries(KNOWN_GATES)) {
114
- console.log(chalk.cyan(` ${stack}: `) + keys.join(', '));
115
- }
116
- }
117
- }
118
-
119
- module.exports = GatesCommand;