@ritualai/cli 0.6.0 → 0.7.1
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/README.md +45 -16
- package/dist/index.js +0 -0
- package/dist/lib/oidc.js +60 -3
- package/dist/lib/oidc.js.map +1 -1
- package/package.json +73 -64
- package/skills/claude-code/ritual/DESIGN.md +35 -0
- package/skills/claude-code/ritual/SKILL.md +43 -370
- package/skills/claude-code/ritual/agents/openai.yaml +5 -0
- package/skills/claude-code/ritual/references/async-polling.md +26 -0
- package/skills/claude-code/ritual/references/build-flow.md +1449 -0
- package/skills/claude-code/ritual/references/cli-output-contract.md +135 -0
- package/skills/claude-code/ritual/references/context-pulse-flow.md +356 -0
- package/skills/claude-code/ritual/references/discovery-classification.md +175 -0
- package/skills/claude-code/ritual/references/lineage-flow.md +152 -0
- package/skills/claude-code/ritual/references/resume-flow.md +156 -0
- package/skills/claude-code/ritual/references/scoring-fallback.md +125 -0
- package/skills/codex/ritual/DESIGN.md +35 -0
- package/skills/codex/ritual/SKILL.md +43 -370
- package/skills/codex/ritual/agents/openai.yaml +5 -0
- package/skills/codex/ritual/references/async-polling.md +26 -0
- package/skills/codex/ritual/references/build-flow.md +1449 -0
- package/skills/codex/ritual/references/cli-output-contract.md +135 -0
- package/skills/codex/ritual/references/context-pulse-flow.md +356 -0
- package/skills/codex/ritual/references/discovery-classification.md +175 -0
- package/skills/codex/ritual/references/lineage-flow.md +152 -0
- package/skills/codex/ritual/references/resume-flow.md +156 -0
- package/skills/codex/ritual/references/scoring-fallback.md +125 -0
- package/skills/cursor/ritual/DESIGN.md +35 -0
- package/skills/cursor/ritual/SKILL.md +43 -370
- package/skills/cursor/ritual/agents/openai.yaml +5 -0
- package/skills/cursor/ritual/references/async-polling.md +26 -0
- package/skills/cursor/ritual/references/build-flow.md +1449 -0
- package/skills/cursor/ritual/references/cli-output-contract.md +135 -0
- package/skills/cursor/ritual/references/context-pulse-flow.md +356 -0
- package/skills/cursor/ritual/references/discovery-classification.md +175 -0
- package/skills/cursor/ritual/references/lineage-flow.md +152 -0
- package/skills/cursor/ritual/references/resume-flow.md +156 -0
- package/skills/cursor/ritual/references/scoring-fallback.md +125 -0
- package/skills/gemini/ritual/DESIGN.md +35 -0
- package/skills/gemini/ritual/SKILL.md +43 -370
- package/skills/gemini/ritual/agents/openai.yaml +5 -0
- package/skills/gemini/ritual/references/async-polling.md +26 -0
- package/skills/gemini/ritual/references/build-flow.md +1449 -0
- package/skills/gemini/ritual/references/cli-output-contract.md +135 -0
- package/skills/gemini/ritual/references/context-pulse-flow.md +356 -0
- package/skills/gemini/ritual/references/discovery-classification.md +175 -0
- package/skills/gemini/ritual/references/lineage-flow.md +152 -0
- package/skills/gemini/ritual/references/resume-flow.md +156 -0
- package/skills/gemini/ritual/references/scoring-fallback.md +125 -0
- package/skills/kiro/ritual/DESIGN.md +35 -0
- package/skills/kiro/ritual/SKILL.md +43 -370
- package/skills/kiro/ritual/agents/openai.yaml +5 -0
- package/skills/kiro/ritual/references/async-polling.md +26 -0
- package/skills/kiro/ritual/references/build-flow.md +1449 -0
- package/skills/kiro/ritual/references/cli-output-contract.md +135 -0
- package/skills/kiro/ritual/references/context-pulse-flow.md +356 -0
- package/skills/kiro/ritual/references/discovery-classification.md +175 -0
- package/skills/kiro/ritual/references/lineage-flow.md +152 -0
- package/skills/kiro/ritual/references/resume-flow.md +156 -0
- package/skills/kiro/ritual/references/scoring-fallback.md +125 -0
- package/skills/vscode/ritual/DESIGN.md +35 -0
- package/skills/vscode/ritual/SKILL.md +43 -370
- package/skills/vscode/ritual/agents/openai.yaml +5 -0
- package/skills/vscode/ritual/references/async-polling.md +26 -0
- package/skills/vscode/ritual/references/build-flow.md +1449 -0
- package/skills/vscode/ritual/references/cli-output-contract.md +135 -0
- package/skills/vscode/ritual/references/context-pulse-flow.md +356 -0
- package/skills/vscode/ritual/references/discovery-classification.md +175 -0
- package/skills/vscode/ritual/references/lineage-flow.md +152 -0
- package/skills/vscode/ritual/references/resume-flow.md +156 -0
- package/skills/vscode/ritual/references/scoring-fallback.md +125 -0
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ The Ritual CLI. Connects your AI coding agent (Claude Code, Cursor,
|
|
|
4
4
|
Codex, Kiro, Gemini CLI, Windsurf, etc.) to Ritual Cloud via the
|
|
5
5
|
[Model Context Protocol][mcp].
|
|
6
6
|
|
|
7
|
+
Docs: [ritual.work/ritual-mcp/docs/](https://ritual.work/ritual-mcp/docs/)
|
|
8
|
+
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
11
|
```bash
|
|
@@ -50,8 +52,34 @@ cached and refreshed automatically).
|
|
|
50
52
|
the MCP server config (`claude mcp add-json` for Claude Code, or
|
|
51
53
|
`mcp.json` merge for the others) with the PAT as the Bearer.
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
## After `ritual init` — close and reopen your agent
|
|
56
|
+
|
|
57
|
+
The CLI registers the MCP server, but every agent caches its MCP
|
|
58
|
+
config at startup. **You must fully close and reopen the agent**
|
|
59
|
+
for the `ritual` server to come online. Reloading the window or
|
|
60
|
+
running `/clear` is usually NOT enough — kill the process and start
|
|
61
|
+
a fresh one.
|
|
62
|
+
|
|
63
|
+
After restarting, verify the registration landed:
|
|
64
|
+
|
|
65
|
+
| Agent | How to verify |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Claude Code | `claude mcp list` from any terminal — `ritual` should appear, status `●` (green). Or `/mcp` inside Claude Code. |
|
|
68
|
+
| Cursor | Settings → MCP → look for `ritual` server with a green toggle. Or `cat ~/.cursor/mcp.json` and confirm `mcpServers.ritual` is present. |
|
|
69
|
+
| Windsurf | Settings → Plugins / MCP → look for `ritual`. Or `cat ~/.codeium/windsurf/mcp_config.json`. |
|
|
70
|
+
| Kiro | Settings → MCP Servers → confirm `ritual` is listed. Or `cat ~/.kiro/mcp.json`. |
|
|
71
|
+
| Gemini CLI | `cat ~/.gemini/mcp.json` — `mcpServers.ritual` should be present. (Gemini's `mcp list` subcommand isn't available in every build yet.) |
|
|
72
|
+
| VS Code (Copilot) | Open the Copilot Chat panel → click the MCP icon → confirm `ritual` is listed and enabled. Or `cat ~/.vscode/mcp.json` — note the top-level key is `servers`, not `mcpServers`. |
|
|
73
|
+
| Codex | `cat ~/.codex/mcp.json` and confirm `mcpServers.ritual` is present. |
|
|
74
|
+
|
|
75
|
+
If `ritual` is missing from your agent, run `ritual doctor` to see
|
|
76
|
+
which agents were detected and which got the MCP registration. Common
|
|
77
|
+
causes: agent installed in a non-standard location, or the agent was
|
|
78
|
+
running during `init` and cached the old config (close + reopen).
|
|
79
|
+
|
|
80
|
+
Once you see `ritual` registered, try `/ritual build <feature>`
|
|
81
|
+
inside the agent. The CLI is now out of the way — everything happens
|
|
82
|
+
via the agent's MCP client talking to Ritual Cloud.
|
|
55
83
|
|
|
56
84
|
## Commands
|
|
57
85
|
|
|
@@ -69,7 +97,7 @@ The agent ids are: `claude-code`, `cursor`, `windsurf`, `kiro`,
|
|
|
69
97
|
for a specific one without auto-detecting (handy when you've got the
|
|
70
98
|
agent installed somewhere non-standard).
|
|
71
99
|
|
|
72
|
-
## How refresh works
|
|
100
|
+
## How refresh works
|
|
73
101
|
|
|
74
102
|
Keycloak issues a short-lived access token (~5 min by default) and a
|
|
75
103
|
longer-lived refresh token (~30 min). The CLI handles this transparently:
|
|
@@ -104,27 +132,24 @@ secret, no manual API key copy-paste.
|
|
|
104
132
|
|
|
105
133
|
## Override defaults
|
|
106
134
|
|
|
107
|
-
|
|
135
|
+
The CLI points at Ritual Cloud by default. To point it at a different
|
|
136
|
+
Ritual deployment (a self-hosted instance, an enterprise tenant, or
|
|
137
|
+
a staging environment), set environment variables:
|
|
108
138
|
|
|
109
139
|
```bash
|
|
110
|
-
|
|
140
|
+
export RITUAL_KEYCLOAK_URL=https://<your-keycloak-host>/realms/<realm>
|
|
141
|
+
export RITUAL_API_URL=https://<your-api-host>
|
|
142
|
+
ritual login
|
|
111
143
|
```
|
|
112
144
|
|
|
113
|
-
|
|
145
|
+
Or pass `--issuer` to `ritual login` for a one-off override:
|
|
114
146
|
|
|
115
147
|
```bash
|
|
116
|
-
|
|
117
|
-
ritual login
|
|
148
|
+
ritual login --issuer https://<your-keycloak-host>/realms/<realm>
|
|
118
149
|
```
|
|
119
150
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- Per-agent skill *format transforms* (currently every agent gets the
|
|
123
|
-
same SKILL.md; future versions emit Cursor `.mdc`, Kiro YAML,
|
|
124
|
-
Gemini's specific frontmatter).
|
|
125
|
-
- Workflow commands (`ritual explore`, `ritual run`, `ritual brief`)
|
|
126
|
-
that wrap the MCP tools so you can drive Ritual from the terminal
|
|
127
|
-
outside an agent session.
|
|
151
|
+
`ritual doctor` prints the effective endpoints so you can confirm
|
|
152
|
+
the override took.
|
|
128
153
|
|
|
129
154
|
## Security notes
|
|
130
155
|
|
|
@@ -136,5 +161,9 @@ ritual login
|
|
|
136
161
|
client secret). PKCE is what makes this safe — only the CLI process
|
|
137
162
|
that generated the verifier can exchange the code.
|
|
138
163
|
|
|
164
|
+
## License
|
|
165
|
+
|
|
166
|
+
Apache-2.0. See [LICENSE](./LICENSE) for the full text.
|
|
167
|
+
|
|
139
168
|
[mcp]: https://modelcontextprotocol.io
|
|
140
169
|
[rfc8252]: https://datatracker.ietf.org/doc/html/rfc8252
|
package/dist/index.js
CHANGED
|
File without changes
|
package/dist/lib/oidc.js
CHANGED
|
@@ -17,14 +17,32 @@ function generatePkce() {
|
|
|
17
17
|
* Spin up a one-shot loopback server on a random port. Resolves with
|
|
18
18
|
* the captured `?code=...&state=...` query params from the OAuth
|
|
19
19
|
* redirect. Rejects on timeout (default 5 min) or error response.
|
|
20
|
+
*
|
|
21
|
+
* The timeout path is the common failure mode for new users who have
|
|
22
|
+
* to click an email-verification link: by the time the verification
|
|
23
|
+
* email arrives + the user notices + clicks, the 5-minute window has
|
|
24
|
+
* elapsed and Keycloak's redirect lands on a port we no longer hold.
|
|
25
|
+
* Phase 1 of the back-to-terminal UX (R1, 2026-05-12) gives those
|
|
26
|
+
* users a recoverable landing page on the web app
|
|
27
|
+
* (`/auth/cli-success`); the timeout error below points them at it.
|
|
28
|
+
*
|
|
29
|
+
* Phase 2 (Device Authorization Grant, RFC 8628) replaces this whole
|
|
30
|
+
* flow with one that doesn't depend on the original browser/CLI
|
|
31
|
+
* staying linked, eliminating the timeout class entirely.
|
|
20
32
|
*/
|
|
21
|
-
function awaitAuthorizationRedirect(timeoutMs = 5 * 60 * 1000) {
|
|
33
|
+
function awaitAuthorizationRedirect(issuer, timeoutMs = 5 * 60 * 1000) {
|
|
22
34
|
let port = 0;
|
|
23
35
|
let serverRef;
|
|
24
36
|
const promise = new Promise((resolve, reject) => {
|
|
25
37
|
const timer = setTimeout(() => {
|
|
26
38
|
serverRef.close();
|
|
27
|
-
|
|
39
|
+
const fallback = cliSuccessFallbackUrl(issuer);
|
|
40
|
+
reject(new Error(`Login timed out — no callback received within 5 minutes.\n` +
|
|
41
|
+
` If you were asked to verify your email, the verification link's redirect\n` +
|
|
42
|
+
` came back after this CLI gave up listening. Recover with one of:\n` +
|
|
43
|
+
` 1. Re-run \`ritual login\` and click the verification link sooner, OR\n` +
|
|
44
|
+
` 2. Finish signing in at ${fallback} and copy a token back.\n` +
|
|
45
|
+
` The second option works even if you opened the email on a different device.`));
|
|
28
46
|
}, timeoutMs);
|
|
29
47
|
const server = (0, node_http_1.createServer)((req, res) => {
|
|
30
48
|
if (!req.url) {
|
|
@@ -83,7 +101,7 @@ async function performLoginFlow(cfg, openBrowser, log) {
|
|
|
83
101
|
const state = base64url((0, node_crypto_1.randomBytes)(16));
|
|
84
102
|
// Bind loopback server FIRST so we know which port to put in the
|
|
85
103
|
// redirect URI before sending the user off to Keycloak.
|
|
86
|
-
const { server, promise } = awaitAuthorizationRedirect();
|
|
104
|
+
const { server, promise } = awaitAuthorizationRedirect(cfg.issuer);
|
|
87
105
|
// Wait one tick for `listen()` to populate the port.
|
|
88
106
|
await new Promise((r) => setImmediate(r));
|
|
89
107
|
const addr = server.address();
|
|
@@ -195,6 +213,45 @@ function decodeJwtPayloadUnsafe(token) {
|
|
|
195
213
|
return null;
|
|
196
214
|
}
|
|
197
215
|
}
|
|
216
|
+
/**
|
|
217
|
+
* Build the web-app URL the user can visit to recover from a stuck
|
|
218
|
+
* CLI flow. Mirrors `webAppUrlFromIssuer` in commands/init.ts (kept
|
|
219
|
+
* separate to avoid a circular import between commands/ and lib/).
|
|
220
|
+
*
|
|
221
|
+
* Maps:
|
|
222
|
+
* auth.dev.ritualapp.cloud → dev.ritualapp.cloud/auth/signin?source=cli
|
|
223
|
+
* auth.ritualapp.cloud → app.ritualapp.cloud/auth/signin?source=cli
|
|
224
|
+
* self-hosted auth.<customer>.* → app.<customer>.* (best-effort)
|
|
225
|
+
*
|
|
226
|
+
* The `?source=cli` query param is read by the web app's signin /
|
|
227
|
+
* signup pages and routes the post-auth landing to /auth/cli-success
|
|
228
|
+
* instead of the dashboard. See
|
|
229
|
+
* apps/web/src/routes/(public)/auth/cli-success/+page.svelte for the
|
|
230
|
+
* full UX.
|
|
231
|
+
*/
|
|
232
|
+
function cliSuccessFallbackUrl(issuer) {
|
|
233
|
+
try {
|
|
234
|
+
const u = new node_url_1.URL(issuer);
|
|
235
|
+
const host = u.host;
|
|
236
|
+
let appHost;
|
|
237
|
+
if (host.startsWith('auth.dev.')) {
|
|
238
|
+
appHost = 'dev.ritualapp.cloud';
|
|
239
|
+
}
|
|
240
|
+
else if (host === 'auth.ritualapp.cloud') {
|
|
241
|
+
appHost = 'app.ritualapp.cloud';
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
appHost = host.replace(/^auth\./, 'app.');
|
|
245
|
+
}
|
|
246
|
+
return `https://${appHost}/auth/signin?source=cli`;
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// Issuer URL malformed — fall back to the prod app domain.
|
|
250
|
+
// The user can still navigate; just won't match a self-hosted
|
|
251
|
+
// install's domain.
|
|
252
|
+
return 'https://app.ritualapp.cloud/auth/signin?source=cli';
|
|
253
|
+
}
|
|
254
|
+
}
|
|
198
255
|
// ─── small html helpers for the loopback browser response ──────────────────
|
|
199
256
|
function htmlPage(title, body) {
|
|
200
257
|
return `<!doctype html><html><head><meta charset="utf-8"><title>${escapeHtml(title)}</title>
|
package/dist/lib/oidc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc.js","sourceRoot":"","sources":["../../src/lib/oidc.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"oidc.js","sourceRoot":"","sources":["../../src/lib/oidc.ts"],"names":[],"mappings":";;;AAsKA,4CA8DC;AAYD,sCA0BC;AAyBD,wDAQC;AA3SD,6CAAsD;AACtD,yCAAiG;AACjG,uCAA+B;AA6C/B,MAAM,SAAS,GAAG,CAAC,GAAW,EAAU,EAAE,CACzC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAEnF,SAAS,YAAY;IACpB,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAA,yBAAW,EAAC,EAAE,CAAC,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,SAAS,CAAC,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,0BAA0B,CAClC,MAAc,EACd,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;IAMzB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,SAAkB,CAAC;IAEvB,MAAM,OAAO,G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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
2
|
+
"name": "@ritualai/cli",
|
|
3
|
+
"version": "0.7.1",
|
|
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
|
+
"dependencies": {
|
|
27
|
+
"commander": "^14.0.3",
|
|
28
|
+
"open": "^10.1.0",
|
|
29
|
+
"@ritual/shared-types": "^1.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/jest": "^29.5.0",
|
|
33
|
+
"@types/node": "^20.0.0",
|
|
34
|
+
"jest": "^29.7.0",
|
|
35
|
+
"ts-jest": "^29.1.0",
|
|
36
|
+
"tsx": "^4.19.0",
|
|
37
|
+
"typescript": "^5.0.0"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"ritual",
|
|
44
|
+
"mcp",
|
|
45
|
+
"ai-coding-agent",
|
|
46
|
+
"claude-code",
|
|
47
|
+
"cursor",
|
|
48
|
+
"windsurf",
|
|
49
|
+
"kiro",
|
|
50
|
+
"gemini-cli",
|
|
51
|
+
"copilot",
|
|
52
|
+
"codex"
|
|
53
|
+
],
|
|
54
|
+
"jest": {
|
|
55
|
+
"preset": "ts-jest",
|
|
56
|
+
"testEnvironment": "node",
|
|
57
|
+
"roots": [
|
|
58
|
+
"<rootDir>/src",
|
|
59
|
+
"<rootDir>/test"
|
|
60
|
+
],
|
|
61
|
+
"testMatch": [
|
|
62
|
+
"**/?(*.)+(spec|test).ts"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build:skills": "node scripts/build-skills.js",
|
|
67
|
+
"build:ts": "tsc -p tsconfig.json",
|
|
68
|
+
"build": "pnpm run build:skills && pnpm run build:ts",
|
|
69
|
+
"dev": "tsx src/index.ts",
|
|
70
|
+
"clean": "rm -rf dist skills",
|
|
71
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
72
|
+
"test": "jest --passWithNoTests"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Ritual skill design notes
|
|
2
|
+
|
|
3
|
+
This file is for humans reviewing or maintaining the Ritual skill. Runtime instructions live in `SKILL.md` and `references/*.md`.
|
|
4
|
+
|
|
5
|
+
## Product intent
|
|
6
|
+
|
|
7
|
+
Ritual helps coding agents avoid jumping straight into implementation when the feature depends on context the agent cannot infer on its own: strategic intent, constraints, prior decisions, trade-offs, and non-obvious scope boundaries.
|
|
8
|
+
|
|
9
|
+
The workflow surfaces that context through targeted discovery questions, combines it with codebase signals and prior explorations, and produces a validated build brief before code is written.
|
|
10
|
+
|
|
11
|
+
## Why split the skill
|
|
12
|
+
|
|
13
|
+
The previous monolithic `SKILL.md` mixed runtime instructions with design rationale, fallback formulas, version history, and long branch handlers. That made it harder for an agent to follow the right path at runtime.
|
|
14
|
+
|
|
15
|
+
The split version keeps:
|
|
16
|
+
|
|
17
|
+
- `SKILL.md` as a dispatcher/control plane
|
|
18
|
+
- `references/*` as runtime procedure files loaded only when needed
|
|
19
|
+
- `DESIGN.md` as rationale and maintenance notes
|
|
20
|
+
|
|
21
|
+
## Retired `/ritual recon`
|
|
22
|
+
|
|
23
|
+
`/ritual recon` is intentionally not part of the vNext command surface. Its former workspace-history value is covered by `/ritual resume`; its file-decision-history value is covered by `/ritual lineage`; and its repo-reading behavior is normal coding-agent behavior in plain English.
|
|
24
|
+
|
|
25
|
+
## Context packet principle
|
|
26
|
+
|
|
27
|
+
The coding agent should contribute local codebase understanding, but not decide final scope itself. After recon, it produces a `codebase_context_packet` containing facts, evidence, hypotheses, confidence, scope pressure, corrections, and open questions. MCP/tooling remains responsible for generating and ranking final sub-problems and scope.
|
|
28
|
+
|
|
29
|
+
## Context pulse principle
|
|
30
|
+
|
|
31
|
+
Context pulse answers: can a reasoning system act safely on this yet? The primary user-facing score is Reasoning Readiness; Context Debt is the inverse. Server-side scoring is canonical for new pulses. Fallback formulas are only for older MCP servers or error recovery.
|
|
32
|
+
|
|
33
|
+
## Host assumptions
|
|
34
|
+
|
|
35
|
+
Designed primarily for Claude Code-style coding-agent sessions with filesystem, git, shell, and MCP access. Adapt commands as needed for Cursor or other agents with equivalent tools.
|