@nolrm/contextkit 0.9.7 → 0.11.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
@@ -37,7 +37,8 @@ npm i -g @nolrm/contextkit
37
37
 
38
38
  # Step 2: Navigate to your project and install
39
39
  cd your-project
40
- contextkit install
40
+ contextkit install # interactive — prompts "Which AI tool?"
41
+ contextkit install claude # or specify your platform directly
41
42
  ```
42
43
 
43
44
  This creates `.contextkit/` with skeleton context files (blank templates to be filled by AI):
@@ -67,10 +68,10 @@ ck analyze
67
68
  Perfect for teams where members use different AI tools:
68
69
 
69
70
  ```bash
70
- # First team member (any tool) - sets up the project
71
- contextkit install
71
+ # First team member - sets up the project with their tool
72
+ contextkit install claude # or: contextkit install (interactive picker)
72
73
 
73
- # Each team member adds their platform
74
+ # Each additional team member adds their platform
74
75
  ck claude # creates CLAUDE.md + .claude/rules/
75
76
  ck cursor # creates .cursor/rules/ (scoped .mdc files)
76
77
  ck copilot # creates .github/copilot-instructions.md
@@ -160,7 +161,8 @@ ContextKit installs reusable slash commands for supported platforms:
160
161
  | `/squad-test` | Write and run tests against acceptance criteria |
161
162
  | `/squad-review` | Review the full pipeline and give a verdict |
162
163
  | `/squad-batch` | Kick off multiple tasks at once (batch PO specs) |
163
- | `/squad-run` | Auto-run the remaining pipeline for batch tasks |
164
+ | `/squad-run` | Auto-run the remaining pipeline for batch tasks (sequential) |
165
+ | `/squad-run-agents` | Auto-run the pipeline in parallel using Claude Code agents (Claude Code only) |
164
166
  | `/ck` | Health check — verify setup, standards, and integrations |
165
167
 
166
168
  **Claude Code** — available as `/analyze`, `/review`, etc. in `.claude/commands/`
@@ -206,6 +208,16 @@ For multiple tasks, use batch mode to spec them all up front, then run the full
206
208
  # Runs Architect → Dev → Test → Review for each task sequentially
207
209
  ```
208
210
 
211
+ **Agent mode (Claude Code only):** Use `/squad-run-agents` instead of `/squad-run` to spawn parallel subagents — one per task per phase — so all tasks progress simultaneously rather than one at a time.
212
+
213
+ ```bash
214
+ /squad-batch "add dark mode" "fix login bug" "refactor checkout"
215
+
216
+ /squad-run-agents
217
+ # Phase 1: architect agents for all 3 tasks run in parallel
218
+ # Phase 2: dev→test→review pipeline runs in parallel per task
219
+ ```
220
+
209
221
  ### Feedback Loop
210
222
 
211
223
  Any downstream role can raise questions for an upstream role. When this happens, the pipeline pauses and directs you to the right command:
@@ -274,7 +286,7 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
274
286
  - 🌍 **Project Agnostic** - Works with React, Vue, Node.js, PHP, Python, Rust, monorepos—any project type
275
287
  - 🤖 **Multi-Platform** - Works with Cursor, Claude Code, Copilot, Codex, Gemini, Aider, Continue, Windsurf
276
288
  - 🛡️ **Safe Install** - Backs up existing files with rollback support
277
- - ⚡ **Zero Config** - Auto-detects package managers and AI tools
289
+ - ⚡ **Zero Config** - Auto-detects project type and package manager
278
290
  - ✅ **Policy Enforcement** - Configurable validation with `ck check`
279
291
  - 📝 **Corrections Tracking** - Track AI performance issues with corrections log
280
292
  - 🔄 **Workflow Orchestration** - Structured workflows with `ck run`
@@ -285,7 +297,8 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
285
297
 
286
298
  ```bash
287
299
  # Installation & Setup
288
- ck install # set up .contextkit in this repo
300
+ ck install # set up .contextkit + pick AI tool interactively
301
+ ck install claude # set up .contextkit + Claude (no prompt)
289
302
  ck claude # add Claude Code integration (CLAUDE.md + rules)
