@nolrm/contextkit 0.12.8 → 0.12.10

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
@@ -29,41 +29,23 @@ Each platform gets auto-loaded bridge files (`CLAUDE.md`, `AGENTS.md`, `GEMINI.m
29
29
 
30
30
  ## Quick Start (60s)
31
31
 
32
- **Requirements:** Node.js 14.x+ (16.x+ recommended) and npm/yarn. Optional: Git for hooks, AI tools for usage.
33
-
32
+ **1. Install the CLI**
34
33
  ```bash
35
- # Step 1: Install the CLI globally (one-time, any machine)
36
34
  npm i -g @nolrm/contextkit
37
-
38
- # Step 2: Initialize in your project (once per project)
39
- cd your-project
40
- contextkit install # interactive — prompts "Which AI tool?"
41
- contextkit install claude # or specify your platform directly
42
35
  ```
43
36
 
44
- > **Project-level only.** `ck install` creates `.contextkit/` in your current directory and commits it with your project. There is no global mode — your standards live in git, not on your machine. This keeps them portable, CI-compatible, and shared with your team.
45
-
46
- > **Tip:** Need to share standards across projects? Push your `.contextkit/` to a shared repo and pull it with `ck pull`.
47
-
48
- This creates `.contextkit/` with skeleton context files (blank templates to be filled by AI):
49
-
50
- ```
51
- .contextkit/
52
- standards/ # Skeleton files: code-style.md, testing.md, architecture.md, ai-guidelines.md, workflows.md
53
- # Real files: glossary.md (universal), README.md (overview)
54
- commands/ # analyze.md (project analysis & customization)
55
- templates/ # skeleton template files (component, test, story, hook, api)
37
+ **2. Set up your project**
38
+ ```bash
39
+ cd your-project
40
+ contextkit install
56
41
  ```
42
+ Creates `.contextkit/` with skeleton standards files in your project.
57
43
 
58
- **Generate content with AI** (recommended):
44
+ **3. Generate your standards**
59
45
 
60
- ```bash
61
- ck analyze
62
- # AI scans your codebase and generates content for the skeleton files
63
- # or in Cursor chat: @.contextkit/commands/analyze.md
64
- ```
46
+ Run `/analyze` in your AI tool — it scans your codebase and fills the skeleton files with your project's conventions.
65
47
 
66
- ⚠️ **Important:** After running `ck analyze`, manually review and edit the generated content to match your exact needs. The AI provides a starting point, but you must customize it.
48
+ Done. Your AI tools now have project-specific context.
67
49
 
68
50
  ---
69
51
 
@@ -322,8 +304,8 @@ ck windsurf # add Windsurf integration (.windsurfrules)
322
304
  ck vscode # alias for copilot
323
305
 
324
306
  # Analysis & Updates
325
- ck analyze # customize standards to your project
326
- ck update # pull latest updates
307
+ /analyze # customize standards to your project (slash command in your AI tool)
308
+ ck update # pull latest commands/hooks — preserves your analyzed standards
327
309
  ck status # check install & integrations
328
310
 
329
311
  # Validation & Compliance
@@ -85,6 +85,7 @@ class InstallCommand {
85
85
  const { shouldContinue } = await this.promptReinstall();
86
86
  if (!shouldContinue) {
87
87
  console.log(chalk.yellow('⏭️ Installation cancelled'));
88
+ console.log(chalk.dim('💡 To get the latest command and squad files, run: ') + chalk.cyan('ck update'));
88
89
  return;
89
90
  }
90
91
  }
@@ -303,11 +304,11 @@ class InstallCommand {
303
304
  const skeletonFiles = {
304
305
  'standards/code-style.md': `# Code Style
305
306
 
306
- <!-- Content will be generated by running: ck analyze -->
307
+ <!-- Content will be generated by running: /analyze -->
307
308
 
308
309
  Your code style standards will be automatically generated based on your codebase patterns, conventions, and existing code.
309
310
 
310
- Run \`ck analyze\` to generate this content.
311
+ Run \`/analyze\` to generate this content.
311
312
 
312
313
  ## Conditional Loading
313
314
 
@@ -331,11 +332,11 @@ Use conditional loading tags:
331
332
 
332
333
  'standards/testing.md': `# Testing Standards
333
334
 
334
- <!-- Content will be generated by running: ck analyze -->
335
+ <!-- Content will be generated by running: /analyze -->
335
336
 
336
337
  Your testing standards will be automatically generated based on your existing test patterns and testing framework.
337
338
 
338
- Run \`ck analyze\` to generate this content.
339
+ Run \`/analyze\` to generate this content.
339
340
 
340
341
  ## ⭐ REQUIRED: Numbered Test Cases
341
342
 
@@ -366,38 +367,78 @@ describe("ComponentName", () => {
366
367
 
367
368
  'standards/architecture.md': `# Architecture
368
369
 
369
- <!-- Content will be generated by running: ck analyze -->
370
+ ## Documentation Levels
371
+
372
+ All documentation follows a 3-level hierarchy. Each level answers a different question.
373
+
374
+ | Level | Scope | Question it answers |
375
+ |-------|-------|---------------------|
376
+ | **Architecture** | System / platform | How things are connected and communicate |
377
+ | **Page / Feature** | App / route / feature | Containers and complex features |
378
+ | **Component** | Single component | One component and its own docs |
379
+
380
+ ### Architecture Level
381
+
382
+ High-level system documentation: how the system is structured and how parts interact.
383
+
384
+ - **Location:** \`docs/architecture.md\` in the project root (or any root-level docs folder)
385
+ - **Scope:** Whole product, platform, or cross-cutting feature
386
+ - **Content:** System/domain boundaries, main flows, how services/apps/packages connect and communicate
387
+ - **Artifacts:** Diagrams (Mermaid or similar) for routing, sequence flows, context/containers; architecture decision notes; shared patterns and conventions
388
+ - **Audience:** Engineers onboarding, tech leads, or anyone needing the big picture before touching code
389
+
390
+ ### Page / Feature Level
391
+
392
+ Documentation for a full screen, route, or feature area — the containers that hold many components.
393
+
394
+ - **Scope:** One app, one major feature, or one route/page
395
+ - **Content:** Purpose of the page/feature, main sections and layout, which components and hooks are used, data/state and API usage, key user flows
396
+ - **Artifacts:** Feature or page READMEs; lists of subcomponents and responsibilities; optional simple flow or layout sketches
397
+ - **Audience:** Developers working on that page/feature or integrating with it
398
+
399
+ ### Component Level
400
+
401
+ Documentation for a single component or a small, cohesive set of components.
402
+
403
+ - **Scope:** One component (or a tight group)
404
+ - **Content:** What the component does, props/API, usage examples, behavior and edge cases, where it's used
405
+ - **Artifacts:** README colocated next to the component; props table; code snippets
406
+ - **Audience:** Developers implementing or reusing the component
407
+
408
+ ## Project Architecture
409
+
410
+ <!-- Content will be generated by running: /analyze -->
370
411
 
371
412
  Your architecture patterns will be documented based on your project structure and organization.
372
413
 
373
- Run \`ck analyze\` to generate this content.`,
414
+ Run \`/analyze\` to generate this content.`,
374
415
 
375
416
  'standards/ai-guidelines.md': `# AI Guidelines
376
417
 
377
- <!-- Content will be generated by running: ck analyze -->
418
+ <!-- Content will be generated by running: /analyze -->
378
419
 
379
420
  Guidelines for AI assistance will be defined based on your project's needs and patterns.
380
421
 
381
- Run \`ck analyze\` to generate this content.`,
422
+ Run \`/analyze\` to generate this content.`,
382
423
 
383
424
  'standards/workflows.md': `# Workflows
384
425
 
385
- <!-- Content will be generated by running: ck analyze -->
426
+ <!-- Content will be generated by running: /analyze -->
386
427
 
387
428
  Development workflows and processes will be documented based on your project's practices.
388
429
 
389
- Run \`ck analyze\` to generate this content.`
430
+ Run \`/analyze\` to generate this content.`
390
431
  };
391
432
 
392
433
  // Create granular code-style skeleton files
393
434
  const granularCodeStyleFiles = {
394
435
  'standards/code-style/css-style.md': `# CSS Style Guide
395
436
 
396
- <!-- Content will be generated by running: ck analyze -->
437
+ <!-- Content will be generated by running: /analyze -->
397
438
 
398
439
  CSS-specific coding standards will be generated based on your project's styling patterns.
399
440
 
400
- Run \`ck analyze\` to generate this content.
441
+ Run \`/analyze\` to generate this content.
401
442
 
402
443
  ## Conditional Loading
403
444
 
@@ -410,11 +451,11 @@ This file is loaded when CSS-related tasks are detected:
410
451
 
411
452
  'standards/code-style/typescript-style.md': `# TypeScript Style Guide
412
453
 
413
- <!-- Content will be generated by running: ck analyze -->
454
+ <!-- Content will be generated by running: /analyze -->
414
455
 
415
456
  TypeScript-specific coding standards will be generated based on your project's TypeScript patterns.
416
457
 
417
- Run \`ck analyze\` to generate this content.
458
+ Run \`/analyze\` to generate this content.
418
459
 
419
460
  ## Conditional Loading
420
461
 
@@ -427,11 +468,11 @@ This file is loaded when TypeScript-related tasks are detected:
427
468
 
428
469
  'standards/code-style/javascript-style.md': `# JavaScript Style Guide
429
470
 
430
- <!-- Content will be generated by running: ck analyze -->
471
+ <!-- Content will be generated by running: /analyze -->
431
472
 
432
473
  JavaScript-specific coding standards will be generated based on your project's JavaScript patterns.
433
474
 
434
- Run \`ck analyze\` to generate this content.
475
+ Run \`/analyze\` to generate this content.
435
476
 
436
477
  ## Conditional Loading
437
478
 
@@ -444,11 +485,11 @@ This file is loaded when JavaScript-related tasks are detected:
444
485
 
445
486
  'standards/code-style/html-style.md': `# HTML Style Guide
446
487
 
447
- <!-- Content will be generated by running: ck analyze -->
488
+ <!-- Content will be generated by running: /analyze -->
448
489
 
449
490
  HTML-specific coding standards will be generated based on your project's HTML patterns.
450
491
 
451
- Run \`ck analyze\` to generate this content.
492
+ Run \`/analyze\` to generate this content.
452
493
 
453
494
  ## Conditional Loading
454
495
 
@@ -473,43 +514,116 @@ This file is loaded when HTML-related tasks are detected:
473
514
  const skeletonFiles = {
474
515
  'templates/component.md': `# Component Template
475
516
 
476
- <!-- Content will be generated by running: ck analyze -->
517
+ <!-- Content will be generated by running: /analyze -->
477
518
 
478
519
  Your canonical component/module pattern will be generated based on your project's framework, language, and conventions.
479
520
 
480
- Run \`ck analyze\` to generate this content, or manually add your component pattern below.
521
+ Run \`/analyze\` to generate this content, or manually add your component pattern below.
481
522
  `,
482
523
  'templates/test.md': `# Test Template
483
524
 
484
- <!-- Content will be generated by running: ck analyze -->
525
+ <!-- Content will be generated by running: /analyze -->
485
526
 
486
527
  Your canonical test file pattern will be generated based on your project's testing framework and conventions.
487
528
 
488
- Run \`ck analyze\` to generate this content, or manually add your test pattern below.
529
+ Run \`/analyze\` to generate this content, or manually add your test pattern below.
489
530
  `,
490
531
  'templates/story.md': `# Story/Demo Template
491
532
 
492
- <!-- Content will be generated by running: ck analyze -->
533
+ <!-- Content will be generated by running: /analyze -->
493
534
 
494
535
  Your canonical story/demo pattern will be generated based on your project's documentation and showcase conventions.
495
536
 
496
- Run \`ck analyze\` to generate this content, or manually add your story/demo pattern below.
537
+ Run \`/analyze\` to generate this content, or manually add your story/demo pattern below.
497
538
  `,
498
539
  'templates/hook.md': `# Hook/Composable/Helper Template
499
540
 
500
- <!-- Content will be generated by running: ck analyze -->
541
+ <!-- Content will be generated by running: /analyze -->
501
542
 
502
543
  Your canonical hook, composable, or helper pattern will be generated based on your project's framework and conventions.
503
544
 
504
- Run \`ck analyze\` to generate this content, or manually add your pattern below.
545
+ Run \`/analyze\` to generate this content, or manually add your pattern below.
505
546
  `,
506
547
  'templates/api.md': `# API Service/Client Template
507
548
 
508
- <!-- Content will be generated by running: ck analyze -->
549
+ <!-- Content will be generated by running: /analyze -->
509
550
 
510
551
  Your canonical API service or client pattern will be generated based on your project's architecture and conventions.
511
552
 
512
- Run \`ck analyze\` to generate this content, or manually add your API pattern below.
553
+ Run \`/analyze\` to generate this content, or manually add your API pattern below.
554
+ `,
555
+
556
+ 'templates/feature-spec.md': `# [FeatureName]
557
+
558
+ > **Spec-first document.** Write this before writing any code.
559
+ > When complete, this file lives next to the feature: \`FeatureName/FeatureName.md\`
560
+ > This is a **Page / Feature Level** doc (Level 2 of the documentation hierarchy).
561
+
562
+ ---
563
+
564
+ ## Purpose
565
+
566
+ What this feature does and why it exists. One or two sentences max.
567
+
568
+ ## Scope
569
+
570
+ What this feature **owns**:
571
+ - [Responsibility 1]
572
+ - [Responsibility 2]
573
+
574
+ What this feature **does NOT cover** (out of scope):
575
+ - [Excluded concern 1]
576
+ - [Excluded concern 2]
577
+
578
+ ## Main Sections / Layout
579
+
580
+ Key areas of the feature and what each contains:
581
+
582
+ | Section | Description |
583
+ |---------|-------------|
584
+ | [Section name] | [What it shows or does] |
585
+ | [Section name] | [What it shows or does] |
586
+
587
+ ## Components & Hooks
588
+
589
+ | Name | Type | Role |
590
+ |------|------|------|
591
+ | \`[ComponentName]\` | Component | [What it handles] |
592
+ | \`[useHookName]\` | Hook | [What state/logic it manages] |
593
+
594
+ ## Data & State
595
+
596
+ **API endpoints used:**
597
+ - \`[METHOD] /[endpoint]\` — [What it returns]
598
+
599
+ **Key state:**
600
+ - \`[stateName]\` — [What it tracks and when it changes]
601
+
602
+ ## Key User Flows
603
+
604
+ Main paths through this feature:
605
+
606
+ 1. **[Flow name]:** [User does X → system does Y → result Z]
607
+ 2. **[Flow name]:** [User does X → system does Y → result Z]
608
+
609
+ **Edge cases:**
610
+ - [What happens when...]
611
+ - [What happens when...]
612
+
613
+ ## Dependencies
614
+
615
+ **Depends on:**
616
+ - [Feature, service, or shared component this relies on]
617
+
618
+ **Entry points:**
619
+ - [Route or screen that leads here]
620
+
621
+ **Exit points:**
622
+ - [Where the user goes after completing the main flow]
623
+
624
+ ## Notes
625
+
626
+ Any design decisions, trade-offs, or open questions to resolve before coding.
513
627
  `
514
628
  };
515
629
 
@@ -525,7 +639,7 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
525
639
  await this.createSkeletonStandards();
526
640
 
527
641
  console.log(chalk.green('✅ Skeleton files created'));
528
- console.log(chalk.yellow('💡 Run: ck analyze to generate content based on your codebase'));
642
+ console.log(chalk.yellow('💡 Run: /analyze to generate content based on your codebase'));
529
643
  console.log('');
530
644
 
531
645
  // Download base files
@@ -733,6 +847,7 @@ claude "read .contextkit/context.md to see available standards, then create a bu
733
847
  - \`.contextkit/instructions/core/auto-corrections-log.md\` - Auto-logging instructions
734
848
 
735
849
  ### Templates
850
+ - \`.contextkit/templates/feature-spec.md\`
736
851
  - \`.contextkit/templates/component.md\`
737
852
  - \`.contextkit/templates/test.md\`
738
853
  - \`.contextkit/templates/story.md\`
@@ -1465,7 +1580,7 @@ Check this project's ContextKit setup and report status.
1465
1580
 
1466
1581
  2. Read \`.contextkit/config.yml\` and check the \`last_analyzed\` field.
1467
1582
 
1468
- 3. Check each standards file for skeleton markers. Read these files and check if they contain \`<!-- Content will be generated by running: ck analyze -->\`:
1583
+ 3. Check each standards file for skeleton markers. Read these files and check if they contain \`<!-- Content will be generated by running: /analyze -->\`:
1469
1584
  - \`.contextkit/standards/code-style.md\`
1470
1585
  - \`.contextkit/standards/testing.md\`
1471
1586
  - \`.contextkit/standards/architecture.md\`
@@ -1545,9 +1660,9 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
1545
1660
  console.log(` @.contextkit/commands/analyze.md`);
1546
1661
  console.log('');
1547
1662
  console.log('Or via CLI:');
1548
- console.log(chalk.yellow('👉'), `ck analyze`);
1663
+ console.log(chalk.yellow('👉'), `/analyze`);
1549
1664
  } else {
1550
- console.log(chalk.yellow('👉'), `ck analyze`);
1665
+ console.log(chalk.yellow('👉'), `/analyze`);
1551
1666
  }
1552
1667
 
1553
1668
  console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nolrm/contextkit",
3
- "version": "0.12.8",
3
+ "version": "0.12.10",
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": {