@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.
- package/README.md +164 -39
- package/cli/dist/commands/config-gates.js +64 -6
- package/cli/dist/commands/config-models.js +19 -0
- package/cli/dist/commands/config.js +40 -16
- package/cli/dist/commands/configure.js +207 -47
- package/cli/dist/commands/install.js +91 -31
- package/cli/dist/commands/migrate.js +17 -20
- package/cli/dist/commands/update.js +164 -12
- package/cli/dist/lib/agents-md.js +55 -13
- package/cli/dist/lib/bindings.js +7 -10
- package/cli/dist/lib/blocks.js +82 -18
- package/cli/dist/lib/detect.js +88 -3
- package/cli/dist/lib/gate-refresh.js +35 -5
- package/cli/dist/lib/gate-script.js +303 -25
- package/cli/dist/lib/generate.js +48 -6
- package/cli/dist/lib/git.js +33 -0
- package/cli/dist/lib/migrate-plan.js +1 -1
- package/cli/dist/lib/profile.js +101 -0
- package/cli/dist/lib/prompter.js +2 -1
- package/cli/dist/lib/release.js +1 -1
- package/cli/dist/lib/schema.js +6 -3
- package/cli/dist/lib/upstream.js +1 -1
- package/cli/dist/reins.js +40 -14
- package/docs/README.ko.md +113 -23
- package/harness/CHANGELOG.md +12 -0
- package/harness/VERSION +1 -1
- package/harness/policy/common-red-lines.yaml +7 -5
- package/harness/roles/advisor.md +1 -1
- package/harness/roles/auditor.md +12 -11
- package/harness/roles/executor.md +4 -3
- package/harness/roles/implementer.md +5 -5
- package/harness/roles/pl.md +4 -4
- package/harness/roles/planner.md +7 -8
- package/harness/roles/pm.md +7 -8
- package/harness/schemas/bindings.schema.json +2 -0
- package/harness/schemas/install.schema.json +1 -0
- package/harness/schemas/intent.schema.json +9 -1
- package/harness/schemas/plan.schema.json +18 -0
- package/harness/schemas/spec.schema.json +9 -6
- package/harness/templates/agents-md-blocks.md +19 -54
- package/harness/templates/agents-md-guide.md +11 -10
- package/harness/templates/audit.md +14 -41
- package/harness/templates/history.md +1 -5
- package/harness/templates/intent.md +8 -19
- package/harness/templates/plan.md +23 -0
- package/harness/templates/spec.md +21 -16
- package/package.json +1 -1
- package/skills/audit/SKILL.md +27 -33
- package/skills/gates/SKILL.md +41 -0
- package/skills/implement/SKILL.md +33 -22
- package/skills/implement/references/procedure.md +51 -0
- package/skills/intent/SKILL.md +29 -20
- package/skills/intent/references/procedure.md +60 -0
- package/skills/onboard/SKILL.md +39 -28
- package/skills/plan/SKILL.md +35 -0
- package/skills/plan/references/procedure.md +52 -0
- package/skills/reins-setup/SKILL.md +4 -4
- package/skills/release/SKILL.md +18 -20
- package/skills/retro/SKILL.md +21 -26
- package/skills/review/SKILL.md +33 -17
- package/skills/review/references/procedure.md +50 -0
- package/skills/spec/SKILL.md +25 -19
- package/skills/spec/references/procedure.md +67 -0
- package/skills/merge/SKILL.md +0 -32
- package/skills/roadmap/SKILL.md +0 -29
- package/skills/test/SKILL.md +0 -26
package/skills/audit/SKILL.md
CHANGED
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: audit
|
|
3
|
-
description:
|
|
3
|
+
description: Audits a version or a range of commits for risk only — secrets, red lines, irreversible changes, unverified checks — from the records alone, in a fresh run that never sees the working conversation, and commits the record under .agents/audit/. Optional; run only when a person asks for it.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# audit
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
- `.loctx/reports/gates/<tree>.log` — written by the hooks and by the PM before each audit; deleted in the retro.
|
|
34
|
-
|
|
35
|
-
## 5. Next
|
|
36
|
-
After the first audit: `merge` (the merge itself). After the second: `retro`.
|
|
37
|
-
|
|
38
|
-
## 6. Stop and ask
|
|
39
|
-
- A passing audit does not vouch for direction or code quality; say so in the report.
|
|
9
|
+
Run this only when a person asks for it. The audit is optional and looks at risk only: it does not judge
|
|
10
|
+
the procedure, the direction or the quality of the code.
|
|
11
|
+
|
|
12
|
+
## What to do
|
|
13
|
+
1. Agree with the person on the range (`<base>..<head>`, or a pull request) and the model. The audit runs in
|
|
14
|
+
a fresh run of your own model or of a model the person picks; the `auditor` in the delegation table, if
|
|
15
|
+
one is set, is the recommended model.
|
|
16
|
+
2. Collect the records into `.loctx/reports/<version>/`, as the tools print them and unedited: the spec and
|
|
17
|
+
plans, `git log` of the range, the gate logs (`.loctx/reports/gates/`), and the pull request and CI
|
|
18
|
+
records (for example `gh pr view <n> --json number,headRefOid,body` and `gh pr checks <n>`).
|
|
19
|
+
3. Hand the auditor the paths of those records and `.agents/harness/policy/common-red-lines.yaml`. It reads
|
|
20
|
+
only them, never this conversation, runs read-only and without a network, and returns its record in the
|
|
21
|
+
form of `.agents/harness/templates/audit.md`.
|
|
22
|
+
4. For each risk it gives a verdict — none found, found, or cannot confirm (no record to show it) — with
|
|
23
|
+
the evidence paths, and for what it found, what to fix:
|
|
24
|
+
- **secrets**: secret files or keys in the diff or the history;
|
|
25
|
+
- **red lines**: anything in `common-red-lines.yaml`;
|
|
26
|
+
- **irreversible changes**: migrations, data or production changes, deletions, force pushes, tags;
|
|
27
|
+
- **unverified checks**: a pass with no raw output, a gate that did not run, red or missing CI.
|
|
28
|
+
5. Write the answer unchanged to `.agents/audit/<version>.md` (append when the file exists), commit it on a
|
|
29
|
+
branch, and report to the person. What to fix is the person's to decide.
|
|
30
|
+
|
|
31
|
+
## Keep in mind
|
|
32
|
+
- A generated file a person edited by hand is not a finding; `reins update` shows drift.
|
|
33
|
+
- A passing audit does not vouch for the direction or the quality of the code; say so in the report.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gates
|
|
3
|
+
description: Designs and tidies the project's gates with the user — which checks run, for which areas and at which hook stage — proposing what to take out before what to add, and changes .agents/harness/gates.yaml in a commit of its own. Use when the user wants to change the gates, a gate is slow, always fails or runs for nothing, or the hooks run too much or too little.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# gates
|
|
7
|
+
|
|
8
|
+
The gates are the project's own checks. `.agents/harness/run-gates.sh` reads `.agents/harness/gates.yaml` each
|
|
9
|
+
time a hook runs it; the user decides what is in that file, with you.
|
|
10
|
+
|
|
11
|
+
## How gates.yaml is read
|
|
12
|
+
- `areas:` names path globs from the repository root: `*` stays within a directory, `**` crosses them, `?` is
|
|
13
|
+
one character. Quote a glob that starts with `*` (`"*.md"`).
|
|
14
|
+
- A gate's `areas:` lists area names. A gate without `areas` always runs. `on:` lists the hook stages it runs
|
|
15
|
+
at (`pre-commit`, `pre-push`); without `on` it runs at every stage.
|
|
16
|
+
- At `pre-commit` and `pre-push` the script works out the changed files (the staged files; the pushed commits)
|
|
17
|
+
and runs a gate only when a changed file is in one of its areas. When it cannot tell, every area counts.
|
|
18
|
+
Any other stage (`manual`, `ci`, `audit`, …) runs every required gate. The full check belongs to CI.
|
|
19
|
+
- Block style only: lists as `- item` lines, no `{ }` or `[ ]`. Another shape stops the script before any gate
|
|
20
|
+
runs. `optional: true` keeps a gate out of the hooks.
|
|
21
|
+
- Each run's log (`.loctx/reports/gates/<tree>.log`) says which gates ran, which were skipped and why.
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
1. Read `gates.yaml`, the scripts and targets the gates call, the CI workflows, and the recent gate logs. If
|
|
25
|
+
the user ran `reins config gates --refresh`, read `.loctx/gates-refresh.md`; you never run reins yourself.
|
|
26
|
+
2. Propose what to take out or tidy first, each with its evidence: a gate that always fails, one that is slow
|
|
27
|
+
for what it catches, two that run the same thing (or one another script already runs), one whose script or
|
|
28
|
+
target is gone, an area no gate names, a gate that runs for areas it does not check.
|
|
29
|
+
3. Then propose what to add or narrow: areas for a gate that runs for every change, a slow gate moved to
|
|
30
|
+
`pre-push`, a check CI runs that the hooks miss. Narrowing a gate means it runs less: say what would no
|
|
31
|
+
longer be checked before the commit and where it is still checked.
|
|
32
|
+
4. A gate that fails: show the failure and ask the user before you change the gate or the code it checks.
|
|
33
|
+
Never weaken, skip or delete a failing gate to get a commit through.
|
|
34
|
+
5. Apply what the user accepts to `gates.yaml` and nothing else, in a commit of its own
|
|
35
|
+
(`chore(gates): …`) that names what changed and why, so the user can read it alone. Run
|
|
36
|
+
`sh .agents/harness/run-gates.sh manual` once and give the log's path.
|
|
37
|
+
|
|
38
|
+
## Never
|
|
39
|
+
- Edit `.agents/harness/run-gates.sh` or the hook files: reins writes them.
|
|
40
|
+
- Change `gates.yaml` in the same commit as other work, or without the user's word.
|
|
41
|
+
- Narrow an area or a stage so that a check you are about to fail does not run.
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement
|
|
3
|
-
description:
|
|
3
|
+
description: Builds what a confirmed plan says, the way the person asked (directly, with subagents, through another vendor's model, in parallel), commits at meaningful units, pushes the work branch, opens the pull request and writes the completion report; also handles the fast lane for small fixes and changes a person made by hand. Use when a plan is agreed, or the person asks for a fix or to continue.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# implement
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
The spec is accepted and has open work units.
|
|
8
|
+
If `references/procedure.md` sits next to this file, read it for the step-by-step procedure.
|
|
10
9
|
|
|
11
|
-
##
|
|
12
|
-
1.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
## What to do
|
|
11
|
+
1. Work on a branch `type/topic` taken from a freshly pulled default branch; never commit on the default
|
|
12
|
+
branch.
|
|
13
|
+
2. Build the way the person said: yourself, with subagents, through a role in the delegation table, in
|
|
14
|
+
parallel. If they said nothing, follow the delegation table. Hand a role the files and decisions it
|
|
15
|
+
needs, and keep the request and its answer as they came under `.loctx/reports/<version>/`.
|
|
16
|
+
3. Build so that each requirement holds everywhere it applies, never only so a check passes.
|
|
17
|
+
4. Commit at meaningful units: each commit is a point you can revert to without taking other working
|
|
18
|
+
work with it. Name the spec items in the message (`R-n`, the plan). The hooks run the gates; never
|
|
19
|
+
bypass them (`--no-verify`) or hide a failing exit code.
|
|
20
|
+
5. When the work departs from the plan, change the plan file, say so in one line, and go on. A departure
|
|
21
|
+
that leaves the spec goes back to the person first.
|
|
22
|
+
6. Push the work branch and open the pull request. That is as far as you go: the person merges and
|
|
23
|
+
releases. A branch behind the default branch is rebased and pushed with
|
|
24
|
+
`git push --force-with-lease origin <branch>`, naming the branch.
|
|
25
|
+
7. Get the first review (`review`), then write the completion report to the person and into the pull
|
|
26
|
+
request body: what changed; a short summary of the structure; where it departed from the plan;
|
|
27
|
+
verification results with the raw log paths; "fast lane" if it was one; the review table.
|
|
18
28
|
|
|
19
|
-
##
|
|
20
|
-
|
|
29
|
+
## The fast lane
|
|
30
|
+
A defect fix or a small change goes without a spec or a plan when it stays within one area of
|
|
31
|
+
`.agents/harness/gates.yaml` and touches no public entry point, schema, dependency or migration. There is
|
|
32
|
+
no size limit: you judge. It still gets the first review, and the completion report says "fast lane".
|
|
21
33
|
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
## Changes a person made
|
|
35
|
+
Before you build on code a person changed (their commits, or edits in the working tree), read the change.
|
|
36
|
+
If it is reasonable or its intent is visible, accept it and build on it. If it looks wrong or you cannot
|
|
37
|
+
tell what it is for, ask the person before you change or revert it.
|
|
25
38
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
- A work unit has to be added, dropped or rescoped: the spec changes and is approved first. A smaller adjustment does not stop the work (2.4); working across approved units that may be reverted together is fine.
|
|
32
|
-
- A user who does not accept an adjustment when it is reported: treat it as a change of the spec — revert it or get it approved.
|
|
39
|
+
## Stop and find the cause
|
|
40
|
+
- The same work failed twice; check output is empty or doubtful; a pass has no raw output behind it.
|
|
41
|
+
- An irreversible action (force push to the default branch or a tag, deleting a tag, data or production
|
|
42
|
+
changes) or a red line (`.agents/harness/policy/common-red-lines.yaml`): ask the person.
|
|
43
|
+
- When the person interrupts, write the resume point in `.loctx/history/<version>.md`.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# implement — step by step
|
|
2
|
+
|
|
3
|
+
For a model with a small context: one step at a time; keep a short running note of what you did.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
1. `git switch <default> && git pull`, then `git switch -c <type>/<topic>` (`feat/offline-export`).
|
|
7
|
+
2. Read the agreed plan. Take its files in order. For each file: read it, change it, run the narrowest
|
|
8
|
+
check that covers it (one test file, the type check).
|
|
9
|
+
3. Before each commit, ask: can this commit be reverted without breaking other work that already works?
|
|
10
|
+
If not, keep going until it can. Commit with `type(scope): title` and name the plan and `R-n`:
|
|
11
|
+
`feat(report): PDF export from the print renderer (spec 031 plan 1, R-1)`.
|
|
12
|
+
4. Let the hooks run the gates. If a gate fails, read the output, fix the cause, commit again. Never pass
|
|
13
|
+
`--no-verify`, never pipe a check so its exit code is lost.
|
|
14
|
+
5. If you have to do something the plan does not say, edit the plan file (`## 바꿀 파일과 순서`), and write
|
|
15
|
+
one line to the person: "Departing from plan 1: <what> because <why>."
|
|
16
|
+
6. If the same thing fails twice for the same cause, stop and write down what you tried; ask for help.
|
|
17
|
+
7. Run the plan's verification commands. Save each raw output to the path the plan names.
|
|
18
|
+
8. `git push -u origin <type>/<topic>`, then open the pull request (for example `gh pr create`).
|
|
19
|
+
9. Get the first review (the `review` skill). Fix what it says is Important.
|
|
20
|
+
10. Write the completion report (format below) to the person and into the pull request body. Stop: the
|
|
21
|
+
person checks the report, merges and releases.
|
|
22
|
+
|
|
23
|
+
## The completion report
|
|
24
|
+
```markdown
|
|
25
|
+
## What changed
|
|
26
|
+
- PDF export of a month's report (R-1, R-2).
|
|
27
|
+
## Structure
|
|
28
|
+
- `src/report/print.ts` renders to bytes; `src/report/export.ts` saves them.
|
|
29
|
+
## Departures from the plan
|
|
30
|
+
- Added `src/report/name.ts` for the file name (threat in plan 1), not in the file list.
|
|
31
|
+
## Verification
|
|
32
|
+
- `pnpm test report`: 14 passed — `.loctx/reports/1.4.0/plan-1/test.log`
|
|
33
|
+
## Review
|
|
34
|
+
| finding | fix | proof or re-review |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| Important: month 0 accepted (`export.ts:12`) | range check | `test/report/export.test.ts` "rejects month 0" passes |
|
|
37
|
+
```
|
|
38
|
+
For a fast-lane change, put "fast lane" as the first line and skip "Departures from the plan".
|
|
39
|
+
|
|
40
|
+
## Handing a unit to another model
|
|
41
|
+
When `implementer/code` (or `qa`, `doc`) has a model, send it one unit at a time:
|
|
42
|
+
```markdown
|
|
43
|
+
# task: plan 1, steps 1-2
|
|
44
|
+
goal: <the plan's step, copied>
|
|
45
|
+
read: the agreed plan .agents/spec/031_offline-export/plan.md, src/report/print.ts
|
|
46
|
+
decisions: one month only; file names from digits only
|
|
47
|
+
do not: touch files outside the list, push, merge, change the gates
|
|
48
|
+
return: the commits made (hash, title), the commands run and their raw output paths, every guess marked "guess"
|
|
49
|
+
```
|
|
50
|
+
Keep the task and the answer under `.loctx/reports/<version>/`. Check its commits yourself before the
|
|
51
|
+
next unit.
|
package/skills/intent/SKILL.md
CHANGED
|
@@ -1,29 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: intent
|
|
3
|
-
description:
|
|
3
|
+
description: Sorts out an idea with the person — researches what is already there, objects or offers another option when the idea does not hold up, asks why, what, how and what it should end up as — and keeps it as a local note under .loctx/intent/; what the person settles goes into docs/ROADMAP.md. Use when the person talks about an idea, a problem or something they may want later.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# intent
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
An intent is a local note of one idea: what was asked, what you found, what was answered. It is not a
|
|
9
|
+
contract and nobody approves it. Many pile up; they are dropped or changed as the person thinks.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
1. When work starts, check whether `.loctx/delegation.local.md` exists; if it does, open it before anything else and use its table. Then 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.
|
|
11
|
+
If `references/procedure.md` sits next to this file, read it for the step-by-step procedure.
|
|
16
12
|
|
|
17
|
-
##
|
|
18
|
-
|
|
13
|
+
## What to do
|
|
14
|
+
1. Look before you ask. Read what touches the idea: the code, `docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`,
|
|
15
|
+
the other notes in `.loctx/intent/`, the specs in `.agents/spec/`, `.agents/knowledge/`, and the decisions
|
|
16
|
+
in history (`grep -l 'decisions:.*<keyword>' .loctx/history/* .agents/knowledge/*`).
|
|
17
|
+
2. Say what you found. If the idea does not hold up — it is already there, it conflicts with a recorded
|
|
18
|
+
decision, a smaller change gets the same result, it costs more than it brings — say so with the evidence
|
|
19
|
+
and offer another option. Do not raise again a proposal the person already rejected.
|
|
20
|
+
3. Ask what the files cannot tell you, in one batch, each question with your proposed answer:
|
|
21
|
+
- why: the problem, and who has it;
|
|
22
|
+
- what: what changes for the person or the user of the project;
|
|
23
|
+
- how: the direction, when there is a choice;
|
|
24
|
+
- the end: what it should look like when it is done, and what is left out.
|
|
25
|
+
4. Write the note to `.loctx/intent/<YYYY-MM-DD>_<slug>.md` from `.agents/harness/templates/intent.md`,
|
|
26
|
+
in the language of documents the person reads. Keep their words; mark your own reading as yours. Update
|
|
27
|
+
the same note as the talk goes on.
|
|
28
|
+
5. Set `status:` as the person decides: `idea` while it is open, `adopted` when they settle it, `dropped`
|
|
29
|
+
when they let it go. Never delete a note yourself.
|
|
30
|
+
6. When the person settles an idea, write it into `docs/ROADMAP.md` as a main change of the version it
|
|
31
|
+
belongs to (and into its other language edition, if the project keeps one). Only what they settled goes
|
|
32
|
+
there.
|
|
19
33
|
|
|
20
|
-
##
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
## 6. Stop and ask
|
|
27
|
-
- Never record an approval the user did not give.
|
|
28
|
-
- The user named a version, answered a question about the plan, or a release is waiting for them: none of these starts an intent. Write the idea to the roadmap and wait for the user to start the work.
|
|
29
|
-
- The user tells you to skip a step: record it in `waivers:` (`{ step, words, at, scope: once }`) now; it applies once.
|
|
34
|
+
## Keep in mind
|
|
35
|
+
- Naming a version says where an idea belongs; it does not start the work.
|
|
36
|
+
- `.loctx/` is not committed. The agreed gist reaches others through the spec's head (`spec`).
|
|
37
|
+
- A large or unclear idea: get opinions given without seeing each other (`pl/discussion` or
|
|
38
|
+
`advisor/committee` in the delegation table, if they have a model) and show where they differ.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# intent — step by step
|
|
2
|
+
|
|
3
|
+
For a model with a small context: do one step at a time and write down what you found before the next.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
1. Name the idea in one line, in the person's words. Pick a slug: two or three lowercase words joined by
|
|
7
|
+
hyphens (`offline-export`).
|
|
8
|
+
2. Search before you ask. Run, and keep only the lines that matter:
|
|
9
|
+
- `ls .loctx/intent/` — is there a note on the same idea? If so, update that note instead of a new one.
|
|
10
|
+
- `grep -n -i '<keyword>' docs/ROADMAP.md .loctx/ROADMAP.local.md`
|
|
11
|
+
- `grep -l 'decisions:.*<keyword>' .loctx/history/* .agents/knowledge/*`
|
|
12
|
+
- `grep -rl '<keyword>' .agents/spec/` and the code paths the idea touches.
|
|
13
|
+
3. Judge the idea against what you found. Write one of:
|
|
14
|
+
- "holds up" — nothing contradicts it;
|
|
15
|
+
- "already there" — name the file;
|
|
16
|
+
- "conflicts with <decision file>" — quote the decision;
|
|
17
|
+
- "cheaper way" — describe the other option and what it gives up.
|
|
18
|
+
If it is not "holds up", tell the person and offer the other option before you ask anything else.
|
|
19
|
+
4. Draft the questions the files did not answer. At most one per heading, each with a proposed answer:
|
|
20
|
+
why, what, how, the end (what done looks like, what is left out).
|
|
21
|
+
5. Ask them in one message. Wait for the answers.
|
|
22
|
+
6. Write the note (format below). Use today's date in the file name.
|
|
23
|
+
7. When the person settles it: set `status: adopted`, add one line under the version in
|
|
24
|
+
`docs/ROADMAP.md` (and the other language edition, if there is one), and say which line you added.
|
|
25
|
+
When they let it go: set `status: dropped`. Never delete a note.
|
|
26
|
+
|
|
27
|
+
## The note: `.loctx/intent/<YYYY-MM-DD>_<slug>.md`
|
|
28
|
+
```markdown
|
|
29
|
+
---
|
|
30
|
+
slug: offline-export
|
|
31
|
+
date: 2026-12-01
|
|
32
|
+
status: idea
|
|
33
|
+
---
|
|
34
|
+
## 아이디어
|
|
35
|
+
Export the month's report without a network. (the person, 2026-12-01)
|
|
36
|
+
## 왜
|
|
37
|
+
Field staff have no signal on site. (the person)
|
|
38
|
+
## 무엇을, 어떻게, 결국 어떻게 되어야 하나
|
|
39
|
+
- 무엇: a "save as file" button on the report screen.
|
|
40
|
+
- 어떻게: my reading — reuse the PDF renderer of the print view.
|
|
41
|
+
- 결국: the same report as online, opened from the phone's files.
|
|
42
|
+
## 조사한 것
|
|
43
|
+
- docs/ROADMAP.md: no export item yet.
|
|
44
|
+
- .agents/knowledge/2026-10-02_no-native-plugins.md: no native plugins — the renderer must stay in JS.
|
|
45
|
+
## 다른 안
|
|
46
|
+
- Cache the last report in the app instead: less work, but no file to share.
|
|
47
|
+
## 질문과 답
|
|
48
|
+
- Q: one month or a chosen range? — A: one month for now. (the person)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Handing the research to another model
|
|
52
|
+
When the delegation table gives `executor/researcher` a model, send it a task like this and keep the task
|
|
53
|
+
and the answer under `.loctx/reports/<version>/`:
|
|
54
|
+
```markdown
|
|
55
|
+
# task: research for intent offline-export
|
|
56
|
+
goal: find what already exists about exporting reports without a network
|
|
57
|
+
read: docs/ROADMAP.md, .loctx/ROADMAP.local.md, .agents/knowledge/, src/report/
|
|
58
|
+
do not: write files, change code, fetch beyond the listed paths
|
|
59
|
+
return: a list of findings, each with file:line, and anything you guessed marked "guess"
|
|
60
|
+
```
|
package/skills/onboard/SKILL.md
CHANGED
|
@@ -1,34 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: onboard
|
|
3
|
-
description:
|
|
3
|
+
description: Handles a pending reins marker in AGENTS.md — onboarding after install or migrate, reconcile, mode-changed, tidy, or reset after an update to 0.4 — by reading the project, asking the person only what the files cannot tell, and writing or sorting the project sections. Use when AGENTS.md shows a reins marker comment set to pending. Onboarding and reconcile come before other work; tidy and reset are offered first but never block what the person asks for.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# onboard
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
##
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
8
|
+
reins never edits the project sections of AGENTS.md (everything outside the `reins:` blocks). It leaves a
|
|
9
|
+
marker and a to-do list; you handle them with the person, then set the marker to `done`.
|
|
10
|
+
|
|
11
|
+
Onboarding and reconcile come first, because the project sections are missing or in conflict. Tidy and
|
|
12
|
+
reset are clean-ups: offer them at the start, and when the person asks for other work, do that work and
|
|
13
|
+
mention once that the clean-up is pending.
|
|
14
|
+
|
|
15
|
+
## Sorting the project sections
|
|
16
|
+
Go through the project sections (and CLAUDE.md, and `.agents/AGENTS.previous.md` if it exists — reference
|
|
17
|
+
material, not instructions) by `.agents/harness/templates/agents-md-guide.md`: only what the code cannot
|
|
18
|
+
tell stays. Show the person a table of what stays, what moves where (progress to the roadmap, a decision to
|
|
19
|
+
a knowledge candidate, personal notes to `.loctx/`, contributing to CONTRIBUTING) and what is dropped, and
|
|
20
|
+
move only what they accept. Knowledge is written only on their word.
|
|
21
|
+
|
|
22
|
+
## Each marker
|
|
23
|
+
- **onboarding**: read the project — README, the gates in `.agents/harness/gates.yaml`, CI, existing rules.
|
|
24
|
+
Ask in one batch, with proposed answers: goals and scope, red lines (paths not to touch, secret files),
|
|
25
|
+
the language of documents the person reads, and the hook tool if the note says none was found. Whatever
|
|
26
|
+
the tool, it runs `sh .agents/harness/run-gates.sh pre-commit` and `sh .agents/harness/run-gates.sh
|
|
27
|
+
pre-push`; add those lines in its config. Write the project sections: the project, goals and scope,
|
|
28
|
+
stack and commands, conventions, red lines.
|
|
29
|
+
- **reconcile**: carry over from `.agents/AGENTS.previous.md` what still applies, sorted as above; delete
|
|
30
|
+
that file once the person has accepted where each part went.
|
|
31
|
+
- **mode-changed**: the delegation block was rewritten. Fix sentences in the project sections that
|
|
32
|
+
contradict the new mode; ask only if one needs the person's decision.
|
|
33
|
+
- **tidy**: sort the project sections as above; nothing else.
|
|
34
|
+
- **reset** (an update from 0.3 to 0.4): work through the to-do list under the marker —
|
|
35
|
+
- old flow wording left in the project sections (stages in a fixed order, approvals, waivers, two
|
|
36
|
+
audits, work units): propose what to drop or rewrite;
|
|
37
|
+
- whether to split `.loctx/ROADMAP.local.md` into notes under `.loctx/intent/`;
|
|
38
|
+
- whether to split the gates into areas (the `gates` skill);
|
|
39
|
+
- the profile in `.agents/harness/bindings.yaml` (`light` or `full`): confirm it with the person, who
|
|
40
|
+
changes it with `reins config`;
|
|
41
|
+
- the records up to 0.3 (`.agents/intent/`, `.agents/audit/`) are reference material, not current rules.
|
|
42
|
+
|
|
43
|
+
## Finish
|
|
44
|
+
Change the marker to `done` (`<!-- reins:<marker> done -->`) and commit on a branch. If the project's own
|
|
45
|
+
rules contradict the reins blocks, show both and let the person decide; never guess a goal or a red line.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Writes one or more plans for a spec — the R-n and D-n each one serves, the files to change and the order, risks, threats, how it is verified and what the person should watch — and records the person's confirmation as one line, agreed with their words. Use when a spec, or part of it, is ready to be built.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# plan
|
|
7
|
+
|
|
8
|
+
Confirming the plan is one of the five things a person does. Nothing is built from a plan they have not
|
|
9
|
+
confirmed; after that, the work goes on without asking.
|
|
10
|
+
|
|
11
|
+
If `references/procedure.md` sits next to this file, read it for the step-by-step procedure.
|
|
12
|
+
|
|
13
|
+
## What to do
|
|
14
|
+
1. Read the spec and what the work touches. Cut the work into plans that can each be reviewed as one pull
|
|
15
|
+
request: one plan for a small spec, several when parts can be built and merged apart.
|
|
16
|
+
2. Write each plan next to its spec, as `plan.md` or `plan-<n>.md`, from
|
|
17
|
+
`.agents/harness/templates/plan.md`, in the language of documents the person reads:
|
|
18
|
+
- `from:` the `R-n` and `D-n` it serves;
|
|
19
|
+
- the files to change, in order;
|
|
20
|
+
- risks: what could break, and how you will notice;
|
|
21
|
+
- threats: how the change could be misused or bypassed;
|
|
22
|
+
- verification: the commands to run, what passing looks like, where the raw output goes;
|
|
23
|
+
- what the person should watch in the result.
|
|
24
|
+
3. A reviewer may check the plans against the spec first (`pl/plan-reviewer` or `pl/qa-plan-reviewer` in
|
|
25
|
+
the delegation table, if they have a model).
|
|
26
|
+
4. Show the person a short summary of each plan and ask them to confirm it.
|
|
27
|
+
5. When they confirm, write their words into the plan's front matter as
|
|
28
|
+
`agreed: { at: <date>, words: "<what they said>" }`, set the spec to `status: in-progress`, and commit.
|
|
29
|
+
Never write words the person did not say.
|
|
30
|
+
6. When they ask for changes, change the plan and ask again.
|
|
31
|
+
|
|
32
|
+
## Keep in mind
|
|
33
|
+
- A defect fix or a small change can skip the spec and the plan (the fast lane in `implement`).
|
|
34
|
+
- Departing from a confirmed plan while building is allowed: `implement` says so and gathers it in the
|
|
35
|
+
completion report. A change that moves the work outside the spec goes back to the person.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# plan — step by step
|
|
2
|
+
|
|
3
|
+
For a model with a small context: do one step at a time and write down what you found before the next.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
1. Read the spec. List its `R-n` and `D-n`.
|
|
7
|
+
2. Decide how many plans. One plan is one pull request: it can be reviewed on its own and merged without
|
|
8
|
+
the others breaking the build. A small spec has one plan (`plan.md`); otherwise `plan-1.md`,
|
|
9
|
+
`plan-2.md`, … in the order they are built.
|
|
10
|
+
3. For each plan, write `from:` — the `R-n` and `D-n` it serves. Every `R-n` must be in some plan; say so
|
|
11
|
+
if one is not.
|
|
12
|
+
4. List the files to change, in order, each with one line on what changes. Read each file first; do not
|
|
13
|
+
list a file you have not opened.
|
|
14
|
+
5. Write the risks: what could break, and how you would notice (a test, a log, a command).
|
|
15
|
+
6. Write the threats: how the change could be misused or bypassed, and what limits it.
|
|
16
|
+
7. Write the verification: the exact commands, what passing looks like, and where the raw output goes
|
|
17
|
+
(`.loctx/reports/<version>/`). A check without a command is not a check.
|
|
18
|
+
8. Write what the person should watch: the two or three places where your judgement could be wrong.
|
|
19
|
+
9. Show the person a summary of each plan (three to five lines) and ask: "Is this plan right?"
|
|
20
|
+
10. When they confirm, add `agreed: { at: <today>, words: "<their words, exactly>" }` to the front matter,
|
|
21
|
+
set the spec's `status: in-progress`, and commit. If they ask for changes, change the plan and ask
|
|
22
|
+
again. Never write `agreed` from your own words.
|
|
23
|
+
|
|
24
|
+
## The plan: `.agents/spec/<NNN>_<slug>/plan.md`
|
|
25
|
+
```markdown
|
|
26
|
+
---
|
|
27
|
+
spec: "031"
|
|
28
|
+
plan: 1
|
|
29
|
+
title: PDF export from the print renderer
|
|
30
|
+
from: R-1, R-2, D-1
|
|
31
|
+
agreed: { at: 2026-12-02, words: "좋아요, 진행" }
|
|
32
|
+
---
|
|
33
|
+
# plan 1 — PDF export from the print renderer
|
|
34
|
+
|
|
35
|
+
## 바꿀 파일과 순서
|
|
36
|
+
1. `src/report/print.ts`: split rendering from the print call so it can return bytes.
|
|
37
|
+
2. `src/report/export.ts` (new): save the bytes as `<month>.pdf` through the file API.
|
|
38
|
+
3. `test/report/export.test.ts` (new): the figures of a fixture month match the online report.
|
|
39
|
+
## 위험
|
|
40
|
+
- The print view changes too: the existing print test must still pass.
|
|
41
|
+
## 위협
|
|
42
|
+
- A crafted month name writes outside the download folder: the name is built from digits only.
|
|
43
|
+
## 검증
|
|
44
|
+
- `pnpm test report` passes; raw output to `.loctx/reports/1.4.0/plan-1/test.log`.
|
|
45
|
+
## 사람이 볼 점
|
|
46
|
+
- Whether the file name format is what the office expects.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Handing a review of the plan to another model
|
|
50
|
+
When `pl/plan-reviewer` has a model, send it the spec and the plan, and ask: "Does every R-n have a plan?
|
|
51
|
+
Does each verification have a command? List gaps with the line they concern." Keep the task and the
|
|
52
|
+
answer under `.loctx/reports/<version>/`.
|
|
@@ -15,10 +15,10 @@ If either still starts with `${` (unsubstituted — this copy lives in a project
|
|
|
15
15
|
1. **Look.** Is there an `.agents/harness/` (reins installed), an `.ai/` workspace, or an older harness
|
|
16
16
|
(`.claude/commands/`, many skills)? Say which.
|
|
17
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.
|
|
19
|
-
- an older harness or `.ai/`: `npx @bluenyang/reins@0.
|
|
20
|
-
- reins already installed: `npx @bluenyang/reins@0.
|
|
21
|
-
- to change models, the mode or the audit later: `npx @bluenyang/reins@0.
|
|
18
|
+
- nothing installed: `npx @bluenyang/reins@0.4.0-rc.2 install --mode <mode>`
|
|
19
|
+
- an older harness or `.ai/`: `npx @bluenyang/reins@0.4.0-rc.2 migrate --dry-run`, then without `--dry-run`
|
|
20
|
+
- reins already installed: `npx @bluenyang/reins@0.4.0-rc.2 update`
|
|
21
|
+
- to change models, the mode, the profile or the recommended audit model later: `npx @bluenyang/reins@0.4.0-rc.2 config` (the user can run `reins config`)
|
|
22
22
|
Run it yourself only when the user asks you to, and only that command.
|
|
23
23
|
3. **Explain what follows.** reins writes AGENTS.md blocks with an onboarding note; the next conversation starts
|
|
24
24
|
with the `onboard` skill, which reads the project, asks the user, and writes AGENTS.md's project sections.
|