@bluenyang/reins 0.3.4 → 0.4.0-rc.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.
Files changed (66) hide show
  1. package/README.md +164 -39
  2. package/cli/dist/commands/config-gates.js +64 -6
  3. package/cli/dist/commands/config-models.js +19 -0
  4. package/cli/dist/commands/config.js +40 -16
  5. package/cli/dist/commands/configure.js +207 -47
  6. package/cli/dist/commands/install.js +91 -31
  7. package/cli/dist/commands/migrate.js +17 -20
  8. package/cli/dist/commands/update.js +164 -12
  9. package/cli/dist/lib/agents-md.js +55 -13
  10. package/cli/dist/lib/bindings.js +7 -10
  11. package/cli/dist/lib/blocks.js +82 -18
  12. package/cli/dist/lib/detect.js +88 -3
  13. package/cli/dist/lib/gate-refresh.js +35 -5
  14. package/cli/dist/lib/gate-script.js +303 -25
  15. package/cli/dist/lib/generate.js +48 -6
  16. package/cli/dist/lib/git.js +33 -0
  17. package/cli/dist/lib/migrate-plan.js +1 -1
  18. package/cli/dist/lib/profile.js +101 -0
  19. package/cli/dist/lib/prompter.js +2 -1
  20. package/cli/dist/lib/release.js +1 -1
  21. package/cli/dist/lib/schema.js +6 -3
  22. package/cli/dist/lib/upstream.js +1 -1
  23. package/cli/dist/reins.js +40 -14
  24. package/docs/README.ko.md +113 -23
  25. package/harness/CHANGELOG.md +12 -0
  26. package/harness/VERSION +1 -1
  27. package/harness/policy/common-red-lines.yaml +7 -5
  28. package/harness/roles/advisor.md +1 -1
  29. package/harness/roles/auditor.md +12 -11
  30. package/harness/roles/executor.md +4 -3
  31. package/harness/roles/implementer.md +5 -5
  32. package/harness/roles/pl.md +4 -4
  33. package/harness/roles/planner.md +7 -8
  34. package/harness/roles/pm.md +7 -8
  35. package/harness/schemas/bindings.schema.json +2 -0
  36. package/harness/schemas/install.schema.json +1 -0
  37. package/harness/schemas/intent.schema.json +9 -1
  38. package/harness/schemas/plan.schema.json +18 -0
  39. package/harness/schemas/spec.schema.json +9 -6
  40. package/harness/templates/agents-md-blocks.md +19 -54
  41. package/harness/templates/agents-md-guide.md +11 -10
  42. package/harness/templates/audit.md +14 -41
  43. package/harness/templates/history.md +1 -5
  44. package/harness/templates/intent.md +8 -19
  45. package/harness/templates/plan.md +23 -0
  46. package/harness/templates/spec.md +21 -16
  47. package/package.json +1 -1
  48. package/skills/audit/SKILL.md +27 -33
  49. package/skills/gates/SKILL.md +41 -0
  50. package/skills/implement/SKILL.md +33 -22
  51. package/skills/implement/references/procedure.md +51 -0
  52. package/skills/intent/SKILL.md +29 -20
  53. package/skills/intent/references/procedure.md +60 -0
  54. package/skills/onboard/SKILL.md +39 -28
  55. package/skills/plan/SKILL.md +35 -0
  56. package/skills/plan/references/procedure.md +52 -0
  57. package/skills/reins-setup/SKILL.md +4 -4
  58. package/skills/release/SKILL.md +18 -20
  59. package/skills/retro/SKILL.md +21 -26
  60. package/skills/review/SKILL.md +33 -17
  61. package/skills/review/references/procedure.md +50 -0
  62. package/skills/spec/SKILL.md +25 -19
  63. package/skills/spec/references/procedure.md +67 -0
  64. package/skills/merge/SKILL.md +0 -32
  65. package/skills/roadmap/SKILL.md +0 -29
  66. package/skills/test/SKILL.md +0 -26
