@nolrm/contextkit 0.12.14 → 0.12.17
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 +13 -16
- package/bin/contextkit.js +1 -1
- package/lib/commands/install.js +6 -0
- package/lib/commands/update.js +20 -0
- package/lib/integrations/claude-integration.js +9 -0
- package/lib/utils/banner.js +47 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,6 +213,14 @@ Pass multiple tasks to `/squad` and it automatically runs in batch mode:
|
|
|
213
213
|
# Phase 2: dev→test→review pipeline runs in parallel per task
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
+
**Model routing (Claude Code only):** Set `model_routing: true` in `.contextkit/squad/config.md` to have `/squad-auto` automatically use Claude Haiku for Dev and Test phases. Architect and Review always run on your primary model. Saves ~35% tokens with no quality loss — the standards files and Review gate maintain quality.
|
|
217
|
+
|
|
218
|
+
```markdown
|
|
219
|
+
# .contextkit/squad/config.md
|
|
220
|
+
checkpoint: po
|
|
221
|
+
model_routing: true # dev + test → Haiku, architect + review → primary model
|
|
222
|
+
```
|
|
223
|
+
|
|
216
224
|
### Feedback Loop
|
|
217
225
|
|
|
218
226
|
Any downstream role can raise questions for an upstream role. When this happens, the pipeline pauses and directs you to the right command:
|
|
@@ -288,8 +296,6 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
288
296
|
- ⚡ **Zero Config** - Auto-detects project type and package manager
|
|
289
297
|
- ✅ **Policy Enforcement** - Configurable validation with `ck check`
|
|
290
298
|
- 📝 **Corrections Tracking** - Track AI performance issues with corrections log
|
|
291
|
-
- 🔄 **Workflow Orchestration** - Structured workflows with `ck run`
|
|
292
|
-
- 📦 **Registry System** - Share standards across teams with `ck publish/pull`
|
|
293
299
|
- 📊 **Observability Dashboard** - Visual metrics and compliance tracking
|
|
294
300
|
|
|
295
301
|
## Commands
|
|
@@ -297,7 +303,7 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
297
303
|
```bash
|
|
298
304
|
# Installation & Setup
|
|
299
305
|
ck install # set up .contextkit + pick AI tool interactively
|
|
300
|
-
ck install claude # set up .contextkit + Claude
|
|
306
|
+
ck install claude # set up .contextkit + Claude, or add Claude to an existing install
|
|
301
307
|
ck claude # add Claude Code integration (CLAUDE.md + rules)
|
|
302
308
|
ck cursor # add Cursor integration (scoped .mdc rules)
|
|
303
309
|
ck copilot # add GitHub Copilot integration
|
|
@@ -322,23 +328,14 @@ ck check --strict # treat warnings as errors
|
|
|
322
328
|
ck note "message" # add note to corrections log
|
|
323
329
|
ck note "AI issue" --category "AI Behavior" --priority HIGH
|
|
324
330
|
|
|
325
|
-
#
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
# Registry & Versioning
|
|
331
|
-
ck publish --name @company/react-standards --version 1.0.0
|
|
332
|
-
ck pull @company/react-standards@1.0.0
|
|
333
|
-
ck pull @company/react-standards@latest --backup
|
|
331
|
+
# Squad — multi-role AI pipeline (slash commands in your AI tool)
|
|
332
|
+
/squad "add dark mode" # PO writes spec
|
|
333
|
+
/squad-auto # runs architect → dev → test → review hands-free
|
|
334
|
+
/squad-reset # clear stuck or mixed squad state
|
|
334
335
|
|
|
335
336
|
# Observability
|
|
336
337
|
ck dashboard # start web dashboard
|
|
337
338
|
ck dashboard --no-server # CLI metrics only
|
|
338
|
-
|
|
339
|
-
# AI Usage (loads .contextkit context automatically)
|
|
340
|
-
ck "create a button" # quick AI chat with context
|
|
341
|
-
ck ai "create a button" # explicit AI command
|
|
342
339
|
```
|
|
343
340
|
|
|
344
341
|
## Links
|
package/bin/contextkit.js
CHANGED
|
@@ -27,7 +27,7 @@ program
|
|
|
27
27
|
.option('--non-interactive', 'Skip interactive prompts')
|
|
28
28
|
.action(async (platform, options) => {
|
|
29
29
|
try {
|
|
30
|
-
await install({ ...options, ...(platform ? { platform
|
|
30
|
+
await install({ ...options, ...(platform ? { platform } : { fullInstall: true }) });
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error(chalk.red('Installation failed:'), error.message);
|
|
33
33
|
process.exit(1);
|
package/lib/commands/install.js
CHANGED
|
@@ -9,6 +9,7 @@ const DownloadManager = require('../utils/download');
|
|
|
9
9
|
const ProjectDetector = require('../utils/project-detector');
|
|
10
10
|
const GitHooksManager = require('../utils/git-hooks');
|
|
11
11
|
const StatusManager = require('../utils/status-manager');
|
|
12
|
+
const { printBanner } = require('../utils/banner');
|
|
12
13
|
|
|
13
14
|
class InstallCommand {
|
|
14
15
|
constructor() {
|
|
@@ -69,6 +70,7 @@ class InstallCommand {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
// Full installation
|
|
73
|
+
printBanner();
|
|
72
74
|
console.log(chalk.magenta('🎵 Installing ContextKit...'));
|
|
73
75
|
console.log('');
|
|
74
76
|
|
|
@@ -728,6 +730,10 @@ Any design decisions, trade-offs, or open questions to resolve before coding.
|
|
|
728
730
|
`${this.repoUrl}/commands/squad-auto-parallel.md`,
|
|
729
731
|
'.contextkit/commands/squad-auto-parallel.md'
|
|
730
732
|
);
|
|
733
|
+
await this.downloadManager.downloadFile(
|
|
734
|
+
`${this.repoUrl}/commands/squad-reset.md`,
|
|
735
|
+
'.contextkit/commands/squad-reset.md'
|
|
736
|
+
);
|
|
731
737
|
|
|
732
738
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
733
739
|
await this.downloadManager.downloadFile(
|
package/lib/commands/update.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const DownloadManager = require('../utils/download');
|
|
7
7
|
const ProjectDetector = require('../utils/project-detector');
|
|
8
8
|
const GitHooksManager = require('../utils/git-hooks');
|
|
9
|
+
const { printBanner } = require('../utils/banner');
|
|
9
10
|
|
|
10
11
|
class UpdateCommand {
|
|
11
12
|
constructor() {
|
|
@@ -16,6 +17,7 @@ class UpdateCommand {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
async update(options = {}) {
|
|
20
|
+
printBanner();
|
|
19
21
|
console.log(chalk.magenta('🔄 Updating ContextKit...'));
|
|
20
22
|
|
|
21
23
|
// Check if ContextKit is installed
|
|
@@ -55,6 +57,9 @@ class UpdateCommand {
|
|
|
55
57
|
// Download latest files
|
|
56
58
|
await this.downloadFiles(projectType);
|
|
57
59
|
|
|
60
|
+
// Remove files that were removed from CK
|
|
61
|
+
await this.removeLegacyFiles();
|
|
62
|
+
|
|
58
63
|
// Restore user configuration
|
|
59
64
|
await this.restoreUserConfig(config);
|
|
60
65
|
|
|
@@ -282,6 +287,10 @@ class UpdateCommand {
|
|
|
282
287
|
`${this.repoUrl}/commands/squad-auto-parallel.md`,
|
|
283
288
|
'.contextkit/commands/squad-auto-parallel.md'
|
|
284
289
|
);
|
|
290
|
+
await this.downloadManager.downloadFile(
|
|
291
|
+
`${this.repoUrl}/commands/squad-reset.md`,
|
|
292
|
+
'.contextkit/commands/squad-reset.md'
|
|
293
|
+
);
|
|
285
294
|
|
|
286
295
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
287
296
|
await this.downloadManager.downloadFile(
|
|
@@ -401,6 +410,17 @@ commands:
|
|
|
401
410
|
}
|
|
402
411
|
}
|
|
403
412
|
|
|
413
|
+
async removeLegacyFiles() {
|
|
414
|
+
const legacyFiles = [
|
|
415
|
+
'.contextkit/commands/squad-peer-review.md',
|
|
416
|
+
];
|
|
417
|
+
for (const file of legacyFiles) {
|
|
418
|
+
if (await fs.pathExists(file)) {
|
|
419
|
+
await fs.remove(file);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
404
424
|
async updateConfigVersion(version) {
|
|
405
425
|
const configContent = await fs.readFile('.contextkit/config.yml', 'utf8');
|
|
406
426
|
const updatedContent = configContent.replace(
|
|
@@ -24,6 +24,7 @@ class ClaudeIntegration extends BaseIntegration {
|
|
|
24
24
|
'.claude/commands/squad-review.md',
|
|
25
25
|
'.claude/commands/squad-auto.md',
|
|
26
26
|
'.claude/commands/squad-auto-parallel.md',
|
|
27
|
+
'.claude/commands/squad-reset.md',
|
|
27
28
|
'.claude/commands/spec.md',
|
|
28
29
|
'.claude/commands/ck.md',
|
|
29
30
|
];
|
|
@@ -44,6 +45,7 @@ class ClaudeIntegration extends BaseIntegration {
|
|
|
44
45
|
'.claude/rules/vibe-kit-testing.md',
|
|
45
46
|
'.claude/rules/vibe-kit-code-style.md',
|
|
46
47
|
'.claude/commands/squad-batch.md',
|
|
48
|
+
'.claude/commands/squad-peer-review.md',
|
|
47
49
|
];
|
|
48
50
|
for (const file of legacyFiles) {
|
|
49
51
|
if (await fs.pathExists(file)) {
|
|
@@ -252,6 +254,13 @@ Run after \`/squad\` kickoff. Automatically runs architect → dev → test →
|
|
|
252
254
|
Read \`.contextkit/commands/squad-auto-parallel.md\` and execute the parallel pipeline workflow.
|
|
253
255
|
|
|
254
256
|
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.
|
|
257
|
+
`);
|
|
258
|
+
|
|
259
|
+
await this.writeGeneratedFile('.claude/commands/squad-reset.md', `# Squad — Reset
|
|
260
|
+
|
|
261
|
+
Read \`.contextkit/commands/squad-reset.md\` and execute the reset workflow.
|
|
262
|
+
|
|
263
|
+
Delete the current squad state (.contextkit/squad/) so you can start fresh. Use when the squad folder is in a mixed or stuck state.
|
|
255
264
|
`);
|
|
256
265
|
|
|
257
266
|
await this.writeGeneratedFile('.claude/commands/ck.md', `# ContextKit Health Check
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
|
|
3
|
+
// ── ASCII art ──────────────────────────────────────────────────────────────
|
|
4
|
+
|
|
5
|
+
const LINES = [
|
|
6
|
+
' ______ __ __ __ __ _ __ ',
|
|
7
|
+
' / ____/ ____ ____ / /_ ___ _ __ / /_ / //_/ (_) / /_ ',
|
|
8
|
+
' / / / __ \\ / __ \\ / __/ / _ \\ | |/_/ / __/ / ,< / / / __/ ',
|
|
9
|
+
'/ /___ / /_/ / / / / / / /_ / __/ _> < / /_ / /| | / / / /_ ',
|
|
10
|
+
'\\____/ \\____/ /_/ /_/ \\__/ \\___/ /_/|_| \\__/ /_/ |_| /_/ \\__/ ',
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
// ── Color helpers ──────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Convert HSL (h: 0–360, s: 0–100, l: 0–100) to [r, g, b] (0–255).
|
|
17
|
+
* Standard algorithm — no dependencies.
|
|
18
|
+
*/
|
|
19
|
+
function hslToRgb(h, s, l) {
|
|
20
|
+
s /= 100;
|
|
21
|
+
l /= 100;
|
|
22
|
+
const k = n => (n + h / 30) % 12;
|
|
23
|
+
const a = s * Math.min(l, 1 - l);
|
|
24
|
+
const f = n => l - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
|
|
25
|
+
return [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ── Banner ─────────────────────────────────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
function printBanner() {
|
|
31
|
+
const maxLen = Math.max(...LINES.map(l => l.length));
|
|
32
|
+
|
|
33
|
+
console.log('');
|
|
34
|
+
LINES.forEach(line => {
|
|
35
|
+
const colored = line.split('').map((char, i) => {
|
|
36
|
+
if (char === ' ') return ' ';
|
|
37
|
+
// Cycle hues 20–290°: warm red → yellow → green → cyan → blue
|
|
38
|
+
const hue = (i / maxLen) * 270 + 20;
|
|
39
|
+
const [r, g, b] = hslToRgb(hue, 100, 65);
|
|
40
|
+
return chalk.rgb(r, g, b)(char);
|
|
41
|
+
}).join('');
|
|
42
|
+
console.log(colored);
|
|
43
|
+
});
|
|
44
|
+
console.log('');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = { printBanner, hslToRgb };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.17",
|
|
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": {
|