@hippo-digital/hippocampus 2.7.1 → 2.8.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +5 -4
  3. package/agents/knowledge-builder.md +2 -0
  4. package/agents/workflow-orchestrator.md +2 -0
  5. package/assets/dist/hippocampus.css +1 -1
  6. package/assets/hippocampus.scss +124 -0
  7. package/bin/hippocampus.js +1 -0
  8. package/docs/add-project-context.md +8 -2
  9. package/docs/ask-whats-already-known.md +6 -2
  10. package/docs/check-for-unintended-consequences.md +7 -2
  11. package/docs/data-and-governance.md +6 -2
  12. package/docs/describe-the-context-of-use.md +134 -0
  13. package/docs/design-actions-and-decisions.md +8 -3
  14. package/docs/hippocampus-for-designers-and-researchers.md +98 -220
  15. package/docs/hippocampus-technical.md +16 -0
  16. package/docs/human-centred-design.md +165 -0
  17. package/docs/import-a-research-round.md +9 -2
  18. package/docs/link-insights-to-needs.md +6 -2
  19. package/docs/record-a-usability-test.md +118 -0
  20. package/docs/record-design-principles.md +76 -0
  21. package/docs/research-knowledge-graph.md +25 -6
  22. package/docs/review-and-promote-a-draft.md +7 -2
  23. package/docs/set-quality-objectives.md +87 -0
  24. package/docs/source-model.md +104 -23
  25. package/docs/start-here.md +52 -34
  26. package/docs/turn-personas-into-users-and-needs.md +9 -2
  27. package/docs/weigh-options-against-requirements.md +96 -0
  28. package/docs/write-requirements.md +161 -0
  29. package/lib/breadcrumb.js +67 -14
  30. package/lib/create-router.js +90 -2
  31. package/lib/docs.js +28 -4
  32. package/lib/flow-map.js +15 -4
  33. package/lib/hcd-views.js +362 -0
  34. package/lib/known.js +5 -2
  35. package/lib/lint-knowledge.js +170 -1
  36. package/lib/load-knowledge.js +128 -5
  37. package/lib/record-links.js +11 -2
  38. package/lib/schema.js +190 -4
  39. package/lib/tidy-principles.js +112 -0
  40. package/package.json +2 -2
  41. package/scripts/init.js +19 -0
  42. package/scripts/migrate-knowledge.js +9 -1
  43. package/scripts/smoke-routes.js +12 -1
  44. package/scripts/tidy-principles.js +68 -0
  45. package/skills/COVERAGE-MATRIX.md +2 -0
  46. package/skills/README.md +5 -0
  47. package/skills/add-scenario/SKILL.md +4 -0
  48. package/skills/add-user-needs/SKILL.md +11 -1
  49. package/skills/create-journey-from-scenario/SKILL.md +4 -1
  50. package/skills/ingest-research-round/SKILL.md +3 -3
  51. package/skills/ingest-user-personas/SKILL.md +24 -7
  52. package/skills/map-research-to-graph/SKILL.md +7 -5
  53. package/skills/record-design-decision/SKILL.md +1 -0
  54. package/skills/review-research-import-draft/SKILL.md +7 -1
  55. package/skills/skills.json +54 -1
  56. package/skills/structure-research-draft/SKILL.md +12 -2
  57. package/skills/weigh-options-against-requirements/SKILL.md +60 -0
  58. package/skills/write-requirements/SKILL.md +69 -0
  59. package/views/hippocampus/_layout.html +15 -12
  60. package/views/hippocampus/components/_activity.njk +36 -0
  61. package/views/hippocampus/components/_journey-step.njk +30 -0
  62. package/views/hippocampus/context.html +197 -0
  63. package/views/hippocampus/design.html +128 -0
  64. package/views/hippocampus/evaluation.html +119 -0
  65. package/views/hippocampus/index.html +57 -11
  66. package/views/hippocampus/journey.html +25 -1
  67. package/views/hippocampus/journeys.html +3 -0
  68. package/views/hippocampus/plan.html +64 -0
  69. package/views/hippocampus/requirements.html +94 -0
  70. package/views/hippocampus/research.html +20 -1
  71. package/views/hippocampus/scenarios.html +3 -0
  72. package/views/hippocampus/user.html +43 -3
