reins-method 0.1.0

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.
@@ -0,0 +1,224 @@
1
+ ---
2
+ scope: always
3
+ role: master — read first every session, defines stack detection and routing
4
+ ---
5
+
6
+ # REINS Orchestrator
7
+
8
+ This file defines how the agent and the user work together on every task, in every project, regardless of stack or AI agent.
9
+
10
+ **Read this file first, every session.** It detects the project's stack, loads the right adapter (if one is installed), locates the active task context, and routes to the correct workflow phase.
11
+
12
+ ---
13
+
14
+ ## 0 — Where REINS lives
15
+
16
+ REINS Method is installed once, globally, at `~/.reins/`. **No REINS files ever live inside a project repository.**
17
+
18
+ ```
19
+ ~/.reins/
20
+ ├── core/ ← this engine (updated via `reins update`)
21
+ │ ├── workflow/ ← phase files (this file + 2/3/4)
22
+ │ ├── templates/ ← context, current_task, adapter, skill templates
23
+ │ ├── evaluation/ ← historic mode templates
24
+ │ └── skills/ ← meta-skills (e.g. skill-creator)
25
+ ├── user/ ← user-owned, never touched by `reins update`
26
+ │ ├── config.yaml ← name, agent, active adapter, historic mode
27
+ │ ├── standards/ ← company.md (floor) + personal.md
28
+ │ ├── adapters/ ← installed adapter packs
29
+ │ ├── skills/ ← user's custom skills
30
+ │ ├── projects/ ← per-project state (contexts, specs)
31
+ │ │ └── <project-slug>/
32
+ │ │ ├── contexts/
33
+ │ │ └── specs/
34
+ │ │ └── <type>_<slug>/
35
+ │ │ ├── step-01-spec.md
36
+ │ │ ├── step-01-plan.md
37
+ │ │ └── ...
38
+ │ └── historic/ ← optional monthly tracking (if historic mode is on)
39
+ └── agents/ ← generated bridge files per AI agent
40
+ ```
41
+
42
+ ---
43
+
44
+ ## 1 — Identify the project
45
+
46
+ 1. Determine the project root (nearest ancestor directory containing `.git`, or the current working directory if none).
47
+ 2. Compute `<project-slug>` — a stable, filesystem-safe identifier for this project (e.g. derived from the repo name, or the git remote URL if available, or the absolute path with `/` replaced by `-`).
48
+ 3. All state for this project lives under `~/.reins/user/projects/<project-slug>/`. Create this directory (with `contexts/` and `specs/`) if it does not exist yet.
49
+
50
+ ---
51
+
52
+ ## 2 — Stack detection
53
+
54
+ Inspect the project root for marker files to detect the stack(s) in play:
55
+
56
+ | Marker | Stack |
57
+ |---|---|
58
+ | `Gemfile` | `ruby` |
59
+ | `package.json` | `node` (inspect `dependencies`/`devDependencies` for framework hints, e.g. React, Angular, Vue) |
60
+ | `pyproject.toml`, `requirements.txt`, `setup.py` | `python` |
61
+ | `go.mod` | `go` |
62
+ | `pom.xml`, `build.gradle` | `jvm` |
63
+ | `Cargo.toml` | `rust` |
64
+ | `composer.json` | `php` |
65
+ | More than one marker present | multi-stack (e.g. `ruby` + `node` = backend + frontend) |
66
+ | Nothing recognizable | ask the user explicitly |
67
+
68
+ If the active context file (see §4) already declares a `stack`, trust it instead of re-detecting — but flag a mismatch if detection now disagrees.
69
+
70
+ ---
71
+
72
+ ## 2.5 — Project map (optional)
73
+
74
+ Check the project root for `graphify-out/GRAPH_REPORT.md` (generated by the
75
+ external [graphify](https://github.com/safishamsi/graphify) tool — a knowledge graph
76
+ of the codebase, docs, and more).
77
+
78
+ - If it exists, read it at session start for an architecture overview before diving
79
+ into the task — it's cheaper and broader than re-reading raw files. `graph.json`
80
+ and `wiki/` are also available for deeper queries if needed.
81
+ - If it doesn't exist, skip silently. REINS does not require graphify; it only uses its
82
+ output when present. See "Companion tools" in the repo `README.md` for how to
83
+ generate it.
84
+
85
+ ---
86
+
87
+ ## 3 — Load the adapter (if any)
88
+
89
+ 1. Read `~/.reins/user/config.yaml` for `adapters:` — a list of installed adapter packs, each with an `ADAPTER.md` declaring which stack(s) it applies to.
90
+ 2. Match the detected stack(s) against installed adapters.
91
+ 3. If a match is found, load (in this order):
92
+ - `<adapter>/standards/floor.md` — non-negotiable conventions (precedence 1)
93
+ - `<adapter>/standards/*.md` — any additional adapter standards (precedence 2, must never conflict with the floor)
94
+ - `<adapter>/workflow/3_implement.md` — if present, **overrides** `core/workflow/3_implement.md` for the development phase
95
+ 4. If no adapter matches, proceed with the generic conventions in `~/.reins/user/standards/company.md` and `~/.reins/user/standards/personal.md` (if the user has filled them in), and the generic `core/workflow/3_implement.md`.
96
+ 5. If multiple stacks are detected (e.g. `ruby` + `node`), load every matching adapter. Steps in the breakdown are then labeled by which adapter/stack they belong to.
97
+
98
+ **Standards precedence rule:** if `personal.md` (or an adapter's secondary standards) contradicts the floor (`company.md` or `<adapter>/standards/floor.md`), **stop immediately** and ask the user to resolve the conflict before proceeding.
99
+
100
+ ---
101
+
102
+ ## 4 — Active context
103
+
104
+ Context files track the state of every work item for this project, under `~/.reins/user/projects/<project-slug>/contexts/`.
105
+
106
+ ### Naming
107
+
108
+ ```
109
+ <type>_<slug>.md
110
+ ```
111
+ - `type`: `feature`, `hotfix`, `bugfix`, `chore`, `spike`
112
+ - `slug`: kebab-case short title
113
+
114
+ ### Frontmatter
115
+
116
+ ```yaml
117
+ ---
118
+ type: feature # feature | hotfix | bugfix | chore | spike
119
+ stack: <detected> # e.g. ruby, node, ruby+node, python...
120
+ status: active # active | paused
121
+ branches: # map of component -> branch name, e.g. { backend: feature/123-x, frontend: feature/123-y }
122
+ prs: # map of component -> PR URL (null until opened)
123
+ title: <title>
124
+ updated_at: YYYY-MM-DD
125
+ ---
126
+ ```
127
+
128
+ ### Invariant
129
+
130
+ **Exactly one context file per project may have `status: active` at any time.**
131
+
132
+ - On session start: glob `~/.reins/user/projects/<project-slug>/contexts/*.md`, read frontmatter, find the file with `status: active`.
133
+ - On interrupt (new task arrives while one is active): set the current active file to `status: paused`, create a new file with `status: active` (see `2_new_task.md`).
134
+ - On close: delete the closed file, list all `status: paused` files, ask which to resume.
135
+
136
+ ### Branch guard (multi-component tasks)
137
+
138
+ When `branches` has more than one entry, before proceeding:
139
+
140
+ 1. Run `git branch --show-current` in each relevant repo/worktree.
141
+ 2. Compare with the corresponding entry in `branches`.
142
+ 3. If any mismatch: present options (switch branch, update context, cancel). Do not proceed until aligned.
143
+
144
+ ---
145
+
146
+ ## 5 — Routing
147
+
148
+ ### Always loaded (every session)
149
+
150
+ | File | When |
151
+ |---|---|
152
+ | `core/workflow/1_orchestrator.md` | Session start (this file) |
153
+ | Active context file (§4) | Session start |
154
+ | Adapter standards (§3), or `~/.reins/user/standards/*.md` | Session start |
155
+ | `graphify-out/GRAPH_REPORT.md` (§2.5) | Session start, only if present |
156
+
157
+ ### Phase-specific
158
+
159
+ | Phase | File |
160
+ |---|---|
161
+ | **New task** | `core/workflow/2_new_task.md` |
162
+ | **Development** | `<adapter>/workflow/3_implement.md` if present, else `core/workflow/3_implement.md` |
163
+ | **Close task** | `core/workflow/4_close_task.md` |
164
+
165
+ ### On-demand (skills)
166
+
167
+ Skills in `~/.reins/core/skills/`, `<adapter>/skills/`, and `~/.reins/user/skills/` are **never loaded proactively**. Invoke them only when the user explicitly requests, or when the task clearly calls for it.
168
+
169
+ ---
170
+
171
+ ## 6 — The full workflow
172
+
173
+ ```
174
+ New task arrives
175
+
176
+ 2_new_task.md
177
+ → identify project + detect stack(s) (§1, §2)
178
+ → load project map if present (§2.5)
179
+ → load adapter standards, or generic standards (§3)
180
+ → understand task + epic
181
+ → optional: party-mode discussion (core/skills/party-mode/SKILL.md)
182
+ → propose breakdown (per component if multi-stack)
183
+ → flag architecture decisions
184
+ → wait for confirmation
185
+ → create context file
186
+
187
+ For each confirmed step:
188
+ → 3_implement.md (adapter override or generic)
189
+ SPEC/PLAN saved to specs/<type>_<slug>/step-NN-{spec,plan}.md
190
+
191
+ User gives close order:
192
+ 4_close_task.md
193
+ → run tests (if applicable)
194
+ → summarize what was done
195
+ → assess epic impact
196
+ → identify next step
197
+ → optional: code review (core/skills/code-review/SKILL.md)
198
+ → review PR comments
199
+ → propose commit message(s)
200
+ → record historic entry (if historic mode is on)
201
+ → clean specs/<type>_<slug>/ + delete context file
202
+ → ask which paused context to resume
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 7 — General rules (permanent — never override)
208
+
209
+ - Never write or modify a SPEC — that step belongs to the user
210
+ - Never implement before the SPEC is provided and confirmed
211
+ - Never make architecture decisions silently — surface trade-offs and wait for input
212
+ - Never modify approved tests
213
+ - Apply adapter and user standards at all times — they are not optional
214
+ - If standards conflict, flag immediately and wait for a decision
215
+ - When in doubt about which file applies, ask
216
+ - When a PR is opened, record its URL in the context frontmatter (`prs`) and in every SPEC under `~/.reins/user/projects/<project-slug>/specs/` that belongs to this task
217
+ - When a task requires more than one agent, run them in parallel whenever there are no dependencies
218
+ - At session start, always glob `~/.reins/user/projects/<project-slug>/contexts/*.md` and read frontmatter to identify the active context
219
+
220
+ ---
221
+
222
+ ## Next steps
223
+
224
+ See `core/workflow/2_new_task.md` to start a new task, or continue with the active context using the development phase file (`3_implement.md`, adapter override if present).
@@ -0,0 +1,133 @@
1
+ ---
2
+ scope: phase-specific
3
+ phase: new-task
4
+ trigger: when a new task or ticket is handed to the agent
5
+ ---
6
+
7
+ # New Task — Start Procedure
8
+
9
+ This file defines how we start working on any new task. Follow this procedure before writing any code, any test, or any SPEC.
10
+
11
+ ---
12
+
13
+ ## Step 1 — Understand the task
14
+
15
+ Read everything I give you: the task description, acceptance criteria, comments, linked tickets. Then answer these questions back to me:
16
+
17
+ - What is the **direct goal** of this task? (one sentence)
18
+ - What **existing behavior** does it touch or depend on?
19
+ - What **services, modules, or components** are likely involved?
20
+ - Are there any **ambiguities or missing information** that would block a clean implementation?
21
+
22
+ Do not assume. If something is unclear, ask before moving on.
23
+
24
+ ---
25
+
26
+ ## Step 2 — Understand the Epic (if provided)
27
+
28
+ If I give you an Epic or broader context, answer:
29
+
30
+ - What is the **overall goal** of the Epic?
31
+ - What **role does this task play** in the Epic? Is it a foundation, a step, or a finishing piece?
32
+ - Are there **adjacent tasks** in the Epic that this task must not break or must align with?
33
+
34
+ This context shapes every decision we make — architecture, naming, scope.
35
+
36
+ ---
37
+
38
+ ## Optional — Party Mode discussion
39
+
40
+ If the user asks for a multi-perspective discussion ("party mode", "discuss this
41
+ first", or the task has real ambiguity, multiple stakeholders, or an unclear "why"),
42
+ invoke `core/skills/party-mode/SKILL.md` now, before proposing the breakdown. Its
43
+ synthesis informs Step 3 and Step 4 below — it does not replace them.
44
+
45
+ ---
46
+
47
+ ## Step 3 — Break down the task
48
+
49
+ Before any implementation, propose a breakdown of the task into clear, ordered steps.
50
+
51
+ Rules for the breakdown:
52
+ - Each step must have a **single, well-defined responsibility**
53
+ - Steps must be **ordered by dependency** — foundational changes come first
54
+ - Each step should be **independently testable or verifiable**
55
+ - If a step feels large, split it further
56
+ - If the project is multi-stack (see `1_orchestrator.md` §2), label each step by component (e.g. `(backend)`, `(frontend)`, `(integration)`)
57
+
58
+ Present the breakdown as a numbered list with a one-line description per step. Wait for my confirmation before proceeding.
59
+
60
+ ---
61
+
62
+ ## Step 4 — Flag architecture decisions
63
+
64
+ Before we write the SPEC, identify if any step requires an **architecture decision** — a choice between two or more valid approaches with different trade-offs.
65
+
66
+ For each decision point:
67
+ - Describe the options concisely
68
+ - State the trade-offs for each
69
+ - Give me your recommendation and why
70
+
71
+ I will make the final decision. Once decided, the rationale goes into the SPEC under `## Architecture decision`.
72
+
73
+ ---
74
+
75
+ ## Step 5 — Create the context file
76
+
77
+ After I confirm the breakdown and any architecture decisions, create the context file for this task at `~/.reins/user/projects/<project-slug>/contexts/<type>_<slug>.md` (see `1_orchestrator.md` §1 and §4 for how `<project-slug>` is determined).
78
+
79
+ 1. **Check for an active context** — glob `contexts/*.md` and read frontmatter. If a file already has `status: active`, follow the interrupt procedure in `1_orchestrator.md` §4 before continuing.
80
+
81
+ 2. **Determine the slug** — kebab-case short version of the task title (e.g. `invoice-by-supplier`).
82
+
83
+ 3. **Create `<type>_<slug>.md`** using `core/templates/context.md` as base. Fill in:
84
+
85
+ ```yaml
86
+ ---
87
+ type: feature # or hotfix / bugfix / chore / spike
88
+ stack: <detected stack(s)>
89
+ status: active
90
+ branches: { <component>: <current git branch> }
91
+ title: <task title>
92
+ updated_at: <today>
93
+ ---
94
+ ```
95
+
96
+ 4. Fill in `## Task` and `## Epic` from what I provided
97
+ 5. Fill in `## Breakdown` with the confirmed steps as unchecked items
98
+ 6. Fill in `## Current step` with the first pending step
99
+ 7. Fill in `## Decisions made` with any architecture decisions I confirmed
100
+ 8. Leave `## Objective` and `## My notes` untouched — those are mine
101
+
102
+ Do not infer or summarize my intent in any of these fields. Write only what was explicitly stated.
103
+
104
+ ---
105
+
106
+ ## Step 6 — Begin development
107
+
108
+ Once the context file exists and architecture decisions are resolved, proceed to the development phase for the first step, following `3_implement.md` (or the active adapter's override of it — see `1_orchestrator.md` §3).
109
+
110
+ Do not start writing tests or code until I have provided the SPEC for that step.
111
+
112
+ ---
113
+
114
+ ## Permanent constraints
115
+
116
+ - Do not start any implementation before the full procedure above is complete
117
+ - Do not collapse the breakdown into a single step to move faster
118
+ - Do not make architecture decisions silently — surface them explicitly in step 4
119
+ - Do not modify `## Objective` or `## My notes` in the context file — those fields are mine only
120
+ - Do not infer my intent when filling the context file — write only what was explicitly stated
121
+ - The breakdown is a proposal — I confirm it before we proceed
122
+
123
+ ---
124
+
125
+ ## Start prompt
126
+
127
+ When I hand you a new task, begin by:
128
+
129
+ 1. Summarizing your understanding of the task (step 1)
130
+ 2. Summarizing the Epic context if provided (step 2)
131
+ 3. Proposing the breakdown (step 3)
132
+ 4. Flagging any architecture decisions (step 4)
133
+ 5. Waiting for my confirmation before anything else
@@ -0,0 +1,118 @@
1
+ ---
2
+ scope: phase-specific
3
+ phase: implement
4
+ trigger: for every development step confirmed in the breakdown
5
+ ---
6
+
7
+ # Implement — Generic Development Phase
8
+
9
+ This is the **default** development phase. If the active adapter provides its own
10
+ `workflow/3_implement.md`, that file overrides this one entirely for stacks it covers
11
+ (see `1_orchestrator.md` §3) — typical adapter overrides implement Test-Driven
12
+ Development (TDD/STDD) or Spec-Driven Development (SDD) variants suited to that stack.
13
+
14
+ This generic version makes no assumption about whether the stack uses automated tests.
15
+
16
+ ---
17
+
18
+ ## The process
19
+
20
+ Always follow this order. Do not move to the next step without explicit confirmation.
21
+
22
+ ```
23
+ 1. SPEC — I write the expected behavior, purpose, edge cases, and concerns
24
+ 2. PLAN — You confirm understanding and state how this step will be verified
25
+ (automated tests, manual/visual review, or both)
26
+ 3. IMPLEMENT — You implement based on the SPEC
27
+ 4. VERIFY — Tests are run and/or I perform manual/visual review
28
+ 5. CONFIRM — I confirm the step is done or request adjustments
29
+ ```
30
+
31
+ Do not write any implementation before the SPEC is provided for that step.
32
+
33
+ ---
34
+
35
+ ## What you do at each step
36
+
37
+ ### Step 1 — Spec
38
+
39
+ Once I give you the SPEC for this step, save it verbatim to:
40
+
41
+ ```
42
+ ~/.reins/user/projects/<project-slug>/specs/<type>_<slug>/step-NN-spec.md
43
+ ```
44
+
45
+ — `<type>_<slug>` matches the active context file's name, `NN` is this step's
46
+ two-digit number in `## Breakdown`. Create the `specs/<type>_<slug>/` directory if
47
+ this is the first step. See `core/templates/spec.md` for the structure.
48
+
49
+ ### Step 2 — Plan
50
+
51
+ - Read the entire SPEC before writing any line of code
52
+ - Restate the guarantees you will cover
53
+ - State explicitly how this step will be verified — if the project/adapter has tests, propose which test files will be added or changed; if not, describe what manual verification looks like
54
+ - If the SPEC conflicts with existing code, stop and ask before deciding
55
+ - Save your plan to `step-NN-plan.md` alongside the SPEC, following
56
+ `core/templates/plan.md`
57
+ - If no adapter override defines a TDD/SDD process for this stack, the
58
+ `core/skills/reins-senior-engineer/SKILL.md` lens (test-first, red/green/refactor) applies
59
+ by default for Step 3
60
+
61
+ ### Step 3 — Implement
62
+
63
+ - Cover the main flow, all listed edge cases, and every listed guarantee
64
+ - Apply the active adapter's standards (or `~/.reins/user/standards/*.md` if no adapter) throughout
65
+ - Do not modify any approved test
66
+ - If existing code contradicts the SPEC, stop and ask before deciding
67
+
68
+ ### Step 4 — Verify
69
+
70
+ - If automated tests exist for this change, run them and report pass/fail
71
+ - If verification is manual, describe clearly what I should see and interact with, and list the specific behaviors to check (happy path, edge cases, error states)
72
+ - Report any failure unrelated to this step (flag it, do not fix it silently)
73
+
74
+ ### Step 5 — Adjustments
75
+
76
+ - Minor corrections (naming, style, small logic fix) → apply directly
77
+ - Significant changes (new behavior, different architecture) → request a SPEC update first
78
+
79
+ ---
80
+
81
+ ## After confirmation — update the context file
82
+
83
+ Once the step is confirmed done, update `~/.reins/user/projects/<project-slug>/contexts/<active-context>.md`:
84
+
85
+ - Mark the current step as done in `## Breakdown`
86
+ - Update `## Current step` to the next pending step
87
+ - Update `## SPEC status` for the completed step to `implemented` (referencing
88
+ `specs/<type>_<slug>/step-NN-{spec,plan}.md`)
89
+ - If a new decision was confirmed during this step, add it to `## Decisions made`
90
+ - Leave `## Objective` and `## My notes` untouched
91
+
92
+ ---
93
+
94
+ ## SPEC and PLAN structure
95
+
96
+ See `core/templates/spec.md` for the SPEC structure (written by me, saved by you to
97
+ `step-NN-spec.md`) and `core/templates/plan.md` for the PLAN structure (written by
98
+ you, saved to `step-NN-plan.md`).
99
+
100
+ ---
101
+
102
+ ## Permanent constraints
103
+
104
+ - Do not modify tests to make the implementation pass — modify the implementation instead
105
+ - Do not write the SPEC — that step is mine
106
+ - Do not move to step 4 without completing step 3 as scoped by the SPEC
107
+ - Do not modify `## Objective` or `## My notes` in the context file — those fields are mine only
108
+ - Apply the active adapter's standards and conventions at all times — they are not optional and do not require a task to be active
109
+
110
+ ---
111
+
112
+ ## Start prompt
113
+
114
+ When I hand you a SPEC, always begin by:
115
+
116
+ 1. Confirming you read the SPEC and summarizing the guarantees you will cover
117
+ 2. Stating how this step will be verified
118
+ 3. Waiting for my explicit approval before any implementation
@@ -0,0 +1,166 @@
1
+ ---
2
+ scope: phase-specific
3
+ phase: close-task
4
+ trigger: when the user gives the order to close a task
5
+ ---
6
+
7
+ # Close Task — Procedure
8
+
9
+ This file defines what you do when I give the order to close a task. Execute every step in order without skipping.
10
+
11
+ ---
12
+
13
+ ## Step 1 — Run the test suite (if applicable)
14
+
15
+ If the project has automated tests, run the full suite — not just the ones related to this task. Use the test command documented in the active adapter's standards, or ask me if none is documented.
16
+
17
+ Report back:
18
+ - Total passing / failing / pending
19
+ - Any failure unrelated to this task that was already present (flag it, do not fix it silently)
20
+ - Any test that was modified after my approval (this must not have happened — flag it immediately if it did)
21
+
22
+ If the project has no automated tests, skip to Step 2 and note that verification was manual (per `3_implement.md`).
23
+
24
+ Do not proceed to step 2 if there are unexpected failures.
25
+
26
+ ---
27
+
28
+ ## Step 2 — Summary of what was done
29
+
30
+ Write a clear, concise summary covering:
31
+
32
+ - **What changed** — which services, components, modules, or endpoints were added or modified
33
+ - **Why** — the problem this solves or the behavior it introduces, in plain language
34
+ - **How** — the approach taken and any architecture decision that shaped it
35
+
36
+ Keep it readable by someone who wasn't in this task. No implementation details unless they are essential to understand the decision.
37
+
38
+ ---
39
+
40
+ ## Step 3 — Task objective and Epic impact
41
+
42
+ Answer explicitly:
43
+
44
+ - Does the implementation fulfill the task's stated goal? If not entirely, what is missing?
45
+ - How does this task contribute to the Epic's overall objective?
46
+ - Does this change anything that adjacent tasks in the Epic depend on?
47
+
48
+ ---
49
+
50
+ ## Step 4 — Next step
51
+
52
+ If there is a natural next step in the Epic or a follow-up that this task makes possible or necessary, state it clearly:
53
+
54
+ - What is the next step?
55
+ - Why does it follow from this task?
56
+ - Any dependency or prerequisite to be aware of?
57
+
58
+ If there is no clear next step, say so explicitly.
59
+
60
+ ---
61
+
62
+ ## Optional — Code review
63
+
64
+ On request, invoke `core/skills/code-review/SKILL.md` against the full diff for this
65
+ task before proposing the commit message in Step 5. Its findings are presented to
66
+ the user, who decides whether to address anything before proceeding.
67
+
68
+ ---
69
+
70
+ ## Step 5 — Commit message
71
+
72
+ Propose the final commit message following these rules:
73
+
74
+ - One subject line — short, imperative, informative
75
+ - Describes **what the change does**, not what files were touched
76
+ - If the task title is already a good description, use it as the base
77
+ - If the task title is too vague, implementation-specific, or ticket-code-only, write a better one
78
+ - Optionally: one blank line followed by 2–3 lines of body if the change needs brief context
79
+
80
+ Format:
81
+ ```
82
+ <subject line>
83
+
84
+ <optional short body>
85
+ ```
86
+
87
+ Present one primary suggestion and one alternative if the scope could be described differently.
88
+
89
+ ---
90
+
91
+ ## Step 6 — Link the PR in the SPEC
92
+
93
+ Add the PR link to this task's spec directory at
94
+ `~/.reins/user/projects/<project-slug>/specs/<type>_<slug>/`:
95
+
96
+ 1. Identify the highest-numbered `step-NN-spec.md` for this task.
97
+ 2. Add the PR URL under a `## PR` section at the bottom of that file.
98
+ 3. Also record it in the context file's frontmatter (`prs`).
99
+ 4. This link is required for Step 9 to determine whether the PR has merged and the
100
+ `specs/<type>_<slug>/` directory can be deleted.
101
+
102
+ ---
103
+
104
+ ## Step 7 — PR comment review
105
+
106
+ When I give the order to review PR comments:
107
+
108
+ 1. If a GitHub (or equivalent) MCP/CLI tool is available, use it to fetch all review comments and inline comments from the PR.
109
+ 2. Analyze the comments in the context of this task, the Epic, and the codebase decisions made.
110
+
111
+ For each comment, respond with:
112
+
113
+ - **Valid** — the comment identifies a real problem or improvement that aligns with the task goals and existing architecture
114
+ - **Partially valid** — the comment has merit but misses context (explain what it's missing)
115
+ - **Not valid** — the comment is incorrect, irrelevant, or conflicts with a deliberate decision made during this task (explain why)
116
+
117
+ For every **Valid** or **Partially valid** comment, propose how to address it — a code change, a clarification, or a documented decision.
118
+
119
+ Do not act on any comment before I confirm which ones to address. Comments marked **Not valid** are ignored unless I say otherwise.
120
+
121
+ ---
122
+
123
+ ## Step 8 — Record historic entry (if historic mode is on)
124
+
125
+ Check `~/.reins/user/config.yaml` for `historic_mode: on`. If it is off, skip this step entirely.
126
+
127
+ If on, follow `~/.reins/core/evaluation/README.md` (Mode A — record task entry at close), using:
128
+ - `~/.reins/core/evaluation/templates/monthly.md` to create the current month's file if it doesn't exist
129
+ - `~/.reins/core/evaluation/templates/task-entry.md` to build the entry
130
+
131
+ This step runs while the task context is still active — that context is the source of data for the entry.
132
+
133
+ Do not skip this step (when historic mode is on) unless I explicitly say to.
134
+
135
+ ---
136
+
137
+ ## Step 9 — Close context file and resume
138
+
139
+ After the PR comments are reviewed and I confirm the task is closed:
140
+
141
+ 1. Check `~/.reins/user/projects/<project-slug>/specs/<type>_<slug>/` for this task:
142
+ - If the highest-numbered `step-NN-spec.md` has a `## PR` link, check if the PR is merged (via available tooling).
143
+ - **Before deleting anything**, list every file that would be deleted and explain why (PR merged, or explicitly authorized by you). Wait for your confirmation.
144
+ - Delete only the files (or the whole `specs/<type>_<slug>/` directory) you confirm.
145
+
146
+ 2. Delete the active context file (`<type>_<slug>.md`) for this task.
147
+
148
+ 3. Glob `~/.reins/user/projects/<project-slug>/contexts/*.md` for any files with `status: paused`:
149
+ - If none exist: confirm the workspace is clean and stop.
150
+ - If any exist: list them (type, title, branches, updated_at) and ask: "Which context do you want to resume?"
151
+ - On selection: set the chosen file to `status: active`, update `updated_at`, then run the branch guard (`1_orchestrator.md` §4) before proceeding.
152
+
153
+ 4. If a SPEC has no PR link yet, keep it until the PR is opened and linked.
154
+
155
+ ---
156
+
157
+ ## Permanent constraints
158
+
159
+ - Do not close a task with a failing test suite unless I explicitly say to proceed anyway
160
+ - Do not write a commit message that references internal ticket codes only — it must be human-readable
161
+ - Do not skip the Epic impact section if an Epic was provided at task start
162
+ - Do not silently fix unrelated failures — flag them and wait for my instruction
163
+ - Do not act on any PR comment before I confirm which ones to address
164
+ - Do not mark a comment as valid solely because it follows a general best practice — evaluate it against the specific decisions made in this task
165
+ - Do not delete the context file before I explicitly confirm the task is closed
166
+ - Do not skip the historic entry step (Step 8) when historic mode is on — it must run before context cleanup
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "reins-method",
3
+ "version": "0.1.0",
4
+ "description": "REINS Method — agent-agnostic AI pair-programming workflow. Interactive installer.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/gustavodiasp/reins-method",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/gustavodiasp/reins-method.git"
10
+ },
11
+ "bin": {
12
+ "reins-method": "tools/installer/cli.js"
13
+ },
14
+ "files": [
15
+ "tools/installer",
16
+ "bin",
17
+ "core",
18
+ "agents",
19
+ "*.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "dependencies": {
26
+ "@clack/prompts": "^0.8.2",
27
+ "commander": "^12.1.0",
28
+ "picocolors": "^1.1.1"
29
+ }
30
+ }