@bluenyang/reins 0.2.0 → 0.3.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 (97) hide show
  1. package/README.md +50 -203
  2. package/cli/dist/commands/config-models.js +206 -127
  3. package/cli/dist/commands/config.js +104 -16
  4. package/cli/dist/commands/configure.js +166 -134
  5. package/cli/dist/commands/install.js +161 -217
  6. package/cli/dist/commands/migrate.js +23 -48
  7. package/cli/dist/commands/update.js +203 -30
  8. package/cli/dist/lib/agents-md.js +111 -0
  9. package/cli/dist/lib/bindings.js +227 -386
  10. package/cli/dist/lib/detect.js +7 -2
  11. package/cli/dist/lib/generate.js +56 -75
  12. package/cli/dist/lib/harness.js +0 -3
  13. package/cli/dist/lib/migrate-plan.js +3 -3
  14. package/cli/dist/lib/prompter.js +4 -4
  15. package/cli/dist/lib/reader.js +20 -0
  16. package/cli/dist/lib/upstream.js +0 -17
  17. package/cli/dist/lib/vendor-write.js +9 -56
  18. package/cli/dist/reins.js +59 -270
  19. package/docs/README.ko.md +31 -204
  20. package/harness/CHANGELOG.md +8 -3
  21. package/harness/VERSION +1 -1
  22. package/harness/models.yaml +8 -0
  23. package/harness/policy/common-red-lines.yaml +4 -4
  24. package/harness/roles/advisor.md +10 -14
  25. package/harness/roles/auditor.md +17 -0
  26. package/harness/roles/executor.md +32 -0
  27. package/harness/roles/implementer.md +23 -21
  28. package/harness/roles/pl.md +44 -21
  29. package/harness/roles/planner.md +17 -19
  30. package/harness/roles/pm.md +16 -21
  31. package/harness/schemas/bindings.schema.json +55 -0
  32. package/harness/schemas/install.schema.json +1 -2
  33. package/harness/schemas/intent.schema.json +1 -13
  34. package/harness/templates/agents-md-blocks.md +52 -17
  35. package/harness/templates/audit.md +25 -0
  36. package/harness/templates/history.md +14 -0
  37. package/harness/templates/intent.md +5 -0
  38. package/harness/templates/spec.md +4 -2
  39. package/package.json +1 -2
  40. package/skills/audit/SKILL.md +28 -0
  41. package/skills/implement/SKILL.md +30 -0
  42. package/skills/intent/SKILL.md +28 -0
  43. package/skills/merge/SKILL.md +26 -0
  44. package/skills/onboard/SKILL.md +31 -0
  45. package/skills/reins-setup/SKILL.md +16 -25
  46. package/skills/release/SKILL.md +26 -0
  47. package/skills/retro/SKILL.md +30 -0
  48. package/skills/review/SKILL.md +27 -0
  49. package/skills/roadmap/SKILL.md +29 -0
  50. package/skills/spec/SKILL.md +27 -0
  51. package/skills/test/SKILL.md +26 -0
  52. package/cli/dist/commands/check.js +0 -379
  53. package/cli/dist/commands/gate.js +0 -136
  54. package/cli/dist/commands/knowledge.js +0 -111
  55. package/cli/dist/commands/metrics.js +0 -138
  56. package/cli/dist/commands/new.js +0 -190
  57. package/cli/dist/commands/retro.js +0 -7
  58. package/cli/dist/commands/stages.js +0 -562
  59. package/cli/dist/commands/status.js +0 -281
  60. package/cli/dist/lib/enforcement.js +0 -125
  61. package/cli/dist/lib/memory.js +0 -96
  62. package/cli/dist/lib/metrics.js +0 -223
  63. package/cli/dist/lib/retro.js +0 -179
  64. package/cli/dist/lib/verdict.js +0 -15
  65. package/cli/dist/lib/work.js +0 -106
  66. package/cli/dist/scripts/enforcement.js +0 -24
  67. package/harness/policy/budget.yaml +0 -13
  68. package/harness/policy/enforcement.yaml +0 -98
  69. package/harness/policy/stops.yaml +0 -29
  70. package/harness/policy/transitions.yaml +0 -13
  71. package/harness/roles/code-review.md +0 -27
  72. package/harness/roles/deploy.md +0 -50
  73. package/harness/roles/docs.md +0 -19
  74. package/harness/roles/lookup.md +0 -22
  75. package/harness/roles/qa-design.md +0 -22
  76. package/harness/roles/qa-run.md +0 -19
  77. package/harness/roles/verify-tool.md +0 -21
  78. package/harness/schemas/bindings-local.schema.json +0 -21
  79. package/harness/schemas/bus-request.schema.json +0 -17
  80. package/harness/schemas/bus-response.schema.json +0 -14
  81. package/harness/schemas/enforcement.schema.json +0 -22
  82. package/harness/schemas/plan.schema.json +0 -10
  83. package/harness/schemas/ticket.schema.json +0 -15
  84. package/harness/templates/bus/request.yaml +0 -20
  85. package/harness/templates/bus/response.yaml +0 -10
  86. package/harness/templates/plan.md +0 -23
  87. package/harness/templates/ticket.md +0 -29
  88. package/skills/reins-implement/SKILL.md +0 -20
  89. package/skills/reins-intent/SKILL.md +0 -26
  90. package/skills/reins-loop/SKILL.md +0 -26
  91. package/skills/reins-loop/references/vendor-cli.md +0 -41
  92. package/skills/reins-release/SKILL.md +0 -18
  93. package/skills/reins-retro/SKILL.md +0 -20
  94. package/skills/reins-review/SKILL.md +0 -23
  95. package/skills/reins-roadmap/SKILL.md +0 -17
  96. package/skills/reins-spec/SKILL.md +0 -22
  97. package/skills/reins-test/SKILL.md +0 -18
