@open-tomato/rafa 0.19.0 → 0.21.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/README.md CHANGED
@@ -171,11 +171,49 @@ the next one, so you rarely have to remember it.
171
171
 
172
172
  Then step 2 again, or `rafa plan create --next`.
173
173
 
174
+ ### Tracking effort and learning from skills
175
+
176
+ Each run records what it cost in time, tokens and work, and which skills
177
+ were offered, invoked and worked. Two commands read that record:
178
+
179
+ ```bash
180
+ rafa effort collect # gather and store session logs
181
+ rafa effort report # per-plan summary: sessions, tasks, costs
182
+ ```
183
+
184
+ `rafa effort report` shows the per-plan tables (sessions by status and
185
+ outcome), the task report tallies, and any runs whose preflight halted. To
186
+ see which skills earned their place and which are ignored:
187
+
188
+ ```bash
189
+ rafa effort report --skills
190
+ rafa effort report --skills --plan=rafa-24-know-which-skills-earn
191
+ ```
192
+
193
+ With `--skills`, the report shows per plan and per resolver (the method
194
+ that picked which skills to offer: `planner` by task declaration, `tag`
195
+ by ranking, or `none`):
196
+
197
+ - Each **skill**: offered count, invoked count, reported in the outcome,
198
+ recurrence count, and its **signal**: `earning` (worked with no failure
199
+ recurrence), `recurring` (invoked but a failure recurred), `unmeasured`
200
+ (invoked with no failure strings declared), or `ignored` (offered but
201
+ never invoked).
202
+ - Each **lesson**: injected count, recurrence count, and whether it
203
+ recurred.
204
+ - **M1** and **M2**: how many task lines used skills you offered, and how
205
+ many of the skills you offered were actually invoked.
206
+ - **Plan CI**: the settled result of the pull request's checks when it landed.
207
+
208
+ The report opens with a fixed line explaining that it shows co-occurrence,
209
+ not causation: a skill can be invoked and its failure recur for reasons the
210
+ skill does not cover.
211
+
174
212
  ### Which agents and skills are involved
175
213
 
176
214
  A task line may end with a declaration, for example
177
- `{agent=tdd-guide effort=medium}`. The planner writes it; you can change
178
- it.
215
+ `{agent=tdd-guide skills=dev-planner effort=medium}`. The planner
216
+ writes it; you can change it.
179
217
 
180
218
  - `agent=` routes the task to a Claude Code subagent. The planner picks
181
219
  by the task's SHAPE: implementation, tests, prose, a red build, a
@@ -196,8 +234,8 @@ it.
196
234
  while the project or a loaded user tier holds a different copy, and a
197
235
  `project` pin while a loaded user tier does; pin the tier the refusal
198
236
  names, or delete or rename the copy it names. `loop start` refuses a
199
- plan that names an agent it cannot resolve before any session is paid
200
- for.
237
+ plan that names an agent or a skill it cannot resolve before any
238
+ session is paid for.
201
239
  - User-tier items are invisible unless `loop.settingSources` includes
202
240
  `user`. `rafa agent list` shows what a run sees, `rafa agent vendor
203
241
  <name>` copies one in or updates it, and `rafa skill check .claude/skills
@@ -205,6 +243,25 @@ it.
205
243
  not resolve, a missing field) before it costs a task.
206
244
  - The plan format itself is a skill, `dev-planner`, shipped in the rafa
207
245
  tier and used when the project has none of its own.
246
+ - **Skills for this task.** A task may declare the skills it needs with
247
+ `skills=skill1,skill2` on its line. At dispatch, one of three resolvers
248
+ picks which skills to offer: `planner` uses the task's `skills=`
249
+ declaration exactly, in order; `tag` ignores `skills=` and ranks every
250
+ enabled skill against the task text to find the top 3 scoring above a
251
+ floor of zero; `none` offers no skills. The resolver is set by
252
+ `task.skills` in `.rafa/config.yaml` (defaulting to `planner`), and the
253
+ `--skills-resolver=` flag overrides it. A compact skill index is listed
254
+ in the planner's prompt so the planner sees what skills are available
255
+ before writing the task. When a task is dispatched, the prompt gains a
256
+ "Skills for this task" section with the skills the resolver picked, or
257
+ stays unchanged if none were picked. The dispatch record stores the
258
+ resolver name and which skills were offered.
259
+ - **Lessons from earlier tasks.** Up to 5 lessons from the learning store
260
+ are added to a task's prompt as a "Lessons from earlier tasks" section
261
+ when `task.lessons` is `on` (the default). The lessons are blessed
262
+ passages from earlier task findings that recurred or reached a
263
+ confidence floor. When neither skills nor lessons appear, the prompt
264
+ stays unchanged from before.
208
265
  - `model=`, `effort=`, `tools=` and `budget=` on a task line set the
209
266
  session's model, reasoning effort, tool list and spending cap when no
210
267
  agent decides them.
@@ -410,7 +467,7 @@ and a line here is ticked by the change that finishes the feature.
410
467
  changed since you last looked
411
468
  - ✅ The right skills reach the right task, chosen when the plan is
412
469
  written
413
- - ⬜ Know which skills earn their place and which are ignored
470
+ - ✅ Know which skills earn their place and which are ignored
414
471
  - ✅ rafa learns from its own runs: what one task works out is handed
415
472
  to the tasks that need it later
416
473
  - ⬜ Skills and lessons shared across projects and machines
@@ -360,12 +360,19 @@ The recognised keys are the `DECLARATION_KEYS` of `src/utils/declaration.ts`, wh
360
360
 
361
361
  ### `skills=` declaration
362
362
 
363
+ When a task needs help from a skill, name those skills with `skills=`. Skill names must come from the skill index provided in this prompt; naming a skill no tier holds is recorded as an issue. Names are comma-separated with no spaces.
364
+
363
365
  `skills` is a recognised key that maps to no flag: there is no CLI flag for a skill, so the names are parsed, kept on the dispatch record and stripped from the task text with the rest of the block. It stands on its own — `{skills=bun-testing}` is a declaration with no other key beside it — and a value that is not a comma-separated list of skill names is recorded as an issue rather than passed on.
364
366
 
367
+ A task with no `skills=` declaration is valid — naming none is the answer when no skill guides the task.
368
+
365
369
  ```markdown
366
370
  - [ ] Port vitest tests to bun:test {agent=build-error-resolver skills=bun-testing,vitest-migration}
371
+ - [ ] Add the Zod schema for `CreateJobRequest` with its unit tests
367
372
  ```
368
373
 
374
+ The second example above has no `skills=` and is still a valid task declaration.
375
+
369
376
  ---
370
377
 
371
378
  ## Task sizing (session economics)