@panaversity/ksor 0.0.1 → 0.0.2

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +24 -6
  3. package/dist/cli.mjs +344 -2
  4. package/docs/index.md +34 -6
  5. package/package.json +3 -1
  6. package/templates/LICENSE +23 -0
  7. package/templates/scaffold/.agents/skills/add-sources/SKILL.md +43 -0
  8. package/templates/scaffold/.agents/skills/format-checker/SKILL.md +39 -0
  9. package/templates/scaffold/.agents/skills/format-checker/check.mjs +782 -0
  10. package/templates/scaffold/.agents/skills/intake-interview/SKILL.md +46 -0
  11. package/templates/scaffold/.claude/skills/add-sources/SKILL.md +43 -0
  12. package/templates/scaffold/.claude/skills/format-checker/SKILL.md +39 -0
  13. package/templates/scaffold/.claude/skills/format-checker/check.mjs +782 -0
  14. package/templates/scaffold/.claude/skills/intake-interview/SKILL.md +46 -0
  15. package/templates/scaffold/.gemini/settings.json +5 -0
  16. package/templates/scaffold/.gitattributes +5 -0
  17. package/templates/scaffold/.github/workflows/validate.yml +23 -0
  18. package/templates/scaffold/AGENTS.md +104 -0
  19. package/templates/scaffold/CLAUDE.md +1 -0
  20. package/templates/scaffold/README.md +63 -0
  21. package/templates/scaffold/gitignore +13 -0
  22. package/templates/scaffold/instance.md +26 -0
  23. package/templates/scaffold/knowledge/example.md +23 -0
  24. package/templates/scaffold/package.json +15 -0
  25. package/templates/scaffold/pnpm-lock.yaml +4041 -0
  26. package/templates/scaffold/pnpm-workspace.yaml +19 -0
  27. package/templates/scaffold/system/site/app/(home)/layout.tsx +6 -0
  28. package/templates/scaffold/system/site/app/(home)/page.tsx +83 -0
  29. package/templates/scaffold/system/site/app/api/search/route.ts +11 -0
  30. package/templates/scaffold/system/site/app/docs/[[...slug]]/page.tsx +53 -0
  31. package/templates/scaffold/system/site/app/docs/layout.tsx +24 -0
  32. package/templates/scaffold/system/site/app/global.css +26 -0
  33. package/templates/scaffold/system/site/app/icon.png +0 -0
  34. package/templates/scaffold/system/site/app/layout.tsx +41 -0
  35. package/templates/scaffold/system/site/app/llms-full.txt/route.ts +10 -0
  36. package/templates/scaffold/system/site/app/llms.txt/route.ts +15 -0
  37. package/templates/scaffold/system/site/components/built-with.tsx +18 -0
  38. package/templates/scaffold/system/site/components/mdx.tsx +15 -0
  39. package/templates/scaffold/system/site/lib/layout.shared.tsx +17 -0
  40. package/templates/scaffold/system/site/lib/shared.ts +51 -0
  41. package/templates/scaffold/system/site/lib/source.ts +119 -0
  42. package/templates/scaffold/system/site/next-env.d.ts +6 -0
  43. package/templates/scaffold/system/site/next.config.mjs +32 -0
  44. package/templates/scaffold/system/site/package.json +29 -0
  45. package/templates/scaffold/system/site/postcss.config.mjs +7 -0
  46. package/templates/scaffold/system/site/source.config.ts +35 -0
  47. package/templates/scaffold/system/site/tsconfig.json +35 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: intake-interview