@@ -1,26 +1,21 @@
1
1
  ---
2
- role: pm
3
- default_binding: "claude-opus-5-5"
4
- summary: "Talks with the user, owns intent confirmation, first spec review, budgets, roadmap and the project sections of AGENTS.md."
5
- covered_by: none
6
- may:
7
- - "talk with the user and write the user-facing summary of a spec (R64)"
8
- - "propose an intent for the user's approval; maintain docs/ROADMAP.md"
9
- - "edit the project sections of AGENTS.md (outside reins managed blocks)"
10
- - "set token budgets per version or scope (R49)"
11
- - "propose knowledge promotions for the user's approval"
12
- must_not:
13
- - "edit source code"
14
- - "mark an intent approved without the user"
15
- - "push, open PRs, merge, release, tag"
2
+ group: pm
3
+ summary: "Talks with the user and owns the flow: intent, approvals, assignments and every report."
4
+ roles:
5
+ pm:
6
+ does: "Turn the user's goals into an approved intent and a delivered version, asking only what the user must decide."
7
+ must_not:
8
+ - "record an approval the user did not give, or approve on the user's behalf"
9
+ - "reword the user's request when quoting it; mark any interpretation as the agent's"
10
+ - "push, open PRs, merge, release or tag without the user's instruction or a setting that allows it"
11
+ tools: { write: true, shell: true, push: false }
16
12
  ---
17
-
18
13
  # pm
19
14
 
20
- Stage skills: `reins-roadmap`, `reins-intent`, `reins-spec`, `reins-retro`.
15
+ Every stage skill starts with the PM; in single mode the PM does every role below itself.
21
16
 
