@bluenyang/reins 0.3.4 → 0.4.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +164 -39
  2. package/cli/dist/commands/config-gates.js +64 -6
  3. package/cli/dist/commands/config-models.js +19 -0
  4. package/cli/dist/commands/config.js +40 -16
  5. package/cli/dist/commands/configure.js +207 -47
  6. package/cli/dist/commands/install.js +91 -31
  7. package/cli/dist/commands/migrate.js +17 -20
  8. package/cli/dist/commands/update.js +164 -12
  9. package/cli/dist/lib/agents-md.js +55 -13
  10. package/cli/dist/lib/bindings.js +7 -10
  11. package/cli/dist/lib/blocks.js +82 -18
  12. package/cli/dist/lib/detect.js +88 -3
  13. package/cli/dist/lib/gate-refresh.js +35 -5
  14. package/cli/dist/lib/gate-script.js +303 -25
  15. package/cli/dist/lib/generate.js +48 -6
  16. package/cli/dist/lib/git.js +33 -0
  17. package/cli/dist/lib/migrate-plan.js +1 -1
  18. package/cli/dist/lib/profile.js +101 -0
  19. package/cli/dist/lib/prompter.js +2 -1
  20. package/cli/dist/lib/release.js +1 -1
  21. package/cli/dist/lib/schema.js +6 -3
  22. package/cli/dist/lib/upstream.js +1 -1
  23. package/cli/dist/reins.js +40 -14
  24. package/docs/README.ko.md +113 -23
  25. package/harness/CHANGELOG.md +12 -0
  26. package/harness/VERSION +1 -1
  27. package/harness/policy/common-red-lines.yaml +7 -5
  28. package/harness/roles/advisor.md +1 -1
  29. package/harness/roles/auditor.md +12 -11
  30. package/harness/roles/executor.md +4 -3
  31. package/harness/roles/implementer.md +5 -5
  32. package/harness/roles/pl.md +4 -4
  33. package/harness/roles/planner.md +7 -8
  34. package/harness/roles/pm.md +7 -8
  35. package/harness/schemas/bindings.schema.json +2 -0
  36. package/harness/schemas/install.schema.json +1 -0
  37. package/harness/schemas/intent.schema.json +9 -1
  38. package/harness/schemas/plan.schema.json +18 -0
  39. package/harness/schemas/spec.schema.json +9 -6
  40. package/harness/templates/agents-md-blocks.md +19 -54
  41. package/harness/templates/agents-md-guide.md +11 -10
  42. package/harness/templates/audit.md +14 -41
  43. package/harness/templates/history.md +1 -5
  44. package/harness/templates/intent.md +8 -19
  45. package/harness/templates/plan.md +23 -0
  46. package/harness/templates/spec.md +21 -16
  47. package/package.json +1 -1
  48. package/skills/audit/SKILL.md +27 -33
  49. package/skills/gates/SKILL.md +41 -0
  50. package/skills/implement/SKILL.md +33 -22
  51. package/skills/implement/references/procedure.md +51 -0
  52. package/skills/intent/SKILL.md +29 -20
  53. package/skills/intent/references/procedure.md +60 -0
  54. package/skills/onboard/SKILL.md +39 -28
  55. package/skills/plan/SKILL.md +35 -0
  56. package/skills/plan/references/procedure.md +52 -0
  57. package/skills/reins-setup/SKILL.md +4 -4
  58. package/skills/release/SKILL.md +18 -20
  59. package/skills/retro/SKILL.md +21 -26
  60. package/skills/review/SKILL.md +33 -17
  61. package/skills/review/references/procedure.md +50 -0
  62. package/skills/spec/SKILL.md +25 -19
  63. package/skills/spec/references/procedure.md +67 -0
  64. package/skills/merge/SKILL.md +0 -32
  65. package/skills/roadmap/SKILL.md +0 -29
  66. package/skills/test/SKILL.md +0 -26
@@ -1,28 +1,26 @@
1
1
  ---
