@hippo-digital/hippocampus 1.0.0-rc.1 → 1.0.0-rc.3

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 (50) hide show
  1. package/CHANGELOG.md +17 -3
  2. package/README.md +15 -6
  3. package/agents/README.md +32 -0
  4. package/agents/accessibility-tester.md +21 -0
  5. package/agents/ingestion-curator.md +29 -0
  6. package/agents/knowledge-builder.md +29 -0
  7. package/agents/prototype-builder.md +23 -0
  8. package/agents/screenshot-runner.md +22 -0
  9. package/agents/workflow-orchestrator.md +37 -0
  10. package/bin/hippocampus.js +2 -1
  11. package/docs/agent-roadmap.md +2 -2
  12. package/docs/design-actions-and-decisions.md +2 -2
  13. package/docs/research-source-file-conventions.md +3 -2
  14. package/instructions/knowledge-source.instructions.md +29 -0
  15. package/instructions/nhs-frontend.instructions.md +22 -0
  16. package/instructions/nhs-prototype-kit.instructions.md +30 -0
  17. package/lib/docs.js +1 -2
  18. package/lib/package-paths.js +2 -0
  19. package/lib/schema.js +1 -1
  20. package/package.json +3 -1
  21. package/scripts/import-design-actions.js +1 -1
  22. package/scripts/init.js +51 -1
  23. package/scripts/install-skills.js +84 -32
  24. package/scripts/link-insights-to-needs.js +62 -19
  25. package/scripts/smoke-routes.js +1 -1
  26. package/scripts/triage-research-corpus.js +1 -1
  27. package/scripts/validate-skills.js +45 -0
  28. package/skills/add-prototype-screen.skill.md +0 -1
  29. package/skills/add-scenario.skill.md +0 -1
  30. package/skills/add-user-needs.skill.md +0 -1
  31. package/skills/audit-knowledge-source.skill.md +0 -1
  32. package/skills/create-journey-from-scenario.skill.md +0 -1
  33. package/skills/deliver-service-slice.skill.md +0 -1
  34. package/skills/generate-service-slice.skill.md +0 -1
  35. package/skills/ingest-project-context.skill.md +0 -1
  36. package/skills/ingest-user-personas.skill.md +78 -0
  37. package/skills/map-research-to-graph.skill.md +0 -1
  38. package/skills/onboard-team-member.skill.md +109 -0
  39. package/skills/record-design-decision.skill.md +6 -2
  40. package/skills/skills.json +54 -0
  41. package/skills/structure-project-context-draft.skill.md +0 -1
  42. package/skills/write-delivery-summary.skill.md +0 -1
  43. package/templates/artefacts/README.md +23 -0
  44. package/templates/artefacts/accessibility/README.md +30 -0
  45. package/templates/artefacts/delivery-summaries/README.md +20 -0
  46. package/templates/artefacts/screenshots/README.md +30 -0
  47. package/templates/insight-design-action-tracker.xlsx +0 -0
  48. package/docs/agentic-patterns-to-port.md +0 -273
  49. package/docs/copilot-ncrs-research-curator-agent.md +0 -298
  50. package/docs/gp-connect-real-data-to-production.md +0 -66
package/CHANGELOG.md CHANGED
@@ -47,9 +47,23 @@ journeys and screens they justify, rendered as a viewer inside your prototype.
47
47
 
48
48
  ### Docs and skills
49
49
 
50
- - The 16 guides are served at `{basePath}/docs`, version-matched to the
50
+ - The 13 guides are served at `{basePath}/docs`, version-matched to the
51
51
  installed package rather than copied into your repo.
52
- - `skills install` copies the 19 agent skills into `.github/skills` with content
53
- hashes, so an upgrade can tell a stale copy from one your team has edited.
52
+ - `skills install` copies the 21 skills into `.github/skills`, the six agents
53
+ into `.github/agents` and the instructions into `.github/instructions`, with
54
+ content hashes so an upgrade can tell a stale copy from one your team has
55
+ edited. They install together because every agent's preferred skills point
56
+ into `.github/skills` and every skill names its `owners` by agent, so either
57
+ half alone is a set of dangling references. `--no-agents` installs the skills
58
+ only.
59
+ - Everything the agents and skills reference that is not a repo file is read
60
+ from the installed package, so those references are version-matched too.
61
+ - `skills validate` checks both directions between skills and agents: a skill
62
+ owned by an agent that does not exist, an agent naming a skill that is not in
63
+ the catalog, and a skill in the catalog that no agent lists - the last of
64
+ which was true of four skills, installed but invisible to the runtime.
65
+ - `init` scaffolds `artefacts/` with the READMEs carrying the naming
66
+ conventions, so the skills writing accessibility notes, screenshot review
67
+ packs and delivery summaries have somewhere to put them in a fresh host.
54
68
  - `init` reports research material in `hippocampus/source-artefacts/` rather
