@nolrm/contextkit 0.10.0 → 0.12.3
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 +22 -4
- package/bin/contextkit.js +13 -0
- package/lib/commands/install.js +7 -2
- package/lib/commands/update.js +4 -0
- package/lib/integrations/claude-integration.js +11 -2
- package/lib/integrations/index.js +3 -1
- package/lib/integrations/opencode-integration.js +45 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Context Engineering for AI Development
|
|
4
4
|
|
|
5
|
-
Give your AI assistants (Cursor, Claude, Copilot, Codex, Gemini, Aider, Continue, Windsurf) structured context through markdown files. ContextKit creates a knowledge base that ensures AI generates code matching your exact patterns, style, and architecture—no more hallucinated code or mismatched conventions.
|
|
5
|
+
Give your AI assistants (Cursor, Claude, Copilot, Codex, OpenCode, Gemini, Aider, Continue, Windsurf) structured context through markdown files. ContextKit creates a knowledge base that ensures AI generates code matching your exact patterns, style, and architecture—no more hallucinated code or mismatched conventions.
|
|
6
6
|
|
|
7
7
|
ContextKit is a CLI tool that provides **context-engineering** capabilities by creating `.contextkit/` directories with project standards, guidelines, and patterns that AI assistants read automatically.
|
|
8
8
|
|
|
@@ -21,7 +21,7 @@ Update `.md` files as your project evolves; the AI follows.
|
|
|
21
21
|
|
|
22
22
|
## Multi-Platform Support
|
|
23
23
|
|
|
24
|
-
Works with: **Cursor** • **Claude Code** • **GitHub Copilot** • **Codex CLI** • **Gemini CLI** • **Aider** • **Continue** • **Windsurf**
|
|
24
|
+
Works with: **Cursor** • **Claude Code** • **GitHub Copilot** • **Codex CLI** • **OpenCode** • **Gemini CLI** • **Aider** • **Continue** • **Windsurf**
|
|
25
25
|
|
|
26
26
|
Each platform gets auto-loaded bridge files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.windsurfrules`, etc.) so your AI tools read project standards automatically. Claude Code uses `@` imports in CLAUDE.md to load standards content directly into context — no extra token cost from manual file reads.
|
|
27
27
|
|
|
@@ -76,6 +76,7 @@ ck claude # creates CLAUDE.md + .claude/rules/
|
|
|
76
76
|
ck cursor # creates .cursor/rules/ (scoped .mdc files)
|
|
77
77
|
ck copilot # creates .github/copilot-instructions.md
|
|
78
78
|
ck codex # creates AGENTS.md
|
|
79
|
+
ck opencode # creates AGENTS.md
|
|
79
80
|
ck gemini # creates GEMINI.md + .gemini/settings.json
|
|
80
81
|
ck aider # creates CONVENTIONS.md + .aider/rules.md
|
|
81
82
|
ck continue # creates .continue/rules/ + config.yaml
|
|
@@ -136,6 +137,11 @@ claude "create checkout flow for customer"
|
|
|
136
137
|
codex "create checkout flow for customer"
|
|
137
138
|
```
|
|
138
139
|
|
|
140
|
+
**OpenCode** — reads `AGENTS.md` automatically
|
|
141
|
+
```bash
|
|
142
|
+
opencode "create checkout flow for customer"
|
|
143
|
+
```
|
|
144
|
+
|
|
139
145
|
**CLI** (Chat with AI)
|
|
140
146
|
```bash
|
|
141
147
|
ck ai "create a button"
|
|
@@ -161,7 +167,8 @@ ContextKit installs reusable slash commands for supported platforms:
|
|
|
161
167
|
| `/squad-test` | Write and run tests against acceptance criteria |
|
|
162
168
|
| `/squad-review` | Review the full pipeline and give a verdict |
|
|
163
169
|
| `/squad-batch` | Kick off multiple tasks at once (batch PO specs) |
|
|
164
|
-
| `/squad-run` | Auto-run the remaining pipeline for batch tasks |
|
|
170
|
+
| `/squad-run` | Auto-run the remaining pipeline for batch tasks (sequential) |
|
|
171
|
+
| `/squad-run-agents` | Auto-run the pipeline in parallel using Claude Code agents (Claude Code only) |
|
|
165
172
|
| `/ck` | Health check — verify setup, standards, and integrations |
|
|
166
173
|
|
|
167
174
|
**Claude Code** — available as `/analyze`, `/review`, etc. in `.claude/commands/`
|
|
@@ -207,6 +214,16 @@ For multiple tasks, use batch mode to spec them all up front, then run the full
|
|
|
207
214
|
# Runs Architect → Dev → Test → Review for each task sequentially
|
|
208
215
|
```
|
|
209
216
|
|
|
217
|
+
**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.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
/squad-batch "add dark mode" "fix login bug" "refactor checkout"
|
|
221
|
+
|
|
222
|
+
/squad-run-agents
|
|
223
|
+
# Phase 1: architect agents for all 3 tasks run in parallel
|
|
224
|
+
# Phase 2: dev→test→review pipeline runs in parallel per task
|
|
225
|
+
```
|
|
226
|
+
|
|
210
227
|
### Feedback Loop
|
|
211
228
|
|
|
212
229
|
Any downstream role can raise questions for an upstream role. When this happens, the pipeline pauses and directs you to the right command:
|
|
@@ -273,7 +290,7 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
273
290
|
- 🧠 **Context Engineering** - Structured MD files your AI reads automatically
|
|
274
291
|
- 🔍 **Smart Analysis** - AI generates standards content based on your codebase
|
|
275
292
|
- 🌍 **Project Agnostic** - Works with React, Vue, Node.js, PHP, Python, Rust, monorepos—any project type
|
|
276
|
-
- 🤖 **Multi-Platform** - Works with Cursor, Claude Code, Copilot, Codex, Gemini, Aider, Continue, Windsurf
|
|
293
|
+
- 🤖 **Multi-Platform** - Works with Cursor, Claude Code, Copilot, Codex, OpenCode, Gemini, Aider, Continue, Windsurf
|
|
277
294
|
- 🛡️ **Safe Install** - Backs up existing files with rollback support
|
|
278
295
|
- ⚡ **Zero Config** - Auto-detects project type and package manager
|
|
279
296
|
- ✅ **Policy Enforcement** - Configurable validation with `ck check`
|
|
@@ -292,6 +309,7 @@ ck claude # add Claude Code integration (CLAUDE.md + rules)
|
|
|
292
309
|
ck cursor # add Cursor integration (scoped .mdc rules)
|
|
293
310
|
ck copilot # add GitHub Copilot integration
|
|
294
311
|
ck codex # add Codex CLI integration (AGENTS.md)
|
|
312
|
+
ck opencode # add OpenCode integration (AGENTS.md)
|
|
295
313
|
ck gemini # add Gemini CLI integration (GEMINI.md)
|
|
296
314
|
ck aider # add Aider integration (CONVENTIONS.md)
|
|
297
315
|
ck continue # add Continue integration
|
package/bin/contextkit.js
CHANGED
|
@@ -275,6 +275,19 @@ program
|
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
+
program
|
|
279
|
+
.command('opencode')
|
|
280
|
+
.description('Install OpenCode integration only')
|
|
281
|
+
.option('--non-interactive', 'Skip interactive prompts')
|
|
282
|
+
.action(async (options) => {
|
|
283
|
+
try {
|
|
284
|
+
await install({ platform: 'opencode', ...options });
|
|
285
|
+
} catch (error) {
|
|
286
|
+
console.error(chalk.red('Installation failed:'), error.message);
|
|
287
|
+
process.exit(1);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
|
|
278
291
|
program
|
|
279
292
|
.command('copilot')
|
|
280
293
|
.description('Install GitHub Copilot integration only')
|
package/lib/commands/install.js
CHANGED
|
@@ -127,7 +127,7 @@ class InstallCommand {
|
|
|
127
127
|
|
|
128
128
|
if (!integration) {
|
|
129
129
|
console.log(chalk.red(`❌ Unknown platform: ${platform}`));
|
|
130
|
-
console.log(chalk.yellow('💡 Available: claude, cursor, copilot, codex, gemini, aider, continue, windsurf'));
|
|
130
|
+
console.log(chalk.yellow('💡 Available: claude, cursor, copilot, codex, opencode, gemini, aider, continue, windsurf'));
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -178,6 +178,7 @@ class InstallCommand {
|
|
|
178
178
|
{ name: 'Cursor', value: 'cursor' },
|
|
179
179
|
{ name: 'Copilot (GitHub)', value: 'copilot' },
|
|
180
180
|
{ name: 'Codex (OpenAI)', value: 'codex' },
|
|
181
|
+
{ name: 'OpenCode', value: 'opencode' },
|
|
181
182
|
{ name: 'Gemini', value: 'gemini' },
|
|
182
183
|
{ name: 'Windsurf', value: 'windsurf' },
|
|
183
184
|
{ name: 'Aider', value: 'aider' },
|
|
@@ -597,6 +598,10 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
|
|
|
597
598
|
`${this.repoUrl}/commands/squad-run.md`,
|
|
598
599
|
'.contextkit/commands/squad-run.md'
|
|
599
600
|
);
|
|
601
|
+
await this.downloadManager.downloadFile(
|
|
602
|
+
`${this.repoUrl}/commands/squad-run-agents.md`,
|
|
603
|
+
'.contextkit/commands/squad-run-agents.md'
|
|
604
|
+
);
|
|
600
605
|
|
|
601
606
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
602
607
|
await this.downloadManager.downloadFile(
|
|
@@ -1511,7 +1516,7 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1511
1516
|
console.log(''.padEnd(48, '─'));
|
|
1512
1517
|
console.log(`ck status → Check installation & integrations`);
|
|
1513
1518
|
console.log(`ck ai <cmd> → Use AI with project context`);
|
|
1514
|
-
console.log(`ck <platform> → Add platform (claude, cursor, copilot, codex, gemini, aider, continue, windsurf)`);
|
|
1519
|
+
console.log(`ck <platform> → Add platform (claude, cursor, copilot, codex, opencode, gemini, aider, continue, windsurf)`);
|
|
1515
1520
|
console.log('');
|
|
1516
1521
|
console.log(`Docs → ${chalk.blue('https://contextkit-docs.vercel.app')}`);
|
|
1517
1522
|
console.log(`Issues → ${chalk.blue('https://github.com/nolrm/contextkit/issues')}`);
|
package/lib/commands/update.js
CHANGED
|
@@ -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
|
|
275
|
-
console.log(chalk.dim(' /squad-run
|
|
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'));
|
|
@@ -2,6 +2,7 @@ const ClaudeIntegration = require('./claude-integration');
|
|
|
2
2
|
const CursorIntegration = require('./cursor-integration');
|
|
3
3
|
const CopilotIntegration = require('./copilot-integration');
|
|
4
4
|
const CodexIntegration = require('./codex-integration');
|
|
5
|
+
const OpencodeIntegration = require('./opencode-integration');
|
|
5
6
|
const GeminiIntegration = require('./gemini-integration');
|
|
6
7
|
const AiderIntegration = require('./aider-integration');
|
|
7
8
|
const ContinueIntegration = require('./continue-integration');
|
|
@@ -13,6 +14,7 @@ const INTEGRATIONS = {
|
|
|
13
14
|
copilot: CopilotIntegration,
|
|
14
15
|
vscode: CopilotIntegration, // backward compat alias
|
|
15
16
|
codex: CodexIntegration,
|
|
17
|
+
opencode: OpencodeIntegration,
|
|
16
18
|
gemini: GeminiIntegration,
|
|
17
19
|
aider: AiderIntegration,
|
|
18
20
|
continue: ContinueIntegration,
|
|
@@ -27,7 +29,7 @@ function getIntegration(name) {
|
|
|
27
29
|
|
|
28
30
|
function getAllIntegrationNames() {
|
|
29
31
|
// Return unique names (exclude aliases like vscode)
|
|
30
|
-
return ['claude', 'cursor', 'copilot', 'codex', 'gemini', 'aider', 'continue', 'windsurf'];
|
|
32
|
+
return ['claude', 'cursor', 'copilot', 'codex', 'opencode', 'gemini', 'aider', 'continue', 'windsurf'];
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
module.exports = { getIntegration, getAllIntegrationNames, INTEGRATIONS };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const BaseIntegration = require('./base-integration');
|
|
3
|
+
|
|
4
|
+
class OpencodeIntegration extends BaseIntegration {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
this.name = 'opencode';
|
|
8
|
+
this.displayName = 'OpenCode';
|
|
9
|
+
this.bridgeFiles = ['AGENTS.md'];
|
|
10
|
+
this.generatedFiles = [];
|
|
11
|
+
this.platformDir = '';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async generateFiles() {
|
|
15
|
+
// Bridge file: AGENTS.md (auto-loaded by OpenCode)
|
|
16
|
+
const bridgeContent = `# Project Standards (ContextKit)
|
|
17
|
+
|
|
18
|
+
This project uses [ContextKit](https://github.com/nolrm/contextkit) for AI development standards.
|
|
19
|
+
|
|
20
|
+
${this.getStandardsBlock()}
|
|
21
|
+
|
|
22
|
+
## Corrections Log
|
|
23
|
+
|
|
24
|
+
- \`.contextkit/corrections.md\` — Track AI performance improvements
|
|
25
|
+
|
|
26
|
+
## Quick Reference
|
|
27
|
+
|
|
28
|
+
Before writing code, check the relevant standards files above. Always follow the project's established patterns and conventions.`;
|
|
29
|
+
|
|
30
|
+
await this.writeBridgeFile('AGENTS.md', bridgeContent);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
showUsage() {
|
|
34
|
+
console.log('');
|
|
35
|
+
console.log(chalk.bold(' OpenCode Usage:'));
|
|
36
|
+
console.log(' AGENTS.md is auto-loaded by OpenCode');
|
|
37
|
+
console.log(' Just run: opencode "create a button component"');
|
|
38
|
+
console.log(' Standards are automatically included via AGENTS.md');
|
|
39
|
+
console.log('');
|
|
40
|
+
console.log(chalk.dim(' Files created:'));
|
|
41
|
+
console.log(chalk.dim(' AGENTS.md (bridge - auto-loaded)'));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
module.exports = OpencodeIntegration;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.3",
|
|
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": {
|