3
+ description: The first conversation with the owner of this Knowledge System of Record — five questions that define what it is authoritative for, then write instance.md together. Use when the owner asks to set up, configure, or "get started with" this project, when instance.md still contains its scaffold placeholder text, or when the scope of the corpus is unclear.
4
+ metadata:
5
+ version: "1.1.0"
6
+ ---
7
+
8
+ # Intake interview
9
+
10
+ `instance.md` is the identity of this Knowledge System of Record, and its
11
+ prose will one day be the agent surface's system prompt. Do not draft it from
12
+ guesses — interview the owner, one question at a time, and write down what
13
+ they actually say.
14
+
15
+ ## The five questions
16
+
17
+ Ask these one at a time; follow up until each answer is concrete enough to
18
+ act on:
19
+
20
+ 1. **Authority** — "What should this record be the _final word_ on? Finish
21
+ the sentence: when someone here disagrees with this corpus, the corpus
22
+ wins about ___."
23
+ 2. **Boundary** — "What is explicitly _outside_ it — near-miss topics people
24
+ will ask about that this record should refuse rather than guess at?"
25
+ 3. **Audience** — "Who reads it — people, agents, both? In what situations,
26
+ making what decisions?"
27
+ 4. **Sources** — "Which existing materials are authoritative inputs (name
28
+ the actual documents, systems, people), and which are explicitly _not_
29
+ trusted?"
30
+ 5. **Strictness** — "When the record doesn't cover a question, how firmly
31
+ should it decline? ('Not in this corpus' is a correct answer here —
32
+ confirm the owner wants that behavior and where they want it softened.)"
33
+
34
+ ## Then write
35
+
36
+ - Rewrite `instance.md`'s body from the answers: first the `# H1` — the
37
+ record's **display title**, the human name every page will lead with
38
+ ("Acme Operations Handbook", not the slug) — then the authority sentence,
39
+ boundary, audience, and strictness — plain prose, written for a reader
40
+ who must act on it. Do not touch the frontmatter keys.
41
+ - Restart `pnpm dev` afterwards so the site picks the new title up, and
42
+ show the owner their name on the page.
43
+ - Offer to capture the source list from question 4 as the first real
44
+ documents (the add-sources skill takes it from there).
45
+ - Read the result back to the owner and get an explicit yes before
46
+ finishing. Their words, tightened — never your invention.
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: add-sources
3
+ description: Turn source material — documents, pages, pasted text, notes — into governed knowledge in knowledge/. Use when the owner shares material to add, says "add this to the knowledge base", or asks how to get existing content in. Not for editing the site.
4
+ metadata:
5
+ version: "1.1.0"
6
+ ---
7
+
8
+ # Add sources
9
+
10
+ Converting material into the record is the everyday work of this project.
11
+ The rules that make it _governed_ rather than merely stored:
12
+
13
+ ## Placement and shape
14
+
15
+ - One document per topic, under `knowledge/`, path = identity: lowercase,
16
+ hyphens, a folder per natural grouping. Plain CommonMark `.md` — if the
17
+ source is rich (tables, images), tables become markdown tables and images
18
+ land _beside the document_ with relative links.
19
+ - A folder's front page is `<folder>/index.md`; reading order is the
20
+ `order:` frontmatter key (ordered documents first, ascending; the rest
21
+ follow alphabetically) — never `meta.json` or `sidebar_position`.
22
+ - Frontmatter: `title` and `status: draft` always; add `owner` (who stands
23
+ behind this content) and `provenance` (a list naming the actual sources —
24
+ file names, systems, people, dates) whenever the owner can tell you.
25
+ Precision matters: "Finance policy manual §4.2, 2025 edition" governs;
26
+ "internal docs" does not.
27
+
28
+ ## Fidelity rules
29
+
30
+ - **Copy load-bearing values exactly** — numbers, thresholds, dates, names.
31
+ Never round, never paraphrase a figure.
32
+ - **Two disagreeing sources stay two statements**, each with its provenance
33
+ — never smooth a conflict into one invented truth; flag it to the owner.
34
+ - **Do not fill gaps from general knowledge.** If the source doesn't cover
35
+ something, the record doesn't either — that boundary is the product.
36
+ - A document replacing an older one: mark the old one `status: superseded`
37
+ with `superseded_by:` pointing at the new — never delete it.
38
+
39
+ ## Finish every batch
40
+
41
+ Run `pnpm check` and fix what it reports (its errors explain themselves),
42
+ then show the owner the rendered result (`pnpm dev`) — the site is the
43
+ review surface: you write, they check.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: format-checker
3
+ description: The record's format rules as a runnable check — frontmatter, filenames, links, structure. Use before handing off any change to knowledge/, when a check fails and you need to fix it, or when unsure whether a document is well-formed. Run with `pnpm check` (or node .agents/skills/format-checker/check.mjs).
4
+ metadata:
5
+ version: "1.1.0"
6
+ ---
7
+
8
+ # Format checker
9
+
10
+ `pnpm check` runs `check.mjs` — dependency-free Node, owned by this repo. It
11
+ enforces what AGENTS.md states in prose:
12
+
13
+ - `knowledge/` holds CommonMark `.md` and images only — no `.mdx`, no
14
+ `meta.json`, no other file types — and it is never empty; a record with no
15
+ documents stands behind nothing.
16
+ - Every document carries `title` + `status` (level-0 requirement); the full
17
+ allowed key set is closed; a `superseded` document names a `superseded_by`
18
+ that resolves to a document that exists.
19
+ - Filenames are portable identities: lowercase, Windows-safe, no spaces, no
20
+ case-collisions, no `foo.md` + `foo/index.md` pairs, no parentheses.
21
+ (`.DS_Store` and friends are skipped, never reported.)
22
+ - Relative links resolve and never leave `knowledge/` — inline,
23
+ `<angle-bracketed>`, and reference-style (`[text][label]` with its
24
+ `[label]: target` definition) alike. Links inside code spans and fenced
25
+ blocks are code, not links, and are ignored.
26
+ - `instance.md` exists, is `format: 1`, and carries only the keys the format
27
+ defines — an unknown key is named, never ignored.
28
+ - `CLAUDE.md` stays a one-line pointer; `.agents/skills/` and
29
+ `.claude/skills/` hold the same files byte for byte **in both directions**
30
+ (a file only one tree carries is a rule nobody reviewed); the site contains
31
+ no content files.
32
+
33
+ Every failure prints what is wrong, why the rule exists, and the fix — obey
34
+ the printed fix literally; if it doesn't resolve the problem, that is a bug
35
+ worth reporting to ksor.
36
+
37
+ When you edit any skill under `.agents/skills/`, re-copy it to
38
+ `.claude/skills/` — the checker holds the two trees identical, and it now
39
+ notices a file added on either side.