55
69
  than silently committing it; `--private-artefacts` gitignores it.
package/README.md CHANGED
@@ -34,11 +34,18 @@ back out and leaves every byte of your knowledge base where it is.
34
34
 
35
35
  ```bash
36
36
  npx hippocampus doctor # what is wired, what is not, and where it looked
37
- npx hippocampus skills install # copy the agent skills into .github/skills
37
+ npx hippocampus skills install # copy the skills, agents and instructions in
38
38
  ```
39
39
 
40
- `skills install` records a hash of what it wrote, so a later upgrade can tell a
41
- stale copy from one your team has edited - the edited one is left alone.
40
+ `skills install` writes three directories: `.github/skills` (the skill catalog),
41
+ `.github/agents` (role wrappers naming who runs each skill) and
42
+ `.github/instructions`. They install together because every agent's preferred
43
+ skills point into `.github/skills`, and every skill names its `owners` by agent,
44
+ so either half on its own is a set of dangling references. `--no-agents`
45
+ installs the skills alone for a host whose agent runtime is not Copilot.
46
+
47
+ It records a hash of what it wrote, so a later upgrade can tell a stale copy
48
+ from one your team has edited - the edited one is left alone and named.
42
49
 
43
50
  ## Wiring it by hand
44
51
 
@@ -119,9 +126,11 @@ describe the version you have installed. Nothing is copied into your repo -
119
126
  a copied guide goes stale within a release, and the stale one is the copy people
120
127
  read, because it is the one sitting in their editor.
121
128
 
122
- `skills install` is the deliberate exception: an agent reads skills as repo
123
- files, so those are copied, with hashes so an upgrade can tell a stale copy from
124
- one your team has edited.
129
+ `skills install` is the deliberate exception: an agent reads skills, agent
130
+ definitions and instructions as repo files, so those are copied, with hashes so
131
+ an upgrade can tell a stale copy from one your team has edited. Everything they
132
+ reference that is not a repo file is read from the installed package, so those
133
+ references cannot go stale either.
125
134
 
126
135
  ## Keeping research material out of the repo
127
136
 