290
303
  ck cursor # add Cursor integration (scoped .mdc rules)
291
304
  ck copilot # add GitHub Copilot integration
package/bin/contextkit.js CHANGED
@@ -21,13 +21,13 @@ program
21
21
 
22
22
  // Install command
23
23
  program
24
- .command('install')
24
+ .command('install [platform]')
25
25
  .description('Install ContextKit in current project')
26
26
  .option('--no-hooks', 'Skip Git hooks installation')
27
27
  .option('--non-interactive', 'Skip interactive prompts')
28
- .action(async (options) => {
28
+ .action(async (platform, options) => {
29
29
  try {
30
- await install(options);
30
+ await install({ ...options, ...(platform ? { platform, fullInstall: true } : { fullInstall: true }) });
31
31
  } catch (error) {
32
32
  console.error(chalk.red('Installation failed:'), error.message);
33
33
  process.exit(1);
@@ -9,7 +9,6 @@ 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 ToolDetector = require('../utils/tool-detector');
13
12
 
14
13
  class InstallCommand {
15
14
  constructor() {
@@ -17,7 +16,6 @@ class InstallCommand {
17
16
  this.projectDetector = new ProjectDetector();
18
17
  this.gitHooksManager = new GitHooksManager();
19
18
  this.statusManager = new StatusManager();
20
- this.toolDetector = new ToolDetector();
21
19
  this.repoUrl = 'https://raw.githubusercontent.com/nolrm/contextkit/main';
22
20
  }
23
21
 
@@ -39,12 +37,12 @@ class InstallCommand {
39
37
  }
40
38
 
41
39
  const requestedPlatform = options.platform;
42
- const isPlatformSpecific = !!requestedPlatform;
40
+ const isFullInstall = !!options.fullInstall;
43
41
 
44
- // Handle platform-specific installation
45
- if (isPlatformSpecific) {
42
+ // Handle platform-specific installation (e.g., `ck claude`)
43
+ if (requestedPlatform && !isFullInstall) {
46
44
  const isInstalled = await this.isAlreadyInstalled();
47
-
45
+
48
46
  if (!isInstalled) {
49
47
  console.log(chalk.red('❌ .contextkit is not installed'));
50
48
  console.log(chalk.yellow('💡 Run: contextkit install'));
@@ -52,7 +50,7 @@ class InstallCommand {
52
50
  console.log(chalk.dim(' Then you can run: contextkit ' + requestedPlatform));
53
51
  return;
54
52
  }
55
-
53
+
56
54
  // .contextkit exists, just add the platform integration
57
55
  console.log(chalk.green('✓ .contextkit already exists'));
58
56
  console.log(chalk.blue(`🔧 Adding ${requestedPlatform} integration...`));
@@ -60,29 +58,17 @@ class InstallCommand {
60
58
  await this.installPlatformIntegration(requestedPlatform);
61
59
  return;
62
60
  }
63
-
61
+
64
62
  // Full installation
65
63
  console.log(chalk.magenta('🎵 Installing ContextKit...'));
66
64
  console.log('');
67
-
65
+
68
66
  // Detect project type
69
67
  const projectType = this.projectDetector.detectProjectType();
70
68
  const packageManager = this.projectDetector.detectPackageManager();
71
-
69
+
72
70
  console.log(chalk.green(`🧩 Detected project: ${projectType}`));
73
71
  console.log(chalk.green(`📦 Package manager: ${packageManager}`));
74
-
75
- // Detect AI tools
76
- const detectedTools = await this.toolDetector.detectAll();
77
- const summary = this.toolDetector.getSummary();
78
-
79
- if (summary && summary.count > 0) {
80
- const tools = [...summary.editors, ...summary.cli].join(', ');
81
- console.log(chalk.green(`🧠 AI tools detected: ${tools}`));
82
- } else {
83
- console.log(chalk.yellow('⚠️ No AI tools detected'));
84
- console.log(chalk.blue('💡 Universal context files will still be installed'));
85
- }
86
72
  console.log('');
87
73
 
88
74
  // Check if already installed
@@ -98,7 +84,7 @@ class InstallCommand {
98
84
  await this.createDirectoryStructure();
99
85
 
100
86
  // Download files
101
- await this.downloadFiles(projectType, options, detectedTools);
87
+ await this.downloadFiles(projectType, options);
102
88
 
103
89
  // Ask about Git hooks
104
90
  let hookChoices = { prePush: true, commitMsg: true };
@@ -119,8 +105,19 @@ class InstallCommand {
119
105
  // Create status tracking
120
106
  await this.createStatusFile(projectType, packageManager, hookChoices);
121
107
 
108
+ // Determine which platform to install
109
+ let chosenPlatform = requestedPlatform || null;
110
+ if (!chosenPlatform && !options.nonInteractive) {
111
+ chosenPlatform = await this.promptPlatformChoice();
112
+ }
113
+
114
+ // Install chosen platform integration
115
+ if (chosenPlatform) {
116
+ await this.installPlatformIntegration(chosenPlatform);
117
+ }
118
+
122
119
  // Success message
123
- this.showSuccessMessage(hookChoices, detectedTools, projectType, packageManager);
120
+ this.showSuccessMessage(hookChoices, chosenPlatform, projectType, packageManager);
124
121
  }
125
122
 
126
123
  async installPlatformIntegration(platform) {
@@ -171,6 +168,26 @@ class InstallCommand {
171
168
  return { shouldContinue };
172
169
  }
173
170
 
171
+ async promptPlatformChoice() {
172
+ const { platform } = await inquirer.prompt([{
173
+ type: 'list',
174
+ name: 'platform',
175
+ message: 'Which AI tool are you using?',
176
+ choices: [
177
+ { name: 'Claude Code', value: 'claude' },
178
+ { name: 'Cursor', value: 'cursor' },
179
+ { name: 'Copilot (GitHub)', value: 'copilot' },
180
+ { name: 'Codex (OpenAI)', value: 'codex' },
181
+ { name: 'Gemini', value: 'gemini' },
182
+ { name: 'Windsurf', value: 'windsurf' },
183
+ { name: 'Aider', value: 'aider' },
184
+ { name: 'Continue', value: 'continue' },
185
+ { name: 'Skip (base only)', value: null },
186
+ ]
187
+ }]);
188
+ return platform;
189
+ }
190
+
174
191
  async promptGitHooks() {
175
192
  // Check for non-interactive mode
176
193
  if (process.env.CI === 'true' || process.env.NON_INTERACTIVE === 'true') {
@@ -491,7 +508,7 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
491
508
  }
492
509
  }
493
510
 
494
- async downloadFiles(projectType, options = {}, detectedTools = {}) {
511
+ async downloadFiles(projectType, options = {}) {
495
512
  try {
496
513
  // Create skeleton standards files (will be customized by analyze)
497
514
  console.log(chalk.blue('📝 Creating skeleton standards files...'));
@@ -580,6 +597,10 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
580
597
  `${this.repoUrl}/commands/squad-run.md`,
581
598
  '.contextkit/commands/squad-run.md'
582
599
  );
600
+ await this.downloadManager.downloadFile(
601
+ `${this.repoUrl}/commands/squad-run-agents.md`,
602
+ '.contextkit/commands/squad-run-agents.md'
603
+ );
583
604
 
584
605
  // Download hooks (pre-push and commit-msg only, no pre-commit)
585
606
  await this.downloadManager.downloadFile(
@@ -640,53 +661,10 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
640
661
  await this.createPolicyFile();
641
662
  await this.createHealthCheckCommand();
642
663
 
643
- // Install platform integrations
644
- await this.installPlatformIntegrations(detectedTools);
664
+ // Install CLI helpers
665
+ await this.installCLIHelpers();
645
666
  }
646
667
 
647
- async installPlatformIntegrations(detectedTools = {}) {
648
- console.log(chalk.blue('🔧 Installing integrations...'));
649
-
650
- try {
651
- const { getIntegration } = require('../integrations');
652
-
653
- // Map detected tools to integration names
654
- const toolToIntegration = {
655
- cursor: 'cursor',
656
- continue: 'continue',
657
- aider: 'aider',
658
- aider_cli: 'aider',
659
- vscode: 'copilot',
660
- claude_cli: 'claude',
661
- gemini_cli: 'gemini',
662
- windsurf: 'windsurf',
663
- };
664
-
665
- const installed = new Set();
666
- for (const [tool, integrationName] of Object.entries(toolToIntegration)) {
667
- if (detectedTools[tool] && !installed.has(integrationName)) {
668
- const integration = getIntegration(integrationName);
669
- if (integration) {
670
- await integration.install();
671
- installed.add(integrationName);
672
- console.log(chalk.green(` ✅ ${integration.displayName}`));
673
- }
674
- }
675
- }
676
-
677
- // Always install CLI helpers
678
- await this.installCLIHelpers();
679
-
680
- console.log(chalk.green('✅ Platform integrations complete'));
681
- console.log('');
682
- } catch (error) {
683
- console.log(chalk.red('❌ Failed to install platform integrations'));
684
- console.log(chalk.yellow(error.message));
685
- }
686
- }
687
-
688
- // Platform integration methods have been moved to lib/integrations/
689
-
690
668
  async installCLIHelpers() {
691
669
  // Create universal context.md file that references ALL standards
692
670
  // CLI tools can read this single file to understand what context is available
@@ -1514,37 +1492,21 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
1514
1492
  await fs.writeFile('.contextkit/commands/health-check.md', healthCheckContent);
1515
1493
  }
1516
1494
 
1517
- showSuccessMessage(hookChoices, detectedTools = {}, projectType = '', packageManager = '') {
1495
+ showSuccessMessage(hookChoices, platform = null, projectType = '', packageManager = '') {
1518
1496
  console.log('');
1519
1497
  console.log(chalk.green('🎉 ContextKit v1.0.0 successfully installed!'));
1520
1498
  console.log('');
1521
1499
 
1522
- // Show which platform integrations were configured
1523
- const { getIntegration } = require('../integrations');
1524
- const toolToIntegration = {
1525
- cursor: 'cursor',
1526
- continue: 'continue',
1527
- aider: 'aider',
1528
- aider_cli: 'aider',
1529
- vscode: 'copilot',
1530
- claude_cli: 'claude',
1531
- gemini_cli: 'gemini',
1532
- windsurf: 'windsurf',
1533
- };
1534
- const installedPlatforms = new Set();
1535
- for (const [tool, name] of Object.entries(toolToIntegration)) {
1536
- if (detectedTools[tool]) installedPlatforms.add(name);
1537
- }
1538
- if (installedPlatforms.size > 0) {
1539
- console.log(chalk.blue('🔌 Platform integrations:'));
1540
- for (const name of installedPlatforms) {
1541
- const integration = getIntegration(name);
1542
- if (integration) {
1543
- const files = [...integration.bridgeFiles, ...integration.generatedFiles];
1544
- console.log(` ${integration.displayName}: ${files.join(', ')}`);
1545
- }
1500
+ // Show which platform was installed
1501
+ if (platform) {
1502
+ const { getIntegration } = require('../integrations');
1503
+ const integration = getIntegration(platform);
1504
+ if (integration) {
1505
+ const files = [...integration.bridgeFiles, ...integration.generatedFiles];
1506
+ console.log(chalk.blue('🔌 Platform integration:'));
1507
+ console.log(` ${integration.displayName}: ${files.join(', ')}`);
1508
+ console.log('');
1546
1509
  }
1547
- console.log('');
1548
1510
  }
1549
1511
 
1550
1512
  // Quick Reference
@@ -1564,7 +1526,7 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
1564
1526
  console.log(chalk.bold('🚀 NEXT STEP — GENERATE STANDARDS'));
1565
1527
  console.log(''.padEnd(48, '─'));
1566
1528
 
1567
- if (detectedTools.cursor) {
1529
+ if (platform === 'cursor') {
1568
1530
  console.log(chalk.bold('In Cursor Chat:'));
1569
1531
  console.log(` @.contextkit/commands/analyze.md`);
1570
1532
  console.log('');
@@ -1590,8 +1552,7 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
1590
1552
  console.log(chalk.bold('💡 After Analyze — Try This'));
1591
1553
  console.log(''.padEnd(48, '─'));
1592
1554
 
1593
- // Platform-specific examples
1594
- if (detectedTools.cursor) {
1555
+ if (platform === 'cursor') {
1595
1556
  console.log(chalk.bold('In Cursor Chat'));
1596
1557
  console.log(`@.contextkit/commands/create-component.md`);
1597
1558
  console.log(chalk.dim('"Create a Button component for customer checkout"'));
@@ -1602,8 +1563,8 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
1602
1563
  console.log(`ck ai "create a Button component for customer checkout"`);
1603
1564
  console.log('');
1604
1565
 
1605
- if (detectedTools.claude_cli || detectedTools.gemini_cli) {
1606
- const toolName = detectedTools.claude_cli ? 'Claude' : 'Gemini';
1566
+ if (platform === 'claude' || platform === 'gemini') {
1567
+ const toolName = platform === 'claude' ? 'Claude' : 'Gemini';
1607
1568
  console.log(chalk.bold(`In ${toolName} CLI`));
1608
1569
  console.log(`read .contextkit/commands/analyze.md and execute`);
1609
1570
  console.log('');
@@ -278,6 +278,10 @@ class UpdateCommand {
278
278
  `${this.repoUrl}/commands/squad-run.md`,
279
279
  '.contextkit/commands/squad-run.md'
280
280
  );
281
+ await this.downloadManager.downloadFile(
282
+ `${this.repoUrl}/commands/squad-run-agents.md`,
283
+ '.contextkit/commands/squad-run-agents.md'
284
+ );
281
285
 
282
286
  // Download hooks (pre-push and commit-msg only, no pre-commit)
283
287
  await this.downloadManager.downloadFile(
@@ -24,6 +24,7 @@ class ClaudeIntegration extends BaseIntegration {
24
24
  '.claude/commands/squad-review.md',
25
25
  '.claude/commands/squad-batch.md',
26
26
  '.claude/commands/squad-run.md',
27
+ '.claude/commands/squad-run-agents.md',
27
28
  '.claude/commands/ck.md',
28
29
  ];
29
30
  this.platformDir = '.claude/rules';
@@ -241,6 +242,13 @@ Create handoff files for multiple tasks and write PO specs for each one. Pass al
241
242
  Read \`.contextkit/commands/squad-run.md\` and execute the pipeline runner workflow.
242
243
 
243
244
  Process all batch tasks through the remaining pipeline steps (Architect, Dev, Test, Review) sequentially.
245
+ `);
246
+
247
+ await this.writeGeneratedFile('.claude/commands/squad-run-agents.md', `# Squad Run — Agent Mode (Parallel)
248
+
249
+ Read \`.contextkit/commands/squad-run-agents.md\` and execute the parallel pipeline workflow.
250
+
251
+ Spawn one subagent per task per phase using the Task tool, so all tasks progress simultaneously instead of sequentially. Use this after \`/squad-batch\` for faster execution on multi-task batches.
244
252
  `);
245
253
 
246
254
  await this.writeGeneratedFile('.claude/commands/ck.md', `# ContextKit Health Check
@@ -271,8 +279,9 @@ Check project setup, standards status, and integrations. Report what needs atten
271
279
  console.log(chalk.dim(' /squad-dev — Implement the code'));
272
280
  console.log(chalk.dim(' /squad-test — Write and run tests'));
273
281
  console.log(chalk.dim(' /squad-review — Review and write verdict'));
274
- console.log(chalk.dim(' /squad-batch — Batch kickoff: PO specs for multiple tasks'));
275
- console.log(chalk.dim(' /squad-run — Auto-run pipeline for batch tasks'));
282
+ console.log(chalk.dim(' /squad-batch — Batch kickoff: PO specs for multiple tasks'));
283
+ console.log(chalk.dim(' /squad-run — Auto-run pipeline sequentially'));
284
+ console.log(chalk.dim(' /squad-run-agents — Auto-run pipeline in parallel (agent mode)'));
276
285
  console.log(chalk.dim(''));
277
286
  console.log(chalk.dim(' Health check:'));
278
287
  console.log(chalk.dim(' /ck — Check project setup and standards status'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolrm/contextkit",
3
- "version": "0.9.7",
3
+ "version": "0.11.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": {