project-librarian 0.2.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/LICENSE +21 -0
- package/README.ja.md +227 -0
- package/README.ko.md +229 -0
- package/README.md +280 -0
- package/README.zh.md +227 -0
- package/SKILL.md +335 -0
- package/agents/openai.yaml +3 -0
- package/dist/args.js +235 -0
- package/dist/code-index-db.js +34 -0
- package/dist/code-index-file-policy.js +120 -0
- package/dist/code-index-sql.js +9 -0
- package/dist/code-index.js +1856 -0
- package/dist/hooks.js +321 -0
- package/dist/init-project-wiki.js +246 -0
- package/dist/install-skill.js +142 -0
- package/dist/migration.js +356 -0
- package/dist/modes.js +823 -0
- package/dist/templates.js +552 -0
- package/dist/types.js +2 -0
- package/dist/wiki-files.js +289 -0
- package/dist/workspace.js +212 -0
- package/package.json +71 -0
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.starterFiles = exports.decisionPolicy = exports.wikiOperatingModel = exports.inboxIndexBlock = exports.glossaryIndexBlock = exports.glossary = exports.index = exports.startup = exports.metadata = exports.wikiAgentsSection = exports.claudeSection = exports.agentsSection = void 0;
|
|
4
|
+
const workspace_1 = require("./workspace");
|
|
5
|
+
exports.agentsSection = `<!-- PROJECT-WIKI-FIRST:START -->
|
|
6
|
+
## Wiki-First Planning
|
|
7
|
+
|
|
8
|
+
This project uses \`./wiki\` as the durable project-planning source of truth.
|
|
9
|
+
|
|
10
|
+
At the start of every session:
|
|
11
|
+
|
|
12
|
+
1. Review \`wiki/startup.md\` for compact current context.
|
|
13
|
+
2. Review \`wiki/index.md\` as the router for which files to read next.
|
|
14
|
+
3. Read detailed \`wiki/canonical/\`, \`wiki/decisions/\`, \`wiki/meta/\`, and \`wiki/sources/\` files on demand only when the current question needs them.
|
|
15
|
+
|
|
16
|
+
During conversation:
|
|
17
|
+
|
|
18
|
+
- Update \`./wiki\` in the same turn when project planning content is added, changed, or removed.
|
|
19
|
+
- Do not store non-project LLM memory, assistant preferences, collaboration reminders, or workflow instructions in project wiki canonical or decision docs.
|
|
20
|
+
- Follow \`wiki/AGENTS.md\` for detailed rules when editing files under \`wiki/\`.
|
|
21
|
+
- Let \`.githooks/prepare-commit-msg\` append wiki trailers automatically for staged wiki, hook, AGENTS, or project-librarian files.
|
|
22
|
+
<!-- PROJECT-WIKI-FIRST:END -->`;
|
|
23
|
+
exports.claudeSection = `<!-- PROJECT-WIKI-CLAUDE:START -->
|
|
24
|
+
# Claude Code Project Instructions
|
|
25
|
+
|
|
26
|
+
@AGENTS.md
|
|
27
|
+
|
|
28
|
+
## Claude Code Notes
|
|
29
|
+
|
|
30
|
+
Claude Code reads \`CLAUDE.md\`, not \`AGENTS.md\`, so this file imports \`AGENTS.md\` to share the same wiki-first planning contract with Codex and other agents. Bootstrap also installs a Claude Code \`SessionStart\` hook in \`.claude/settings.json\` for compact wiki startup context.
|
|
31
|
+
|
|
32
|
+
At session start, follow the imported instructions: review \`wiki/startup.md\` and \`wiki/index.md\` first, then read detailed wiki pages on demand only when the current task needs them.
|
|
33
|
+
<!-- PROJECT-WIKI-CLAUDE:END -->`;
|
|
34
|
+
exports.wikiAgentsSection = `<!-- PROJECT-WIKI-INTERNAL:START -->
|
|
35
|
+
## Wiki Internal Rules
|
|
36
|
+
|
|
37
|
+
This file applies to \`./wiki\` and its children. Root \`AGENTS.md\` owns the project-wide wiki-first contract. Root \`CLAUDE.md\` imports \`AGENTS.md\` for Claude Code compatibility. This file owns detailed wiki editing rules.
|
|
38
|
+
|
|
39
|
+
Language policy:
|
|
40
|
+
|
|
41
|
+
- Wiki operating documents generated by this bootstrap are English by default.
|
|
42
|
+
- Project canonical content does not have a fixed default language. The LLM should choose the language that best matches the user's language, project context, and surrounding materials, then keep that choice consistent.
|
|
43
|
+
- If the user explicitly asks for a language, that instruction wins.
|
|
44
|
+
|
|
45
|
+
Reading rules:
|
|
46
|
+
|
|
47
|
+
- Treat \`startup.md\` as compact session context and \`index.md\` as the router.
|
|
48
|
+
- Read detailed \`canonical/\`, \`decisions/\`, \`meta/\`, and \`sources/\` files on demand only when the current question needs them.
|
|
49
|
+
- Prefer each file's TL;DR and metadata before reading the full body.
|
|
50
|
+
|
|
51
|
+
Storage boundaries:
|
|
52
|
+
|
|
53
|
+
- \`canonical/\` contains current project-planning truth only.
|
|
54
|
+
- \`decisions/\` contains project decision history only.
|
|
55
|
+
- \`meta/\` contains wiki operating rules, decision policy, bootstrap, lint, hook, and migration decisions.
|
|
56
|
+
- \`sources/\` contains external reference summaries and source notes.
|
|
57
|
+
- \`inbox/\` and migration inbox files contain candidates, not canonical truth.
|
|
58
|
+
- Do not store non-project LLM memory, assistant preferences, collaboration reminders, or workflow instructions in \`canonical/\` or \`decisions/\`; use root \`AGENTS.md\`, \`CLAUDE.md\`, hooks, or skills instead.
|
|
59
|
+
- During migration review, do not copy legacy markdown files directly into \`canonical/\`, \`decisions/\`, or \`sources/\`. Rewrite only the useful project meaning, cite current-project evidence when possible, and keep unresolved or ambiguous material in migration inboxes.
|
|
60
|
+
|
|
61
|
+
Update rules:
|
|
62
|
+
|
|
63
|
+
- Every wiki knowledge markdown file should include compact metadata with \`status\`, \`updated\`, \`scope\`, \`read_budget\`, \`decision_ref\`, and \`review_trigger\`. This \`wiki/AGENTS.md\` instruction file is excluded from that wiki-page metadata requirement.
|
|
64
|
+
- Put a compact TL;DR near the top of canonical, decision, meta, source, inbox, and migration pages.
|
|
65
|
+
- Update \`startup.md\` when session-start summary, recent important decisions, open questions, routing hints, or project-language choice changes.
|
|
66
|
+
- Update \`index.md\` when adding, moving, removing, or materially changing wiki pages.
|
|
67
|
+
- Use \`decisions/log.md\` for trivial timestamped project decisions, Decision Packs for grouped topic decisions, and Full ADRs only for product direction, architecture, public API, data model, security/permission, SEO contract, high migration-cost, or likely-to-be-challenged decisions.
|
|
68
|
+
- Initialize \`canonical/glossary.md\` only when terminology becomes useful.
|
|
69
|
+
- Keep migration inbox statuses as \`pending\`, \`adopted\`, \`rejected\`, \`resolved\`, or \`needs-human-review\`.
|
|
70
|
+
|
|
71
|
+
Commit rules:
|
|
72
|
+
|
|
73
|
+
- Follow the repository's commit-message policy when one exists.
|
|
74
|
+
- Let \`.githooks/prepare-commit-msg\` append wiki trailers automatically when git hooks are enabled.
|
|
75
|
+
- If bootstrap was run with \`--no-git-config\`, hook files are installed but \`core.hooksPath\` is not changed.
|
|
76
|
+
- Do not hand-write wiki trailers unless the hook is unavailable or a trailer needs correction.
|
|
77
|
+
<!-- PROJECT-WIKI-INTERNAL:END -->`;
|
|
78
|
+
const metadata = (scope, budget, decisionRef, trigger, status = "active") => `---
|
|
79
|
+
status: ${status}
|
|
80
|
+
updated: ${workspace_1.today}
|
|
81
|
+
scope: ${scope}
|
|
82
|
+
read_budget: ${budget}
|
|
83
|
+
decision_ref: ${decisionRef}
|
|
84
|
+
review_trigger: ${trigger}
|
|
85
|
+
---
|
|
86
|
+
`;
|
|
87
|
+
exports.metadata = metadata;
|
|
88
|
+
exports.startup = `${(0, exports.metadata)("startup-router", "short", "wiki/meta/wiki-ops-v1-decisions.md", "session-start summary, routing, language policy, or open project state changes")}
|
|
89
|
+
# Startup Context
|
|
90
|
+
|
|
91
|
+
## TL;DR
|
|
92
|
+
|
|
93
|
+
- This project is in an initial planning state unless the canonical wiki says otherwise.
|
|
94
|
+
- Project truth lives in \`wiki/canonical/\`, project decision history lives in \`wiki/decisions/\`, and source summaries live in \`wiki/sources/\`.
|
|
95
|
+
- Wiki operating rules and wiki operating decisions live in \`wiki/meta/\`.
|
|
96
|
+
- At session start, read only this file and \`wiki/index.md\` first; read detailed files on demand.
|
|
97
|
+
- Project canonical content language is not fixed by this bootstrap. The LLM should choose the language that best matches the user and project context.
|
|
98
|
+
- Update the wiki in the same turn when project-planning content changes.
|
|
99
|
+
|
|
100
|
+
## Read On Demand
|
|
101
|
+
|
|
102
|
+
- [[index]]: document router.
|
|
103
|
+
- [[canonical/project-brief]]: read only when product direction, audience, scope, success criteria, or core scenarios matter.
|
|
104
|
+
- [[canonical/open-questions]]: read only when unresolved questions or next clarification items matter.
|
|
105
|
+
- [[canonical/assumptions]]: read only when temporary assumptions or unverified premises matter.
|
|
106
|
+
- [[canonical/risks]]: read only when risks, revisit triggers, or uncertainty matter.
|
|
107
|
+
|
|
108
|
+
## Project State
|
|
109
|
+
|
|
110
|
+
- Problem/opportunity: not selected yet.
|
|
111
|
+
- Target users: not selected yet.
|
|
112
|
+
- Core scenario: not selected yet.
|
|
113
|
+
- Success criteria: not selected yet.
|
|
114
|
+
- Initial scope: not selected yet.
|
|
115
|
+
- Project content language: to be selected from user/project context.
|
|
116
|
+
|
|
117
|
+
## Recent Project Decisions
|
|
118
|
+
|
|
119
|
+
- None yet.
|
|
120
|
+
|
|
121
|
+
## Wiki Operating Pointers
|
|
122
|
+
|
|
123
|
+
- Decision recording follows [[meta/decision-policy]].
|
|
124
|
+
- Wiki operation follows [[meta/operating-model]].
|
|
125
|
+
- Wiki operating decisions are recorded only in [[meta/wiki-ops-v1-decisions]], not in project decision logs.
|
|
126
|
+
|
|
127
|
+
## Token Discipline
|
|
128
|
+
|
|
129
|
+
- The Codex and Claude Code session-start hooks inject only this file and \`wiki/index.md\`.
|
|
130
|
+
- Detailed files are selected by the "read when" rules in \`wiki/index.md\`.
|
|
131
|
+
- Long decision history is not injected wholesale; read only relevant Decision Packs or ADRs.
|
|
132
|
+
`;
|
|
133
|
+
exports.index = `${(0, exports.metadata)("wiki-router", "short", "wiki/meta/wiki-ops-v1-decisions.md", "wiki page added, moved, removed, or routing changes")}
|
|
134
|
+
# Wiki Index
|
|
135
|
+
|
|
136
|
+
## How To Use This Index
|
|
137
|
+
|
|
138
|
+
This file is a router, not a file to expand into every answer. Read only the files that are relevant to the current question.
|
|
139
|
+
|
|
140
|
+
## Language Policy
|
|
141
|
+
|
|
142
|
+
- Operating documents generated by this bootstrap are English by default.
|
|
143
|
+
- Project canonical content language is chosen by the LLM from the user's language, project context, and surrounding materials.
|
|
144
|
+
- Keep the chosen project language consistent unless the user asks to switch.
|
|
145
|
+
|
|
146
|
+
## Boundary Rule
|
|
147
|
+
|
|
148
|
+
- \`wiki/canonical/\` and \`wiki/decisions/\` contain project-planning content only.
|
|
149
|
+
- Wiki operating rules and wiki operating decisions live in \`wiki/meta/\`.
|
|
150
|
+
- Non-project LLM memory, collaboration reminders, and workflow instructions belong in \`AGENTS.md\`, \`wiki/AGENTS.md\`, hooks, or skills, not in project canonical/decision docs.
|
|
151
|
+
|
|
152
|
+
## Startup
|
|
153
|
+
|
|
154
|
+
- [[startup]]
|
|
155
|
+
- Read: every session start or compact project state lookup.
|
|
156
|
+
- Update: startup summary, recent decisions, open questions, routes, language policy.
|
|
157
|
+
- Token budget: short.
|
|
158
|
+
|
|
159
|
+
## Canonical
|
|
160
|
+
|
|
161
|
+
- [[canonical/project-brief]]
|
|
162
|
+
- Read: product direction, audience, scope, success criteria, core scenarios.
|
|
163
|
+
- Update: product, audience, scope, or success criteria changes.
|
|
164
|
+
- Token budget: medium.
|
|
165
|
+
- [[canonical/open-questions]]
|
|
166
|
+
- Read: unresolved questions or next clarifications.
|
|
167
|
+
- Update: questions are added, answered, or moved.
|
|
168
|
+
- Token budget: short.
|
|
169
|
+
- [[canonical/assumptions]]
|
|
170
|
+
- Read: temporary assumptions or unverified premises.
|
|
171
|
+
- Update: assumptions are added, validated, or retired.
|
|
172
|
+
- Token budget: short.
|
|
173
|
+
- [[canonical/risks]]
|
|
174
|
+
- Read: risks, revisit triggers, uncertainty.
|
|
175
|
+
- Update: risks are added, mitigated, or resolved.
|
|
176
|
+
- Token budget: short.
|
|
177
|
+
|
|
178
|
+
## Project Decisions
|
|
179
|
+
|
|
180
|
+
- [[decisions/recent]]
|
|
181
|
+
- Read: recent important project decisions.
|
|
182
|
+
- Update: a decision belongs in startup context.
|
|
183
|
+
- Token budget: short.
|
|
184
|
+
- [[decisions/log]]
|
|
185
|
+
- Read: project decision timing matters.
|
|
186
|
+
- Update: a trivial decision needs timestamp tracking.
|
|
187
|
+
- Token budget: on-demand.
|
|
188
|
+
- [[decisions/decision-pack-template]]
|
|
189
|
+
- Read: creating a Decision Pack.
|
|
190
|
+
- Update: Decision Pack format changes.
|
|
191
|
+
- Token budget: short.
|
|
192
|
+
- [[decisions/full-adr-template]]
|
|
193
|
+
- Read: creating a Full ADR.
|
|
194
|
+
- Update: Full ADR format changes.
|
|
195
|
+
- Token budget: short.
|
|
196
|
+
|
|
197
|
+
## Wiki Meta
|
|
198
|
+
|
|
199
|
+
- [[meta/operating-model]]
|
|
200
|
+
- Read: wiki operation, hooks, bootstrap, maintenance, language policy.
|
|
201
|
+
- Update: wiki operation or startup behavior changes.
|
|
202
|
+
- Token budget: medium.
|
|
203
|
+
- [[meta/decision-policy]]
|
|
204
|
+
- Read: decision level, ADR need, canonical/decision split.
|
|
205
|
+
- Update: decision classification or ADR criteria changes.
|
|
206
|
+
- Token budget: medium.
|
|
207
|
+
- [[meta/wiki-ops-v1-decisions]]
|
|
208
|
+
- Read: wiki operating decisions, rejected alternatives, rationale.
|
|
209
|
+
- Update when: wiki operating decisions change.
|
|
210
|
+
- Token budget: medium.
|
|
211
|
+
|
|
212
|
+
## Sources
|
|
213
|
+
|
|
214
|
+
- [[sources/karpathy-llm-wiki]]
|
|
215
|
+
- Read: source pattern and LLM Wiki rationale.
|
|
216
|
+
- Update: source links, interpretation, application notes.
|
|
217
|
+
- Token budget: short.
|
|
218
|
+
`;
|
|
219
|
+
exports.glossary = `${(0, exports.metadata)("project-canonical", "medium", "wiki/meta/wiki-ops-v1-decisions.md", "project terms, roles, states, permissions, events, entities, API names, DB names, or UI labels are added or renamed")}
|
|
220
|
+
# Glossary
|
|
221
|
+
|
|
222
|
+
## TL;DR
|
|
223
|
+
|
|
224
|
+
- This file is the naming contract for project/product terminology.
|
|
225
|
+
- Do not store wiki operating terms, LLM collaboration instructions, or general working memory here.
|
|
226
|
+
- Prefer canonical terms from this file for API, database, UI, and policy wording.
|
|
227
|
+
- Use the project language chosen in [[startup]] unless the user says otherwise.
|
|
228
|
+
|
|
229
|
+
## Terms
|
|
230
|
+
|
|
231
|
+
| Term | Definition | Avoid | Related Canonical Doc | Status |
|
|
232
|
+
| --- | --- | --- | --- | --- |
|
|
233
|
+
| | | | | proposed |
|
|
234
|
+
`;
|
|
235
|
+
exports.glossaryIndexBlock = `<!-- PROJECT-WIKI-GLOSSARY:START -->
|
|
236
|
+
## Glossary
|
|
237
|
+
|
|
238
|
+
- [[canonical/glossary]]
|
|
239
|
+
- Read: terms, roles, states, permissions, events, API/DB/UI names, naming conflicts.
|
|
240
|
+
- Update: core term is added, renamed, or deprecated.
|
|
241
|
+
- Token budget: medium.
|
|
242
|
+
<!-- PROJECT-WIKI-GLOSSARY:END -->`;
|
|
243
|
+
exports.inboxIndexBlock = `<!-- PROJECT-WIKI-INBOX:START -->
|
|
244
|
+
## Inbox
|
|
245
|
+
|
|
246
|
+
- [[inbox/project-candidates]]
|
|
247
|
+
- Read: captured project candidates not yet adopted.
|
|
248
|
+
- Update: \`--capture-inbox\` adds a candidate or status changes.
|
|
249
|
+
- Token budget: on-demand.
|
|
250
|
+
<!-- PROJECT-WIKI-INBOX:END -->`;
|
|
251
|
+
exports.wikiOperatingModel = `${(0, exports.metadata)("wiki-meta", "medium", "wiki/meta/wiki-ops-v1-decisions.md", "wiki operating rules, hook behavior, bootstrap behavior, language policy, or token policy changes")}
|
|
252
|
+
# Wiki Operating Model
|
|
253
|
+
|
|
254
|
+
## TL;DR
|
|
255
|
+
|
|
256
|
+
- This wiki keeps project-planning knowledge as durable markdown.
|
|
257
|
+
- The Codex and Claude Code session-start hooks inject only \`wiki/startup.md\` and \`wiki/index.md\`.
|
|
258
|
+
- Detailed canonical and decision files are read on demand.
|
|
259
|
+
- Root \`AGENTS.md\` keeps the project-wide wiki-first contract; \`wiki/AGENTS.md\` keeps detailed wiki editing rules.
|
|
260
|
+
- Operating documents generated by bootstrap are English by default.
|
|
261
|
+
- Project canonical content language is selected from user/project context, not hardcoded by this bootstrap.
|
|
262
|
+
- Search, index refresh, inbox capture, and lifecycle checks are explicit script modes.
|
|
263
|
+
|
|
264
|
+
## Purpose
|
|
265
|
+
|
|
266
|
+
This wiki prevents project-planning knowledge from being trapped in one-off conversations. It gives humans and LLM agents a compact startup path plus durable source-of-truth documents.
|
|
267
|
+
|
|
268
|
+
## Applied Source Pattern
|
|
269
|
+
|
|
270
|
+
Karpathy's LLM Wiki pattern favors a continuously maintained markdown wiki over repeatedly rebuilding answers from scratch. This project applies that pattern to project planning.
|
|
271
|
+
|
|
272
|
+
## Layers
|
|
273
|
+
|
|
274
|
+
1. Sources: external docs, links, user notes, and evidence summaries.
|
|
275
|
+
2. Canonical project truth: current valid planning content under \`wiki/canonical/\`.
|
|
276
|
+
3. Project decisions: rationale, rejected alternatives, and revisit triggers under \`wiki/decisions/\`.
|
|
277
|
+
4. Startup context: compact session summary in \`wiki/startup.md\`.
|
|
278
|
+
5. Router: read/update/token-budget guidance in \`wiki/index.md\`.
|
|
279
|
+
6. Wiki meta: operating rules, decision policy, bootstrap, migration, lint, and language policy under \`wiki/meta/\`.
|
|
280
|
+
|
|
281
|
+
## Language Policy
|
|
282
|
+
|
|
283
|
+
- Bootstrap-generated operating documents are English.
|
|
284
|
+
- Project canonical content should use the language that best matches the user's language, project context, and surrounding materials.
|
|
285
|
+
- Keep a consistent project language once selected.
|
|
286
|
+
- If the user explicitly requests a language, that request wins.
|
|
287
|
+
|
|
288
|
+
## Query Procedure
|
|
289
|
+
|
|
290
|
+
Start with \`wiki/startup.md\` and \`wiki/index.md\`. Then select only relevant canonical, decision, meta, or source files using the "read when" rules.
|
|
291
|
+
|
|
292
|
+
Use keyword query when explicit search is useful:
|
|
293
|
+
|
|
294
|
+
\`\`\`bash
|
|
295
|
+
node dist/init-project-wiki.js --query "search terms"
|
|
296
|
+
\`\`\`
|
|
297
|
+
|
|
298
|
+
## Token Discipline
|
|
299
|
+
|
|
300
|
+
- Do not inject long canonical bodies or full decision logs into startup context.
|
|
301
|
+
- Put a compact TL;DR near the top of knowledge pages.
|
|
302
|
+
- Keep read/update/token-budget hints in \`wiki/index.md\`.
|
|
303
|
+
- Use \`decisions/log.md\` for accumulated timestamps and surface only important recent decisions in \`decisions/recent.md\` or \`startup.md\`.
|
|
304
|
+
|
|
305
|
+
## Git Hook Setup
|
|
306
|
+
|
|
307
|
+
- The script installs \`.githooks/prepare-commit-msg\` and \`.githooks/wiki-commit-trailers.js\`.
|
|
308
|
+
- By default, git repositories with an unset \`core.hooksPath\` are configured with \`git config core.hooksPath .githooks\`.
|
|
309
|
+
- Existing \`core.hooksPath\` values are preserved so an existing hook chain is not replaced.
|
|
310
|
+
- Run bootstrap with \`--no-git-config\` to install hook files without changing git config.
|
|
311
|
+
`;
|
|
312
|
+
exports.decisionPolicy = `${(0, exports.metadata)("wiki-meta", "medium", "wiki/meta/wiki-ops-v1-decisions.md", "project decision recording levels or ADR criteria change")}
|
|
313
|
+
# Decision Policy
|
|
314
|
+
|
|
315
|
+
## TL;DR
|
|
316
|
+
|
|
317
|
+
- Canonical docs hold current agreement; project decision docs hold rationale and history.
|
|
318
|
+
- Simple project changes update canonical docs only.
|
|
319
|
+
- Trivial decisions that need timing go into \`decisions/log.md\`.
|
|
320
|
+
- Related decisions can be grouped into a Decision Pack.
|
|
321
|
+
- Heavy decisions use a Full ADR.
|
|
322
|
+
- Wiki operating decisions belong in \`wiki/meta/\`, not project decision history.
|
|
323
|
+
|
|
324
|
+
## 1. Canonical Only
|
|
325
|
+
|
|
326
|
+
Use only \`wiki/canonical/\` for simple spec confirmation, current behavior descriptions, reversible wording edits, and low-context changes.
|
|
327
|
+
|
|
328
|
+
## 2. One-Line Log
|
|
329
|
+
|
|
330
|
+
Use \`wiki/decisions/log.md\` when the main value is timestamp tracking.
|
|
331
|
+
|
|
332
|
+
\`\`\`md
|
|
333
|
+
- YYYY-MM-DD | area | decision | canonical: [[canonical/example]]
|
|
334
|
+
\`\`\`
|
|
335
|
+
|
|
336
|
+
## 3. Decision Pack
|
|
337
|
+
|
|
338
|
+
Use a Decision Pack when several related choices share one topic.
|
|
339
|
+
|
|
340
|
+
| Date | Decision | Rationale | Rejected Alternative | Revisit Trigger | Canonical Link |
|
|
341
|
+
| --- | --- | --- | --- | --- | --- |
|
|
342
|
+
|
|
343
|
+
## 4. Full ADR
|
|
344
|
+
|
|
345
|
+
Use a Full ADR when the decision affects product direction, architecture, public API, data model, security/permissions, SEO contracts, high migration cost, or a likely future challenge.
|
|
346
|
+
|
|
347
|
+
## Token Rules
|
|
348
|
+
|
|
349
|
+
- Put a TL;DR near the top of canonical docs.
|
|
350
|
+
- Do not inject full canonical or decision bodies into startup context.
|
|
351
|
+
- Read long decision files only when \`wiki/index.md\` routing says they are relevant.
|
|
352
|
+
`;
|
|
353
|
+
exports.starterFiles = {
|
|
354
|
+
"wiki/README.md": `${(0, exports.metadata)("wiki-entry", "short", "wiki/meta/wiki-ops-v1-decisions.md", "top-level wiki structure changes")}
|
|
355
|
+
# Project Wiki
|
|
356
|
+
|
|
357
|
+
This directory is the durable project-planning source of truth. Keep product direction, specs, constraints, terms, and decisions current here.
|
|
358
|
+
|
|
359
|
+
## Start Here
|
|
360
|
+
|
|
361
|
+
- [[startup]]
|
|
362
|
+
- [[index]]
|
|
363
|
+
- [[canonical/project-brief]]
|
|
364
|
+
- [[canonical/open-questions]]
|
|
365
|
+
- [[canonical/assumptions]]
|
|
366
|
+
- [[canonical/risks]]
|
|
367
|
+
`,
|
|
368
|
+
"wiki/canonical/project-brief.md": `${(0, exports.metadata)("project-canonical", "medium", "none", "product direction, audience, scope, success criteria, or language choice changes")}
|
|
369
|
+
# Project Brief
|
|
370
|
+
|
|
371
|
+
## TL;DR
|
|
372
|
+
|
|
373
|
+
- Current state: product/service topic is not decided yet.
|
|
374
|
+
- This file is the current project-planning truth for direction, audience, scope, and success criteria.
|
|
375
|
+
- Content language: choose from user/project context and keep it consistent.
|
|
376
|
+
|
|
377
|
+
## Current State
|
|
378
|
+
|
|
379
|
+
Product/service topic is not decided yet.
|
|
380
|
+
|
|
381
|
+
## To Decide
|
|
382
|
+
|
|
383
|
+
- Problem/opportunity
|
|
384
|
+
- Target users
|
|
385
|
+
- Core user scenario
|
|
386
|
+
- Success criteria
|
|
387
|
+
- Key constraints
|
|
388
|
+
- Initial scope
|
|
389
|
+
`,
|
|
390
|
+
"wiki/canonical/open-questions.md": `${(0, exports.metadata)("project-canonical", "short", "none", "project questions are added, answered, or retired")}
|
|
391
|
+
# Open Questions
|
|
392
|
+
|
|
393
|
+
## TL;DR
|
|
394
|
+
|
|
395
|
+
- This page tracks unresolved project questions.
|
|
396
|
+
- Move answered questions into relevant canonical docs or mark them resolved.
|
|
397
|
+
|
|
398
|
+
## Product
|
|
399
|
+
|
|
400
|
+
- What problem should this project solve?
|
|
401
|
+
- Who is it for?
|
|
402
|
+
- What is the first core scenario?
|
|
403
|
+
- What counts as success?
|
|
404
|
+
|
|
405
|
+
## Operations
|
|
406
|
+
|
|
407
|
+
- None yet.
|
|
408
|
+
`,
|
|
409
|
+
"wiki/canonical/assumptions.md": `${(0, exports.metadata)("project-canonical", "short", "none", "assumptions are added, validated, or retired")}
|
|
410
|
+
# Assumptions
|
|
411
|
+
|
|
412
|
+
## TL;DR
|
|
413
|
+
|
|
414
|
+
- This page tracks temporary assumptions before they are validated.
|
|
415
|
+
- When an assumption becomes true project knowledge, move it into the relevant canonical doc.
|
|
416
|
+
|
|
417
|
+
## Active
|
|
418
|
+
|
|
419
|
+
- Product/service topic is not decided yet.
|
|
420
|
+
|
|
421
|
+
## Retired
|
|
422
|
+
|
|
423
|
+
- None.
|
|
424
|
+
`,
|
|
425
|
+
"wiki/canonical/risks.md": `${(0, exports.metadata)("project-canonical", "short", "none", "project risks are added, mitigated, or resolved")}
|
|
426
|
+
# Risks
|
|
427
|
+
|
|
428
|
+
## TL;DR
|
|
429
|
+
|
|
430
|
+
- This page tracks project-planning risks and revisit triggers.
|
|
431
|
+
- When a risk is resolved, keep the status and evidence.
|
|
432
|
+
|
|
433
|
+
## Active
|
|
434
|
+
|
|
435
|
+
| Risk | Impact | Mitigation | Revisit Trigger |
|
|
436
|
+
| --- | --- | --- | --- |
|
|
437
|
+
| None | - | - | - |
|
|
438
|
+
|
|
439
|
+
## Resolved
|
|
440
|
+
|
|
441
|
+
None.
|
|
442
|
+
`,
|
|
443
|
+
"wiki/decisions/README.md": `${(0, exports.metadata)("project-decisions", "short", "wiki/meta/decision-policy.md", "project decision structure changes")}
|
|
444
|
+
# Decisions
|
|
445
|
+
|
|
446
|
+
## TL;DR
|
|
447
|
+
|
|
448
|
+
- This directory preserves project decision history.
|
|
449
|
+
- Current valid project specs belong in \`../canonical/\`.
|
|
450
|
+
- Wiki operating decisions belong in \`../meta/\`.
|
|
451
|
+
|
|
452
|
+
This directory preserves project decision history. Current valid project specs belong in \`../canonical/\`.
|
|
453
|
+
|
|
454
|
+
Wiki operation, hook, bootstrap, lint, migration, and language-policy decisions belong in \`../meta/\`, not here.
|
|
455
|
+
`,
|
|
456
|
+
"wiki/decisions/log.md": `${(0, exports.metadata)("project-decisions", "on-demand", "wiki/meta/decision-policy.md", "trivial project decisions need timestamp tracking")}
|
|
457
|
+
# Decision Log
|
|
458
|
+
|
|
459
|
+
## TL;DR
|
|
460
|
+
|
|
461
|
+
- This page records lightweight timestamped project decisions when timing matters.
|
|
462
|
+
- No project decisions have been logged yet.
|
|
463
|
+
|
|
464
|
+
No project decisions yet.
|
|
465
|
+
`,
|
|
466
|
+
"wiki/decisions/recent.md": `${(0, exports.metadata)("project-decisions", "short", "wiki/meta/decision-policy.md", "recent important project decisions change")}
|
|
467
|
+
# Recent Decisions
|
|
468
|
+
|
|
469
|
+
## TL;DR
|
|
470
|
+
|
|
471
|
+
- Keep only recent important project decisions that may matter at session start.
|
|
472
|
+
- Use [[decisions/log]] for full timestamp tracking.
|
|
473
|
+
|
|
474
|
+
## Decisions
|
|
475
|
+
|
|
476
|
+
- None yet.
|
|
477
|
+
`,
|
|
478
|
+
"wiki/meta/wiki-ops-v1-decisions.md": `${(0, exports.metadata)("wiki-meta-decisions", "medium", "self", "wiki operation, metadata, lint, migration, language policy, or storage-boundary decisions change")}
|
|
479
|
+
# Wiki Operations v1 Decisions
|
|
480
|
+
|
|
481
|
+
## TL;DR
|
|
482
|
+
|
|
483
|
+
- This Decision Pack records accepted wiki operating choices for project-librarian.
|
|
484
|
+
- It covers wiki structure, startup hook scope, metadata, language policy, git hook behavior, migration review, and inbox handling.
|
|
485
|
+
- Project product decisions belong in \`wiki/decisions/\`, while these operating decisions stay in \`wiki/meta/\`.
|
|
486
|
+
|
|
487
|
+
Status: accepted
|
|
488
|
+
Scope: wiki operation
|
|
489
|
+
Canonical: [[meta/operating-model]], [[meta/decision-policy]]
|
|
490
|
+
|
|
491
|
+
| Date | Decision | Rationale | Rejected Alternative | Revisit Trigger | Canonical Link |
|
|
492
|
+
| --- | --- | --- | --- | --- | --- |
|
|
493
|
+
| ${workspace_1.today} | Keep the wiki root at \`./wiki\`. | Planning docs live with the project. | External docs only. | Another tool cannot read \`./wiki\` or the team needs another path. | [[meta/operating-model]] |
|
|
494
|
+
| ${workspace_1.today} | Split \`canonical/\` and \`decisions/\`. | Current truth and decision history are easier to scan when separated. | A single mixed docs directory. | The structure proves too heavy for small projects. | [[meta/decision-policy]] |
|
|
495
|
+
| ${workspace_1.today} | Inject only \`startup.md\` and \`index.md\` through Codex and Claude Code startup hooks; route detailed files Read On Demand. | Full canonical and decision bodies waste startup tokens. | Always read detailed canonical and decision files first. | Important context is repeatedly missed at startup. | [[startup]], [[index]] |
|
|
496
|
+
| ${workspace_1.today} | Use metadata headers on wiki knowledge pages. | Agents and humans can quickly judge status, scope, budget, and review triggers. | Body-only conventions. | Header maintenance costs more than it saves. | [[meta/operating-model]] |
|
|
497
|
+
| ${workspace_1.today} | Keep wiki operating docs in \`wiki/meta/\`. | Project truth stays focused on product/project content. | Store operating docs in \`canonical/\` or \`decisions/\`. | Meta docs become hard to discover. | [[meta/operating-model]] |
|
|
498
|
+
| ${workspace_1.today} | Bootstrap-generated operating documents are English by default. | Repository entry points and operating contracts are easier for public users to inspect. | Generate operating docs in a fixed non-English language. | The project intentionally targets a single-language local audience. | [[meta/operating-model]] |
|
|
499
|
+
| ${workspace_1.today} | Project canonical content language is chosen from user/project context. | User language and source material should drive project truth, not the bootstrap tool. | Hardcode Korean or English as the canonical content language. | A team requires a fixed language policy. | [[startup]], [[index]] |
|
|
500
|
+
| ${workspace_1.today} | Install git hook files but preserve existing \`core.hooksPath\` values and allow \`--no-git-config\`. | Public users may already have a hook chain such as Husky. | Always replace \`core.hooksPath\`. | Users prefer automatic setup and accept the side effect. | [[meta/operating-model]] |
|
|
501
|
+
| ${workspace_1.today} | Commit automation writes the \`Wiki-scope\` trailer. | Reviewers should see whether a commit touched startup, canonical docs, decisions, or wiki operations. | Leave wiki impact implicit in the diff. | Trailer format becomes too noisy. | [[meta/operating-model]] |
|
|
502
|
+
| ${workspace_1.today} | Migration may mark rows \`needs-human-review\`. | Ambiguous, risky, or high-impact legacy content should not be closed automatically. | Force every migrated row into adopted/rejected/resolved. | Human review queues become too large. | [[meta/operating-model]] |
|
|
503
|
+
| ${workspace_1.today} | Capture stores candidates in \`wiki/inbox/\`. | Useful ideas are not lost, but unreviewed content does not become canonical truth. | Save all conversation content directly into canonical docs. | Inbox content is frequently abandoned. | [[meta/operating-model]] |
|
|
504
|
+
`,
|
|
505
|
+
"wiki/decisions/decision-pack-template.md": `${(0, exports.metadata)("project-decision-template", "short", "wiki/meta/decision-policy.md", "decision pack format changes", "template")}
|
|
506
|
+
# <Topic> v<N> Decisions
|
|
507
|
+
|
|
508
|
+
Status: proposed | accepted | superseded
|
|
509
|
+
Scope:
|
|
510
|
+
Canonical:
|
|
511
|
+
|
|
512
|
+
| Date | Decision | Rationale | Rejected Alternative | Revisit Trigger | Canonical Link |
|
|
513
|
+
| --- | --- | --- | --- | --- | --- |
|
|
514
|
+
| YYYY-MM-DD | | | | | |
|
|
515
|
+
`,
|
|
516
|
+
"wiki/decisions/full-adr-template.md": `${(0, exports.metadata)("project-decision-template", "short", "wiki/meta/decision-policy.md", "full ADR format changes", "template")}
|
|
517
|
+
# ADR: <Title>
|
|
518
|
+
|
|
519
|
+
Status: proposed | accepted | superseded
|
|
520
|
+
Date: YYYY-MM-DD
|
|
521
|
+
Canonical:
|
|
522
|
+
|
|
523
|
+
## Context
|
|
524
|
+
|
|
525
|
+
## Decision
|
|
526
|
+
|
|
527
|
+
## Consequences
|
|
528
|
+
|
|
529
|
+
## Rejected Alternatives
|
|
530
|
+
|
|
531
|
+
## Revisit Trigger
|
|
532
|
+
`,
|
|
533
|
+
"wiki/sources/karpathy-llm-wiki.md": `${(0, exports.metadata)("source-summary", "short", "wiki/meta/wiki-ops-v1-decisions.md", "source interpretation or reference link changes")}
|
|
534
|
+
# Karpathy LLM Wiki
|
|
535
|
+
|
|
536
|
+
## TL;DR
|
|
537
|
+
|
|
538
|
+
- This pattern favors continuously maintained markdown wiki context over repeatedly reconstructing context from scratch.
|
|
539
|
+
- This project applies the pattern to project-planning source-of-truth management.
|
|
540
|
+
|
|
541
|
+
Source: [karpathy/llm-wiki.md](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
|
|
542
|
+
Checked: ${workspace_1.today}
|
|
543
|
+
|
|
544
|
+
## Applied Here
|
|
545
|
+
|
|
546
|
+
- \`wiki/startup.md\` stores compact session context.
|
|
547
|
+
- \`wiki/index.md\` routes reads and updates.
|
|
548
|
+
- \`wiki/canonical/\` stores current project truth.
|
|
549
|
+
- \`wiki/decisions/\` stores project decision history.
|
|
550
|
+
- \`wiki/meta/\` stores wiki operating rules and operating decisions.
|
|
551
|
+
`,
|
|
552
|
+
};
|
package/dist/types.js
ADDED