@nolrm/contextkit 0.7.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,7 +47,7 @@ This creates `.contextkit/` with skeleton context files (blank templates to be f
47
47
  standards/ # Skeleton files: code-style.md, testing.md, architecture.md, ai-guidelines.md, workflows.md
48
48
  # Real files: glossary.md (universal), README.md (overview)
49
49
  commands/ # analyze.md (project analysis & customization)
50
- templates/ # example component template
50
+ templates/ # skeleton template files (component, test, story, hook, api)
51
51
  ```
52
52
 
53
53
  **Generate content with AI** (recommended):
@@ -403,6 +403,55 @@ This file is loaded when HTML-related tasks are detected:
403
403
  }
404
404
  }
405
405
 
406
+ async createSkeletonTemplates() {
407
+ const skeletonFiles = {
408
+ 'templates/component.md': `# Component Template
409
+
410
+ <!-- Content will be generated by running: ck analyze -->
411
+
412
+ Your canonical component/module pattern will be generated based on your project's framework, language, and conventions.
413
+
414
+ Run \`ck analyze\` to generate this content, or manually add your component pattern below.
415
+ `,
416
+ 'templates/test.md': `# Test Template
417
+
418
+ <!-- Content will be generated by running: ck analyze -->
419
+
420
+ Your canonical test file pattern will be generated based on your project's testing framework and conventions.
421
+
422
+ Run \`ck analyze\` to generate this content, or manually add your test pattern below.
423
+ `,
424
+ 'templates/story.md': `# Story/Demo Template
425
+
426
+ <!-- Content will be generated by running: ck analyze -->
427
+
428
+ Your canonical story/demo pattern will be generated based on your project's documentation and showcase conventions.
429
+
430
+ Run \`ck analyze\` to generate this content, or manually add your story/demo pattern below.
431
+ `,
432
+ 'templates/hook.md': `# Hook/Composable/Helper Template
433
+
434
+ <!-- Content will be generated by running: ck analyze -->
435
+
436
+ Your canonical hook, composable, or helper pattern will be generated based on your project's framework and conventions.
437
+
438
+ Run \`ck analyze\` to generate this content, or manually add your pattern below.
439
+ `,
440
+ 'templates/api.md': `# API Service/Client Template
441
+
442
+ <!-- Content will be generated by running: ck analyze -->
443
+
444
+ Your canonical API service or client pattern will be generated based on your project's architecture and conventions.
445
+
446
+ Run \`ck analyze\` to generate this content, or manually add your API pattern below.
447
+ `
448
+ };
449
+
450
+ for (const [relativePath, content] of Object.entries(skeletonFiles)) {
451
+ await fs.writeFile(`.contextkit/${relativePath}`, content);
452
+ }
453
+ }
454
+
406
455
  async downloadFiles(projectType, options = {}, detectedTools = {}) {
407
456
  try {
408
457
  // Create skeleton standards files (will be customized by analyze)
@@ -487,27 +536,8 @@ This file is loaded when HTML-related tasks are detected:
487
536
  '.contextkit/types/typescript-strict.json'
488
537
  );
489
538
 
490
- // Download templates
491
- await this.downloadManager.downloadFile(
492
- `${this.repoUrl}/templates/component.tsx`,
493
- '.contextkit/templates/component.tsx'
494
- );
495
- await this.downloadManager.downloadFile(
496
- `${this.repoUrl}/templates/test.tsx`,
497
- '.contextkit/templates/test.tsx'
498
- );
499
- await this.downloadManager.downloadFile(
500
- `${this.repoUrl}/templates/story.tsx`,
501
- '.contextkit/templates/story.tsx'
502
- );
503
- await this.downloadManager.downloadFile(
504
- `${this.repoUrl}/templates/hook.ts`,
505
- '.contextkit/templates/hook.ts'
506
- );
507
- await this.downloadManager.downloadFile(
508
- `${this.repoUrl}/templates/api.ts`,
509
- '.contextkit/templates/api.ts'
510
- );
539
+ // Create skeleton template files (will be customized by analyze)
540
+ await this.createSkeletonTemplates();
511
541
 
512
542
  // Download scripts
513
543
  await this.downloadManager.downloadFile(
@@ -631,11 +661,11 @@ claude "read .contextkit/context.md to see available standards, then create a bu
631
661
  - \`.contextkit/instructions/core/auto-corrections-log.md\` - Auto-logging instructions
632
662
 
633
663
  ### Templates
634
- - \`.contextkit/templates/component.tsx\`
635
- - \`.contextkit/templates/test.tsx\`
636
- - \`.contextkit/templates/story.tsx\`
637
- - \`.contextkit/templates/hook.ts\`
638
- - \`.contextkit/templates/api.ts\`
664
+ - \`.contextkit/templates/component.md\`
665
+ - \`.contextkit/templates/test.md\`
666
+ - \`.contextkit/templates/story.md\`
667
+ - \`.contextkit/templates/hook.md\`
668
+ - \`.contextkit/templates/api.md\`
639
669
 
640
670
  ### Tracking
641
671
  - \`.contextkit/corrections.md\` - AI performance corrections log
@@ -255,27 +255,7 @@ class UpdateCommand {
255
255
  '.contextkit/types/typescript-strict.json'
256
256
  );
257
257
 
258
- // Download templates
259
- await this.downloadManager.downloadFile(
260
- `${this.repoUrl}/templates/component.tsx`,
261
- '.contextkit/templates/component.tsx'
262
- );
263
- await this.downloadManager.downloadFile(
264
- `${this.repoUrl}/templates/test.tsx`,
265
- '.contextkit/templates/test.tsx'
266
- );
267
- await this.downloadManager.downloadFile(
268
- `${this.repoUrl}/templates/story.tsx`,
269
- '.contextkit/templates/story.tsx'
270
- );
271
- await this.downloadManager.downloadFile(
272
- `${this.repoUrl}/templates/hook.ts`,
273
- '.contextkit/templates/hook.ts'
274
- );
275
- await this.downloadManager.downloadFile(
276
- `${this.repoUrl}/templates/api.ts`,
277
- '.contextkit/templates/api.ts'
278
- );
258
+ // Templates are user-owned skeleton files — not overwritten during update
279
259
 
280
260
  // Download scripts
281
261
  await this.downloadManager.downloadFile(
@@ -47,10 +47,10 @@ ${this.getStandardsBlock()}
47
47
 
48
48
  ## Templates
49
49
 
50
- - @.contextkit/templates/component.tsx — Component template
51
- - @.contextkit/templates/test.tsx — Test template
52
- - @.contextkit/templates/hook.ts — Custom hook template
53
- - @.contextkit/templates/api.ts — API service template
50
+ - @.contextkit/templates/component.md — Component template
51
+ - @.contextkit/templates/test.md — Test template
52
+ - @.contextkit/templates/hook.md — Custom hook template
53
+ - @.contextkit/templates/api.md — API service template
54
54
 
55
55
  ## Always Include
56
56
 
@@ -88,7 +88,7 @@ globs:
88
88
  When writing or modifying tests, follow:
89
89
  - \`.contextkit/standards/testing.md\` for test patterns and requirements
90
90
  - All test cases MUST use numbered descriptions (e.g., \`it("1. renders correctly")\`)
91
- - Reference \`.contextkit/templates/test.tsx\` for test template patterns
91
+ - Reference \`.contextkit/templates/test.md\` for test template patterns
92
92
  `;
93
93
  await this.writeGeneratedFile('.claude/rules/contextkit-testing.md', testingRule);
94
94
 
@@ -106,9 +106,9 @@ globs:
106
106
 
107
107
  When writing or modifying source code, follow:
108
108
  - \`.contextkit/standards/code-style.md\` for coding conventions
109
- - \`.contextkit/templates/component.tsx\` for component patterns
110
- - \`.contextkit/templates/hook.ts\` for custom hook patterns
111
- - \`.contextkit/templates/api.ts\` for API service patterns
109
+ - \`.contextkit/templates/component.md\` for component patterns
110
+ - \`.contextkit/templates/hook.md\` for custom hook patterns
111
+ - \`.contextkit/templates/api.md\` for API service patterns
112
112
  `;
113
113
  await this.writeGeneratedFile('.claude/rules/contextkit-code-style.md', codeStyleRule);
114
114
 
@@ -25,7 +25,7 @@ ${this.getStandardsBlock()}
25
25
  - Follow coding conventions in \`.contextkit/standards/code-style.md\`
26
26
  - Use numbered test cases as defined in \`.contextkit/standards/testing.md\`
27
27
  - Check \`.contextkit/standards/glossary.md\` for project-specific terminology
28
- - Reference \`.contextkit/templates/\` for code generation patterns`;
28
+ - Reference \`.contextkit/templates/\` for code generation patterns (skeleton .md files)`;
29
29
 
30
30
  await this.writeBridgeFile('.github/copilot-instructions.md', bridgeContent);
31
31
 
@@ -95,7 +95,7 @@ describe("ComponentName", () => {
95
95
 
96
96
  ## Templates
97
97
 
98
- - @.contextkit/templates/test.tsx — Test template
98
+ - @.contextkit/templates/test.md — Test template
99
99
  `;
100
100
  await this.writeGeneratedFile('.cursor/rules/contextkit-testing.mdc', testingRule);
101
101
 
@@ -112,9 +112,9 @@ Reference: @.contextkit/standards/code-style.md
112
112
 
113
113
  ## Templates
114
114
 
115
- - @.contextkit/templates/component.tsx — Component template
116
- - @.contextkit/templates/story.tsxStorybook template
117
- - @.contextkit/templates/hook.ts — Custom hook template
115
+ - @.contextkit/templates/component.md — Component template
116
+ - @.contextkit/templates/story.mdStory/demo template
117
+ - @.contextkit/templates/hook.md — Custom hook template
118
118
 
119
119
  ## Commands
120
120
 
@@ -135,7 +135,7 @@ Reference: @.contextkit/standards/architecture.md
135
135
 
136
136
  ## Templates
137
137
 
138
- - @.contextkit/templates/api.ts — API service template
138
+ - @.contextkit/templates/api.md — API service template
139
139
 
140
140
  ## Commands
141
141
 
@@ -59,10 +59,10 @@ This project uses ContextKit for structured development standards.
59
59
 
60
60
  ## Templates
61
61
 
62
- - \`.contextkit/templates/component.tsx\` — Component template
63
- - \`.contextkit/templates/test.tsx\` — Test template
64
- - \`.contextkit/templates/hook.ts\` — Custom hook template
65
- - \`.contextkit/templates/api.ts\` — API service template
62
+ - \`.contextkit/templates/component.md\` — Component template
63
+ - \`.contextkit/templates/test.md\` — Test template
64
+ - \`.contextkit/templates/hook.md\` — Custom hook template
65
+ - \`.contextkit/templates/api.md\` — API service template
66
66
 
67
67
  ## Commands
68
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolrm/contextkit",
3
- "version": "0.7.4",
3
+ "version": "0.8.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": {