@@ -0,0 +1,32 @@
1
+ # Agents
2
+
3
+ These agent definitions are Copilot-friendly role wrappers for the portable skill catalog in `.github/skills/`.
4
+
5
+ Use role agents to decide **who** should do the work. Use skill files to decide **how** the task should be run with repo docs, scripts and finish checks.
6
+
7
+ Use the source model as the handoff contract between agents.
8
+
9
+ ## Agents
10
+
11
+ - `knowledge-builder.md`
12
+ - `prototype-builder.md`
13
+ - `ingestion-curator.md`
14
+ - `screenshot-runner.md`
15
+ - `accessibility-tester.md`
16
+ - `workflow-orchestrator.md`
17
+
18
+ ## Portable skills
19
+
20
+ - See `.github/skills/README.md` for the catalog.
21
+ - See `.github/skills/skills.json` for a machine-readable index that other agent runtimes can parse.
22
+ - See `.github/skills/COVERAGE-MATRIX.md` for archived prompt to current skill mapping.
23
+
24
+ ## Common entrypoints
25
+
26
+ - End-to-end research ingestion: `.github/skills/ingest-research-round.skill.md`
27
+ - End-to-end project context ingestion: `.github/skills/ingest-project-context.skill.md`
28
+ - End-to-end service slice delivery: `.github/skills/deliver-service-slice.skill.md`
29
+ - Route review pack: `.github/skills/capture-route-review-pack.skill.md`
30
+ - Accessibility review note: `.github/skills/record-accessibility-review.skill.md`
31
+ - Route review handover: `.github/skills/write-route-review-summary.skill.md`
32
+
@@ -0,0 +1,21 @@
1
+ # accessibility-tester
2
+
3
+ Reviews accessibility of changed prototype and Hippocampus pages.
4
+
5
+ ## Responsibilities
6
+
7
+ - Check heading order, labels, link text and keyboard flow.
8
+ - Check NHS component usage.
9
+ - Store findings under `artefacts/accessibility/`.
10
+ - Separate blockers from improvements.
11
+
12
+ ## Preferred Skills
13
+
14
+ - `.github/skills/record-accessibility-review.skill.md`
15
+ - `.github/skills/write-route-review-summary.skill.md`
16
+
17
+ ## Read First
18
+
19
+ - `.github/instructions/nhs-frontend.instructions.md`
20
+ - `node_modules/@hippo-digital/hippocampus/docs/custom-agents-usage.md`
21
+ - `artefacts/accessibility/README.md`
@@ -0,0 +1,29 @@
1
+ # ingestion-curator
2
+
3
+ Improves script-generated research and project-context drafts before human review and promotion.
4
+
5
+ ## Responsibilities
6
+
7
+ - Work in `hippocampus/imports/research/` and `hippocampus/imports/project/`.
8
+ - Combine extracted draft files with source-model docs and promotion scripts.
9
+ - Keep reviewable metadata and extracted text intact.
10
+ - Run dry-run promotion checks, not direct promotion.
11
+ - Summarise changed draft fields, evidence gaps and remaining warnings.
12
+
13
+ ## Preferred Skills
14
+
15
+ - `.github/skills/ingest-project-context.skill.md`
16
+ - `.github/skills/ingest-research-round.skill.md`
17
+ - `.github/skills/structure-project-context-draft.skill.md`
18
+ - `.github/skills/structure-research-draft.skill.md`
19
+ - `.github/skills/review-research-import-draft.skill.md`
20
+ - `.github/skills/map-research-to-graph.skill.md`
21
+ - `.github/skills/ingest-user-personas.skill.md`
22
+ - `.github/skills/record-design-decision.skill.md`
23
+ - `.github/skills/triage-research-corpus.skill.md`
24
+
25
+ ## Read First
26
+
27
+ - `node_modules/@hippo-digital/hippocampus/docs/repeatable-research-round-ingestion.md`
28
+ - `.github/instructions/knowledge-source.instructions.md`
29
+
@@ -0,0 +1,29 @@
1
+ # knowledge-builder
2
+
3
+ Maintains the Hippocampus source model.
4
+
5
+ ## Responsibilities
6
+
7
+ - Edit `hippocampus/source`.
8
+ - Preserve linked source relationships.
9
+ - Add assumptions when evidence is missing.
10
+ - Run `npx hippocampus validate`.
11
+ - Summarise records changed and unresolved assumptions.
12
+
13
+ ## Preferred Skills
14
+
15
+ - `.github/skills/deliver-service-slice.skill.md`
16
+ - `.github/skills/generate-service-slice.skill.md`
17
+ - `.github/skills/add-user-needs.skill.md`
18
+ - `.github/skills/add-scenario.skill.md`
19
+ - `.github/skills/create-journey-from-scenario.skill.md`
20
+ - `.github/skills/audit-knowledge-source.skill.md`
21
+ - `.github/skills/ingest-user-personas.skill.md`
22
+ - `.github/skills/record-design-decision.skill.md`
23
+ - `.github/skills/onboard-team-member.skill.md`
24
+
25
+ ## Read First
26
+
27
+ - `node_modules/@hippo-digital/hippocampus/docs/source-model.md`
28
+ - `.github/instructions/knowledge-source.instructions.md`
29
+ - `node_modules/@hippo-digital/hippocampus/lib/schema.js`
@@ -0,0 +1,23 @@
1
+ # prototype-builder
2
+
3
+ Builds NHS Prototype Kit routes and views from the source model.
4
+
5
+ ## Responsibilities
6
+
7
+ - Edit `app/routes.js` and `app/views`.
8
+ - Use source data rather than hard-coded service facts.
9
+ - Reuse Hippocampus components where practical.
10
+ - Keep NHS UK Frontend conventions.
11
+ - Run `npx hippocampus validate` and `npx hippocampus doctor` when routes, views or screen routes change.
12
+
13
+ ## Preferred Skills
14
+
15
+ - `.github/skills/deliver-service-slice.skill.md`
16
+ - `.github/skills/add-prototype-screen.skill.md`
17
+ - `.github/skills/audit-knowledge-source.skill.md`
18
+
19
+ ## Read First
20
+
21
+ - `.github/instructions/nhs-prototype-kit.instructions.md`
22
+ - `.github/instructions/nhs-frontend.instructions.md`
23
+ - `app/routes.js`
@@ -0,0 +1,22 @@
1
+ # screenshot-runner
2
+
3
+ Captures review evidence for prototype and Hippocampus routes.
4
+
5
+ ## Responsibilities
6
+
7
+ - Start the prototype kit when needed.
8
+ - Visit changed routes.
9
+ - Capture screenshots or concise route notes.
10
+ - Store outputs under `artefacts/screenshots/<YYYY-MM-DD>-<topic>/`.
11
+ - Write a manifest describing routes captured and issues found.
12
+
13
+ ## Preferred Skills
14
+
15
+ - `.github/skills/capture-route-review-pack.skill.md`
16
+ - `.github/skills/write-route-review-summary.skill.md`
17
+
18
+ ## Read First
19
+
20
+ - `node_modules/@hippo-digital/hippocampus/docs/custom-agents-usage.md`
21
+ - `artefacts/screenshots/README.md`
22
+ - `app/routes.js`
@@ -0,0 +1,37 @@
1
+ # workflow-orchestrator
2
+
3
+ Coordinates larger Hippocampus delivery work.
4
+
5
+ ## Responsibilities
6
+
7
+ - Break work into source, prototype, validation and review steps.
8
+ - Use `knowledge-builder` before `prototype-builder` for service content.
9
+ - Use `ingestion-curator` for script-generated research and project-context drafts.
10
+ - Request screenshot and accessibility review for visible journeys.
11
+ - Store delivery summaries under `artefacts/delivery-summaries/`.
12
+
13
+ ## Preferred Skills
14
+
15
+ - `.github/skills/deliver-service-slice.skill.md`
16
+ - `.github/skills/ingest-project-context.skill.md`
17
+ - `.github/skills/ingest-research-round.skill.md`
18
+ - `.github/skills/write-delivery-summary.skill.md`
19
+ - `.github/skills/capture-route-review-pack.skill.md`
20
+ - `.github/skills/record-accessibility-review.skill.md`
21
+ - `.github/skills/write-route-review-summary.skill.md`
22
+ - `.github/skills/generate-service-slice.skill.md`
23
+ - `.github/skills/add-prototype-screen.skill.md`
24
+ - `.github/skills/structure-project-context-draft.skill.md`
25
+ - `.github/skills/structure-research-draft.skill.md`
26
+ - `.github/skills/review-research-import-draft.skill.md`
27
+ - `.github/skills/map-research-to-graph.skill.md`
28
+ - `.github/skills/audit-knowledge-source.skill.md`
29
+ - `.github/skills/triage-research-corpus.skill.md`
30
+ - `.github/skills/onboard-team-member.skill.md`
31
+
32
+ ## Required Finish
33
+
34
+ - Validation result.
35
+ - Routes or artefacts reviewed.
36
+ - Assumptions and unresolved risks.
37
+ - Suggested next action.
@@ -24,7 +24,7 @@ const COMMANDS = {
24
24
  'link insight-needs': 'link-insights-to-needs.js',
25
25
  'source index': 'index-source-artefacts.js',
26
26
  'source audit': 'audit-provenance.js',
27
- 'skills install': 'install-skills.js',
27
+ 'skills install': 'install-skills.js', // also installs agents and instructions
28
28
  'skills validate': 'validate-skills.js'
29
29
  }
