@nolrm/contextkit 0.9.7 β 0.10.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 +8 -6
- package/bin/contextkit.js +3 -3
- package/lib/commands/install.js +58 -101
- package/package.json +1 -1
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
|
|
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
|
|
@@ -274,7 +275,7 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
274
275
|
- π **Project Agnostic** - Works with React, Vue, Node.js, PHP, Python, Rust, monoreposβany project type
|
|
275
276
|
- π€ **Multi-Platform** - Works with Cursor, Claude Code, Copilot, Codex, Gemini, Aider, Continue, Windsurf
|
|
276
277
|
- π‘οΈ **Safe Install** - Backs up existing files with rollback support
|
|
277
|
-
- β‘ **Zero Config** - Auto-detects
|
|
278
|
+
- β‘ **Zero Config** - Auto-detects project type and package manager
|
|
278
279
|
- β
**Policy Enforcement** - Configurable validation with `ck check`
|
|
279
280
|
- π **Corrections Tracking** - Track AI performance issues with corrections log
|
|
280
281
|
- π **Workflow Orchestration** - Structured workflows with `ck run`
|
|
@@ -285,7 +286,8 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
285
286
|
|
|
286
287
|
```bash
|
|
287
288
|
# Installation & Setup
|
|
288
|
-
ck install
|
|
289
|
+
ck install # set up .contextkit + pick AI tool interactively
|
|
290
|
+
ck install claude # set up .contextkit + Claude (no prompt)
|
|
289
291
|
ck claude # add Claude Code integration (CLAUDE.md + rules)
|
|
290
292
|
ck cursor # add Cursor integration (scoped .mdc rules)
|
|
291
293
|
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);
|
package/lib/commands/install.js
CHANGED
|
@@ -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
|
|
40
|
+
const isFullInstall = !!options.fullInstall;
|
|
43
41
|
|
|
44
|
-
// Handle platform-specific installation
|
|
45
|
-
if (
|
|
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
|
|
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,
|
|
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 = {}
|
|
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...'));
|
|
@@ -640,53 +657,10 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
|
|
|
640
657
|
await this.createPolicyFile();
|
|
641
658
|
await this.createHealthCheckCommand();
|
|
642
659
|
|
|
643
|
-
// Install
|
|
644
|
-
await this.
|
|
660
|
+
// Install CLI helpers
|
|
661
|
+
await this.installCLIHelpers();
|
|
645
662
|
}
|
|
646
663
|
|
|
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
664
|
async installCLIHelpers() {
|
|
691
665
|
// Create universal context.md file that references ALL standards
|
|
692
666
|
// CLI tools can read this single file to understand what context is available
|
|
@@ -1514,37 +1488,21 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1514
1488
|
await fs.writeFile('.contextkit/commands/health-check.md', healthCheckContent);
|
|
1515
1489
|
}
|
|
1516
1490
|
|
|
1517
|
-
showSuccessMessage(hookChoices,
|
|
1491
|
+
showSuccessMessage(hookChoices, platform = null, projectType = '', packageManager = '') {
|
|
1518
1492
|
console.log('');
|
|
1519
1493
|
console.log(chalk.green('π ContextKit v1.0.0 successfully installed!'));
|
|
1520
1494
|
console.log('');
|
|
1521
1495
|
|
|
1522
|
-
// Show which platform
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
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
|
-
}
|
|
1496
|
+
// Show which platform was installed
|
|
1497
|
+
if (platform) {
|
|
1498
|
+
const { getIntegration } = require('../integrations');
|
|
1499
|
+
const integration = getIntegration(platform);
|
|
1500
|
+
if (integration) {
|
|
1501
|
+
const files = [...integration.bridgeFiles, ...integration.generatedFiles];
|
|
1502
|
+
console.log(chalk.blue('π Platform integration:'));
|
|
1503
|
+
console.log(` ${integration.displayName}: ${files.join(', ')}`);
|
|
1504
|
+
console.log('');
|
|
1546
1505
|
}
|
|
1547
|
-
console.log('');
|
|
1548
1506
|
}
|
|
1549
1507
|
|
|
1550
1508
|
// Quick Reference
|
|
@@ -1564,7 +1522,7 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1564
1522
|
console.log(chalk.bold('π NEXT STEP β GENERATE STANDARDS'));
|
|
1565
1523
|
console.log(''.padEnd(48, 'β'));
|
|
1566
1524
|
|
|
1567
|
-
if (
|
|
1525
|
+
if (platform === 'cursor') {
|
|
1568
1526
|
console.log(chalk.bold('In Cursor Chat:'));
|
|
1569
1527
|
console.log(` @.contextkit/commands/analyze.md`);
|
|
1570
1528
|
console.log('');
|
|
@@ -1590,8 +1548,7 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1590
1548
|
console.log(chalk.bold('π‘ After Analyze β Try This'));
|
|
1591
1549
|
console.log(''.padEnd(48, 'β'));
|
|
1592
1550
|
|
|
1593
|
-
|
|
1594
|
-
if (detectedTools.cursor) {
|
|
1551
|
+
if (platform === 'cursor') {
|
|
1595
1552
|
console.log(chalk.bold('In Cursor Chat'));
|
|
1596
1553
|
console.log(`@.contextkit/commands/create-component.md`);
|
|
1597
1554
|
console.log(chalk.dim('"Create a Button component for customer checkout"'));
|
|
@@ -1602,8 +1559,8 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1602
1559
|
console.log(`ck ai "create a Button component for customer checkout"`);
|
|
1603
1560
|
console.log('');
|
|
1604
1561
|
|
|
1605
|
-
if (
|
|
1606
|
-
const toolName =
|
|
1562
|
+
if (platform === 'claude' || platform === 'gemini') {
|
|
1563
|
+
const toolName = platform === 'claude' ? 'Claude' : 'Gemini';
|
|
1607
1564
|
console.log(chalk.bold(`In ${toolName} CLI`));
|
|
1608
1565
|
console.log(`read .contextkit/commands/analyze.md and execute`);
|
|
1609
1566
|
console.log('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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": {
|