@purview-dev/pm-docs-site 0.0.0-stage → 0.1.0-pre.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 (69) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +219 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +90 -0
  5. package/dist/index.d.ts +7 -0
  6. package/dist/index.js +118 -0
  7. package/dist/options.d.ts +5 -0
  8. package/dist/options.js +46 -0
  9. package/dist/repo-docs.d.ts +33 -0
  10. package/dist/repo-docs.js +94 -0
  11. package/dist/schema-version.d.ts +10 -0
  12. package/dist/schema-version.js +19 -0
  13. package/dist/sidebar.d.ts +10 -0
  14. package/dist/sidebar.js +30 -0
  15. package/dist/site-options.d.ts +9 -0
  16. package/dist/site-options.js +39 -0
  17. package/dist/types.d.ts +47 -0
  18. package/dist/types.js +4 -0
  19. package/lib/repo-docs.ts +124 -0
  20. package/lib/schema-version.ts +24 -0
  21. package/package.json +68 -5
  22. package/src/components/ExportStamp.astro +29 -0
  23. package/src/components/FeatureSummary.astro +160 -0
  24. package/src/components/FeatureTable.astro +64 -0
  25. package/src/components/ItemDetail.astro +16 -0
  26. package/src/components/ItemDialog.astro +16 -0
  27. package/src/components/LinkedFrom.astro +33 -0
  28. package/src/components/LinkedText.astro +12 -0
  29. package/src/components/PlanInteractions.astro +30 -0
  30. package/src/components/RefLink.astro +18 -0
  31. package/src/components/StateBadge.astro +15 -0
  32. package/src/components/board/Board.tsx +244 -0
  33. package/src/components/board/KanbanItemCard.tsx +129 -0
  34. package/src/components/board/LinkRuns.tsx +21 -0
  35. package/src/components/board/TaskKanbanCard.tsx +81 -0
  36. package/src/components/board/useBoardUrlState.ts +41 -0
  37. package/src/components/lib/KanbanItemCard.astro +264 -0
  38. package/src/components/lib/StatusTimelineFeed.astro +194 -0
  39. package/src/components/lib/TaskKanbanCard.astro +215 -0
  40. package/src/components/timeline/Timeline.tsx +159 -0
  41. package/src/components/timeline/useTimelineLayout.ts +39 -0
  42. package/src/content.config.ts +16 -0
  43. package/src/env.d.ts +7 -0
  44. package/src/lib/board-data.ts +84 -0
  45. package/src/lib/board.ts +209 -0
  46. package/src/lib/planning-types.ts +207 -0
  47. package/src/lib/planning.ts +415 -0
  48. package/src/lib/references.ts +360 -0
  49. package/src/lib/timeline.ts +156 -0
  50. package/src/loaders/repo-docs.ts +69 -0
  51. package/src/pages/index.astro +158 -0
  52. package/src/pages/plan/board.astro +41 -0
  53. package/src/pages/plan/log.astro +83 -0
  54. package/src/pages/plan/risks/[id].astro +72 -0
  55. package/src/pages/plan/risks.astro +263 -0
  56. package/src/pages/plan/roadmap.astro +108 -0
  57. package/src/routes/plan/briefs.astro +66 -0
  58. package/src/routes/plan/features/[id].astro +113 -0
  59. package/src/routes/plan/features/index.astro +29 -0
  60. package/src/routes/plan/inbox.astro +78 -0
  61. package/src/routes/plan/milestones/[milestone].astro +113 -0
  62. package/src/routes/plan/milestones/index.astro +56 -0
  63. package/src/routes/plan/now.astro +135 -0
  64. package/src/routes/plan/strategy.astro +194 -0
  65. package/src/scripts/plan.ts +40 -0
  66. package/src/styles/components.css +491 -0
  67. package/src/styles/kanban.css +277 -0
  68. package/src/styles/timeline.css +210 -0
  69. package/src/styles/width.css +4 -0
