@sylad/cadence 0.8.0 → 0.10.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.
Files changed (39) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +207 -15
  4. package/agents/qa-reviewer.md +15 -6
  5. package/bin/cadence.js +3 -1
  6. package/dist/audit.js +5 -2
  7. package/dist/check.js +5 -2
  8. package/dist/clean.js +225 -0
  9. package/dist/cli.js +67 -14
  10. package/dist/config.js +82 -6
  11. package/dist/deliver.js +5 -4
  12. package/dist/git.js +29 -0
  13. package/dist/orchestrate/briefs.js +52 -0
  14. package/dist/orchestrate/command.js +498 -0
  15. package/dist/orchestrate/cycle.js +674 -0
  16. package/dist/orchestrate/guard.js +131 -0
  17. package/dist/orchestrate/launch.js +221 -0
  18. package/dist/orchestrate/lock.js +85 -0
  19. package/dist/orchestrate/pool.js +51 -0
  20. package/dist/orchestrate/result.js +94 -0
  21. package/dist/orchestrate/schemas.js +48 -0
  22. package/dist/orchestrate/state.js +93 -0
  23. package/dist/orchestrate/table.js +73 -0
  24. package/dist/plan.js +57 -2
  25. package/dist/proc.js +109 -10
  26. package/dist/recurring.js +19 -0
  27. package/dist/schedule.js +4 -1
  28. package/dist/session.js +17 -1
  29. package/dist/verify.js +30 -3
  30. package/package.json +6 -1
  31. package/skills/lead/SKILL.md +33 -13
  32. package/skills/session-close/SKILL.md +25 -4
  33. package/templates/orchestrate/fix-minors.md +22 -0
  34. package/templates/orchestrate/fix.md +21 -0
  35. package/templates/orchestrate/implement.md +25 -0
  36. package/templates/orchestrate/review-recheck.md +11 -0
  37. package/templates/orchestrate/review-small.md +11 -0
  38. package/templates/orchestrate/review.md +8 -0
  39. package/templates/orchestrate/ux.md +10 -0
@@ -34,26 +34,46 @@ progress, then drift that blocks a delivery, then ready quick wins. **Stop and w
34
34
 
35
35
  ## 2. Delegation
36
36
 