30
30
 
@@ -37,6 +37,7 @@ function usage () {
37
37
  for (const name of Object.keys(COMMANDS)) console.log(` ${name}`)
38
38
  console.log('\nOptions:')
39
39
  console.log(' --root <dir> the project to act on (default: nearest project above the cwd)')
40
+ console.log(' --no-agents skills install: skills only, no agents or instructions')
40
41
  console.log(' --version print the installed version')
41
42
  console.log(' --help this message')
42
43
  console.log('\nEvery command resolves a project root the same way; run `hippocampus validate`')
@@ -206,8 +206,8 @@ The repo now has enough agent-facing documentation that overlap will become a ma
206
206
  - Do not make skills promote drafts automatically.
207
207
  - Do not treat generated artefacts as canonical source data.
208
208
  - Do not reintroduce active prompt-first workflows.
209
- - Do not port NCRS clinical content or FHIR-heavy workflows unless Hippocampus actually needs them.
210
- - Do not add a huge NHS component reference unless repeated component mistakes justify it.
209
+ - Do not port a host project's domain content or integration-heavy workflows unless Hippocampus actually needs them.
210
+ - Do not add a huge component reference unless repeated component mistakes justify it.
211
211
 
212
212
  ## Recommended Next Commits
213
213
 
@@ -29,14 +29,14 @@ along; it was only ever used for five notes about the prototype spike.
29
29
  ## Why the rejected options matter
30
30
 
31
31
  The accepted option ends up in production, where anyone can see it. The rejected
32
- ones are the ones that get asked about eighteen months later — "why didn't NCRS
32
+ ones are the ones that get asked about eighteen months later — "why didn't we
33
33
  just do the obvious thing?" — and by then the answer lives in one person's memory
34
34
  or in a meeting no one recorded. A rejected decision record with a `consequence`
35
35
  answers it.
36
36
 
37
37
  ## The workbook
38
38
 
39
- `hippocampus/templates/ncrs-insight-design-action-tracker.xlsx`, one copy per round.
39
+ `hippocampus/templates/insight-design-action-tracker.xlsx`, one copy per round.
40
40
  Three sheets that reference each other by ID:
41
41
 
42
42
  | Sheet | One row per | Key columns |
@@ -7,8 +7,9 @@ is a change to how a file is *authored or named*, not a change to the research
7
7
  itself. Each convention exists because the ingestion pipeline currently loses
8
8
  something real without it.
9
9
 
10
- The reference corpus behind this guidance is the NCRS user research drive:
11
- 599 files, 2.3 million extractable words, rounds 4 to 16.
10
+ This guidance was derived from a real user research drive of 599 files and
11
+ 2.3 million extractable words spanning thirteen rounds, so the conventions are
12
+ the ones that survived contact with a messy corpus rather than a tidy example.
12
13
 
13
14
  ## The one thing that matters most
14
15
 
@@ -0,0 +1,29 @@
1
+ ---
2
+ applyTo: "hippocampus/source/**/*.json,app/lib/hippocampus/**/*.js,scripts/validate-knowledge.js,docs/source-model.md"
3
+ ---
4
+
5
+ # Knowledge Source Instructions
6
+
7
+ The Hippocampus knowledge base is source-model first. JSON records in `hippocampus/source` drive the visible artefacts and prototype traceability.
8
+
9
+ ## Editing Rules
10
+
11
+ - Read `docs/source-model.md` before editing records.
12
+ - Use structured JSON edits. Do not rely on fragile string manipulation.
13
+ - Keep IDs lowercase kebab-case.
14
+ - Preserve IDs unless a rename is explicitly requested.
15
+ - Keep arrays ordered for human review: project context first, then journey/user-facing order.
16
+ - Add assumptions instead of unsupported evidence claims.
17
+ - Use fictional and synthetic content only.
18
+
19
+ ## Required Checks
20
+
21
+ Run:
22
+
23
+ ```bash
24
+ npm run validate:knowledge
25
+ ```
26
+
27
+ Validation must pass before the work is considered done.
28
+
29
+ If validation fails, fix the source relationships or schema issue before changing views.
@@ -0,0 +1,22 @@
1
+ ---
2
+ applyTo: "app/views/**/*.html,app/views/**/*.njk,app/assets/sass/**/*.scss"
3
+ ---
4
+
5
+ # NHS Frontend Instructions
6
+
7
+ Use NHS UK Frontend conventions.
8
+
9
+ ## Interface Rules
10
+
11
+ - Use NHS component classes before custom styling.
12
+ - Keep headings hierarchical and page-specific.
13
+ - Use summary lists, cards, tables and tags only when they improve scanning.
14
+ - Use clear link text that makes sense out of context.
15
+ - Keep prototype screens accessible and keyboard-friendly.
16
+ - Avoid decorative UI that does not help the service-design task.
17
+
18
+ ## Content Rules
19
+
20
+ - Write plain, task-focused NHS-style content.
21
+ - Keep clinical and service details synthetic unless explicitly provided as approved source material.
22
+ - Avoid overclaiming certainty. Represent unknowns as assumptions or risks.
@@ -0,0 +1,30 @@
1
+ ---
2
+ applyTo: "app/routes.js,app/views/**/*.html,app/views/**/*.njk,app/config.js"
3
+ ---
4
+
5
+ # NHS Prototype Kit Instructions
6
+
7
+ Use the existing NHS Prototype Kit structure.
8
+
9
+ ## Routes
10
+
11
+ - Keep route handlers in `app/routes.js` concise.
12
+ - Load knowledge through `app/lib/hippocampus/load-knowledge.js`.
13
+ - Return useful not-found states instead of crashing on missing IDs.
14
+
15
+ ## Views
16
+
17
+ - Use Nunjucks and NHS UK Frontend classes.
18
+ - Reuse components from `app/views/hippocampus/components` when patterns repeat.
19
+ - Keep page content driven by source data wherever possible.
20
+ - Do not put service facts only in Nunjucks if they belong in `hippocampus/source`.
21
+
22
+ ## Checks
23
+
24
+ After route or view changes, run:
25
+
26
+ ```bash
27
+ npm run validate:knowledge
28
+ ```
29
+
30
+ When practical, start the kit and smoke-test affected routes.
package/lib/docs.js CHANGED
@@ -15,8 +15,7 @@ const packagePaths = require('./package-paths')
15
15
  // a stale copy from an edited one.
16
16
 
17
17
  const TITLE_OVERRIDES = {
18
- 'hippocampus-for-designers-and-researchers': 'Hippocampus for designers and researchers',
19
- 'gp-connect-real-data-to-production': 'GP Connect: real data to production'
18
+ 'hippocampus-for-designers-and-researchers': 'Hippocampus for designers and researchers'
20
19
  }
21
20
 
22
21
  function slugOf (filename) {
@@ -28,5 +28,7 @@ module.exports = {
28
28
  scriptsDir: path.join(packageRoot, 'scripts'),
29
29
  templatesDir: path.join(packageRoot, 'templates'),
30
30
  skillsDir: path.join(packageRoot, 'skills'),
31
+ agentsDir: path.join(packageRoot, 'agents'),
32
+ instructionsDir: path.join(packageRoot, 'instructions'),
31
33
  docsDir: path.join(packageRoot, 'docs')
32
34
  }
package/lib/schema.js CHANGED
@@ -172,7 +172,7 @@ const ScreenSchema = z.object({
172
172
  purpose: nonEmptyString,
173
173
  needIds: z.array(id).min(1),
174
174
  components: stringList,
175
- // A screen in the real NCRS prototype rather than in this viewer. The
175
+ // A screen in the host project rather than in this viewer. The
176
176
  // knowledge base models the service, not only the screens this repo happens
177
177
  // to render, so the route smoke test skips these instead of failing on them.
178
178
  external: z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hippo-digital/hippocampus",
3
- "version": "1.0.0-rc.1",
3
+ "version": "1.0.0-rc.3",
4
4
  "description": "A design-knowledge base for NHS Prototype Kit projects: research, insights, needs, journeys and screens, traceable end to end.",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -15,6 +15,8 @@
15
15
  "assets",
16
16
  "scripts",
17
17
  "skills",
18
+ "agents",
19
+ "instructions",
18
20
  "templates",
19
21
  "docs",
20
22
  "README.md",
@@ -179,7 +179,7 @@ function main () {
179
179
 
180
180
  function rows (workbook, sheetName) {
181
181
  if (!workbook.sheetFiles.has(sheetName)) {
182
- throw new Error(`The workbook has no "${sheetName}" sheet. It has: ${[...workbook.sheetFiles.keys()].join(', ')}. Start from hippocampus/templates/ncrs-insight-design-action-tracker.xlsx.`)
182
+ throw new Error(`The workbook has no "${sheetName}" sheet. It has: ${[...workbook.sheetFiles.keys()].join(', ')}. Start from the blank tracker that ships with the package: node_modules/@hippo-digital/hippocampus/templates/insight-design-action-tracker.xlsx`)
183
183
  }
184
184
  const grid = readSheetGrid(workbook, sheetName)
185
185
  const header = grid.find((r) => r && r.some(Boolean)) || []
package/scripts/init.js CHANGED
@@ -4,6 +4,7 @@ const path = require('path')
4
4
  const { resolveRoot, CONFIG_FILENAME } = require('../lib/resolve-root')
5
5
  const { CURRENT_SCHEMA_VERSION } = require('../lib/schema-version')
6
6
  const hostEdit = require('../lib/host-edit')
7
+ const packagePaths = require('../lib/package-paths')
7
8
 
8
9
  // Set a host project up to use Hippocampus: write the config and an empty
9
10
  // knowledge base, then make the two host edits - both inside marked blocks, both
@@ -37,6 +38,7 @@ function main () {
37
38
 
38
39
  planConfig(root)
39
40
  planKnowledgeBase(root)
41
+ planArtefacts(root, artefactsDir(root))
40
42
  planArtefactGovernance(root)
41
43
  if (!noWire) {
42
44
  planHostEdit(path.join(root, 'app/routes.js'), wireRoutes)
@@ -75,6 +77,54 @@ function planConfig (root) {
75
77
  }, null, 2) + '\n'))
76
78
  }
77
79
 
80
+ // Several skills write into `artefacts/` - accessibility notes, screenshot
81
+ // review packs, delivery summaries - and two agents name the READMEs there as
82
+ // required reading. A fresh host had none of it, so those skills had nowhere to
83
+ // put their output and the agents pointed at files that did not exist. The
84
+ // READMEs carry the naming conventions, which is the part that stops every
85
+ // project inventing its own.
86
+ //
87
+ // Each file is written only when absent: these are the host's to edit.
88
+ // The host may have renamed it in the config; honour that rather than assuming.
89
+ function artefactsDir (root) {
90
+ const configPath = path.join(root, CONFIG_FILENAME)
91
+ if (!fs.existsSync(configPath)) return 'artefacts'
92
+ try {
93
+ return JSON.parse(fs.readFileSync(configPath, 'utf8')).artefactsDir || 'artefacts'
94
+ } catch {
95
+ return 'artefacts'
96
+ }
97
+ }
98
+
99
+ function planArtefacts (root, artefactsDir) {
100
+ const from = path.join(packagePaths.templatesDir, 'artefacts')
101
+ const to = path.join(root, artefactsDir)
102
+ const missing = []
103
+
104
+ for (const rel of listTemplateFiles(from)) {
105
+ if (!fs.existsSync(path.join(to, rel))) missing.push(rel)
106
+ }
107
+ if (!missing.length) return
108
+
109
+ plan(`${artefactsDir}/ and ${missing.length} README${missing.length === 1 ? '' : 's'}`, () => {
110
+ for (const rel of missing) {
111
+ const target = path.join(to, rel)
112
+ fs.mkdirSync(path.dirname(target), { recursive: true })
113
+ fs.copyFileSync(path.join(from, rel), target)
114
+ }
115
+ })
116
+ }
117
+
118
+ function listTemplateFiles (dir, prefix = '') {
119
+ const found = []
120
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
121
+ const rel = prefix ? path.posix.join(prefix, entry.name) : entry.name
122
+ if (entry.isDirectory()) found.push(...listTemplateFiles(path.join(dir, entry.name), rel))
123
+ else found.push(rel)
124
+ }
125
+ return found
126
+ }
127
+
78
128
  function planKnowledgeBase (root) {
79
129
  const sourceDir = path.join(root, 'hippocampus/source')
80
130
  const projectPath = path.join(sourceDir, 'project.json')
@@ -87,7 +137,7 @@ function planKnowledgeBase (root) {
87
137
  const id = kebab(dirName) || 'prototype'
88
138
  const name = dirName
89
139
  plan('hippocampus/source/project.json and an empty knowledge base', () => {
90
- for (const dir of ['source', 'inbox/project', 'inbox/research', 'imports/project', 'imports/research', 'manifests']) {
140
+ for (const dir of ['source', 'inbox/personas', 'inbox/project', 'inbox/research', 'imports/project', 'imports/research', 'manifests']) {
91
141
  fs.mkdirSync(path.join(root, 'hippocampus', dir), { recursive: true })
92
142
  }
93
143
  fs.writeFileSync(projectPath, JSON.stringify({