@ritualai/cli 0.7.16 → 0.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.
- package/dist/commands/init.js +406 -96
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/build-flow-explainer.js +226 -0
- package/dist/lib/build-flow-explainer.js.map +1 -0
- package/dist/lib/final-cta-box.js +224 -0
- package/dist/lib/final-cta-box.js.map +1 -0
- package/dist/lib/onboarding-state.js +140 -0
- package/dist/lib/onboarding-state.js.map +1 -0
- package/dist/lib/persona-picker.js +171 -0
- package/dist/lib/persona-picker.js.map +1 -0
- package/dist/lib/persona-samples.js +245 -0
- package/dist/lib/persona-samples.js.map +1 -0
- package/dist/lib/project-config.js.map +1 -1
- package/dist/lib/workspace-explainer.js +193 -0
- package/dist/lib/workspace-explainer.js.map +1 -0
- package/dist/lib/workspace-flow.js +8 -7
- package/dist/lib/workspace-flow.js.map +1 -1
- package/package.json +73 -73
- package/skills/claude-code/ritual/.ritual-bundle.json +2 -2
- package/skills/claude-code/ritual/references/build-flow.md +51 -14
- package/skills/codex/ritual/.ritual-bundle.json +2 -2
- package/skills/codex/ritual/references/build-flow.md +51 -14
- package/skills/cursor/ritual/.ritual-bundle.json +2 -2
- package/skills/cursor/ritual/references/build-flow.md +51 -14
- package/skills/gemini/ritual/.ritual-bundle.json +2 -2
- package/skills/gemini/ritual/references/build-flow.md +51 -14
- package/skills/kiro/ritual/.ritual-bundle.json +2 -2
- package/skills/kiro/ritual/references/build-flow.md +51 -14
- package/skills/vscode/ritual/.ritual-bundle.json +2 -2
- package/skills/vscode/ritual/references/build-flow.md +51 -14
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Workspace explainer — onboarding screen #2 of 3.
|
|
4
|
+
*
|
|
5
|
+
* Shown once per machine on first `ritual init` (gated by
|
|
6
|
+
* onboarding-state.ts). Teaches the user the mental model:
|
|
7
|
+
*
|
|
8
|
+
* - Workspace = container for explorations on this codebase
|
|
9
|
+
* - Explorations = boxes of work (problem → answers → recs → brief → impl)
|
|
10
|
+
* - Context flows between explorations within a workspace
|
|
11
|
+
* (decisions, anti-goals, file lineage carry forward)
|
|
12
|
+
*
|
|
13
|
+
* Personalized via:
|
|
14
|
+
* - Workspace name (git-remote-detected, falls back to cwd basename)
|
|
15
|
+
* - Persona slug (when set) → discipline framing + 3 sample
|
|
16
|
+
* exploration names from persona-samples.ts
|
|
17
|
+
*
|
|
18
|
+
* Non-TTY fallback: terse 3-line summary printed via printTerse().
|
|
19
|
+
* Caller is expected to check tty + onboarding state before calling
|
|
20
|
+
* the rich version.
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.detectColorMode = void 0;
|
|
24
|
+
exports.printWorkspaceExplainer = printWorkspaceExplainer;
|
|
25
|
+
exports.printWorkspaceExplainerTerse = printWorkspaceExplainerTerse;
|
|
26
|
+
const colors_1 = require("./colors");
|
|
27
|
+
Object.defineProperty(exports, "detectColorMode", { enumerable: true, get: function () { return colors_1.detectColorMode; } });
|
|
28
|
+
const persona_samples_1 = require("./persona-samples");
|
|
29
|
+
/** Width target. Matches welcome-banner.ts for visual consistency. */
|
|
30
|
+
const BOX_WIDTH = 78;
|
|
31
|
+
/**
|
|
32
|
+
* Render the workspace explainer to stdout. Always renders (caller
|
|
33
|
+
* decides whether to skip based on TTY + onboarding-state).
|
|
34
|
+
*
|
|
35
|
+
* The rich version assumes ≥80-char terminal width. For narrower
|
|
36
|
+
* terminals, callers should prefer printTerse().
|
|
37
|
+
*/
|
|
38
|
+
function printWorkspaceExplainer(opts) {
|
|
39
|
+
const persona = (0, persona_samples_1.findPersona)(opts.personaSlug) ?? persona_samples_1.GENERIC_PERSONA;
|
|
40
|
+
const accent = persona.accent;
|
|
41
|
+
const lines = [];
|
|
42
|
+
// Title bar carries the workspace name + brand-teal accent. The
|
|
43
|
+
// body BELOW it actually teaches what a workspace IS (replaces an
|
|
44
|
+
// earlier draft that just labeled "workspace: foo / you build: bar"
|
|
45
|
+
// without explaining the concept — the visual cards alone weren't
|
|
46
|
+
// enough to land it).
|
|
47
|
+
lines.push(box.top(BOX_WIDTH, (0, colors_1.color)(accent, `─ workspace: "${opts.workspaceName}" `)));
|
|
48
|
+
lines.push(box.padded(BOX_WIDTH, ''));
|
|
49
|
+
// Value-prop framing — mirrors the developer landing page at
|
|
50
|
+
// ritual.work/product/developer ("structured discovery, living
|
|
51
|
+
// specs, plans with less guesswork — so AI agents land changes
|
|
52
|
+
// you'd actually merge"). One bold opener + two dim continuation
|
|
53
|
+
// lines so the eye lands on the verb-noun phrases without the
|
|
54
|
+
// outcome clause getting lost in the wrap.
|
|
55
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.boldColor)(accent, 'where structured discovery, living specs, and plans with')}`));
|
|
56
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.boldColor)(accent, 'less guesswork come together —')}`));
|
|
57
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.dim)('so AI agents land changes you\'d actually merge.')}`));
|
|
58
|
+
lines.push(box.padded(BOX_WIDTH, ''));
|
|
59
|
+
// Inner container with 3 exploration cards side-by-side
|
|
60
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('┌' + '─'.repeat(BOX_WIDTH - 8) + '┐')));
|
|
61
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('│') + ' '.repeat(BOX_WIDTH - 8) + (0, colors_1.dim)('│')));
|
|
62
|
+
const cards = renderExplorationCardsRow(persona);
|
|
63
|
+
for (const cardLine of cards) {
|
|
64
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('│ ') + cardLine + (0, colors_1.dim)(' │')));
|
|
65
|
+
}
|
|
66
|
+
// Down-arrows pointing to shared context
|
|
67
|
+
const arrowsLine = ' ↓ ↓ ↓';
|
|
68
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('│ ') + (0, colors_1.dim)(arrowsLine.padEnd(BOX_WIDTH - 16)) + (0, colors_1.dim)('│')));
|
|
69
|
+
// Shared context strip
|
|
70
|
+
const contextLines = [
|
|
71
|
+
' ┌─ shared context · knowledge graph ' + '─'.repeat(28) + '┐',
|
|
72
|
+
' │ • decisions in one carry to the next' + ' '.repeat(28) + '│',
|
|
73
|
+
' │ • anti-goals propagate forward' + ' '.repeat(34) + '│',
|
|
74
|
+
' │ • file lineage: which exploration shaped this' + ' '.repeat(19) + '│',
|
|
75
|
+
' │ • prior implementations inform new explorations' + ' '.repeat(17) + '│',
|
|
76
|
+
' └' + '─'.repeat(65) + '┘',
|
|
77
|
+
];
|
|
78
|
+
for (const cl of contextLines) {
|
|
79
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('│ ') + (0, colors_1.color)(accent, cl) + (0, colors_1.dim)(' │')));
|
|
80
|
+
}
|
|
81
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('│') + ' '.repeat(BOX_WIDTH - 8) + (0, colors_1.dim)('│')));
|
|
82
|
+
lines.push(box.padded(BOX_WIDTH, ' ' + (0, colors_1.dim)('└' + '─'.repeat(BOX_WIDTH - 8) + '┘')));
|
|
83
|
+
lines.push(box.padded(BOX_WIDTH, ''));
|
|
84
|
+
// What you'll do here. Kept short: only commands that exist + are
|
|
85
|
+
// expected to be the first thing the user reaches for. `/ritual
|
|
86
|
+
// lineage` lived here in the first draft; pulled because it's not
|
|
87
|
+
// shipping in the same window as this onboarding flow and we
|
|
88
|
+
// don't want to teach a command that doesn't work yet.
|
|
89
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.boldColor)(accent, 'what you\'ll do here:')}`));
|
|
90
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.dim)('›')} /ritual build <feature> ${(0, colors_1.dim)('create an exploration')}`));
|
|
91
|
+
lines.push(box.padded(BOX_WIDTH, ` ${(0, colors_1.dim)('›')} /ritual resume ${(0, colors_1.dim)('pick up where you left off')}`));
|
|
92
|
+
lines.push(box.padded(BOX_WIDTH, ''));
|
|
93
|
+
lines.push(box.bottom(BOX_WIDTH));
|
|
94
|
+
for (const line of lines) {
|
|
95
|
+
process.stdout.write(line + '\n');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Terse single-line-per-concept fallback for non-TTY or narrow
|
|
100
|
+
* terminals. No colors, no boxes — just the teaching.
|
|
101
|
+
*/
|
|
102
|
+
function printWorkspaceExplainerTerse(opts) {
|
|
103
|
+
// `persona` is intentionally not consulted in the terse path —
|
|
104
|
+
// the framing line was pulled in favor of an actual definition.
|
|
105
|
+
// Persona-specific examples still surface in the rich version.
|
|
106
|
+
void (0, persona_samples_1.findPersona)(opts.personaSlug);
|
|
107
|
+
process.stdout.write(`\n workspace: "${opts.workspaceName}"\n`);
|
|
108
|
+
process.stdout.write('\n');
|
|
109
|
+
process.stdout.write(' Where structured discovery, living specs, and plans with less\n');
|
|
110
|
+
process.stdout.write(' guesswork come together — so AI agents land changes you\'d\n');
|
|
111
|
+
process.stdout.write(' actually merge.\n');
|
|
112
|
+
process.stdout.write('\n');
|
|
113
|
+
process.stdout.write(' Use /ritual build <feature> to create an exploration. /ritual resume\n');
|
|
114
|
+
process.stdout.write(' to pick up where you left off.\n');
|
|
115
|
+
process.stdout.write('\n');
|
|
116
|
+
}
|
|
117
|
+
// ─── helpers ────────────────────────────────────────────────────────────────
|
|
118
|
+
/**
|
|
119
|
+
* Render the 3 exploration cards as a single 4-line column-block:
|
|
120
|
+
* top border with the "exploration" label, two title lines (most
|
|
121
|
+
* titles wrap to 2; short ones get a blank second line), bottom
|
|
122
|
+
* border. Lifecycle bullets used to live here; they were dropped
|
|
123
|
+
* because they teach the SAME thing as the build-flow explainer's
|
|
124
|
+
* phase chain (which is the right place for that detail). The
|
|
125
|
+
* workspace explainer should only convey the unit + that multiple
|
|
126
|
+
* units coexist in a workspace.
|
|
127
|
+
*
|
|
128
|
+
* Each card is 18 visible chars wide (`┌─ exploration ──┐`); 3 cards
|
|
129
|
+
* + 2 separators (2 spaces each) = 18*3 + 4 = 58 chars, well within
|
|
130
|
+
* the BOX_WIDTH - 8 = 70 inner budget.
|
|
131
|
+
*/
|
|
132
|
+
function renderExplorationCardsRow(persona) {
|
|
133
|
+
const titles = persona.sampleExplorations;
|
|
134
|
+
// Card body width (inside the side `│ … │` chars). Matches the
|
|
135
|
+
// width of the top/bottom borders so all three rows align cleanly.
|
|
136
|
+
const bodyW = 14;
|
|
137
|
+
// Wrap each title to 2 lines; pad the second line with empty so
|
|
138
|
+
// short titles still occupy the full card height.
|
|
139
|
+
const wrap = (s) => {
|
|
140
|
+
if (s.length <= bodyW)
|
|
141
|
+
return [s, ''];
|
|
142
|
+
const cut = s.slice(0, bodyW).lastIndexOf(' ');
|
|
143
|
+
if (cut <= 0)
|
|
144
|
+
return [s.slice(0, bodyW), s.slice(bodyW, 2 * bodyW)];
|
|
145
|
+
return [s.slice(0, cut), s.slice(cut + 1, cut + 1 + bodyW)];
|
|
146
|
+
};
|
|
147
|
+
const wrapped = titles.map(wrap);
|
|
148
|
+
const pad = (s) => s.padEnd(bodyW, ' ');
|
|
149
|
+
const top = '┌─ exploration ──┐';
|
|
150
|
+
const mid = '│';
|
|
151
|
+
const bot = '└────────────────┘';
|
|
152
|
+
const lines = [];
|
|
153
|
+
// Top border × 3
|
|
154
|
+
lines.push([top, top, top].join(' '));
|
|
155
|
+
// Title line 1 × 3
|
|
156
|
+
lines.push([wrapped[0][0], wrapped[1][0], wrapped[2][0]]
|
|
157
|
+
.map((t) => `${mid} ${pad(t)} ${mid}`)
|
|
158
|
+
.join(' '));
|
|
159
|
+
// Title line 2 × 3 (blank for short titles)
|
|
160
|
+
lines.push([wrapped[0][1], wrapped[1][1], wrapped[2][1]]
|
|
161
|
+
.map((t) => `${mid} ${pad(t)} ${mid}`)
|
|
162
|
+
.join(' '));
|
|
163
|
+
// Bottom border × 3
|
|
164
|
+
lines.push([bot, bot, bot].join(' '));
|
|
165
|
+
return lines;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Minimal box-drawing helpers. Local to this module to keep the
|
|
169
|
+
* file self-contained; if the workspace + build-flow explainers
|
|
170
|
+
* grow more shared box logic we can factor into a `box.ts`.
|
|
171
|
+
*/
|
|
172
|
+
const box = {
|
|
173
|
+
top(width, title) {
|
|
174
|
+
// Title sits at column 2, padded with ─ to fill width.
|
|
175
|
+
const stripped = stripAnsi(title);
|
|
176
|
+
const fillWidth = width - stripped.length - 4;
|
|
177
|
+
return `╭ ${title} ${'─'.repeat(Math.max(0, fillWidth))}╮`;
|
|
178
|
+
},
|
|
179
|
+
bottom(width) {
|
|
180
|
+
return '╰' + '─'.repeat(width - 2) + '╯';
|
|
181
|
+
},
|
|
182
|
+
padded(width, content) {
|
|
183
|
+
const stripped = stripAnsi(content);
|
|
184
|
+
const pad = ' '.repeat(Math.max(0, width - 2 - stripped.length));
|
|
185
|
+
return `│${content}${pad}│`;
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
/** Strip ANSI escape sequences so padding math is correct. */
|
|
189
|
+
function stripAnsi(s) {
|
|
190
|
+
// eslint-disable-next-line no-control-regex
|
|
191
|
+
return s.replace(/\x1b\[[0-9;]*m/g, '');
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=workspace-explainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-explainer.js","sourceRoot":"","sources":["../../src/lib/workspace-explainer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAsBH,0DAwFC;AAMD,oEAcC;AAhID,qCAA+E;AA0NtE,gGA1NoC,wBAAe,OA0NpC;AAzNxB,uDAAqF;AASrF,sEAAsE;AACtE,MAAM,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AO,KAAK,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC;IAC5D,CAAC;IACD,MAAM,CAAC,KAAa;QACnB,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;IAC1C,CAAC;IACD,MAAM,CAAC,KAAa,EAAE,OAAe;QACpC,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QACjE,OAAO,IAAI,OAAO,GAAG,GAAG,GAAG,CAAC;IAC7B,CAAC;CACD,CAAC;AAEF,8DAA8D;AAC9D,SAAS,SAAS,CAAC,CAAS;IAC3B,4CAA4C;IAC5C,OAAO,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -21,13 +21,14 @@ async function resolveProjectWorkspace(opts) {
|
|
|
21
21
|
return null;
|
|
22
22
|
}
|
|
23
23
|
const detection = (0, repo_name_1.detectRepoName)(opts.projectDir);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
// Concept-level "what is a workspace" copy AND the "Detected
|
|
25
|
+
// project name: foo (from cwd-basename)" line used to live here.
|
|
26
|
+
// Both moved out: the explainer above teaches the concept and
|
|
27
|
+
// already renders the workspace name in its title, so repeating
|
|
28
|
+
// "Detected project name: foo" in this prompt is redundant. The
|
|
29
|
+
// detected name still appears INSIDE the bind question itself
|
|
30
|
+
// (`Create new workspace "foo"…?`), which is where the user
|
|
31
|
+
// actually needs to see it to accept or rename.
|
|
31
32
|
console.log('');
|
|
32
33
|
let answer;
|
|
33
34
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-flow.js","sourceRoot":"","sources":["../../src/lib/workspace-flow.ts"],"names":[],"mappings":";;AAsEA,
|
|
1
|
+
{"version":3,"file":"workspace-flow.js","sourceRoot":"","sources":["../../src/lib/workspace-flow.ts"],"names":[],"mappings":";;AAsEA,0DA6FC;AAlKD,qDAI0B;AAC1B,2CAA6C;AAC7C,qCAAkC;AA+D3B,KAAK,UAAU,uBAAuB,CAC5C,IAA6B;IAE7B,kEAAkE;IAClE,MAAM,QAAQ,GAAG,IAAA,kCAAiB,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpD,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO;YACN,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,OAAO,EAAE,KAAK;SACd,CAAC;IACH,CAAC;IAED,kEAAkE;IAClE,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;IAEhE,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,uDAAuD;QACvD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,SAAS,GAAG,IAAA,0BAAc,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAElD,6DAA6D;IAC7D,iEAAiE;IACjE,8DAA8D;IAC9D,gEAAgE;IAChE,gEAAgE;IAChE,8DAA8D;IAC9D,4DAA4D;IAC5D,gDAAgD;IAChD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACJ,MAAM,GAAG,MAAM,IAAA,eAAM,EACpB,2BAA2B,SAAS,CAAC,IAAI,2CAA2C,CACpF,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,yCAAyC;QACzC,OAAO,CAAC,GAAG,CAAC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
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
"name": "@ritualai/cli",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Ritual CLI — scaffold AI coding agent skills + register MCP servers. Connects Claude Code, Cursor, Windsurf, Kiro, Gemini CLI, VS Code/Copilot, and Codex to Ritual Cloud.",
|
|
5
|
+
"private": false,
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://ritual.work/ritual-mcp/docs/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Ritual-Mobile/ritual-enterprise.git",
|
|
11
|
+
"directory": "apps/cli"
|
|
12
|
+
},
|
|
13
|
+
"author": "Ritual",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"ritual": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"skills",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build:skills": "node scripts/build-skills.js",
|
|
28
|
+
"build:ts": "tsc -p tsconfig.json",
|
|
29
|
+
"build": "pnpm run build:skills && pnpm run build:ts",
|
|
30
|
+
"dev": "tsx src/index.ts",
|
|
31
|
+
"clean": "rm -rf dist skills",
|
|
32
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
33
|
+
"test": "jest --passWithNoTests",
|
|
34
|
+
"prepublishOnly": "pnpm run clean && pnpm run build"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"commander": "^14.0.3",
|
|
38
|
+
"open": "^10.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@ritual/shared-types": "workspace:^",
|
|
42
|
+
"@types/jest": "^29.5.0",
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"ts-jest": "^29.1.0",
|
|
46
|
+
"tsx": "^4.19.0",
|
|
47
|
+
"typescript": "^5.0.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=20.0.0"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"ritual",
|
|
54
|
+
"mcp",
|
|
55
|
+
"ai-coding-agent",
|
|
56
|
+
"claude-code",
|
|
57
|
+
"cursor",
|
|
58
|
+
"windsurf",
|
|
59
|
+
"kiro",
|
|
60
|
+
"gemini-cli",
|
|
61
|
+
"copilot",
|
|
62
|
+
"codex"
|
|
63
|
+
],
|
|
64
|
+
"jest": {
|
|
65
|
+
"preset": "ts-jest",
|
|
66
|
+
"testEnvironment": "node",
|
|
67
|
+
"roots": [
|
|
68
|
+
"<rootDir>/src",
|
|
69
|
+
"<rootDir>/test"
|
|
70
|
+
],
|
|
71
|
+
"testMatch": [
|
|
72
|
+
"**/?(*.)+(spec|test).ts"
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
75
|
}
|
|
@@ -121,7 +121,7 @@ Store `workspace_id` for the rest of the flow.
|
|
|
121
121
|
|
|
122
122
|
If you created a new workspace, persist the binding to `.ritual/config.json` so future runs in this repo skip the workspace-selection prompt. Write it yourself if you have filesystem write access; otherwise show the user the JSON and have them save it.
|
|
123
123
|
|
|
124
|
-
**`.ritual/config.json` is committed to the repo — it is shared, not per-user.** Same model as `.eslintrc.json` or `tsconfig.json`: it binds this codebase to a Ritual workspace + pins team-level defaults (workspaceId
|
|
124
|
+
**`.ritual/config.json` is committed to the repo — it is shared, not per-user.** Same model as `.eslintrc.json` or `tsconfig.json`: it binds this codebase to a Ritual workspace + pins team-level defaults (`workspaceId`, `personaSlug` — set by `ritual init`'s FTUE — or the legacy `defaultTemplateId`). Everyone working on this repo wants the same values. Per-user state (PATs, auth tokens) lives in `~/.config/ritual/` and never in this file.
|
|
125
125
|
|
|
126
126
|
When you write the config, also write `.ritual/.gitignore` if it doesn't already exist so any future per-user state files in this directory get ignored while `config.json` itself stays tracked:
|
|
127
127
|
|
|
@@ -446,16 +446,48 @@ Templates shape the structure of considerations, the problem statement, and the
|
|
|
446
446
|
|
|
447
447
|
Resolution order:
|
|
448
448
|
|
|
449
|
-
1. **
|
|
449
|
+
1. **Persona-pinned default (preferred — FTUE-set).** Check `.ritual/config.json` for a `personaSlug` field. If present, that slug **is the template id** (Engineering template families are seeded with `schema.id === <slug>` — see `apps/cli/src/lib/persona-samples.ts`). Use it directly as `template_id` without calling `mcp__ritual__list_templates` and without pausing. This is the common case: the user picked a persona during `ritual init`'s FTUE, the slug was persisted to `.ritual/config.json`, and `/ritual build` should respect that pick.
|
|
450
450
|
|
|
451
|
-
|
|
451
|
+
**Frame this as a persona + scope-of-work confirmation, not a template confirmation.** "Template" is an internal noun the user hasn't seen — they picked a *persona* during FTUE and what they care about now is "is the persona right + what does that mean for this feature?" Use the `PERSONA_DISPLAY` table below to look up the friendly label from the slug.
|
|
452
452
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
>
|
|
456
|
-
>
|
|
453
|
+
User-visible (one short pause that confirms persona + lists the scope sections, NOT a tool-call prompt):
|
|
454
|
+
|
|
455
|
+
> You're set up as **{personaLabel}**.
|
|
456
|
+
>
|
|
457
|
+
> For this feature, we'll work through: scope · non-goals · requirements · acceptance criteria · dependencies · metrics · open questions.
|
|
458
|
+
>
|
|
459
|
+
> Sound right? Reply `go` to continue, or `change role` to pick a different persona.
|
|
460
|
+
|
|
461
|
+
Do **NOT** call `mcp__ritual__list_templates` in this branch. It's wasted ceremony — both for latency (round-trip + LLM context bloat) and for UX (pre-FTUE this step was a real decision; with `personaSlug` already pinned it's a confirmation prompt the user can't meaningfully act on).
|
|
462
|
+
|
|
463
|
+
**`PERSONA_DISPLAY` lookup table** (slug → label, mirrors `apps/cli/src/lib/persona-samples.ts#PERSONA_SAMPLES`). If the slug isn't here (a custom or future persona), fall back to humanizing the slug (e.g. `frontend-web` → `Frontend Web`):
|
|
464
|
+
|
|
465
|
+
| slug | label |
|
|
466
|
+
| --- | --- |
|
|
467
|
+
| backend-services | Backend Services |
|
|
468
|
+
| frontend-web | Frontend Web |
|
|
469
|
+
| data-engineering | Data Engineering |
|
|
470
|
+
| ml-engineering | ML Engineering |
|
|
471
|
+
| platform-engineering | Platform Engineering |
|
|
472
|
+
| security-engineering | Security Engineering |
|
|
473
|
+
| developer-tooling | Developer Tooling |
|
|
474
|
+
| embedded-firmware | Embedded / Firmware |
|
|
475
|
+
| game-development | Game Development |
|
|
476
|
+
| smart-contracts | Smart Contracts |
|
|
477
|
+
| desktop-apps | Desktop Apps |
|
|
478
|
+
| qa-engineering | QA Engineering |
|
|
457
479
|
|
|
458
|
-
|
|
480
|
+
**If user replies `change role`** (or `template: list`, retained as a power-user alias): fall through to Branch 3 (`list_templates`). Otherwise treat any non-empty reply that isn't a recognized override command as `go`.
|
|
481
|
+
|
|
482
|
+
2. **Legacy template pin.** If `personaSlug` is missing but `.ritual/config.json` has the legacy `defaultTemplateId` field (older inits before FTUE), use that as `template_id` without pausing. Same confirmation shape as Branch 1, but the role name comes from the template — call `mcp__ritual__list_templates` ONCE to resolve the display name (the legacy pin gave us an id, not a label), then show:
|
|
483
|
+
|
|
484
|
+
> You're set up with **{templateName}**.
|
|
485
|
+
>
|
|
486
|
+
> For this feature, we'll work through: scope · non-goals · requirements · acceptance criteria · dependencies · metrics · open questions.
|
|
487
|
+
>
|
|
488
|
+
> Sound right? Reply `go` to continue, or `change role` to pick a different persona.
|
|
489
|
+
|
|
490
|
+
3. **No pin — pick a recommended default + offer alternatives.** Only when neither `personaSlug` nor `defaultTemplateId` is set, call `mcp__ritual__list_templates`. From the response, pick the first template matching this fallback chain:
|
|
459
491
|
- Name matches `/Feature Specification.*Agentic Coding/i` — canonical default for code-aware builds
|
|
460
492
|
- Name matches `/Technical Detail PRD/i`
|
|
461
493
|
- Name matches `/Engineering Spec|Technical (Detail|Spec)/i`
|
|
@@ -468,13 +500,13 @@ Resolution order:
|
|
|
468
500
|
>
|
|
469
501
|
> Reply `go`, `list`, or `template: {name}`.
|
|
470
502
|
|
|
471
|
-
|
|
503
|
+
4. **If the user types `list`** (in any branch, override path): call `mcp__ritual__list_templates` if you haven't yet, then present a numbered menu of all SYSTEM-type templates. Skip CUSTOM templates by default to avoid menu sprawl unless the user gives a specific custom id/name. Each line: `{N}. {name} — {short description}`. Wait for a number selection.
|
|
472
504
|
|
|
473
|
-
|
|
505
|
+
5. **If the user types `template: {name}` or picks one by name:** call `mcp__ritual__list_templates` if you haven't yet, then find the case-insensitive partial match. If ambiguous, show only the matching options and ask which one. If no match, show the SYSTEM template menu.
|
|
474
506
|
|
|
475
|
-
|
|
507
|
+
6. **Remember `template_id`.** It passes through every subsequent phase — `generate_considerations`, `refine_considerations`, `generate_problem_statement`, `refine_problem_statement`, and ultimately `create_exploration`. The API uses it to load template-specific anti-patterns + focus keywords into the LLM prompt, so it materially shapes output quality.
|
|
476
508
|
|
|
477
|
-
|
|
509
|
+
7. **Track role silently.** Infer `role` from the selected template and carry it forward for:
|
|
478
510
|
- recommendation tone
|
|
479
511
|
- sibling exploration cap
|
|
480
512
|
- Step 8 run-mode default
|
|
@@ -501,11 +533,15 @@ Resolution order:
|
|
|
501
533
|
|
|
502
534
|
If the user corrects the role (e.g. "actually I'm building a PRD"), update internal role tracking. Do **not** re-pick the template unless the user explicitly asks to change it.
|
|
503
535
|
|
|
504
|
-
|
|
536
|
+
8. **Suggest persistence only when useful.** If you got here via Branch 3 (no pinned default, you picked one from the list), AND the user accepted with `go` rather than picking a different one, suggest:
|
|
505
537
|
|
|
506
538
|
> Want me to pin this template for future `/ritual build` runs in this repo? I can add `"defaultTemplateId": "{id}"` to `.ritual/config.json`.
|
|
507
539
|
|
|
508
|
-
If the user says yes, write the field while preserving existing keys.
|
|
540
|
+
If the user says yes, write the field while preserving existing keys. Use the `defaultTemplateId` field (not `personaSlug`) when the user picked a template directly — `personaSlug` is reserved for the FTUE persona pick (where the slug semantically maps to one of the 12 Engineering personas). The SKILL reads `personaSlug` first, then `defaultTemplateId`, so either field works as a pin; the distinction is provenance.
|
|
541
|
+
|
|
542
|
+
This is a TEAM pin — `.ritual/config.json` is committed to the repo per Step 1, so the whole team picks up the same default.
|
|
543
|
+
|
|
544
|
+
**Do NOT suggest persistence in Branches 1 or 2** (persona-pinned or legacy-pinned). The pin already exists; offering to write it would be confusing.
|
|
509
545
|
|
|
510
546
|
Proceed to Step 3 once a template is selected. No extra confirmation is required after a pinned template or an accepted default.
|
|
511
547
|
|
|
@@ -1061,6 +1097,7 @@ Call `mcp__ritual__create_exploration` with:
|
|
|
1061
1097
|
- `workspace_id`
|
|
1062
1098
|
- `name`
|
|
1063
1099
|
- `problem_statement` (the scope from Step 5)
|
|
1100
|
+
- `template_id` — **REQUIRED.** Pass the same `template_id` used in Steps 4 and 5 (the one established in Step 2 from `personaSlug` / `defaultTemplateId` / picker). The exploration must carry this forward so downstream `start_agentic_run`, `get_recommendations`, and `generate_build_brief` load the right template-specific anti-patterns + focus keywords into the LLM prompts. Skipping `template_id` here silently falls back to the API default, which produces generic recs that don't match the persona's scope contract — the symptom is brief sections that don't align with what the user was promised at Step 2 ("For this feature, we'll work through: scope · non-goals · requirements …"). Always include it; the MCP tool accepts it (see `apps/mcp/src/mcp/tools/create-exploration.tool.ts:78`).
|
|
1064
1101
|
- `agentic: false` — **do NOT** pass `agentic: true`. We want explicit per-step control so the user gets to pick discovery questions in Step 7. Auto-agentic skips that.
|
|
1065
1102
|
|
|
1066
1103
|
Store `exploration_id`. Move the progress header from Scope to Discovery:
|