@nolrm/contextkit 0.13.2 → 0.13.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 +30 -0
- package/lib/commands/install.js +71 -5
- package/lib/commands/update.js +18 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -284,6 +284,36 @@ Hooks are optional and can be skipped with `ck install --no-hooks`.
|
|
|
284
284
|
|
|
285
285
|
---
|
|
286
286
|
|
|
287
|
+
## CI Squad — GitHub Issues → PR
|
|
288
|
+
|
|
289
|
+
ContextKit can automatically turn GitHub issues into pull requests — no local development required.
|
|
290
|
+
|
|
291
|
+
**How it works:**
|
|
292
|
+
|
|
293
|
+
1. Label any issue `squad-ready`
|
|
294
|
+
2. GitHub Actions runs the full squad pipeline (architect → dev → test → review) using Claude
|
|
295
|
+
3. A draft PR is opened, linked to the issue
|
|
296
|
+
|
|
297
|
+
**Setup:**
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
ck install # answer "yes" to the CI squad prompt
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Then add your Anthropic API key as a repository secret:
|
|
304
|
+
|
|
305
|
+
> **Settings → Secrets and variables → Actions → New repository secret**
|
|
306
|
+
> Name: `ANTHROPIC_API_KEY`
|
|
307
|
+
|
|
308
|
+
**Tips:**
|
|
309
|
+
|
|
310
|
+
- Write issues with clear acceptance criteria for the best results
|
|
311
|
+
- If the issue is too vague, the workflow posts a comment asking for clarification instead of generating a bad PR
|
|
312
|
+
- PRs always open as **draft** — you review and merge manually
|
|
313
|
+
- Re-apply the `squad-ready` label after answering a clarification comment to re-trigger the pipeline
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
287
317
|
## Key Features
|
|
288
318
|
|
|
289
319
|
- 🧠 **Context Engineering** - Structured MD files your AI reads automatically
|
package/lib/commands/install.js
CHANGED
|
@@ -114,11 +114,20 @@ class InstallCommand {
|
|
|
114
114
|
await this.gitHooksManager.installHooks(packageManager, hookChoices);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
// Ask about GitHub Actions CI squad workflow
|
|
118
|
+
let squadCi = false;
|
|
119
|
+
if (!options.nonInteractive) {
|
|
120
|
+
squadCi = await this.promptGitHubActionsWorkflow();
|
|
121
|
+
}
|
|
122
|
+
if (squadCi) {
|
|
123
|
+
await this.installGitHubActionsWorkflow();
|
|
124
|
+
}
|
|
125
|
+
|
|
117
126
|
// Create configuration
|
|
118
|
-
await this.createConfiguration(projectType, hookChoices);
|
|
127
|
+
await this.createConfiguration(projectType, hookChoices, squadCi);
|
|
119
128
|
|
|
120
129
|
// Create status tracking
|
|
121
|
-
await this.createStatusFile(projectType, packageManager, hookChoices);
|
|
130
|
+
await this.createStatusFile(projectType, packageManager, hookChoices, squadCi);
|
|
122
131
|
|
|
123
132
|
// Determine which platform to install
|
|
124
133
|
let chosenPlatform = requestedPlatform || null;
|
|
@@ -204,6 +213,56 @@ class InstallCommand {
|
|
|
204
213
|
return platform;
|
|
205
214
|
}
|
|
206
215
|
|
|
216
|
+
async promptGitHubActionsWorkflow() {
|
|
217
|
+
if (process.env.CI === 'true' || process.env.NON_INTERACTIVE === 'true') {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
console.log('');
|
|
222
|
+
console.log('──────────────────────────────────────────────');
|
|
223
|
+
console.log(chalk.blue('🤖 CI Squad — GitHub Issues → PR'));
|
|
224
|
+
console.log('──────────────────────────────────────────────');
|
|
225
|
+
console.log('');
|
|
226
|
+
console.log(chalk.dim('Label any GitHub issue `squad-ready` and ContextKit will'));
|
|
227
|
+
console.log(chalk.dim('automatically create a branch, run the full squad pipeline'));
|
|
228
|
+
console.log(chalk.dim('(architect → dev → test → review), and open a draft PR.'));
|
|
229
|
+
console.log('');
|
|
230
|
+
console.log(chalk.dim('Requires: ANTHROPIC_API_KEY secret in your repo settings.'));
|
|
231
|
+
console.log('');
|
|
232
|
+
|
|
233
|
+
const { squadCi } = await inquirer.prompt([
|
|
234
|
+
{
|
|
235
|
+
type: 'confirm',
|
|
236
|
+
name: 'squadCi',
|
|
237
|
+
message: 'Install GitHub Actions workflow for issue-triggered squad automation?',
|
|
238
|
+
default: false,
|
|
239
|
+
},
|
|
240
|
+
]);
|
|
241
|
+
|
|
242
|
+
if (squadCi) {
|
|
243
|
+
console.log(chalk.green(' ✅ CI squad workflow will be installed'));
|
|
244
|
+
console.log(chalk.blue(' 💡 Add ANTHROPIC_API_KEY to: Settings → Secrets → Actions'));
|
|
245
|
+
} else {
|
|
246
|
+
console.log(chalk.yellow(' ⏭️ Skipping CI squad workflow'));
|
|
247
|
+
}
|
|
248
|
+
console.log('');
|
|
249
|
+
|
|
250
|
+
return squadCi;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
async installGitHubActionsWorkflow() {
|
|
254
|
+
try {
|
|
255
|
+
await fs.ensureDir('.github/workflows');
|
|
256
|
+
await this.downloadManager.downloadFile(
|
|
257
|
+
`${this.repoUrl}/templates/github-actions/squad-issue.yml`,
|
|
258
|
+
'.github/workflows/squad-issue.yml'
|
|
259
|
+
);
|
|
260
|
+
console.log(chalk.green('✅ CI squad workflow installed → .github/workflows/squad-issue.yml'));
|
|
261
|
+
} catch (error) {
|
|
262
|
+
console.log(chalk.yellow('⚠️ Could not install CI squad workflow:'), error.message);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
207
266
|
async promptGitHooks() {
|
|
208
267
|
// Check for non-interactive mode
|
|
209
268
|
if (process.env.CI === 'true' || process.env.NON_INTERACTIVE === 'true') {
|
|
@@ -738,6 +797,10 @@ Any design decisions, trade-offs, or open questions to resolve before coding.
|
|
|
738
797
|
`${this.repoUrl}/commands/squad-doc.md`,
|
|
739
798
|
'.contextkit/commands/squad-doc.md'
|
|
740
799
|
);
|
|
800
|
+
await this.downloadManager.downloadFile(
|
|
801
|
+
`${this.repoUrl}/commands/squad-ci.md`,
|
|
802
|
+
'.contextkit/commands/squad-ci.md'
|
|
803
|
+
);
|
|
741
804
|
await this.downloadManager.downloadFile(
|
|
742
805
|
`${this.repoUrl}/commands/health-check.md`,
|
|
743
806
|
'.contextkit/commands/health-check.md'
|
|
@@ -948,7 +1011,7 @@ esac
|
|
|
948
1011
|
console.log(chalk.green('✅ CLI helpers installed'));
|
|
949
1012
|
}
|
|
950
1013
|
|
|
951
|
-
async createConfiguration(projectType, hookChoices) {
|
|
1014
|
+
async createConfiguration(projectType, hookChoices, squadCi = false) {
|
|
952
1015
|
const projectName = path.basename(process.cwd());
|
|
953
1016
|
|
|
954
1017
|
const config = {
|
|
@@ -962,7 +1025,8 @@ esac
|
|
|
962
1025
|
linting: true,
|
|
963
1026
|
type_safety: true,
|
|
964
1027
|
pre_push_hook: hookChoices.prePush,
|
|
965
|
-
commit_msg_hook: hookChoices.commitMsg
|
|
1028
|
+
commit_msg_hook: hookChoices.commitMsg,
|
|
1029
|
+
squad_ci_workflow: squadCi,
|
|
966
1030
|
},
|
|
967
1031
|
paths: {
|
|
968
1032
|
components: 'src/components',
|
|
@@ -1038,6 +1102,7 @@ features:
|
|
|
1038
1102
|
type_safety: ${config.features.type_safety}
|
|
1039
1103
|
pre_push_hook: ${config.features.pre_push_hook}
|
|
1040
1104
|
commit_msg_hook: ${config.features.commit_msg_hook}
|
|
1105
|
+
squad_ci_workflow: ${config.features.squad_ci_workflow}
|
|
1041
1106
|
|
|
1042
1107
|
# Paths (customize for your project)
|
|
1043
1108
|
paths:
|
|
@@ -1078,13 +1143,14 @@ https://www.npmjs.com/package/@nolrm/contextkit
|
|
|
1078
1143
|
await fs.writeFile('.contextkit/README.md', content);
|
|
1079
1144
|
}
|
|
1080
1145
|
|
|
1081
|
-
async createStatusFile(projectType, packageManager, hookChoices) {
|
|
1146
|
+
async createStatusFile(projectType, packageManager, hookChoices, squadCi = false) {
|
|
1082
1147
|
try {
|
|
1083
1148
|
const status = this.statusManager.getDefaultStatus();
|
|
1084
1149
|
status.project_type = projectType;
|
|
1085
1150
|
status.package_manager = packageManager;
|
|
1086
1151
|
status.features.pre_push_hook = hookChoices.prePush;
|
|
1087
1152
|
status.features.commit_msg_hook = hookChoices.commitMsg;
|
|
1153
|
+
status.features.squad_ci_workflow = squadCi;
|
|
1088
1154
|
|
|
1089
1155
|
await this.statusManager.saveStatus(status);
|
|
1090
1156
|
console.log(chalk.green('✅ Status tracking initialized'));
|
package/lib/commands/update.js
CHANGED
|
@@ -64,7 +64,7 @@ class UpdateCommand {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// Download latest files
|
|
67
|
-
await this.downloadFiles(projectType);
|
|
67
|
+
await this.downloadFiles(projectType, config);
|
|
68
68
|
|
|
69
69
|
// Remove files that were removed from CK
|
|
70
70
|
await this.removeLegacyFiles();
|
|
@@ -205,13 +205,16 @@ class UpdateCommand {
|
|
|
205
205
|
} else if (trimmed.startsWith('commit_msg_hook:')) {
|
|
206
206
|
config.features = config.features || {};
|
|
207
207
|
config.features.commit_msg_hook = trimmed.split('commit_msg_hook:')[1].trim() === 'true';
|
|
208
|
+
} else if (trimmed.startsWith('squad_ci_workflow:')) {
|
|
209
|
+
config.features = config.features || {};
|
|
210
|
+
config.features.squad_ci_workflow = trimmed.split('squad_ci_workflow:')[1].trim() === 'true';
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
|
|
211
214
|
return config;
|
|
212
215
|
}
|
|
213
216
|
|
|
214
|
-
async downloadFiles(projectType) {
|
|
217
|
+
async downloadFiles(projectType, config = {}) {
|
|
215
218
|
const spinner = ora('Downloading latest files...').start();
|
|
216
219
|
|
|
217
220
|
try {
|
|
@@ -306,11 +309,24 @@ class UpdateCommand {
|
|
|
306
309
|
`${this.repoUrl}/commands/squad-doc.md`,
|
|
307
310
|
'.contextkit/commands/squad-doc.md'
|
|
308
311
|
);
|
|
312
|
+
await this.downloadManager.downloadFile(
|
|
313
|
+
`${this.repoUrl}/commands/squad-ci.md`,
|
|
314
|
+
'.contextkit/commands/squad-ci.md'
|
|
315
|
+
);
|
|
309
316
|
await this.downloadManager.downloadFile(
|
|
310
317
|
`${this.repoUrl}/commands/health-check.md`,
|
|
311
318
|
'.contextkit/commands/health-check.md'
|
|
312
319
|
);
|
|
313
320
|
|
|
321
|
+
// Update CI squad workflow if the user opted in
|
|
322
|
+
if (config.features?.squad_ci_workflow) {
|
|
323
|
+
await fs.ensureDir('.github/workflows');
|
|
324
|
+
await this.downloadManager.downloadFile(
|
|
325
|
+
`${this.repoUrl}/templates/github-actions/squad-issue.yml`,
|
|
326
|
+
'.github/workflows/squad-issue.yml'
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
314
330
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
315
331
|
await this.downloadManager.downloadFile(
|
|
316
332
|
`${this.repoUrl}/hooks/pre-push`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.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": {
|