@refactco/refact-os 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/bin/refact-os.js +3 -1
- package/lib/scaffold.js +10 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ Notable changes to the refact-os standard and scaffolder.
|
|
|
4
4
|
|
|
5
5
|
**Staying current:** a consumer repo updates with `npm run refact:update` (or `npx @refactco/refact-os init`). That refreshes the package-managed `agent/` payload, **prunes** skills this package has removed or renamed (safe — only skills the package previously shipped, never your own), regenerates `.cursor/` + `.claude/`, and flags `agent/AGENTS.md` drift for a manual merge. The version it last applied is recorded in `.refact-os.json` under `_scaffold.version`, and `init` prints the `old → new` transition so you can scan the entries below for anything needing manual action. Run `npm run refact:validate` afterward.
|
|
6
6
|
|
|
7
|
+
## 1.5.2
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **npm auto-publish on tags.** A GitHub Actions workflow (`.github/workflows/publish.yml`) publishes to npm (with provenance) when a `vX.Y.Z` tag is pushed, after checking the tag matches `package.json`. Requires the repo secret `NPM_TOKEN` (an npm "Automation" token for the `refactco` org). Release flow: bump `package.json` + `CHANGELOG` → commit → `git tag vX.Y.Z` → `git push origin vX.Y.Z`.
|
|
11
|
+
- **Restored the `--adopt` flag** (it was lost before reaching `main`). `refact-os init --adopt` forces gentle / agent-layer-only mode on any repo — to re-adopt one an older `init` over-scaffolded, or update an existing repo without re-imposing the `docs/` seed, `apps/`, or WordPress dirs. It's the opposite of `--seed` (force full scaffold); `--adopt` wins if both are passed.
|
|
12
|
+
|
|
7
13
|
## 1.5.1
|
|
8
14
|
|
|
9
15
|
### Changed
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ refact-os validate [--target <dir>] # check structure + ski
|
|
|
80
80
|
refact-os migrate [--target <dir>] # move an older layout into the current one
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
- **`init`** — scaffold a project. An **empty** repo gets the thin seed + base `agent/` skills + type overlays + adapters; an **existing** repo gets only the agent layer (then run `/adopt`). `--seed` forces the full scaffold on a non-empty repo; `--no-force` never overwrites existing files.
|
|
83
|
+
- **`init`** — scaffold a project. An **empty** repo gets the thin seed + base `agent/` skills + type overlays + adapters; an **existing** repo gets only the agent layer (then run `/adopt`). `--seed` forces the full scaffold on a non-empty repo; `--adopt` forces agent-layer-only on any repo (re-adopt one an older `init` over-scaffolded, or update an existing repo without imposing structure); `--no-force` never overwrites existing files.
|
|
84
84
|
- **`sync`** — after editing `agent/`, regenerate `.cursor/` and `.claude/`. Never edit those by hand.
|
|
85
85
|
- **`validate`** — checks the required folders/files exist, every skill declares its resolver frontmatter (the fields the agent routes on — `name`, `pattern`, `description`, `when_to_use`, `when_not_to_use`, `next_skills`), the generated skill index isn't stale, and the adapters are in sync.
|
|
86
86
|
- **`migrate`** — moves an old-layout repo into the current one and tops up the `package.json` scripts. Safe: it never overwrites an existing file, and merges old chat folders into the new location.
|
package/bin/refact-os.js
CHANGED
|
@@ -26,7 +26,7 @@ function isAllowedTarget(target) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function parseArgs(argv) {
|
|
29
|
-
const args = { command: "init", sub: undefined, target: process.cwd(), projectType: undefined, overlays: [], force: true, seed: false };
|
|
29
|
+
const args = { command: "init", sub: undefined, target: process.cwd(), projectType: undefined, overlays: [], force: true, seed: false, adopt: false };
|
|
30
30
|
const raw = [...argv];
|
|
31
31
|
if (raw[0] && !raw[0].startsWith("-")) args.command = raw.shift();
|
|
32
32
|
if (raw[0] && !raw[0].startsWith("-")) args.sub = raw.shift();
|
|
@@ -37,6 +37,7 @@ function parseArgs(argv) {
|
|
|
37
37
|
else if (token === "--target") args.target = raw.shift();
|
|
38
38
|
else if (token === "--no-force") args.force = false;
|
|
39
39
|
else if (token === "--seed") args.seed = true;
|
|
40
|
+
else if (token === "--adopt") args.adopt = true;
|
|
40
41
|
}
|
|
41
42
|
return args;
|
|
42
43
|
}
|
|
@@ -47,6 +48,7 @@ async function runScaffold(args, { force }) {
|
|
|
47
48
|
overlays: args.overlays,
|
|
48
49
|
force,
|
|
49
50
|
seed: args.seed,
|
|
51
|
+
adopt: args.adopt,
|
|
50
52
|
interactive: process.stdin.isTTY,
|
|
51
53
|
});
|
|
52
54
|
console.log(`Scaffolded ${result.filesWritten} files in ${result.target}`);
|
package/lib/scaffold.js
CHANGED
|
@@ -216,13 +216,17 @@ async function scaffoldProject(targetDir, options = {}) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
// Brownfield vs greenfield. Decided once (at first init) and recorded, so a
|
|
219
|
-
// later `init`/update never suddenly imposes structure on an adopted repo.
|
|
220
|
-
//
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
//
|
|
219
|
+
// later `init`/update never suddenly imposes structure on an adopted repo. On a
|
|
220
|
+
// brownfield repo we add ONLY the agent layer (base skills, root pointers,
|
|
221
|
+
// config, adapters) and defer the docs/ seed, apps/, and type overlays to the
|
|
222
|
+
// `adopt` skill. The two flags are opposites and override detection/recorded
|
|
223
|
+
// state: `--adopt` (options.adopt) forces gentle mode (re-adopt a repo an older
|
|
224
|
+
// init over-scaffolded, or update an existing one without imposing structure);
|
|
225
|
+
// `--seed` (options.seed) forces the full scaffold. `--adopt` wins if both pass.
|
|
224
226
|
let brownfield;
|
|
225
|
-
if (options.
|
|
227
|
+
if (options.adopt) {
|
|
228
|
+
brownfield = true;
|
|
229
|
+
} else if (options.seed) {
|
|
226
230
|
brownfield = false;
|
|
227
231
|
} else if (!hadConfig) {
|
|
228
232
|
brownfield = repoHasOwnContent(resolvedTarget);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refactco/refact-os",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Installable scaffolder for the agent-first repo standard: minimum-seed substrate + canonical agent/ skill catalog with generated tool adapters",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|