knowy-cli 0.1.3 → 0.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowy-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Give your AI a structured project brain",
5
5
  "type": "module",
6
6
  "bin": {
package/src/constants.js CHANGED
@@ -16,7 +16,7 @@ export const CORE_FILES = ['principles.md', 'vision.md', 'experience.md'];
16
16
  export const SUBDIRS = ['research', 'design', 'history', TEMPLATES_DIR];
17
17
 
18
18
  export const SKILLS_SOURCE = join(PACKAGE_ROOT, 'skills');
19
- export const SKILLS_TARGET = '.claude/skills/knowy';
19
+ export const SKILLS_TARGET = '.claude/skills';
20
20
  export const SKILL_NAMES = ['knowy-init', 'knowy-update', 'knowy-judge', 'knowy-next'];
21
21
 
22
22
  export const MARKER_START = '<!-- Knowy: Project Knowledge -->';
package/src/i18n.js CHANGED
@@ -73,7 +73,7 @@ const messages = {
73
73
  'cli.init.handshake.created': (file, tool) => ` ✓ Created ${file} (${tool})`,
74
74
  'cli.init.handshake.updated': (file, tool) => ` ✓ Updated ${file} (${tool})`,
75
75
  'cli.init.handshake.appended': (file, tool) => ` ✓ Added to ${file} (${tool})`,
76
- 'cli.init.skills': (n) => ` ✓ Installed ${n} skills to .claude/skills/knowy/`,
76
+ 'cli.init.skills': (n) => ` ✓ Installed ${n} skills to .claude/skills/`,
77
77
  'cli.init.done': '✅ Done!',
78
78
  'cli.init.nextStep': 'Next step: run /knowy init in your AI tool to populate your knowledge files.',
79
79
  'cli.init.selectLanguage': 'Select language for templates:',
package/src/scaffold.js CHANGED
@@ -2,9 +2,16 @@ import { mkdir, copyFile, writeFile, access } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import {
4
4
  KNOWLEDGE_DIR, KNOWY_CONFIG, CORE_FILES, SUBDIRS,
5
- PACKAGE_ROOT, VERSION
5
+ PACKAGE_ROOT, VERSION, TEMPLATES_DIR
6
6
  } from './constants.js';
7
7
 
8
+ // Subdirectories that get a README (excludes .templates)
9
+ const SUBDIR_READMES = {
10
+ research: 'research-README.md',
11
+ design: 'design-README.md',
12
+ history: 'history-README.md',
13
+ };
14
+
8
15
  async function exists(p) {
9
16
  try { await access(p); return true; } catch { return false; }
10
17
  }
@@ -35,6 +42,21 @@ export async function scaffoldKnowledge(projectRoot, language = 'en') {
35
42
  }
36
43
  }
37
44
 
45
+ // Copy subdirectory READMEs (never overwrite)
46
+ for (const [sub, tmplName] of Object.entries(SUBDIR_READMES)) {
47
+ const dest = join(knowledgeDir, sub, 'README.md');
48
+ if (await exists(dest)) {
49
+ report.skipped.push(`${sub}/README.md`);
50
+ } else {
51
+ let src = join(PACKAGE_ROOT, 'templates', language, tmplName);
52
+ if (!await exists(src)) {
53
+ src = join(PACKAGE_ROOT, 'templates', 'en', tmplName);
54
+ }
55
+ await copyFile(src, dest);
56
+ report.created.push(`${sub}/README.md`);
57
+ }
58
+ }
59
+
38
60
  // Create .knowy.json
39
61
  const configPath = join(projectRoot, KNOWY_CONFIG);
40
62
  if (await exists(configPath)) {
@@ -0,0 +1,47 @@
1
+ # Design
2
+
3
+ This directory holds architecture designs, technical decision records (ADRs), system designs, and interface specifications.
4
+
5
+ ## When to add a file here
6
+
7
+ - You're making an architectural decision that affects multiple parts of the system
8
+ - You're designing a new component, API, or data model
9
+ - You're choosing between approaches and want to document the reasoning
10
+ - You're proposing a significant change to existing architecture
11
+
12
+ ## Suggested format
13
+
14
+ ```markdown
15
+ # [Design Title]
16
+
17
+ **Date**: YYYY-MM-DD
18
+ **Status**: draft | accepted | superseded
19
+
20
+ ## Context
21
+
22
+ What situation or need prompted this design?
23
+
24
+ ## Decision
25
+
26
+ What approach did we choose?
27
+
28
+ ## Rationale
29
+
30
+ Why this approach over alternatives?
31
+
32
+ ## Consequences
33
+
34
+ What are the trade-offs? What becomes easier or harder?
35
+
36
+ ## Alternatives Considered
37
+
38
+ - ...
39
+ ```
40
+
41
+ ## File naming
42
+
43
+ Use descriptive topic names: `auth-system.md`, `database-migration-strategy.md`
44
+
45
+ ## Relationship to core files
46
+
47
+ Key architectural decisions should be reflected in **vision.md** (Architecture section). The design file has the full reasoning; vision.md has the summary. When a design is superseded, update vision.md accordingly.
@@ -0,0 +1,38 @@
1
+ # History
2
+
3
+ This directory holds event records — what happened, when, and why it mattered. These are the raw material that gets distilled into experience.md.
4
+
5
+ ## When to add a file here
6
+
7
+ - You just completed a significant milestone or feature
8
+ - Something unexpected happened during development
9
+ - You made a decision you might need to revisit later
10
+ - A debugging session revealed something important about the system
11
+
12
+ ## Suggested format
13
+
14
+ ```markdown
15
+ # [Event Title]
16
+
17
+ **Date**: YYYY-MM-DD
18
+
19
+ ## What Happened
20
+
21
+ Describe the event — what was built, what broke, what changed.
22
+
23
+ ## Impact
24
+
25
+ How did this affect the project? What changed as a result?
26
+
27
+ ## Follow-up Actions
28
+
29
+ - [ ] ...
30
+ ```
31
+
32
+ ## File naming
33
+
34
+ Use numbered prefixes to maintain chronological order: `001-initial-setup.md`, `002-auth-migration.md`, `015-performance-crisis.md`
35
+
36
+ ## Relationship to core files
37
+
38
+ History entries are the raw events. The lessons they teach should be distilled into **experience.md** using the four-part format (Theory said → Actually happened → Resolved by → Lesson). The history file stays here as the detailed record; experience.md has the actionable pattern.
@@ -0,0 +1,43 @@
1
+ # Research
2
+
3
+ This directory holds exploratory notes, literature surveys, technical research, and prototype experiments.
4
+
5
+ ## When to add a file here
6
+
7
+ - You're investigating a technology, library, or approach
8
+ - You're reading papers or documentation and want to capture findings
9
+ - You're running experiments or prototypes to test an idea
10
+ - You have open questions that need exploration before making a decision
11
+
12
+ ## Suggested format
13
+
14
+ ```markdown
15
+ # [Research Topic]
16
+
17
+ **Date**: YYYY-MM-DD
18
+ **Status**: exploring | concluded
19
+
20
+ ## Question
21
+
22
+ What are we trying to find out?
23
+
24
+ ## Findings
25
+
26
+ - ...
27
+
28
+ ## Conclusion
29
+
30
+ What did we learn? What decision does this inform?
31
+
32
+ ## Next Steps
33
+
34
+ - [ ] ...
35
+ ```
36
+
37
+ ## File naming
38
+
39
+ Use descriptive topic names: `caching-strategies.md`, `auth-library-comparison.md`
40
+
41
+ ## Relationship to core files
42
+
43
+ When research reaches a conclusion that reveals a fundamental truth about your project, consider distilling it into **principles.md**. The research file stays here as the detailed record; the principle is the distilled essence.
@@ -0,0 +1,47 @@
1
+ # 設計
2
+
3
+ 這個目錄放架構設計、技術決策記錄(ADR)、系統設計和介面規格。
4
+
5
+ ## 什麼時候在這裡新增檔案
6
+
7
+ - 你在做一個影響系統多個部分的架構決策
8
+ - 你在設計新的元件、API 或資料模型
9
+ - 你在幾個方案之間抉擇,想記錄推理過程
10
+ - 你在提議對既有架構的重大變更
11
+
12
+ ## 建議格式
13
+
14
+ ```markdown
15
+ # [設計標題]
16
+
17
+ **日期**:YYYY-MM-DD
18
+ **狀態**:草稿 | 已採納 | 已取代
19
+
20
+ ## 脈絡
21
+
22
+ 什麼情況或需求促成了這個設計?
23
+
24
+ ## 決策
25
+
26
+ 我們選擇了什麼方案?
27
+
28
+ ## 理由
29
+
30
+ 為什麼選這個方案而不是其他的?
31
+
32
+ ## 後果
33
+
34
+ 有什麼取捨?什麼變容易了、什麼變難了?
35
+
36
+ ## 考慮過的替代方案
37
+
38
+ - ...
39
+ ```
40
+
41
+ ## 檔案命名
42
+
43
+ 使用描述性的主題名稱:`auth-system.md`、`資料庫遷移策略.md`
44
+
45
+ ## 與核心文件的關係
46
+
47
+ 關鍵的架構決策應該反映到 **vision.md**(架構區塊)。設計檔案有完整的推理過程;vision.md 有摘要。當設計被取代時,同步更新 vision.md。
@@ -0,0 +1,38 @@
1
+ # 歷史
2
+
3
+ 這個目錄放事件記錄——發生了什麼、什麼時候、為什麼重要。這些是蒸餾成 experience.md 的原始素材。
4
+
5
+ ## 什麼時候在這裡新增檔案
6
+
7
+ - 你剛完成一個重要的里程碑或功能
8
+ - 開發過程中發生了意料之外的事
9
+ - 你做了一個之後可能需要回顧的決定
10
+ - 一次除錯過程揭示了系統的重要特性
11
+
12
+ ## 建議格式
13
+
14
+ ```markdown
15
+ # [事件標題]
16
+
17
+ **日期**:YYYY-MM-DD
18
+
19
+ ## 發生了什麼
20
+
21
+ 描述事件——建了什麼、壞了什麼、改了什麼。
22
+
23
+ ## 影響
24
+
25
+ 這對專案有什麼影響?因此改變了什麼?
26
+
27
+ ## 後續行動
28
+
29
+ - [ ] ...
30
+ ```
31
+
32
+ ## 檔案命名
33
+
34
+ 使用編號前綴保持時間順序:`001-初始建置.md`、`002-auth-migration.md`、`015-效能危機.md`
35
+
36
+ ## 與核心文件的關係
37
+
38
+ 歷史記錄是原始事件。從中學到的教訓應該蒸餾進 **experience.md**,使用四段式格式(理論說 → 實際發生 → 解決方式 → 教訓)。歷史檔案留在這裡作為詳細記錄;experience.md 是可操作的模式。
@@ -0,0 +1,43 @@
1
+ # 研究
2
+
3
+ 這個目錄放探索性筆記、文獻調查、技術研究和原型實驗記錄。
4
+
5
+ ## 什麼時候在這裡新增檔案
6
+
7
+ - 你正在調查某個技術、函式庫或方法
8
+ - 你在閱讀論文或文件,想記錄發現
9
+ - 你在跑實驗或原型來測試想法
10
+ - 你有開放性的問題需要在做決定前先探索
11
+
12
+ ## 建議格式
13
+
14
+ ```markdown
15
+ # [研究主題]
16
+
17
+ **日期**:YYYY-MM-DD
18
+ **狀態**:探索中 | 已結論
19
+
20
+ ## 問題
21
+
22
+ 我們想弄清楚什麼?
23
+
24
+ ## 發現
25
+
26
+ - ...
27
+
28
+ ## 結論
29
+
30
+ 我們學到了什麼?這個結論影響什麼決策?
31
+
32
+ ## 下一步
33
+
34
+ - [ ] ...
35
+ ```
36
+
37
+ ## 檔案命名
38
+
39
+ 使用描述性的主題名稱:`快取策略.md`、`auth-library-comparison.md`
40
+
41
+ ## 與核心文件的關係
42
+
43
+ 當研究得出的結論揭示了專案的根本真理時,考慮蒸餾進 **principles.md**。研究檔案留在這裡作為詳細記錄;原則是蒸餾後的精華。