@jaybeeuu/agent-cortex 2.7.0 → 2.9.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.
- package/CHANGELOG.md +412 -0
- package/README.md +87 -8
- package/agents/README.md +4 -4
- package/agents/guppi/agent.md +162 -0
- package/agents/guppi/claude/frontmatter.json +6 -0
- package/agents/guppi/pi/frontmatter.json +6 -0
- package/agents/plan/agent.md +6 -0
- package/agents/ralph/agent.md +17 -16
- package/agents/ralph/claude/wake.md +4 -4
- package/agents/ralph/pi/wake.md +15 -20
- package/agents/ralph-plan/agent.md +6 -0
- package/bin/agent-cortex.mjs +20 -1
- package/bin/installers/claude.mjs +1 -20
- package/bin/installers/pi.mjs +8 -2
- package/extensions/interrupt-bookmark/README.md +129 -0
- package/extensions/interrupt-bookmark/index.test.ts +717 -0
- package/extensions/interrupt-bookmark/index.ts +354 -0
- package/extensions/interrupt-bookmark/package.json +20 -0
- package/extensions/post-merge-watch/README.md +133 -0
- package/extensions/post-merge-watch/index.test.ts +247 -0
- package/extensions/post-merge-watch/index.ts +123 -0
- package/extensions/post-merge-watch/package.json +16 -0
- package/extensions/post-merge-watch/watch.test.ts +469 -0
- package/extensions/post-merge-watch/watch.ts +431 -0
- package/extensions/session-clear/README.md +74 -0
- package/extensions/session-clear/index.test.ts +524 -0
- package/extensions/session-clear/index.ts +159 -0
- package/extensions/session-clear/package.json +16 -0
- package/extensions/skill-stats/README.md +84 -3
- package/extensions/skill-stats/index.ts +62 -3
- package/extensions/skill-stats/package.json +1 -1
- package/extensions/skill-stats/rollup.test.ts +643 -0
- package/extensions/skill-stats/rollup.ts +415 -0
- package/extensions/skill-stats/timeline.ts +101 -0
- package/lib/cli.mjs +42 -1
- package/lib/self-update.mjs +553 -0
- package/package.json +1 -1
- package/scripts/lib/manifest.mjs +29 -0
- package/skills/engineering/implement-task/SKILL.md +124 -0
- package/skills/engineering/tdd/SKILL.md +2 -0
- package/skills/planning/create-task/REFERENCE.md +15 -6
- package/skills/planning/create-task/SKILL.md +1 -1
- package/skills/planning/create-task/pipeline.json +8 -0
- package/skills/planning/create-task/scripts/create-chores.mjs +27 -18
- package/skills/planning/create-task/templates/code.md +8 -3
- package/skills/planning/create-task/templates/document.md +8 -3
- package/skills/planning/create-task/templates/fix.md +8 -3
- package/skills/planning/create-task/templates/housekeeping.md +8 -4
- package/skills/planning/create-task/templates/post-merge.md +67 -0
- package/skills/planning/create-task/templates/review.md +8 -3
- package/skills/planning/create-task/templates/verify.md +8 -3
- package/skills/productivity/bd-tool/SKILL.md +55 -0
- package/skills/review/review-defects/EXAMPLES.md +198 -0
- package/skills/review/review-defects/SKILL.md +121 -0
- package/skills/review/review-report/EXAMPLES.md +114 -0
- package/skills/review/review-report/SKILL.md +138 -0
- package/skills/review/review-report/scripts/report.mjs +1032 -0
- package/skills/style/style-tests/EXAMPLES.md +30 -0
- package/skills/style/style-tests/SKILL.md +10 -6
- package/skills/workflow/hitl-queue/SKILL.md +134 -0
- package/skills/workflow/hitl-queue/scripts/queue.mjs +626 -0
- package/skills/workflow/plan/SKILL.md +27 -3
- package/skills/workflow/prioritise-work/CHALLENGE.md +139 -0
- package/skills/workflow/prioritise-work/SKILL.md +150 -0
- package/skills/workflow/prioritise-work/scripts/challenge.mjs +505 -0
- package/skills/workflow/prioritise-work/scripts/strategy.mjs +566 -0
- package/skills/workflow/prioritise-work/templates/strategy.md +61 -0
- package/skills/workflow/ralph/REFERENCE.md +124 -27
- package/skills/workflow/ralph/SKILL.md +24 -15
- package/skills/workflow/ralph/scripts/post-merge-check.mjs +651 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +37 -22
- package/skills/workflow/run-pipeline-stage/playbooks/code.md +14 -8
- package/skills/workflow/run-pipeline-stage/playbooks/document.md +2 -2
- package/skills/workflow/run-pipeline-stage/playbooks/fix.md +2 -2
- package/skills/workflow/run-pipeline-stage/playbooks/housekeeping.md +1 -1
- package/skills/workflow/run-pipeline-stage/playbooks/post-merge.md +54 -0
- package/skills/workflow/run-pipeline-stage/playbooks/review.md +37 -3
- package/skills/workflow/run-pipeline-stage/playbooks/verify.md +2 -2
- package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +55 -11
- package/skills/workflow/run-pipeline-stage/scripts/recover-brief.mjs +805 -0
- package/skills/workflow/run-pipeline-stage/scripts/trail-entry.mjs +702 -0
- package/skills/workflow/score-bead/FORMAT.md +73 -0
- package/skills/workflow/score-bead/SKILL.md +112 -0
- package/skills/workflow/score-bead/scripts/rice.mjs +664 -0
- package/skills/workflow/using-agent-skills/SKILL.md +21 -8
- package/token-map.README.md +27 -0
- package/token-map.json +16 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Score Bead — Record, Bands and Trail
|
|
2
|
+
|
|
3
|
+
The exact shapes `rice.mjs` reads and writes. Read this when a record looks wrong, when you need the band thresholds, or when you are auditing a re-score.
|
|
4
|
+
|
|
5
|
+
## The metadata record
|
|
6
|
+
|
|
7
|
+
One key, `rice`, written with `bd update <id> --metadata '{"rice":{…}}'`. `bd show` renders it under `METADATA`:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
METADATA
|
|
11
|
+
rice: {"assessedAt":"2026-11-14T09:00:00.000Z","confidence":0.7,"effort":2,
|
|
12
|
+
"impact":3,"rationale":"unblocks the messaging epic — Current themes",
|
|
13
|
+
"reach":4,"score":4.2,"strategyVersion":2}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Field | Type | Meaning |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `reach` | number ≥ 0 | How much work the bead changes |
|
|
19
|
+
| `impact` | number ≥ 0 | How much each unit of reach gains, on the rubric's scale |
|
|
20
|
+
| `confidence` | number `0..1` | Probability that the reach, impact and effort estimates hold |
|
|
21
|
+
| `effort` | number > 0 | Cost, on the rubric's effort calibration |
|
|
22
|
+
| `score` | number, one decimal | `reach × impact × confidence ÷ effort` |
|
|
23
|
+
| `strategyVersion` | integer | The strategy file's own version, read after it validated |
|
|
24
|
+
| `assessedAt` | string | When the judgement was made — now in UTC, or `--at` copied verbatim |
|
|
25
|
+
| `rationale` | string | Why these numbers, then the `[prior]` trail |
|
|
26
|
+
|
|
27
|
+
The total is rounded once, at the end: `Math.round(value * 10) / 10`. Rounding a component instead would make the stored components disagree with the stored total.
|
|
28
|
+
|
|
29
|
+
`--at` is a convention, not a guarantee. The flag documents an RFC 3339 UTC timestamp, but `score` writes the value exactly as given and never validates it, so a mistyped timestamp reaches the record unchanged. Omit the flag and the record carries the real time.
|
|
30
|
+
|
|
31
|
+
`score` refuses, writing nothing, when:
|
|
32
|
+
|
|
33
|
+
- the strategy file is missing, or `validate` rejects it — exit 1, with the reason;
|
|
34
|
+
- a component is not a number, `confidence` falls outside `0..1`, or `effort` is zero or less — exit 2;
|
|
35
|
+
- the rationale is empty — exit 2.
|
|
36
|
+
|
|
37
|
+
Exit 1 means the run reached a judgement and refused it; exit 2 means the call was malformed and never got that far. Neither reaches the tracker: the components, the rationale and the strategy are all checked before the first `bd` call, so a refused score leaves no metadata, no note and no tag behind.
|
|
38
|
+
|
|
39
|
+
## The band table
|
|
40
|
+
|
|
41
|
+
| Score at least | Proposed priority |
|
|
42
|
+
|---|---|
|
|
43
|
+
| 8 | P1 |
|
|
44
|
+
| 4 | P2 |
|
|
45
|
+
| 1 | P3 |
|
|
46
|
+
| 0 | P4 |
|
|
47
|
+
|
|
48
|
+
Bands are highest-first and evaluated in order. P0 is absent and `bandFor` throws if a table ever yields it, so a computed score can never file a bead as an incident. The table lives in `rice.mjs` as `DEFAULT_BANDS`; changing it is a code change, reviewable like any other.
|
|
49
|
+
|
|
50
|
+
`band <id>` prints the proposal and the command that would apply it:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
✓ tst-6: score 4.2 → P2 (currently P3)
|
|
54
|
+
proposal only — review the components and the rationale, then apply: bd update tst-6 -p 2
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
It reads the bead with `bd show` and calls nothing else. A bead already at P0 is refused before a proposal exists, because an incident is not re-prioritised by a rubric. A bead with no numeric `score` is refused too — score it first, then band it.
|
|
58
|
+
|
|
59
|
+
## The rationale trail
|
|
60
|
+
|
|
61
|
+
The rationale holds the current argument, then one `[prior]` line per score it replaced, oldest first and ending with the score just replaced:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
re-scored against the December rubric
|
|
65
|
+
[prior] score 1 @ strategy v1, assessed 2026-10-01T00:00:00.000Z (reach 1, impact 1, confidence 0.5, effort 2)
|
|
66
|
+
[prior] score 4.2 @ strategy v2, assessed 2026-11-14T09:00:00.000Z (reach 4, impact 3, confidence 0.7, effort 2)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Each line carries the superseded total, its components, the strategy version it was judged against and its date, so the old arithmetic stays checkable after the components are overwritten.
|
|
70
|
+
|
|
71
|
+
Why the rationale and not a separate `history` array: the bead carries one record, `bd show` renders it in one place, and a re-score cannot drop the history by forgetting a second store. A reader greps `[prior]` to separate the trail from the prose. A record with no numeric `score` contributes no new line, but its existing trail is carried forward unchanged.
|
|
72
|
+
|
|
73
|
+
Nothing caps the trail. Every re-score appends one line and drops none, so the field grows by a line per re-score for the whole life of the bead. In practice a bead is re-scored a handful of times, once per strategy version; treat a long trail as history, not as a defect.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: score-bead
|
|
3
|
+
description: Scores one bead RICE-style against the committed strategy and stores the components, total, confidence, rationale and strategy version in its metadata, then proposes a priority band for review. Use when a bead is unscored, when asked to "score this bead", "rank this work", or "what priority should this be".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Score Bead
|
|
7
|
+
|
|
8
|
+
Owns two things about one bead: the **RICE record** in its metadata, and a **band proposal** for its priority. The rubric the numbers are judged against is not this skill's — `prioritise-work` owns the strategy file, validates it and versions it.
|
|
9
|
+
|
|
10
|
+
Score and band are two steps on purpose. `score` writes an auditable record; `band` only reads it and prints a proposal. A score is a judgement, so the priority it implies is reviewed before it lands. A script that re-prioritised the backlog silently would remove the review, not save it.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- A bead appears in a queue with no `rice` metadata, or with a `strategyVersion` older than the strategy file.
|
|
15
|
+
- "Score this bead", "rank this work", "is this a P1?", "what priority should this be".
|
|
16
|
+
- Before dispatching work: an unscored bead cannot be compared with a scored one.
|
|
17
|
+
|
|
18
|
+
## When NOT to use
|
|
19
|
+
|
|
20
|
+
- Setting or updating the strategy — use `prioritise-work`. This skill reads the rubric and never writes it.
|
|
21
|
+
- Recording an idea for later — use `record-idea`.
|
|
22
|
+
- Changing where a bead's state lives — use `bd-tool`.
|
|
23
|
+
- Ordering the whole backlog into one list — that is the [hitl-queue](../hitl-queue/SKILL.md) skill's job; this skill scores one bead.
|
|
24
|
+
|
|
25
|
+
## The record
|
|
26
|
+
|
|
27
|
+
`score` writes one metadata key, so a reader greps one key instead of parsing the bead:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{"rice":{"reach":4,"impact":3,"confidence":0.7,"effort":2,"score":4.2,
|
|
31
|
+
"strategyVersion":2,"assessedAt":"2026-11-14T09:00:00.000Z",
|
|
32
|
+
"rationale":"unblocks the messaging epic — Current themes"}}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Components and total are both stored, so a reader can redo the arithmetic. The full shape, the band table and the rationale trail are in [FORMAT.md](FORMAT.md).
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
1. **Check the strategy is valid.** Load `prioritise-work` and run its validator:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
node <skill-scripts>/../../prioritise-work/scripts/strategy.mjs validate
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
A missing or malformed strategy stops here. `score` refuses in that state and writes nothing, so fixing the rubric is the only useful next action. The path above is the default (`.agent-cortex/working-docs/strategy.md` relative to the repository root); pass `--file <path>` to `score` when the repository keeps it elsewhere, and the same `--file` to the validator.
|
|
46
|
+
|
|
47
|
+
2. **Judge the four components against the strategy.** Each number must trace to a section of the rubric, and the rationale names that section.
|
|
48
|
+
|
|
49
|
+
| Component | What it measures | Watch for |
|
|
50
|
+
|---|---|---|
|
|
51
|
+
| `reach` | How much work this changes — how many workflows, beads or users | Counting the author once, not the repeated cost |
|
|
52
|
+
| `impact` | How much each unit of reach gains, on the rubric's own scale | A number the rubric does not define |
|
|
53
|
+
| `confidence` | How sure the estimate is, as a probability `0..1` | A guess presented as a figure |
|
|
54
|
+
| `effort` | Cost, on the effort calibration the rubric anchors | An effort that is a wish |
|
|
55
|
+
|
|
56
|
+
3. **Record a confidence figure you can defend.** Use `0..1`, and let the rationale say what the evidence is and what is missing. `0.5` with "no comparable work yet" is honest; `0.9` with no evidence is a guess wearing a number. When you cannot estimate at all, lower the figure and name the gap rather than inflating it.
|
|
57
|
+
|
|
58
|
+
4. **Score the bead.** One command, one record:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node <skill-scripts>/rice.mjs score <bead-id> --reach 4 --impact 3 --confidence 0.7 \
|
|
62
|
+
--effort 2 --rationale "unblocks the messaging epic — Current themes"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
It computes `reach × impact × confidence ÷ effort` to one decimal, records the strategy version it validated, and writes the record with `bd update <id> --metadata`. It writes nothing when the strategy is missing or invalid, and nothing when a component falls outside its range.
|
|
66
|
+
|
|
67
|
+
5. **Read back what landed.** `bd show <bead-id>` renders the `METADATA` block: the components, the total, the version and the rationale. Confirm the arithmetic before you trust the score.
|
|
68
|
+
|
|
69
|
+
6. **Propose a band.** Separate command, read-only:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
node <skill-scripts>/rice.mjs band <bead-id>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
It prints `score 4.2 → P2 (currently P3)` and the exact command that would apply it.
|
|
76
|
+
|
|
77
|
+
7. **Apply the band only after review.** Show the proposal — score, current priority, proposed priority, and the rationale — and run the printed `bd update <bead-id> -p <n>` only when the owner accepts it. Skip the step when the proposal equals the current priority.
|
|
78
|
+
|
|
79
|
+
## Re-scoring keeps the history
|
|
80
|
+
|
|
81
|
+
When the strategy version moves, re-score the bead. The new record carries the new `strategyVersion`, and the rationale keeps a `[prior]` line for every score it replaced — old score, components, version and date. The mechanism is the rationale text itself, not a second field: one record then holds both the current argument and its trail, and `bd show` renders all of it.
|
|
82
|
+
|
|
83
|
+
So a re-score never needs a note to explain the change. Write the new rationale, score, and read the trail back to confirm the old total survived (see [FORMAT.md](FORMAT.md) for the rendered shape).
|
|
84
|
+
|
|
85
|
+
## Priority is an output of review, not of arithmetic
|
|
86
|
+
|
|
87
|
+
- **A band is a proposal.** The script never runs the update it prints; step 7 does, and only on acceptance.
|
|
88
|
+
- **P0 is an incident.** A score never produces P0, and `band` refuses a bead that is already at P0 without proposing anything. An incident is declared by a person and cleared by a person; a rubric that could compute one would let a high-impact feature hide a production failure.
|
|
89
|
+
- **A previous priority stays readable.** The rationale carries the scores a band decision was made from, so a reader sees why the priority moved.
|
|
90
|
+
|
|
91
|
+
## Red Flags
|
|
92
|
+
|
|
93
|
+
- Red flag: writing a confidence number with no evidence behind it, because the field needs a value.
|
|
94
|
+
- Red flag: applying a band yourself, in the same breath as proposing it, so no review happens.
|
|
95
|
+
- Red flag: scoring against a strategy whose `validate` was never run — the record then cites a version nobody checked.
|
|
96
|
+
- Red flag: re-scoring and dropping the `[prior]` trail, so the priority change has no recorded reason.
|
|
97
|
+
- Red flag: raising a P0 bead to make a queue look tidy.
|
|
98
|
+
|
|
99
|
+
## Verification checklist
|
|
100
|
+
|
|
101
|
+
- [ ] `strategy.mjs validate` exited 0 before the score ran.
|
|
102
|
+
- [ ] `bd show <id>` shows a `rice` key whose components reproduce the total: `reach × impact × confidence ÷ effort`, one decimal.
|
|
103
|
+
- [ ] The recorded `strategyVersion` equals the file's version after validation.
|
|
104
|
+
- [ ] The rationale names the strategy section each component rests on, and the confidence is a figure the evidence supports.
|
|
105
|
+
- [ ] A re-score carries a `[prior]` line for the score it replaced.
|
|
106
|
+
- [ ] The band proposal was accepted by a reviewer before the priority changed, and no P0 bead was touched.
|
|
107
|
+
|
|
108
|
+
## See Also
|
|
109
|
+
|
|
110
|
+
- [prioritise-work](../../workflow/prioritise-work/SKILL.md) — owns the strategy file; run its `validate` before any score.
|
|
111
|
+
- [hitl-queue](../hitl-queue/SKILL.md) — ranks the beads these scores belong to, and reads them back.
|
|
112
|
+
- [bd-tool](../../productivity/bd-tool/SKILL.md) — where the record lives, and why a bead holds operational state rather than the rubric.
|