2
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 merged after its first audit.
3
+ description: Writes the release documents for a version — changelog entry, release notes, roadmap state, README status — in a pull request, and tells the person which button or command cuts the release; the person presses it. Run only when a person asks for it.
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # release
7
8
 
8
- ## 1. When
9
- The first audit is done (its findings fixed or accepted by the user) and the work is merged.
9
+ Run this only when a person asks for it. Releasing, rc included, is one of the five things a person does.
10
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. When a release waits for the user — an approval of the published package, the instruction for stable — report and wait. Do not start the work of another unit meanwhile; stabilising this version is this loop's work.
15
- 4. After the rc, a defect found while checking it is fixed in the same version, then the next rc. A small fix is an adjustment recorded in the spec (`A-n`); one that needs a new work unit changes the spec first and is approved.
11
+ ## What to do
12
+ 1. Find how the repository releases: its release workflows, tags, changelog and version files,
13
+ `.agents/harness/install.yaml` (`release:`), the release notes of the last version.
14
+ 2. On a branch, write the release documents from the merged work: the changelog entry, the release notes,
15
+ the state of the version in `docs/ROADMAP.md` (and its other language edition), the README status. Take
16
+ the content from the completion reports and pull requests, not from memory.
17
+ 3. Push the branch and open the pull request. The person merges it.
18
+ 4. Tell the person exactly what cuts the release — the workflow and its inputs, the tag, the publish
19
+ command — and where to check the result. Do not run it: merging, publishing, creating a release and
20
+ dispatching a workflow are a person's, and the deny rules in `.claude/settings.json` block them.
21
+ 5. A defect found in an rc is fixed on a work branch like any other change (`implement`, `review`); the
22
+ person cuts the next rc.
16
23
 
17
- ## 3. Delegation
18
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro. Executor (deployer) does this when switched on, within the same limits.
19
-
20
- ## 4. Files and lifetime
21
- - Tags, release notes — on the forge, kept.
22
-
23
- ## 5. Next
24
- `audit` (the second audit — after stable, or when the user declares the version closed), then `retro`.
25
-
26
- ## 6. Stop and ask
27
- - Stable, force-pushing the default branch or a tag, deleting tags: ask the user every time.
28
- - A release that waits for the user is not idle time to fill: no intent, spec or code of the next version before this one's retro, unless the user says so (then record a waiver).
24
+ ## Never
25
+ - Run `gh pr merge`, `npm publish`, `gh release create`, `gh workflow run`, or push to the default branch.
26
+ - Force-push the default branch or a tag, delete a tag, or rewrite the default branch.
@@ -1,33 +1,28 @@
1
1
  ---
2
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.
3
+ description: Looks back on a finished version — history, completion reports, any audit — and proposes improvements to AGENTS.md, the skills and the harness, and knowledge candidates; applies only what the person accepts, then cleans up the version's working files. Optional; run only when a person asks for it.
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # retro
7
8
 
8
- ## 1. When
9
- After the second audit — that is, after stable, or when the user declares a version without stable closed.
9
+ Run this only when a person asks for it. The retro is optional; nothing waits for it.
10
10
 
