@nolrm/contextkit 0.14.0 → 0.14.1
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 +2 -2
- package/bin/contextkit.js +0 -18
- package/lib/index.js +0 -2
- package/lib/integrations/claude-integration.js +267 -94
- package/package.json +1 -1
- package/lib/commands/gates.js +0 -119
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).
|
|
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.
|
|
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>')
|
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
|
-
|
|
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
|
-
//
|
|
203
|
+
// Skills — delegate to .contextkit/commands/ with rich frontmatter for Claude Code
|
|
167
204
|
await this.writeGeneratedFile(
|
|
168
|
-
'.claude/
|
|
169
|
-
|
|
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/
|
|
179
|
-
|
|
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/
|
|
189
|
-
|
|
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/
|
|
199
|
-
|
|
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/
|
|
209
|
-
|
|
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/
|
|
219
|
-
|
|
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/
|
|
229
|
-
|
|
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/
|
|
240
|
-
|
|
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/
|
|
252
|
-
|
|
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/
|
|
262
|
-
|
|
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/
|
|
272
|
-
|
|
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/
|
|
282
|
-
|
|
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/
|
|
292
|
-
|
|
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/
|
|
302
|
-
|
|
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/
|
|
312
|
-
|
|
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/
|
|
322
|
-
|
|
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/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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/
|
|
355
|
-
|
|
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/
|
|
367
|
-
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
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": {
|
package/lib/commands/gates.js
DELETED
|
@@ -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;
|