@refactco/refact-os 1.5.0 → 1.5.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/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to the refact-os standard and scaffolder.
|
|
4
4
|
|
|
5
|
-
**Staying current:** a consumer repo updates with `npm run refact:update` (or `npx
|
|
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
|
+
|
|
7
|
+
## 1.5.1
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- **Consumers now install from npm.** Scaffolded repos get `@refactco/refact-os` (`^1.5.0`) as their devDependency instead of the `github:refactco/refact-os` specifier. A repo scaffolded before the publish has its legacy GitHub devDependency **migrated** to the npm package on the next `init`/update (so it doesn't end up with two packages providing the same `refact-os` bin). README, the `adopt` / `update-package` skills, and the bootstrap commands now use `npx @refactco/refact-os …`.
|
|
6
11
|
|
|
7
12
|
## 1.5.0
|
|
8
13
|
|
package/README.md
CHANGED
|
@@ -8,27 +8,27 @@ You only ever edit one canonical folder, `agent/`. The tool generates the tool-s
|
|
|
8
8
|
|
|
9
9
|
## Get started
|
|
10
10
|
|
|
11
|
-
> refact-os is
|
|
11
|
+
> refact-os is published on npm as **`@refactco/refact-os`** (scoped, public).
|
|
12
12
|
|
|
13
13
|
Create a project and scaffold it:
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
mkdir my-project && cd my-project
|
|
17
|
-
npx
|
|
17
|
+
npx @refactco/refact-os init
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Choose the project type up front (skips the prompt):
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npx
|
|
24
|
-
npx
|
|
23
|
+
npx @refactco/refact-os init --type nextjs # or: wordpress, blank
|
|
24
|
+
npx @refactco/refact-os init --type wordpress,nextjs # hybrid: apply both overlays
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
`init` adapts to the repo. An **empty** repo gets the full scaffold (substrate seed + skills + overlays). An **existing** repo gets **only the agent layer** (skills, including `adopt`) so it never imposes folders over your structure — then `/adopt` plans the transition. Force the full scaffold on a non-empty repo with `--seed`. See the **Bringing an existing repo** note under [Commands](#commands) below.
|
|
28
28
|
|
|
29
29
|
## Run it inside your project (npm)
|
|
30
30
|
|
|
31
|
-
After `init`, your `package.json` gets a
|
|
31
|
+
After `init`, your `package.json` gets a `@refactco/refact-os` dev-dependency and ready-made scripts. From then on you use plain **npm** — no more typing the full `npx @refactco/refact-os …`:
|
|
32
32
|
|
|
33
33
|
```jsonc
|
|
34
34
|
"scripts": {
|
|
@@ -86,7 +86,7 @@ refact-os migrate [--target <dir>] # move an older layout
|
|
|
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.
|
|
87
87
|
- **`sync company`** — pulls Refact's shared company context (brand, team, pitch) from `refactco/refact-operation` into `docs/context/company/`. Re-syncable, so it never drifts permanently. Source + SHA are recorded in `.refact-os.json`.
|
|
88
88
|
|
|
89
|
-
**Bringing an existing repo to the standard:** just run `npx
|
|
89
|
+
**Bringing an existing repo to the standard:** just run `npx @refactco/refact-os init`. It detects that the repo isn't empty and adds **only the agent layer** — the skills (including `adopt`), root pointers, config, and adapters — *without* dropping a `docs/` seed or `apps/` over your existing structure, and without applying type overlays. Then run the **`adopt`** skill (`/adopt`): it surveys the repo, writes a phased transition plan to `docs/task/open/`, and reconciles your structure with the standard — asking before anything ambiguous — until `refact-os validate` is green. (Pass `--seed` if you actually want the full greenfield scaffold on a non-empty repo.)
|
|
90
90
|
|
|
91
91
|
## What gets generated
|
|
92
92
|
|
package/lib/project-utils.js
CHANGED
|
@@ -104,20 +104,27 @@ const SCAFFOLD_SCRIPTS = {
|
|
|
104
104
|
"refact:update": "refact-os init",
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
// refact-os is
|
|
108
|
-
// devDependency is what lets the `refact:*` npm scripts above call the
|
|
109
|
-
// `refact-os` binary (instead of fetching it via npx
|
|
107
|
+
// refact-os is published to npm as @refactco/refact-os. Adding it as a
|
|
108
|
+
// devDependency is what lets the `refact:*` npm scripts above call the
|
|
109
|
+
// `refact-os` binary (which the package provides) instead of fetching it via npx.
|
|
110
110
|
const SCAFFOLD_DEV_DEPENDENCIES = {
|
|
111
|
-
"refact-os": "
|
|
111
|
+
"@refactco/refact-os": "^1.5.0",
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
// Add scaffold devDependencies that aren't already declared (in either
|
|
115
115
|
// dependencies or devDependencies). Non-destructive; mutates `data` and
|
|
116
|
-
// returns the names added.
|
|
116
|
+
// returns the names added. Also migrates the legacy GitHub-specifier
|
|
117
|
+
// devDependency (`refact-os: github:refactco/refact-os`) to the npm package, so
|
|
118
|
+
// a repo scaffolded before the npm publish doesn't end up with both (two
|
|
119
|
+
// packages providing the same `refact-os` bin).
|
|
117
120
|
function _ensureDevDependencies(data) {
|
|
118
121
|
const depsAdded = [];
|
|
119
122
|
const deps = data.dependencies || {};
|
|
120
123
|
const devDeps = data.devDependencies || {};
|
|
124
|
+
if (typeof devDeps["refact-os"] === "string" && /github:refactco\/refact-os/i.test(devDeps["refact-os"])) {
|
|
125
|
+
delete devDeps["refact-os"];
|
|
126
|
+
data.devDependencies = devDeps;
|
|
127
|
+
}
|
|
121
128
|
for (const [name, spec] of Object.entries(SCAFFOLD_DEV_DEPENDENCIES)) {
|
|
122
129
|
if (name in deps || name in devDeps) continue;
|
|
123
130
|
devDeps[name] = spec;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refactco/refact-os",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
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",
|
|
@@ -3,8 +3,8 @@ name: adopt
|
|
|
3
3
|
pattern: procedure
|
|
4
4
|
requires_approval: false
|
|
5
5
|
description: Produce a PLAN for bringing an existing, non-conformant repo up to the agent-first standard. Surveys the repo and outputs a phased transition plan as its final response — it does NOT change anything.
|
|
6
|
-
when_to_use: The user wants to understand what it would take to bring an existing repo to the standard — "adopt this repo", "make this repo agent-first", "what's the plan to conform this repo", "plan the migration". Run after `npx
|
|
7
|
-
when_not_to_use: For a brand-new empty project (use `npx
|
|
6
|
+
when_to_use: The user wants to understand what it would take to bring an existing repo to the standard — "adopt this repo", "make this repo agent-first", "what's the plan to conform this repo", "plan the migration". Run after `npx @refactco/refact-os init --no-force` has laid the mechanical seed.
|
|
7
|
+
when_not_to_use: For a brand-new empty project (use `npx @refactco/refact-os init`). When the user explicitly asks you to EXECUTE a plan that already exists (this skill only plans — execution is a separate, explicit step the user approves).
|
|
8
8
|
inputs:
|
|
9
9
|
- the target repository (surveyed read-only, not fully read)
|
|
10
10
|
- the standard at docs/agent-first-repo-best-practices.md (or the refact-os package copy)
|
|
@@ -29,9 +29,9 @@ Produce a **plan** for bringing an existing repo to the agent-first standard. Th
|
|
|
29
29
|
## Steps
|
|
30
30
|
|
|
31
31
|
1. **Survey** the repo breadth-first (sub-agents per area). For each area note: what's there, which of the six roles it maps to (Evidence/Knowledge/Task/Output/Software/Agent), and anything load-bearing (scripts, automation, hardcoded paths).
|
|
32
|
-
2. **Read the gaps:** run `npm run refact:validate` (read-only) and fold its findings in. If the script/binary isn't wired up yet, fall back to `npx
|
|
32
|
+
2. **Read the gaps:** run `npm run refact:validate` (read-only) and fold its findings in. If the script/binary isn't wired up yet, fall back to `npx @refactco/refact-os validate` (read-only, touches nothing in the repo) — don't run `npm install` here, since this skill changes nothing.
|
|
33
33
|
3. **Write the plan** and present it as your final response. Structure it as ordered **phases**, each a small reviewable unit, with: the proposed moves/renames/**deletions**, the references that would need updating, and any open questions. Typical items:
|
|
34
|
-
- Missing seed → `npx
|
|
34
|
+
- Missing seed → `npx @refactco/refact-os init --no-force` (additive).
|
|
35
35
|
- Duplicate canonical map (`INDEX.md` vs `docs/index.md`) → which is canonical; merge the other.
|
|
36
36
|
- Duplicate contract (root `AGENTS.md` vs `agent/AGENTS.md`) → consolidate into `agent/AGENTS.md`, leave a thin root pointer.
|
|
37
37
|
- Variant dirs (`docs/tasks` vs `docs/task`) → consolidate onto the standard name.
|
|
@@ -14,27 +14,27 @@ Use this when the user asks to update / bump / refresh / reinstall `refact-os` i
|
|
|
14
14
|
|
|
15
15
|
## Source
|
|
16
16
|
|
|
17
|
-
`refact-os`
|
|
17
|
+
`refact-os` is published to npm as **`@refactco/refact-os`** (scoped public). Install it from npm unless the user explicitly names a local checkout (e.g. `../refact-os` for development). The binary it provides is still `refact-os`, so the `refact:*` npm scripts are unchanged.
|
|
18
18
|
|
|
19
19
|
## Workflow
|
|
20
20
|
|
|
21
21
|
1. **Detect the package manager** from lockfiles: `pnpm-lock.yaml` → pnpm; `yarn.lock` → yarn; `package-lock.json` or none → npm.
|
|
22
22
|
2. **Bump the package** (show the command first; let the user override the source):
|
|
23
|
-
- npm: `npm install
|
|
24
|
-
- pnpm: `pnpm add
|
|
25
|
-
- yarn: `yarn add
|
|
23
|
+
- npm: `npm install -D @refactco/refact-os@latest`
|
|
24
|
+
- pnpm: `pnpm add -D @refactco/refact-os@latest`
|
|
25
|
+
- yarn: `yarn add -D @refactco/refact-os@latest`
|
|
26
26
|
|
|
27
|
-
Installing
|
|
27
|
+
Installing does **not** scaffold anything (there is no postinstall), so apply the refresh explicitly in the next step.
|
|
28
28
|
3. **Refresh the payload:** `npx refact-os init` (or `npm run refact:update`). It is idempotent and:
|
|
29
29
|
- force-copies package-managed files (the `agent/` skills, hooks, scripts, root pointers); your own files are preserved (`agent/AGENTS.md`, `README.md`, everything under `docs/`).
|
|
30
30
|
- **prunes** skills the package removed or renamed since your last update (tracked via `_scaffold.shippedSkills` in `.refact-os.json`); skills you authored are never pruned.
|
|
31
31
|
- regenerates `.cursor/` and `.claude/` from `agent/`.
|
|
32
32
|
- prints the version transition (`old → new`) and any pruned skills.
|
|
33
33
|
4. **Read the output** and surface to the user:
|
|
34
|
-
- the version transition — point them at `node_modules/refact-os/CHANGELOG.md` for what changed and whether anything needs manual action.
|
|
34
|
+
- the version transition — point them at `node_modules/@refactco/refact-os/CHANGELOG.md` for what changed and whether anything needs manual action.
|
|
35
35
|
- any pruned skills.
|
|
36
36
|
- the **`agent/AGENTS.md` drift warning** if it fired (the upstream contract template changed; your copy is never overwritten).
|
|
37
|
-
5. **agent/AGENTS.md drift follow-up** (only if the warning fired): read the installed template at `node_modules/refact-os/templates/base/agent/AGENTS.md` and the project's `agent/AGENTS.md`, diff them, and surface the meaningful additions as *suggestions*. Wait for the user's go-ahead before editing; preserve project-specific values (stack, hosting, URLs, SSH) — never replace them with template placeholders.
|
|
37
|
+
5. **agent/AGENTS.md drift follow-up** (only if the warning fired): read the installed template at `node_modules/@refactco/refact-os/templates/base/agent/AGENTS.md` and the project's `agent/AGENTS.md`, diff them, and surface the meaningful additions as *suggestions*. Wait for the user's go-ahead before editing; preserve project-specific values (stack, hosting, URLs, SSH) — never replace them with template placeholders.
|
|
38
38
|
6. **Validate:** run `npm run refact:validate` and report the result. If it surfaces structural gaps (common when the standard adds folders/roles), suggest `/adopt` to reconcile them.
|
|
39
39
|
7. **Report:** source used, installed version/SHA, version transition, files changed, pruned skills, whether the AGENTS.md drift fired, and follow-up steps (review the diff, run tests, commit).
|
|
40
40
|
|
|
@@ -45,7 +45,7 @@ If the user explicitly wants to install from a local clone (developing refact-os
|
|
|
45
45
|
## Guardrails
|
|
46
46
|
|
|
47
47
|
- Prefer package-manager commands over hand-editing `package.json`.
|
|
48
|
-
-
|
|
48
|
+
- Prefer the published npm package (`@refactco/refact-os`); a local checkout (`../refact-os`) is opt-in for development only.
|
|
49
49
|
- Never run destructive git commands.
|
|
50
50
|
- If install fails, capture the exact error and suggest the smallest fix — don't silently retry with a different source.
|
|
51
51
|
- The refresh prunes only skills the package previously shipped. If the user customized a package skill in place (discouraged — fork it with a project prefix instead), warn them it will be overwritten or pruned.
|