@@ -0,0 +1,101 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, rmdirSync, writeFileSync, } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ import { listFiles } from './fsx.js';
4
+ import { packageHarness, packageSkills } from './upstream.js';
5
+ export const PROFILES = ['light', 'full'];
6
+ /** The profile a bindings file asks for: `full` only when it says so. */
7
+ export const profileOf = (doc) => doc?.profile === 'full' ? 'full' : 'light';
8
+ /** Whether an upstream harness file (relative to `harness/`) is installed under this profile. */
9
+ export const harnessInProfile = (file, profile) => profile === 'full' || !file.startsWith('roles/');
10
+ /** Whether a file of a skill (relative to the skill's folder) is installed under this profile. */
11
+ export const skillFileInProfile = (file, profile) => profile === 'full' || !file.startsWith('references/');
12
+ /** Skills that ship with the plugin only and are not installed into a project. */
13
+ export const PLUGIN_ONLY = new Set(['reins-setup', 'setup']);
14
+ /** The skills this package installs into a project. */
15
+ export function upstreamSkills() {
16
+ const up = packageSkills();
17
+ if (!existsSync(up))
18
+ return [];
19
+ return readdirSync(up)
20
+ .toSorted()
21
+ .filter((n) => !PLUGIN_ONLY.has(n) && existsSync(join(up, n, 'SKILL.md')));
22
+ }
23
+ /**
24
+ * What a profile leaves out that is installed now: the role files under `.agents/harness/roles/` and the
25
+ * `references/` of the skills this package ships (a skill of the project's own is never touched).
26
+ */
27
+ export function outOfProfile(root, profile) {
28
+ if (profile === 'full')
29
+ return [];
30
+ const out = [];
31
+ const roles = join(root, '.agents/harness/roles');
32
+ if (existsSync(roles))
33
+ for (const f of listFiles(roles))
34
+ out.push(`.agents/harness/roles/${f}`);
35
+ for (const name of upstreamSkills()) {
36
+ const refs = join(root, '.agents/skills', name, 'references');
37
+ if (existsSync(refs))
38
+ for (const f of listFiles(refs))
39
+ out.push(`.agents/skills/${name}/references/${f}`);
40
+ }
41
+ return out;
42
+ }
43
+ /** The files a profile adds on top of light, as they ship: the role files and the skills' `references/`. */
44
+ export function inFullOnly() {
45
+ const out = [];
46
+ const up = packageHarness();
47
+ if (existsSync(join(up, 'roles')))
48
+ for (const f of listFiles(join(up, 'roles')))
49
+ out.push({
50
+ path: `.agents/harness/roles/${f}`,
51
+ content: readFileSync(join(up, 'roles', f), 'utf8'),
52
+ });
53
+ for (const name of upstreamSkills()) {
54
+ const refs = join(packageSkills(), name, 'references');
55
+ if (existsSync(refs))
56
+ for (const f of listFiles(refs))
57
+ out.push({
58
+ path: `.agents/skills/${name}/references/${f}`,
59
+ content: readFileSync(join(refs, f), 'utf8'),
60
+ });
61
+ }
62
+ return out;
63
+ }
64
+ /** Delete files under `root` and the folders they leave empty, up to (not including) `stop`. */
65
+ export function removeFiles(root, paths, stop = '.agents') {
66
+ const top = join(root, stop);
67
+ for (const p of paths) {
68
+ const abs = join(root, p);
69
+ rmSync(abs, { force: true });
70
+ for (let d = dirname(abs); d.startsWith(top) && d !== top; d = dirname(d)) {
71
+ try {
72
+ rmdirSync(d);
73
+ }
74
+ catch {
75
+ break;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ /**
81
+ * Bring `.agents/` in line with a profile (`config`, design §9): full writes the role files and the skills'
82
+ * `references/`, light removes them. The generated copies (`.claude/skills/`, `rs-*`) follow when the
83
+ * caller regenerates.
84
+ */
85
+ export function applyProfile(root, profile) {
86
+ if (profile === 'light') {
87
+ const removed = outOfProfile(root, 'light');
88
+ removeFiles(root, removed);
89
+ return { written: [], removed };
90
+ }
91
+ const written = [];
92
+ for (const w of inFullOnly()) {
93
+ const abs = join(root, w.path);
94
+ if (existsSync(abs) && readFileSync(abs, 'utf8') === w.content)
95
+ continue;
96
+ mkdirSync(dirname(abs), { recursive: true });
97
+ writeFileSync(abs, w.content);
98
+ written.push(w.path);
99
+ }
100
+ return { written, removed: [] };
101
+ }
@@ -67,13 +67,14 @@ export function scriptedPrompter(answers) {
67
67
  },
68
68
  };
69
69
  }
70
+ /** The option whose value or label is `raw`. */
71
+ const pick = (raw, options) => options.find((o) => String(o.value) === raw || o.label === raw)?.value;
70
72
  /**
71
73
  * Non-TTY bridge over the line-based `Asker`: each question is asked as one line and its answer parsed.
72
74
  * select/multiselect take a value (or label) / a comma-separated list; confirm takes y/n; text takes the line.
73
75
  * The default shown is the initial value.
74
76
  */
75
77
  export function askerPrompter(asker) {
76
- const pick = (raw, options) => options.find((o) => String(o.value) === raw || o.label === raw)?.value;
77
78
  return {
78
79
  async select(q) {
79
80
  const d = String(q.initial ?? q.options[0]?.value ?? '');
@@ -73,7 +73,7 @@ export function draftRelease(root) {
73
73
  if (!existsSync(dir))
74
74
  return [];
75
75
  const out = [];
76
- for (const f of readdirSync(dir).sort()) {
76
+ for (const f of readdirSync(dir).toSorted()) {
77
77
  if (!/\.ya?ml$/.test(f))
78
78
  continue;
79
79
  let doc;
@@ -72,11 +72,14 @@ export function validateFile(v, path, whole = false, content) {
72
72
  /** Which schema a file belongs to, from where it lives. */
73
73
  export function schemaFor(rel) {
74
74
  const name = basename(rel);
75
- if (/(^|\/)intent\/[^/]+\/intent\.md$/.test(rel) || rel.endsWith('templates/intent.md'))
75
+ // 0.4 (design §4): intents are local notes, specs and plans live under .agents/spec/<NNN>_<slug>/;
76
+ // the records of 0.3 under .agents/intent/ are reference material and match no schema
77
+ if (/(^|\/)\.loctx\/intent\/[^/]+\.md$/.test(rel) || rel.endsWith('templates/intent.md'))
76
78
  return { schema: 'intent', whole: false };
77
- if (/(^|\/)intent\/[^/]+\/spec\.md$/.test(rel) || rel.endsWith('templates/spec.md'))
79
+ if (/(^|\/)\.agents\/spec\/[^/]+\/spec\.md$/.test(rel) || rel.endsWith('templates/spec.md'))
78
80
  return { schema: 'spec', whole: false };
79
- if (/(^|\/)intent\/[^/]+\/plan\.md$/.test(rel) || rel.endsWith('templates/plan.md'))
81
+ if (/(^|\/)\.agents\/spec\/[^/]+\/plan(-\d+)?\.md$/.test(rel) ||
82
+ rel.endsWith('templates/plan.md'))
80
83
  return { schema: 'plan', whole: false };
81
84
  if (/(^|\/)\.loctx\/ticket\/[^/]+\.md$/.test(rel) || rel.endsWith('templates/ticket.md'))
82
85
  return { schema: 'ticket', whole: false };
@@ -11,7 +11,7 @@ export function packageHarness() {
11
11
  }
12
12
  throw new Error('reins: cannot find the packaged harness/ directory');
13
13
  }
14
- /** The version of the installed package (package.json next to `harness/`); stage skills pin the CLI to it. */
14
+ /** The version of the installed package (package.json next to `harness/`); the plugin skill pins the CLI to it. */
15
15
  export function packageVersion() {
16
16
  const p = join(packageHarness(), '..', 'package.json');
17
17
  return JSON.parse(readFileSync(p, 'utf8')).version;
package/cli/dist/reins.js CHANGED
@@ -6,7 +6,7 @@ import { runMigrate } from './commands/migrate.js';
6
6
  import { formatUpdate, runUpdate } from './commands/update.js';
7
7
  import { configureBindings, configureGates, formatGenerated, REFRESH_LIST, } from './commands/configure.js';
8
8
  import { refreshGates } from './commands/config-gates.js';
9
- import { formatGateRow } from './lib/gate-refresh.js';
9
+ import { reportLines } from './lib/gate-refresh.js';
10
10
  import { NotARepository, repoRoot } from './lib/git.js';
11
11
  import { LOCAL_DELEGATION_NOTE } from './lib/local-delegation.js';
12
12
  import { formatBindings, runConfig } from './commands/config.js';
@@ -27,18 +27,24 @@ const program = new Command()
27
27
  .enablePositionalOptions();
28
28
  program
29
29
  .command('install')
30
- .description('install the harness: settings, roles, stage skills, AGENTS.md blocks, hook proposals')
30
+ .description('install the harness: settings, skills, AGENTS.md blocks, deny rules, hook proposals')
31
31
  .option('--mode <mode>', 'manual (ask) | auto (detect and apply defaults)', 'manual')
32
32
  .option('--hooks', 'add the project gate commands to existing husky hooks (otherwise only proposed)')
33
+ .option('--profile <profile>', 'light (skill bodies only, the default) | full (adds references, role files and rs-* agents)')
33
34
  .option('--dry-run', 'show what would be written')
34
35
  .option('--json')
35
36
  .action(async (o) => {
37
+ if (o.profile !== undefined && o.profile !== 'light' && o.profile !== 'full') {
38
+ process.stderr.write(`reins install: --profile must be light or full\n`);
39
+ process.exit(1);
40
+ }
36
41
  // screens only on a terminal, in manual mode, without --json; otherwise the line-based questions
37
42
  const screens = o.mode === 'manual' && !o.json && isInteractive();
38
43
  const asker = o.mode === 'auto' || screens ? defaultsAsker : await stdinAsker();
39
44
  const r = await runInstall({
40
45
  mode: o.mode,
41
46
  hooks: o.hooks,
47
+ profile: o.profile,
42
48
  dryRun: o.dryRun,
43
49
  asker,
44
50
  prompter: screens ? await clackPrompter() : undefined,
@@ -109,10 +115,10 @@ program
109
115
  });
110
116
  program
111
117
  .command('update')
112
- .description('re-apply the packaged harness; ask before overwriting hand-edited files; move 0.x installs to 0.3')
118
+ .description('re-apply the packaged harness; ask before overwriting hand-edited files; move 0.x installs to 0.3 and 0.3 installs to 0.4')
113
119
  .option('--dry-run', 'show what would change')
114
120
  .option('--yes', 'do not ask for confirmation (also deletes the listed 0.x working files)')
115
- .option('--force', 'overwrite generated files edited by hand')
121
+ .option('--force', 'overwrite generated files edited by hand (and delete hand-edited skills 0.4 no longer ships)')
116
122
  .option('--json')
117
123
  .action(async (o) => {
118
124
  // on a terminal, show the plan and ask first (design §9); otherwise run as before
@@ -143,7 +149,7 @@ program
143
149
  const config = program
144
150
  .command('config')
145
151
  .alias('configure')
146
- .description('settings: models and roles, agent tools, mode, audit; a screen on a terminal');
152
+ .description('settings: models and roles, agent tools, mode, profile, audit model; a screen on a terminal');
147
153
  config
148
154
  .command('screen', { isDefault: true, hidden: true })
149
155
  .option('--json', 'print the effective settings as JSON (no screen)')
@@ -158,7 +164,7 @@ config
158
164
  .option('--off <groups...>', 'switch groups off (the PM does their work)')
159
165
  .option('--fallback <pairs...>', '<group>|<group>.<role>=<model>|none — what to call when that model cannot be called')
160
166
  .option('--mode <mode>', 'single | multi')
161
- .option('--audit <state>', 'on | off — the per-version audit')
167
+ .option('--profile <profile>', 'light | full — references, role files and rs-* agents (the team file only)')
162
168
  .option('--tools <pairs...>', '<tool>=on|off')
163
169
  .option('--detect', 'detect the agent tools again')
164
170
  .option('--local', 'write your own override to .loctx/bindings.local.yaml')
@@ -169,8 +175,8 @@ config
169
175
  process.stderr.write(`reins config bindings: --mode must be single or multi\n`);
170
176
  process.exit(1);
171
177
  }
172
- if (o.audit && o.audit !== 'on' && o.audit !== 'off') {
173
- process.stderr.write(`reins config bindings: --audit must be on or off\n`);
178
+ if (o.profile && o.profile !== 'light' && o.profile !== 'full') {
179
+ process.stderr.write(`reins config bindings: --profile must be light or full\n`);
174
180
  process.exit(1);
175
181
  }
176
182
  const r = await configureBindings({
@@ -179,7 +185,7 @@ config
179
185
  off: o.off,
180
186
  fallback: o.fallback,
181
187
  mode: o.mode,
182
- audit: o.audit,
188
+ profile: o.profile,
183
189
  tools: o.tools,
184
190
  detect: o.detect,
185
191
  local: o.local,
@@ -201,6 +207,12 @@ config
201
207
  process.stdout.write(`• ${LOCAL_DELEGATION_NOTE(r.localDelegation)}\n`);
202
208
  if (r.modeChanged)
203
209
  process.stdout.write('• AGENTS.md has a mode-changed note — the PM checks the project sections in the next conversation\n');
210
+ if (r.profileFiles) {
211
+ for (const p of r.profileFiles.written)
212
+ process.stdout.write(` + ${p}\n`);
213
+ for (const p of r.profileFiles.removed)
214
+ process.stdout.write(` - ${p}\n`);
215
+ }
204
216
  if (r.generated)
205
217
  for (const line of formatGenerated(r.generated))
206
218
  process.stdout.write(`${line}\n`);
@@ -211,15 +223,23 @@ config
211
223
  .option('--add <names...>', 'proposal names to append after the existing gates')
212
224
  .option('--refresh', 'run the discovery again and show every gate and candidate with its state (also in .loctx/gates-refresh.md)')
213
225
  .option('--apply <names...>', 'with --refresh: rows to act on by name (a candidate is added, a gate with another command gets it, a gate is removed), remove:<name>, or `all` (adds every candidate not applied)')
226
+ .option('--define-area <specs...>', 'define areas: <name>=<glob,…> (`*` within a directory, `**` across them, `?` one character); <name>= removes an area no gate names')
227
+ .option('--area <specs...>', 'the areas a gate runs for: <gate>=<area,…>; <gate>= takes them away and the gate always runs')
228
+ .option('--on <specs...>', 'the stages a gate runs at: <gate>=<stage,…> (pre-commit, pre-push); <gate>= runs it at every stage')
214
229
  .option('--json')
215
230
  .action(async (o) => {
216
- const refresh = !!o.refresh || !!o.apply;
231
+ const keys = !!(o.defineArea || o.area || o.on);
232
+ const refresh = !keys && (!!o.refresh || !!o.apply);
217
233
  // on a terminal, --refresh alone lets the user pick; with --apply or --json it never asks
218
234
  if (refresh && !o.apply && !o.json && isInteractive()) {
219
235
  await refreshGates(repoRoot(process.cwd()), await clackPrompter());
220
236
  return;
221
237
  }
222
- const r = configureGates(refresh ? { refresh: true, apply: o.apply } : { add: o.add });
238
+ const r = configureGates(keys
239
+ ? { defineArea: o.defineArea, area: o.area, on: o.on }
240
+ : refresh
241
+ ? { refresh: true, apply: o.apply }
242
+ : { add: o.add });
223
243
  if (o.json) {
224
244
  process.stdout.write(`${JSON.stringify(r, null, 2)}\n`);
225
245
  process.exit(r.code ?? 0);
@@ -228,9 +248,15 @@ config
228
248
  process.stderr.write(`reins config gates: ${r.refused}\n`);
229
249
  process.exit(r.code ?? 2);
230
250
  }
251
+ if (keys) {
252
+ for (const x of r.set ?? [])
253
+ process.stdout.write(`set ${x}\n`);
254
+ process.stdout.write('gates.yaml was written — commit it on its own\n');
255
+ return;
256
+ }
231
257
  if (refresh) {
232
- for (const row of r.rows ?? [])
233
- process.stdout.write(`${formatGateRow(row)}\n`);
258
+ for (const line of reportLines(r.rows ?? []))
259
+ process.stdout.write(`${line}\n`);
234
260
  process.stdout.write(`(the same list: ${REFRESH_LIST})\n`);
235
261
  if (r.applied?.length)
236
262
  process.stdout.write(`applied: ${r.applied.join(', ')} — gates.yaml was written\n`);
@@ -243,7 +269,7 @@ config
243
269
  if (!r.available.length)
244
270
  process.stdout.write('no more proposals\n');
245
271
  for (const g of r.available)
246
- process.stdout.write(` ${g.name} ${g.cmd} (${g.from})\n`);
272
+ process.stdout.write(` ${g.name} ${g.cmd} (${g.from})${g.areas?.length ? ` [areas: ${g.areas.join(', ')}]` : ''}\n`);
247
273
  });
248
274
  program.parseAsync(process.argv).catch((e) => {
249
275
  if (!(e instanceof NotARepository))
package/docs/README.ko.md CHANGED
@@ -1,26 +1,99 @@
1
1
  # reins
2
2
 
3
- [English](../README.md)
3
+ [![English](https://img.shields.io/badge/English-README-blue)](../README.md)
4
+ [![npm](https://img.shields.io/npm/v/@bluenyang/reins?label=npm)](https://www.npmjs.com/package/@bluenyang/reins)
5
+ [![license](https://img.shields.io/npm/l/@bluenyang/reins)](../LICENSE)
6
+ <br>
7
+ [![Node](https://img.shields.io/badge/Node-%E2%89%A522-339933?logo=nodedotjs&logoColor=white)](../package.json)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-ESM-3178C6?logo=typescript&logoColor=white)](../cli/tsconfig.json)
9
+ [![pnpm](https://img.shields.io/badge/pnpm-workspace-F69220?logo=pnpm&logoColor=white)](../package.json)
10
+ <br>
11
+ [![AGENTS.md](https://img.shields.io/badge/AGENTS.md-supported-555)](https://agents.md)
12
+ [![Agent Skills](https://img.shields.io/badge/Agent%20Skills-SKILL.md-555)](https://agentskills.io)
13
+ [![Claude Code](https://img.shields.io/badge/Claude%20Code-supported-D97757?logo=claude&logoColor=white)](https://code.claude.com)
14
+ [![Codex](https://img.shields.io/badge/Codex-supported-412991?logo=openai&logoColor=white)](https://developers.openai.com/codex)
15
+ [![Antigravity](https://img.shields.io/badge/Antigravity%20(agy)-supported-4285F4?logo=google&logoColor=white)](https://antigravity.google)
16
+ [![Cursor](https://img.shields.io/badge/Cursor%20Agent-supported-000000?logo=cursor&logoColor=white)](https://cursor.com)
4
17
 
5
- reins는 저장소의 에이전트 하네스를 관리합니다. 코딩 에이전트가 그 저장소에서 일하는 방식을 정하는 파일(`AGENTS.md`, 역할, 단계 스킬, 모델 할당)을 설치·이전·갱신·설정하는 것이 전부입니다. reins가 설치한 것은 프로젝트가 일하는 동안 reins를 실행하지 않습니다. 검사는 프로젝트의 훅 도구가 프로젝트의 명령으로 돌리고, 흐름을 지켰는지는 버전마다 감사가 판정합니다.
18
+ **AI를 활용하는 프로젝트의 세팅을 일관되게 유지하고, 반복은 에이전트가, 최종 결정은 사람이 하도록 합니다.**
6
19
 
7
- BlueNyang과 Team Croffle의 저장소 열두 곳이 같은 하네스 계통을 쓰면서 같은 문제를 겪었기 때문에 만들었습니다. 에이전트가 요청 밖으로 나가고, 한 세션이 구현과 판정을 함께 하고, 지식이 gitignore된 곳에서 사라지고, 사본이 서로 갈라졌습니다. 전체 목록은 [기획서](proposal.ko.md)에 있습니다.
20
+ reins는 저장소의 에이전트 하네스를 관리합니다. 코딩 에이전트가 그 저장소에서 일하는 방식을 정하는 파일(`AGENTS.md`, 스킬, 역할, 모델 할당)을 설치·이전·갱신·설정하는 것이 전부입니다. reins가 설치한 것은 프로젝트가 일하는 동안 reins를 실행하지 않습니다. 검사는 프로젝트의 훅 도구가 프로젝트의 명령으로 돌리고, plan 확인과 머지와 배포는 사람이 합니다.
21
+
22
+ ## 왜 만들었나
23
+
24
+ reins는 루프 엔지니어링에서 시작했습니다. 단계마다 명령이 있었고, 사람이 루프를 지켜보다가 다음 단계를 불러야 했습니다. 같은 하네스를 프로젝트마다 손으로 복사하다 보니 사본끼리 갈라졌고, 새 프로젝트에 하네스를 깔 때마다 같은 장문 프롬프트를 다시 써야 했습니다. reins는 이 일을 하네스를 설치하고 옮기고 갱신하는 도구로 바꿉니다.
25
+
26
+ 0.3까지 reins는 단계마다 에이전트를 통제하고 억제하려 했습니다. 처음에는 검증기로, 그다음에는 필수 감사로 했습니다. 그러다 한 프로젝트에서는 리뷰 루프가 여섯 시간 넘게 멈추지 않았고, 불필요한 리뷰와 감사 때문에 모델의 행동도 위축됐습니다. 진행해도 되는 자리에서도 단계마다 허락을 구했고, 감사를 맞추려고 끝난 작업을 다시 고쳐 썼습니다. 0.4는 반대로 갑니다. 강한 모델에게는 제약 대신 맥락을 주고, 중요한 결정은 사람이 쥐고, 작은 오픈 모델은 필요하면 전체 하네스를 고를 수 있게 합니다.
27
+
28
+ 각 결정에 어떻게 이르렀는지는 [docs/conversation/](conversation/README.md)에 있습니다.
8
29
 
9
30
  ## 상태
10
31
 
11
- **0.3.4-rc.2가 릴리스 후보입니다**(intent 024): `npx @bluenyang/reins@0.3.4-rc.2`. **0.3.3이 최신 릴리스입니다**(intent 019~023): `npx @bluenyang/reins install`. 0.2.0까지는 스킬과 훅이 작업 중에 `npx @bluenyang/reins`를 불렀습니다. 0.3은 그것을 없애고, `reins update`가 0.1.x·0.2.0 설치를 옮깁니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 앞으로의 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
32
+ **0.3.4가 최신 릴리스입니다.** 0.4는 `master`에 있고 아직 배포 전이며, 이 문서는 0.4를 설명합니다. 버전마다 바뀐 것은 [CHANGELOG.md](../CHANGELOG.md)에, 다음 계획은 [로드맵](ROADMAP.ko.md)에 있습니다.
33
+
34
+ ```sh
35
+ npx @bluenyang/reins install
36
+ ```
12
37
 
13
38
  ## 동작 방식
14
39
 
15
- - **기본은 단일 에이전트입니다.** 에이전트 하나(PM)가 모든 단계를 수행합니다. 조사, 리뷰, 감사처럼 읽기 위주의 일이나 급한 병렬 작업에는 같은 모델의 서브에이전트를 쓸 수 있습니다. 멀티는 역할군(PM, PL, Planner, Implementer, Executor, Advisor, Auditor)에 모델을 할당해 켭니다. 모델이 없는 역할군의 일은 PM이 합니다. 근거는 Anthropic의 [Building agents: When to fold subagents into your main agent loop](https://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop)(2026-10-22)입니다.
16
- - **흐름은 실행 중 차단이 아니라 문서로 적습니다.** `docs/ROADMAP.md` → intent → spec → 구현 → 리뷰 → 테스트 → PR·CI → 1차 감사 → 머지 → 릴리스 → 2차 감사 → 회고. 단계마다 `.agents/skills/`에 스킬이 있고, 순서와 멈추고 물을 때는 `AGENTS.md`에 있습니다.
17
- - **승인은 사용자가 합니다.** intent와 매번의 spec 요약은 사용자를 기다립니다. PM은 사용자의 말을 인용해 승인을 기록합니다. 사용자가 건너뛰라고 한 단계는 한 번만 적용됩니다.
18
- - **버전마다 두 번 감사합니다.** CI 뒤 머지 전에 1차 감사가 기록(intent, spec, git 이력, 로그)을 읽고 위험을 봅니다. 배포 뒤에는 2차 감사가 절차만 보고 결과를 회고로 넘깁니다. 사용자가 끄지 않는 한 필수이고, 기록은 `.agents/audit/`에 커밋됩니다.
19
- - **온보딩.** 설치 뒤 첫 대화에서 PM이 프로젝트를 파악하고 사용자에게 물어 `AGENTS.md`의 프로젝트 절을 씁니다.
20
- - **파일마다 수명이 있습니다.** 작업 중 파일은 회고 뒤에 요약하고 지웁니다.
40
+ - **기본은 단일 에이전트입니다.** 에이전트 하나(PM)가 일을 합니다. 조사, 리뷰, 감사처럼 읽기 위주의 일이나 서로 독립된 기능을 나란히 만들 때는 같은 모델의 서브에이전트를 쓸 수 있습니다. 멀티는 역할군(PM, PL, Planner, Implementer, Executor, Advisor, Auditor)에 모델을 할당해 켜고, 모델이 없는 군의 일은 PM이 합니다. 근거는 Anthropic의 [Building agents: When to fold subagents into your main agent loop](https://claude.com/resources/articles/building-agents-when-to-fold-subagents-into-your-main-agent-loop)(2026-10-22)입니다.
41
+ - **흐름이 아니라 스킬입니다.** 모델이 `.agents/skills/`의 스킬을 설명을 보고 고릅니다. 순서를 강제하지 않고, 작은 수정은 빠른 길로 갑니다(spec과 plan 없이 첫 리뷰만). `AGENTS.md`에는 코드로 알 수 없는 것만 둡니다. 위임 표, 사람이 하는 일, 배치, 그리고 프로젝트 자신의 절입니다.
42
+ - **사람은 다섯 곳에서 나섭니다.** 요구를 말하고, plan을 확인하고, 완료 보고를 확인하고, 머지하고, 배포합니다(rc 포함). 그 사이에서 에이전트는 묻지 않고 진행합니다. Claude Code에서는 머지, 패키지 배포, 릴리스, 기본 브랜치나 태그로의 push가 `.claude/settings.json`에서 막혀 있어(강제가 아니라 실수를 막는 장치), 에이전트는 작업 브랜치를 push하고 PR을 여는 데까지 갑니다.
43
+ - **리뷰는 멈출 때를 압니다.** 첫 리뷰는 반드시 받고, 정확성만 봅니다. 머지를 막는 것은 Important뿐이고, 고친 것을 증명할 수 있으면(테스트 통과, 오류가 사라짐) 다시 리뷰하지 않습니다.
44
+ - **gate는 area로 나눕니다.** `gates.yaml`이 area와 경로를 잇고, 훅은 바뀐 파일이 닿은 area의 gate만 돌립니다. area가 없는 gate는 늘 돌고, `gates.yaml` 자체가 바뀌면 모든 gate가 돕니다. 전체 검사는 CI가 합니다.
45
+ - **감사는 선택입니다.** 사람이 시작할 때만 돌고, 위험만 봅니다. 비밀, 레드라인, 되돌릴 수 없는 변경, 근거 없는 검사입니다.
46
+ - **판이 둘입니다.** `light`(기본)는 스킬 본문만 두고, `full`은 단계별 참고 문서와 역할 파일, `rs-*` 에이전트를 더합니다. 작은 모델을 쓸 때를 위한 판입니다.
47
+ - **파일마다 수명이 있습니다.** 파일마다 주인과 지우는 때가 정해져 있습니다.
21
48
 
22
49
  설계는 [design.ko.md](design.ko.md)에 있습니다.
23
50
 
51
+ ## 작업 하나의 처음부터 끝까지
52
+
53
+ 1. **아이디어.** 하고 싶은 것을 말합니다. 에이전트(`intent` 스킬)는 관련 정보를 찾아보고, 왜, 무엇을, 어떻게 바꾸고 싶은지 묻고, 더 나은 길이 보이면 그렇게 말하고, 정리한 것을 `.loctx/intent/`에 남깁니다. 정리된 항목은 `docs/ROADMAP.md`에 올라갑니다.
54
+ 2. **spec.** 무언가를 만들고 싶다고 하면 `spec`이 intent를 묶어 요구와 기초 설계를 `.agents/spec/<NNN>_<slug>/spec.md`에 쓰고, 설계의 방향을 묻습니다.
55
+ 3. **plan — 사람이 확인합니다.** `plan`이 plan을 하나 이상 씁니다. 바꿀 파일, 순서, 위험과 위협, 검증 방법, 사람이 볼 점이 들어갑니다. 확인하기 전에는 아무것도 만들지 않습니다.
56
+ 4. **구현.** `implement`는 사람이 말한 방식(직접, 서브에이전트, 다른 벤더의 모델, 병렬)으로 plan을 따릅니다. plan이 틀린 것으로 드러나면 방향을 바꾸고 알립니다.
57
+ 5. **PR과 첫 리뷰.** 에이전트가 작업 브랜치를 push하고, 완료 보고(바뀐 것, 구조, plan과 달라진 점, 로그 경로가 붙은 검증)를 담아 PR을 열고, 리뷰를 한 번 받습니다.
58
+ 6. **머지와 배포는 사람이 합니다.** 머지와 모든 배포(rc 포함)는 사람의 몫입니다.
59
+
60
+ 결함 수정이나 한 area 안에서 끝나는 작은 변경은 2와 3을 건너뜁니다. 에이전트가 고치고 첫 리뷰를 받은 뒤 보고에 "빠른 길"이라고 적습니다.
61
+
62
+ ## 스킬 쓰기
63
+
64
+ 설치한 뒤에는 평소처럼 에이전트와 이야기하면 됩니다. 말이 스킬의 설명과 맞으면 에이전트가 그 스킬을 고릅니다. 직접 부를 수도 있습니다. 예를 들어 Claude Code에서는 `/intent`입니다.
65
+
66
+ Codex, Antigravity(`agy`), Cursor Agent도 Claude Code처럼 `.agents/skills/`의 스킬을 자기 스킬로 봅니다(2026-11-30에 도구마다 확인). 위임 표의 실행 줄로 역할을 맡길 수도 있습니다. reins가 Claude Code에만 써 주는 것은 `.claude/settings.json`의 deny 규칙과, full판의 `rs-*` 서브에이전트입니다. 다른 도구에서는 머지와 배포를 `AGENTS.md`와 스킬의 글로만 막습니다.
67
+
68
+ | 이렇게 말하면 | 스킬 | 나오는 것 |
69
+ |---|---|---|
70
+ | "X를 하고 싶어, 왜냐하면 …", "…하면 어떨까" | `intent` | 질문, 조사, `.loctx/intent/`의 메모 |
71
+ | "X를 만들자" | `spec` | 요구와 기초 설계가 담긴 `spec.md`, 그리고 질문 |
72
+ | "시작할 준비 됐어", "계획 세워 줘" | `plan` | 확인받을 `plan.md` |
73
+ | "진행", "구현해 줘" | `implement` | 커밋, PR, 완료 보고 |
74
+ | "리뷰해 줘"(push할 때마다도) | `review` | 리뷰 한 번, 고친 것을 증명할 수 없을 때만 재리뷰 |
75
+ | "검사가 느려", "검사를 더하자" | `gates` | `gates.yaml` 제안 — 빼는 것부터 |
76
+ | "릴리스 노트 써 줘", Claude Code의 `/release`(`audit`, `retro`도 같음) | `release`, `audit`, `retro` | 릴리스 노트, 위험 감사, 회고 — 이름을 불러야만 돕니다 |
77
+
78
+ `install`이나 `update` 뒤의 첫 대화는 `onboard`로 시작합니다. 프로젝트를 읽고, 사람에게 묻고, `AGENTS.md`의 프로젝트 절을 쓰거나 정리합니다.
79
+
80
+ ## install이 프로젝트에 더하는 것
81
+
82
+ ```
83
+ <project>/
84
+ ├── AGENTS.md 위임 표, 사람이 하는 일, 배치(reins) + 프로젝트의 절
85
+ ├── CLAUDE.md @AGENTS.md
86
+ ├── .agents/ 커밋
87
+ │ ├── skills/ 스킬(full이면 references/도)
88
+ │ ├── spec/ spec과 plan, 작업 하나에 폴더 하나
89
+ │ ├── knowledge/ 남겨 둘 결정
90
+ │ └── harness/ bindings.yaml(모델, 모드, 판), gates.yaml, run-gates.sh, 템플릿
91
+ ├── .claude/ 커밋: skills/, settings.json(deny 규칙), agents/rs-*.md(full)
92
+ └── .loctx/ gitignore: intent/, ROADMAP.local.md, history/, reports/, 개인 설정
93
+ ```
94
+
95
+ 훅 도구(husky, lefthook, pre-commit)에는 단계마다 한 줄, `sh .agents/harness/run-gates.sh pre-commit`(그리고 `pre-push`)이 들어갑니다. `install`이 제안하고, `--hooks`를 주면 husky에 넣습니다.
96
+
24
97
  ## 시작하기
25
98
 
26
99
  설정할 저장소의 루트에서 실행합니다(Node 22 이상).
@@ -28,7 +101,7 @@ BlueNyang과 Team Croffle의 저장소 열두 곳이 같은 하네스 계통을
28
101
  ```sh
29
102
  npx @bluenyang/reins install --dry-run # 무엇을 쓸지 보기
30
103
  npx @bluenyang/reins install # 묻고 나서 하네스 배치
31
- npx @bluenyang/reins config # 모델과 역할, 에이전트 도구, 모드, 감사
104
+ npx @bluenyang/reins config # 모델과 역할, 에이전트 도구, 모드, 판, gate
32
105
  ```
33
106
 
34
107
  그다음 저장소에서 에이전트를 여세요. `AGENTS.md`의 온보딩 표시가 첫 대화를 시작합니다. Claude Code에서는 플러그인이 같은 명령을 보여 줍니다.
@@ -39,28 +112,45 @@ npx @bluenyang/reins config # 모델과 역할, 에이전트 도구
39
112
  /reins:reins-setup
40
113
  ```
41
114
 
42
- reins 자체를 개발하려면 `git clone https://github.com/bluenyang/reins.git` 뒤 `pnpm install`, `pnpm build`를 하고 `node cli/dist/reins.js <명령>`으로 실행합니다([CONTRIBUTING.ko.md](CONTRIBUTING.ko.md)).
43
-
44
115
  ## 명령
45
116
 
46
117
  | 명령 | 하는 일 |
47
118
  |---|---|
48
- | `install` | 하네스를 배치하고, 에이전트 도구를 감지하고, 게이트를 확인하고, 검사 스크립트 `.agents/harness/run-gates.sh`(프로젝트 게이트 명령을 돌리고 출력을 감사용으로 남김)를 쓰고 그것을 부르는 훅 한 줄을 제안하고(`--hooks`면 husky에 넣음), 온보딩 표시를 남깁니다. `--mode manual\|auto`, `--dry-run`, `--json` |
49
- | `migrate` | 이전 하네스나 `.ai/` 작업 공간을 이 배치로 옮기고, 이전 `AGENTS.md`는 PM이 합치도록 따로 둡니다. `--legacy local\|committed`, `--dry-run` |
50
- | `update` | 패키지의 하네스를 다시 적용합니다. 손으로 고친 생성 파일은 덮어쓰기 전에 묻고(`--force`), 0.1.x·0.2.0 설치를 0.3으로 옮기며 옛 작업 파일을 보여 줍니다(`--yes`면 지움) |
51
- | `config` | 터미널에서 화면: 모델과 역할, 에이전트 도구, 모드(single·multi), 감사. `config bindings`·`config gates`는 플래그로(`configure`는 별칭). `config gates --refresh`는 프로젝트 검사를 다시 찾아(이름과 본문, 워크스페이스, CI) 모든 게이트와 후보를 상태와 근거와 함께 보여 줍니다 — 적용됨, 적용 안 됨, 다른 것이 이미 돌림. 같은 목록을 `.loctx/gates-refresh.md`에 남기고, `gates.yaml`은 고른 대로만 바꿉니다(터미널이 아니면 `--apply <이름…|all|remove:이름>`). 게이트가 없어졌다고 판정하지 않습니다. 화면의 `gates` 항목에서도 같은 일을 합니다. 군이나 역할에 대체 모델을 적을 수 있습니다(`config bindings --fallback <군>[.<역할>]=<model>`). 첫 모델을 부를 수 없을 때 쓰도록 대체 실행 줄이 위임 표에 들어갑니다 |
119
+ | `install` | 하네스 배치, 판 묻기, gate를 찾고 area 제안, 훅 줄 제안, 온보딩 표시(`--mode`, `--profile`, `--hooks`, `--dry-run`, `--json`) |
120
+ | `migrate` | 이전 하네스나 `.ai/` 작업 공간을 이 배치로 옮김(`--legacy`, `--dry-run`) |
121
+ | `update` | 패키지의 하네스를 다시 적용하고, 손으로 고친 파일은 덮어쓰기 전에 물으며(`--force`), 이전 설치를 올림(`--yes`, `--dry-run`) |
122
+ | `config` | 터미널에서는 화면: 모델과 역할, 에이전트 도구, 모드, 판, 감사 모델, gate. 화면 없이는 `config bindings`와 `config gates`에 플래그를 줌 |
52
123
 
53
- ## 스킬
124
+ **0.3에서 `update`.** `roadmap`, `test`, `merge` 스킬을 지우고(손으로 고친 것은 남기고 알림), `AGENTS.md`에 새 블록을 쓰고, 설치된 에이전트로 판을 정하고(`rs-*` 에이전트가 있으면 `full`, 없으면 `light`), `gates.yaml`을 area 없이 2판으로 올리고(검사 동작은 그대로), `onboard`가 처리할 reset 표시를 남깁니다. 0.1.x나 0.2.0에서는 먼저 0.3으로 옮기고 옛 작업 파일 목록을 보여 줍니다(`--yes`면 지움).
125
+
126
+ **`config gates`.** `--refresh`는 프로젝트의 검사를 다시 찾아(스크립트의 이름과 본문, 워크스페이스, CI) 모든 gate와 후보를 상태와 근거와 함께 보여 주고, 뺄 것 후보를 맨 앞에 둡니다. 같은 목록이 `.loctx/gates-refresh.md`에 남고, `gates.yaml`은 사람이 고른 대로만 바뀝니다(`--apply <이름…|all|remove:이름>`). `--define-area <이름>=<글롭,…>`, `--area <gate>=<area,…>`, `--on <gate>=<단계,…>`로 area와 단계를 정합니다.
127
+
128
+ **대체 모델.** 군이나 역할마다 하나를 정할 수 있습니다(`config bindings --fallback <군>[.<역할>]=<모델>`). 그 호출 줄이 위임 표에 들어가, 첫 모델을 부를 수 없을 때 씁니다.
129
+
130
+ ## 이 저장소
131
+
132
+ ```
133
+ reins/
134
+ ├── cli/src/
135
+ │ ├── reins.ts CLI 진입점
136
+ │ ├── commands/ install, migrate, update, config(과 그 화면)
137
+ │ └── lib/ AGENTS.md 블록, bindings, gate 탐색과 검사 스크립트, 생성, update 단계
138
+ ├── harness/ .agents/harness/에 설치되는 것: 역할, 템플릿, 스키마, 레드라인, 모델
139
+ ├── skills/ .agents/skills/에 설치되는 것(reins-setup은 플러그인용)
140
+ ├── cli/test/, test/e2e/ vitest 단위 테스트와 끝단 테스트
141
+ ├── docs/ 설계, 기획, 로드맵, 설계 대화, 한글판
142
+ └── .agents/, .claude/ 이 저장소 자신의 하네스 — reins의 첫 사용자
143
+ ```
54
144
 
55
- `onboard`, `roadmap`, `intent`, `spec`, `implement`, `review`, `test`, `merge`, `audit`, `release`, `retro`. 단계마다 하나이고 평문이며, 단일과 멀티에서 같은 스킬을 씁니다. 스킬마다 만드는 파일과 지우는 때, 다음 스킬을 적습니다.
145
+ reins를 고치려면 `git clone https://github.com/bluenyang/reins.git` 뒤에 `pnpm install`, `pnpm build`를 하고 `node cli/dist/reins.js <명령>`으로 실행합니다. `pnpm check`가 lint, 포맷, 타입 검사, 테스트를 돌립니다([CONTRIBUTING.ko.md](CONTRIBUTING.ko.md)).
56
146
 
57
147
  ## 문서
58
148
 
59
- - [proposal.ko.md](proposal.ko.md): 문제, 목표, 요구사항
60
- - [design.ko.md](design.ko.md): 배치, 역할, 흐름, 감사, 파일 형식, CLI
149
+ - [proposal.ko.md](proposal.ko.md): 문제, 목표, 요구
150
+ - [design.ko.md](design.ko.md): 배치, 역할, 스킬과 사람의 확인점, 파일 형식, CLI
61
151
  - [ROADMAP.ko.md](ROADMAP.ko.md): 버전
62
- - [conversation/](conversation/README.md): 메인테이너의 설계 대화. 시기별로 무엇을 두고 고민했고 왜 그렇게 정했는지를 적은 것이며 규칙은 아닙니다
63
- - 영어판: [proposal.md](proposal.md), [design.md](design.md), [ROADMAP.md](ROADMAP.md). 둘이 어긋나면 한글판이 기준입니다.
152
+ - [conversation/](conversation/README.md): 메인테이너의 설계 대화를 시기별로 — 무엇을 따졌고 왜 그렇게 정했는지(규칙이 아님)
153
+ - 영문판: [README.md](../README.md), [proposal.md](proposal.md), [design.md](design.md), [ROADMAP.md](ROADMAP.md). 영문판과 한글판이 어긋나면 한글 파일이 기준입니다.
64
154
 
65
155
  ## 라이선스
66
156
 
@@ -2,7 +2,19 @@
2
2
 
3
3
  Read by `reins update`: it lists the entries newer than a project's pinned version.
4
4
 
5
+ ## 0.4.0
6
+ - Skills instead of a flow: the fixed order of stages and the "next skill" chain are gone; the model picks a skill by its description. New `plan` (plans that a person confirms) and `gates` (the gates designed with a person). `roadmap`, `test` and `merge` are gone: `intent` takes ideas, the plan's checks and `implement` take the tests, and a person merges. `release`, `audit` and `retro` start only when a person asks (`disable-model-invocation: true`).
7
+ - From 0.3: `update` deletes `.agents/skills/roadmap`, `test` and `merge` and their `.claude/skills/` copies. A skill that differs from what 0.3 shipped is kept and listed (exit 1, as for a hand-edited file); on a terminal it is deleted only on yes, and `--force` deletes it.
8
+ - AGENTS.md: the managed blocks are delegation (first), people (what a person does), layout and notice, plus language. The settings, flow, records and stops blocks are taken out; text outside the blocks stays. The delegation block's first line says that `.loctx/delegation.local.md` wins when it exists.
9
+ - A person states the requirement, confirms the plan, checks the completion report, merges and releases. Approvals, waivers and the adjustment record (`A-n`) are gone; a plan's confirmation is one line, `agreed: { at, words }`. The deployer pushes and opens pull requests only.
10
+ - Profiles: `profile: light | full` in `bindings.yaml`. light keeps the skill bodies; full adds each skill's `references/`, the role files and the `rs-*` agents. From 0.3, `update` writes `full` when `.claude/agents/` holds `rs-*` agents and `light` otherwise, so the harness works as it did; `reins config` changes it. In light the role files and the skills' `references/` are removed.
11
+ - The audit is optional and looks at risk only (secrets, red lines, irreversible changes, checks without evidence); a person starts it. `audit.required` is removed from `bindings.yaml`; the auditor's model, if set, stays as the recommended one.
12
+ - gates.yaml version 2 (`reins/gates@2`): `areas` (name → path globs) and, per gate, `areas` and `on` (stages). `run-gates.sh` runs only the gates of the areas a change touches; a gate without areas always runs. From 0.3, `update` changes only the schema line, so every gate runs as before; split the gates into areas with the `gates` skill or `reins config gates`.
13
+ - Deny rules in `.claude/settings.json`: merging and releasing are a person's — `gh pr merge`, `git push` to the default branch (its name is read at install into `install.yaml`'s `default_branch`), `npm publish`, `pnpm publish`, `yarn publish`, `yarn npm publish`, `bun publish`, `gh release create`, `gh workflow run`, and tag pushes (`--tags`, `--follow-tags`, a `refs/tags/` refspec). A work branch push stays allowed. These are globs over the command string: they prevent mistakes, they do not enforce.
14
+ - From 0.3, `update` leaves `<!-- reins:reset pending -->` in AGENTS.md with a to-do list for the `onboard` skill: old flow wording in the project sections, whether to split `.loctx/ROADMAP.local.md` into notes under `.loctx/intent/`, whether to split the gates into areas, the profile, and that the records up to 0.3 are reference material. `.agents/intent/`, `.agents/audit/`, `.agents/knowledge/` and `.loctx/` are not touched, so a 0.3 spec in progress can be continued.
15
+
5
16
  ## 0.3.4
17
+ - Stable 2026-11-25 (same harness as rc.2).
6
18
  - Gate discovery finds candidates by name and body: a script with `check`, `lint`, `test`, `typecheck`, `build`, `e2e`, `verify` or `ci` as a word of its name, or `type-check` (`lint:check`, `format:check`, `check:migrations`, `test:unit`, `build:web`), Makefile targets and go.mod below the root, workspace packages (pnpm, npm, yarn 1 and berry, bun, turbo, nx, lerna) and the one-line `run:` commands of pull-request workflows. Each candidate has a state and its reasons: picked, offered, already run by another script or gate, or excluded (rewrites files, never ends, install step, platform packaging). `lint:check` is no bundle any more but a gate of its own; a gate name has `-` where the script has `:`.
7
19
  - `reins config gates --refresh` no longer reports new, changed or gone. It shows every gate and candidate with its state — applied, applied (written by hand / source not found / another command), not applied, not applied (already runs) — and leaves the same list in `.loctx/gates-refresh.md`, so the user picks and an agent edits `gates.yaml` in a commit of its own. reins never calls a gate gone and never removes one by itself; `--apply all` only adds, removing and replacing take a name.
8
20
  - `.agents/harness/run-gates.sh` reads `gates.yaml` when it runs (POSIX `awk`, the shape reins writes) instead of holding the commands, so editing `gates.yaml` is enough. Another shape, or a missing `gates.yaml`, stops the run with exit 2 before anything runs. The script is written even without a required gate; `config gates` no longer rewrites it. `gates.yaml` is the project's file, not a generated one.
package/harness/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.4
1
+ 0.4.0
@@ -1,5 +1,7 @@
1
1
  schema: reins/policy/red-lines@1
2
- # What no role does (design §2-4). Agents keep these; the audit judges them; C4 patterns also become deny rules.
2
+ # What no role does (design §2). Agents keep these; an audit a person asks for looks for them. C4 patterns and
3
+ # C6 commands also become deny rules in .claude/settings.json (with git push to the default branch); those
4
+ # prevent mistakes, they do not enforce (design §6).
3
5
  rules:
4
6
  - id: C1
5
7
  text: Implementing "to pass" — hard-coding, or making only some paths look right. Fix the cause.
@@ -14,12 +16,12 @@ rules:
14
16
  - id: C5
15
17
  text: Bypassing hooks (--no-verify) or massaging gate output (pipes that hide the exit code).
16
18
  - id: C6
17
- text: push, PR, merge, release, tag without the user's instruction or a setting that allows it (the deployer within that scope).
19
+ text: Merging and releasing — merging a pull request, pushing to the default branch, publishing a package, creating or pushing a tag, creating a release, dispatching a workflow. A person does these; an agent goes as far as pushing its work branch and opening the pull request.
20
+ # each command alone or with arguments becomes a deny rule; reins adds pushes to the default branch and tag pushes (--tags, --follow-tags, refs/tags/)
21
+ commands: ['gh pr merge', 'npm publish', 'pnpm publish', 'yarn publish', 'yarn npm publish', 'bun publish', 'gh release create', 'gh workflow run']
18
22
  - id: C7
19
23
  text: Reversing a recorded decision (knowledge/) without the user.
20
24
  - id: C8
21
- text: Re-raising a proposal the user rejected.
25
+ text: Raising again a proposal the user rejected.
22
26
  - id: C9
23
27
  text: Touching running servers, clusters or network devices.
24
- - id: C10
25
- text: Changing files or behaviour outside the intent and spec — ask the PM.
@@ -3,7 +3,7 @@ group: advisor
3
3
  summary: "High-capability models the PM consults on large, complex or abstract requirements and on serious incidents."
4
4
  roles:
5
5
  committee:
6
- does: "Analyse the PM's information and question and answer with options, grounds and a recommendation; for an incident (e.g. the flow not followed), the root cause and a remedy."
6
+ does: "Analyse the PM's information and question and answer with options, grounds and a recommendation; for an incident, the root cause and a remedy."
7
7
  must_not:
8
8
  - "extend its own authority or decide for the user"
9
9
  - "read the other committee members' answers before answering"