chapterhouse 0.3.16 → 0.3.17

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.
@@ -222,6 +222,8 @@ You are an agent within Chapterhouse, a team-level AI assistant for engineering
222
222
  ### Shared Wiki
223
223
  All agents share a wiki knowledge base for persistent memory. Use \`wiki_read\` and \`wiki_search\` to find existing knowledge, and \`wiki_update\` to save important findings.
224
224
 
225
+ Invoke \`wiki-conventions\` before wiki writes or restructuring work. Treat \`wiki_update\`, \`remember\`, \`forget\`, \`wiki_ingest\`, \`wiki_lint\`, and \`wiki_rebuild_index\` as write-sensitive workflows. Before using them, read \`pages/index.md\`, scan the last 20-30 entries of \`pages/_meta/log.md\`, and run \`wiki_search\` for the topic when the wiki is large or the topic is ambiguous.
226
+
225
227
  ### Communication
226
228
  - You receive tasks from @chapterhouse (the orchestrator) or directly from the user
227
229
  - Your results are relayed back to the user by @chapterhouse
@@ -0,0 +1,22 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { composeAgentSystemMessage, } from "./agents.js";
4
+ function makeAgent(slug) {
5
+ return {
6
+ slug,
7
+ name: slug,
8
+ description: `${slug} test agent`,
9
+ model: "claude-sonnet-4.6",
10
+ systemMessage: `You are ${slug}.`,
11
+ };
12
+ }
13
+ test("composeAgentSystemMessage steers wiki-capable agents to wiki-conventions", () => {
14
+ for (const slug of ["coder", "general-purpose"]) {
15
+ const message = composeAgentSystemMessage(makeAgent(slug));
16
+ assert.match(message, /invoke `wiki-conventions` before wiki writes/i);
17
+ assert.match(message, /wiki_update[\s\S]{0,80}remember[\s\S]{0,80}forget[\s\S]{0,80}wiki_ingest[\s\S]{0,80}wiki_lint[\s\S]{0,80}wiki_rebuild_index/i);
18
+ assert.match(message, /read `pages\/index\.md`/i);
19
+ assert.match(message, /scan the last 20-30 entries of `pages\/_meta\/log\.md`/i);
20
+ }
21
+ });
22
+ //# sourceMappingURL=agents.test.js.map
@@ -0,0 +1,10 @@
1
+ import assert from "node:assert/strict";
2
+ import test from "node:test";
3
+ import { listSkills } from "./skills.js";
4
+ test("listSkills includes bundled wiki-conventions skill metadata", () => {
5
+ const skill = listSkills().find((entry) => entry.slug === "wiki-conventions" && entry.source === "bundled");
6
+ assert.ok(skill);
7
+ assert.equal(skill.name, "wiki-conventions");
8
+ assert.match(skill.description, /creating, editing, linting, restructuring, or reviewing Chapterhouse wiki content/i);
9
+ });
10
+ //# sourceMappingURL=skills.test.js.map
@@ -122,6 +122,8 @@ You can delegate **multiple tasks simultaneously**. Different agents can work in
122
122
  - With \`remember\`, pass \`entity\` for entity categories (and \`facet\` to target a sub-page). With \`wiki_update\`, give the full canonical path — bad paths are rejected with a suggested correction; just retry with the suggestion.
123
123
  - If the structure ever looks wrong, call \`wiki_rebuild_index\` to regenerate the index from disk.
124
124
 
125
+ **Wiki writes and restructuring**: Before writing or restructuring wiki content, invoke the \`wiki-conventions\` skill. Treat \`wiki_update\`, \`remember\`, \`forget\`, \`wiki_ingest\`, \`wiki_lint\`, and \`wiki_rebuild_index\` as write-sensitive workflows. Before using them, read \`pages/index.md\`, scan the last 20-30 entries of \`pages/_meta/log.md\`, and run \`wiki_search\` for the topic when the wiki is large or the topic is ambiguous.
126
+
125
127
  **Learning workflow**: When the user asks you to do something you don't have a skill for:
126
128
  1. **Search skills.sh first**: Use the find-skills skill to search for existing community skills.
127
129
  2. **Present what you found**: Tell the user the skill name, what it does, and its security status.
@@ -22,4 +22,15 @@ test("orchestrator prompt omits version banner when version is not provided", ()
22
22
  const message = getOrchestratorSystemMessage();
23
23
  assert.doesNotMatch(message, /chapterhouse v\d/);
24
24
  });
25
+ test("orchestrator prompt requires wiki-conventions before write-sensitive wiki work", () => {
26
+ const message = getOrchestratorSystemMessage();
27
+ assert.match(message, /wiki-conventions[\s\S]{0,500}wiki_update[\s\S]{0,200}remember[\s\S]{0,200}forget[\s\S]{0,200}wiki_ingest[\s\S]{0,200}wiki_lint[\s\S]{0,200}wiki_rebuild_index/i);
28
+ assert.match(message, /before writing or restructuring wiki content/i);
29
+ });
30
+ test("orchestrator prompt describes the wiki orientation ritual", () => {
31
+ const message = getOrchestratorSystemMessage();
32
+ assert.match(message, /read `pages\/index\.md`/i);
33
+ assert.match(message, /scan the last 20-30 entries of `pages\/_meta\/log\.md`/i);
34
+ assert.match(message, /run `wiki_search` for the topic/i);
35
+ });
25
36
  //# sourceMappingURL=system-message.test.js.map
@@ -27,6 +27,9 @@ export const EXEMPT_PREFIXES = [
27
27
  "pages/kpis/",
28
28
  "pages/shared/",
29
29
  ];
30
+ export const EXEMPT_PAGES = [
31
+ "pages/index.md",
32
+ ];
30
33
  /** Map a `remember`-style category name to its directory under pages/. */
31
34
  const CATEGORY_DIR_MAP = {
32
35
  person: "people",
@@ -65,7 +68,8 @@ function isFlatCategory(dir) {
65
68
  return FLAT_CATEGORIES.includes(dir);
66
69
  }
67
70
  function isExemptPath(relativePath) {
68
- return EXEMPT_PREFIXES.some((p) => relativePath.startsWith(p));
71
+ return EXEMPT_PAGES.includes(relativePath)
72
+ || EXEMPT_PREFIXES.some((p) => relativePath.startsWith(p));
69
73
  }
70
74
  /** Slugify a free-text name into a wiki-safe path segment. */
71
75
  export function slugify(name) {
@@ -25,6 +25,7 @@ test("topicPagePath builds canonical paths", () => {
25
25
  assert.equal(topicPagePath("tool", "Kubernetes"), "pages/tools/kubernetes/index.md");
26
26
  });
27
27
  test("validateTopicPath accepts canonical and exempt paths", () => {
28
+ assert.deepEqual(validateTopicPath("pages/index.md"), { ok: true });
28
29
  assert.deepEqual(validateTopicPath("pages/projects/chapterhouse/index.md"), { ok: true });
29
30
  assert.deepEqual(validateTopicPath("pages/projects/chapterhouse/decisions.md"), { ok: true });
30
31
  assert.deepEqual(validateTopicPath("pages/people/brian/index.md"), { ok: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chapterhouse",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "Chapterhouse — a team-level AI assistant for engineering teams, built on the GitHub Copilot SDK. Web UI only.",
5
5
  "bin": {
6
6
  "chapterhouse": "dist/cli.js"
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: wiki-conventions
3
+ description: Use when creating, editing, linting, restructuring, or reviewing Chapterhouse wiki content.
4
+ when_to_load: Wiki tools, remember/forget workflows, or direct edits under the Chapterhouse wiki.
5
+ related_skills:
6
+ - squad
7
+ ---
8
+
9
+ # Wiki Conventions
10
+
11
+ Use this skill before creating, editing, linting, restructuring, archiving, or reviewing Chapterhouse wiki content.
12
+
13
+ ## Orientation Ritual — Mandatory Before Any Wiki Write
14
+
15
+ Perform this checklist before using `wiki_update`, `remember`, `forget`, `wiki_ingest`, `wiki_lint`, or `wiki_rebuild_index`:
16
+
17
+ 1. Read `pages/index.md` with `wiki_read`.
18
+ 2. Scan the last 20-30 entries of `pages/_meta/log.md` to see recent edits, archives, and reorganizations.
19
+ 3. If the wiki is large, the topic is ambiguous, or you might be creating a page, run `wiki_search` for the topic first.
20
+
21
+ Do not skip the ritual because the task feels small. The point is to avoid duplicate pages, category mistakes, stale contradictions, and taxonomy drift.
22
+
23
+ ## Wiki Structure Recap
24
+
25
+ - **Entity categories** live at `pages/<category>/<topic>/index.md` with optional facet pages beside the overview.
26
+ - **Flat categories** live in a single page such as `pages/preferences.md`, `pages/facts.md`, or `pages/routines.md`.
27
+ - **Decisions** always belong to an entity and should land in `pages/<entity-category>/<topic>/decisions.md`.
28
+
29
+ ## Naming Conventions
30
+
31
+ - Use lowercase only.
32
+ - Use kebab-case slugs.
33
+ - Do not put dates in slugs.
34
+ - Keep facet names predictable and durable, such as `decisions`, `feature-ideas`, or `architecture`.
35
+ - If a name feels ad hoc, it probably belongs as a section on an existing page instead of a new facet.
36
+
37
+ ## `index.md` vs Facet Pages
38
+
39
+ - Use `index.md` for the durable overview of a topic, entity, or area.
40
+ - Use a facet page only when the subtopic has ongoing value and a stable identity.
41
+ - Do not create a facet page as random overflow for a page that merely feels long today.
42
+ - If a page is growing because it contains several durable subtopics, split those into facets and keep `index.md` as the orientation page.
43
+
44
+ ## Page Creation Thresholds
45
+
46
+ - Create a new page when a topic appears in two or more distinct sources or interactions.
47
+ - Create a new page when the topic is central to one major source, even if it is only one source so far.
48
+ - Add to an existing page when coverage already exists.
49
+ - Do not create a page for a passing mention, transient detail, or one-off aside.
50
+ - Split pages once they approach roughly 300 lines.
51
+ - Archive fully superseded pages into `pages/_archive/` and remove them from the active index rather than letting stale content linger in place.
52
+
53
+ ## Decision Recording Protocol
54
+
55
+ - With `remember`, use `category: "decision"` plus both `about` and `entity`.
56
+ - Record the decision against the actual entity that owns it.
57
+ - Keep decision facets canonical; prefer `decisions.md` over inventing one-off decision page names.
58
+
59
+ ## Cross-Reference Standards
60
+
61
+ - Prefer wiki-relative paths over raw URLs when a wiki page exists.
62
+ - Avoid raw local absolute paths in the body when a canonical wiki page can be linked instead.
63
+ - Add reciprocal links when the relationship is durable enough that future readers should discover it from either side.
64
+
65
+ ## Tag Usage
66
+
67
+ - Treat the merged taxonomy as the source of truth: code-defined defaults plus optional `pages/_meta/taxonomy.md` extensions.
68
+ - Read `pages/_meta/taxonomy.md` before inventing a new tag.
69
+ - If a new durable tag is needed, extend `pages/_meta/taxonomy.md` first instead of inventing the tag inline on a page.
70
+
71
+ ## Contradiction Update Policy
72
+
73
+ When two sources disagree:
74
+
75
+ 1. Compare dates first.
76
+ 2. If the conflict is real, preserve both claims instead of collapsing them into one "truth".
77
+ 3. Keep dates, sources, or citations in the page body so the disagreement is auditable.
78
+ 4. Add reciprocal `contradictions:` frontmatter references.
79
+ 5. Set `contested: true` while the issue remains unresolved.
80
+ 6. Use `confidence` to describe certainty; do not smooth over disagreement with vague prose.
81
+
82
+ ## Tone
83
+
84
+ - Be terse.
85
+ - Be factual.
86
+ - Be dated when the timing matters.
87
+ - Avoid speculative voice such as "I think" unless the uncertainty itself is the fact being recorded.
88
+ - Prefer explicit source attribution over implied certainty.
89
+
90
+ ## Frontmatter Shape
91
+
92
+ Required fields:
93
+
94
+ ```yaml
95
+ ---
96
+ title: Chapterhouse
97
+ summary: Team-level AI assistant for engineering teams.
98
+ ---
99
+ ```
100
+
101
+ Recommended fields for most durable pages:
102
+
103
+ ```yaml
104
+ ---
105
+ title: Chapterhouse
106
+ summary: Team-level AI assistant for engineering teams.
107
+ updated: 2026-05-12
108
+ tags: [engineering, orchestration]
109
+ related: [pages/projects/chapterhouse/decisions.md]
110
+ ---
111
+ ```
112
+
113
+ Use contradiction-supporting fields when needed:
114
+
115
+ ```yaml
116
+ ---
117
+ title: Chapterhouse
118
+ summary: Coordination notes about the runtime architecture.
119
+ updated: 2026-05-12
120
+ tags: [engineering, architecture]
121
+ related: [pages/projects/chapterhouse/index.md]
122
+ confidence: low
123
+ contested: true
124
+ contradictions: [pages/projects/chapterhouse/decisions.md]
125
+ ---
126
+ ```
127
+
128
+ Use `autostub: true` only for genuine stubs that are intentionally thin and expected to grow later.
129
+
130
+ ## Common Mistakes
131
+
132
+ - **Wrong category:** move the content to the correct entity or flat page instead of stretching the path rules.
133
+ - **Page created too early:** merge it into an existing page or section until the topic earns a standalone page.
134
+ - **Invented tag:** update `pages/_meta/taxonomy.md` first.
135
+ - **Skipped orientation ritual:** stop, orient, then retry.
136
+ - **Collapsed contradiction:** preserve both claims, date them, and mark the relationship explicitly.
137
+
138
+ ## Routing Guide — "I want to record X. Where does it go?"
139
+
140
+ - A durable fact about a named project, tool, person, org, topic, or area -> `pages/<category>/<slug>/index.md`
141
+ - A durable subtopic of an existing entity -> `pages/<category>/<slug>/<facet>.md`
142
+ - A decision about an entity -> `remember` with `category: "decision"`, `about`, and `entity`, or write to that entity's `decisions.md`
143
+ - A user preference or routine -> the corresponding flat category page
144
+ - Source material you want preserved before synthesis -> `wiki_ingest`
145
+ - A passing mention with no durable value yet -> do not create a new page; add it to existing context or leave it out