11
- ## 2. Procedure
12
- 1. Read the audit record — both audits, and above all what the second audit handed to the retro — the release, and history. Put what the user decides about the handed-over items under `### 회고에서의 처리` of the audit record. 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). Mark each proposal that is about the harness itself — the flow and stop blocks, a skill, a role — rather than about this project: another project would meet the same problem, so list those apart for the user to take to reins (harness sources are never edited by hand).
14
- 3. Propose knowledge candidates: decisions and failures repeated (twice or more) in history and the audit. For each one give a title, how often and where it appeared (file paths), and a draft of the decision, the reason and where it applies. First look for an entry that already covers it (`grep -l 'decisions:.*<keyword>' .agents/knowledge/*`); if there is one, propose updating that entry instead of a new one. If nothing repeated, write "knowledge candidates: none" so that an empty list is not mistaken for a skipped step. Count the accepted findings too: the same audit finding accepted three times or more by the user — in the audit records' `사용자 처리` and `회고에서의 처리`, across versions — is proposed as an entry of `kind: accepted-finding`: which finding is accepted, how often and where it was accepted (file paths and the user's words), and where the acceptance ends and a violation begins.
15
- 4. 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`.
16
- 5. 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).
17
- 6. Delete `.loctx/reports/<version>/`, and the gate logs in `.loctx/reports/gates/` last written before the version's stable tag was made (logs of later work stay).
18
- 7. Report that the loop is closed and stop. The retro ends the loop; the next work begins when the user starts it — unless the user named another end for this run (quoted in `.loctx/ROADMAP.local.md`).
19
-
20
- ## 3. Delegation
21
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro.
22
-
23
- ## 4. Files and lifetime
24
- - `.loctx/history/<version>.md` — local, kept.
25
- - `.agents/knowledge/` — committed, kept.
26
- - `.loctx/reports/<version>/` — deleted here.
27
- - `.loctx/reports/gates/<tree>.log` — those written before the stable tag are deleted here.
28
-
29
- ## 5. Next
30
- `roadmap` — when the user starts the next work.
31
-
32
- ## 6. Stop and ask
33
- - Never edit harness sources or generated files by hand.
11
+ ## What to do
12
+ 1. Read the version's records: `.loctx/history/<version>.md`, the specs and plans, the completion reports
13
+ and pull requests, `.agents/audit/<version>.md` if there is one, and the release. Look for repeats: the
14
+ same failure, the same question asked twice, the same departure from a plan.
15
+ 2. Propose changes to the project sections of AGENTS.md, to the skills and to the harness (the
16
+ `pl/retrospector` in the delegation table does this if it has a model). List apart the proposals about
17
+ the harness itself — a skill, a block, a role — that another project would meet too, so the person can
18
+ take them to reins.
19
+ 3. Propose knowledge candidates: decisions and failures that came up twice or more
20
+ (`grep -l 'decisions:.*<keyword>' .loctx/history/* .agents/knowledge/*`). For each, the title, where it
21
+ appeared (file paths), and a draft of the decision, the reason and where it applies. When an entry
22
+ already covers it, propose updating that entry. If nothing repeated, write "knowledge candidates: none".
23
+ 4. Apply only what the person accepts: the project sections of AGENTS.md and `.agents/knowledge/` entries
24
+ yourself; reins' files only through `reins config` or `reins update`, which the person runs.
25
+ 5. Write the summary into `.loctx/history/<version>.md` from `.agents/harness/templates/history.md`:
26
+ decisions, and a summary of the logs about to be deleted. Then delete `.loctx/reports/<version>/` and
27
+ the gate logs of the version under `.loctx/reports/gates/`.
28
+ 6. Report what was applied and stop.
@@ -1,28 +1,44 @@
1
1
  ---
2
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.
3
+ description: Runs the first review of a pull request's diff — correctness only, findings graded Important, Nit or pre-existing — and decides after a fix whether a re-review is needed, by whether the fix can be proven mechanically. Use when work is pushed and its pull request is open, or the person asks for a review.
4
4
  ---
5
5
 
6
6
  # review
7
7
 
8
- ## 1. When
9
- Work units are done and not reviewed.
8
+ If `references/procedure.md` sits next to this file, read it for the step-by-step procedure.
10
9
 
11
- ## 2. Procedure
12
- 1. Every work unit is reviewed, including one that changes tests or documents only. If a unit is not reviewed, record that and why in the spec's adjustment record; a unit left unreviewed without that record is a finding of the first audit.
13
- 2. Put `git diff --stat <base>..<head>` as it prints at the head of the review request; the reviewer first checks that the files of the diff it received match that list, and hands it back to the PM before reviewing if one is missing. 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. If one language edition of a document changed, compare the two language editions again after the last change; a waiver or a skipped check does not stand in for it.
14
- 3. 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.
15
- 4. Findings go back to the PM, who sends fixes to `implement`. A small fix is an adjustment: it goes on and is recorded in the spec (`A-n`); a finding that needs a work unit added, dropped or rescoped changes the spec first.
16
- 5. A large decision or an unresolved disagreement: pl/discussion (every assigned model, without seeing each other); combine with the originals attached, keeping minority views.
10
+ ## The first review
11
+ Every pull request gets one. The reviewer is the one in the delegation table (`pl/code-reviewer`, or
12
+ `pl/doc-reviewer` for documents); in single mode, a fresh subagent run of your own model. The reviewer gets
13
+ the pull request's diff, its `git diff --stat` and the requirements it serves, never this conversation, and
14
+ first checks that the files of the diff match that list.
17
15
 
18
- ## 3. Delegation
19
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro.
16
+ The reviewer looks at correctness only and grades each finding, with its evidence (file:line, a command
17
+ and its output):
18
+ - **Important** — wrong behaviour, to fix before the merge. Only these block the merge.
19
+ - **Nit** — style, naming, a better way.
20
+ - **Pre-existing** — a problem the diff did not cause.
20
21
 
21
- ## 4. Files and lifetime
22
- - Review notes under `.loctx/reports/<version>/` — deleted after the retro, once summarised.
22
+ A finding without evidence is "cannot confirm", never a pass.
23
23
 
24
- ## 5. Next
25
- `implement` (fixes) or `test`.
24
+ ## After the review
25
+ 1. Nits and pre-existing problems are not fixed in this pull request: write each as an intent in
26
+ `.loctx/intent/`. If one is fixed anyway, it is not reviewed again.
27
+ 2. Fix each Important finding. When the fix can be proven mechanically, it is not reviewed again. A proof is
28
+ one of: a reproduction test that now passes, the error gone, a grep result, a local edit within the
29
+ flagged lines.
30
+ 3. When it cannot be proven that way, the changed part alone is reviewed once more. That is the case when
31
+ behaviour outside the fix changed, a design was chosen, the problem cannot be reproduced, or the fix
32
+ touches a risk area: authentication and permissions, secrets, migrations, money and figures, anything
33
+ irreversible.
34
+ 4. If an Important finding remains after that re-review, report to the person and stop.
35
+ 5. Put one table in the pull request body: finding → fix → proof or re-review.
26
36
 
27
- ## 6. Stop and ask
28
- - A finding without evidence is "cannot confirm", never a pass.
37
+ ## Changes a person made
38
+ A change in the diff that a person made is reviewed like the rest. If it is reasonable or its intent is
39
+ visible, accept it; if it looks wrong or its purpose is unclear, ask the person before anyone reverts it.
40
+
41
+ ## Keep in mind
42
+ - If one language edition of a document changed, compare it with the other edition after the last change.
43
+ - A large decision or a disagreement that does not settle goes to `pl/discussion` (every listed model,
44
+ without seeing each other); keep the minority view.
@@ -0,0 +1,50 @@
1
+ # review — step by step
2
+
3
+ For a model with a small context: the reviewer reads the diff only; the author handles the findings.
4
+
5
+ ## Steps
6
+
7
+ ### Preparing the request (the author)
8
+ 1. `git diff --stat <default>...HEAD > .loctx/reports/<version>/review-<n>.stat`
9
+ 2. `git diff <default>...HEAD > .loctx/reports/<version>/review-<n>.diff`
10
+ 3. Write the request (format below) with the paths of those two files and the `R-n` the work serves. Do
11
+ not add the conversation or your own opinion of the code.
12
+ 4. Send it to the reviewer in the delegation table (single mode: a fresh subagent of your own model). Keep
13
+ the request and the answer under `.loctx/reports/<version>/`.
14
+
15
+ ```markdown
16
+ # review request: spec 031 plan 1
17
+ diff: .loctx/reports/1.4.0/review-1.diff
18
+ stat: .loctx/reports/1.4.0/review-1.stat
19
+ serves: R-1 a month's report saves as one PDF without a network; R-2 same figures as online
20
+ look at: correctness only
21
+ return: one line per finding — grade (Important | Nit | Pre-existing), file:line, what is wrong, evidence
22
+ ```
23
+
24
+ ### Reviewing (the reviewer)
25
+ 1. Check that the files in the diff match the stat list. If one is missing, return that and stop.
26
+ 2. Read the diff file by file. For each problem, ask: does this change make the code behave wrongly?
27
+ - yes, and the diff caused it: **Important**;
28
+ - yes, but it was there before the diff: **Pre-existing**;
29
+ - no, it is style, naming or a better way: **Nit**.
30
+ 3. Give evidence for each finding: file:line and, where you can, a command and its output. Without
31
+ evidence write "cannot confirm".
32
+ 4. Return the list. Do not fix anything.
33
+
34
+ ### Handling the findings (the author)
35
+ 1. Each Nit and Pre-existing finding: write a note in `.loctx/intent/`; do not fix it here.
36
+ 2. Each Important finding: fix it, then pick its proof —
37
+ - a reproduction test that fails before the fix and passes after;
38
+ - the error no longer appears (the command and its output);
39
+ - a grep that shows the pattern is gone;
40
+ - the edit stays within the flagged lines.
41
+ 3. No proof fits (behaviour outside the fix changed, a design was chosen, it cannot be reproduced, or it is
42
+ in authentication, permissions, secrets, migrations, money and figures, or anything irreversible):
43
+ send only the changed part for one more review.
44
+ 4. An Important finding still there after that: report to the person and stop.
45
+ 5. Add the table to the pull request body:
46
+
47
+ | finding | fix | proof or re-review |
48
+ |---|---|---|
49
+ | Important: month 0 accepted (`export.ts:12`) | range check | test "rejects month 0" passes |
50
+ | Important: renderer state shared between calls (`print.ts:40`) | new instance per call | re-review: no finding |
@@ -1,28 +1,34 @@
1
1
  ---
2
2
  name: spec
3
- description: Turn an approved intent into spec.md — interpretation, design, work units and checks — and get the user's 진행 or 수정 on its summary. Use when an intent is approved and has no accepted spec yet.
3
+ description: Writes a spec under .agents/spec/ from one or more adopted intents — a head with why, the requirements and the rejected alternatives, then requirements R-n, basic design D-n and the questions for the person — proposing design directions and asking instead of deciding alone. Use when the person wants something built.
4
4
  ---
5
5
 
6
6
  # spec
7
7
 
8
- ## 1. When
9
- The intent is approved and has no accepted spec.
8
+ A spec says what is to be built and why. It is committed, so it is how the team learns what was agreed.
10
9
 
11
- ## 2. Procedure
12
- 1. Write `spec.md` from `.agents/harness/templates/spec.md`: interpretation (S-n, each naming the intent sentence it comes from), design, **work units** (W-n — each can be reverted on its own without taking other work with it; its commits pass the gates), **checks** (V-n — what to run, the expected result, how a fail looks), concerns, out of scope.
13
- 2. Review it against the user's own words, the intent and the product boundary (pl/plan-reviewer and pl/qa-plan-reviewer if switched on; else review it yourself and say so).
14
- 3. Write `summary_for_user` (3–5 lines) and show it. Wait for 진행 or 수정 — every time, no auto-accept.
15
- 4. On 진행: add `{ role: user, by, at, words, rev, kind: summary }` to `approvals:`, set `status: accepted`, commit.
16
- 5. After acceptance the spec may still move while the work goes on. A work unit added, dropped or rescoped comes back here: change the spec, show the summary, wait for 진행 or 수정. A smaller adjustment is recorded by `implement` under the spec's adjustment record (`A-n`) without stopping. When you revise the spec, read both roadmaps and the review records of the version being revised (`docs/ROADMAP.md`, `.loctx/ROADMAP.local.md`, the reviews under `.loctx/reports/<version>/`) and say in the revision that it does not contradict them, or where it does.
10
+ If `references/procedure.md` sits next to this file, read it for the step-by-step procedure.
17
11
 
18
- ## 3. Delegation
19
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro. Planner (spec-writer, qa-designer) does steps 1 when switched on.
12
+ ## What to do
13
+ 1. Gather the intents the work comes from (`.loctx/intent/`, `status: adopted`) and `docs/ROADMAP.md`.
14
+ Combine those that belong together; leave out what does not belong to this work and say so.
15
+ 2. Read what the work touches: the code, the specs and plans before it, `.agents/knowledge/`, and the
16
+ decisions in history. A requirement that reverses a recorded decision is named as such.
17
+ 3. Write `.agents/spec/<NNN>_<slug>/spec.md` (the next free number) from
18
+ `.agents/harness/templates/spec.md`, in the language of documents the person reads:
19
+ - the head: why (the problem, in the person's words), the rejected alternatives and why each was left;
20
+ - requirements `R-n`: what must hold when the work is done, each one checkable;
21
+ - basic design `D-n`: the decisions the plans build on — data shapes, boundaries, names;
22
+ - questions `Q-n`: what only the person can decide, each with the options and your proposal;
23
+ - out of scope.
24
+ 4. Where the design has a real choice, propose a direction with its reason and ask. Write the person's
25
+ answer under its `Q-n` with their words and the date.
26
+ 5. Show the person a short summary (five lines or so) and the open questions. Commit the spec with
27
+ `status: draft`; it becomes `in-progress` when a plan is agreed and `done` when the work is finished.
20
28
 
21
- ## 4. Files and lifetime
22
- - `spec.md` — committed, kept.
23
-
24
- ## 5. Next
25
- `implement`.
26
-
27
- ## 6. Stop and ask
28
- - The spec needs something the intent does not say: go back to the user (and `intent`).
29
+ ## Keep in mind
30
+ - A spec has no work units, checkboxes, approvals or adjustment records. How the work is cut and checked
31
+ belongs to the plans (`plan`); where the work departed from a plan goes into the completion report.
32
+ - A reviewer may check the spec against the intents and the person's words before you show it
33
+ (`pl/plan-reviewer` in the delegation table, if it has a model).
34
+ - When the person changes the direction, change the spec and say what changed.
@@ -0,0 +1,67 @@
1
+ # spec — 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. List the intents the work comes from: `grep -l 'status: adopted' .loctx/intent/*.md`. Read each. Write
7
+ down which ones belong to this work and which do not, with one reason each.
8
+ 2. Pick the number: the next free `NNN` in `ls .agents/spec/`. Pick a slug.
9
+ 3. Read what the work touches, one file at a time: the code paths, the specs and plans before it, the
10
+ knowledge entries found with `grep -l 'decisions:.*<keyword>' .loctx/history/* .agents/knowledge/*`.
11
+ Note every decision the work would reverse.
12
+ 4. Write the head: why (the problem in the person's words, quoted), and the rejected alternatives, each
13
+ with why it was left.
14
+ 5. Write the requirements `R-1`, `R-2`, …: each is one thing that must hold when the work is done, and can
15
+ be checked by a command, a test or a reading of one file. Not "fast", but "the export finishes within
16
+ 5 seconds for a month of data".
17
+ 6. Write the basic design `D-1`, `D-2`, …: the decisions the plans build on — data shapes, file paths,
18
+ names, boundaries. Each says which `R-n` it serves.
19
+ 7. Write the questions `Q-1`, `Q-2`, … for what only the person can decide: the options, and your proposal
20
+ with its reason.
21
+ 8. Write what is out of scope.
22
+ 9. Show the person: five lines of summary, then the questions. Write each answer under its `Q-n` with the
23
+ person's words and the date.
24
+ 10. Commit `.agents/spec/<NNN>_<slug>/spec.md` with `status: draft`.
25
+
26
+ ## The spec: `.agents/spec/<NNN>_<slug>/spec.md`
27
+ ```markdown
28
+ ---
29
+ id: "031"
30
+ slug: offline-export
31
+ version: 1.4.0
32
+ status: draft
33
+ intents: [2026-12-01_offline-export]
34
+ ---
35
+ # Offline export of the monthly report
36
+
37
+ ## 왜
38
+ Field staff have no signal on site and cannot open the report. ("현장에서는 신호가 없어요" — the person)
39
+
40
+ **버린 대안.**
41
+ - Cache the last report in the app: nothing to share with the office.
42
+
43
+ ## 요구
44
+ ### R-1 A month's report saves as one PDF file without a network
45
+ ### R-2 The file has the same figures as the online report
46
+
47
+ ## 기초 설계
48
+ **D-1 Renderer.** Reuse the print view's PDF renderer (`src/report/print.ts`); R-1, R-2.
49
+
50
+ ## 사용자에게 물을 것
51
+ - **Q-1 Range** — one month (proposed) or a chosen range? Answer: "한 달이면 돼요" (2026-12-02).
52
+
53
+ ## 범위 밖
54
+ - Export of other screens.
55
+ ```
56
+
57
+ ## Handing the draft to another model
58
+ When `planner/spec-writer` has a model, send it a task like this (keep it and the answer under
59
+ `.loctx/reports/<version>/`), then check its draft against steps 4–8 yourself:
60
+ ```markdown
61
+ # task: draft spec 031 offline-export
62
+ goal: write the spec draft in the format of .agents/harness/templates/spec.md
63
+ read: .loctx/intent/2026-12-01_offline-export.md, src/report/, .agents/knowledge/2026-10-02_no-native-plugins.md
64
+ decisions: one month only (the person, 2026-12-02)
65
+ do not: add requirements the intent does not have, change code
66
+ return: the full text of spec.md; mark every guess "guess"
67
+ ```
@@ -1,32 +0,0 @@
1
- ---
2
- name: merge
3
- description: Bring the tested branch into the default branch — push, PR and CI without asking, the first audit, then the merge on the user's instruction. 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. Push the branch and open the PR without asking: for a branch of the work in progress (an accepted spec's work units, their records, release documents) this is part of the flow. Taking anything else out of the machine still needs the user's word.
13
- 2. The PR body: the intent, the spec summary, the checks. Wait for CI. Red CI goes back to `implement`.
14
- 3. When CI is green, go on to the first audit (`audit`) without asking; a PR that goes without one says why in a line of its body. After the first audit — its record is committed on the branch and CI is green again — report once: what was done, the adjustments recorded in the spec (`A-n`), the results of the checks and of CI, what the audit found, and the instruction you are waiting for (the merge). Before that point, do not stop to report unless a stop condition applies.
15
- 4. Every merge needs the user's instruction — the PR of the work, and a PR of records or release documents alike. When the first audit found no violation, or its violations are fixed or accepted, and the user says to merge, merge at once. Merge only when the required checks pass, the way the repository merges (rebase, squash …).
16
- 5. Which PR: the PM judges which PR the instruction means — the PR it names; without a name, what the PM proposed to merge (one PR or several together) or the PR just spoken of. If you cannot tell, ask. A general "go on" is not a merge instruction. Keep the user's words with the PR's record; the second audit reads them.
17
- 6. Delete the merged branch, remote and local, in this step.
18
- 7. When the merge made the commits again (rebase, squash), a record written after the merge names the default branch's SHAs. Do not rewrite the first audit's record: right after the merge, write the table of branch SHAs and default-branch SHAs under `.loctx/reports/<version>/`, hand it to the second audit and commit it under `### SHA 대응` of the audit record. Correct the spec's ticks to the default branch's SHAs in the next record commit.
19
-
20
- ## 3. Delegation
21
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro. Executor (deployer) does this when switched on, within the same limits.
22
-
23
- ## 4. Files and lifetime
24
- - The PR — on the forge, kept.
25
- - The work branch — deleted at the merge, remote and local.
26
- - The SHA table under `.loctx/reports/<version>/` — deleted after the retro; kept in the audit record.
27
-
28
- ## 5. Next
29
- After CI: `audit` (the first audit). After the merge: `release`.
30
-
31
- ## 6. Stop and ask
32
- - Never force-push the default branch or a tag, rewrite the default branch or bypass hooks. A work branch behind the default branch is rebased and pushed with `git push --force-with-lease origin <branch>`, naming the branch; where that is not possible, merge the default branch into it (a rebase merge drops that merge commit).
@@ -1,29 +0,0 @@
1
- ---
2
- name: roadmap
3
- description: Keep the roadmaps — ideas go to .loctx/ROADMAP.local.md, and only what the user settled goes to docs/ROADMAP.md; pick the version of the next work. Use when the user brings an idea, asks what comes next, or wants to change the plan.
4
- ---
5
-
6
- # roadmap
7
-
8
- ## 1. When
9
- The user brings an idea, a change of plan, or asks what comes next.
10
-
11
- ## 2. Procedure
12
- 1. Write ideas as they come into `.loctx/ROADMAP.local.md` under the version they may belong to, marked as ideas — also while another version is being worked on. An idea is never lost and never starts work by itself.
13
- 2. Talk them through with the user until they are settled: what, why, which version, what is out. Ask what only the user can decide. A version name alone is not a settlement, and naming a version says where an item belongs — it is not an instruction to start it.
14
- 3. Only what the user settled goes into `docs/ROADMAP.md` (and its other language edition, if the project keeps one). Never put an unsettled idea there. A settled item may be entered while another version is still in work.
15
- 4. Name the version of the next work. Hand over to `intent` when the user starts that work and the previous loop is closed (its retro is done).
16
-
17
- ## 3. Delegation
18
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro.
19
-
20
- ## 4. Files and lifetime
21
- - `.loctx/ROADMAP.local.md` — local, the user keeps it.
22
- - `docs/ROADMAP.md` — committed, kept.
23
-
24
- ## 5. Next
25
- `intent` — when the user starts the work.
26
-
27
- ## 6. Stop and ask
28
- - The idea changes a past decision or the product boundary.
29
- - You are about to write something to `docs/ROADMAP.md` the user did not settle.
@@ -1,26 +0,0 @@
1
- ---
2
- name: test
3
- description: Run the spec's checks (V-n) exactly as written and judge each against its expected result, keeping the raw output. Use when every work unit of the version is reviewed.
4
- ---
5
-
6
- # test
7
-
8
- ## 1. When
9
- Every work unit of the version is reviewed.
10
-
11
- ## 2. Procedure
12
- 1. Build, then run every check V-n as written. Keep the raw output under `.loctx/reports/<version>/`.
13
- 2. Judge each against its expected result. Ambiguous is a fail. If one language edition of a document changed, compare the two language editions again after the last change; a waiver or a skipped check does not stand in for it.
14
- 3. A fail goes back to the PM → `implement`.
15
-
16
- ## 3. Delegation
17
- Check `.loctx/delegation.local.md` if it exists, otherwise 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. Always keep the request sent to another model and its final answer in .loctx/reports/<version>/ as they came, when you get them; they are deleted after the retro. Executor (qa-runner) runs the checks when switched on; tool-executor summarises a large log.
18
-
19
- ## 4. Files and lifetime
20
- - `.loctx/reports/<version>/` test logs — deleted after the retro, once summarised.
21
-
22
- ## 5. Next
23
- `merge`.
24
-
25
- ## 6. Stop and ask
26
- - Never change a check or its expected result to make it pass.