37
- For each chosen lot, the lead runs `cd <project> && raf start <lot>`, then gives a subagent this brief
38
- (fill in the brackets, keep the rest verbatim):
39
-
40
- > Work in `<absolute path of the project>` on lot `<id>` — "<title>" — of its plan
41
- > (`docs/plan/raf.yaml`, or the file named by `plan:` in `cadence.yaml`; read the lot, its notes and sub-tasks, and the project's CLAUDE.md first).
42
- > Goal: <what done looks like, from the human's words>.
43
- > Rules: test first; commit each sub-part as soon as its tests pass, with explicit paths (never
44
- > `git add -A` or `commit -a`), and a message that cites the lot (`feat(<id>): …`); run the project's
45
- > full test suite and build before reporting; do not push, deliver, run `raf done`, `raf ux` or
46
- > `raf review`.
47
- > If something is ambiguous or needs a decision, stop and report the question instead of guessing.
48
- > Report: commits (sha + subject), tests and build results with their numbers, what you could not
49
- > verify, open questions.
37
+ The default way to delegate is **`cadence orchestrate`** (section 2b): a program, not a conversation, that runs
38
+ one fresh short session per step. When the lead delegates by hand, the brief is the template
39
+ `templates/orchestrate/implement.md` of the cadence package — the single source, tested; `cadence
40
+ orchestrate --dry-run <project>:<lot>` writes it rendered for the lot. The lead runs
41
+ `cd <project> && raf start <lot>`, fills `{{chemin}}`, `{{lot}}`, `{{titre}}` and `{{objectif}}` (what done
42
+ looks like, from the human's words), and keeps the rest verbatim.
50
43
 
51
44
  A lot that adds or changes a screen is `visible`: after the implementation, have the
52
45
  `ux-reviewer` agent review it (give it the URL or the way to run the app) and bring its verdict and
53
46
  proposed sub-tasks back to the human.
54
47
 
48
+ ### 2b. A wave through `cadence orchestrate`
49
+
50
+ Once the human has chosen the lots, the lead runs, **in the background** (it is notified at the end; no
51
+ silent wait, no polling loop — `cadence orchestrate --status` shows where the wave is):
52
+
53
+ ```sh
54
+ cadence orchestrate <project>:<lot> <project>:<lot>@haiku … [--budget 2M]
55
+ ```
56
+
57
+ `cadence orchestrate --dry-run …` first when a precondition is in doubt. The program, not the lead, runs
58
+ for each lot a fresh short session per step — implementation (Sonnet), UX review if the lot is `visible`
59
+ and the project declares how to see its app (`orchestrate.ux` in `cadence.yaml`), code review last
60
+ (Opus, the `code-reviewer` agent), a correction in a new session if the review is not compliant (two
61
+ passes at most) — and records `raf review` itself when the code review is compliant. The state is in
62
+ `.cadence/runs/<wave>/`, not in this conversation. `@haiku` only when the human writes it, for a
63
+ mechanical lot. Exit code: 0 all ready · 1 some lots handed back · 2 refused before acting · 3 wave
64
+ suspended (budget or usage limit; `--resume --budget …` continues).
65
+
66
+ What the orchestrator does **not** do, and stays with the lead: choose the lots (with the human), bring the
67
+ questions back (`--resume --answer <project>:<lot> "…"`), look at the UX reviewer's captures and record
68
+ `raf ux` (the orchestrator reports its verdict, it never records it), re-verify (section 3, point 2),
69
+ `raf done`, push and deliver. Minor findings and proposed sub-tasks come back in the table: adding them to
70
+ the plan is the lead's decision. If an orchestrated wave is running in a repository, do not commit there
71
+ and do not deliver it (`cadence deliver` refuses).
72
+
55
73
  ## 3. Check
56
74
 
75
+ 0. After an orchestrated wave the review is already done, by a fresh session: read the table, then go to
76
+ point 2. For a lot delegated by hand:
57
77
  1. The `code-reviewer` agent, as a fresh subagent (most capable model), reviews the lot. Give it
58
78
  the absolute path of the project and the lot id, **not** the author's report: it reads the diff
59
79
  itself from the commits that cite the lot, runs the checks, and returns real defects only,
@@ -34,18 +34,39 @@ With no project named, run `cadence session close` in each project touched durin
34
34
  (`raf review enable`), UX review of a visible lot (`raf ux enable`) → have the `code-reviewer` / `ux-reviewer` agent review it, then record its
35
35
  verdict with `raf review <id> "…"` / `raf ux <id> "…"`; never write a verdict nobody gave;
36
36
  - rerun until the check part is clean.
37
- 3. **Memory, filtered** (only if you keep a persistent memory): write down what the repository does
37
+ 3. **Stale working files** (report section "Nettoyage proposé", from `session.clean` in `cadence.yaml`):
38
+ list them to the human — shared tmp folder, screenshots no one refers to, throwaway scripts,
39
+ folders left by tests — and delete them only after the human agrees, with explicit paths (never a
40
+ wildcard `rm`, never a file `git` tracks). The agreement can be old by then: right before
41
+ deleting, re-run `cadence session close` (or the scan) and delete only the entries that are
42
+ still proposed, never one the human named from memory. Delete a proposed symbolic link as a
43
+ link (`rm path`, no trailing `/`, never `rm -r` through it). Before proposing a screenshot, check nothing still
44
+ refers to it (plan, news, docs). Anything kept: leave it, it will be listed again next close. No
45
+ section: nothing to do; a project with no `session.clean` can propose adding it.
46
+ An entry is proposed only if it could be measured entirely. Age: a folder's age is that of the
47
+ most recent entry it contains, an entry's age counting from the later of its modification and status-change times. The report never proposes: a git repository, a folder that
48
+ contains one at any depth, and anything under a `.git` folder; a git directory without a `.git`
49
+ entry (bare repository, mirror, `--separate-git-dir`, worktree admin folder — recognised by
50
+ `HEAD` with `objects` and `refs`, or with `commondir`), anything inside it or a folder that
51
+ contains one; anything `git` tracks, in any repository that has a `.git` entry above it (one limit: a bare repository driven with an external work tree, `git --git-dir=~/.dotfiles --work-tree=~`, leaves no `.git` beside its files — their tracked files can be proposed, so check a proposed entry is not one); a name starting with `.`
52
+ unless the pattern itself starts that name with `.`; anything behind a symbolic link a `*`
53
+ matched (the link itself may be proposed: remove the link, never `rm -r` through it — a segment
54
+ written in full before the first `*` does follow its link); the repository itself or a folder that contains it;
55
+ anything that could not be read entirely — those are listed apart as "illisible(s)": tell the
56
+ human, never delete those, and never widen the list by hand to entries the report did not
57
+ propose.
58
+ 4. **Memory, filtered** (only if you keep a persistent memory): write down what the repository does
38
59
  NOT already say — a trap and its cause, a decision or correction from the human, a collaboration
39
60
  rule. Test: "do `git log` or the docs already say it?" → then no memory.
40
- 4. **Skills and agents, on threshold, PROPOSED**: a skill when the same chain of commands was done by
61
+ 5. **Skills and agents, on threshold, PROPOSED**: a skill when the same chain of commands was done by
41
62
  hand at least twice today; an agent update when an agent got something wrong or its domain moved.
42
63
  List them with the benefit; the human decides. Never create them here.
43
64
  When the report has a "Faits propres au projet" section (`session.close` in `cadence.yaml`), treat
44
65
  what it flags as part of this hygiene; with a read-only plan, use the project's own tool wherever
45
66
  these steps say `raf`.
46
- 5. **Clean state**: everything committed and pushed, no delivery running. If the command still exits 1,
67
+ 6. **Clean state**: everything committed and pushed, no delivery running. If the command still exits 1,
47
68
  say what remains and do NOT say the session is closed.
48
- 6. **Three lines for next time**: `cadence session next "…" "…" "…"` — the next `session-start` shows them.
69
+ 7. **Three lines for next time**: `cadence session next "…" "…" "…"` — the next `session-start` shows them.
49
70
  The lines replace the previous notes. Without a line the command refuses and keeps them; erase
50
71
  them on purpose with `cadence session next --clear`, only when nothing is left to say.
51
72
 
@@ -0,0 +1,22 @@
1
+ Work in `{{chemin}}` on lot `{{lot}}` — "{{titre}}" — of its plan.
2
+ A fresh review found only minor findings: the lot is compliant, and this is the one pass that treats them.
3
+ Commits of the lot so far:
4
+ {{commits}}
5
+
6
+ Minor findings:
7
+ {{constats}}
8
+
9
+ Fix each minor finding that is right, and nothing else. Rules: test first; commit each fix as soon as
10
+ its tests pass, with explicit paths (never `git add -A` or `commit -a`), and a message that cites the
11
+ lot (`fix({{lot}}): …`); run the project's full test suite and build before reporting; do not push,
12
+ deliver, run `raf done`, `raf ux` or `raf review`. Read the project's CLAUDE.md first.
13
+ Do not stop to ask. A finding that is wrong, or not worth its change, is not fixed: list it under
14
+ "choix" in your report with the reason — the reviewer re-reads it and the lead sees it. Leave
15
+ "questions" empty. Making no commit at all is a valid outcome when every finding is rejected.
16
+ Minor choices to settle yourself, writing the alternative you did not take:
17
+ a spacing, colour or label value when a measurement or a rule justifies it; the URL of a link (the most general official page if a precise one is not certain);
18
+ a News entry: only if a finding asks for it; a written rule of the project's CLAUDE.md (apply it); who launches the review or UX pass (never the session: the program and the lead do).
19
+ "not my job to touch the plan" is not a question: say it in the report.
20
+ You are one short session of an orchestrated wave: do not launch subagents (the Agent tool is disabled).
21
+ Give your final report as the structured output (commits, tests, build, what you could not verify, choices).
22
+ {{reponse}}
@@ -0,0 +1,21 @@
1
+ Work in `{{chemin}}` on lot `{{lot}}` — "{{titre}}" — of its plan. A fresh review of the commits
2
+ of this lot found the defects below; fix them, and nothing else.
3
+ Commits of the lot so far:
4
+ {{commits}}
5
+
6
+ Findings to fix:
7
+ {{constats}}
8
+
9
+ Rules: test first; commit each fix as soon as its tests pass, with explicit paths (never
10
+ `git add -A` or `commit -a`), and a message that cites the lot (`fix({{lot}}): …`); run the project's
11
+ full test suite and build before reporting; do not push, deliver, run `raf done`, `raf ux` or
12
+ `raf review`. Read the project's CLAUDE.md first.
13
+ If a finding is wrong, say so under "choix" with the reason. Ask (under "questions") only when a fix needs a decision that passes the rule below.
14
+ A question is legitimate only if it names what it would change: the scope of the lot, the architecture, or a costly rollback (data, production, public API);
15
+ otherwise it is a choice: decide, write the alternative you did not take, go on. Minor choices to settle yourself:
16
+ a spacing, colour or label value when a measurement or a rule justifies it; the URL of a link (the most general official page if a precise one is not certain);
17
+ a News entry: only if a finding asks for it; a written rule of the project's CLAUDE.md (apply it); who launches the review or UX pass (never the session: the program and the lead do).
18
+ "not my job to touch the plan" is not a question: say it in the report.
19
+ You are one short session of an orchestrated wave: do not launch subagents (the Agent tool is disabled).
20
+ Give your final report as the structured output (commits, tests, build, what you could not verify, choices, questions).
21
+ {{reponse}}
@@ -0,0 +1,25 @@
1
+ Work in `{{chemin}}` on lot `{{lot}}` — "{{titre}}" — of its plan
2
+ (`docs/plan/raf.yaml`, or the file named by `plan:` in `cadence.yaml`; read the lot, its notes and sub-tasks, and the project's CLAUDE.md first).
3
+ Goal: {{objectif}}
4
+ Rules: test first; commit each sub-part as soon as its tests pass, with explicit paths (never
5
+ `git add -A` or `commit -a`), and a message that cites the lot (`feat({{lot}}): …`); run the project's
6
+ full test suite and build before reporting; do not push, deliver, run `raf done`, `raf ux` or
7
+ `raf review`.
8
+ Decide minor interpretation questions yourself (the wording of a message, a name, a default, the
9
+ reading of an ambiguous line of the lot) and list each one under "choix" in your report, with the
10
+ alternative you did not take — the reviewer re-reads them. Stop and ask (under "questions") only on a real blocker.
11
+ A question is legitimate only if it names what it would change: the scope of the lot, the architecture, or a costly rollback (data, production, public API), AND the plan, its notes and the project's CLAUDE.md do not settle it;
12
+ otherwise it is a choice: decide, write the alternative you did not take, go on. Minor choices to settle yourself:
13
+ a spacing, colour or label value when a measurement or a rule justifies it; the URL of a link (the most general official page if a precise one is not certain);
14
+ a News entry for a visible lot (yes, always); a written rule of the project's CLAUDE.md (apply it); who launches the review or UX pass (never the session: the program and the lead do).
15
+ "not my job to touch the plan" is not a question: say it in the report.
16
+ If the lot's commits already cover its open sub-tasks, do not ask whether to continue: make no commit and say so
17
+ in your report (the review that follows re-reads those commits). If they do not cover them all, implement the rest.
18
+ Report: commits (sha + subject), tests and build results with their numbers, what you could not
19
+ verify, choices made, open questions.
20
+
21
+ You are one short session of an orchestrated wave: do not launch subagents (the Agent tool is disabled).
22
+ Give your final report as the structured output, not as free text. If the plan is kept by the project's own tool
23
+ (read-only for `raf`), use that tool's commands named in the project's CLAUDE.md, never `raf start|done|note`.
24
+ {{commits}}
25
+ {{reponse}}
@@ -0,0 +1,11 @@
1
+ Do a short re-review of lot `{{lot}}` — "{{titre}}" — of the repository `{{chemin}}`, following your
2
+ agent instructions. A full review found the lot compliant with minor findings, and one pass has since
3
+ treated them. Check that the minor findings fixed are fixed, that the fixes broke nothing, and that the
4
+ rest of the lot is still sound: read the diff yourself from the commits that cite the lot
5
+ (`raf commits {{lot}}`, or `git log`), run the checks, report real defects only. A new minor finding
6
+ is reported, not a reason to ask for another pass. This is a code review only.
7
+ {{choix}}
8
+ You are read-only: do not modify, commit, push or run `raf review|ux|done`. Do not launch subagents.
9
+ Give your report as the structured output: counts of blocking / major / minor findings, each finding
10
+ (severity, file, line, text), proposed sub-tasks, what you could not verify, and the one-line verdict
11
+ for `raf review {{lot}}`.
@@ -0,0 +1,11 @@
1
+ Review lot `{{lot}}` — "{{titre}}" — of the repository `{{chemin}}`, following your agent instructions.
2
+ This lot is small: one single pass covers the code review AND the usability review.
3
+ You are given the repository path and the lot id only: read the diff yourself from the commits that
4
+ cite the lot (`raf commits {{lot}}`, or `git log`), run the checks, report real defects only.
5
+ {{ux}}
6
+ {{choix}}
7
+ You are read-only: do not modify, commit, push or run `raf review|ux|done`. Do not launch subagents.
8
+ Give your report as the structured output: counts of blocking / major / minor findings (usability
9
+ findings included, each tied to a named rule — Nielsen heuristic or WCAG 2.2 AA criterion — or a
10
+ measurement), each finding (severity, file, line, text), proposed sub-tasks, what you could not
11
+ verify, and the one-line verdict for `raf review {{lot}}`.
@@ -0,0 +1,8 @@
1
+ Review lot `{{lot}}` — "{{titre}}" — of the repository `{{chemin}}`, following your agent instructions.
2
+ You are given the repository path and the lot id only: read the diff yourself from the commits that
3
+ cite the lot (`raf commits {{lot}}`, or `git log`), run the checks, report real defects only.
4
+ {{choix}}
5
+ You are read-only: do not modify, commit, push or run `raf review|ux|done`. Do not launch subagents.
6
+ Give your report as the structured output: counts of blocking / major / minor findings, each finding
7
+ (severity, file, line, text), proposed sub-tasks, what you could not verify, and the one-line verdict
8
+ for `raf review {{lot}}`.
@@ -0,0 +1,10 @@
1
+ Review the usability and accessibility of lot `{{lot}}` — "{{titre}}" — of the repository `{{chemin}}`,
2
+ following your agent instructions. Read the diff yourself from the commits that cite the lot
3
+ (`raf commits {{lot}}`, or `git log`).
4
+ {{ux}}
5
+ You are read-only: do not modify, commit, push or run `raf review|ux|done`. Do not launch subagents.
6
+ Ground every finding in a named rule (Nielsen heuristic, WCAG 2.2 AA criterion) or a measurement;
7
+ describe a mockup before proposing any redesign, never code it.
8
+ Give your report as the structured output: counts of blocking / major / minor findings, each finding
9
+ (severity, file, line, text), proposed sub-tasks, what you could not verify, and the one-line verdict
10
+ for `raf ux {{lot}}`.