@nolrm/contextkit 0.13.7 → 0.14.1
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 +19 -4
- package/lib/commands/install.js +175 -73
- package/lib/commands/update.js +98 -58
- package/lib/integrations/claude-integration.js +267 -94
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ Each platform generates bridge files that the AI tool auto-reads. If a bridge fi
|
|
|
114
114
|
/fix # diagnose and fix bugs
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
**Claude Code** — `CLAUDE.md` uses `@` imports to auto-load all standards into context every session (no manual reads needed, saves tokens).
|
|
117
|
+
**Claude Code** — `CLAUDE.md` uses `@` imports to auto-load all standards into context every session (no manual reads needed, saves tokens). Skills in `.claude/skills/`.
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
/analyze # scan codebase and generate standards
|
|
@@ -165,10 +165,13 @@ ContextKit installs reusable slash commands for supported platforms:
|
|
|
165
165
|
| `/squad-review` | Review the full pipeline and give a verdict |
|
|
166
166
|
| `/squad-doc` | Create companion `.md` files for new/modified code after review passes |
|
|
167
167
|
| `/squad-auto` | Auto-run the full pipeline after kickoff (recommended, sequential) |
|
|
168
|
-
| `/squad-auto-parallel`
|
|
169
|
-
| `/ck`
|
|
168
|
+
| `/squad-auto-parallel` | Auto-run the pipeline in parallel using Claude Code agents (Claude Code only) |
|
|
169
|
+
| `/ck` | Health check — verify setup, standards, and integrations |
|
|
170
|
+
| `/agent-push-checklist` | Pre-push quality checklist for agents to self-check before `git push` |
|
|
171
|
+
| `/context-budget` | Prioritized guide for which standards files to load for a given task |
|
|
172
|
+
| `/standards-aware` | Decide whether and how to add a newly discovered pattern to the project's standards files |
|
|
170
173
|
|
|
171
|
-
**Claude Code** — available as `/analyze`, `/review`, etc.
|
|
174
|
+
**Claude Code** — available as `/analyze`, `/review`, etc. via `.claude/skills/`
|
|
172
175
|
**Cursor** — available as slash commands in Chat via `.cursor/prompts/`
|
|
173
176
|
|
|
174
177
|
Both platforms delegate to the universal command files in `.contextkit/commands/`, so you maintain one set of workflows.
|
|
@@ -283,6 +286,18 @@ The pre-push hook detects your project type and runs the right quality checks au
|
|
|
283
286
|
| **Swift** | SwiftLint, swift test |
|
|
284
287
|
| **.NET / C#** | dotnet build, dotnet test |
|
|
285
288
|
|
|
289
|
+
### Managing Gates
|
|
290
|
+
|
|
291
|
+
Use `ck gates` to inspect or toggle individual checks without editing config files manually:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
ck gates # list all gates and their status
|
|
295
|
+
ck gates --disable prettier # disable a specific gate
|
|
296
|
+
ck gates --enable prettier # re-enable it
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Gate state is saved to `.contextkit/quality-gates.yml`. Commit this file to share gate preferences with your team.
|
|
300
|
+
|
|
286
301
|
### Commit Message Format
|
|
287
302
|
|
|
288
303
|
When the `commit-msg` hook is enabled, all commits must follow this format:
|
package/lib/commands/install.js
CHANGED
|
@@ -133,6 +133,9 @@ class InstallCommand {
|
|
|
133
133
|
await this.installGitHubActionsWorkflow();
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
// Create quality gates config
|
|
137
|
+
await this.createQualityGatesConfig();
|
|
138
|
+
|
|
136
139
|
// Create configuration
|
|
137
140
|
await this.createConfiguration(projectType, hookChoices, squadCi);
|
|
138
141
|
|
|
@@ -496,11 +499,43 @@ Run \`/analyze\` to generate this content.`,
|
|
|
496
499
|
|
|
497
500
|
'standards/ai-guidelines.md': `# AI Guidelines
|
|
498
501
|
|
|
499
|
-
|
|
502
|
+
> Run \`/analyze\` to add project-specific rules to this file.
|
|
500
503
|
|
|
501
|
-
|
|
504
|
+
## Agentic Workflow
|
|
502
505
|
|
|
503
|
-
|
|
506
|
+
When working as an agent in this project:
|
|
507
|
+
|
|
508
|
+
- **Read standards first** — load \`code-style.md\` and \`testing.md\` before writing code
|
|
509
|
+
- **Before pushing** — run through \`.contextkit/commands/agents/agent-push-checklist.md\`
|
|
510
|
+
- **Commit format** — all commits must follow Conventional Commits: \`type(scope): description\`
|
|
511
|
+
- Valid types: \`feat\`, \`fix\`, \`improve\`, \`docs\`, \`chore\`, \`refactor\`, \`test\`
|
|
512
|
+
- **When to proceed** — proceed if the task is clear and standards cover it
|
|
513
|
+
- **When to ask** — ask if the task is ambiguous, contradicts existing standards, or requires an architecture decision
|
|
514
|
+
- **No debug statements** — do not leave \`console.log\`, \`print\`, or equivalent debug output in production code
|
|
515
|
+
|
|
516
|
+
## Context Budget
|
|
517
|
+
|
|
518
|
+
Load standards files in this priority order to use your context window efficiently:
|
|
519
|
+
|
|
520
|
+
1. **Always load:** \`code-style.md\`, \`testing.md\` — highest signal, always relevant
|
|
521
|
+
2. **Load at session start:** \`ai-guidelines.md\` (this file) — behaviour rules
|
|
522
|
+
3. **Load on demand:** \`architecture.md\` — only when making structural decisions
|
|
523
|
+
4. **Load on demand:** \`workflows.md\` — only for process questions
|
|
524
|
+
5. **Load selectively:** \`code-style/typescript-style.md\`, \`code-style/css-style.md\` — only for the file type you are editing
|
|
525
|
+
6. **Skip unless needed:** \`glossary.md\` — only when the task involves domain-specific terms
|
|
526
|
+
|
|
527
|
+
If a standards file is longer than 200 lines, read the sections relevant to your task — not the whole file.
|
|
528
|
+
|
|
529
|
+
## Standards Loop
|
|
530
|
+
|
|
531
|
+
This project follows a continuous standards loop:
|
|
532
|
+
|
|
533
|
+
1. Standards files define what correct looks like
|
|
534
|
+
2. Quality gates enforce it at every push (human or agent)
|
|
535
|
+
3. Agents read standards before writing code and write to standards when new patterns emerge
|
|
536
|
+
|
|
537
|
+
When you discover a pattern worth standardising, use \`/standards-aware\` to decide whether and how to add it.
|
|
538
|
+
Without the standards, agents guess. Without the gates, the guesses reach the repo unchecked.`,
|
|
504
539
|
|
|
505
540
|
'standards/workflows.md': `# Workflows
|
|
506
541
|
|
|
@@ -737,104 +772,118 @@ Any design decisions, trade-offs, or open questions to resolve before coding.
|
|
|
737
772
|
|
|
738
773
|
// Download commands
|
|
739
774
|
await this.downloadManager.downloadFile(
|
|
740
|
-
`${this.repoUrl}/commands/analyze.md`,
|
|
741
|
-
'.contextkit/commands/analyze.md'
|
|
775
|
+
`${this.repoUrl}/commands/dev/analyze.md`,
|
|
776
|
+
'.contextkit/commands/dev/analyze.md'
|
|
742
777
|
);
|
|
743
778
|
await this.downloadManager.downloadFile(
|
|
744
|
-
`${this.repoUrl}/commands/review.md`,
|
|
745
|
-
'.contextkit/commands/review.md'
|
|
779
|
+
`${this.repoUrl}/commands/dev/review.md`,
|
|
780
|
+
'.contextkit/commands/dev/review.md'
|
|
746
781
|
);
|
|
747
782
|
await this.downloadManager.downloadFile(
|
|
748
|
-
`${this.repoUrl}/commands/fix.md`,
|
|
749
|
-
'.contextkit/commands/fix.md'
|
|
783
|
+
`${this.repoUrl}/commands/dev/fix.md`,
|
|
784
|
+
'.contextkit/commands/dev/fix.md'
|
|
750
785
|
);
|
|
751
786
|
await this.downloadManager.downloadFile(
|
|
752
|
-
`${this.repoUrl}/commands/refactor.md`,
|
|
753
|
-
'.contextkit/commands/refactor.md'
|
|
787
|
+
`${this.repoUrl}/commands/dev/refactor.md`,
|
|
788
|
+
'.contextkit/commands/dev/refactor.md'
|
|
754
789
|
);
|
|
755
790
|
await this.downloadManager.downloadFile(
|
|
756
|
-
`${this.repoUrl}/commands/run-tests.md`,
|
|
757
|
-
'.contextkit/commands/run-tests.md'
|
|
791
|
+
`${this.repoUrl}/commands/dev/run-tests.md`,
|
|
792
|
+
'.contextkit/commands/dev/run-tests.md'
|
|
758
793
|
);
|
|
759
794
|
await this.downloadManager.downloadFile(
|
|
760
|
-
`${this.repoUrl}/commands/add-documentation.md`,
|
|
761
|
-
'.contextkit/commands/add-documentation.md'
|
|
795
|
+
`${this.repoUrl}/commands/docs/add-documentation.md`,
|
|
796
|
+
'.contextkit/commands/docs/add-documentation.md'
|
|
762
797
|
);
|
|
763
798
|
await this.downloadManager.downloadFile(
|
|
764
|
-
`${this.repoUrl}/commands/quality-check.md`,
|
|
765
|
-
'.contextkit/commands/quality-check.md'
|
|
799
|
+
`${this.repoUrl}/commands/dev/quality-check.md`,
|
|
800
|
+
'.contextkit/commands/dev/quality-check.md'
|
|
766
801
|
);
|
|
767
802
|
await this.downloadManager.downloadFile(
|
|
768
|
-
`${this.repoUrl}/commands/create-feature.md`,
|
|
769
|
-
'.contextkit/commands/create-feature.md'
|
|
803
|
+
`${this.repoUrl}/commands/dev/create-feature.md`,
|
|
804
|
+
'.contextkit/commands/dev/create-feature.md'
|
|
770
805
|
);
|
|
771
806
|
await this.downloadManager.downloadFile(
|
|
772
|
-
`${this.repoUrl}/commands/create-component.md`,
|
|
773
|
-
'.contextkit/commands/create-component.md'
|
|
807
|
+
`${this.repoUrl}/commands/dev/create-component.md`,
|
|
808
|
+
'.contextkit/commands/dev/create-component.md'
|
|
774
809
|
);
|
|
775
810
|
await this.downloadManager.downloadFile(
|
|
776
|
-
`${this.repoUrl}/commands/spec.md`,
|
|
777
|
-
'.contextkit/commands/spec.md'
|
|
811
|
+
`${this.repoUrl}/commands/dev/spec.md`,
|
|
812
|
+
'.contextkit/commands/dev/spec.md'
|
|
778
813
|
);
|
|
779
814
|
|
|
780
815
|
// Download squad commands
|
|
781
816
|
await this.downloadManager.downloadFile(
|
|
782
|
-
`${this.repoUrl}/commands/squad.md`,
|
|
783
|
-
'.contextkit/commands/squad.md'
|
|
817
|
+
`${this.repoUrl}/commands/squad/squad.md`,
|
|
818
|
+
'.contextkit/commands/squad/squad.md'
|
|
784
819
|
);
|
|
785
820
|
await this.downloadManager.downloadFile(
|
|
786
|
-
`${this.repoUrl}/commands/squad-architect.md`,
|
|
787
|
-
'.contextkit/commands/squad-architect.md'
|
|
821
|
+
`${this.repoUrl}/commands/squad/squad-architect.md`,
|
|
822
|
+
'.contextkit/commands/squad/squad-architect.md'
|
|
788
823
|
);
|
|
789
824
|
await this.downloadManager.downloadFile(
|
|
790
|
-
`${this.repoUrl}/commands/squad-dev.md`,
|
|
791
|
-
'.contextkit/commands/squad-dev.md'
|
|
825
|
+
`${this.repoUrl}/commands/squad/squad-dev.md`,
|
|
826
|
+
'.contextkit/commands/squad/squad-dev.md'
|
|
792
827
|
);
|
|
793
828
|
await this.downloadManager.downloadFile(
|
|
794
|
-
`${this.repoUrl}/commands/squad-test.md`,
|
|
795
|
-
'.contextkit/commands/squad-test.md'
|
|
829
|
+
`${this.repoUrl}/commands/squad/squad-test.md`,
|
|
830
|
+
'.contextkit/commands/squad/squad-test.md'
|
|
796
831
|
);
|
|
797
832
|
await this.downloadManager.downloadFile(
|
|
798
|
-
`${this.repoUrl}/commands/squad-review.md`,
|
|
799
|
-
'.contextkit/commands/squad-review.md'
|
|
833
|
+
`${this.repoUrl}/commands/squad/squad-review.md`,
|
|
834
|
+
'.contextkit/commands/squad/squad-review.md'
|
|
800
835
|
);
|
|
801
836
|
await this.downloadManager.downloadFile(
|
|
802
|
-
`${this.repoUrl}/commands/squad-auto.md`,
|
|
803
|
-
'.contextkit/commands/squad-auto.md'
|
|
837
|
+
`${this.repoUrl}/commands/squad/squad-auto.md`,
|
|
838
|
+
'.contextkit/commands/squad/squad-auto.md'
|
|
804
839
|
);
|
|
805
840
|
await this.downloadManager.downloadFile(
|
|
806
|
-
`${this.repoUrl}/commands/squad-auto-parallel.md`,
|
|
807
|
-
'.contextkit/commands/squad-auto-parallel.md'
|
|
841
|
+
`${this.repoUrl}/commands/squad/squad-auto-parallel.md`,
|
|
842
|
+
'.contextkit/commands/squad/squad-auto-parallel.md'
|
|
808
843
|
);
|
|
809
844
|
await this.downloadManager.downloadFile(
|
|
810
|
-
`${this.repoUrl}/commands/squad-reset.md`,
|
|
811
|
-
'.contextkit/commands/squad-reset.md'
|
|
845
|
+
`${this.repoUrl}/commands/squad/squad-reset.md`,
|
|
846
|
+
'.contextkit/commands/squad/squad-reset.md'
|
|
812
847
|
);
|
|
813
848
|
await this.downloadManager.downloadFile(
|
|
814
|
-
`${this.repoUrl}/commands/squad-doc.md`,
|
|
815
|
-
'.contextkit/commands/squad-doc.md'
|
|
849
|
+
`${this.repoUrl}/commands/squad/squad-doc.md`,
|
|
850
|
+
'.contextkit/commands/squad/squad-doc.md'
|
|
816
851
|
);
|
|
817
852
|
await this.downloadManager.downloadFile(
|
|
818
|
-
`${this.repoUrl}/commands/squad-ci.md`,
|
|
819
|
-
'.contextkit/commands/squad-ci.md'
|
|
853
|
+
`${this.repoUrl}/commands/squad/squad-ci.md`,
|
|
854
|
+
'.contextkit/commands/squad/squad-ci.md'
|
|
820
855
|
);
|
|
821
856
|
await this.downloadManager.downloadFile(
|
|
822
|
-
`${this.repoUrl}/commands/health-check.md`,
|
|
823
|
-
'.contextkit/commands/health-check.md'
|
|
857
|
+
`${this.repoUrl}/commands/dev/health-check.md`,
|
|
858
|
+
'.contextkit/commands/dev/health-check.md'
|
|
824
859
|
);
|
|
825
860
|
|
|
826
861
|
// Download doc family commands
|
|
827
862
|
await this.downloadManager.downloadFile(
|
|
828
|
-
`${this.repoUrl}/commands/doc-arch.md`,
|
|
829
|
-
'.contextkit/commands/doc-arch.md'
|
|
863
|
+
`${this.repoUrl}/commands/docs/doc-arch.md`,
|
|
864
|
+
'.contextkit/commands/docs/doc-arch.md'
|
|
830
865
|
);
|
|
831
866
|
await this.downloadManager.downloadFile(
|
|
832
|
-
`${this.repoUrl}/commands/doc-feature.md`,
|
|
833
|
-
'.contextkit/commands/doc-feature.md'
|
|
867
|
+
`${this.repoUrl}/commands/docs/doc-feature.md`,
|
|
868
|
+
'.contextkit/commands/docs/doc-feature.md'
|
|
834
869
|
);
|
|
835
870
|
await this.downloadManager.downloadFile(
|
|
836
|
-
`${this.repoUrl}/commands/doc-component.md`,
|
|
837
|
-
'.contextkit/commands/doc-component.md'
|
|
871
|
+
`${this.repoUrl}/commands/docs/doc-component.md`,
|
|
872
|
+
'.contextkit/commands/docs/doc-component.md'
|
|
873
|
+
);
|
|
874
|
+
|
|
875
|
+
// Download agentic workflow commands
|
|
876
|
+
await this.downloadManager.downloadFile(
|
|
877
|
+
`${this.repoUrl}/commands/agents/context-budget.md`,
|
|
878
|
+
'.contextkit/commands/agents/context-budget.md'
|
|
879
|
+
);
|
|
880
|
+
await this.downloadManager.downloadFile(
|
|
881
|
+
`${this.repoUrl}/commands/agents/agent-push-checklist.md`,
|
|
882
|
+
'.contextkit/commands/agents/agent-push-checklist.md'
|
|
883
|
+
);
|
|
884
|
+
await this.downloadManager.downloadFile(
|
|
885
|
+
`${this.repoUrl}/commands/agents/standards-aware.md`,
|
|
886
|
+
'.contextkit/commands/agents/standards-aware.md'
|
|
838
887
|
);
|
|
839
888
|
|
|
840
889
|
// Download hooks (pre-push and commit-msg only, no pre-commit)
|
|
@@ -937,15 +986,15 @@ claude "read .contextkit/context.md to see available standards, then create a bu
|
|
|
937
986
|
- \`.contextkit/product/context.md\` - Domain-specific context
|
|
938
987
|
|
|
939
988
|
### Commands
|
|
940
|
-
- \`.contextkit/commands/analyze.md\` - Analyze & customize standards
|
|
941
|
-
- \`.contextkit/commands/review.md\` - Code review
|
|
942
|
-
- \`.contextkit/commands/fix.md\` - Diagnose and fix bugs
|
|
943
|
-
- \`.contextkit/commands/refactor.md\` - Refactor code structure
|
|
944
|
-
- \`.contextkit/commands/run-tests.md\` - Generate or run tests
|
|
945
|
-
- \`.contextkit/commands/add-documentation.md\` - Add documentation
|
|
946
|
-
- \`.contextkit/commands/quality-check.md\` - Quality checks
|
|
947
|
-
- \`.contextkit/commands/create-component.md\` - Create component
|
|
948
|
-
- \`.contextkit/commands/create-feature.md\` - Create feature
|
|
989
|
+
- \`.contextkit/commands/dev/analyze.md\` - Analyze & customize standards
|
|
990
|
+
- \`.contextkit/commands/dev/review.md\` - Code review
|
|
991
|
+
- \`.contextkit/commands/dev/fix.md\` - Diagnose and fix bugs
|
|
992
|
+
- \`.contextkit/commands/dev/refactor.md\` - Refactor code structure
|
|
993
|
+
- \`.contextkit/commands/dev/run-tests.md\` - Generate or run tests
|
|
994
|
+
- \`.contextkit/commands/docs/add-documentation.md\` - Add documentation
|
|
995
|
+
- \`.contextkit/commands/dev/quality-check.md\` - Quality checks
|
|
996
|
+
- \`.contextkit/commands/dev/create-component.md\` - Create component
|
|
997
|
+
- \`.contextkit/commands/dev/create-feature.md\` - Create feature
|
|
949
998
|
|
|
950
999
|
### Instructions
|
|
951
1000
|
- \`.contextkit/instructions/meta/pre-flight.md\` - Pre-flight checks
|
|
@@ -1066,15 +1115,15 @@ esac
|
|
|
1066
1115
|
docs: 'docs',
|
|
1067
1116
|
},
|
|
1068
1117
|
commands: {
|
|
1069
|
-
analyze: '@.contextkit/commands/analyze.md',
|
|
1070
|
-
review: '@.contextkit/commands/review.md',
|
|
1071
|
-
fix: '@.contextkit/commands/fix.md',
|
|
1072
|
-
refactor: '@.contextkit/commands/refactor.md',
|
|
1073
|
-
run_tests: '@.contextkit/commands/run-tests.md',
|
|
1074
|
-
add_docs: '@.contextkit/commands/add-documentation.md',
|
|
1075
|
-
quality_check: '@.contextkit/commands/quality-check.md',
|
|
1076
|
-
create_component: '@.contextkit/commands/create-component.md',
|
|
1077
|
-
create_feature: '@.contextkit/commands/create-feature.md',
|
|
1118
|
+
analyze: '@.contextkit/commands/dev/analyze.md',
|
|
1119
|
+
review: '@.contextkit/commands/dev/review.md',
|
|
1120
|
+
fix: '@.contextkit/commands/dev/fix.md',
|
|
1121
|
+
refactor: '@.contextkit/commands/dev/refactor.md',
|
|
1122
|
+
run_tests: '@.contextkit/commands/dev/run-tests.md',
|
|
1123
|
+
add_docs: '@.contextkit/commands/docs/add-documentation.md',
|
|
1124
|
+
quality_check: '@.contextkit/commands/dev/quality-check.md',
|
|
1125
|
+
create_component: '@.contextkit/commands/dev/create-component.md',
|
|
1126
|
+
create_feature: '@.contextkit/commands/dev/create-feature.md',
|
|
1078
1127
|
},
|
|
1079
1128
|
};
|
|
1080
1129
|
|
|
@@ -1740,7 +1789,7 @@ enforcement:
|
|
|
1740
1789
|
|
|
1741
1790
|
if (platform === 'cursor') {
|
|
1742
1791
|
console.log(chalk.bold('In Cursor Chat:'));
|
|
1743
|
-
console.log(` @.contextkit/commands/analyze.md`);
|
|
1792
|
+
console.log(` @.contextkit/commands/dev/analyze.md`);
|
|
1744
1793
|
console.log('');
|
|
1745
1794
|
console.log('Or via CLI:');
|
|
1746
1795
|
console.log(chalk.yellow('👉'), `/analyze`);
|
|
@@ -1766,7 +1815,7 @@ enforcement:
|
|
|
1766
1815
|
|
|
1767
1816
|
if (platform === 'cursor') {
|
|
1768
1817
|
console.log(chalk.bold('In Cursor Chat'));
|
|
1769
|
-
console.log(`@.contextkit/commands/create-component.md`);
|
|
1818
|
+
console.log(`@.contextkit/commands/dev/create-component.md`);
|
|
1770
1819
|
console.log(chalk.dim('"Create a Button component for customer checkout"'));
|
|
1771
1820
|
console.log('');
|
|
1772
1821
|
}
|
|
@@ -1774,7 +1823,7 @@ enforcement:
|
|
|
1774
1823
|
console.log(chalk.bold('In CLI'));
|
|
1775
1824
|
console.log(
|
|
1776
1825
|
chalk.dim(
|
|
1777
|
-
"Use your AI tool's slash command, e.g. /analyze or @.contextkit/commands/create-component.md"
|
|
1826
|
+
"Use your AI tool's slash command, e.g. /analyze or @.contextkit/commands/dev/create-component.md"
|
|
1778
1827
|
)
|
|
1779
1828
|
);
|
|
1780
1829
|
console.log('');
|
|
@@ -1782,7 +1831,7 @@ enforcement:
|
|
|
1782
1831
|
if (platform === 'claude' || platform === 'gemini') {
|
|
1783
1832
|
const toolName = platform === 'claude' ? 'Claude' : 'Gemini';
|
|
1784
1833
|
console.log(chalk.bold(`In ${toolName} CLI`));
|
|
1785
|
-
console.log(`read .contextkit/commands/analyze.md and execute`);
|
|
1834
|
+
console.log(`read .contextkit/commands/dev/analyze.md and execute`);
|
|
1786
1835
|
console.log('');
|
|
1787
1836
|
}
|
|
1788
1837
|
|
|
@@ -1973,6 +2022,59 @@ module.exports = [
|
|
|
1973
2022
|
}
|
|
1974
2023
|
return false;
|
|
1975
2024
|
}
|
|
2025
|
+
|
|
2026
|
+
async createQualityGatesConfig() {
|
|
2027
|
+
const configPath = '.contextkit/quality-gates.yml';
|
|
2028
|
+
if (await fs.pathExists(configPath)) return;
|
|
2029
|
+
const content = `# Quality Gates Configuration
|
|
2030
|
+
# Disable specific gates by uncommenting keys below.
|
|
2031
|
+
# All gates are enabled by default.
|
|
2032
|
+
# Reference: https://contextkit-docs.vercel.app/docs/quality-gates
|
|
2033
|
+
|
|
2034
|
+
disabled:
|
|
2035
|
+
# Node.js gates
|
|
2036
|
+
# - typescript # skip TypeScript type checking
|
|
2037
|
+
# - eslint # skip ESLint (direct, not via script)
|
|
2038
|
+
# - prettier # skip Prettier (direct, not via script)
|
|
2039
|
+
# - format # skip npm run format
|
|
2040
|
+
# - lint # skip npm run lint
|
|
2041
|
+
# - build # skip npm run build
|
|
2042
|
+
# - test # skip npm test
|
|
2043
|
+
# - e2e # skip npm run e2e
|
|
2044
|
+
# Python gates
|
|
2045
|
+
# - ruff-lint # skip ruff/flake8 lint
|
|
2046
|
+
# - typecheck # skip mypy
|
|
2047
|
+
# - ruff-format # skip ruff/black format check
|
|
2048
|
+
# - pytest # skip pytest
|
|
2049
|
+
# Rust gates
|
|
2050
|
+
# - cargo-check # skip cargo check
|
|
2051
|
+
# - clippy # skip cargo clippy
|
|
2052
|
+
# - cargo-test # skip cargo test
|
|
2053
|
+
# Go gates
|
|
2054
|
+
# - go-vet # skip go vet
|
|
2055
|
+
# - golangci-lint # skip golangci-lint
|
|
2056
|
+
# - go-test # skip go test
|
|
2057
|
+
# PHP gates
|
|
2058
|
+
# - phpstan # skip PHPStan
|
|
2059
|
+
# - phpunit # skip PHPUnit
|
|
2060
|
+
# Ruby gates
|
|
2061
|
+
# - rubocop # skip RuboCop
|
|
2062
|
+
# - rspec # skip RSpec / rake test
|
|
2063
|
+
# Java / Kotlin gates
|
|
2064
|
+
# - maven-verify # skip mvn verify
|
|
2065
|
+
# - gradle-check # skip gradle check
|
|
2066
|
+
# - ktlint # skip ktlint
|
|
2067
|
+
# - kotlin-test # skip gradle test
|
|
2068
|
+
# Swift gates
|
|
2069
|
+
# - swiftlint # skip SwiftLint
|
|
2070
|
+
# - swift-test # skip swift test
|
|
2071
|
+
# .NET gates
|
|
2072
|
+
# - dotnet-build # skip dotnet build
|
|
2073
|
+
# - dotnet-test # skip dotnet test
|
|
2074
|
+
`;
|
|
2075
|
+
await fs.writeFile(configPath, content);
|
|
2076
|
+
console.log(chalk.green('✅ Created .contextkit/quality-gates.yml'));
|
|
2077
|
+
}
|
|
1976
2078
|
}
|
|
1977
2079
|
|
|
1978
2080
|
async function install(options) {
|
package/lib/commands/update.js
CHANGED
|
@@ -236,104 +236,116 @@ class UpdateCommand {
|
|
|
236
236
|
|
|
237
237
|
// Download commands
|
|
238
238
|
await this.downloadManager.downloadFile(
|
|
239
|
-
`${this.repoUrl}/commands/analyze.md`,
|
|
240
|
-
'.contextkit/commands/analyze.md'
|
|
239
|
+
`${this.repoUrl}/commands/dev/analyze.md`,
|
|
240
|
+
'.contextkit/commands/dev/analyze.md'
|
|
241
241
|
);
|
|
242
242
|
await this.downloadManager.downloadFile(
|
|
243
|
-
`${this.repoUrl}/commands/review.md`,
|
|
244
|
-
'.contextkit/commands/review.md'
|
|
243
|
+
`${this.repoUrl}/commands/dev/review.md`,
|
|
244
|
+
'.contextkit/commands/dev/review.md'
|
|
245
245
|
);
|
|
246
246
|
await this.downloadManager.downloadFile(
|
|
247
|
-
`${this.repoUrl}/commands/fix.md`,
|
|
248
|
-
'.contextkit/commands/fix.md'
|
|
247
|
+
`${this.repoUrl}/commands/dev/fix.md`,
|
|
248
|
+
'.contextkit/commands/dev/fix.md'
|
|
249
249
|
);
|
|
250
250
|
await this.downloadManager.downloadFile(
|
|
251
|
-
`${this.repoUrl}/commands/refactor.md`,
|
|
252
|
-
'.contextkit/commands/refactor.md'
|
|
251
|
+
`${this.repoUrl}/commands/dev/refactor.md`,
|
|
252
|
+
'.contextkit/commands/dev/refactor.md'
|
|
253
253
|
);
|
|
254
254
|
await this.downloadManager.downloadFile(
|
|
255
|
-
`${this.repoUrl}/commands/run-tests.md`,
|
|
256
|
-
'.contextkit/commands/run-tests.md'
|
|
255
|
+
`${this.repoUrl}/commands/dev/run-tests.md`,
|
|
256
|
+
'.contextkit/commands/dev/run-tests.md'
|
|
257
257
|
);
|
|
258
258
|
await this.downloadManager.downloadFile(
|
|
259
|
-
`${this.repoUrl}/commands/add-documentation.md`,
|
|
260
|
-
'.contextkit/commands/add-documentation.md'
|
|
259
|
+
`${this.repoUrl}/commands/docs/add-documentation.md`,
|
|
260
|
+
'.contextkit/commands/docs/add-documentation.md'
|
|
261
261
|
);
|
|
262
262
|
await this.downloadManager.downloadFile(
|
|
263
|
-
`${this.repoUrl}/commands/quality-check.md`,
|
|
264
|
-
'.contextkit/commands/quality-check.md'
|
|
263
|
+
`${this.repoUrl}/commands/dev/quality-check.md`,
|
|
264
|
+
'.contextkit/commands/dev/quality-check.md'
|
|
265
265
|
);
|
|
266
266
|
await this.downloadManager.downloadFile(
|
|
267
|
-
`${this.repoUrl}/commands/create-feature.md`,
|
|
268
|
-
'.contextkit/commands/create-feature.md'
|
|
267
|
+
`${this.repoUrl}/commands/dev/create-feature.md`,
|
|
268
|
+
'.contextkit/commands/dev/create-feature.md'
|
|
269
269
|
);
|
|
270
270
|
await this.downloadManager.downloadFile(
|
|
271
|
-
`${this.repoUrl}/commands/create-component.md`,
|
|
272
|
-
'.contextkit/commands/create-component.md'
|
|
271
|
+
`${this.repoUrl}/commands/dev/create-component.md`,
|
|
272
|
+
'.contextkit/commands/dev/create-component.md'
|
|
273
273
|
);
|
|
274
274
|
await this.downloadManager.downloadFile(
|
|
275
|
-
`${this.repoUrl}/commands/spec.md`,
|
|
276
|
-
'.contextkit/commands/spec.md'
|
|
275
|
+
`${this.repoUrl}/commands/dev/spec.md`,
|
|
276
|
+
'.contextkit/commands/dev/spec.md'
|
|
277
277
|
);
|
|
278
278
|
|
|
279
279
|
// Download squad commands
|
|
280
280
|
await this.downloadManager.downloadFile(
|
|
281
|
-
`${this.repoUrl}/commands/squad.md`,
|
|
282
|
-
'.contextkit/commands/squad.md'
|
|
281
|
+
`${this.repoUrl}/commands/squad/squad.md`,
|
|
282
|
+
'.contextkit/commands/squad/squad.md'
|
|
283
283
|
);
|
|
284
284
|
await this.downloadManager.downloadFile(
|
|
285
|
-
`${this.repoUrl}/commands/squad-architect.md`,
|
|
286
|
-
'.contextkit/commands/squad-architect.md'
|
|
285
|
+
`${this.repoUrl}/commands/squad/squad-architect.md`,
|
|
286
|
+
'.contextkit/commands/squad/squad-architect.md'
|
|
287
287
|
);
|
|
288
288
|
await this.downloadManager.downloadFile(
|
|
289
|
-
`${this.repoUrl}/commands/squad-dev.md`,
|
|
290
|
-
'.contextkit/commands/squad-dev.md'
|
|
289
|
+
`${this.repoUrl}/commands/squad/squad-dev.md`,
|
|
290
|
+
'.contextkit/commands/squad/squad-dev.md'
|
|
291
291
|
);
|
|
292
292
|
await this.downloadManager.downloadFile(
|
|
293
|
-
`${this.repoUrl}/commands/squad-test.md`,
|
|
294
|
-
'.contextkit/commands/squad-test.md'
|
|
293
|
+
`${this.repoUrl}/commands/squad/squad-test.md`,
|
|
294
|
+
'.contextkit/commands/squad/squad-test.md'
|
|
295
295
|
);
|
|
296
296
|
await this.downloadManager.downloadFile(
|
|
297
|
-
`${this.repoUrl}/commands/squad-review.md`,
|
|
298
|
-
'.contextkit/commands/squad-review.md'
|
|
297
|
+
`${this.repoUrl}/commands/squad/squad-review.md`,
|
|
298
|
+
'.contextkit/commands/squad/squad-review.md'
|
|
299
299
|
);
|
|
300
300
|
await this.downloadManager.downloadFile(
|
|
301
|
-
`${this.repoUrl}/commands/squad-auto.md`,
|
|
302
|
-
'.contextkit/commands/squad-auto.md'
|
|
301
|
+
`${this.repoUrl}/commands/squad/squad-auto.md`,
|
|
302
|
+
'.contextkit/commands/squad/squad-auto.md'
|
|
303
303
|
);
|
|
304
304
|
await this.downloadManager.downloadFile(
|
|
305
|
-
`${this.repoUrl}/commands/squad-auto-parallel.md`,
|
|
306
|
-
'.contextkit/commands/squad-auto-parallel.md'
|
|
305
|
+
`${this.repoUrl}/commands/squad/squad-auto-parallel.md`,
|
|
306
|
+
'.contextkit/commands/squad/squad-auto-parallel.md'
|
|
307
307
|
);
|
|
308
308
|
await this.downloadManager.downloadFile(
|
|
309
|
-
`${this.repoUrl}/commands/squad-reset.md`,
|
|
310
|
-
'.contextkit/commands/squad-reset.md'
|
|
309
|
+
`${this.repoUrl}/commands/squad/squad-reset.md`,
|
|
310
|
+
'.contextkit/commands/squad/squad-reset.md'
|
|
311
311
|
);
|
|
312
312
|
await this.downloadManager.downloadFile(
|
|
313
|
-
`${this.repoUrl}/commands/squad-doc.md`,
|
|
314
|
-
'.contextkit/commands/squad-doc.md'
|
|
313
|
+
`${this.repoUrl}/commands/squad/squad-doc.md`,
|
|
314
|
+
'.contextkit/commands/squad/squad-doc.md'
|
|
315
315
|
);
|
|
316
316
|
await this.downloadManager.downloadFile(
|
|
317
|
-
`${this.repoUrl}/commands/squad-ci.md`,
|
|
318
|
-
'.contextkit/commands/squad-ci.md'
|
|
317
|
+
`${this.repoUrl}/commands/squad/squad-ci.md`,
|
|
318
|
+
'.contextkit/commands/squad/squad-ci.md'
|
|
319
319
|
);
|
|
320
320
|
await this.downloadManager.downloadFile(
|
|
321
|
-
`${this.repoUrl}/commands/health-check.md`,
|
|
322
|
-
'.contextkit/commands/health-check.md'
|
|
321
|
+
`${this.repoUrl}/commands/dev/health-check.md`,
|
|
322
|
+
'.contextkit/commands/dev/health-check.md'
|
|
323
323
|
);
|
|
324
324
|
|
|
325
325
|
// Download doc family commands
|
|
326
326
|
await this.downloadManager.downloadFile(
|
|
327
|
-
`${this.repoUrl}/commands/doc-arch.md`,
|
|
328
|
-
'.contextkit/commands/doc-arch.md'
|
|
327
|
+
`${this.repoUrl}/commands/docs/doc-arch.md`,
|
|
328
|
+
'.contextkit/commands/docs/doc-arch.md'
|
|
329
329
|
);
|
|
330
330
|
await this.downloadManager.downloadFile(
|
|
331
|
-
`${this.repoUrl}/commands/doc-feature.md`,
|
|
332
|
-
'.contextkit/commands/doc-feature.md'
|
|
331
|
+
`${this.repoUrl}/commands/docs/doc-feature.md`,
|
|
332
|
+
'.contextkit/commands/docs/doc-feature.md'
|
|
333
333
|
);
|
|
334
334
|
await this.downloadManager.downloadFile(
|
|
335
|
-
`${this.repoUrl}/commands/doc-component.md`,
|
|
336
|
-
'.contextkit/commands/doc-component.md'
|
|
335
|
+
`${this.repoUrl}/commands/docs/doc-component.md`,
|
|
336
|
+
'.contextkit/commands/docs/doc-component.md'
|
|
337
|
+
);
|
|
338
|
+
await this.downloadManager.downloadFile(
|
|
339
|
+
`${this.repoUrl}/commands/agents/context-budget.md`,
|
|
340
|
+
'.contextkit/commands/agents/context-budget.md'
|
|
341
|
+
);
|
|
342
|
+
await this.downloadManager.downloadFile(
|
|
343
|
+
`${this.repoUrl}/commands/agents/agent-push-checklist.md`,
|
|
344
|
+
'.contextkit/commands/agents/agent-push-checklist.md'
|
|
345
|
+
);
|
|
346
|
+
await this.downloadManager.downloadFile(
|
|
347
|
+
`${this.repoUrl}/commands/agents/standards-aware.md`,
|
|
348
|
+
'.contextkit/commands/agents/standards-aware.md'
|
|
337
349
|
);
|
|
338
350
|
|
|
339
351
|
// Update CI squad workflow if the user opted in
|
|
@@ -426,15 +438,15 @@ paths:
|
|
|
426
438
|
|
|
427
439
|
# Commands
|
|
428
440
|
commands:
|
|
429
|
-
analyze: "${config.commands?.analyze || '@.contextkit/commands/analyze.md'}"
|
|
430
|
-
review: "${config.commands?.review || '@.contextkit/commands/review.md'}"
|
|
431
|
-
fix: "${config.commands?.fix || '@.contextkit/commands/fix.md'}"
|
|
432
|
-
refactor: "${config.commands?.refactor || '@.contextkit/commands/refactor.md'}"
|
|
433
|
-
run_tests: "${config.commands?.run_tests || '@.contextkit/commands/run-tests.md'}"
|
|
434
|
-
add_docs: "${config.commands?.add_docs || '@.contextkit/commands/add-documentation.md'}"
|
|
435
|
-
quality_check: "${config.commands?.quality_check || '@.contextkit/commands/quality-check.md'}"
|
|
436
|
-
create_component: "${config.commands?.create_component || '@.contextkit/commands/create-component.md'}"
|
|
437
|
-
create_feature: "${config.commands?.create_feature || '@.contextkit/commands/create-feature.md'}"
|
|
441
|
+
analyze: "${config.commands?.analyze || '@.contextkit/commands/dev/analyze.md'}"
|
|
442
|
+
review: "${config.commands?.review || '@.contextkit/commands/dev/review.md'}"
|
|
443
|
+
fix: "${config.commands?.fix || '@.contextkit/commands/dev/fix.md'}"
|
|
444
|
+
refactor: "${config.commands?.refactor || '@.contextkit/commands/dev/refactor.md'}"
|
|
445
|
+
run_tests: "${config.commands?.run_tests || '@.contextkit/commands/dev/run-tests.md'}"
|
|
446
|
+
add_docs: "${config.commands?.add_docs || '@.contextkit/commands/docs/add-documentation.md'}"
|
|
447
|
+
quality_check: "${config.commands?.quality_check || '@.contextkit/commands/dev/quality-check.md'}"
|
|
448
|
+
create_component: "${config.commands?.create_component || '@.contextkit/commands/dev/create-component.md'}"
|
|
449
|
+
create_feature: "${config.commands?.create_feature || '@.contextkit/commands/dev/create-feature.md'}"
|
|
438
450
|
`;
|
|
439
451
|
|
|
440
452
|
await fs.writeFile('.contextkit/config.yml', configContent);
|
|
@@ -465,7 +477,35 @@ commands:
|
|
|
465
477
|
}
|
|
466
478
|
|
|
467
479
|
async removeLegacyFiles() {
|
|
468
|
-
const legacyFiles = [
|
|
480
|
+
const legacyFiles = [
|
|
481
|
+
// Removed in 0.14.0 — commands reorganised into dev/ squad/ docs/ agents/ subdirs
|
|
482
|
+
'.contextkit/commands/analyze.md',
|
|
483
|
+
'.contextkit/commands/review.md',
|
|
484
|
+
'.contextkit/commands/fix.md',
|
|
485
|
+
'.contextkit/commands/refactor.md',
|
|
486
|
+
'.contextkit/commands/run-tests.md',
|
|
487
|
+
'.contextkit/commands/add-documentation.md',
|
|
488
|
+
'.contextkit/commands/quality-check.md',
|
|
489
|
+
'.contextkit/commands/create-feature.md',
|
|
490
|
+
'.contextkit/commands/create-component.md',
|
|
491
|
+
'.contextkit/commands/spec.md',
|
|
492
|
+
'.contextkit/commands/health-check.md',
|
|
493
|
+
'.contextkit/commands/squad.md',
|
|
494
|
+
'.contextkit/commands/squad-architect.md',
|
|
495
|
+
'.contextkit/commands/squad-dev.md',
|
|
496
|
+
'.contextkit/commands/squad-test.md',
|
|
497
|
+
'.contextkit/commands/squad-review.md',
|
|
498
|
+
'.contextkit/commands/squad-auto.md',
|
|
499
|
+
'.contextkit/commands/squad-auto-parallel.md',
|
|
500
|
+
'.contextkit/commands/squad-reset.md',
|
|
501
|
+
'.contextkit/commands/squad-doc.md',
|
|
502
|
+
'.contextkit/commands/squad-ci.md',
|
|
503
|
+
'.contextkit/commands/doc-arch.md',
|
|
504
|
+
'.contextkit/commands/doc-feature.md',
|
|
505
|
+
'.contextkit/commands/doc-component.md',
|
|
506
|
+
// Older legacy
|
|
507
|
+
'.contextkit/commands/squad-peer-review.md',
|
|
508
|
+
];
|
|
469
509
|
for (const file of legacyFiles) {
|
|
470
510
|
if (await fs.pathExists(file)) {
|
|
471
511
|
await fs.remove(file);
|
|
@@ -11,6 +11,59 @@ class ClaudeIntegration extends BaseIntegration {
|
|
|
11
11
|
'.claude/rules/contextkit-standards.md',
|
|
12
12
|
'.claude/rules/contextkit-testing.md',
|
|
13
13
|
'.claude/rules/contextkit-code-style.md',
|
|
14
|
+
'.claude/skills/analyze/SKILL.md',
|
|
15
|
+
'.claude/skills/review/SKILL.md',
|
|
16
|
+
'.claude/skills/fix/SKILL.md',
|
|
17
|
+
'.claude/skills/refactor/SKILL.md',
|
|
18
|
+
'.claude/skills/test/SKILL.md',
|
|
19
|
+
'.claude/skills/doc/SKILL.md',
|
|
20
|
+
'.claude/skills/squad/SKILL.md',
|
|
21
|
+
'.claude/skills/squad-architect/SKILL.md',
|
|
22
|
+
'.claude/skills/squad-dev/SKILL.md',
|
|
23
|
+
'.claude/skills/squad-test/SKILL.md',
|
|
24
|
+
'.claude/skills/squad-review/SKILL.md',
|
|
25
|
+
'.claude/skills/squad-auto/SKILL.md',
|
|
26
|
+
'.claude/skills/squad-auto-parallel/SKILL.md',
|
|
27
|
+
'.claude/skills/squad-reset/SKILL.md',
|
|
28
|
+
'.claude/skills/squad-doc/SKILL.md',
|
|
29
|
+
'.claude/skills/spec/SKILL.md',
|
|
30
|
+
'.claude/skills/ck/SKILL.md',
|
|
31
|
+
'.claude/skills/doc-arch/SKILL.md',
|
|
32
|
+
'.claude/skills/doc-feature/SKILL.md',
|
|
33
|
+
'.claude/skills/doc-component/SKILL.md',
|
|
34
|
+
'.claude/skills/agent-push-checklist/SKILL.md',
|
|
35
|
+
'.claude/skills/context-budget/SKILL.md',
|
|
36
|
+
'.claude/skills/standards-aware/SKILL.md',
|
|
37
|
+
];
|
|
38
|
+
this.platformDir = '.claude/rules';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async install() {
|
|
42
|
+
await super.install();
|
|
43
|
+
const fs = require('fs-extra');
|
|
44
|
+
await fs.ensureDir('.claude/skills');
|
|
45
|
+
await this.addToGitignore('.claude/settings.local.json');
|
|
46
|
+
await this.removeLegacyFiles();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async addToGitignore(entry) {
|
|
50
|
+
const fs = require('fs-extra');
|
|
51
|
+
if (!fs.existsSync('.gitignore')) return;
|
|
52
|
+
const content = await fs.readFile('.gitignore', 'utf-8');
|
|
53
|
+
if (content.includes(entry)) return;
|
|
54
|
+
const separator = content.endsWith('\n') ? '' : '\n';
|
|
55
|
+
await fs.appendFile('.gitignore', `${separator}${entry}\n`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async removeLegacyFiles() {
|
|
59
|
+
const fs = require('fs-extra');
|
|
60
|
+
const legacyFiles = [
|
|
61
|
+
'.claude/rules/vibe-kit-standards.md',
|
|
62
|
+
'.claude/rules/vibe-kit-testing.md',
|
|
63
|
+
'.claude/rules/vibe-kit-code-style.md',
|
|
64
|
+
'.claude/commands/squad-batch.md',
|
|
65
|
+
'.claude/commands/squad-peer-review.md',
|
|
66
|
+
// Migrated to .claude/skills/ in 0.15.0
|
|
14
67
|
'.claude/commands/analyze.md',
|
|
15
68
|
'.claude/commands/review.md',
|
|
16
69
|
'.claude/commands/fix.md',
|
|
@@ -31,25 +84,9 @@ class ClaudeIntegration extends BaseIntegration {
|
|
|
31
84
|
'.claude/commands/doc-arch.md',
|
|
32
85
|
'.claude/commands/doc-feature.md',
|
|
33
86
|
'.claude/commands/doc-component.md',
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
async install() {
|
|
39
|
-
await super.install();
|
|
40
|
-
const fs = require('fs-extra');
|
|
41
|
-
await fs.ensureDir('.claude/commands');
|
|
42
|
-
await this.removeLegacyFiles();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async removeLegacyFiles() {
|
|
46
|
-
const fs = require('fs-extra');
|
|
47
|
-
const legacyFiles = [
|
|
48
|
-
'.claude/rules/vibe-kit-standards.md',
|
|
49
|
-
'.claude/rules/vibe-kit-testing.md',
|
|
50
|
-
'.claude/rules/vibe-kit-code-style.md',
|
|
51
|
-
'.claude/commands/squad-batch.md',
|
|
52
|
-
'.claude/commands/squad-peer-review.md',
|
|
87
|
+
'.claude/commands/agent-push-checklist.md',
|
|
88
|
+
'.claude/commands/context-budget.md',
|
|
89
|
+
'.claude/commands/standards-aware.md',
|
|
53
90
|
];
|
|
54
91
|
for (const file of legacyFiles) {
|
|
55
92
|
if (await fs.pathExists(file)) {
|
|
@@ -78,11 +115,11 @@ The following standards are auto-loaded into context via @imports:
|
|
|
78
115
|
|
|
79
116
|
## Commands
|
|
80
117
|
|
|
81
|
-
- \`.contextkit/commands/analyze.md\` — Analyze and customize standards
|
|
82
|
-
- \`.contextkit/commands/create-component.md\` — Create components
|
|
83
|
-
- \`.contextkit/commands/create-feature.md\` — Create features
|
|
84
|
-
- \`.contextkit/commands/run-tests.md\` — Run tests
|
|
85
|
-
- \`.contextkit/commands/quality-check.md\` — Quality checks`;
|
|
118
|
+
- \`.contextkit/commands/dev/analyze.md\` — Analyze and customize standards
|
|
119
|
+
- \`.contextkit/commands/dev/create-component.md\` — Create components
|
|
120
|
+
- \`.contextkit/commands/dev/create-feature.md\` — Create features
|
|
121
|
+
- \`.contextkit/commands/dev/run-tests.md\` — Run tests
|
|
122
|
+
- \`.contextkit/commands/dev/quality-check.md\` — Quality checks`;
|
|
86
123
|
}
|
|
87
124
|
|
|
88
125
|
async generateFiles() {
|
|
@@ -163,83 +200,137 @@ Follow the code style standards auto-loaded via CLAUDE.md (from code-style.md).
|
|
|
163
200
|
`;
|
|
164
201
|
await this.writeGeneratedFile('.claude/rules/contextkit-code-style.md', codeStyleRule);
|
|
165
202
|
|
|
166
|
-
//
|
|
203
|
+
// Skills — delegate to .contextkit/commands/ with rich frontmatter for Claude Code
|
|
167
204
|
await this.writeGeneratedFile(
|
|
168
|
-
'.claude/
|
|
169
|
-
|
|
205
|
+
'.claude/skills/analyze/SKILL.md',
|
|
206
|
+
`---
|
|
207
|
+
description: Analyze project and generate customized standards
|
|
208
|
+
argument-hint: "[optional: scope or package path]"
|
|
209
|
+
allowed-tools: Read, Glob, Grep, Write, Bash
|
|
210
|
+
effort: high
|
|
211
|
+
---
|
|
170
212
|
|
|
171
|
-
Read \`.contextkit/commands/analyze.md\` and execute the analysis workflow for this project.
|
|
213
|
+
Read \`.contextkit/commands/dev/analyze.md\` and execute the analysis workflow for this project.
|
|
172
214
|
|
|
173
215
|
Scan the codebase structure, detect frameworks and patterns, then generate customized standards files in \`.contextkit/standards/\`.
|
|
174
216
|
`
|
|
175
217
|
);
|
|
176
218
|
|
|
177
219
|
await this.writeGeneratedFile(
|
|
178
|
-
'.claude/
|
|
179
|
-
|
|
220
|
+
'.claude/skills/review/SKILL.md',
|
|
221
|
+
`---
|
|
222
|
+
description: Review current changes for correctness and standards compliance
|
|
223
|
+
argument-hint: "[optional: file or directory]"
|
|
224
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
225
|
+
effort: normal
|
|
226
|
+
---
|
|
180
227
|
|
|
181
|
-
Read \`.contextkit/commands/review.md\` and execute the review workflow.
|
|
228
|
+
Read \`.contextkit/commands/dev/review.md\` and execute the review workflow.
|
|
182
229
|
|
|
183
230
|
Review current changes for correctness, standards compliance, and potential issues.
|
|
184
231
|
`
|
|
185
232
|
);
|
|
186
233
|
|
|
187
234
|
await this.writeGeneratedFile(
|
|
188
|
-
'.claude/
|
|
189
|
-
|
|
235
|
+
'.claude/skills/fix/SKILL.md',
|
|
236
|
+
`---
|
|
237
|
+
description: Diagnose root cause and implement a minimal bug fix with regression test
|
|
238
|
+
argument-hint: "<description of the bug>"
|
|
239
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
240
|
+
effort: normal
|
|
241
|
+
---
|
|
190
242
|
|
|
191
|
-
Read \`.contextkit/commands/fix.md\` and execute the bug fix workflow.
|
|
243
|
+
Read \`.contextkit/commands/dev/fix.md\` and execute the bug fix workflow.
|
|
192
244
|
|
|
193
245
|
Diagnose the root cause, implement the minimal fix, and add a regression test.
|
|
194
246
|
`
|
|
195
247
|
);
|
|
196
248
|
|
|
197
249
|
await this.writeGeneratedFile(
|
|
198
|
-
'.claude/
|
|
199
|
-
|
|
250
|
+
'.claude/skills/refactor/SKILL.md',
|
|
251
|
+
`---
|
|
252
|
+
description: Improve code structure without changing behavior
|
|
253
|
+
argument-hint: "[optional: file or scope]"
|
|
254
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
255
|
+
effort: normal
|
|
256
|
+
---
|
|
200
257
|
|
|
201
|
-
Read \`.contextkit/commands/refactor.md\` and execute the refactoring workflow.
|
|
258
|
+
Read \`.contextkit/commands/dev/refactor.md\` and execute the refactoring workflow.
|
|
202
259
|
|
|
203
260
|
Improve code structure without changing behavior, keeping tests green at every step.
|
|
204
261
|
`
|
|
205
262
|
);
|
|
206
263
|
|
|
207
264
|
await this.writeGeneratedFile(
|
|
208
|
-
'.claude/
|
|
209
|
-
|
|
265
|
+
'.claude/skills/test/SKILL.md',
|
|
266
|
+
`---
|
|
267
|
+
description: Generate or run tests covering happy paths, edge cases, and errors
|
|
268
|
+
argument-hint: "[optional: file or function]"
|
|
269
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
270
|
+
effort: normal
|
|
271
|
+
---
|
|
210
272
|
|
|
211
|
-
Read \`.contextkit/commands/run-tests.md\` and execute the testing workflow.
|
|
273
|
+
Read \`.contextkit/commands/dev/run-tests.md\` and execute the testing workflow.
|
|
212
274
|
|
|
213
275
|
Generate or run tests for the specified code, covering happy paths, edge cases, and errors.
|
|
214
276
|
`
|
|
215
277
|
);
|
|
216
278
|
|
|
217
279
|
await this.writeGeneratedFile(
|
|
218
|
-
'.claude/
|
|
219
|
-
|
|
280
|
+
'.claude/skills/doc/SKILL.md',
|
|
281
|
+
`---
|
|
282
|
+
description: Add inline docs, README sections, and usage examples
|
|
283
|
+
argument-hint: "[optional: file or module]"
|
|
284
|
+
allowed-tools: Read, Edit, Write, Glob, Grep
|
|
285
|
+
effort: normal
|
|
286
|
+
---
|
|
220
287
|
|
|
221
|
-
Read \`.contextkit/commands/add-documentation.md\` and execute the documentation workflow.
|
|
288
|
+
Read \`.contextkit/commands/docs/add-documentation.md\` and execute the documentation workflow.
|
|
222
289
|
|
|
223
290
|
Add inline docs, README sections, and usage examples for the specified code.
|
|
224
291
|
`
|
|
225
292
|
);
|
|
226
293
|
|
|
227
294
|
await this.writeGeneratedFile(
|
|
228
|
-
'.claude/
|
|
229
|
-
|
|
295
|
+
'.claude/skills/spec/SKILL.md',
|
|
296
|
+
`---
|
|
297
|
+
description: Write a component spec (MD-first) before coding begins
|
|
298
|
+
argument-hint: "<component or feature name>"
|
|
299
|
+
allowed-tools: Read, Write, Glob, Grep
|
|
300
|
+
effort: normal
|
|
301
|
+
---
|
|
230
302
|
|
|
231
|
-
Read \`.contextkit/commands/spec.md\` and execute the spec workflow.
|
|
303
|
+
Read \`.contextkit/commands/dev/spec.md\` and execute the spec workflow.
|
|
232
304
|
|
|
233
305
|
Write a component spec (MD-first) before any code is created. Scaffold the spec file colocated with the component and wait for review before coding begins.
|
|
234
306
|
`
|
|
235
307
|
);
|
|
236
308
|
|
|
237
|
-
// Squad slash commands
|
|
238
309
|
await this.writeGeneratedFile(
|
|
239
|
-
'.claude/
|
|
240
|
-
|
|
310
|
+
'.claude/skills/ck/SKILL.md',
|
|
311
|
+
`---
|
|
312
|
+
description: Check project setup, standards status, and integrations
|
|
313
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
314
|
+
effort: low
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
Read \`.contextkit/commands/dev/health-check.md\` and execute the health check workflow.
|
|
318
|
+
|
|
319
|
+
Check project setup, standards status, and integrations. Report what needs attention.
|
|
320
|
+
`
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
// Squad skills
|
|
324
|
+
await this.writeGeneratedFile(
|
|
325
|
+
'.claude/skills/squad/SKILL.md',
|
|
326
|
+
`---
|
|
327
|
+
description: Squad pipeline kickoff — create handoff file and write PO spec
|
|
328
|
+
argument-hint: '"<task description>"'
|
|
329
|
+
allowed-tools: Read, Write, Glob, Grep
|
|
330
|
+
effort: normal
|
|
331
|
+
---
|
|
241
332
|
|
|
242
|
-
Read \`.contextkit/commands/squad.md\` and execute the squad kickoff workflow.
|
|
333
|
+
Read \`.contextkit/commands/squad/squad.md\` and execute the squad kickoff workflow.
|
|
243
334
|
|
|
244
335
|
Create the handoff file and write the PO spec for the given task. Pass the user's task description as the input.
|
|
245
336
|
|
|
@@ -248,101 +339,130 @@ After kickoff, run \`/squad-auto\` to auto-run the full pipeline hands-free, or
|
|
|
248
339
|
);
|
|
249
340
|
|
|
250
341
|
await this.writeGeneratedFile(
|
|
251
|
-
'.claude/
|
|
252
|
-
|
|
342
|
+
'.claude/skills/squad-architect/SKILL.md',
|
|
343
|
+
`---
|
|
344
|
+
description: Write technical implementation plan from PO spec (manual step 1/4)
|
|
345
|
+
allowed-tools: Read, Write, Glob, Grep, Bash
|
|
346
|
+
effort: normal
|
|
347
|
+
---
|
|
253
348
|
|
|
254
|
-
Read \`.contextkit/commands/squad-architect.md\` and execute the architect workflow.
|
|
349
|
+
Read \`.contextkit/commands/squad/squad-architect.md\` and execute the architect workflow.
|
|
255
350
|
|
|
256
351
|
Read the PO spec from the handoff file, design the technical approach, and write the implementation plan. Use \`/squad-auto\` instead to run all steps automatically.
|
|
257
352
|
`
|
|
258
353
|
);
|
|
259
354
|
|
|
260
355
|
await this.writeGeneratedFile(
|
|
261
|
-
'.claude/
|
|
262
|
-
|
|
356
|
+
'.claude/skills/squad-dev/SKILL.md',
|
|
357
|
+
`---
|
|
358
|
+
description: Implement code changes following architect plan (manual step 2/4)
|
|
359
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
360
|
+
effort: normal
|
|
361
|
+
---
|
|
263
362
|
|
|
264
|
-
Read \`.contextkit/commands/squad-dev.md\` and execute the dev workflow.
|
|
363
|
+
Read \`.contextkit/commands/squad/squad-dev.md\` and execute the dev workflow.
|
|
265
364
|
|
|
266
365
|
Follow the architect's plan to implement the code changes. Use \`/squad-auto\` instead to run all steps automatically.
|
|
267
366
|
`
|
|
268
367
|
);
|
|
269
368
|
|
|
270
369
|
await this.writeGeneratedFile(
|
|
271
|
-
'.claude/
|
|
272
|
-
|
|
370
|
+
'.claude/skills/squad-test/SKILL.md',
|
|
371
|
+
`---
|
|
372
|
+
description: Write and run tests against acceptance criteria (manual step 3/4)
|
|
373
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
374
|
+
effort: normal
|
|
375
|
+
---
|
|
273
376
|
|
|
274
|
-
Read \`.contextkit/commands/squad-test.md\` and execute the test workflow.
|
|
377
|
+
Read \`.contextkit/commands/squad/squad-test.md\` and execute the test workflow.
|
|
275
378
|
|
|
276
379
|
Write and run tests against the PO's acceptance criteria. Use \`/squad-auto\` instead to run all steps automatically.
|
|
277
380
|
`
|
|
278
381
|
);
|
|
279
382
|
|
|
280
383
|
await this.writeGeneratedFile(
|
|
281
|
-
'.claude/
|
|
282
|
-
|
|
384
|
+
'.claude/skills/squad-review/SKILL.md',
|
|
385
|
+
`---
|
|
386
|
+
description: Review full handoff and write pass/needs-work verdict (manual step 4/4)
|
|
387
|
+
allowed-tools: Read, Write, Glob, Grep, Bash
|
|
388
|
+
effort: normal
|
|
389
|
+
---
|
|
283
390
|
|
|
284
|
-
Read \`.contextkit/commands/squad-review.md\` and execute the review workflow.
|
|
391
|
+
Read \`.contextkit/commands/squad/squad-review.md\` and execute the review workflow.
|
|
285
392
|
|
|
286
393
|
Review the full handoff (spec, plan, implementation, tests) and write the final verdict. Use \`/squad-auto\` instead to run all steps automatically.
|
|
287
394
|
`
|
|
288
395
|
);
|
|
289
396
|
|
|
290
397
|
await this.writeGeneratedFile(
|
|
291
|
-
'.claude/
|
|
292
|
-
|
|
398
|
+
'.claude/skills/squad-auto/SKILL.md',
|
|
399
|
+
`---
|
|
400
|
+
description: Auto-run full squad pipeline hands-free (architect → dev → test → review → doc)
|
|
401
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
402
|
+
effort: high
|
|
403
|
+
context: fork
|
|
404
|
+
---
|
|
293
405
|
|
|
294
|
-
Read \`.contextkit/commands/squad-auto.md\` and execute the pipeline runner workflow.
|
|
406
|
+
Read \`.contextkit/commands/squad/squad-auto.md\` and execute the pipeline runner workflow.
|
|
295
407
|
|
|
296
408
|
Run after \`/squad\` kickoff. Automatically runs architect → dev → test → review for all tasks sequentially, hands-free.
|
|
297
409
|
`
|
|
298
410
|
);
|
|
299
411
|
|
|
300
412
|
await this.writeGeneratedFile(
|
|
301
|
-
'.claude/
|
|
302
|
-
|
|
413
|
+
'.claude/skills/squad-auto-parallel/SKILL.md',
|
|
414
|
+
`---
|
|
415
|
+
description: Auto-run squad pipeline with parallel agents — one per task per phase (fastest)
|
|
416
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
417
|
+
effort: high
|
|
418
|
+
context: fork
|
|
419
|
+
---
|
|
303
420
|
|
|
304
|
-
Read \`.contextkit/commands/squad-auto-parallel.md\` and execute the parallel pipeline workflow.
|
|
421
|
+
Read \`.contextkit/commands/squad/squad-auto-parallel.md\` and execute the parallel pipeline workflow.
|
|
305
422
|
|
|
306
423
|
Spawn one subagent per task per phase using the Task tool, so all tasks progress simultaneously instead of sequentially. Use this after \`/squad\` batch kickoff for faster execution on multi-task batches.
|
|
307
424
|
`
|
|
308
425
|
);
|
|
309
426
|
|
|
310
427
|
await this.writeGeneratedFile(
|
|
311
|
-
'.claude/
|
|
312
|
-
|
|
428
|
+
'.claude/skills/squad-reset/SKILL.md',
|
|
429
|
+
`---
|
|
430
|
+
description: Delete squad state to start fresh
|
|
431
|
+
allowed-tools: Read, Write, Glob
|
|
432
|
+
effort: low
|
|
433
|
+
---
|
|
313
434
|
|
|
314
|
-
Read \`.contextkit/commands/squad-reset.md\` and execute the reset workflow.
|
|
435
|
+
Read \`.contextkit/commands/squad/squad-reset.md\` and execute the reset workflow.
|
|
315
436
|
|
|
316
437
|
Delete the current squad state (.contextkit/squad/) so you can start fresh. Use when the squad folder is in a mixed or stuck state.
|
|
317
438
|
`
|
|
318
439
|
);
|
|
319
440
|
|
|
320
441
|
await this.writeGeneratedFile(
|
|
321
|
-
'.claude/
|
|
322
|
-
|
|
442
|
+
'.claude/skills/squad-doc/SKILL.md',
|
|
443
|
+
`---
|
|
444
|
+
description: Document changes after review passes (manual step 5/5)
|
|
445
|
+
allowed-tools: Read, Edit, Write, Glob, Grep
|
|
446
|
+
effort: normal
|
|
447
|
+
---
|
|
323
448
|
|
|
324
|
-
Read \`.contextkit/commands/squad-doc.md\` and execute the doc workflow.
|
|
449
|
+
Read \`.contextkit/commands/squad/squad-doc.md\` and execute the doc workflow.
|
|
325
450
|
|
|
326
451
|
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.
|
|
327
452
|
`
|
|
328
453
|
);
|
|
329
454
|
|
|
455
|
+
// Doc family skills
|
|
330
456
|
await this.writeGeneratedFile(
|
|
331
|
-
'.claude/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
);
|
|
339
|
-
|
|
340
|
-
// Doc family slash commands
|
|
341
|
-
await this.writeGeneratedFile(
|
|
342
|
-
'.claude/commands/doc-arch.md',
|
|
343
|
-
`# Doc — Architecture (Level 1)
|
|
457
|
+
'.claude/skills/doc-arch/SKILL.md',
|
|
458
|
+
`---
|
|
459
|
+
description: Generate or update architecture documentation (Level 1)
|
|
460
|
+
argument-hint: "[optional: PR number]"
|
|
461
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
462
|
+
effort: high
|
|
463
|
+
---
|
|
344
464
|
|
|
345
|
-
Read \`.contextkit/commands/doc-arch.md\` and execute the architecture documentation workflow.
|
|
465
|
+
Read \`.contextkit/commands/docs/doc-arch.md\` and execute the architecture documentation workflow.
|
|
346
466
|
|
|
347
467
|
Detect the project stack, then generate or update \`docs/architecture.md\` with system boundaries, key flows, and stack-appropriate artifacts (Mermaid diagrams, component trees, service maps).
|
|
348
468
|
|
|
@@ -351,10 +471,15 @@ Pass an optional PR number to scope to that PR's changes.
|
|
|
351
471
|
);
|
|
352
472
|
|
|
353
473
|
await this.writeGeneratedFile(
|
|
354
|
-
'.claude/
|
|
355
|
-
|
|
474
|
+
'.claude/skills/doc-feature/SKILL.md',
|
|
475
|
+
`---
|
|
476
|
+
description: Generate or update feature documentation (Level 2)
|
|
477
|
+
argument-hint: "[optional: feature name, path, or PR number]"
|
|
478
|
+
allowed-tools: Read, Edit, Write, Glob, Grep, Bash
|
|
479
|
+
effort: high
|
|
480
|
+
---
|
|
356
481
|
|
|
357
|
-
Read \`.contextkit/commands/doc-feature.md\` and execute the feature documentation workflow.
|
|
482
|
+
Read \`.contextkit/commands/docs/doc-feature.md\` and execute the feature documentation workflow.
|
|
358
483
|
|
|
359
484
|
Detect the project stack, identify the target feature from the argument or current branch, then generate or update \`docs/features/<name>.md\` with purpose, components/modules, data flow, and user flows.
|
|
360
485
|
|
|
@@ -363,14 +488,62 @@ Pass a feature name, directory path, or PR number to scope the documentation.
|
|
|
363
488
|
);
|
|
364
489
|
|
|
365
490
|
await this.writeGeneratedFile(
|
|
366
|
-
'.claude/
|
|
367
|
-
|
|
491
|
+
'.claude/skills/doc-component/SKILL.md',
|
|
492
|
+
`---
|
|
493
|
+
description: Generate or update component documentation (Level 3)
|
|
494
|
+
argument-hint: "[optional: file path or directory]"
|
|
495
|
+
allowed-tools: Read, Edit, Write, Glob, Grep
|
|
496
|
+
effort: normal
|
|
497
|
+
---
|
|
368
498
|
|
|
369
|
-
Read \`.contextkit/commands/doc-component.md\` and execute the component documentation workflow.
|
|
499
|
+
Read \`.contextkit/commands/docs/doc-component.md\` and execute the component documentation workflow.
|
|
370
500
|
|
|
371
501
|
Detect the project stack, read the target file or directory, then create or update a colocated \`<name>.md\` with API/props, usage examples, behavior, and edge cases.
|
|
372
502
|
|
|
373
503
|
Pass a file path or directory to target. Omit to infer from current context.
|
|
504
|
+
`
|
|
505
|
+
);
|
|
506
|
+
|
|
507
|
+
// Agent skills
|
|
508
|
+
await this.writeGeneratedFile(
|
|
509
|
+
'.claude/skills/agent-push-checklist/SKILL.md',
|
|
510
|
+
`---
|
|
511
|
+
description: Pre-push quality checklist for agents before git push
|
|
512
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
513
|
+
effort: low
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
Read \`.contextkit/commands/agents/agent-push-checklist.md\` and execute the agent push checklist workflow.
|
|
517
|
+
|
|
518
|
+
Run before pushing from an AI agent. Validates that changes are safe, tests pass, and the push is ready.
|
|
519
|
+
`
|
|
520
|
+
);
|
|
521
|
+
|
|
522
|
+
await this.writeGeneratedFile(
|
|
523
|
+
'.claude/skills/context-budget/SKILL.md',
|
|
524
|
+
`---
|
|
525
|
+
description: Check context consumption and advise on compact, summarise, or continue
|
|
526
|
+
allowed-tools: Read, Glob, Grep
|
|
527
|
+
effort: low
|
|
528
|
+
---
|
|
529
|
+
|
|
530
|
+
Read \`.contextkit/commands/agents/context-budget.md\` and execute the context budget workflow.
|
|
531
|
+
|
|
532
|
+
Check how much context has been consumed and advise on whether to compact, summarise, or continue.
|
|
533
|
+
`
|
|
534
|
+
);
|
|
535
|
+
|
|
536
|
+
await this.writeGeneratedFile(
|
|
537
|
+
'.claude/skills/standards-aware/SKILL.md',
|
|
538
|
+
`---
|
|
539
|
+
description: Load and apply project standards before acting in an agentic context
|
|
540
|
+
allowed-tools: Read, Glob, Grep
|
|
541
|
+
effort: low
|
|
542
|
+
---
|
|
543
|
+
|
|
544
|
+
Read \`.contextkit/commands/agents/standards-aware.md\` and execute the standards-aware workflow.
|
|
545
|
+
|
|
546
|
+
Load and apply the project's ContextKit standards before taking action in an agentic context.
|
|
374
547
|
`
|
|
375
548
|
);
|
|
376
549
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
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": {
|