@ericrisco/rsc 4.1.2 → 4.1.4
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 +90 -2
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/scripts/doctor.js +68 -2
- package/scripts/install-apply.js +17 -8
- package/scripts/lib/cli-invocation.js +44 -0
- package/scripts/lib/manifest-file.js +2 -1
- package/scripts/lib/risk.js +6 -4
- package/scripts/rsc.js +39 -4
- package/skills/worktrees/SKILL.md +6 -0
- package/skills/worktrees/evals/cases.yaml +7 -0
- package/skills/worktrees/references/orca.md +64 -0
- package/targets/agents.js +13 -1
- package/targets/asdd-gate.mjs +401 -52
- package/targets/claude.js +1 -0
- package/targets/commands.js +2 -1
- package/targets/index.js +52 -3
- package/targets/risk-policy.mjs +424 -0
- package/targets/sello.mjs +35 -10
- package/targets/session-memory-adapter.mjs +7 -0
- package/targets/ship-guard.mjs +1 -1
- package/targets/spec-completeness.mjs +3 -2
- package/targets/worktree-reaper.mjs +42 -4
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
Keep your project knowledge, skills and working rules together across the assistants you already use.
|
|
16
16
|
Start with your goal. Review what rsc proposes to install. Accept the plan before it changes your project.
|
|
17
17
|
|
|
18
|
-
**MIT licensed · project-local setup ·
|
|
18
|
+
**MIT licensed · project-local setup · 19 assistant targets**
|
|
19
19
|
|
|
20
20
|
Give this URL to your agent and paste the request in the chat:
|
|
21
21
|
|
|
@@ -119,6 +119,12 @@ load progressively: only their description is paid for until a task needs them.
|
|
|
119
119
|
|
|
120
120
|
Prefer a short `rsc` command? `npm install -g @ericrisco/rsc`.
|
|
121
121
|
|
|
122
|
+
When an executable `rsc` is already on PATH, install and sync write operational skill and
|
|
123
|
+
command instructions using that installed CLI. This also applies to unversioned commands
|
|
124
|
+
suggested by hooks. Explicit versions such as `@4.1.1` and `@latest` keep their meaning.
|
|
125
|
+
No execution permission is added for this choice. If the CLI is removed, run sync using the
|
|
126
|
+
version declared in `.rsc.json` to restore the `npx` instructions.
|
|
127
|
+
|
|
122
128
|
> **Run it inside the project you are equipping, not inside a clone of this repo.** The catalog's own
|
|
123
129
|
> `package.json` is named `@ericrisco/rsc`, so `npx @ericrisco/rsc` from within a clone resolves to
|
|
124
130
|
> the local bin and fails with `sh: rsc: command not found`. Working on the catalog itself? Use
|
|
@@ -235,6 +241,12 @@ project. rsc handles four things by default:
|
|
|
235
241
|
| **The agent picks the method** | FTD for simple changes, ASDD for complex ones. The agent decides and says why. | Ask for the other lane |
|
|
236
242
|
| **Knowledge reaches everyone** | `01-TOOLS/`, `02-DOCS/wiki/` and `02-DOCS/attachments/` travel through one exchange branch, `rsc/knowledge`, and reach `main` inside your normal pull requests. | `rsc knowledge-sync off` |
|
|
237
243
|
|
|
244
|
+
**Orca worktrees.** Set `"worktreeManager": "orca"` in `.rsc.json` to retain externally managed
|
|
245
|
+
checkouts even when Orca is unavailable. rsc also recognises a matching Orca CLI response, and never
|
|
246
|
+
removes these checkouts through plain Git. [Setup and cleanup](skills/worktrees/references/orca.md)
|
|
247
|
+
use the pinned harness version and Orca's lifecycle hooks; workspace lineage does not silence
|
|
248
|
+
warnings about unverified concurrent sessions.
|
|
249
|
+
|
|
238
250
|
**How it knows a project is complex.** A hook counts what anyone can check: a CI setup, a deployment
|
|
239
251
|
file (`Dockerfile`, `vercel.json`, `fly.toml`…) or at least two people in the last 50 commits. The
|
|
240
252
|
answer you gave at install always wins over this detection.
|
|
@@ -367,18 +379,32 @@ The wizard asks which ones; `--target a,b` does it non-interactively.
|
|
|
367
379
|
| `amp` | `.amp/rsc/<id>/` → symlink | block in `AGENTS.md` |
|
|
368
380
|
| `opencode` | `.opencode/rsc/<id>/` → symlink | block in `AGENTS.md` |
|
|
369
381
|
| `deepseek` | `.dsh/skills/<id>/` → symlink (discovered natively) | block in `AGENTS.md` |
|
|
382
|
+
| `pi` | `.pi/skills/<id>/` → symlink (copy on Windows; discovered natively) | block in Pi's selected project context file |
|
|
370
383
|
| `jules` | `.jules/rsc/<id>/` → symlink | block in `AGENTS.md` |
|
|
371
384
|
| `junie` | `.junie/rsc/<id>/` → symlink | block in `.junie/guidelines.md` |
|
|
372
385
|
| `kiro` | `.kiro/rsc/<id>/` → symlink | doc in `.kiro/steering/rsc-suggest.md` |
|
|
373
386
|
| `aider` | `.aider/rsc/<id>/` → symlink | block in `CONVENTIONS.md` |
|
|
374
387
|
|
|
375
388
|
> `codex`, `zed`, `amp`, `opencode`, `deepseek` and `jules` share one root `AGENTS.md`; the block is
|
|
376
|
-
> written once.
|
|
389
|
+
> written once. Pi shares it when that is the context file its native loader selects.
|
|
377
390
|
|
|
378
391
|
> **DeepSeek Harness** (`dsh`) has no project-level hooks, so once per machine rsc adds one marked
|
|
379
392
|
> block to `~/.dsh/cordis.patch.yml` that runs the hooks of whichever project the session is in.
|
|
380
393
|
> Restart dsh once after the first install; delete the block to turn it off.
|
|
381
394
|
|
|
395
|
+
> **Pi:** select `--target pi` during onboarding, then run `/reload` in Pi to discover the
|
|
396
|
+
> installed skills. Invoke one explicitly with `/skill:<id>`. Pi loads project resources after
|
|
397
|
+
> project trust is granted; rsc preserves your `.pi/settings.json` and extensions.
|
|
398
|
+
> This target uses Pi's [native skills and context files](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/configuration.md).
|
|
399
|
+
> Its [context loader](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/src/core/resource-loader.ts)
|
|
400
|
+
> selects the first readable file in this order: `AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`,
|
|
401
|
+
> `CLAUDE.md`, `CLAUDE.MD`. rsc adds its marked block to that file, preserving your instructions;
|
|
402
|
+
> it creates `AGENTS.md` only when none exists. If a new override hides the block, doctor reports
|
|
403
|
+
> the missing wiring and sync writes the block into the selected file.
|
|
404
|
+
> It does not install a custom extension, subagents, automatic session-memory hooks, or tool guards.
|
|
405
|
+
> Pi has no built-in subagents; skills that require independent reviewers need an external review.
|
|
406
|
+
> The instructions request an update check on the first turn, as for other targets without a wired session hook.
|
|
407
|
+
|
|
382
408
|
| Targets | Stack agents | Native commands | Session memory |
|
|
383
409
|
| --- | --- | --- | --- |
|
|
384
410
|
| Claude Code | yes | agent + memory entries | full |
|
|
@@ -386,6 +412,7 @@ The wizard asks which ones; `--target a,b` does it non-interactively.
|
|
|
386
412
|
| Cursor desktop | yes | yes | assisted |
|
|
387
413
|
| Gemini CLI, OpenCode | yes | yes | full |
|
|
388
414
|
| DeepSeek Harness | unsupported | unsupported | full (machine bridge) |
|
|
415
|
+
| Pi | unsupported | native `/skill:<id>` (no generated command files) | unsupported |
|
|
389
416
|
| GitHub Copilot | yes | yes | unsupported |
|
|
390
417
|
| Junie, Kiro | yes | unsupported | unsupported |
|
|
391
418
|
| Windsurf, Cline, Roo | unsupported | yes | unsupported |
|
|
@@ -674,6 +701,67 @@ Most of this catalog is written here. These are not, and they keep their author'
|
|
|
674
701
|
Adapted, not mirrored: each carries rsc frontmatter, routing evals and hand-offs to its siblings. The
|
|
675
702
|
craft bar in them is the original author's.
|
|
676
703
|
|
|
704
|
+
### Shared risk policy and external branch checks
|
|
705
|
+
|
|
706
|
+
Commit `.rsc-risk.json` at the workspace root to share risk rules across clones and submodules:
|
|
707
|
+
|
|
708
|
+
```json
|
|
709
|
+
{
|
|
710
|
+
"version": 1,
|
|
711
|
+
"trunks": ["develop", "integration"],
|
|
712
|
+
"repositories": { "Catman": { "trunks": ["develop"] } },
|
|
713
|
+
"testRepos": ["CatmanTest"],
|
|
714
|
+
"rules": [
|
|
715
|
+
{ "class": "schema", "tier": 2, "path": "\\.Table\\.al$",
|
|
716
|
+
"removed": "^\\s*field\\s*\\(", "productionOnly": true,
|
|
717
|
+
"because": "Removing a field changes the stored schema." },
|
|
718
|
+
{ "class": "api", "tier": 2, "path": "\\.Page\\.al$",
|
|
719
|
+
"contains": "PageType\\s*=\\s*API", "removed": "APIVersion",
|
|
720
|
+
"because": "The API contract changes." },
|
|
721
|
+
{ "class": "platform", "tier": 2, "path": "(^|/)app\\.json$",
|
|
722
|
+
"jsonKeys": ["dependencies", "idRanges", "runtime"],
|
|
723
|
+
"because": "Dependencies or platform requirements change." },
|
|
724
|
+
{ "class": "editor", "tier": 0, "path": "^\\.vscode/settings\\.json$",
|
|
725
|
+
"because": "Editor preferences only." }
|
|
726
|
+
]
|
|
727
|
+
}
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
Rules can also use `added`, `deleted: true` and `repos: ["relative/path"]`. Conditions in one rule
|
|
731
|
+
must all match. `contains` reads the file before and after the change; `added` and `removed` read
|
|
732
|
+
changed lines with whitespace differences ignored. JSON keys are top-level keys. Renames are
|
|
733
|
+
checked as both old and new paths. Matching rules take their highest tier; explicit zero replaces
|
|
734
|
+
ordinary-code defaults, but built-in risk classes and the secrets/harness floors still apply.
|
|
735
|
+
Patterns are case-insensitive and limited to 200 characters; repeated groups, lookarounds and
|
|
736
|
+
backreferences are rejected. Content lines over 2,000 characters are skipped. Rule evaluation has
|
|
737
|
+
a hard one-second timeout and an 8 MiB input budget: exceeding either reports an error at tier 2.
|
|
738
|
+
At most 64 rules and 16 trunk candidates are supported.
|
|
739
|
+
|
|
740
|
+
`rsc risk` and the push gate use the policy **from the workspace trunk**, including repository
|
|
741
|
+
settings and exemptions. A proposed policy cannot relax its own outgoing branch. A policy first
|
|
742
|
+
added on a feature branch stays inactive until it lands. Use `rsc risk --policy-preview` to inspect
|
|
743
|
+
the proposed policy explicitly; the output identifies its source. Local `.rsc/sello-config.json`
|
|
744
|
+
remains available for existing settings and bootstrap. Initial trunk discovery uses `origin/HEAD`,
|
|
745
|
+
then `main`, `master` or `develop`; for another name, set the remote HEAD or the local `trunk` first.
|
|
746
|
+
Once a trusted policy exists, its trunk candidates select the nearest branch by commits ahead.
|
|
747
|
+
`rsc doctor` reports an installed ASDD gate that cannot find a trunk.
|
|
748
|
+
|
|
749
|
+
Specs accept `branches: [feature/a, fix/b]` or a YAML block list, as well as the existing `branch:`.
|
|
750
|
+
An FTD under `02-DOCS/wiki/ftd/` can link its branch to a spec with `spec: <slug>`. Optional trusted
|
|
751
|
+
`asddGate` settings are `require: "spec"` (default: full panel), `exemptBranches: ["^chore/back-merge-"]`
|
|
752
|
+
and `cherryPickSuffix: "-master"`. These settings take effect after the policy reaches the trunk.
|
|
753
|
+
|
|
754
|
+
External PR tools can run `rsc spec gate --branch-check --repo <directory> [--branch <name>]` from
|
|
755
|
+
the workspace, or run the same command inside a submodule. Exit `0` means allowed, `2` means denied,
|
|
756
|
+
and `1` means the check could not run. `--branch` evaluates that branch even when it is not checked
|
|
757
|
+
out. The hook resolves ordinary `git -C`, directory changes, shell `-c`/`eval` wrappers and `gh pr`
|
|
758
|
+
commands. Arbitrary scripts, aliases and shell functions need the explicit CLI check; their bodies
|
|
759
|
+
cannot be inferred from the shell invocation. This is a local review aid, not a remote-server policy.
|
|
760
|
+
|
|
761
|
+
Sync preserves opt-outs declared by teammates in `.rsc.json`. Existing local markers remain local
|
|
762
|
+
choices; doctor reports differences. To explicitly re-arm a team gate, remove its local marker and
|
|
763
|
+
run an explicit install, which records the new decision; sync alone does not erase the declaration.
|
|
764
|
+
|
|
677
765
|
## License
|
|
678
766
|
|
|
679
767
|
MIT. See [LICENSE](LICENSE).
|
package/manifest.json
CHANGED
package/package.json
CHANGED
package/scripts/doctor.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readPolicy } from '../targets/risk-policy.mjs';
|
|
1
2
|
import { hooksDir, hooksDirIsOurs, classifyWorktrees } from '../targets/worktree-reaper.mjs';
|
|
2
3
|
import { existsSync, readFileSync, readdirSync, statSync, realpathSync } from 'node:fs';
|
|
3
4
|
import { join, dirname, relative, sep } from 'node:path';
|
|
@@ -195,6 +196,62 @@ function ownSkillsIn(paths, declared = []) {
|
|
|
195
196
|
return { present: present.sort(), missing, declared };
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
// Diagnose the shipped capability-name defect without rejecting custom MCP tools or
|
|
200
|
+
// changing a user-owned file. Restrict parsing to the frontmatter's tools field.
|
|
201
|
+
function withoutYamlComment(line) {
|
|
202
|
+
let quote = null;
|
|
203
|
+
for (let i = 0; i < line.length; i++) {
|
|
204
|
+
const c = line[i];
|
|
205
|
+
if (quote === '"' && c === '\\') { i++; continue; }
|
|
206
|
+
if (quote && c === quote) {
|
|
207
|
+
if (quote === "'" && line[i + 1] === "'") { i++; continue; }
|
|
208
|
+
quote = null;
|
|
209
|
+
} else if (!quote && (c === '"' || c === "'")) quote = c;
|
|
210
|
+
else if (!quote && c === '#' && (i === 0 || /\s/.test(line[i - 1]))) return line.slice(0, i).trim();
|
|
211
|
+
}
|
|
212
|
+
return line.trim();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function invalidClaudeAgentTools(root, names) {
|
|
216
|
+
return names.flatMap((id) => {
|
|
217
|
+
const path = agentPath('claude', root, id);
|
|
218
|
+
let text;
|
|
219
|
+
try { text = readFileSync(path, 'utf8').replace(/^\uFEFF/, '').replace(/\r\n?/g, '\n'); } catch { return []; }
|
|
220
|
+
const fm = /^---\n([\s\S]*?)\n---(?:\n|$)/.exec(text)?.[1] || '';
|
|
221
|
+
const rawLines = fm.split('\n');
|
|
222
|
+
const index = rawLines.findIndex((line) => /^tools:/.test(line));
|
|
223
|
+
const lines = rawLines.map(withoutYamlComment);
|
|
224
|
+
if (index < 0) return [];
|
|
225
|
+
let value = lines[index].slice('tools:'.length).trim();
|
|
226
|
+
if (!value) {
|
|
227
|
+
for (const line of lines.slice(index + 1)) {
|
|
228
|
+
if (!line) continue;
|
|
229
|
+
if (!line.startsWith('- ')) break;
|
|
230
|
+
value += `${line}\n`;
|
|
231
|
+
}
|
|
232
|
+
} else if (value.startsWith('[') && !value.endsWith(']')) {
|
|
233
|
+
for (const line of lines.slice(index + 1)) {
|
|
234
|
+
if (/^[\w-]+:/.test(line)) break;
|
|
235
|
+
value += `\n${line}`;
|
|
236
|
+
if (line.endsWith(']')) break;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
const values = value.split(/,|\n/)
|
|
240
|
+
.map((s) => s.trim().replace(/^-\s*/, '').replace(/^[\["']+|[\]"']+$/g, '').trim());
|
|
241
|
+
const tools = [...new Set(values.filter((s) => ['read', 'search', 'edit', 'shell'].includes(s)))];
|
|
242
|
+
return tools.length ? [{ id, path, tools,
|
|
243
|
+
action: `Claude requires native tool names. Run \`rsc sync\`; if this agent was edited, review it or use \`rsc agents reset ${id}\` (backs up your version).`,
|
|
244
|
+
}] : [];
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function piInstructionsWired(file) {
|
|
249
|
+
try {
|
|
250
|
+
const text = readFileSync(file, 'utf8');
|
|
251
|
+
return /^<!-- rsc-suggest:start -->\r?$/m.test(text) && /^<!-- rsc-suggest:end -->\r?$/m.test(text);
|
|
252
|
+
} catch { return false; }
|
|
253
|
+
}
|
|
254
|
+
|
|
198
255
|
export function doctor({ target, home, cwd }) {
|
|
199
256
|
const root = cwd || process.cwd();
|
|
200
257
|
const paths = targetPaths(target, home, cwd);
|
|
@@ -242,7 +299,14 @@ export function doctor({ target, home, cwd }) {
|
|
|
242
299
|
installed: Object.keys(state.skills),
|
|
243
300
|
missing: [],
|
|
244
301
|
// Wired means it can actually run, not merely that the file declaring it is there.
|
|
245
|
-
hookWired: existsSync(paths.hookTarget) && missingHookScripts({ target, home, cwd }).length === 0
|
|
302
|
+
hookWired: existsSync(paths.hookTarget) && missingHookScripts({ target, home, cwd }).length === 0
|
|
303
|
+
&& (target !== 'pi' || piInstructionsWired(paths.hookTarget)),
|
|
304
|
+
...(target === 'pi' ? { contextFile: {
|
|
305
|
+
path: paths.hookTarget,
|
|
306
|
+
...(piInstructionsWired(paths.hookTarget) ? {} : {
|
|
307
|
+
action: 'Run `rsc sync` to restore the managed instructions in the context file Pi currently selects.',
|
|
308
|
+
}),
|
|
309
|
+
} } : {}),
|
|
246
310
|
manifestSkills: manifest.counts.skills,
|
|
247
311
|
backups: {
|
|
248
312
|
exists: existsSync(join(root, '.rsc', 'backups')),
|
|
@@ -257,6 +321,7 @@ export function doctor({ target, home, cwd }) {
|
|
|
257
321
|
worktreeHygiene: worktreeHygiene(root),
|
|
258
322
|
ownSkills: ownSkillsIn(paths, readProjectManifest(root)?.ownSkills || []),
|
|
259
323
|
sello: selloStatus(root),
|
|
324
|
+
asddGate: existsSync(join(root, '.rsc', '.no-asdd-gate')) ? { state: 'off-by-choice' } : existsSync(join(root, '.rsc', 'asdd-gate.mjs')) ? (() => { const p = readPolicy(root); return { state: p.error ? 'invalid-policy' : p.trunk ? 'ready' : 'no-trunk', trunk: p.trunk, policySource: p.source, ...(p.error || !p.trunk ? { action: p.error || 'Set origin/HEAD or configure a trunk before relying on ASDD branch checks.' } : {}) }; })() : { state: 'not-installed' },
|
|
260
325
|
// An inert gate must never read as an armed one (the same rule the sello follows):
|
|
261
326
|
// the gitmoji guard has a per-project kill switch, so say which state it is in.
|
|
262
327
|
gitmojiGuard: state.policy?.gitmojiGuard === false
|
|
@@ -274,6 +339,7 @@ export function doctor({ target, home, cwd }) {
|
|
|
274
339
|
automationGaps: countGaps(root),
|
|
275
340
|
memory,
|
|
276
341
|
missingAgents,
|
|
342
|
+
invalidAgentTools: target === 'claude' ? invalidClaudeAgentTools(root, state.agents || []) : [],
|
|
277
343
|
agentCollisions: state.agentCollisions || [],
|
|
278
344
|
// #298 — generated agents the user edited and sync kept as they are. Not unhealthy: theirs on
|
|
279
345
|
// purpose. Named with the way back, so a stale edit is one command from rsc's version.
|
|
@@ -307,7 +373,7 @@ export function doctor({ target, home, cwd }) {
|
|
|
307
373
|
report.onboarding = { status: 'incomplete', missing: ['<onboarding readiness could not be read>'], pending: [], action: String(error?.message || error).slice(0, 200) };
|
|
308
374
|
}
|
|
309
375
|
report.healthy = report.hookWired && !report.missing.length && !missingAgents.length && !missingCommands.length
|
|
310
|
-
&& !report.opencodePluginsOutdated.length;
|
|
376
|
+
&& !report.opencodePluginsOutdated.length && !report.invalidAgentTools.length;
|
|
311
377
|
return report;
|
|
312
378
|
}
|
|
313
379
|
|
package/scripts/install-apply.js
CHANGED
|
@@ -4,6 +4,7 @@ import { join, dirname, relative, resolve, sep } from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { spawnSync } from 'node:child_process';
|
|
6
6
|
import { planInstall } from './install-plan.js';
|
|
7
|
+
import { installedCli, materializeCliInstructions } from './lib/cli-invocation.js';
|
|
7
8
|
import { targetPaths, writeSkill, wireHook, unwireHook, baseDir, TARGET_IDS } from '../targets/index.js';
|
|
8
9
|
import { shadowTarget } from '../targets/agents-md-shadow.js';
|
|
9
10
|
import {
|
|
@@ -59,13 +60,16 @@ function writeBaseVersions(cwd, versions) {
|
|
|
59
60
|
// overwriting on a version change is safe. Mutates `baseVersions` with the new mark.
|
|
60
61
|
function ensureBase(id, cwd, baseVersions) {
|
|
61
62
|
const dest = baseDir(id, cwd);
|
|
62
|
-
const
|
|
63
|
+
const local = installedCli();
|
|
64
|
+
const stamp = `${CLI_VERSION}:${local ? 'rsc' : 'npx'}`;
|
|
65
|
+
const stale = baseVersions[id] !== stamp;
|
|
63
66
|
if (stale && existsSync(dest)) rmSync(dest, { recursive: true, force: true });
|
|
64
67
|
if (!existsSync(dest)) {
|
|
65
68
|
mkdirSync(dirname(dest), { recursive: true });
|
|
66
69
|
cpSync(join(ROOT, 'skills', id), dest, { recursive: true });
|
|
70
|
+
materializeCliInstructions(dest, local);
|
|
67
71
|
}
|
|
68
|
-
baseVersions[id] =
|
|
72
|
+
baseVersions[id] = stamp;
|
|
69
73
|
return dest;
|
|
70
74
|
}
|
|
71
75
|
|
|
@@ -83,7 +87,7 @@ export function generatedHookFiles({ target, cwd, policy }) {
|
|
|
83
87
|
join(cwd, '.rsc', 'worklog-checkpoint.mjs'),
|
|
84
88
|
join(cwd, '.rsc', 'hook-once.mjs'),
|
|
85
89
|
join(cwd, '.rsc', 'shell-unwrap.mjs'),
|
|
86
|
-
join(cwd, '.rsc', 'worktree-reaper.mjs'),
|
|
90
|
+
join(cwd, '.rsc', 'worktree-reaper.mjs'), join(cwd, '.rsc', 'risk-policy.mjs'),
|
|
87
91
|
join(cwd, '.rsc', 'auto-update.mjs'),
|
|
88
92
|
join(cwd, '.rsc', 'memslop-offer.mjs'),
|
|
89
93
|
// team-safe-default: the 3.0 start-up duties and the trunk policy (also read by branch-guard).
|
|
@@ -111,6 +115,8 @@ export function managedPathsForInstall({ skillIds, agentIds = [], target, home,
|
|
|
111
115
|
const paths = targetPaths(target, home, cwd);
|
|
112
116
|
const plan = planInstall({ skillIds, target, home, cwd, hooks: policy?.alwaysOn !== false });
|
|
113
117
|
const out = [paths.stateFile, versionFile(cwd), baseVersionsFile(cwd)];
|
|
118
|
+
// Pi can move its managed block when the native context-file precedence changes.
|
|
119
|
+
if (target === 'pi') out.push(...paths.contextFiles);
|
|
114
120
|
if (policy?.context7 === false) out.push(join(cwd, '.rsc', '.no-context7'));
|
|
115
121
|
if (policy?.memory !== false) out.push(...memoryManagedPaths(target, cwd));
|
|
116
122
|
out.push(...updateManagedPaths(target, cwd));
|
|
@@ -208,7 +214,7 @@ export function hydrateLocalDecisions(cwd, manifest) {
|
|
|
208
214
|
// into codex on a machine that already had claude is adding, not replacing. Union, sorted
|
|
209
215
|
// where order carries no meaning, so the file stays diffable and a merge conflict stays
|
|
210
216
|
// readable.
|
|
211
|
-
export function recordInManifest({ cwd, target, skillIds, agentIds = [], catalogVersion = CLI_VERSION, dropTarget, onboarding, gitPermissions }) {
|
|
217
|
+
export function recordInManifest({ cwd, target, skillIds, agentIds = [], catalogVersion = CLI_VERSION, dropTarget, onboarding, gitPermissions, preserveOptOuts = false, rearmOptOuts = [] }) {
|
|
212
218
|
const prev = readManifest(cwd) || { targets: [], skills: [], agents: [], ownSkills: [], optOuts: [] };
|
|
213
219
|
const { optOuts, tier } = localDecisions(cwd);
|
|
214
220
|
const union = (a, b) => [...new Set([...(a || []), ...(b || [])])].sort();
|
|
@@ -225,15 +231,16 @@ export function recordInManifest({ cwd, target, skillIds, agentIds = [], catalog
|
|
|
225
231
|
ownSkills: prev.ownSkills || [],
|
|
226
232
|
catalogVersion,
|
|
227
233
|
tier: tier ?? prev.tier ?? null,
|
|
228
|
-
optOuts: optOuts ?? projectOptOuts(prev.optOuts),
|
|
234
|
+
optOuts: preserveOptOuts ? union(projectOptOuts(prev.optOuts), optOuts).filter(name => !rearmOptOuts.includes(name)) : optOuts ?? projectOptOuts(prev.optOuts),
|
|
229
235
|
memory: prev.memory,
|
|
230
236
|
gitPermissions: gitPermissions ?? prev.gitPermissions,
|
|
231
237
|
agentModels: prev.agentModels,
|
|
238
|
+
worktreeManager: prev.worktreeManager,
|
|
232
239
|
onboarding: onboarding ?? prev.onboarding,
|
|
233
240
|
});
|
|
234
241
|
}
|
|
235
242
|
|
|
236
|
-
export async function applyInstall({ skillIds = [], agentIds = [], target, home, cwd = process.cwd(), operation = 'install', dryRun = false, policy, onboarding }) {
|
|
243
|
+
export async function applyInstall({ skillIds = [], agentIds = [], target, home, cwd = process.cwd(), operation = 'install', dryRun = false, policy, onboarding, rearmOptOuts = [] }) {
|
|
237
244
|
// Read BEFORE anything can create it — the backup writes under `.rsc/`, and one line later the
|
|
238
245
|
// answer would always be "yes, it exists". This single boolean is what separates a clone (the
|
|
239
246
|
// declaration is the only thing that knows what the team decided) from a built machine (the
|
|
@@ -369,7 +376,7 @@ export async function applyInstall({ skillIds = [], agentIds = [], target, home,
|
|
|
369
376
|
writeState(paths.stateFile, state);
|
|
370
377
|
mkdirSync(dirname(versionFile(cwd)), { recursive: true });
|
|
371
378
|
writeFileSync(versionFile(cwd), CLI_VERSION + '\n');
|
|
372
|
-
recordInManifest({ cwd, target, skillIds, agentIds, onboarding, gitPermissions });
|
|
379
|
+
recordInManifest({ cwd, target, skillIds, agentIds, onboarding, gitPermissions, preserveOptOuts: operation === 'sync', rearmOptOuts });
|
|
373
380
|
// The worktree cleanup's trigger. It lives in `.git/hooks/`, which is NOT cloned, so it has to be
|
|
374
381
|
// (re)written by every operation that touches a user's repo — install, sync and repair all land
|
|
375
382
|
// here. Target-agnostic on purpose: it is a git hook, not an assistant hook, and a cleanup that
|
|
@@ -389,6 +396,7 @@ export async function applyInstall({ skillIds = [], agentIds = [], target, home,
|
|
|
389
396
|
if (policy?.codeHooks === false) throw new Error('code hooks not governed by the accepted plan');
|
|
390
397
|
mkdirSync(join(cwd, '.rsc'), { recursive: true });
|
|
391
398
|
cpSync(join(ROOT, 'targets', 'worktree-reaper.mjs'), join(cwd, '.rsc', 'worktree-reaper.mjs'));
|
|
399
|
+
cpSync(join(ROOT, 'targets', 'risk-policy.mjs'), join(cwd, '.rsc', 'risk-policy.mjs'));
|
|
392
400
|
const { installMergeHook } = await import('../targets/worktree-reaper.mjs');
|
|
393
401
|
if (existsSync(join(cwd, '.git'))) mergeHook = installMergeHook(cwd);
|
|
394
402
|
} catch (err) { mergeHook = { installed: false, state: 'skipped', reason: err.message }; }
|
|
@@ -690,7 +698,7 @@ export function pruneSharedBases({ cwd = process.cwd(), skillIds = [] }) {
|
|
|
690
698
|
writeBaseVersions(cwd, versions);
|
|
691
699
|
}
|
|
692
700
|
|
|
693
|
-
export async function syncInstalled({ target, home, cwd = process.cwd(), dryRun = false }) {
|
|
701
|
+
export async function syncInstalled({ target, home, cwd = process.cwd(), dryRun = false, rearmOptOuts = [] }) {
|
|
694
702
|
const paths = targetPaths(target, home, cwd);
|
|
695
703
|
const state = readState(paths.stateFile);
|
|
696
704
|
// The per-target state is machine wiring and does not travel, so a fresh clone has
|
|
@@ -735,6 +743,7 @@ export async function syncInstalled({ target, home, cwd = process.cwd(), dryRun
|
|
|
735
743
|
home,
|
|
736
744
|
cwd,
|
|
737
745
|
operation: 'sync',
|
|
746
|
+
rearmOptOuts,
|
|
738
747
|
policy: manifest?.onboarding?.plan?.policy,
|
|
739
748
|
onboarding: manifest?.onboarding,
|
|
740
749
|
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { accessSync, constants, statSync, readFileSync, writeFileSync, readdirSync } from 'node:fs';
|
|
2
|
+
import { join, isAbsolute } from 'node:path';
|
|
3
|
+
|
|
4
|
+
// Inspect PATH, never execute a candidate just to discover it. Ignore relative PATH
|
|
5
|
+
// entries: a checked-out executable is not evidence of an installed CLI.
|
|
6
|
+
export function installedCli({ env = process.env, platform = process.platform } = {}) {
|
|
7
|
+
const windows = platform === 'win32';
|
|
8
|
+
const names = windows ? ['rsc.exe', 'rsc.cmd', 'rsc.bat', 'rsc'] : ['rsc'];
|
|
9
|
+
for (const dir of (env.PATH || env.Path || '').split(windows ? ';' : ':')) {
|
|
10
|
+
if (!dir || !isAbsolute(dir)) continue;
|
|
11
|
+
// npm/npx inject these only for this process. They will not make `rsc`
|
|
12
|
+
// available in the assistant's next shell after installation finishes.
|
|
13
|
+
if (/(?:^|[\\/])_npx(?:[\\/]|$)|[\\/]node_modules[\\/]\.bin[\\/]?$/i.test(dir)) continue;
|
|
14
|
+
for (const name of names) {
|
|
15
|
+
try {
|
|
16
|
+
const file = join(dir, name);
|
|
17
|
+
if (!statSync(file).isFile()) continue;
|
|
18
|
+
accessSync(file, windows ? constants.F_OK : constants.X_OK);
|
|
19
|
+
return true;
|
|
20
|
+
} catch { /* absent, unreadable or not executable */ }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function cliInstructions(text, local = installedCli()) {
|
|
27
|
+
// Explicit versions (including @latest) are deliberate choices, never rewritten.
|
|
28
|
+
return local ? text.replace(/\bnpx[ \t]+(?:-y[ \t]+)?@ericrisco\/rsc(?=[ \t`\n]|$)/g, 'rsc') : text;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function materializeCliInstructions(dir, local) {
|
|
32
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
33
|
+
const file = join(dir, entry.name);
|
|
34
|
+
if (entry.isDirectory()) materializeCliInstructions(file, local);
|
|
35
|
+
else if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
36
|
+
const before = readFileSync(file, 'utf8');
|
|
37
|
+
let after = cliInstructions(before, local);
|
|
38
|
+
if (local && entry.name === 'SKILL.md' && /\nname: suggest\n/.test(before)) {
|
|
39
|
+
after += '\n**Installed CLI.** Use `rsc` for unversioned `npx @ericrisco/rsc` commands, including commands suggested by hooks. Explicit package versions stay pinned. If `rsc` disappears from PATH, run sync with the declared package version to refresh these instructions. This does not grant execution permissions.\n';
|
|
40
|
+
}
|
|
41
|
+
if (after !== before) writeFileSync(file, after);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -15,7 +15,7 @@ import { join } from 'node:path';
|
|
|
15
15
|
export const MANIFEST = '.rsc.json';
|
|
16
16
|
export const manifestPath = (cwd = process.cwd()) => join(cwd, MANIFEST);
|
|
17
17
|
|
|
18
|
-
const KEYS = ['version', 'targets', 'skills', 'agents', 'ownSkills', 'catalogVersion', 'tier', 'optOuts', 'memory', 'gitPermissions', 'agentModels', 'onboarding'];
|
|
18
|
+
const KEYS = ['version', 'targets', 'skills', 'agents', 'ownSkills', 'catalogVersion', 'tier', 'optOuts', 'memory', 'gitPermissions', 'agentModels', 'worktreeManager', 'onboarding'];
|
|
19
19
|
|
|
20
20
|
export function readManifest(cwd = process.cwd()) {
|
|
21
21
|
const file = manifestPath(cwd);
|
|
@@ -43,6 +43,7 @@ export function readManifest(cwd = process.cwd()) {
|
|
|
43
43
|
// #298 — per-target agent model: { opencode: 'openai/gpt-5' | 'inherit' }. Only plain objects of
|
|
44
44
|
// strings survive the read; what each value may contain is checked where it is rendered.
|
|
45
45
|
agentModels: agentModelsFrom(raw.agentModels),
|
|
46
|
+
worktreeManager: raw.worktreeManager === 'orca' ? 'orca' : undefined,
|
|
46
47
|
onboarding: raw.onboarding ?? undefined,
|
|
47
48
|
};
|
|
48
49
|
}
|
package/scripts/lib/risk.js
CHANGED
|
@@ -16,8 +16,7 @@ const nul = (out) => (out || '').split('\0').filter(Boolean);
|
|
|
16
16
|
|
|
17
17
|
// Every path that differs from the base (committed, staged, unstaged or untracked). The base is the
|
|
18
18
|
// merge-base with `--base`, or with the trunk when none is given.
|
|
19
|
-
export function changedPaths(root, base = null) {
|
|
20
|
-
const cfg = readEffectiveConfig(root);
|
|
19
|
+
export function changedPaths(root, base = null, cfg = readEffectiveConfig(root)) {
|
|
21
20
|
const ref = base || trunkRef(root, cfg);
|
|
22
21
|
if (!ref) return { ok: false, message: 'rsc: no base to compare against. Pass --base <ref> or the paths themselves: npx @ericrisco/rsc risk <path…>' };
|
|
23
22
|
const head = git(root, ['rev-parse', 'HEAD']);
|
|
@@ -45,8 +44,8 @@ export function changedPaths(root, base = null) {
|
|
|
45
44
|
|
|
46
45
|
// `texts` is what the change adds per path (sello.changeText): content signals raise a path that its
|
|
47
46
|
// name alone would leave at tier 1 — auth code in `src/app.js`.
|
|
48
|
-
export function assess(paths, cfg = null, texts = {}) {
|
|
49
|
-
const { tier, classes, configError, content } = classifyChange(paths, texts, cfg);
|
|
47
|
+
export function assess(paths, cfg = null, texts = {}, details = {}) {
|
|
48
|
+
const { tier, classes, configError, content, rules } = classifyChange(paths, texts, cfg, details);
|
|
50
49
|
return {
|
|
51
50
|
tier,
|
|
52
51
|
classes: [...new Set(Object.values(classes))].sort(),
|
|
@@ -56,6 +55,7 @@ export function assess(paths, cfg = null, texts = {}) {
|
|
|
56
55
|
escalate: tier >= 2 ? 'asdd' : null,
|
|
57
56
|
paths: classes,
|
|
58
57
|
content,
|
|
58
|
+
rules,
|
|
59
59
|
...(configError ? { configError } : {}),
|
|
60
60
|
};
|
|
61
61
|
}
|
|
@@ -69,6 +69,8 @@ export function render(r) {
|
|
|
69
69
|
`human approval: ${r.humanApproval ? 'required' : 'not required'}`,
|
|
70
70
|
...(r.base ? [`base: ${r.base}`] : []),
|
|
71
71
|
...(r.escalate ? ['escalate: asdd — tier 2 needs a spec linked to this branch (`branch: <name>` in its frontmatter) that passes `npx @ericrisco/rsc spec gate`; push and PR are refused until it exists. Write it now, before more code.'] : []),
|
|
72
|
+
...(r.policySource ? [`policy: ${r.policySource}`] : []),
|
|
73
|
+
...(r.rules || []).map(r => ` rule: ${r.class} in ${r.path}: ${r.because}`),
|
|
72
74
|
...(r.configError ? [`config ignored: ${r.configError}`] : []),
|
|
73
75
|
...(r.content || []).slice(0, 10).map((h) => ` content: ${h.class} in ${h.path} ("${h.match}")`),
|
|
74
76
|
...top.slice(0, 20).map(([p, c]) => ` ${c.padEnd(10)} ${p}`),
|
package/scripts/rsc.js
CHANGED
|
@@ -78,6 +78,13 @@ const GLOBAL_VALUE_FLAGS = new Set([
|
|
|
78
78
|
'--topic', '--target', '--technical-level', '--accompaniment', '--project-kind', '--goal', '--goal-base64', '--software-scope', '--workflow', '--accept-plan',
|
|
79
79
|
]);
|
|
80
80
|
const COMMANDS = new Set(['ingest', 'copy', 'onboard', 'reassess', 'add', 'install', 'consult', 'catalog', 'audit', 'list', 'doctor', 'memory', 'knowledge-sync', 'git-permissions', 'agent-model', 'agents', 'main', 'isolation', 'sync', 'backups', 'restore', 'upgrade', 'registry', 'worktrees', 'capabilities', 'review', 'risk', 'spec', 'sello', 'repair', 'uninstall', 'purge']);
|
|
81
|
+
// Sync preserves project decisions. Only these explicit transitions clear an opt-out;
|
|
82
|
+
// a missing local marker alone does not revoke a teammate's declared decision.
|
|
83
|
+
const EXPLICIT_REARMS = {
|
|
84
|
+
main: { lock: ['trunk-guard'], unlock: ['trunk-open'] },
|
|
85
|
+
isolation: { on: ['worktree-isolation'] },
|
|
86
|
+
'knowledge-sync': { on: ['knowledge-sync'] },
|
|
87
|
+
};
|
|
81
88
|
function positionalTokens(input) {
|
|
82
89
|
const out = [];
|
|
83
90
|
for (let i = 0; i < input.length; i++) {
|
|
@@ -920,7 +927,8 @@ async function main() {
|
|
|
920
927
|
const lock = join(root, '.rsc', '.no-trunk-open');
|
|
921
928
|
if (sub === ON) writeFileSync(lock, ''); else rmSync(lock, { force: true });
|
|
922
929
|
}
|
|
923
|
-
|
|
930
|
+
const rearmOptOuts = EXPLICIT_REARMS[cmd]?.[sub] || [];
|
|
931
|
+
for (const t of targets) await syncInstalled({ target: t, cwd: root, rearmOptOuts });
|
|
924
932
|
say(isMain
|
|
925
933
|
? (sub === OFF
|
|
926
934
|
? 'rsc main unlock: the agent may now work on the default branch in this project. Commit .rsc.json so the team gets the same decision.'
|
|
@@ -954,7 +962,8 @@ async function main() {
|
|
|
954
962
|
mkdirSync(join(root, '.rsc'), { recursive: true });
|
|
955
963
|
if (sub === 'off') writeFileSync(marker, '');
|
|
956
964
|
else rmSync(marker, { force: true });
|
|
957
|
-
|
|
965
|
+
const rearmOptOuts = EXPLICIT_REARMS[cmd]?.[sub] || [];
|
|
966
|
+
for (const t of targets) await syncInstalled({ target: t, cwd: root, rearmOptOuts });
|
|
958
967
|
say(sub === 'off'
|
|
959
968
|
? 'rsc knowledge-sync off: 01-TOOLS/ and 02-DOCS/ no longer sync on their own in this project. Commit .rsc.json so the team gets the same decision.'
|
|
960
969
|
: 'rsc knowledge-sync on: 01-TOOLS/ and 02-DOCS/ go up when a turn ends and come down before each message. Commit .rsc.json so the team gets the same decision.');
|
|
@@ -1237,6 +1246,28 @@ async function main() {
|
|
|
1237
1246
|
// script inside this package, so the one check ASDD's spec depends on could not run where specs live.
|
|
1238
1247
|
const USE = 'Use: npx @ericrisco/rsc spec gate [spec.md ...]\n Without paths it checks 02-DOCS/wiki/sdd/specs/ of this project. Exits 1 when a spec fails.';
|
|
1239
1248
|
if (argv[1] !== 'gate') { say(USE); if (argv[1]) process.exitCode = 1; return; }
|
|
1249
|
+
if (argv.includes('--branch-check')) {
|
|
1250
|
+
const S = await import('../targets/sello.mjs');
|
|
1251
|
+
const { branchCheck } = await import('../targets/asdd-gate.mjs');
|
|
1252
|
+
const { specCompleteness } = await import('../targets/spec-completeness.mjs');
|
|
1253
|
+
const { git } = await import('../targets/risk-policy.mjs');
|
|
1254
|
+
const { resolve, relative, isAbsolute } = await import('node:path');
|
|
1255
|
+
const rawRepo = flag('repo'); const branch = flag('branch');
|
|
1256
|
+
try {
|
|
1257
|
+
if (rawRepo === true || branch === true) throw new Error('--repo and --branch require values');
|
|
1258
|
+
const at = typeof rawRepo === 'string' ? resolve(rawRepo) : process.cwd();
|
|
1259
|
+
const repo = (git(at, 'rev-parse', '--show-toplevel') || '').trim();
|
|
1260
|
+
if (!repo) throw new Error('not a Git repository; pass --repo <directory>');
|
|
1261
|
+
if (branch && (branch.startsWith('-') || git(repo, 'rev-parse', '--verify', '--quiet', `${branch}^{commit}`) === null)) throw new Error('unknown branch; pass an existing branch name');
|
|
1262
|
+
const caller = (git(process.cwd(), 'rev-parse', '--show-toplevel') || '').trim();
|
|
1263
|
+
const offset = caller ? relative(caller, repo) : '..';
|
|
1264
|
+
const workspace = caller && !isAbsolute(offset) && offset !== '..' && !offset.startsWith('../') && !offset.startsWith('..\\')
|
|
1265
|
+
? S.policyRoot(caller) : S.policyRoot(repo);
|
|
1266
|
+
const denial = branchCheck(workspace, repo, { sello: S, specCompleteness }, { branch, strict: true });
|
|
1267
|
+
say(denial || 'RSC_BRANCH_CHECK_PASS'); process.exitCode = denial ? 2 : 0;
|
|
1268
|
+
} catch (e) { say(`RSC_BRANCH_CHECK_ERROR: ${e.message}`); process.exitCode = 1; }
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1240
1271
|
const { spawnSync } = await import('node:child_process');
|
|
1241
1272
|
const { fileURLToPath: toPath } = await import('node:url');
|
|
1242
1273
|
const rest = argv.slice(2);
|
|
@@ -1251,6 +1282,10 @@ async function main() {
|
|
|
1251
1282
|
const K = await import('./lib/risk.js');
|
|
1252
1283
|
const S = await import('../targets/sello.mjs');
|
|
1253
1284
|
const root = S.resolveRoot(process.cwd());
|
|
1285
|
+
const workspace = S.policyRoot(root);
|
|
1286
|
+
const local = S.readEffectiveConfig(workspace);
|
|
1287
|
+
const policy = S.readPolicy(root, { workspace, localConfig: local, preview: argv.includes('--policy-preview') });
|
|
1288
|
+
const cfg = S.mergePolicyConfig(local, policy);
|
|
1254
1289
|
const base = flag('base');
|
|
1255
1290
|
if (base === true) { say('Use: npx @ericrisco/rsc risk [--base <ref>] [paths…] [--json]'); process.exitCode = 1; return; }
|
|
1256
1291
|
const rest = argv.slice(1);
|
|
@@ -1264,7 +1299,7 @@ async function main() {
|
|
|
1264
1299
|
let against = null;
|
|
1265
1300
|
let from = null;
|
|
1266
1301
|
if (!given.length) {
|
|
1267
|
-
const c = K.changedPaths(root, base || null);
|
|
1302
|
+
const c = K.changedPaths(root, base || null, cfg);
|
|
1268
1303
|
if (!c.ok) { say(c.message); process.exitCode = 1; return; }
|
|
1269
1304
|
paths = c.paths;
|
|
1270
1305
|
against = c.base;
|
|
@@ -1272,7 +1307,7 @@ async function main() {
|
|
|
1272
1307
|
}
|
|
1273
1308
|
// Given paths are read whole (a forecast or a single file); a diff contributes its added lines.
|
|
1274
1309
|
const texts = S.changeText(root, from, paths);
|
|
1275
|
-
const r = { ...K.assess(paths, S.
|
|
1310
|
+
const r = { ...K.assess(paths, cfg, texts, S.changeDetails(root, from, paths)), policySource: policy.source, ...(against ? { base: against } : {}) };
|
|
1276
1311
|
say(argv.includes('--json') ? JSON.stringify(r, null, 2) : K.render(r));
|
|
1277
1312
|
return;
|
|
1278
1313
|
}
|
|
@@ -86,6 +86,12 @@ Only once the tree state is understood and the user's WIP is accounted for do yo
|
|
|
86
86
|
|
|
87
87
|
## Creating the workspace — native first, git fallback
|
|
88
88
|
|
|
89
|
+
**Orca-managed project:** use Orca's lifecycle instead; do not bypass its setup or teardown hooks
|
|
90
|
+
with a native assistant worktree tool or plain Git. Follow [Orca setup and cleanup](references/orca.md).
|
|
91
|
+
Declare `"worktreeManager": "orca"` in `.rsc.json` so cleanup retains these checkouts even on a
|
|
92
|
+
machine without the Orca CLI. A shared worktree or parent/child relationship alone does not prove
|
|
93
|
+
that two agent sessions belong to the same task; verify their identities before sharing changes.
|
|
94
|
+
|
|
89
95
|
**Prefer the native worktree tool when it's available in your environment.** An `EnterWorktree`-style
|
|
90
96
|
tool typically creates an isolated worktree (often under something like `.claude/worktrees/`, though
|
|
91
97
|
the exact location is tool-dependent), switches the session into it, and tracks it for clean exit —
|
|
@@ -34,6 +34,13 @@ should_not_trigger:
|
|
|
34
34
|
why: "Bootstrapping the workspace control plane is the harness skill; nothing to do with git isolation for a feature."
|
|
35
35
|
|
|
36
36
|
capability:
|
|
37
|
+
- scenario: "The project uses Orca, creates worktrees on origin/develop, and runs setup and teardown hooks. Another session is active in this checkout. Create independent work and explain cleanup."
|
|
38
|
+
must_include:
|
|
39
|
+
- "Checks Orca's returned checkout path and actual session identities; workspace lineage alone never suppresses a concurrency warning"
|
|
40
|
+
- "Uses orca worktree create with --no-parent and the declared origin/develop base, then waits for setup"
|
|
41
|
+
- "Runs sync with the exact catalogVersion in .rsc.json, never @latest, and stops setup on failure"
|
|
42
|
+
- "Declares worktreeManager: orca so rsc retains externally managed checkouts even without the CLI"
|
|
43
|
+
- "Uses Orca removal with --run-hooks after verifying the worktree is safe; never plain git worktree remove"
|
|
37
44
|
- scenario: "User says: 'I'm on main with a clean tree, the plan for the order-reservation feature (slug: order-reservation) is approved, and I'm about to implement it. My editor and a dev server are open against the current files. Set up isolation.' The agent has the worktrees skill loaded and a native worktree tool available."
|
|
38
45
|
must_include:
|
|
39
46
|
- "Runs the pre-flight gate: confirms it's a git repo, checks current branch (main), and checks `git status --short` for tree state before creating anything"
|