22
- 1. Session start: read AGENTS.md, docs/ROADMAP.md, open intents (.agents/intent/*/intent.md with status draft|approved), then `reins status`.
23
- 2. New request → run the questionnaire skill; write intent.md in the user's words; ask the user to approve. Never set `status: approved` yourself.
24
- 3. Spec review: read spec.md against intent.md; approve or send back; write `summary_for_user` (3–5 lines) and show it — the user may veto.
25
- 4. Budgets: set `budget:` in plan.md when the planner hands it over; adjust scopes with `reins configure budget`.
26
- 5. Retro (`reins-retro`): `reins retro` candidates → `reins knowledge propose` → show drafts → the user approves → `reins knowledge accept`, commit with `Approved-by: user`. Never accept unapproved.
17
+ - **Talk.** Ask the user what only the user can decide (goals, scope, boundaries, irreversible steps); decide the rest yourself and write it down under "decided by agents" with the alternative and the reason.
18
+ - **Write the intent** in the user's words: problem, desired result, plan (order of work), scope, constraints, open questions, not doing.
19
+ - **Record approvals** by quoting the user: `{ role: user, by, at, words, rev }`. A step the user tells you to skip goes to the intent's `waivers:` and applies once.
20
+ - **Assign.** When a group is switched on (AGENTS.md delegation table), hand it the work with the list of files and decisions it needs. Every report comes back to you; a role never calls another model itself.
21
+ - **Answer the question asked.** Do not answer a different question (e.g. turn "why is X used" into "how fast is X").
@@ -0,0 +1,55 @@
1
+ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/bindings@2", "type": "object",
2
+ "required": ["schema"],
3
+ "additionalProperties": false,
4
+ "properties": {
5
+ "schema": { "const": "reins/bindings@2" },
6
+ "mode": { "enum": ["single", "multi"] },
7
+ "audit": {
8
+ "type": "object", "additionalProperties": false,
9
+ "properties": { "required": { "type": "boolean" } }
10
+ },
11
+ "default": { "$ref": "#/$defs/binding" },
12
+ "tools": {
13
+ "type": "object",
14
+ "additionalProperties": {
15
+ "type": "object", "additionalProperties": false,
16
+ "properties": { "cli": { "type": "string", "minLength": 1 }, "use": { "type": "boolean" } }
17
+ }
18
+ },
19
+ "groups": {
20
+ "type": "object", "additionalProperties": false,
21
+ "properties": {
22
+ "pl": { "$ref": "#/$defs/many" },
23
+ "planner": { "$ref": "#/$defs/one" },
24
+ "implementer": { "$ref": "#/$defs/one" },
25
+ "executor": { "$ref": "#/$defs/one" },
26
+ "advisor": { "$ref": "#/$defs/many" },
27
+ "auditor": { "$ref": "#/$defs/one" }
28
+ }
29
+ }
30
+ },
31
+ "$defs": {
32
+ "binding": {
33
+ "type": "object", "required": ["vendor", "model"], "additionalProperties": false,
34
+ "properties": { "vendor": { "type": "string", "minLength": 1 }, "model": { "type": "string", "minLength": 1 } }
35
+ },
36
+ "roles": { "type": "object", "additionalProperties": { "$ref": "#/$defs/binding" } },
37
+ "one": {
38
+ "type": "object", "additionalProperties": false,
39
+ "dependentRequired": { "vendor": ["model"], "model": ["vendor"] },
40
+ "properties": {
41
+ "vendor": { "type": "string", "minLength": 1 }, "model": { "type": "string", "minLength": 1 },
42
+ "roles": { "$ref": "#/$defs/roles" }
43
+ }
44
+ },
45
+ "many": {
46
+ "type": "object", "additionalProperties": false,
47
+ "dependentRequired": { "vendor": ["model"], "model": ["vendor"] },
48
+ "properties": {
49
+ "vendor": { "type": "string", "minLength": 1 }, "model": { "type": "string", "minLength": 1 },
50
+ "models": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/binding" } },
51
+ "roles": { "$ref": "#/$defs/roles" }
52
+ }
53
+ }
54
+ }
55
+ }
@@ -1,8 +1,7 @@
1
1
  { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/install@1", "type": "object",
2
- "required": ["schema", "tier", "version"],
2
+ "required": ["schema", "version"],
3
3
  "properties": {
4
4
  "schema": { "const": "reins/install@1" },
5
- "tier": { "enum": ["harness", "loop", "graph"] },
6
5
  "version": { "type": "string" },
7
6
  "cli": { "type": "string" },
8
7
  "mode": { "enum": ["manual", "auto"] },
@@ -1,13 +1 @@
1
- { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/intent@1", "type": "object",
2
- "required": ["id", "slug", "version", "status", "origin", "approvals"],
3
- "properties": {
4
- "id": { "type": "string", "pattern": "^[0-9]{3}$" },
5
- "slug": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
6
- "version": { "type": "string" },
7
- "status": { "enum": ["draft", "approved", "released", "superseded"] },
8
- "origin": { "enum": ["user", "agent", "incident"] },
9
- "approvals": { "$ref": "#/$defs/approvals" },
10
- "supersedes": { "type": ["string", "null"] }
11
- },
12
- "$defs": { "approvals": { "type": "array", "items": { "type": "object", "required": ["role", "at"],
13
- "properties": { "role": { "type": "string" }, "at": { "type": "string" }, "kind": { "type": "string" } } } } } }
1
+ {"$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "reins/intent@1", "type": "object", "required": ["id", "slug", "version", "status", "origin", "approvals"], "properties": {"id": {"type": "string", "pattern": "^[0-9]{3}$"}, "slug": {"type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"}, "version": {"type": "string"}, "status": {"enum": ["draft", "approved", "released", "superseded"]}, "origin": {"enum": ["user", "agent", "incident"]}, "approvals": {"$ref": "#/$defs/approvals"}, "supersedes": {"type": ["string", "null"]}, "waivers": {"type": "array", "items": {"type": "object", "required": ["step", "words", "at"], "properties": {"step": {"type": "string"}, "words": {"type": "string"}, "at": {"type": "string"}, "scope": {"enum": ["once"]}}}}}, "$defs": {"approvals": {"type": "array", "items": {"type": "object", "required": ["role", "at"], "properties": {"role": {"type": "string"}, "at": {"type": "string"}, "kind": {"type": "string"}, "by": {"type": "string"}, "words": {"type": "string"}, "rev": {"type": "string"}}}}}}
@@ -1,26 +1,61 @@
1
- <!-- reins:begin notice v=0.1.0 -->
2
- > The blocks marked `reins:begin … reins:end` in this file are generated by reins from `.agents/harness/`. Do not edit them by hand; run `reins update`. Everything outside the blocks belongs to the project.
1
+ <!-- reins:begin notice v=0.3.0 -->
2
+ > The blocks marked `reins:begin … reins:end` are written by reins from `.agents/harness/`. Do not edit them by hand; the user changes them with `reins config` or `reins update` in a terminal. Everything outside the blocks belongs to the project. Nothing in this repository runs reins while you work.
3
3
  <!-- reins:end notice -->
4
4
 
5
- <!-- reins:begin workflow v=0.1.0 -->
6
- ## Workflow
5
+ <!-- reins:begin layout v=0.3.0 -->
6
+ ## Layout
7
7
 
8
- - Session start: `AGENTS.md` → `docs/ROADMAP.md` → open intents in `.agents/intent/` → `reins status`.
9
- - Work comes from `.loctx/ticket/`; one file is one item; delete it when done after writing a line in `.loctx/history/`.
10
- - **Committing is part of doing the work.** Land each finished unit — one coherent change that builds on its own — as its own local commit as you go, on the feature branch. Do not batch a whole ticket into one commit, and do not wait for permission to commit locally. Never commit on the default branch; never bypass hooks.
11
- - Before a non-trivial decision: `reins recall <keyword>` (knowledge, history, symptoms).
12
- - The verifier runs at every transition (`reins check`). Verdicts: CONTINUE · HOLD (ask the user) · STOP (recorded, resumable) · ESCALATE. A stop names its reason id (A1–G2).
13
- - Anything that leaves the machine happens only in the deploy role inside the pre-release loop, or on the user's explicit instruction.
14
- <!-- reins:end workflow -->
8
+ - `.agents/` — committed agent context: `intent/<NNN>_<slug>/{intent,spec}.md`, `audit/<version>.md`, `knowledge/`, `harness/` (settings, roles, templates), `skills/` (the stage skills).
9
+ - `.loctx/` — this machine only (gitignored): `ROADMAP.local.md`, `history/<version>.md`, `reports/<version>/`, `context/`, `bindings.local.yaml`.
10
+ - `docs/ROADMAP.md` — the public roadmap.
11
+ <!-- reins:end layout -->
15
12
 
16
- <!-- reins:begin skills v=0.1.0 -->
17
- ## Skills
13
+ <!-- reins:begin settings v=0.3.0 -->
14
+ ## Settings
18
15
 
19
- See `.agents/SKILLS.md`. Skills that push, merge or release are user-invoked only.
20
- <!-- reins:end skills -->
16
+ - `.agents/harness/bindings.yaml` — the mode (`single` or `multi`), which model does which role group, and `audit.required`. A personal override may sit in `.loctx/bindings.local.yaml`; when it exists, it wins.
17
+ - **When `audit.required` is true (the default), every version ends with an audit (skill `audit`). It is mandatory: never skip it; only the user switches it off.**
18
+ - `.agents/harness/gates.yaml` — the project's own check commands; the hooks and the `test` skill run them as they are.
19
+ - `.agents/harness/roles/<group>.md` — what each role does, must not do, and which tools it may use.
20
+ <!-- reins:end settings -->
21
21
 
22
- <!-- reins:begin language v=0.1.0 -->
22
+ <!-- reins:begin flow v=0.3.0 -->
23
+ ## Flow
24
+
25
+ Follow these steps in order; each has a skill in `.agents/skills/`, and each skill names the next.
26
+
27
+ 1. `roadmap` — ideas go to `.loctx/ROADMAP.local.md`; once settled with the user, to `docs/ROADMAP.md`.
28
+ 2. `intent` — the PM writes the direction and the plan; **the user approves**.
29
+ 3. `spec` — the spec, its work units (W-n) and checks (V-n); **the user answers 진행 or 수정 on its summary, every time**.
30
+ 4. `implement` → `review` — one work unit, one commit, naming its spec items.
31
+ 5. `test` → `merge` → **`audit`** (after the merge, before the rc) → `release` → `retro` (after stable), then delete the version's working files.
32
+
33
+ The first conversation after installation (or after a reconcile or mode-changed marker appears in this file) starts with `onboard`.
34
+ <!-- reins:end flow -->
35
+
36
+ <!-- reins:begin delegation v=0.3.0 -->
37
+ {{DELEGATION}}
38
+ <!-- reins:end delegation -->
39
+
40
+ <!-- reins:begin records v=0.3.0 -->
41
+ ## Approvals and records
42
+
43
+ - Record an approval by quoting the user in the intent's or spec's `approvals:` — `{ role: user, by, at, words, rev }` — and commit it. Never record an approval the user did not give.
44
+ - A step or approval the user tells you to skip goes to the intent's `waivers:` — `{ step, words, at, scope: once }` — at that moment. It applies once; next time, follow the flow.
45
+ - Every file you create has an owner and a deletion point (each skill lists them). Working files under `.loctx/reports/<version>/` are summarised in history and the audit, then deleted after the retro.
46
+ <!-- reins:end records -->
47
+
48
+ <!-- reins:begin stops v=0.3.0 -->
49
+ ## When to stop and ask
50
+
51
+ - **Ask the user and stop:** an irreversible action (force push, deleting a tag, rewriting the default branch, data or production changes); a stable release; anything that leaves the machine (push, PR, release) unless the settings or the user allow it; scope moving outside the intent and spec; a conflict with a past decision; a next step that needs an approval not yet given.
52
+ - **Stop and find the cause:** two failures in the same work unit; empty or doubtful check output; a pass without evidence (a pass needs the raw output's path).
53
+ - **When the user interrupts** (chat, Ctrl+C, session end): stop and write the resume point in `.loctx/history/<version>.md`.
54
+ - What no role does: `.agents/harness/policy/common-red-lines.yaml`.
55
+ <!-- reins:end stops -->
56
+
57
+ <!-- reins:begin language v=0.3.0 -->
23
58
  ## Language
24
59
 
25
- `AGENTS.md`, code, commits, `.agents/` sources: English. Documents the user reads (`intent/`, `.loctx/`, `docs/*.ko.md`): the project's user language.
60
+ `AGENTS.md`, code, commits, `.agents/` sources: English. Documents the user reads (`intent/`, `.loctx/`, `docs/*.ko.md` if any): {{LANGUAGE}}.
26
61
  <!-- reins:end language -->
@@ -0,0 +1,25 @@
1
+ ---
2
+ version: 0.0.0
3
+ range: "<base>..<head>"
4
+ at: 0000-00-00
5
+ auditor: { vendor: —, model: —, independence: — }
6
+ ---
7
+ ## 읽은 것
8
+ —
9
+ ## 단계별 판정
10
+ | 단계 | 판정 | 근거 |
11
+ |---|---|---|
12
+ | local 로드맵 → 로드맵 | — | — |
13
+ | intent → 승인 | — | — |
14
+ | spec → 승인 | — | — |
15
+ | 구현·커밋 | — | — |
16
+ | 리뷰 | — | — |
17
+ | 테스트 | — | — |
18
+ | 머지 | — | — |
19
+ | 생성 파일·하네스 손 수정 | — | — |
20
+ ## 비판
21
+ —
22
+ ## 해결 방법
23
+ —
24
+ ## 사용자 처리
25
+ —
@@ -0,0 +1,14 @@
1
+ decisions: —
2
+
3
+ # 0.0.0
4
+
5
+ ## 결정
6
+ —
7
+ ## 판정
8
+ —
9
+ ## 건너뛴 단계
10
+ —
11
+ ## 감사·회고 요약
12
+ —
13
+ ## 지운 로그 요약
14
+ —
@@ -5,12 +5,15 @@ version: 0.0.0
5
5
  status: draft
6
6
  origin: user
7
7
  approvals: []
8
+ waivers: []
8
9
  supersedes: null
9
10
  ---
10
11
  ## 문제
11
12
  —
12
13
  ## 바라는 결과
13
14
  —
15
+ ## 계획
16
+ —
14
17
  ## 영향 범위
15
18
  —
16
19
  ## 제약
@@ -19,5 +22,7 @@ supersedes: null
19
22
  —
20
23
  ## 질의서 기록
21
24
  —
25
+ ### 에이전트가 정한 것
26
+ —
22
27
  ## 하지 않을 것
23
28
  —
@@ -9,9 +9,11 @@ summary_for_user: |
9
9
  - S-1 —
10
10
  ## 설계
11
11
  —
12
- ## 우려 표시
13
- —
12
+ ## 작업 단위
13
+ - [ ] W-1 —
14
14
  ## 검증 기준
15
+ - V-1 —
16
+ ## 우려
15
17
  —
16
18
  ## 범위 밖
17
19
  —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluenyang/reins",
3
- "version": "0.2.0",
3
+ "version": "0.3.0-rc.2",
4
4
  "description": "Installs, migrates and updates an agent harness (harness → loop → graph) that keeps coding agents inside their permitted roles.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,6 @@
33
33
  "fmt:check": "oxfmt --check cli/src cli/test test",
34
34
  "test": "vitest run",
35
35
  "check": "pnpm lint && pnpm fmt:check && pnpm typecheck && pnpm test",
36
- "docs:enforcement": "pnpm -s build && node cli/dist/scripts/enforcement.js",
37
36
  "version": "pnpm -s build && node cli/dist/scripts/sync-version.js && git add .claude-plugin/plugin.json skills/reins-setup/SKILL.md",
38
37
  "prepare": "husky"
39
38
  },
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: audit
3
+ description: Audit a merged version against the flow in AGENTS.md, from the records alone, and commit the audit record under .agents/audit/. Use after the merge and before the rc; mandatory while audit.required is true.
4
+ ---
5
+
6
+ # audit
7
+
8
+ ## 1. When
9
+ After the merge, before the rc. While `audit.required` in `.agents/harness/bindings.yaml` is true, this is mandatory — never skip it.
10
+
11
+ ## 2. Procedure
12
+ 1. Run in a fresh context that gets only the records, never the working conversation (auditor if switched on; in single mode, a new run — another vendor, or the same vendor's top model — chosen by the user).
13
+ 2. Read: AGENTS.md and the harness settings as they were, the intent, spec, `docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`, git history, history, gate and test logs.
14
+ 3. Judge each step: local roadmap → roadmap → intent → approval → spec → approval → implementation and commits → review → test → merge. Kept, violated, cannot confirm (no evidence path), or skipped on the user's instruction (recorded in `waivers:`). Judge against the rules in force at the time. A generated or harness file changed by a commit that is not an `update`/`config` commit is a violation.
15
+ 4. Write `.agents/audit/<version>.md` from `.agents/harness/templates/audit.md`: criticise each violation precisely and give a remedy (pl or advisor opinions by severity).
16
+ 5. The PM reports to the user: fix it, or the user accepts it. Commit the record with the user's decision.
17
+
18
+ ## 3. Delegation
19
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. The audit never runs inside the working conversation.
20
+
21
+ ## 4. Files and lifetime
22
+ - `.agents/audit/<version>.md` — committed, kept.
23
+
24
+ ## 5. Next
25
+ `release`.
26
+
27
+ ## 6. Stop and ask
28
+ - A passing audit does not vouch for direction or code quality; say so in the report.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: implement
3
+ description: Implement the spec's work units in order, one commit each, and fill the self-review table. Use when the spec is accepted, or the user says implement or continue.
4
+ ---
5
+
6
+ # implement
7
+
8
+ ## 1. When
9
+ The spec is accepted and has open work units.
10
+
11
+ ## 2. Procedure
12
+ 1. Work on a feature branch (`type/topic`), never the default branch.
13
+ 2. Take the next open work unit. Implement it so the requirement holds everywhere it applies — never to pass.
14
+ 3. Run the project's gates (`.agents/harness/gates.yaml`; the hooks run them too). Keep the raw output under `.loctx/reports/<version>/`.
15
+ 4. Commit: `type(scope): title` naming the spec items (S-n, W-n). Tick the work unit in `spec.md` with the commit.
16
+ 5. When the plan turns out wrong, update the intent or spec in the same commit, or stop and ask.
17
+
18
+ ## 3. Delegation
19
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Implementer (code, qa, doc) does the units when switched on; independent units may run in parallel; the code, tests and documents of one feature stay in one run.
20
+
21
+ ## 4. Files and lifetime
22
+ - Commits — kept.
23
+ - `.loctx/reports/<version>/` gate logs — deleted after the retro, once summarised.
24
+
25
+ ## 5. Next
26
+ `review`.
27
+
28
+ ## 6. Stop and ask
29
+ - Two failures in the same work unit: stop, find the cause (pl or advisor opinions by severity), or bring options to the user.
30
+ - A change outside the work unit.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: intent
3
+ description: Write the intent of one piece of work — the direction and the plan in the user's words — and record the user's approval. Use when a roadmap item is settled and has no approved intent yet.
4
+ ---
5
+
6
+ # intent
7
+
8
+ ## 1. When
9
+ A settled roadmap item has no approved intent.
10
+
11
+ ## 2. Procedure
12
+ 1. Create `.agents/intent/<NNN>_<slug>/intent.md` from `.agents/harness/templates/intent.md` (next free number).
13
+ 2. Write it in the user's words: problem, desired result, **plan** (order of work), scope, constraints, open questions, not doing. Quote the user; mark your own interpretation as yours. Decisions you made go under "decided by agents" with the alternative and the reason.
14
+ 3. Ask only the open questions the user must answer. For a large or abstract request, get opinions first (pl/discussion or advisor/committee, if switched on) and show where they differ.
15
+ 4. Show the intent and ask for approval. When the user approves, add `{ role: user, by, at, words, rev }` to `approvals:` (quote the words; `rev` is the commit you showed), set `status: approved`, commit.
16
+
17
+ ## 3. Delegation
18
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. The intent itself is always written by the PM.
19
+
20
+ ## 4. Files and lifetime
21
+ - `intent.md` — committed, kept.
22
+
23
+ ## 5. Next
24
+ `spec`.
25
+
26
+ ## 6. Stop and ask
27
+ - Never record an approval the user did not give.
28
+ - The user tells you to skip a step: record it in `waivers:` (`{ step, words, at, scope: once }`) now; it applies once.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: merge
3
+ description: Bring the tested branch into the default branch — PR, CI, merge — as the user's settings or instruction allow. Use when the version is tested.
4
+ ---
5
+
6
+ # merge
7
+
8
+ ## 1. When
9
+ The version is tested.
10
+
11
+ ## 2. Procedure
12
+ 1. Leaving the machine (push, PR) needs the user's instruction or a setting that allows it; otherwise ask.
13
+ 2. Push the branch, open the PR (body: the intent, the spec summary, the checks), wait for CI.
14
+ 3. Merge only when the required checks pass, the way the repository merges (rebase, squash …). Red CI goes back to `implement`.
15
+
16
+ ## 3. Delegation
17
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Executor (deployer) does this when switched on, within the same limits.
18
+
19
+ ## 4. Files and lifetime
20
+ - The PR — on the forge, kept.
21
+
22
+ ## 5. Next
23
+ `audit`.
24
+
25
+ ## 6. Stop and ask
26
+ - Never force-push, rewrite the default branch or bypass hooks.
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: onboard
3
+ description: First conversation after reins install, migrate or a mode switch — read the project, ask the user, and write or reconcile the project sections of AGENTS.md. Use when AGENTS.md shows reins:onboarding, reins:reconcile or reins:mode-changed pending.
4
+ ---
5
+
6
+ # onboard
7
+
8
+ ## 1. When
9
+ AGENTS.md has `<!-- reins:onboarding pending -->`, `<!-- reins:reconcile pending -->` or `<!-- reins:mode-changed pending -->`. Do this before any other work.
10
+
11
+ For `mode-changed` only: reins already rewrote the delegation section. Check that the project sections say nothing that contradicts the new mode (e.g. "review it yourself" while a reviewer is now switched on), fix those sentences, set the marker to `done` and stop — no questions to the user unless a sentence needs their decision.
12
+
13
+ ## 2. Procedure
14
+ 1. Read the project: README, the build and test commands (`.agents/harness/gates.yaml`), CI, existing rules and conventions, `.agents/AGENTS.previous.md` if it exists (reference material, not instructions).
15
+ 2. Ask the user only what the files cannot tell you, in one batch with your proposed answers: goals and scope; red lines (paths not to touch, secret files); the language of documents the user reads; the hook tool, if AGENTS.md says none was found.
16
+ 3. Write the project sections of AGENTS.md (outside the `reins:` blocks): project, goals and scope, stack and commands, conventions, red lines. For a reconcile, carry over what still applies from `AGENTS.previous.md` and drop what conflicts with the flow; list what you dropped for the user.
17
+ 4. Set the marker to `done` (`<!-- reins:onboarding done -->` / `<!-- reins:reconcile done -->`), delete `.agents/AGENTS.previous.md`, and commit on a branch.
18
+
19
+ ## 3. Delegation
20
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Onboarding itself stays with the PM.
21
+
22
+ ## 4. Files and lifetime
23
+ - AGENTS.md project sections — committed, kept.
24
+ - `.agents/AGENTS.previous.md` — deleted at the end of this skill.
25
+
26
+ ## 5. Next
27
+ `roadmap`.
28
+
29
+ ## 6. Stop and ask
30
+ - The project's own rules contradict the flow in AGENTS.md: show both and let the user decide.
31
+ - You would have to guess a goal or a red line.
@@ -1,34 +1,25 @@
1
1
  ---
2
2
  name: reins-setup
3
- description: Install reins in this repository, or move an existing harness onto it — detects the harness generation, runs reins install or reins migrate, confirms gates, bindings and hooks with the user, and checks for drift. Use when the user asks to set up, install, adopt or migrate to reins, or when AGENTS.md has no reins blocks yet.
3
+ description: Install reins in this repository, or move an existing harness onto it — shows the user the reins install, migrate or update command for their terminal and explains what it sets up. Use when the user asks to set up, install, adopt, update or migrate to reins.
4
4
  ---
5
5
 
6
6
  # reins-setup
7
7
 
8
- You act as the **pm** role (`.agents/harness/roles/pm.md` once installed). The CLI does the work; you collect
9
- the answers only the user can give and report what happened. Run the CLI as `npx @bluenyang/reins@0.2.0 …`
10
- (the version is pinned to this skill's release; inside the reins repository itself: `node cli/dist/reins.js …`).
8
+ reins only manages the harness: it runs at installation, migration, update and configuration time, in the
9
+ user's terminal. Nothing installed by reins runs reins while the project works.
11
10
 
12
11
  Defaults from the plugin settings: language `${user_config.language}`, install mode `${user_config.default_mode}`.
13
- If either still starts with `${` (unsubstituted — this copy lives in a project, not the plugin), use the built-in
14
- default of step 2 instead. Use these only as the defaults you propose; change `--mode` to `auto` only after the
15
- user confirms it.
12
+ If either still starts with `${` (unsubstituted — this copy lives in a project, not the plugin), use `ko` and
13
+ `manual`.
16
14
 
17
- 1. **Look first.** `reins install graph --dry-run --json` → read `generation` and `refused`.
18
- - `refused` (3rd/4th-generation harness) → `reins migrate <tier> --dry-run` and show the moves.
19
- - `.ai/` present (1st/2nd generation) → install, then offer `reins migrate`.
20
- 2. **One batch of questions, defaults stated** — never more than one round:
21
- tier (`graph` when two or more vendors are detected, else `loop`; `harness` for permissions only) ·
22
- vendors to use (show the detected ones) · language of the documents the user reads · public repository?
23
- 3. **Apply** non-interactively: `reins install <tier> --mode auto` (or `reins migrate <tier> --mode auto`).
24
- Then adjust what the user changed: `reins configure bindings --set <role>=<model> …`.
25
- The user can also change bindings and switch roles on or off themselves in a terminal with `reins config`;
26
- as the agent, keep using the flag form (`reins configure bindings --set …`, `--disable|--enable`).
27
- 4. **Gates.** Show `.agents/harness/gates.yaml`; run `reins gate` once. A gate that fails or mutates files is
28
- the user's call — never edit the project's scripts to make it pass.
29
- 5. **Hooks are proposed, not added.** Show the proposal from the install notes; only on the user's yes run
30
- `reins install <tier> --mode auto --hooks`.
31
- 6. **Verify.** `reins check --drift` must print `drift: ok`. Commit on a branch (`chore/reins-setup`), one commit
32
- per step that changed files. Never push.
33
- 7. **Report** in the user's language: generation before → after, the bindings table, gates, notes, and the
34
- next step — bring the first request to `reins-intent`.
15
+ 1. **Look.** Is there an `.agents/harness/` (reins installed), an `.ai/` workspace, or an older harness
16
+ (`.claude/commands/`, many skills)? Say which.
17
+ 2. **Show the user the command** for their terminal, with the version pinned to this skill's release:
18
+ - nothing installed: `npx @bluenyang/reins@0.3.0-rc.2 install --mode <mode>`
19
+ - an older harness or `.ai/`: `npx @bluenyang/reins@0.3.0-rc.2 migrate --dry-run`, then without `--dry-run`
20
+ - reins already installed: `npx @bluenyang/reins@0.3.0-rc.2 update`
21
+ - to change models, the mode or the audit later: `npx @bluenyang/reins@0.3.0-rc.2 config` (the user can run `reins config`)
22
+ Run it yourself only when the user asks you to, and only that command.
23
+ 3. **Explain what follows.** reins writes AGENTS.md blocks with an onboarding note; the next conversation starts
24
+ with the `onboard` skill, which reads the project, asks the user, and writes AGENTS.md's project sections.
25
+ Hooks are only proposed: the project's own gate commands in the project's own hook tool.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: release
3
+ description: Cut the rc and, on the user's explicit instruction only, the stable release, as the repository's release setup allows. Use when the version is audited.
4
+ ---
5
+
6
+ # release
7
+
8
+ ## 1. When
9
+ The version is audited (or the user accepted its findings).
10
+
11
+ ## 2. Procedure
12
+ 1. Update the release documents (changelog, roadmap state, README status) in the release PR.
13
+ 2. Cut the rc the way the repository releases (its workflow, tags). Never stable without the user's explicit instruction.
14
+ 3. After the rc, fixes are stabilisation work units; then the next rc.
15
+
16
+ ## 3. Delegation
17
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you. Executor (deployer) does this when switched on, within the same limits.
18
+
19
+ ## 4. Files and lifetime
20
+ - Tags, release notes — on the forge, kept.
21
+
22
+ ## 5. Next
23
+ `retro` (after stable, or when the user declares the version closed).
24
+
25
+ ## 6. Stop and ask
26
+ - Stable, force-pushing, deleting tags: ask the user every time.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: retro
3
+ description: Look back on a released version — the audit and the release — propose changes to AGENTS.md, skills and the harness, apply only what the user accepts, then clean up the version's working files. Use after stable, or when the user closes a version.
4
+ ---
5
+
6
+ # retro
7
+
8
+ ## 1. When
9
+ After stable, or when the user declares a version without stable closed.
10
+
11
+ ## 2. Procedure
12
+ 1. Read the audit record, the release, and history. Find repeats: the same violation, the same failure, the same question asked twice.
13
+ 2. Propose changes to AGENTS.md, skills and the harness, and whether the role groups switched on paid for themselves (pl/retrospector if switched on).
14
+ 3. Apply only what the user accepts: project sections of AGENTS.md and `.agents/knowledge/` entries (`approved: {by, at, words}`) by you; harness sources by the user with `reins config` / `reins update`.
15
+ 4. Write `.loctx/history/<version>.md` from `.agents/harness/templates/history.md`: decisions, verdicts, skipped steps, the audit and retro summary, and a summary of the logs about to be deleted (commits, check commands and results, exceptions).
16
+ 5. Delete `.loctx/reports/<version>/`.
17
+
18
+ ## 3. Delegation
19
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you.
20
+
21
+ ## 4. Files and lifetime
22
+ - `.loctx/history/<version>.md` — local, kept.
23
+ - `.agents/knowledge/` — committed, kept.
24
+ - `.loctx/reports/<version>/` — deleted here.
25
+
26
+ ## 5. Next
27
+ `roadmap`.
28
+
29
+ ## 6. Stop and ask
30
+ - Never edit harness sources or generated files by hand.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: review
3
+ description: Review finished work units — one reviewer (or a self-review table in single mode), evidence for every finding; large decisions get a discussion. Use after implement, or when the user says review.
4
+ ---
5
+
6
+ # review
7
+
8
+ ## 1. When
9
+ Work units are done and not reviewed.
10
+
11
+ ## 2. Procedure
12
+ 1. Review the diff against the spec: does each S-n hold, with which commit and which evidence (test, log path)? Look for defects, not only for the checklist.
13
+ 2. Multi mode: one reviewer (pl/code-reviewer, doc-reviewer …). Single mode: fill the table spec item ↔ commit ↔ evidence path yourself and state that it is not an independent review.
14
+ 3. Findings go back to the PM, who sends fixes to `implement`.
15
+ 4. A large decision or an unresolved disagreement: pl/discussion (every assigned model, without seeing each other); combine with the originals attached, keeping minority views.
16
+
17
+ ## 3. Delegation
18
+ Check the delegation table in AGENTS.md. If the role group named here has a model, hand it the work with the list of files and decisions it needs and wait for its report; otherwise do it yourself. Read-heavy work (research, large log summaries, review) or urgent parallel work on independent units may go to subagents of your own model. A role never calls another model; it returns to you.
19
+
20
+ ## 4. Files and lifetime
21
+ - Review notes under `.loctx/reports/<version>/` — deleted after the retro, once summarised.
22
+
23
+ ## 5. Next
24
+ `implement` (fixes) or `test`.
25
+
26
+ ## 6. Stop and ask
27
+ - A finding without evidence is "cannot confirm", never a pass.