[rig-tasks] Add 10 rig samples — 2026-07-25 - #109
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /grill-with-docs — requesting changes on a few correctness issues.
📋 Key Themes & Highlights
Issues to fix
p.writevsp.writeOutput(samples 68, 69): both usep.write(path, staticContent)which writes a fixed placeholder, not the LLM-generated field. Replace withp.writeOutput(field, path).p.bashwith backslash regex (sample 69):'TODO\\|FIXME\\|HACK'should usep.bashRaw`...`to pass the shell command verbatim.const pshadows thepimport (sample 74): thedetectConflictshandler names a local variablep, shadowing rig's prompt-intent builder. Rename toprettier/eslint.p.globpreferred overp.bash("find ...")(samples 70, 72): rig's declarativep.glob(pattern)is the idiomatic form for workspace file discovery.- Model identifier drift: all 10 samples use
"small"but SKILL.md specifies"large","mini", or"nano"in examples; preceding samples 66–67 use"mini".
Positive Highlights
- ✅ Good variety of patterns:
defineTool, subagent delegation,steering + repairaddon composition,s.optional,s.record,p.readOptional. - ✅ Consistent
// Agent role: ...comments on every agent. - ✅ All 10 samples passed typecheck.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 66.8 AIC · ⌖ 4.65 AIC · ⊞ 6.3K
Comment /matt to run again
| const changelogGenerator = agent({ | ||
| model: "small", | ||
| instructions: p`Review ${p.bash("git diff HEAD~1 HEAD --stat")} and ${p.bash("git log HEAD~1..HEAD --oneline")} to produce a changelog entry. Classify each change by category and determine the semver bump type. Use the validateSemver tool to confirm the bump value. Write the markdown changelog to CHANGELOG.md via ${p.write("CHANGELOG.md", "<!-- changelog -->")}`, | ||
| output: s.object({ |
There was a problem hiding this comment.
[/grill-with-docs] p.write("CHANGELOG.md", "<!-- changelog -->") writes a static placeholder, not the LLM-generated markdown field — the file will always contain the literal string <!-- changelog -->.
💡 Fix: use `p.writeOutput`
Replace the write intent so the generated markdown field is persisted:
instructions: p`...via ${p.writeOutput("markdown", "CHANGELOG.md")}`,p.write(path, content) injects a static string; only p.writeOutput(field, path) writes a generated output field to disk after the run completes.
| // Agent role: scan source files for TODO/FIXME/HACK comments and produce a structured report. | ||
| const todoCommentTracker = agent({ | ||
| model: "small", | ||
| instructions: p`Scan source files using ${p.bash("grep -rn 'TODO\\|FIXME\\|HACK' --include='*.ts' . 2>/dev/null || true")} and produce a structured list of all found comments. Write a markdown report to todo-report.md via ${p.write("todo-report.md", "<!-- report -->")}`, |
There was a problem hiding this comment.
[/grill-with-docs] Two issues on this line:
-
p.write("todo-report.md", "<!-- report -->")writes a static placeholder — the generatedmarkdownfield is never persisted. Usep.writeOutput("markdown", "todo-report.md")instead. -
The backslash
\|alternation in ap.bashstring goes through TypeScript string escaping before reaching the shell. The regex may not behave as intended. Use the tagged-template formp.bashRaw`grep -rn 'TODO\|FIXME\|HACK' ...`to pass the command verbatim.
💡 Suggested fix
instructions: p`Scan source files using ${p.bashRaw`grep -rn 'TODO\|FIXME\|HACK' --include='*.ts' . 2>/dev/null || true`} and produce a structured list. Write a markdown report via ${p.writeOutput("markdown", "todo-report.md")}`,| const multiFileSummarizer = agent({ | ||
| model: "small", | ||
| instructions: p`Find TypeScript files using ${p.bash("find src -name '*.ts' -not -path '*/node_modules/*' 2>/dev/null | head -10 || echo 'no files'")} then delegate each file path to the fileSummarizer subagent and collect summaries keyed by file path.`, | ||
| output: s.record(s.string), |
There was a problem hiding this comment.
[/grill-with-docs] p.bash("find src -name '*.ts' ...") for file discovery can be replaced with p.glob("src/**/*.ts"), which is the idiomatic rig pattern (see sample 67 directly above this one).
💡 Suggested fix
instructions: p`Find TypeScript files: ${p.glob("src/**/*.ts")}. For each path delegate to fileSummarizer and collect summaries keyed by file path.`,p.glob handles the discovery as a declarative intent, keeping the instructions cleaner and consistent with the project's established style.
| const detectConflicts = defineTool("detectConflicts", { | ||
| description: "Detect rule conflicts between Prettier and ESLint configs", | ||
| parameters: s.object({ prettierConfig: s.string, eslintConfig: s.string }), | ||
| handler({ prettierConfig, eslintConfig }) { |
There was a problem hiding this comment.
[/grill-with-docs] The detectConflicts handler declares const p (line 10: const p = JSON.parse(...)) which shadows the p import from "rig" at module scope. This creates a confusing name collision in the sample — readers will associate p with rig's prompt-intent builder, not a parsed config object.
💡 Suggested fix
Rename the local variable to avoid the shadow:
const prettier = JSON.parse(prettierConfig || "{}");
const eslint = JSON.parse(eslintConfig || "{}");
if (prettier.printWidth && eslint.rules?.["max-len"]) { ... }| const tsFunctionSignatures = agent({ | ||
| model: "small", | ||
| instructions: p`Find TypeScript files using ${p.bash("find src -name '*.ts' 2>/dev/null | head -5 || echo 'no files'")} then read each file and use the parseSignatures tool to extract function signatures. Return results keyed by file path.`, | ||
| output: s.record(s.array(s.object({ |
There was a problem hiding this comment.
[/grill-with-docs] File discovery uses p.bash("find src -name '*.ts' ...") — prefer p.glob("src/**/*.ts") (the established rig pattern) over a shell find command for workspace file discovery.
💡 Suggested fix
instructions: p`Find TypeScript files: ${p.glob("src/**/*.ts")}. Read each file and use the parseSignatures tool to extract function signatures. Return results keyed by file path.`,| }); | ||
|
|
||
| // Agent role: read recent git changes and produce a structured changelog entry with semver bump classification. | ||
| const changelogGenerator = agent({ |
There was a problem hiding this comment.
[/grill-with-docs] All 10 new samples use model: "small", but the SKILL.md construction rules say to use "large", "mini", or "nano" in examples, and the two immediately preceding samples (66, 67) both use "mini". Using "small" drifts from the documented vocabulary and could confuse readers learning from these samples.
Consider updating all new samples to "mini" (or "nano" for the subagent delegates) to stay consistent with the project's example conventions.
Summary
Added 10 new rig sample files to
skills/rig/samples/.defineToolsemver validation,p.bashgit diff/log,p.write,repair()p.bashgrep, structured output withs.enumkind, writes report viap.writefileSummarizersubagent,p.readInput, coordinator aggregates intos.record(s.string)p.read,defineToolname validation,s.enumstatus,repair()p.bashfind,p.read,defineToolregex handler,s.recordoutputp.bashgit commands,s.optionallastCommitDate,s.enumaction,repair()p.readOptional,defineToolconflict detection,repair()workflowAnalyzersubagent,p.bashfind,s.recordaggregationsteering()+repair()addons,p.writeOutput,s.enumcategory.envkey cross-checker usingp.readOptionalfor both files,defineToolregex extraction,s.enumstatusTypecheck failures
None — all 10 samples passed typecheck.
Tasks run