Skip to content

Commit 36db308

Browse files
kieranklaassenclaude
authored andcommitted
feat(lfg): add dogfood step and riffrec/video/screenshot input
Bring the linear /lfg skill and the lfg workflow to parity and extend both: - Add a Dogfood step to the skill, inlining ce-dogfood-beta's diff-scoped behavior (it is disable-model-invocation and can't be invoked from the pipeline), mirroring the workflow's Dogfood phase. - Accept a Riffrec bundle, video, audio, or screenshots as input and analyze it before planning, on both surfaces. - Reproduce bugs locally with synthetic, anonymized state before writing the fix. - Capture demos non-interactively via ce-demo-reel for observable changes, and emit a fixed PR template for feedback-sourced runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5b8566a commit 36db308

2 files changed

Lines changed: 57 additions & 14 deletions

File tree

  • .claude/workflows
  • plugins/compound-engineering/skills/lfg

.claude/workflows/lfg.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
export const meta = {
5454
name: 'lfg',
5555
description: 'Compounding autonomous engineering pipeline named in compound-engineering steps: Worktree, Riffrec, Research, Ideate, Plan, Doc Review, Work, Code Review, Autofix, Re-review, Simplify, Test, Dogfood, Commit & PR, Compound, Cleanup. Runs in an isolated git worktree, recalls prior learnings in and captures a durable learning out, watching CI to green.',
56-
whenToUse: 'Hands-off execution of a software task when you want the full compound-engineering loop (institutional recall in, durable learning out, CI watched to green) rather than a single linear pass. Runs in an isolated git worktree so your checkout is untouched. Pass the feature description (or a Riffrec bundle path) as args. Add { dryRun: true } to stop before Commit & PR / CI / Compound.',
56+
whenToUse: 'Hands-off execution of a software task when you want the full compound-engineering loop (institutional recall in, durable learning out, CI watched to green) rather than a single linear pass. Runs in an isolated git worktree so your checkout is untouched. Pass the feature description or a Riffrec bundle, video, audio, or screenshot path as args. Add { dryRun: true } to stop before Commit & PR / CI / Compound.',
5757
phases: [
5858
{ title: 'Worktree', detail: 'Create an isolated git worktree so the run never touches the user checkout' },
5959
{ title: 'Riffrec', detail: 'ce-riffrec-feedback-analysis — if a recording is present, find + analyze it and fold its findings into the task' },
@@ -419,7 +419,7 @@ if (wtSetup && wtSetup.created && wtSetup.path) {
419419

420420
phase('Riffrec')
421421
const riffrec = await agent(
422-
`Determine whether a Riffrec product-feedback recording is available for this task, then act.\n\nTask:\n${task}\n\nLook for a \`riffrec-*.zip\` or a bundle containing session.json + events.json + recording.webm + voice.webm — in any path named in the task, the repo root, the current directory, or ~/Downloads.\n- If you find one, invoke the ce-riffrec-feedback-analysis skill to analyze it, and return found=true, the path, and the structured product feedback (bugs, UX issues, repro steps, the user's spoken intent).\n- If none exists, return found=false and stop — do not fabricate feedback. ${NON_INTERACTIVE}`,
422+
`Determine whether product-feedback input is available for this task, then act.\n\nTask:\n${task}\n\nLook for any of these — in any path named in the task, the repo root, the current directory, or ~/Downloads:\n- a \`riffrec-*.zip\` or a bundle containing session.json + events.json + recording.webm + voice.webm;\n- a video or audio recording (.mp4 / .mov / .webm / .m4a / .mp3 / .wav);\n- one or more screenshots (image files) showing the problem.\n\n- For a Riffrec bundle, video, or audio: invoke the ce-riffrec-feedback-analysis skill on it and return found=true, the path, and the structured product feedback (bugs, UX issues, repro steps, the user's spoken intent).\n- For screenshots: view them, derive what is broken or requested, and return found=true, the path, and that as the feedback.\n- If none exists, return found=false and stop — do not fabricate feedback. ${NON_INTERACTIVE}`,
423423
{ label: 'riffrec', phase: 'Riffrec', schema: RIFFREC_SCHEMA }
424424
)
425425
const riffrecFeedback = (riffrec && riffrec.found && riffrec.feedback) ? riffrec.feedback : ''
@@ -540,7 +540,7 @@ if (planConcerns.length) log(`Doc Review raised ${planConcerns.length} non-fatal
540540

541541
phase('Work')
542542
const build = await agent(
543-
`${wt}Invoke the ce-work skill to execute the plan at ${planPath}. Implement the full feature, following the codebase's existing patterns and the conventions surfaced in research. Address these Doc Review concerns as you go:\n${JSON.stringify(planConcerns)}\n${NON_INTERACTIVE}\n\nWhen done, report whether files actually changed, a concise summary, the files touched, and which observable surfaces (web-ui / ios / cli / api / library / docs) the change affects.`,
543+
`${wt}Invoke the ce-work skill to execute the plan at ${planPath}. Implement the full feature, following the codebase's existing patterns and the conventions surfaced in research. If this is a bug fix (including any Riffrec/feedback-sourced run), reproduce the bug locally FIRST — minimal synthetic state, anonymize any production data, never commit throwaway repro data — then fix the confirmed root cause. Address these Doc Review concerns as you go:\n${JSON.stringify(planConcerns)}\n${NON_INTERACTIVE}\n\nWhen done, report whether files actually changed, a concise summary, the files touched, and which observable surfaces (web-ui / ios / cli / api / library / docs) the change affects.`,
544544
{ label: 'work', phase: 'Work', schema: BUILD_SCHEMA }
545545
)
546546
if (!build || !build.changed) {
@@ -698,6 +698,15 @@ if (DRY_RUN) {
698698
(observable
699699
? `This change has an observable surface (${surfaceList}) — also invoke the ce-demo-reel skill to capture visual/CLI proof and include its markdown in the PR body.\n\n`
700700
: '') +
701+
(riffrecFeedback
702+
? `This is a feedback-sourced run. Write the PR body from this exact template so the issue is understandable WITHOUT watching the recording:\n` +
703+
`## What the user reported\n<one or two plain-language sentences>\n> <verbatim narration excerpt from the analysis, as a Markdown block quote>\n<any "before" frames from the analysis>\n\n` +
704+
`## The problem\n<technical root cause>\n\n` +
705+
`## How we reproduced it\n<minimal local state + exact steps>\n\n` +
706+
`## The fix\n<what changed and why, kept tight>\n\n` +
707+
`## Demo\n<after evidence from ce-demo-reel proving it works>\n\n` +
708+
`## Testing\n<regression test covering this bug + other checks run>\n\n`
709+
: '') +
701710
`In the PR body, add a "## Residual Findings" section listing these unresolved items verbatim (omit the section if the list is empty):\n${JSON.stringify(residualForPr, null, 2)}\n\nReturn the PR number, URL, and branch.`,
702711
{ label: 'commit-pr', phase: 'Commit & PR', schema: SHIP_SCHEMA }
703712
)

plugins/compound-engineering/skills/lfg/SKILL.md

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
---
22
name: lfg
3-
description: Run the full autonomous engineering pipeline end-to-end (plan, work, code review, test, commit, push, open PR, watch CI, fix CI failures until green). Use only when the user explicitly requests hands-off execution of a software task and provides a feature description; do not auto-route casual conversation here.
4-
argument-hint: "[feature description]"
3+
description: Run the full autonomous engineering pipeline end-to-end (plan, work, code review, test, dogfood, commit, push, open PR, watch CI, fix CI failures until green). Use only when the user explicitly requests hands-off execution of a software task and provides a feature description, Riffrec recording, video, or screenshots; do not auto-route casual conversation here.
4+
argument-hint: "[feature description | riffrec zip | video | screenshots]"
55
---
66

77
CRITICAL: You MUST execute every step below IN ORDER. Do NOT skip any required step. Do NOT jump ahead to coding or implementation. The plan phase (step 1) MUST be completed and verified BEFORE any work begins. Violating this order produces bad output.
88

99
When invoking any skill referenced below, resolve its name against the available-skills list the host platform provides and use that exact entry. Some platforms list skills under a plugin namespace (e.g., `compound-engineering:ce-plan`); others list the bare name. Invoking a short-form guess that isn't in the list will fail — always match a listed entry verbatim before calling the Skill/Task tool.
1010

11-
1. Invoke the `ce-plan` skill with `$ARGUMENTS`.
11+
**Input resolution (do this before step 1).** `$ARGUMENTS` may be a plain feature description, a path to a Riffrec bundle (`riffrec-*.zip`, or a folder with `session.json` + `events.json` + `recording.webm` + `voice.webm`), a video/audio recording, or one or more screenshots. Resolve it into a concrete task before planning:
1212

13-
GATE: STOP. If ce-plan reported the task is non-software and cannot be processed in pipeline mode, stop the pipeline and inform the user that LFG requires software tasks. Otherwise, verify that the `ce-plan` workflow produced a plan file in `docs/plans/`. If no plan file was created, invoke `ce-plan` again with `$ARGUMENTS`. Do NOT proceed to step 2 until a written plan exists. **Record the plan file path** — it will be passed to ce-code-review in step 3.
13+
- Riffrec bundle, video, or audio: invoke the `ce-riffrec-feedback-analysis` skill on the path to extract structured product feedback — the bugs, UX issues, repro steps, and the user's spoken intent. Use that feedback as the task.
14+
- Screenshot image(s): view them and derive what is broken or requested. Use that as the task.
15+
- Plain text: use it verbatim.
16+
17+
Call the result the **resolved task**, and note whether it came from a recording, video, or screenshots — a **feedback-sourced** run, which changes the PR body in step 8. Pass the resolved task (not bare `$ARGUMENTS`) to every step below.
18+
19+
1. Invoke the `ce-plan` skill with the resolved task.
20+
21+
GATE: STOP. If ce-plan reported the task is non-software and cannot be processed in pipeline mode, stop the pipeline and inform the user that LFG requires software tasks. Otherwise, verify that the `ce-plan` workflow produced a plan file in `docs/plans/`. If no plan file was created, invoke `ce-plan` again with the resolved task. Do NOT proceed to step 2 until a written plan exists. **Record the plan file path** — it will be passed to ce-code-review in step 3.
1422

1523
2. Invoke the `ce-work` skill.
1624

25+
If the task is a bug fix (especially a feedback-sourced run), reproduce the bug locally FIRST — set up the minimal local state and trigger the failing behavior — before writing any fix, so the fix targets the confirmed root cause. Prefer building that state synthetically; only pull production data as a last resort, and always anonymize names, emails, and other PII. Do not commit throwaway repro data (e.g., to seed files) unless it has lasting value for the team.
26+
1727
GATE: STOP. Verify that implementation work was performed - files were created or modified beyond the plan. Do NOT proceed to step 3 if no code changes were made.
1828

1929
3. Invoke the `ce-code-review` skill with `mode:agent plan:<plan-path-from-step-1>`.
@@ -52,13 +62,37 @@ When invoking any skill referenced below, resolve its name against the available
5262

5363
6. Invoke the `ce-test-browser` skill with `mode:pipeline`.
5464

55-
7. Invoke the `ce-commit-push-pr` skill.
65+
7. **Dogfood the change as a real user** (ALWAYS run; do not skip)
66+
67+
`ce-dogfood-beta` is `disable-model-invocation` and cannot be invoked from this pipeline, so perform its diff-scoped dogfooding behavior directly. This is hands-on exercise of the changed journeys, distinct from the automated browser tests in step 6.
68+
69+
Determine which observable surfaces the branch diff touches (web-ui, ios, cli, api, library, docs), then exercise the CHANGED user journeys the way a real user would — not just the happy path; include bad input, edge states, and back/forward navigation:
70+
71+
- web-ui: start or attach to the running app and drive the affected pages in a real browser (e.g., agent-browser).
72+
- ios: drive the changed flows on the simulator.
73+
- cli: run the changed commands as a user would, including bad input and unusual flag combinations.
74+
- api / library: call the changed entrypoints as a consumer would, including misuse.
75+
76+
Fix any UX or behavior breakage found at its root cause, add a regression test for each fix, and re-check until the changed journeys work. Leave the fixes uncommitted in the working tree — step 8 commits and pushes them. If there is genuinely nothing runnable to exercise (e.g., a pure docs change), state that explicitly and continue.
77+
78+
8. Invoke the `ce-commit-push-pr` skill.
79+
80+
This commits any remaining changes (including dogfood fixes from step 7), pushes the branch, and opens a pull request. If step 5 already opened a PR (check with `gh pr view --json number,url,state 2>/dev/null`), skip PR creation but still commit and push any uncommitted changes.
81+
82+
For observable changes (UI, CLI output, API behavior, generated artifacts), capture a demo NON-INTERACTIVELY via the `ce-demo-reel` skill and splice its markdown into the PR body. This run is autonomous — do not wait for an interactive "capture evidence?" prompt; decide to capture for observable changes, and skip only when there is genuinely nothing runnable to show.
83+
84+
If this is a feedback-sourced run (input resolution), write the PR body from this fixed template so the issue is understandable without watching the original recording:
5685

57-
This commits any remaining changes, pushes the branch, and opens a pull request. If step 5 already opened a PR (check with `gh pr view --json number,url,state 2>/dev/null`), skip PR creation but still commit and push any uncommitted changes.
86+
- `## What the user reported` — one or two plain-language sentences, then the user's narration as a verbatim Markdown block quote (`>`), and any "before" frames from the analysis.
87+
- `## The problem` — the technical root cause.
88+
- `## How we reproduced it` — the minimal local state and exact steps.
89+
- `## The fix` — what changed and why, kept tight.
90+
- `## Demo` — the after evidence from `ce-demo-reel` proving it works.
91+
- `## Testing` — the regression test covering this bug, plus any other checks run.
5892
59-
8. **CI watch and autofix loop** (only when an open PR exists for the current branch)
93+
9. **CI watch and autofix loop** (only when an open PR exists for the current branch)
6094
61-
Detect the PR; if none exists or `gh` is unavailable, skip this step entirely and proceed to step 9.
95+
Detect the PR; if none exists or `gh` is unavailable, skip this step entirely and proceed to step 10.
6296
6397
```bash
6498
gh pr view --json number,url,state
@@ -72,7 +106,7 @@ When invoking any skill referenced below, resolve its name against the available
72106
gh pr checks --watch
73107
```
74108
75-
If the command exits 0, all checks passed. Break out of the loop and proceed to step 9.
109+
If the command exits 0, all checks passed. Break out of the loop and proceed to step 10.
76110
77111
If it exits non-zero, one or more checks failed. Continue to (2).
78112
@@ -105,8 +139,8 @@ When invoking any skill referenced below, resolve its name against the available
105139
gh pr edit PR_NUMBER --body-file BODY_FILE
106140
```
107141

108-
- Do NOT continue looping. The autopilot contract is "make residuals durable, then exit." Proceed to step 9.
142+
- Do NOT continue looping. The autopilot contract is "make residuals durable, then exit." Proceed to step 10.
109143

110-
9. Output `<promise>DONE</promise>` when complete
144+
10. Output `<promise>DONE</promise>` when complete
111145

112146
Start with step 1 now. Remember: plan FIRST, then work. Never skip the plan.

0 commit comments

Comments
 (0)