@nolrm/contextkit 0.12.9 → 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 +10 -28
- package/lib/commands/install.js +146 -32
- package/package.json +1 -1
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
|
-
**
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
44
|
+
**3. Generate your standards**
|
|
59
45
|
|
|
60
|
-
|
|
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
|
-
|
|
48
|
+
Done. Your AI tools now have project-specific context.
|
|
67
49
|
|
|
68
50
|
---
|
|
69
51
|
|
|
@@ -322,7 +304,7 @@ ck windsurf # add Windsurf integration (.windsurfrules)
|
|
|
322
304
|
ck vscode # alias for copilot
|
|
323
305
|
|
|
324
306
|
# Analysis & Updates
|
|
325
|
-
|
|
307
|
+
/analyze # customize standards to your project (slash command in your AI tool)
|
|
326
308
|
ck update # pull latest commands/hooks — preserves your analyzed standards
|
|
327
309
|
ck status # check install & integrations
|
|
328
310
|
|
package/lib/commands/install.js
CHANGED
|
@@ -304,11 +304,11 @@ class InstallCommand {
|
|
|
304
304
|
const skeletonFiles = {
|
|
305
305
|
'standards/code-style.md': `# Code Style
|
|
306
306
|
|
|
307
|
-
<!-- Content will be generated by running:
|
|
307
|
+
<!-- Content will be generated by running: /analyze -->
|
|
308
308
|
|
|
309
309
|
Your code style standards will be automatically generated based on your codebase patterns, conventions, and existing code.
|
|
310
310
|
|
|
311
|
-
Run
|
|
311
|
+
Run \`/analyze\` to generate this content.
|
|
312
312
|
|
|
313
313
|
## Conditional Loading
|
|
314
314
|
|
|
@@ -332,11 +332,11 @@ Use conditional loading tags:
|
|
|
332
332
|
|
|
333
333
|
'standards/testing.md': `# Testing Standards
|
|
334
334
|
|
|
335
|
-
<!-- Content will be generated by running:
|
|
335
|
+
<!-- Content will be generated by running: /analyze -->
|
|
336
336
|
|
|
337
337
|
Your testing standards will be automatically generated based on your existing test patterns and testing framework.
|
|
338
338
|
|
|
339
|
-
Run
|
|
339
|
+
Run \`/analyze\` to generate this content.
|
|
340
340
|
|
|
341
341
|
## ⭐ REQUIRED: Numbered Test Cases
|
|
342
342
|
|
|
@@ -367,38 +367,78 @@ describe("ComponentName", () => {
|
|
|
367
367
|
|
|
368
368
|
'standards/architecture.md': `# Architecture
|
|
369
369
|
|
|
370
|
-
|
|
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 -->
|
|
371
411
|
|
|
372
412
|
Your architecture patterns will be documented based on your project structure and organization.
|
|
373
413
|
|
|
374
|
-
Run
|
|
414
|
+
Run \`/analyze\` to generate this content.`,
|
|
375
415
|
|
|
376
416
|
'standards/ai-guidelines.md': `# AI Guidelines
|
|
377
417
|
|
|
378
|
-
<!-- Content will be generated by running:
|
|
418
|
+
<!-- Content will be generated by running: /analyze -->
|
|
379
419
|
|
|
380
420
|
Guidelines for AI assistance will be defined based on your project's needs and patterns.
|
|
381
421
|
|
|
382
|
-
Run
|
|
422
|
+
Run \`/analyze\` to generate this content.`,
|
|
383
423
|
|
|
384
424
|
'standards/workflows.md': `# Workflows
|
|
385
425
|
|
|
386
|
-
<!-- Content will be generated by running:
|
|
426
|
+
<!-- Content will be generated by running: /analyze -->
|
|
387
427
|
|
|
388
428
|
Development workflows and processes will be documented based on your project's practices.
|
|
389
429
|
|
|
390
|
-
Run
|
|
430
|
+
Run \`/analyze\` to generate this content.`
|
|
391
431
|
};
|
|
392
432
|
|
|
393
433
|
// Create granular code-style skeleton files
|
|
394
434
|
const granularCodeStyleFiles = {
|
|
395
435
|
'standards/code-style/css-style.md': `# CSS Style Guide
|
|
396
436
|
|
|
397
|
-
<!-- Content will be generated by running:
|
|
437
|
+
<!-- Content will be generated by running: /analyze -->
|
|
398
438
|
|
|
399
439
|
CSS-specific coding standards will be generated based on your project's styling patterns.
|
|
400
440
|
|
|
401
|
-
Run
|
|
441
|
+
Run \`/analyze\` to generate this content.
|
|
402
442
|
|
|
403
443
|
## Conditional Loading
|
|
404
444
|
|
|
@@ -411,11 +451,11 @@ This file is loaded when CSS-related tasks are detected:
|
|
|
411
451
|
|
|
412
452
|
'standards/code-style/typescript-style.md': `# TypeScript Style Guide
|
|
413
453
|
|
|
414
|
-
<!-- Content will be generated by running:
|
|
454
|
+
<!-- Content will be generated by running: /analyze -->
|
|
415
455
|
|
|
416
456
|
TypeScript-specific coding standards will be generated based on your project's TypeScript patterns.
|
|
417
457
|
|
|
418
|
-
Run
|
|
458
|
+
Run \`/analyze\` to generate this content.
|
|
419
459
|
|
|
420
460
|
## Conditional Loading
|
|
421
461
|
|
|
@@ -428,11 +468,11 @@ This file is loaded when TypeScript-related tasks are detected:
|
|
|
428
468
|
|
|
429
469
|
'standards/code-style/javascript-style.md': `# JavaScript Style Guide
|
|
430
470
|
|
|
431
|
-
<!-- Content will be generated by running:
|
|
471
|
+
<!-- Content will be generated by running: /analyze -->
|
|
432
472
|
|
|
433
473
|
JavaScript-specific coding standards will be generated based on your project's JavaScript patterns.
|
|
434
474
|
|
|
435
|
-
Run
|
|
475
|
+
Run \`/analyze\` to generate this content.
|
|
436
476
|
|
|
437
477
|
## Conditional Loading
|
|
438
478
|
|
|
@@ -445,11 +485,11 @@ This file is loaded when JavaScript-related tasks are detected:
|
|
|
445
485
|
|
|
446
486
|
'standards/code-style/html-style.md': `# HTML Style Guide
|
|
447
487
|
|
|
448
|
-
<!-- Content will be generated by running:
|
|
488
|
+
<!-- Content will be generated by running: /analyze -->
|
|
449
489
|
|
|
450
490
|
HTML-specific coding standards will be generated based on your project's HTML patterns.
|
|
451
491
|
|
|
452
|
-
Run
|
|
492
|
+
Run \`/analyze\` to generate this content.
|
|
453
493
|
|
|
454
494
|
## Conditional Loading
|
|
455
495
|
|
|
@@ -474,43 +514,116 @@ This file is loaded when HTML-related tasks are detected:
|
|
|
474
514
|
const skeletonFiles = {
|
|
475
515
|
'templates/component.md': `# Component Template
|
|
476
516
|
|
|
477
|
-
<!-- Content will be generated by running:
|
|
517
|
+
<!-- Content will be generated by running: /analyze -->
|
|
478
518
|
|
|
479
519
|
Your canonical component/module pattern will be generated based on your project's framework, language, and conventions.
|
|
480
520
|
|
|
481
|
-
Run
|
|
521
|
+
Run \`/analyze\` to generate this content, or manually add your component pattern below.
|
|
482
522
|
`,
|
|
483
523
|
'templates/test.md': `# Test Template
|
|
484
524
|
|
|
485
|
-
<!-- Content will be generated by running:
|
|
525
|
+
<!-- Content will be generated by running: /analyze -->
|
|
486
526
|
|
|
487
527
|
Your canonical test file pattern will be generated based on your project's testing framework and conventions.
|
|
488
528
|
|
|
489
|
-
Run
|
|
529
|
+
Run \`/analyze\` to generate this content, or manually add your test pattern below.
|
|
490
530
|
`,
|
|
491
531
|
'templates/story.md': `# Story/Demo Template
|
|
492
532
|
|
|
493
|
-
<!-- Content will be generated by running:
|
|
533
|
+
<!-- Content will be generated by running: /analyze -->
|
|
494
534
|
|
|
495
535
|
Your canonical story/demo pattern will be generated based on your project's documentation and showcase conventions.
|
|
496
536
|
|
|
497
|
-
Run
|
|
537
|
+
Run \`/analyze\` to generate this content, or manually add your story/demo pattern below.
|
|
498
538
|
`,
|
|
499
539
|
'templates/hook.md': `# Hook/Composable/Helper Template
|
|
500
540
|
|
|
501
|
-
<!-- Content will be generated by running:
|
|
541
|
+
<!-- Content will be generated by running: /analyze -->
|
|
502
542
|
|
|
503
543
|
Your canonical hook, composable, or helper pattern will be generated based on your project's framework and conventions.
|
|
504
544
|
|
|
505
|
-
Run
|
|
545
|
+
Run \`/analyze\` to generate this content, or manually add your pattern below.
|
|
506
546
|
`,
|
|
507
547
|
'templates/api.md': `# API Service/Client Template
|
|
508
548
|
|
|
509
|
-
<!-- Content will be generated by running:
|
|
549
|
+
<!-- Content will be generated by running: /analyze -->
|
|
510
550
|
|
|
511
551
|
Your canonical API service or client pattern will be generated based on your project's architecture and conventions.
|
|
512
552
|
|
|
513
|
-
Run
|
|
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.
|
|
514
627
|
`
|
|
515
628
|
};
|
|
516
629
|
|
|
@@ -526,7 +639,7 @@ Run \`ck analyze\` to generate this content, or manually add your API pattern be
|
|
|
526
639
|
await this.createSkeletonStandards();
|
|
527
640
|
|
|
528
641
|
console.log(chalk.green('✅ Skeleton files created'));
|
|
529
|
-
console.log(chalk.yellow('💡 Run:
|
|
642
|
+
console.log(chalk.yellow('💡 Run: /analyze to generate content based on your codebase'));
|
|
530
643
|
console.log('');
|
|
531
644
|
|
|
532
645
|
// Download base files
|
|
@@ -734,6 +847,7 @@ claude "read .contextkit/context.md to see available standards, then create a bu
|
|
|
734
847
|
- \`.contextkit/instructions/core/auto-corrections-log.md\` - Auto-logging instructions
|
|
735
848
|
|
|
736
849
|
### Templates
|
|
850
|
+
- \`.contextkit/templates/feature-spec.md\`
|
|
737
851
|
- \`.contextkit/templates/component.md\`
|
|
738
852
|
- \`.contextkit/templates/test.md\`
|
|
739
853
|
- \`.contextkit/templates/story.md\`
|
|
@@ -1466,7 +1580,7 @@ Check this project's ContextKit setup and report status.
|
|
|
1466
1580
|
|
|
1467
1581
|
2. Read \`.contextkit/config.yml\` and check the \`last_analyzed\` field.
|
|
1468
1582
|
|
|
1469
|
-
3. Check each standards file for skeleton markers. Read these files and check if they contain \`<!-- Content will be generated by running:
|
|
1583
|
+
3. Check each standards file for skeleton markers. Read these files and check if they contain \`<!-- Content will be generated by running: /analyze -->\`:
|
|
1470
1584
|
- \`.contextkit/standards/code-style.md\`
|
|
1471
1585
|
- \`.contextkit/standards/testing.md\`
|
|
1472
1586
|
- \`.contextkit/standards/architecture.md\`
|
|
@@ -1546,9 +1660,9 @@ If standards are still skeletons, warn that @imports in CLAUDE.md are loading em
|
|
|
1546
1660
|
console.log(` @.contextkit/commands/analyze.md`);
|
|
1547
1661
|
console.log('');
|
|
1548
1662
|
console.log('Or via CLI:');
|
|
1549
|
-
console.log(chalk.yellow('👉'),
|
|
1663
|
+
console.log(chalk.yellow('👉'), `/analyze`);
|
|
1550
1664
|
} else {
|
|
1551
|
-
console.log(chalk.yellow('👉'),
|
|
1665
|
+
console.log(chalk.yellow('👉'), `/analyze`);
|
|
1552
1666
|
}
|
|
1553
1667
|
|
|
1554
1668
|
console.log('');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nolrm/contextkit",
|
|
3
|
-
"version": "0.12.
|
|
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": {
|