@@ -0,0 +1,94 @@
1
+ {% extends "hippocampus/_layout.html" %}
2
+ {% from "hippocampus/components/_activity.njk" import activityHeader, stat %}
3
+ {% from "hippocampus/components/_empty-state.njk" import emptyState %}
4
+
5
+ {% block pageTitle %}Requirements{% endblock %}
6
+
7
+ {% block content %}
8
+ {{ activityHeader(3, "Requirements",
9
+ "What users need, and what the service must let them do - precisely enough to check a design against.",
10
+ "user needs, user requirements") }}
11
+
12
+ <section class="knowledge-status">
13
+ <div class="knowledge-status__grid">
14
+ {{ stat(view.needs.total, "User needs", "What is necessary to reach a goal", basePath + "/user-needs", false) }}
15
+ {{ stat(view.total, "Requirements", "What users must be able to do, and how well", "#requirements", not view.total) }}
16
+ {{ stat(view.needs.withoutRequirement, "Needs with no requirement", "No design can be checked against them yet", basePath + "/user-needs", view.needs.withoutRequirement) }}
17
+ {{ stat(view.needs.namingSolution, "Needs that name a solution", "A need says what, the design says how", basePath + "/user-needs", view.needs.namingSolution) }}
18
+ {% if view.placeholders %}
19
+ {{ stat(view.placeholders, "Placeholder measures", "Numbers not yet agreed", "#user-quantitative", true) }}
20
+ {% endif %}
21
+ </div>
22
+ </section>
23
+
24
+ {#
25
+ The difference between the two, said once, here. It is the distinction a
26
+ team most often blurs - a need that says "highlighted" and a requirement
27
+ that says nothing anyone can check are the same mistake from two sides.
28
+ #}
29
+ <section class="knowledge-section">
30
+ <div class="nhsuk-grid-row">
31
+ <div class="nhsuk-grid-column-one-half">
32
+ <h2 class="nhsuk-heading-s">A user need</h2>
33
+ <p class="nhsuk-body-s">Says what is necessary for a user to reach a goal, in a given context.
34
+ It names no solution - not the system, not a screen, not "highlighted" - and it does not have to be
35
+ checkable.</p>
36
+ <p class="nhsuk-body-s knowledge-muted">"As a safeguarding practitioner, I need to know everyone who lives at an address, so that no child at risk is missed."</p>
37
+ </div>
38
+ <div class="nhsuk-grid-column-one-half">
39
+ <h2 class="nhsuk-heading-s">A user requirement</h2>
40
+ <p class="nhsuk-body-s">Says what the user must be able to recognise, select or input - or how well,
41
+ measurably - so a design can be checked against it. It still names no solution.</p>
42
+ <p class="nhsuk-body-s knowledge-muted">"The user must be able to recognise that a search returned only some of the people who match."</p>
43
+ </div>
44
+ </div>
45
+ </section>
46
+
47
+ <section class="knowledge-section" id="requirements">
48
+ <h2>Requirements</h2>
49
+ {% for group in view.groups %}
50
+ <h3 class="nhsuk-heading-s nhsuk-u-margin-bottom-1" id="{{ group.key }}">{{ group.label }} <span class="nhsuk-u-font-weight-normal nhsuk-u-secondary-text-color">({{ group.requirements.length }})</span></h3>
51
+ <p class="knowledge-note nhsuk-u-margin-bottom-3">{{ group.hint }}</p>
52
+ <div class="knowledge-card-grid knowledge-card-grid--wide nhsuk-u-margin-bottom-5">
53
+ {% for requirement in group.requirements %}
54
+ <article class="knowledge-card knowledge-card--compact">
55
+ <p class="knowledge-card__tags">
56
+ {% if requirement.verb %}<strong class="nhsuk-tag nhsuk-tag--white">{{ requirement.verb }}</strong>{% endif %}
57
+ {% if requirement.dimensionLabel %}<strong class="nhsuk-tag nhsuk-tag--{{ 'red' if requirement.dimensionLabel == 'Avoidance of harm' else 'blue' }}">{{ requirement.dimensionLabel }}</strong>{% endif %}
58
+ {% if requirement.measure and requirement.measure.valuesStatus != 'agreed' %}<strong class="nhsuk-tag nhsuk-tag--yellow">Placeholder numbers</strong>{% endif %}
59
+ {% if requirement.evaluation %}<strong class="nhsuk-tag nhsuk-tag--{{ requirement.evaluation.tag }}">Evaluated: {{ requirement.evaluation.label }}</strong>{% endif %}
60
+ </p>
61
+ <h4 class="knowledge-card__statement">
62
+ <a href="{{ basePath }}/requirements/{{ requirement.id }}">{{ requirement.statement }}</a>
63
+ </h4>
64
+ {% if requirement.source %}
65
+ <p class="knowledge-card__meta">From: {{ requirement.source }}</p>
66
+ {% endif %}
67
+ {% if requirement.needs.length %}
68
+ <h5 class="knowledge-card__label">Meets the needs</h5>
69
+ <ul class="nhsuk-list knowledge-linked-list">
70
+ {% for need in requirement.needs %}<li><a href="{{ basePath }}/needs/{{ need.id }}">{{ need.label }}</a></li>{% endfor %}
71
+ </ul>
72
+ {% endif %}
73
+ {% if requirement.constrainedBy.length %}
74
+ <h5 class="knowledge-card__label">Within the rule</h5>
75
+ <ul class="nhsuk-list knowledge-linked-list">
76
+ {% for rule in requirement.constrainedBy %}<li><a href="{{ basePath }}/requirements/{{ rule.id }}">{{ rule.label }}</a></li>{% endfor %}
77
+ </ul>
78
+ {% endif %}
79
+ {% if requirement.constrains.length %}
80
+ <p class="knowledge-card__meta nhsuk-u-margin-bottom-0">Constrains {{ requirement.constrains.length }} requirement{{ "" if requirement.constrains.length == 1 else "s" }}</p>
81
+ {% endif %}
82
+ {% if requirement.weighedCount %}
83
+ <p class="knowledge-card__meta nhsuk-u-margin-bottom-0">{{ requirement.weighedCount }} option{{ "" if requirement.weighedCount == 1 else "s" }} weighed against it - <a href="{{ basePath }}/design#options">see the options</a></p>
84
+ {% endif %}
85
+ </article>
86
+ {% endfor %}
87
+ </div>
88
+ {% else %}
89
+ {{ emptyState("No requirements yet",
90
+ "A requirement turns a need into something a design can be checked against: \"The user must be able to recognise that a search returned only some of the matches.\" Rules the service works within - information governance, access control - are requirements too, from a source rather than a need.",
91
+ "Add them to hippocampus/source/requirements.json. The guide's Requirements section shows each kind.") }}
92
+ {% endfor %}
93
+ </section>
94
+ {% endblock %}
@@ -22,13 +22,32 @@
22
22
  </div>
23
23
  {% endif %}
24
24
 
25
+ {% if method %}
26
+ <div class="nhsuk-inset-text nhsuk-u-margin-top-0">
27
+ <p>Showing the {{ research.rounds.length }} round{{ "" if research.rounds.length == 1 else "s" }} run as a <strong>{{ methodLabel | lower }}</strong>.
28
+ <a href="{{ basePath }}/research">Show every round</a></p>
29
+ </div>
30
+ {% endif %}
31
+
25
32
  <p class="knowledge-muted nhsuk-body-s">Most recent round first.</p>
26
33
 
27
34
  {% if research.rounds.length %}
28
35
  {% for round in research.rounds %}
29
- <section class="knowledge-section">
36
+ <section class="knowledge-section" id="{{ round.id }}">
30
37
  <p class="knowledge-card__meta">{{ round.date }} · {{ round.sourceType }}</p>
31
38
  <h2>{{ round.title }}</h2>
39
+ {#
40
+ How the round was run. It decides what the round's insights can
41
+ claim: an interview tells you what people say they do, a usability
42
+ test what they actually do.
43
+ #}
44
+ <p class="knowledge-card__tags">
45
+ {% for tag in round.methodTags %}
46
+ <a class="nhsuk-tag nhsuk-tag--white knowledge-method-tag" href="{{ basePath }}/research?method={{ tag.key }}">{{ tag.label }}</a>
47
+ {% else %}
48
+ <span class="knowledge-muted nhsuk-body-s">Method not recorded</span>
49
+ {% endfor %}
50
+ </p>
32
51
  <p class="knowledge-round-status">
33
52
  <strong class="nhsuk-tag nhsuk-tag--{{ round.status.tag }}">{{ round.status.label }}</strong>
34
53
  <span class="knowledge-muted">{{ round.status.detail }}</span>
@@ -20,8 +20,11 @@
20
20
  {% set user = knowledge.index.users[scenario.userId] %}
21
21
  <section class="knowledge-section">
22
22
  <span class="nhsuk-tag nhsuk-tag--{{ 'red' if scenario.riskLevel == 'high' else 'yellow' }}">{{ scenario.riskLevel }} risk</span>
23
+ <span class="nhsuk-tag nhsuk-tag--{{ 'purple' if scenario.state == 'to-be' else 'white' }}">{{ "To-be" if scenario.state == "to-be" else "As-is" }}</span>
23
24
  <h2>{{ scenario.title }}</h2>
24
25
  <p><strong>User:</strong> <a href="{{ basePath }}/users/{{ user.id }}">{{ user.label }}</a></p>
26
+ {% set goal = knowledge.index.goals[scenario.goalId] if scenario.goalId else null %}
27
+ {% if goal %}<p><strong>Goal:</strong> <a href="{{ basePath }}/goals/{{ goal.id }}">{{ goal.statement }}</a></p>{% endif %}
25
28
  <p><strong>Trigger:</strong> {{ scenario.trigger }}</p>
26
29
  <p>{{ scenario.context }}</p>
27
30
 
@@ -7,12 +7,52 @@
7
7
 
8
8
  <div class="nhsuk-grid-row">
9
9
  <div class="nhsuk-grid-column-two-thirds">
10
- <span class="nhsuk-caption-l">User knowledge graph</span>
11
- <h1>{{ userGraph.user.label }}</h1>
12
- <p class="nhsuk-lede-text">{{ userGraph.user.description }}</p>
10
+ {% set user = userGraph.user %}
11
+ <span class="nhsuk-caption-l">
12
+ {{ "Persona" if user.kind == "persona" else "User group" }}{% if user.userType %} · {{ user.userType }} user{% endif %}
13
+ </span>
14
+ <h1>{{ user.label }}</h1>
15
+ <p class="nhsuk-lede-text">{{ user.description }}</p>
16
+ {% if user.userGroupId and knowledge.index.users[user.userGroupId] %}
17
+ <p>A persona of <a href="{{ basePath }}/users/{{ user.userGroupId }}">{{ knowledge.index.users[user.userGroupId].label }}</a>.</p>
18
+ {% endif %}
13
19
  </div>
14
20
  </div>
15
21
 
22
+ {#
23
+ This user's part of the context of use: what they are trying to achieve,
24
+ and the conditions and resources they work with. Shown only when recorded
25
+ - a heading over "not recorded" four times is noise on every persona.
26
+ #}
27
+ {% set goals = [] %}
28
+ {% for goal in knowledge.goals %}{% if goal.userId == user.id %}{% set _ = goals.push(goal) %}{% endif %}{% endfor %}
29
+ {% set env = user.environment or {} %}
30
+ {% if goals.length or env.physical or env.social or env.technical or user.resources %}
31
+ <section class="knowledge-section">
32
+ <h2>Context of use</h2>
33
+ {% if goals.length %}
34
+ <h3 class="nhsuk-heading-s">Goals</h3>
35
+ <ul class="nhsuk-list nhsuk-list--bullet">
36
+ {% for goal in goals %}<li><a href="{{ basePath }}/goals/{{ goal.id }}">{{ goal.statement }}</a></li>{% endfor %}
37
+ </ul>
38
+ {% endif %}
39
+ <div class="nhsuk-grid-row">
40
+ {% for part in [["physical", "Physical conditions"], ["social", "Social conditions"], ["technical", "Technical conditions"]] %}
41
+ {% if env[part[0]] %}
42
+ <div class="nhsuk-grid-column-one-third">
43
+ <h3 class="nhsuk-heading-s">{{ part[1] }}</h3>
44
+ {{ bulletList(env[part[0]]) }}
45
+ </div>
46
+ {% endif %}
47
+ {% endfor %}
48
+ </div>
49
+ {% if user.resources %}
50
+ <h3 class="nhsuk-heading-s">Resources</h3>
51
+ {{ bulletList(user.resources) }}
52
+ {% endif %}
53
+ </section>
54
+ {% endif %}
55
+
16
56
  <section class="knowledge-section">
17
57
  <h2>Responsibilities and access needs</h2>
18
58
  <div class="nhsuk-grid-row">