@nolrm/contextkit 0.12.17 → 0.12.20
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 +8 -4
- package/bin/contextkit.js +3 -0
- package/lib/commands/install.js +8 -53
- package/lib/commands/update.js +8 -0
- package/lib/integrations/claude-integration.js +15 -1
- package/lib/utils/notifier.js +17 -0
- package/lib/utils/notifier.md +29 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -153,6 +153,7 @@ ContextKit installs reusable slash commands for supported platforms:
|
|
|
153
153
|
| `/squad-dev` | Implement code following the architect plan |
|
|
154
154
|
| `/squad-test` | Write and run tests against acceptance criteria |
|
|
155
155
|
| `/squad-review` | Review the full pipeline and give a verdict |
|
|
156
|
+
| `/squad-doc` | Create companion `.md` files for new/modified code after review passes |
|
|
156
157
|
| `/squad-auto` | Auto-run the full pipeline after kickoff (recommended, sequential) |
|
|
157
158
|
| `/squad-auto-parallel` | Auto-run the pipeline in parallel using Claude Code agents (Claude Code only) |
|
|
158
159
|
| `/ck` | Health check — verify setup, standards, and integrations |
|
|
@@ -177,18 +178,20 @@ The squad workflow turns a single AI session into a structured multi-role pipeli
|
|
|
177
178
|
| 3 | Developer | `/squad-dev` | Implements the code following the architect's plan |
|
|
178
179
|
| 4 | Tester | `/squad-test` | Writes and runs tests against the PO's acceptance criteria |
|
|
179
180
|
| 5 | Reviewer | `/squad-review` | Reviews everything and gives a PASS or NEEDS-WORK verdict |
|
|
181
|
+
| 6 | Doc Writer | `/squad-doc` | Creates companion `.md` files for every new/modified code file |
|
|
180
182
|
|
|
181
183
|
### Single-Task Flow
|
|
182
184
|
|
|
183
185
|
```bash
|
|
184
186
|
/squad "add dark mode support" # PO writes the spec
|
|
185
187
|
|
|
186
|
-
/squad-auto # Auto-runs architect → dev → test → review (recommended)
|
|
188
|
+
/squad-auto # Auto-runs architect → dev → test → review → doc (recommended)
|
|
187
189
|
# — or step through manually —
|
|
188
190
|
/squad-architect # Architect designs the plan
|
|
189
191
|
/squad-dev # Dev implements the code
|
|
190
192
|
/squad-test # Tester writes and runs tests
|
|
191
193
|
/squad-review # Reviewer gives the verdict
|
|
194
|
+
/squad-doc # Doc Writer creates companion .md files
|
|
192
195
|
```
|
|
193
196
|
|
|
194
197
|
### Batch Flow
|
|
@@ -200,7 +203,7 @@ Pass multiple tasks to `/squad` and it automatically runs in batch mode:
|
|
|
200
203
|
# PO writes specs for all three tasks
|
|
201
204
|
|
|
202
205
|
/squad-auto
|
|
203
|
-
# Runs Architect → Dev → Test → Review for each task sequentially
|
|
206
|
+
# Runs Architect → Dev → Test → Review → Doc for each task sequentially
|
|
204
207
|
```
|
|
205
208
|
|
|
206
209
|
**Parallel mode (Claude Code only):** Use `/squad-auto-parallel` instead of `/squad-auto` to spawn parallel subagents — one per task per phase — so all tasks progress simultaneously rather than one at a time.
|
|
@@ -210,7 +213,7 @@ Pass multiple tasks to `/squad` and it automatically runs in batch mode:
|
|
|
210
213
|
|
|
211
214
|
/squad-auto-parallel
|
|
212
215
|
# Phase 1: architect agents for all 3 tasks run in parallel
|
|
213
|
-
# Phase 2: dev→test→review pipeline runs in parallel per task
|
|
216
|
+
# Phase 2: dev→test→review pipeline runs in parallel per task; Phase 3: doc runs sequentially
|
|
214
217
|
```
|
|
215
218
|
|
|
216
219
|
**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.
|
|
@@ -318,6 +321,7 @@ ck vscode # alias for copilot
|
|
|
318
321
|
# Analysis & Updates
|
|
319
322
|
/analyze # customize standards to your project (slash command in your AI tool)
|
|
320
323
|
ck update # pull latest commands/hooks — preserves your analyzed standards
|
|
324
|
+
# updates are also flagged automatically after each ck command (24h cache)
|
|
321
325
|
ck status # check install & integrations
|
|
322
326
|
|
|
323
327
|
# Validation & Compliance
|
|
@@ -330,7 +334,7 @@ ck note "AI issue" --category "AI Behavior" --priority HIGH
|
|
|
330
334
|
|
|
331
335
|
# Squad — multi-role AI pipeline (slash commands in your AI tool)
|
|
332
336
|
/squad "add dark mode" # PO writes spec
|
|
333
|
-
/squad-auto # runs architect → dev → test → review hands-free
|
|
337
|
+
/squad-auto # runs architect → dev → test → review → doc hands-free
|
|
334
338
|
/squad-reset # clear stuck or mixed squad state
|
|
335
339
|
|
|
336
340
|
# Observability
|
package/bin/contextkit.js
CHANGED
|
@@ -12,6 +12,9 @@ const publish = require('../lib/commands/publish');
|
|
|
12
12
|
const pull = require('../lib/commands/pull');
|
|
13
13
|
const dashboard = require('../lib/commands/dashboard');
|
|
14
14
|
const packageJson = require('../package.json');
|
|
15
|
+
const { checkForUpdates } = require('../lib/utils/notifier');
|
|
16
|
+
|
|
17
|
+
checkForUpdates();
|
|
15
18
|
|
|
16
19
|
// Set up the CLI
|
|
17
20
|
program
|
package/lib/commands/install.js
CHANGED
|
@@ -734,6 +734,14 @@ Any design decisions, trade-offs, or open questions to resolve before coding.
|
|
|
734
734
|
`${this.repoUrl}/commands/squad-reset.md`,
|
|
735
735
|
'.contextkit/commands/squad-reset.md'
|
|
736
736
|
);
|
|
737
|
+
await this.downloadManager.downloadFile(
|
|
738
|
+
`${this.repoUrl}/commands/squad-doc.md`,
|
|
739
|
+
'.contextkit/commands/squad-doc.md'
|
|
740
|
+
);
|
|
741
|
+
await this.downloadManager.downloadFile(
|
|
742
|
+
`${this.repoUrl}/commands/health-check.md`,
|
|
743
|
+
'.contextkit/commands/health-check.md'
|
|
744
|
+
);
|
|
737
745
|
|
|
738
746
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
739
747
|
await this.downloadManager.downloadFile(
|
|
@@ -792,7 +800,6 @@ Any design decisions, trade-offs, or open questions to resolve before coding.
|
|
|
792
800
|
await this.createCorrectionsLog();
|
|
793
801
|
await this.createMetaInstructions();
|
|
794
802
|
await this.createPolicyFile();
|
|
795
|
-
await this.createHealthCheckCommand();
|
|
796
803
|
|
|
797
804
|
// Install CLI helpers
|
|
798
805
|
await this.installCLIHelpers();
|
|
@@ -1592,58 +1599,6 @@ enforcement:
|
|
|
1592
1599
|
console.log(chalk.green('✅ Policy file created'));
|
|
1593
1600
|
}
|
|
1594
1601
|
|
|
1595
|
-
async createHealthCheckCommand() {
|
|
1596
|
-
const healthCheckContent = `# ContextKit Health Check
|
|
1597
|
-
|
|
1598
|
-
Check this project's ContextKit setup and report status.
|
|
1599
|
-
|
|
1600
|
-
## Steps
|
|
1601
|
-
|
|
1602
|
-
1. Check if \`.contextkit/\` directory exists. If not → STOP and tell user: "Run \`ck install\` to set up ContextKit."
|
|
1603
|
-
|
|
1604
|
-
2. Read \`.contextkit/config.yml\` and check the \`last_analyzed\` field.
|
|
1605
|
-
|
|
1606
|
-
3. Check each standards file for skeleton markers. Read these files and check if they contain \`<!-- Content will be generated by running: /analyze -->\`:
|
|
1607
|
-
- \`.contextkit/standards/code-style.md\`
|
|
1608
|
-
- \`.contextkit/standards/testing.md\`
|
|
1609
|
-
- \`.contextkit/standards/architecture.md\`
|
|
1610
|
-
- \`.contextkit/standards/ai-guidelines.md\`
|
|
1611
|
-
- \`.contextkit/standards/workflows.md\`
|
|
1612
|
-
- \`.contextkit/standards/glossary.md\`
|
|
1613
|
-
|
|
1614
|
-
4. Check product files for placeholder content (e.g., \`[ELEVATOR_PITCH_FROM_MISSION_MD]\`):
|
|
1615
|
-
- \`.contextkit/product/mission-lite.md\`
|
|
1616
|
-
- \`.contextkit/product/decisions.md\`
|
|
1617
|
-
- \`.contextkit/product/roadmap.md\`
|
|
1618
|
-
|
|
1619
|
-
5. Check which platform integrations exist:
|
|
1620
|
-
- \`CLAUDE.md\` → Claude Code
|
|
1621
|
-
- \`.cursor/rules/\` → Cursor
|
|
1622
|
-
- \`AGENTS.md\` → Codex
|
|
1623
|
-
- \`GEMINI.md\` → Gemini
|
|
1624
|
-
- \`CONVENTIONS.md\` → Aider
|
|
1625
|
-
- \`.windsurfrules\` → Windsurf
|
|
1626
|
-
- \`.github/copilot-instructions.md\` → Copilot
|
|
1627
|
-
|
|
1628
|
-
6. Report findings as a status summary table and list recommended next steps.
|
|
1629
|
-
|
|
1630
|
-
## Output Format
|
|
1631
|
-
|
|
1632
|
-
| Area | Status | Action |
|
|
1633
|
-
|------|--------|--------|
|
|
1634
|
-
| Installation | OK/Missing | \`ck install\` |
|
|
1635
|
-
| Standards | Populated/Skeleton | \`ck analyze\` or \`/analyze\` |
|
|
1636
|
-
| Product context | Populated/Placeholder | Edit \`.contextkit/product/\` files |
|
|
1637
|
-
| Integrations | List active | \`ck <platform>\` to add more |
|
|
1638
|
-
|
|
1639
|
-
## Token Note
|
|
1640
|
-
|
|
1641
|
-
If standards are still skeletons, warn that @imports in CLAUDE.md are loading empty files — wasting context tokens. Run \`/analyze\` to populate them.
|
|
1642
|
-
`;
|
|
1643
|
-
|
|
1644
|
-
await fs.writeFile('.contextkit/commands/health-check.md', healthCheckContent);
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
1602
|
showSuccessMessage(hookChoices, platform = null, projectType = '', packageManager = '') {
|
|
1648
1603
|
console.log('');
|
|
1649
1604
|
console.log(chalk.green('🎉 ContextKit v1.0.0 successfully installed!'));
|
package/lib/commands/update.js
CHANGED
|
@@ -291,6 +291,14 @@ class UpdateCommand {
|
|
|
291
291
|
`${this.repoUrl}/commands/squad-reset.md`,
|
|
292
292
|
'.contextkit/commands/squad-reset.md'
|
|
293
293
|
);
|
|
294
|
+
await this.downloadManager.downloadFile(
|
|
295
|
+
`${this.repoUrl}/commands/squad-doc.md`,
|
|
296
|
+
'.contextkit/commands/squad-doc.md'
|
|
297
|
+
);
|
|
298
|
+
await this.downloadManager.downloadFile(
|
|
299
|
+
`${this.repoUrl}/commands/health-check.md`,
|
|
300
|
+
'.contextkit/commands/health-check.md'
|
|
301
|
+
);
|
|
294
302
|
|
|
295
303
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
296
304
|
await this.downloadManager.downloadFile(
|
|
@@ -25,6 +25,7 @@ class ClaudeIntegration extends BaseIntegration {
|
|
|
25
25
|
'.claude/commands/squad-auto.md',
|
|
26
26
|
'.claude/commands/squad-auto-parallel.md',
|
|
27
27
|
'.claude/commands/squad-reset.md',
|
|
28
|
+
'.claude/commands/squad-doc.md',
|
|
28
29
|
'.claude/commands/spec.md',
|
|
29
30
|
'.claude/commands/ck.md',
|
|
30
31
|
];
|
|
@@ -82,11 +83,16 @@ The following standards are auto-loaded into context via @imports:
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
async generateFiles() {
|
|
86
|
+
const { version } = require('../../package.json');
|
|
87
|
+
|
|
85
88
|
// Bridge file: CLAUDE.md (auto-loaded every session)
|
|
86
89
|
const bridgeContent = `# Project Standards (ContextKit)
|
|
87
90
|
|
|
88
91
|
This project uses [ContextKit](https://github.com/nolrm/contextkit) for AI development standards.
|
|
89
92
|
|
|
93
|
+
## ContextKit
|
|
94
|
+
Version: ${version}
|
|
95
|
+
|
|
90
96
|
${this.getStandardsBlock()}
|
|
91
97
|
|
|
92
98
|
## Corrections Log
|
|
@@ -211,7 +217,7 @@ Read \`.contextkit/commands/squad.md\` and execute the squad kickoff workflow.
|
|
|
211
217
|
|
|
212
218
|
Create the handoff file and write the PO spec for the given task. Pass the user's task description as the input.
|
|
213
219
|
|
|
214
|
-
After kickoff, run \`/squad-auto\` to auto-run the full pipeline hands-free, or step through manually with \`/squad-architect\` → \`/squad-dev\` → \`/squad-test\` → \`/squad-review\`.
|
|
220
|
+
After kickoff, run \`/squad-auto\` to auto-run the full pipeline hands-free, or step through manually with \`/squad-architect\` → \`/squad-dev\` → \`/squad-test\` → \`/squad-review\` → \`/squad-doc\`.
|
|
215
221
|
`);
|
|
216
222
|
|
|
217
223
|
await this.writeGeneratedFile('.claude/commands/squad-architect.md', `# Squad — Architect (manual step 1/4)
|
|
@@ -261,6 +267,13 @@ Spawn one subagent per task per phase using the Task tool, so all tasks progress
|
|
|
261
267
|
Read \`.contextkit/commands/squad-reset.md\` and execute the reset workflow.
|
|
262
268
|
|
|
263
269
|
Delete the current squad state (.contextkit/squad/) so you can start fresh. Use when the squad folder is in a mixed or stuck state.
|
|
270
|
+
`);
|
|
271
|
+
|
|
272
|
+
await this.writeGeneratedFile('.claude/commands/squad-doc.md', `# Squad — Doc (manual step 5/5)
|
|
273
|
+
|
|
274
|
+
Read \`.contextkit/commands/squad-doc.md\` and execute the doc workflow.
|
|
275
|
+
|
|
276
|
+
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.
|
|
264
277
|
`);
|
|
265
278
|
|
|
266
279
|
await this.writeGeneratedFile('.claude/commands/ck.md', `# ContextKit Health Check
|
|
@@ -293,6 +306,7 @@ Check project setup, standards status, and integrations. Report what needs atten
|
|
|
293
306
|
console.log(chalk.dim(' /squad-review — Review and write verdict'));
|
|
294
307
|
console.log(chalk.dim(' /squad-auto — Auto-run full pipeline (recommended)'));
|
|
295
308
|
console.log(chalk.dim(' /squad-auto-parallel — Auto-run pipeline in parallel (batch, fastest)'));
|
|
309
|
+
console.log(chalk.dim(' /squad-doc — Document changes after review passes'));
|
|
296
310
|
console.log(chalk.dim(''));
|
|
297
311
|
console.log(chalk.dim(' Health check:'));
|
|
298
312
|
console.log(chalk.dim(' /ck — Check project setup and standards status'));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const updateNotifier = require('update-notifier');
|
|
2
|
+
const pkg = require('../../package.json');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Check for available updates to @nolrm/contextkit on npm.
|
|
6
|
+
* Results are cached for 24 hours. Notification prints after the command
|
|
7
|
+
* completes. Suppressed automatically in CI environments.
|
|
8
|
+
*/
|
|
9
|
+
function checkForUpdates() {
|
|
10
|
+
try {
|
|
11
|
+
updateNotifier({ pkg }).notify();
|
|
12
|
+
} catch (err) {
|
|
13
|
+
// Never crash the CLI due to a notifier failure
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
module.exports = { checkForUpdates };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# notifier.js
|
|
2
|
+
|
|
3
|
+
Thin wrapper around `update-notifier` for passive npm update notifications in the ContextKit CLI.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Checks npm once every 24 hours for a newer version of `@nolrm/contextkit`. If an update is available, prints a non-blocking one-liner after the command completes. Suppressed automatically in CI environments (`CI=true`).
|
|
8
|
+
|
|
9
|
+
## Exports
|
|
10
|
+
|
|
11
|
+
### `checkForUpdates()`
|
|
12
|
+
|
|
13
|
+
Initialises `update-notifier` with the package metadata from `package.json` and calls `.notify()`. Errors are silently swallowed — a notifier failure must never crash the CLI.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Called once in `bin/contextkit.js` before `program.parse()`:
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
const { checkForUpdates } = require('../lib/utils/notifier');
|
|
21
|
+
checkForUpdates();
|
|
22
|
+
program.parse(process.argv);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Edge Cases
|
|
26
|
+
|
|
27
|
+
- `update-notifier` caches the check result for 24 hours — only one npm request per day per machine.
|
|
28
|
+
- Suppressed in CI via `update-notifier`'s built-in CI detection (`CI`, `CONTINUOUS_INTEGRATION`, `BUILD_NUMBER` env vars).
|
|
29
|
+
- Uses `update-notifier@5.1.0` — the last CommonJS-compatible release (v6+ is ESM-only).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.20",
|
|
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": {
|
|
@@ -69,7 +69,8 @@
|
|
|
69
69
|
"fs-extra": "^11.1.1",
|
|
70
70
|
"inquirer": "^8.2.6",
|
|
71
71
|
"js-yaml": "^4.1.0",
|
|
72
|
-
"ora": "^5.4.1"
|
|
72
|
+
"ora": "^5.4.1",
|
|
73
|
+
"update-notifier": "^5.1.0"
|
|
73
74
|
},
|
|
74
75
|
"files": [
|
|
75
76
|
"bin/",
|