reffy-cli 1.8.0 → 1.9.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 +10 -2
- package/dist/cli.js +6 -35
- package/dist/doctor.js +1 -1
- package/dist/plan.js +4 -0
- package/dist/skills.js +31 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,6 @@ Command summary:
|
|
|
25
25
|
|
|
26
26
|
- `reffy init`: runs the canonical first-run setup flow, creates the `.reffy/` and `.reffy/reffyspec/` structure, writes managed instructions, reindexes artifacts, and on first-run text output prints a copy/paste instruction for your agent harness.
|
|
27
27
|
- `reffy bootstrap`: compatibility alias for `reffy init`.
|
|
28
|
-
- `reffy migrate`: migrates a legacy `.references/` workspace into `.reffy/`.
|
|
29
28
|
- `reffy doctor`: diagnoses required Reffy setup and workspace health.
|
|
30
29
|
- `reffy reindex`: reconciles `.reffy/manifest.json` with `.reffy/artifacts` by adding missing files and removing stale entries.
|
|
31
30
|
- `reffy validate`: validates `.reffy/manifest.json` against manifest v1 contract.
|
|
@@ -136,7 +135,7 @@ managed: true
|
|
|
136
135
|
- `commands` declares the CLI commands the skill wraps, which `reffy doctor` cross-checks against the installed CLI.
|
|
137
136
|
- `managed: true` marks skills Reffy owns. `reffy init` scaffolds and refreshes managed skills in place and never touches unmanaged ones.
|
|
138
137
|
|
|
139
|
-
`reffy init` ships
|
|
138
|
+
`reffy init` ships seven managed skills covering the core workflows: `create-artifact`, `create-change`, `archive-change`, `supersede-change`, `inspect-specs`, `sync-remote`, and `diagnose`. Author your own with `reffy skill create <name>`.
|
|
140
139
|
|
|
141
140
|
```bash
|
|
142
141
|
reffy skill list # name + description + managed flag
|
|
@@ -370,6 +369,15 @@ Useful side commands during the arc:
|
|
|
370
369
|
|
|
371
370
|
Pivots, deprecations, and wind-downs are not a separate concept in ReffySpec — they are ordinary changes whose delta is mostly REMOVED or MODIFIED requirements instead of ADDED ones. Because every change's `specs/<capability>/spec.md` is already a delta against the canonical spec, a course correction reuses the same machinery as a feature addition: scaffold a change, author a delta that removes or rewrites the relevant requirements, pair it with code-removal tasks, and archive it when shipped. The history of pivots stays legible as a series of deltas under `changes/archive/`, rather than getting buried in code commits.
|
|
372
371
|
|
|
372
|
+
There is no pivot command and no per-requirement "deprecated" flag: signaling a change of direction just requires another change. The archive is append-only — you never edit or delete an archived change to reverse it; you land a new change on top, and canonical `specs/` always reflects current truth. When a change reverses or replaces a prior one, name the prior change-id(s) in an optional `## Supersedes` section of `proposal.md`:
|
|
373
|
+
|
|
374
|
+
```md
|
|
375
|
+
## Supersedes
|
|
376
|
+
- add-old-direction
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
This is a navigational pointer that keeps the lineage explicit; the spec delta remains the authoritative record of what actually changed. `reffy plan create` scaffolds the `## Supersedes` section (defaulting to `None`) so the convention is there when you need it.
|
|
380
|
+
|
|
373
381
|
### Reference implementation in this repo
|
|
374
382
|
|
|
375
383
|
- `AGENTS.md`: contains both managed instruction blocks and encodes sequencing.
|
package/dist/cli.js
CHANGED
|
@@ -195,6 +195,12 @@ These instructions are for AI assistants working in this project.
|
|
|
195
195
|
- Delta specs must use \`## ADDED|MODIFIED|REMOVED|RENAMED Requirements\`.
|
|
196
196
|
- Each requirement must include at least one \`#### Scenario:\`.
|
|
197
197
|
|
|
198
|
+
## Representing Pivots
|
|
199
|
+
|
|
200
|
+
- A pivot, deprecation, or wind-down is not a special object — it is an ordinary change whose delta is mostly \`REMOVED\`/\`MODIFIED\` requirements.
|
|
201
|
+
- Never edit or delete an archived change to reverse direction; land a new change on top. The archive is an append-only ledger and canonical \`specs/\` always reflects current truth.
|
|
202
|
+
- When a change reverses or replaces the direction of a prior one, name the prior change-id(s) in a \`## Supersedes\` section of \`proposal.md\`. This is a navigational pointer; the spec delta remains the authoritative record of what changed.
|
|
203
|
+
|
|
198
204
|
## Reffy Relationship
|
|
199
205
|
|
|
200
206
|
- Reffy owns the runtime and artifact workflow.
|
|
@@ -434,7 +440,6 @@ function usage() {
|
|
|
434
440
|
"Commands:",
|
|
435
441
|
" init Run the canonical first-run setup flow and refresh managed instructions.",
|
|
436
442
|
" bootstrap Compatibility alias for init.",
|
|
437
|
-
" migrate Migrate a legacy .references workspace to the canonical .reffy layout.",
|
|
438
443
|
" doctor Diagnose required Reffy setup and optional tool availability.",
|
|
439
444
|
" reindex Scan .reffy/artifacts and add missing files to manifest.",
|
|
440
445
|
" validate Validate .reffy/manifest.json against manifest v1 contract.",
|
|
@@ -1894,40 +1899,6 @@ async function main() {
|
|
|
1894
1899
|
const repoRoot = parseRepoArg(rest);
|
|
1895
1900
|
return await runSetupCommand("bootstrap", output, repoRoot);
|
|
1896
1901
|
}
|
|
1897
|
-
if (command === "migrate") {
|
|
1898
|
-
const repoRoot = parseRepoArg(rest);
|
|
1899
|
-
const workspace = await prepareCanonicalWorkspace(repoRoot);
|
|
1900
|
-
const planning = await prepareCanonicalPlanningLayout(repoRoot);
|
|
1901
|
-
const agents = await initAgents(repoRoot);
|
|
1902
|
-
const skills = await scaffoldManagedSkills(repoRoot);
|
|
1903
|
-
const payload = {
|
|
1904
|
-
status: "ok",
|
|
1905
|
-
command: "migrate",
|
|
1906
|
-
workspace_mode: workspace.state.mode,
|
|
1907
|
-
migrated_workspace: workspace.migrated,
|
|
1908
|
-
created_workspace: workspace.created,
|
|
1909
|
-
planning_mode: planning.state.mode,
|
|
1910
|
-
migrated_planning_layout: planning.migrated,
|
|
1911
|
-
created_planning_layout: planning.created,
|
|
1912
|
-
refs_dir: workspace.state.canonicalDir,
|
|
1913
|
-
...agents,
|
|
1914
|
-
skills,
|
|
1915
|
-
};
|
|
1916
|
-
if (output === "json") {
|
|
1917
|
-
printResult(output, payload);
|
|
1918
|
-
}
|
|
1919
|
-
else {
|
|
1920
|
-
console.log(workspace.message ?? `Workspace ready at ${workspace.state.canonicalDir}`);
|
|
1921
|
-
if (planning.message) {
|
|
1922
|
-
console.log(planning.message);
|
|
1923
|
-
}
|
|
1924
|
-
console.log(`Updated ${agents.root_agents_path}`);
|
|
1925
|
-
console.log(`Updated ${agents.reffy_agents_path}`);
|
|
1926
|
-
console.log(`Updated ${agents.reffyspec_agents_path}`);
|
|
1927
|
-
console.log(`Skills: ${String(skills.written_skills.length)} managed (${skills.preserved_unmanaged.length} unmanaged preserved)`);
|
|
1928
|
-
}
|
|
1929
|
-
return 0;
|
|
1930
|
-
}
|
|
1931
1902
|
if (command === "reindex") {
|
|
1932
1903
|
const repoRoot = parseRepoArg(rest);
|
|
1933
1904
|
const store = new ReferencesStore(repoRoot);
|
package/dist/doctor.js
CHANGED
|
@@ -86,7 +86,7 @@ export async function runDoctor(repoRoot) {
|
|
|
86
86
|
level: "optional",
|
|
87
87
|
ok: workspace.mode !== "legacy",
|
|
88
88
|
message: workspace.mode === "legacy"
|
|
89
|
-
? "legacy .references workspace detected; run `reffy
|
|
89
|
+
? "legacy .references workspace detected; run `reffy init` to adopt .reffy/"
|
|
90
90
|
: ".reffy/ is the active workspace",
|
|
91
91
|
});
|
|
92
92
|
const commandDrift = await findCommandDrift(repoRoot);
|
package/dist/plan.js
CHANGED
|
@@ -156,6 +156,10 @@ ${changeBullets}
|
|
|
156
156
|
|
|
157
157
|
${buildImpactText(capabilityId, signals)}
|
|
158
158
|
|
|
159
|
+
## Supersedes
|
|
160
|
+
_Optional. If this change reverses or replaces the direction of a prior change (a pivot, deprecation, or wind-down), name the prior change-id(s) here, e.g. \`- add-old-direction\`. Leave as "None" otherwise. The spec delta remains the authoritative record of what changed; this is a navigational pointer._
|
|
161
|
+
None
|
|
162
|
+
|
|
159
163
|
## Reffy References
|
|
160
164
|
${references}
|
|
161
165
|
`;
|
package/dist/skills.js
CHANGED
|
@@ -214,7 +214,6 @@ export async function validateSkills(repoRoot, name) {
|
|
|
214
214
|
export const KNOWN_COMMANDS = [
|
|
215
215
|
"reffy init",
|
|
216
216
|
"reffy bootstrap",
|
|
217
|
-
"reffy migrate",
|
|
218
217
|
"reffy doctor",
|
|
219
218
|
"reffy reindex",
|
|
220
219
|
"reffy validate",
|
|
@@ -341,6 +340,36 @@ Use this once a change is implemented and verified and you want to fold its spec
|
|
|
341
340
|
|
|
342
341
|
## Failure modes
|
|
343
342
|
- If archive reports unmerged or conflicting requirements, inspect the delta against the canonical spec before retrying.`,
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: "supersede-change",
|
|
346
|
+
description: "Represent a pivot, deprecation, or reversal as a new change that supersedes a prior one.",
|
|
347
|
+
triggers: [
|
|
348
|
+
"pivot",
|
|
349
|
+
"change direction",
|
|
350
|
+
"deprecate",
|
|
351
|
+
"wind down",
|
|
352
|
+
"reverse the decision",
|
|
353
|
+
"supersede",
|
|
354
|
+
"replace the approach",
|
|
355
|
+
"abandon",
|
|
356
|
+
],
|
|
357
|
+
commands: ["reffy plan list", "reffy plan create", "reffy plan validate", "reffy plan archive"],
|
|
358
|
+
body: `## When to use this skill
|
|
359
|
+
Use this when a request changes direction rather than adding to it: a pivot, deprecation, wind-down, or reversal of a prior decision. A pivot is not a special object — it is an ordinary change that supersedes another. Never edit or delete an archived change to reverse it; land a new change on top. Canonical \`specs/\` always reflects current truth and the archive stays append-only.
|
|
360
|
+
|
|
361
|
+
## Steps
|
|
362
|
+
1. Run \`reffy plan list\` to identify the prior change-id(s) whose direction this reverses or replaces.
|
|
363
|
+
2. Run \`reffy plan create --change-id <kebab-id> --title "<title>"\` for the new change.
|
|
364
|
+
3. Author the spec delta with \`REMOVED\`/\`MODIFIED\` requirements (not \`ADDED\`) that retire or rewrite the superseded behavior. The delta is the authoritative record of what changed.
|
|
365
|
+
4. In \`proposal.md\`, fill the \`## Supersedes\` section with the prior change-id(s) — a navigational pointer that keeps the lineage explicit.
|
|
366
|
+
5. Pair the change with code-removal / migration tasks in \`tasks.md\`.
|
|
367
|
+
6. Run \`reffy plan validate <change-id>\`, then \`reffy plan archive <change-id>\` once shipped.
|
|
368
|
+
|
|
369
|
+
## Failure modes
|
|
370
|
+
- If you find yourself wanting to edit an archived change, stop: model the reversal as a new superseding change instead.
|
|
371
|
+
- Leaving \`## Supersedes\` as "None" on a genuine pivot loses the lineage; name the prior change-id.
|
|
372
|
+
- A pivot whose delta only \`ADDED\`s requirements is probably not actually retiring the old direction — check the canonical spec for what should be \`REMOVED\`/\`MODIFIED\`.`,
|
|
344
373
|
},
|
|
345
374
|
{
|
|
346
375
|
name: "inspect-specs",
|
|
@@ -398,7 +427,7 @@ Use this first when a Reffy command misbehaves in an unfamiliar repo.
|
|
|
398
427
|
2. Run \`reffy validate\` to confirm the manifest contract.
|
|
399
428
|
3. Resolve each failure by class:
|
|
400
429
|
- Missing \`.reffy/\` or \`AGENTS.md\`: run \`reffy init\`.
|
|
401
|
-
- Legacy \`.references/\` workspace: run \`reffy
|
|
430
|
+
- Legacy \`.references/\` workspace: run \`reffy init\`.
|
|
402
431
|
- Invalid manifest: fix the reported entry, then re-run \`reffy validate\`.
|
|
403
432
|
- Skill command drift: update the stale skill's \`commands\` list.
|
|
404
433
|
|