@@ -0,0 +1,108 @@
1
+ ---
2
+ // The roadmap by milestone, in strategy order: what is done, what is in
3
+ // progress, and what is queued, all from planning.json. The milestone
4
+ // timeline (src/components/timeline/Timeline.tsx) sits above the sections.
5
+ // Its inline script runs as the page is parsed, before the strip paints: a
6
+ // `?layout=vertical` link hides the strip until the island has rendered it
7
+ // vertical and deleted the mark (useTimelineLayout.ts), so it never flashes
8
+ // horizontal first. The mark is set on this page only; timeline.css reveals
9
+ // the strip after 3s if the island never loads. It must stay in step with
10
+ // parseTimelineQuery in src/lib/timeline.ts.
11
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
12
+
13
+ import ExportStamp from '../../components/ExportStamp.astro';
14
+ import Timeline from '../../components/timeline/Timeline';
15
+ import ItemDetail from '../../components/ItemDetail.astro';
16
+ import ItemDialog from '../../components/ItemDialog.astro';
17
+ import LinkedText from '../../components/LinkedText.astro';
18
+ import StatusTimelineFeed from '../../components/lib/StatusTimelineFeed.astro';
19
+ import PlanInteractions from '../../components/PlanInteractions.astro';
20
+ import RefLink from '../../components/RefLink.astro';
21
+ import { loadPlanning, roadmapGroups } from '../../lib/planning';
22
+ import { siteRefs } from '../../lib/references';
23
+ import { timelineMilestones } from '../../lib/timeline';
24
+ import '../../styles/components.css';
25
+ import '../../styles/timeline.css';
26
+
27
+ const { known } = siteRefs();
28
+ const planning = loadPlanning();
29
+ const milestones = timelineMilestones(planning, known);
30
+ const groups = roadmapGroups(planning).map((group) => ({
31
+ ...group,
32
+ events: group.events.map((event) => {
33
+ const href = event.id ? known.get(event.id)?.href : null;
34
+
35
+ return href ? { ...event, href, itemId: event.id! } : event;
36
+ }),
37
+ }));
38
+ ---
39
+
40
+ <StarlightPage frontmatter={{ title: 'Roadmap', description: 'Milestones in order, with what is done, in progress and queued.', tableOfContents: false }}>
41
+ <ExportStamp />
42
+
43
+ <script is:inline>
44
+ if (new URLSearchParams(location.search).get('layout') === 'vertical') document.documentElement.dataset.timelinePending = '';
45
+ </script>
46
+ <Timeline client:load milestones={milestones} />
47
+
48
+ {
49
+ groups.map((group) => (
50
+ <section class="roadmap-group">
51
+ <h2>
52
+ <RefLink ref={group.milestone?.id ?? 'none'} />
53
+ {group.milestone?.isFocus && <span class="roadmap-focus">Focus</span>}
54
+ </h2>
55
+ <p class="roadmap-meta">
56
+ {group.milestone && <strong>{group.milestone.status}</strong>}
57
+ {group.milestone?.target && ` · target ${group.milestone.target}`}
58
+ {group.milestone && ' · '}
59
+ {group.progress.done} of {group.progress.total} done
60
+ {group.milestone?.exitCriteria && (
61
+ <>
62
+ {' '}
63
+ — <LinkedText text={group.milestone.exitCriteria} />
64
+ </>
65
+ )}
66
+ </p>
67
+ {group.progress.total > 0 && (
68
+ <progress class="roadmap-progress" max={group.progress.total} value={group.progress.done}>
69
+ {group.progress.done} of {group.progress.total}
70
+ </progress>
71
+ )}
72
+ {group.events.length === 0 ? <p class="plan-empty">No items</p> : <StatusTimelineFeed events={group.events} />}
73
+ {group.events.map((event) => 'itemId' in event && <ItemDetail id={event.itemId} />)}
74
+ </section>
75
+ ))
76
+ }
77
+
78
+ <ItemDialog />
79
+ <PlanInteractions />
80
+ </StarlightPage>
81
+
82
+ <style>
83
+ .roadmap-group + .roadmap-group {
84
+ margin-top: 2.5rem;
85
+ }
86
+
87
+ .roadmap-focus {
88
+ margin-left: 0.5rem;
89
+ padding: 0.1rem 0.5rem;
90
+ border-radius: 999px;
91
+ background: var(--sl-color-accent-low);
92
+ color: var(--sl-color-accent-high);
93
+ font-size: var(--sl-text-xs);
94
+ vertical-align: middle;
95
+ }
96
+
97
+ .roadmap-meta {
98
+ color: var(--sl-color-gray-2);
99
+ font-size: var(--sl-text-sm);
100
+ }
101
+
102
+ .roadmap-progress {
103
+ width: 100%;
104
+ max-width: 24rem;
105
+ height: 0.5rem;
106
+ accent-color: var(--sl-color-accent);
107
+ }
108
+ </style>
@@ -0,0 +1,66 @@
1
+ ---
2
+ // The shaping record from planning.json's `briefs`: each brief's status, the
3
+ // problem it names, its Done when, its decision, and any revisions.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../components/ExportStamp.astro';
7
+ import LinkedText from '../../components/LinkedText.astro';
8
+ import RefLink from '../../components/RefLink.astro';
9
+ import { briefAnchor, loadPlanning } from '../../lib/planning';
10
+ import '../../styles/components.css';
11
+
12
+ const planning = loadPlanning();
13
+ ---
14
+
15
+ <StarlightPage frontmatter={{ title: 'Briefs', description: 'Each shaped idea: its status, problem, Done when, decision and revisions.', tableOfContents: false }}>
16
+ <ExportStamp />
17
+
18
+ <p>{planning.briefs.length} briefs, {planning.counts.shapingBriefs} still shaping.</p>
19
+
20
+ {planning.briefs.length === 0 && <p class="plan-empty">No briefs. pm-shape writes one per idea it discusses.</p>}
21
+
22
+ {
23
+ planning.briefs.map((brief) => (
24
+ <section id={briefAnchor(brief.path)}>
25
+ <h2>
26
+ {brief.id && <RefLink ref={brief.id} label="id" />} {brief.title}
27
+ </h2>
28
+ <p class="plan-meta">
29
+ {brief.status ? <LinkedText text={brief.status} /> : 'No status'}
30
+ {brief.updated && <> · updated {brief.updated}</>}
31
+ {brief.origin && (
32
+ <>
33
+ {' '}
34
+ · from <LinkedText text={brief.origin} />
35
+ </>
36
+ )}{' '}
37
+ · <RefLink ref={brief.path} label="id" />
38
+ </p>
39
+ {brief.problem && (
40
+ <p>
41
+ <strong>Problem:</strong> <LinkedText text={brief.problem} />
42
+ </p>
43
+ )}
44
+ {brief.doneWhen && (
45
+ <p>
46
+ <strong>Done when:</strong> <LinkedText text={brief.doneWhen} />
47
+ </p>
48
+ )}
49
+ {brief.decision && (
50
+ <p>
51
+ <strong>Decision:</strong> <LinkedText text={brief.decision} />
52
+ </p>
53
+ )}
54
+ {brief.revisions.length > 0 && (
55
+ <ul>
56
+ {brief.revisions.map((revision) => (
57
+ <li>
58
+ {revision.date && <strong>{revision.date}</strong>} <LinkedText text={revision.text} />
59
+ </li>
60
+ ))}
61
+ </ul>
62
+ )}
63
+ </section>
64
+ ))
65
+ }
66
+ </StarlightPage>
@@ -0,0 +1,113 @@
1
+ ---
2
+ // One roadmap item, wherever the export holds it (Now, Next, Later, Done or
3
+ // Dropped): its summary, result or plan, reason, what it serves, its note, the
4
+ // inbox entries that name it, and the pages that link to it. All from planning.json.
5
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
6
+
7
+ import ExportStamp from '../../../components/ExportStamp.astro';
8
+ import FeatureSummary from '../../../components/FeatureSummary.astro';
9
+ import LinkedFrom from '../../../components/LinkedFrom.astro';
10
+ import LinkedText from '../../../components/LinkedText.astro';
11
+ import { docsHref, FEATURE_STATES, features, loadPlanning } from '../../../lib/planning';
12
+ import config from 'virtual:pm-docs-site/config';
13
+ import '../../../styles/components.css';
14
+
15
+ export function getStaticPaths() {
16
+ return features(loadPlanning()).map((feature) => ({ params: { id: feature.id.toLowerCase() }, props: { id: feature.id } }));
17
+ }
18
+
19
+ const { id } = Astro.props;
20
+ const planning = loadPlanning();
21
+ const feature = features(planning).find((candidate) => candidate.id === id)!;
22
+ const outcomes = new Map(planning.vision.outcomes.map((outcome) => [outcome.id, outcome.text]));
23
+ const milestone = planning.strategy.milestones.find((candidate) => candidate.id === feature.milestone) ?? null;
24
+ const inbox = planning.inbox.filter((entry) => entry.affects === feature.id || entry.related.includes(feature.id));
25
+ const planLink = docsHref(feature.plan);
26
+ ---
27
+
28
+ <StarlightPage
29
+ frontmatter={{
30
+ title: `${feature.id} ${feature.title}`,
31
+ description: feature.doneWhen[0] ?? feature.result ?? feature.reason ?? `${FEATURE_STATES[feature.state]} item ${feature.id}.`,
32
+ tableOfContents: false,
33
+ }}
34
+ >
35
+ <ExportStamp kind="Feature" state={FEATURE_STATES[feature.state]} milestone={milestone ? `${milestone.id} ${milestone.name}` : 'No milestone'} />
36
+
37
+ <FeatureSummary id={feature.id} />
38
+
39
+ {
40
+ (feature.result || feature.plan) && (
41
+ <section>
42
+ <h2>{feature.state === 'done' ? 'Result' : 'Plan'}</h2>
43
+ {feature.result && (
44
+ <p>
45
+ <LinkedText text={feature.result} />
46
+ </p>
47
+ )}
48
+ {feature.plan && <p>Plan: {planLink ? <a href={planLink}>{feature.plan}</a> : <code>{feature.plan}</code>}</p>}
49
+ {feature.state === 'now' && config.views.now && (
50
+ <p>
51
+ <a href="/plan/now/">The plan's tasks and the last checkpoint</a>
52
+ </p>
53
+ )}
54
+ </section>
55
+ )
56
+ }
57
+
58
+ {
59
+ feature.reason && (
60
+ <section>
61
+ <h2>Reason</h2>
62
+ <p>
63
+ <LinkedText text={feature.reason} />
64
+ </p>
65
+ </section>
66
+ )
67
+ }
68
+
69
+ {
70
+ feature.serves.length > 0 && (
71
+ <section>
72
+ <h2>Serves</h2>
73
+ <ul>
74
+ {feature.serves.map((line) => (
75
+ <li>
76
+ <strong>{line}</strong> {outcomes.get(line)}
77
+ </li>
78
+ ))}
79
+ </ul>
80
+ </section>
81
+ )
82
+ }
83
+
84
+ {
85
+ feature.note && (
86
+ <section>
87
+ <h2>Note</h2>
88
+ <p>
89
+ <LinkedText text={feature.note} />
90
+ </p>
91
+ </section>
92
+ )
93
+ }
94
+
95
+ {
96
+ inbox.length > 0 && (
97
+ <section>
98
+ <h2>Inbox</h2>
99
+ <ul>
100
+ {inbox.map((entry) => (
101
+ <li>
102
+ {entry.kind && <strong>{entry.kind}</strong>} <LinkedText text={entry.title} />
103
+ {entry.severity && <> ({entry.severity})</>}
104
+ {entry.captured && <>, captured {entry.captured}</>}
105
+ </li>
106
+ ))}
107
+ </ul>
108
+ </section>
109
+ )
110
+ }
111
+
112
+ <LinkedFrom ref={feature.id} />
113
+ </StarlightPage>
@@ -0,0 +1,29 @@
1
+ ---
2
+ // Every roadmap item in the plan, by state — in progress, Next, Later, Done
3
+ // and Dropped — from planning.json. Each item has its own page, which search indexes.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../../components/ExportStamp.astro';
7
+ import FeatureTable from '../../../components/FeatureTable.astro';
8
+ import { FEATURE_STATES, features, loadPlanning, type FeatureState } from '../../../lib/planning';
9
+ import '../../../styles/components.css';
10
+
11
+ const planning = loadPlanning();
12
+ const all = features(planning);
13
+ const groups = (Object.keys(FEATURE_STATES) as FeatureState[]).map((state) => ({ state, items: all.filter((feature) => feature.state === state) }));
14
+ ---
15
+
16
+ <StarlightPage frontmatter={{ title: 'Features', description: 'Every roadmap item: in progress, Next, Later, Done and Dropped.' }}>
17
+ <ExportStamp />
18
+
19
+ {
20
+ groups.map((group) => (
21
+ <section>
22
+ <h2 id={group.state}>
23
+ {FEATURE_STATES[group.state]} <span class="plan-count">{group.items.length}</span>
24
+ </h2>
25
+ <FeatureTable state={group.state} items={group.items} milestones={planning.strategy.milestones} />
26
+ </section>
27
+ ))
28
+ }
29
+ </StarlightPage>
@@ -0,0 +1,78 @@
1
+ ---
2
+ // The parking lot from planning.json's `inbox`: the ideas waiting for a
3
+ // pm-shape discussion first, then the rest, one card per idea.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../components/ExportStamp.astro';
7
+ import KanbanItemCard from '../../components/lib/KanbanItemCard.astro';
8
+ import LinkedText from '../../components/LinkedText.astro';
9
+ import RefLink from '../../components/RefLink.astro';
10
+ import { loadPlanning, severityToPriority, sourceInitials } from '../../lib/planning';
11
+ import '../../styles/components.css';
12
+
13
+ const planning = loadPlanning();
14
+ const groups = [
15
+ { title: 'To discuss', entries: planning.inbox.filter((entry) => entry.discuss === 'yes') },
16
+ { title: 'Parked', entries: planning.inbox.filter((entry) => entry.discuss !== 'yes') },
17
+ ];
18
+ ---
19
+
20
+ <StarlightPage frontmatter={{ title: 'Inbox', description: 'Parked ideas, bugs and questions, with those waiting for discussion first.', tableOfContents: false }}>
21
+ <ExportStamp />
22
+
23
+ <p>
24
+ {planning.counts.openInbox} open, {planning.counts.discuss} to discuss, {planning.inbox.length} in all. Last review: {planning.checks.lastReview ?? 'never'}.
25
+ </p>
26
+
27
+ {
28
+ groups.map((group) => (
29
+ <section>
30
+ <h2>
31
+ {group.title} <span class="plan-count">{group.entries.length}</span>
32
+ </h2>
33
+ {group.entries.length === 0 && <p class="plan-empty">Nothing here</p>}
34
+ <div class="plan-cards not-content">
35
+ {group.entries.map((entry) => (
36
+ <div>
37
+ <KanbanItemCard
38
+ title={entry.title}
39
+ tag={entry.kind ?? 'idea'}
40
+ assignee={sourceInitials(entry.source)}
41
+ dueDate={entry.captured ?? ''}
42
+ priority={severityToPriority(entry.severity)}
43
+ commentsCount={0}
44
+ attachmentsCount={0}
45
+ />
46
+ {entry.affects && entry.affects !== 'none' && (
47
+ <p class="plan-meta">
48
+ Affects: <LinkedText text={entry.affects} />
49
+ </p>
50
+ )}
51
+ {entry.related.length > 0 && (
52
+ <p class="plan-meta">
53
+ Related:{' '}
54
+ {entry.related.map((ref, index) => (
55
+ <>
56
+ {index > 0 && ', '}
57
+ <RefLink ref={ref} />
58
+ </>
59
+ ))}
60
+ </p>
61
+ )}
62
+ {entry.brief && (
63
+ <p class="plan-meta">
64
+ Brief: <RefLink ref={entry.brief} label="id" />
65
+ </p>
66
+ )}
67
+ {entry.idea && (
68
+ <p class="plan-meta">
69
+ <LinkedText text={entry.idea} />
70
+ </p>
71
+ )}
72
+ </div>
73
+ ))}
74
+ </div>
75
+ </section>
76
+ ))
77
+ }
78
+ </StarlightPage>
@@ -0,0 +1,113 @@
1
+ ---
2
+ // One milestone (or the items with none): its status, target, exit criteria,
3
+ // the V lines it serves, its items by state, and the risks that name it.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../../components/ExportStamp.astro';
7
+ import FeatureTable from '../../../components/FeatureTable.astro';
8
+ import LinkedFrom from '../../../components/LinkedFrom.astro';
9
+ import LinkedText from '../../../components/LinkedText.astro';
10
+ import RefLink from '../../../components/RefLink.astro';
11
+ import { FEATURE_STATES, loadPlanning, milestoneSummaries, type FeatureState } from '../../../lib/planning';
12
+ import '../../../styles/components.css';
13
+
14
+ export function getStaticPaths() {
15
+ return milestoneSummaries(loadPlanning()).map((summary) => ({ params: { milestone: summary.slug }, props: { slug: summary.slug } }));
16
+ }
17
+
18
+ const { slug } = Astro.props;
19
+ const planning = loadPlanning();
20
+ const summary = milestoneSummaries(planning).find((candidate) => candidate.slug === slug)!;
21
+ const outcomes = new Map(planning.vision.outcomes.map((outcome) => [outcome.id, outcome.text]));
22
+ const title = summary.id ? `${summary.id} ${summary.name}` : summary.name;
23
+ const groups = (Object.keys(FEATURE_STATES) as FeatureState[])
24
+ .map((state) => ({ state, items: summary.features.filter((feature) => feature.state === state) }))
25
+ .filter((group) => group.items.length > 0);
26
+ const risks = summary.id ? [...planning.risks.open, ...planning.risks.closed].filter((risk) => risk.affects === summary.id) : [];
27
+ ---
28
+
29
+ <StarlightPage frontmatter={{ title, description: summary.exitCriteria ?? `The items in ${title}.`, tableOfContents: false }}>
30
+ <ExportStamp kind="Milestone" milestone={title} />
31
+
32
+ <p>
33
+ {summary.isFocus && <span class="plan-focus">Focus</span>}
34
+ {summary.isFocus && ' '}
35
+ {summary.id ? 'Status' : 'Items with no milestone'}
36
+ {summary.id && <strong> {summary.status ?? 'none'}</strong>}
37
+ {summary.target && <> · target {summary.target}</>}
38
+ </p>
39
+
40
+ {
41
+ summary.id === null && <p class="plan-meta">These items have no milestone, or name one that is not in STRATEGY.md.</p>
42
+ }
43
+
44
+ {
45
+ summary.progress.total > 0 && (
46
+ <p>
47
+ <progress class="plan-progress" max={summary.progress.total} value={summary.progress.done}>
48
+ {summary.progress.done} of {summary.progress.total}
49
+ </progress>{' '}
50
+ {summary.progress.done} of {summary.progress.total} done
51
+ </p>
52
+ )
53
+ }
54
+
55
+ {
56
+ summary.exitCriteria && (
57
+ <section>
58
+ <h2>Exit criteria</h2>
59
+ <p>
60
+ <LinkedText text={summary.exitCriteria} />
61
+ </p>
62
+ </section>
63
+ )
64
+ }
65
+
66
+ {
67
+ summary.serves.length > 0 && (
68
+ <section>
69
+ <h2>Serves</h2>
70
+ <ul>
71
+ {summary.serves.map((line) => (
72
+ <li>
73
+ <strong>{line}</strong> {outcomes.get(line)}
74
+ </li>
75
+ ))}
76
+ </ul>
77
+ </section>
78
+ )
79
+ }
80
+
81
+ {groups.length === 0 && <p class="plan-empty">No items</p>}
82
+ {
83
+ groups.map((group) => (
84
+ <section>
85
+ <h2 id={group.state}>
86
+ {FEATURE_STATES[group.state]} <span class="plan-count">{group.items.length}</span>
87
+ </h2>
88
+ <FeatureTable state={group.state} items={group.items} milestones={planning.strategy.milestones} hideMilestone />
89
+ </section>
90
+ ))
91
+ }
92
+
93
+ {
94
+ risks.length > 0 && (
95
+ <section>
96
+ <h2>Risks</h2>
97
+ <ul>
98
+ {risks.map((risk) => (
99
+ <li>
100
+ <span class={`rag rag--${risk.rag}`}>{risk.rag}</span>{' '}
101
+ <strong>
102
+ <RefLink ref={risk.id} label="id" />
103
+ </strong>{' '}
104
+ <LinkedText text={risk.title} /> — {risk.status}
105
+ </li>
106
+ ))}
107
+ </ul>
108
+ </section>
109
+ )
110
+ }
111
+
112
+ <LinkedFrom ref={summary.id ?? 'none'} />
113
+ </StarlightPage>
@@ -0,0 +1,56 @@
1
+ ---
2
+ // The milestones in strategy order, each with its status, target, exit
3
+ // criteria, the V lines it serves, and its items by state, from planning.json.
4
+ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
5
+
6
+ import ExportStamp from '../../../components/ExportStamp.astro';
7
+ import LinkedText from '../../../components/LinkedText.astro';
8
+ import RefLink from '../../../components/RefLink.astro';
9
+ import { FEATURE_STATES, loadPlanning, milestoneSummaries, type FeatureState } from '../../../lib/planning';
10
+ import '../../../styles/components.css';
11
+
12
+ const planning = loadPlanning();
13
+ const summaries = milestoneSummaries(planning);
14
+ const states = Object.keys(FEATURE_STATES) as FeatureState[];
15
+ const byState = (summary: (typeof summaries)[number]) =>
16
+ states
17
+ .map((state) => ({ state, count: summary.features.filter((feature) => feature.state === state).length }))
18
+ .filter((entry) => entry.count > 0)
19
+ .map((entry) => `${entry.count} ${FEATURE_STATES[entry.state].toLowerCase()}`)
20
+ .join(', ');
21
+ ---
22
+
23
+ <StarlightPage frontmatter={{ title: 'Milestones', description: 'Each milestone in strategy order, with its exit criteria and its items.', tableOfContents: false }}>
24
+ <ExportStamp />
25
+
26
+ {summaries.length === 0 && <p class="plan-empty">No milestones. pm-strategy sets them in STRATEGY.md.</p>}
27
+
28
+ <div class="plan-cards not-content">
29
+ {
30
+ summaries.map((summary) => (
31
+ <article class="plan-card">
32
+ <h3>
33
+ <RefLink ref={summary.id ?? 'none'} />
34
+ {summary.isFocus && <span class="plan-focus">Focus</span>}
35
+ </h3>
36
+ <p class="plan-meta">
37
+ {summary.status ?? 'No status'}
38
+ {summary.target && <> · target {summary.target}</>} · {summary.progress.done} of {summary.progress.total} done
39
+ </p>
40
+ {summary.progress.total > 0 && (
41
+ <progress class="plan-progress" max={summary.progress.total} value={summary.progress.done}>
42
+ {summary.progress.done} of {summary.progress.total}
43
+ </progress>
44
+ )}
45
+ {summary.exitCriteria && (
46
+ <p>
47
+ Exit: <LinkedText text={summary.exitCriteria} />
48
+ </p>
49
+ )}
50
+ {summary.serves.length > 0 && <p class="plan-meta">Serves {summary.serves.join(', ')}</p>}
51
+ <p class="plan-meta">{byState(summary) || 'No items'}</p>
52
+ </article>
53
+ ))
54
+ }
55
+ </div>
56
+ </StarlightPage>