aiknowsys 0.1.1 â 0.3.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/AGENTS.template.md +99 -14
- package/CODEBASE_ESSENTIALS.template.md +169 -47
- package/README.md +95 -0
- package/bin/cli.js +24 -0
- package/lib/commands/audit.js +225 -0
- package/lib/commands/check.js +192 -0
- package/lib/commands/init.js +438 -53
- package/lib/commands/install-skills.js +2 -1
- package/lib/commands/sync.js +107 -0
- package/package.json +2 -1
- package/templates/skills/tdd-workflow/SKILL.md +492 -0
- package/templates/stacks/README.md +47 -0
- package/templates/stacks/nextjs/CODEBASE_ESSENTIALS.md +405 -0
- package/templates/stacks/vue-express/CODEBASE_ESSENTIALS.md +445 -0
package/AGENTS.template.md
CHANGED
|
@@ -34,14 +34,16 @@
|
|
|
34
34
|
- [ ] Read @CODEBASE_ESSENTIALS.md (patterns, conventions)
|
|
35
35
|
- [ ] Read relevant skill if applicable
|
|
36
36
|
- [ ] Make changes + write/update tests
|
|
37
|
-
- [ ] **VALIDATE** (see validation matrix
|
|
37
|
+
- [ ] **VALIDATE** (see validation matrix in ESSENTIALS)
|
|
38
38
|
- [ ] Update docs if patterns changed
|
|
39
39
|
|
|
40
|
-
**Validation Matrix
|
|
40
|
+
**Validation Matrix:**
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
đ **See [CODEBASE_ESSENTIALS.md - Validation Matrix](CODEBASE_ESSENTIALS.md#validation-matrix)**
|
|
43
|
+
|
|
44
|
+
The validation matrix lives in CODEBASE_ESSENTIALS.md as the single source of truth. Always run all commands from that matrix after making changes.
|
|
45
|
+
|
|
46
|
+
**đ¨ RULE: Never claim work is complete without running validation!**
|
|
45
47
|
|
|
46
48
|
---
|
|
47
49
|
|
|
@@ -75,6 +77,19 @@
|
|
|
75
77
|
|
|
76
78
|
Follow patterns from CODEBASE_ESSENTIALS.md and the skill you read.
|
|
77
79
|
|
|
80
|
+
**đĄ TDD Recommended:** For new features, practice Test-Driven Development:
|
|
81
|
+
1. **RED**: Write a failing test first
|
|
82
|
+
2. **GREEN**: Write minimal code to make it pass
|
|
83
|
+
3. **REFACTOR**: Clean up code while tests stay green
|
|
84
|
+
|
|
85
|
+
See `.github/skills/tdd-workflow/SKILL.md` for detailed TDD guidance.
|
|
86
|
+
|
|
87
|
+
**Benefits of TDD:**
|
|
88
|
+
- Better code design (forces decoupling)
|
|
89
|
+
- Fewer bugs (issues caught before implementation)
|
|
90
|
+
- Confidence in refactoring (tests catch regressions)
|
|
91
|
+
- Living documentation (tests show intent)
|
|
92
|
+
|
|
78
93
|
### 4ī¸âŖ VALIDATE: Run Tests & Checks (MANDATORY - DO NOT SKIP!)
|
|
79
94
|
|
|
80
95
|
**â ī¸ CRITICAL: Run validation EVERY TIME you make a change (even small fixes!)**
|
|
@@ -178,30 +193,100 @@ This project uses Developer + Architect agents for automated code review.
|
|
|
178
193
|
|
|
179
194
|
---
|
|
180
195
|
|
|
196
|
+
## â
Pre-Commit Validation Checklist
|
|
197
|
+
|
|
198
|
+
**Run this checklist BEFORE every commit. Copy-paste into terminal:**
|
|
199
|
+
|
|
200
|
+
### Quick Check (1 minute)
|
|
201
|
+
```bash
|
|
202
|
+
# 1. Validation Matrix commands
|
|
203
|
+
{{VALIDATION_CMD_1}} # e.g., npm test
|
|
204
|
+
{{VALIDATION_CMD_2}} # e.g., npm run lint
|
|
205
|
+
|
|
206
|
+
# 2. No debug code
|
|
207
|
+
grep -r "console.log\|debugger\|TODO:" src/ || echo "â No debug code"
|
|
208
|
+
|
|
209
|
+
# 3. No secrets
|
|
210
|
+
grep -r "password\|api_key\|secret" . --exclude-dir={node_modules,.git} || echo "â No secrets"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Full Check (5 minutes)
|
|
214
|
+
```bash
|
|
215
|
+
# Run all validation commands from matrix
|
|
216
|
+
{{ALL_VALIDATION_COMMANDS}}
|
|
217
|
+
|
|
218
|
+
# Additional checks
|
|
219
|
+
git status # No untracked files
|
|
220
|
+
git diff # Review changes
|
|
221
|
+
grep "{{" {{TEMPLATE_FILES}} # No unfilled placeholders
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Before Push
|
|
225
|
+
```bash
|
|
226
|
+
# Final validation
|
|
227
|
+
{{VALIDATION_CMD_1}}
|
|
228
|
+
|
|
229
|
+
# Check commits
|
|
230
|
+
git log origin/main..HEAD # Review commits
|
|
231
|
+
|
|
232
|
+
# Push
|
|
233
|
+
git push
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## đ Troubleshooting Validation Failures
|
|
239
|
+
|
|
240
|
+
### Tests Failing
|
|
241
|
+
1. Read error message carefully
|
|
242
|
+
2. Check CODEBASE_ESSENTIALS.md for test patterns
|
|
243
|
+
3. Review "Common Gotchas" section
|
|
244
|
+
4. Run single failing test: `{{SINGLE_TEST_CMD}}`
|
|
245
|
+
5. Check if pattern violated (Critical Invariants)
|
|
246
|
+
|
|
247
|
+
### Linting Errors
|
|
248
|
+
1. Auto-fix if possible: `{{AUTO_FIX_CMD}}`
|
|
249
|
+
2. Review Core Patterns for style rules
|
|
250
|
+
3. Don't disable rules - fix the code
|
|
251
|
+
4. If rule is wrong, update ESSENTIALS first
|
|
252
|
+
|
|
253
|
+
### Build Errors
|
|
254
|
+
1. Check dependency versions (Technology Stack section)
|
|
255
|
+
2. Clear cache: `{{CLEAR_CACHE_CMD}}`
|
|
256
|
+
3. Rebuild from scratch: `{{CLEAN_BUILD_CMD}}`
|
|
257
|
+
4. Check environment variables
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
181
261
|
## đ Customization Instructions
|
|
182
262
|
|
|
183
263
|
**This is a template file. To customize:**
|
|
184
264
|
|
|
185
|
-
1. **{{
|
|
186
|
-
```markdown
|
|
187
|
-
| Backend | pytest | â
MANDATORY |
|
|
188
|
-
| Frontend | npm run type-check | â
MANDATORY |
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
2. **{{SKILL_MAPPING}}** - Add your project's skill trigger words
|
|
265
|
+
1. **{{SKILL_MAPPING}}** - Add your project's skill trigger words
|
|
192
266
|
```markdown
|
|
193
267
|
| "refactor", "clean up" | code-refactoring | Test-driven refactoring |
|
|
194
268
|
| "update deps" | dependency-updates | Safe dependency updates |
|
|
269
|
+
| "write tests", "TDD", "test first" | tdd-workflow | Test-driven development |
|
|
195
270
|
```
|
|
196
271
|
|
|
272
|
+
2. **Validation Checklist Placeholders:**
|
|
273
|
+
- `{{VALIDATION_CMD_1}}` â Your primary test command (e.g., `npm test`)
|
|
274
|
+
- `{{VALIDATION_CMD_2}}` â Your lint command (e.g., `npm run lint`)
|
|
275
|
+
- `{{ALL_VALIDATION_COMMANDS}}` â All commands from validation matrix in ESSENTIALS
|
|
276
|
+
- `{{TEMPLATE_FILES}}` â Files to check for placeholders
|
|
277
|
+
- `{{SINGLE_TEST_CMD}}` â How to run one test (e.g., `npm test -- file.test.js`)
|
|
278
|
+
- `{{AUTO_FIX_CMD}}` â Auto-fix linting (e.g., `npm run lint:fix`)
|
|
279
|
+
- `{{CLEAR_CACHE_CMD}}` â Clear build cache
|
|
280
|
+
- `{{CLEAN_BUILD_CMD}}` â Clean rebuild command
|
|
281
|
+
|
|
197
282
|
3. **Add project-specific sections** as needed
|
|
198
283
|
|
|
199
284
|
4. **Remove placeholder text** and instructions
|
|
200
285
|
|
|
201
|
-
|
|
286
|
+
**Note:** Validation Matrix is in CODEBASE_ESSENTIALS.md - no need to duplicate it here.
|
|
202
287
|
|
|
203
288
|
---
|
|
204
289
|
|
|
205
290
|
*This file helps AI agents follow a consistent workflow: Read â Plan â Implement â Validate â Document â Confirm*
|
|
206
291
|
|
|
207
|
-
*Part of
|
|
292
|
+
*Part of aiknowsys. See [README](README.md) and [SETUP_GUIDE.md](SETUP_GUIDE.md) for full documentation.*
|
|
@@ -34,18 +34,79 @@
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## đ Knowledge System: Document Roles
|
|
38
|
+
|
|
39
|
+
**Your project has three core knowledge files that work together:**
|
|
40
|
+
|
|
41
|
+
### 1ī¸âŖ CODEBASE_ESSENTIALS.md (This File)
|
|
42
|
+
**Role:** Single source of truth for architecture, patterns, and invariants
|
|
43
|
+
**Read:** At the start of EVERY session before making changes
|
|
44
|
+
**Contains:**
|
|
45
|
+
- Technology stack and versions
|
|
46
|
+
- Validation commands (test, lint, build)
|
|
47
|
+
- Project structure and file organization
|
|
48
|
+
- Code patterns and conventions
|
|
49
|
+
- Critical rules that must never be violated
|
|
50
|
+
- Common gotchas and workarounds
|
|
51
|
+
|
|
52
|
+
**Use this when:**
|
|
53
|
+
- Starting a coding session (read first!)
|
|
54
|
+
- Implementing new features (check existing patterns)
|
|
55
|
+
- Debugging issues (review gotchas)
|
|
56
|
+
- Onboarding new developers (comprehensive reference)
|
|
57
|
+
|
|
58
|
+
### 2ī¸âŖ AGENTS.md
|
|
59
|
+
**Role:** AI assistant workflow and session procedures
|
|
60
|
+
**Read:** When working with AI coding assistants
|
|
61
|
+
**Contains:**
|
|
62
|
+
- Mandatory session start protocol
|
|
63
|
+
- Validation matrix (copy from this file)
|
|
64
|
+
- Skill trigger words and workflows
|
|
65
|
+
- Project-specific invariants for AI
|
|
66
|
+
- Changelog update procedures
|
|
67
|
+
|
|
68
|
+
**Use this when:**
|
|
69
|
+
- Using GitHub Copilot, Claude, ChatGPT, etc.
|
|
70
|
+
- Need workflow reminders (read â plan â implement â validate â document)
|
|
71
|
+
- Looking for relevant skills for a task
|
|
72
|
+
|
|
73
|
+
### 3ī¸âŖ CODEBASE_CHANGELOG.md
|
|
74
|
+
**Role:** Session-by-session development history
|
|
75
|
+
**Read:** When you need project history or context
|
|
76
|
+
**Contains:**
|
|
77
|
+
- Session entries (what changed, when, why)
|
|
78
|
+
- Validation results for each session
|
|
79
|
+
- Key learnings and discoveries
|
|
80
|
+
- Links to changed files with line numbers
|
|
81
|
+
|
|
82
|
+
**Use this when:**
|
|
83
|
+
- Understanding why a decision was made
|
|
84
|
+
- Tracking down when a bug was introduced
|
|
85
|
+
- Reviewing project evolution
|
|
86
|
+
- After each session (add new entry)
|
|
87
|
+
|
|
88
|
+
### đ How They Work Together
|
|
38
89
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
90
|
+
```
|
|
91
|
+
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
92
|
+
â 1. Session Start: Read CODEBASE_ESSENTIALS.md â
|
|
93
|
+
â (Get current architecture, patterns, invariants) â
|
|
94
|
+
ââââââââââââââââââââââââŦâââââââââââââââââââââââââââââââââââ
|
|
95
|
+
â
|
|
96
|
+
âŧ
|
|
97
|
+
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
98
|
+
â 2. Work Session: Follow AGENTS.md workflow â
|
|
99
|
+
â (AI-guided: read â plan â code â validate â doc) â
|
|
100
|
+
ââââââââââââââââââââââââŦâââââââââââââââââââââââââââââââââââ
|
|
101
|
+
â
|
|
102
|
+
âŧ
|
|
103
|
+
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
104
|
+
â 3. Session End: Update CODEBASE_CHANGELOG.md â
|
|
105
|
+
â (Document what changed, validation, learnings) â
|
|
106
|
+
âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
107
|
+
```
|
|
44
108
|
|
|
45
|
-
**
|
|
46
|
-
- Session history: [CODEBASE_CHANGELOG.md](CODEBASE_CHANGELOG.md)
|
|
47
|
-
- AI workflow: [AGENTS.md](AGENTS.md)
|
|
48
|
-
- Skills: [.github/skills/](.github/skills/)
|
|
109
|
+
**Golden Rule:** ESSENTIALS = "what is", AGENTS = "how to work", CHANGELOG = "what happened"
|
|
49
110
|
|
|
50
111
|
---
|
|
51
112
|
|
|
@@ -342,6 +403,89 @@ openspec archive X --yes # Archive after deployment
|
|
|
342
403
|
|
|
343
404
|
---
|
|
344
405
|
|
|
406
|
+
## đ First Implementation Guide
|
|
407
|
+
|
|
408
|
+
**Once this template is filled, here's your recommended build order:**
|
|
409
|
+
|
|
410
|
+
### Step 1: Foundation (Week 1)
|
|
411
|
+
**Goal:** Get basic project running with validation
|
|
412
|
+
|
|
413
|
+
**Build:**
|
|
414
|
+
1. Set up project structure (directories from "Project Structure" section)
|
|
415
|
+
2. Initialize package manager and install dependencies
|
|
416
|
+
3. Configure build tools and linters
|
|
417
|
+
4. Write "Hello World" or minimal working version
|
|
418
|
+
5. Set up validation commands from Validation Matrix
|
|
419
|
+
|
|
420
|
+
**Validate:**
|
|
421
|
+
- [ ] All validation commands work (`npm test`, etc.)
|
|
422
|
+
- [ ] Can build and run the project
|
|
423
|
+
- [ ] Linting passes
|
|
424
|
+
|
|
425
|
+
**Document:** Update CODEBASE_CHANGELOG.md with first session
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
### Step 2: Core Patterns (Week 2-3)
|
|
430
|
+
**Goal:** Implement fundamental patterns from this document
|
|
431
|
+
|
|
432
|
+
**Build:**
|
|
433
|
+
1. Create pattern examples (from "Core Patterns" section)
|
|
434
|
+
2. Set up error handling structure
|
|
435
|
+
3. Implement logging/monitoring basics
|
|
436
|
+
4. Add configuration management
|
|
437
|
+
5. Write tests for core patterns
|
|
438
|
+
|
|
439
|
+
**Validate:**
|
|
440
|
+
- [ ] Pattern examples work as documented
|
|
441
|
+
- [ ] Tests cover core patterns
|
|
442
|
+
- [ ] No critical invariants violated
|
|
443
|
+
|
|
444
|
+
**Why this order:** Patterns guide all future code. Establish them early.
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
### Step 3: Feature Development (Ongoing)
|
|
449
|
+
**Goal:** Build actual features following established patterns
|
|
450
|
+
|
|
451
|
+
**Build:**
|
|
452
|
+
1. Reference "Core Patterns" for each implementation
|
|
453
|
+
2. Follow "Critical Invariants" religiously
|
|
454
|
+
3. Watch out for "Common Gotchas"
|
|
455
|
+
4. Run validation before each commit
|
|
456
|
+
5. Update changelog after each session
|
|
457
|
+
|
|
458
|
+
**Validate:**
|
|
459
|
+
- [ ] New code follows documented patterns
|
|
460
|
+
- [ ] All validation passes
|
|
461
|
+
- [ ] No gotchas violated
|
|
462
|
+
|
|
463
|
+
**When stuck:** Review this document, check AGENTS.md for relevant skills
|
|
464
|
+
|
|
465
|
+
---
|
|
466
|
+
|
|
467
|
+
### Step 4: Hardening (Before Production)
|
|
468
|
+
**Goal:** Production-ready quality
|
|
469
|
+
|
|
470
|
+
**Build:**
|
|
471
|
+
1. Implement security measures (Security section)
|
|
472
|
+
2. Add performance optimizations (Performance section)
|
|
473
|
+
3. Ensure accessibility (Accessibility section)
|
|
474
|
+
4. Set up monitoring and alerting
|
|
475
|
+
5. Document deployment process
|
|
476
|
+
|
|
477
|
+
**Validate:**
|
|
478
|
+
- [ ] Security checklist complete
|
|
479
|
+
- [ ] Performance targets met
|
|
480
|
+
- [ ] Accessibility standards met
|
|
481
|
+
- [ ] Deployment tested
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
**Golden Rule:** Always refer back to this document. Don't drift from documented patterns.
|
|
486
|
+
|
|
487
|
+
---
|
|
488
|
+
|
|
345
489
|
## Version Control
|
|
346
490
|
|
|
347
491
|
**Branch strategy:** {{BRANCH_STRATEGY}}
|
|
@@ -354,43 +498,21 @@ openspec archive X --yes # Archive after deployment
|
|
|
354
498
|
|
|
355
499
|
## đ Customization Instructions
|
|
356
500
|
|
|
357
|
-
**This is a template file. To
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
-
|
|
371
|
-
- â
Make content specific to THIS project, not generic advice
|
|
372
|
-
|
|
373
|
-
When filling this template, you MUST NOT:
|
|
374
|
-
- â Change section headings (e.g., "Testing Patterns" â "Testing Guidelines")
|
|
375
|
-
- â Replace placeholders with other placeholders (e.g., `{{TEST_ORGANIZATION}}` â "Manual testing only")
|
|
376
|
-
- â Add generic content that could apply to any project
|
|
377
|
-
- â Skip sections - fill them or remove them
|
|
378
|
-
|
|
379
|
-
**Common placeholders:**
|
|
380
|
-
- `{{PROJECT_NAME}}` - Your project name
|
|
381
|
-
- `{{DATE}}` - Current date
|
|
382
|
-
- `{{FRAMEWORK}}` - Framework name and version
|
|
383
|
-
- `{{LANGUAGE}}` - Programming language
|
|
384
|
-
- `{{*_CMD}}` - Actual commands to run
|
|
385
|
-
- `{{*_DESCRIPTION}}` - Your explanations
|
|
386
|
-
- `{{*_EXAMPLE}}` - Real code examples
|
|
387
|
-
|
|
388
|
-
**After customization:**
|
|
389
|
-
1. Rename to `CODEBASE_ESSENTIALS.md`
|
|
390
|
-
2. Commit to repository
|
|
391
|
-
3. Reference in AGENTS.md
|
|
392
|
-
4. Update as patterns change
|
|
501
|
+
**This is a template file. To customize it for your project:**
|
|
502
|
+
|
|
503
|
+
đ **See [SETUP_GUIDE.md](SETUP_GUIDE.md) for detailed instructions**
|
|
504
|
+
|
|
505
|
+
**Quick start:**
|
|
506
|
+
1. Replace all `{{PLACEHOLDERS}}` with real values from your project
|
|
507
|
+
2. Use actual commands, file paths, and code examples (not generic descriptions)
|
|
508
|
+
3. Keep section headings exactly as written
|
|
509
|
+
4. Remove sections that don't apply to your project
|
|
510
|
+
|
|
511
|
+
**â ī¸ Critical:** Replace placeholders with REAL values, not other placeholders
|
|
512
|
+
Example: `{{TEST_CMD}}` â `npm test` (not "run your tests")
|
|
513
|
+
|
|
514
|
+
**AI-Assisted:** Use the prompt from `npx aiknowsys init` to have AI fill this automatically
|
|
393
515
|
|
|
394
516
|
---
|
|
395
517
|
|
|
396
|
-
*This template is part of
|
|
518
|
+
*This template is part of aiknowsys. See [README](README.md) and [SETUP_GUIDE.md](SETUP_GUIDE.md) for full documentation.*
|
package/README.md
CHANGED
|
@@ -54,6 +54,9 @@ From production use in gnwebsite:
|
|
|
54
54
|
# For new projects - interactive setup
|
|
55
55
|
npx aiknowsys init
|
|
56
56
|
|
|
57
|
+
# For new projects with pre-built stack template
|
|
58
|
+
npx aiknowsys init --stack nextjs
|
|
59
|
+
|
|
57
60
|
# For existing projects - auto-detect and migrate
|
|
58
61
|
npx aiknowsys migrate
|
|
59
62
|
|
|
@@ -62,6 +65,35 @@ npm install -g aiknowsys
|
|
|
62
65
|
aiknowsys init
|
|
63
66
|
```
|
|
64
67
|
|
|
68
|
+
**đ Pre-built Stack Templates:**
|
|
69
|
+
|
|
70
|
+
Skip most customization work with production-ready stack templates:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# List available stacks
|
|
74
|
+
npx aiknowsys init --list-stacks
|
|
75
|
+
|
|
76
|
+
# Initialize with Next.js stack
|
|
77
|
+
npx aiknowsys init --stack nextjs
|
|
78
|
+
|
|
79
|
+
# Initialize with Vue + Express full-stack monorepo
|
|
80
|
+
npx aiknowsys init --stack vue-express
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Available stacks:**
|
|
84
|
+
- `nextjs` - Next.js 15 + App Router + TypeScript + Tailwind + Prisma
|
|
85
|
+
- `vue-express` - Vue 3 + Express full-stack monorepo with shared types
|
|
86
|
+
|
|
87
|
+
Each stack template includes:
|
|
88
|
+
- â
Pre-filled Technology Snapshot
|
|
89
|
+
- â
Stack-specific validation matrix with proper commands
|
|
90
|
+
- â
Core patterns and conventions for the stack
|
|
91
|
+
- â
Common gotchas and solutions
|
|
92
|
+
- â
Testing patterns and examples
|
|
93
|
+
- â
Architecture decisions (why this stack)
|
|
94
|
+
|
|
95
|
+
**Setup time:** 2-3 minutes (vs 10-15 min interactive, vs 45 min manual)
|
|
96
|
+
|
|
65
97
|
**Available commands:**
|
|
66
98
|
|
|
67
99
|
| Command | Description | Auto-installs agents/skills? |
|
|
@@ -70,11 +102,73 @@ aiknowsys init
|
|
|
70
102
|
| `npx aiknowsys migrate` | Full migration for existing projects | â
Yes |
|
|
71
103
|
| `npx aiknowsys scan` | Scan codebase and generate draft ESSENTIALS | â No (run install-agents after) |
|
|
72
104
|
| `npx aiknowsys update` | Update agents, skills, and workflow to latest version | N/A (updates existing) |
|
|
105
|
+
| `npx aiknowsys check` | Validate knowledge system setup and configuration | N/A (validation) |
|
|
106
|
+
| `npx aiknowsys sync` | Sync AGENTS.md validation reference with ESSENTIALS.md | N/A (maintenance) |
|
|
107
|
+
| `npx aiknowsys audit` | Find common issues and pattern violations | N/A (analysis) |
|
|
73
108
|
| `npx aiknowsys install-agents` | Install Developer + Architect agents | N/A (standalone) |
|
|
74
109
|
| `npx aiknowsys install-skills` | Install universal skills | N/A (standalone) |
|
|
75
110
|
|
|
76
111
|
**đĄ AI-Assisted Completion:** When using `init` in AI-guided mode, `migrate`, or `scan`, you'll receive a ready-to-copy prompt that you can paste to your AI assistant (Claude, GPT-4, Copilot Chat, etc.) to automatically complete the TODO sections based on your actual codebase. Manual mode lets you fill sections yourself, but you can always use AI later.
|
|
77
112
|
|
|
113
|
+
**đ Template Options:**
|
|
114
|
+
|
|
115
|
+
- **Minimal Template** (10 sections): For learning projects, prototypes, and simple tools
|
|
116
|
+
```bash
|
|
117
|
+
npx aiknowsys init --template minimal
|
|
118
|
+
```
|
|
119
|
+
Includes: Tech Stack, Validation Matrix, Structure, Patterns, Invariants, Gotchas, Testing, Architecture, Change Management, Workflow
|
|
120
|
+
|
|
121
|
+
- **Full Template** (13+ sections): For production projects and complex systems (default)
|
|
122
|
+
```bash
|
|
123
|
+
npx aiknowsys init --template full # or just: npx aiknowsys init
|
|
124
|
+
```
|
|
125
|
+
Includes all minimal sections + Security, Performance, Accessibility
|
|
126
|
+
|
|
127
|
+
See [examples/filled-simple-api](examples/filled-simple-api) for a realistic filled example using the minimal template.
|
|
128
|
+
|
|
129
|
+
**đ Enhanced Interactive Setup (Manual Mode):**
|
|
130
|
+
|
|
131
|
+
Manual mode now asks intelligent questions about your project and automatically fills many placeholders:
|
|
132
|
+
|
|
133
|
+
- â
**Technology Snapshot**: Framework, language, build tool, package manager
|
|
134
|
+
- â
**Validation Matrix**: Auto-generates test, lint, type-check commands
|
|
135
|
+
- â
**Tooling Details**: Database, linter, test framework selections
|
|
136
|
+
- â
**Individual Commands**: {{TEST_CMD}}, {{LINT_CMD}}, {{TYPE_CHECK_CMD}} all filled
|
|
137
|
+
|
|
138
|
+
**Before**: 50+ placeholders to fill manually
|
|
139
|
+
**After**: Only structure and pattern placeholders remain (for AI or human completion)
|
|
140
|
+
|
|
141
|
+
This significantly reduces setup time while maintaining flexibility for project-specific details.
|
|
142
|
+
|
|
143
|
+
**đ Verification & Maintenance Commands:**
|
|
144
|
+
|
|
145
|
+
New commands to validate and maintain your knowledge system:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Validate your setup
|
|
149
|
+
npx aiknowsys check
|
|
150
|
+
# â Checks required files exist
|
|
151
|
+
# â Verifies agents and skills installed
|
|
152
|
+
# â Detects unfilled placeholders
|
|
153
|
+
# â Validates validation matrix
|
|
154
|
+
|
|
155
|
+
# Fix redundancy (sync validation matrix reference)
|
|
156
|
+
npx aiknowsys sync
|
|
157
|
+
# Updates AGENTS.md to reference ESSENTIALS.md (DRY principle)
|
|
158
|
+
|
|
159
|
+
# Find issues and violations
|
|
160
|
+
npx aiknowsys audit
|
|
161
|
+
# â ī¸ Detects validation matrix duplication
|
|
162
|
+
# â ī¸ Finds generic placeholder values
|
|
163
|
+
# â ī¸ Checks file size bloat
|
|
164
|
+
# âšī¸ Suggests improvements
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**When to use:**
|
|
168
|
+
- `check` - Before committing, after setup, or when troubleshooting
|
|
169
|
+
- `sync` - After upgrading from old templates with duplicated validation matrix
|
|
170
|
+
- `audit` - Periodic health checks, before releases, or when reviewing code quality
|
|
171
|
+
|
|
78
172
|
---
|
|
79
173
|
|
|
80
174
|
## AI Tool Compatibility
|
|
@@ -206,6 +300,7 @@ User â @Developer â Implements feature â Auto-handoff â @SeniorArchitect
|
|
|
206
300
|
- `code-refactoring` - Test-driven refactoring patterns
|
|
207
301
|
- `testing-best-practices` - Framework-agnostic testing guide
|
|
208
302
|
- `skill-creator` - How to create new skills
|
|
303
|
+
- `tdd-workflow` - Test-Driven Development (RED-GREEN-REFACTOR cycle)
|
|
209
304
|
|
|
210
305
|
**Custom skills you can add:**
|
|
211
306
|
- Feature implementation workflows
|
package/bin/cli.js
CHANGED
|
@@ -11,6 +11,9 @@ import { migrate } from '../lib/commands/migrate.js';
|
|
|
11
11
|
import { installAgents } from '../lib/commands/install-agents.js';
|
|
12
12
|
import { installSkills } from '../lib/commands/install-skills.js';
|
|
13
13
|
import { update } from '../lib/commands/update.js';
|
|
14
|
+
import { check } from '../lib/commands/check.js';
|
|
15
|
+
import { sync } from '../lib/commands/sync.js';
|
|
16
|
+
import { audit } from '../lib/commands/audit.js';
|
|
14
17
|
|
|
15
18
|
// Get version from package.json
|
|
16
19
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -38,6 +41,9 @@ program
|
|
|
38
41
|
.description('Initialize knowledge system with AI-assisted setup')
|
|
39
42
|
.option('-d, --dir <directory>', 'Target directory', '.')
|
|
40
43
|
.option('-y, --yes', 'Skip prompts and use defaults')
|
|
44
|
+
.option('-t, --template <type>', 'Template size: minimal (10 sections) or full (13+ sections)', 'full')
|
|
45
|
+
.option('-s, --stack <name>', 'Use pre-built stack template (nextjs, vue-express, etc.)')
|
|
46
|
+
.option('--list-stacks', 'List available stack templates')
|
|
41
47
|
.action(init);
|
|
42
48
|
|
|
43
49
|
program
|
|
@@ -75,6 +81,24 @@ program
|
|
|
75
81
|
.option('-f, --force', 'Force update even if already up to date')
|
|
76
82
|
.action(update);
|
|
77
83
|
|
|
84
|
+
program
|
|
85
|
+
.command('check')
|
|
86
|
+
.description('Validate knowledge system setup and configuration')
|
|
87
|
+
.option('-d, --dir <directory>', 'Target directory', '.')
|
|
88
|
+
.action(check);
|
|
89
|
+
|
|
90
|
+
program
|
|
91
|
+
.command('sync')
|
|
92
|
+
.description('Sync AGENTS.md validation reference with CODEBASE_ESSENTIALS.md')
|
|
93
|
+
.option('-d, --dir <directory>', 'Target directory', '.')
|
|
94
|
+
.action(sync);
|
|
95
|
+
|
|
96
|
+
program
|
|
97
|
+
.command('audit')
|
|
98
|
+
.description('Find common issues and pattern violations in knowledge system')
|
|
99
|
+
.option('-d, --dir <directory>', 'Target directory', '.')
|
|
100
|
+
.action(audit);
|
|
101
|
+
|
|
78
102
|
// Default command - show help with styled banner
|
|
79
103
|
program
|
|
80
104
|
.action(() => {
|