[rig-tasks] Add 10 rig samples — 2026-08-21 - #466
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 /diagnosing-bugs, /codebase-design, and /grill-with-docs — requesting changes on correctness issues in the tool handler logic.
📋 Key Themes & Highlights
Bugs (correctness issues)
- 448:
lstatnever throws on the symlink itself, so broken links are never detected. Replace withstatwhich follows the link target. - 449: The
"other"category is dead code — the conditional that assigns it can never be true given the regex structure. - 445:
targetDirinput is declared but thep.bashcommand ignores it entirely, always scanning..
Style / maintainability
- 441: Arrow-function parameter
sshadows thesschema import; rename tosh. - 441: Two separate
import ... from "rig"lines — consolidate per project convention.
Positive Highlights
- ✅ Diverse, well-structured samples covering glob, bash, node:zlib, node:crypto, workflows, and steering/repair addons.
- ✅
Promise.allcorrectly used for parallel agent calls in sample 444. - ✅ Null-coalescing on
call()results handled properly throughout.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 45.8 AIC · ⌖ 4.5 AIC · ⊞ 6.3K
Comment /matt to run again
| const hasShebang = firstLine.startsWith("#!"); | ||
| const shebangLine = hasShebang ? firstLine : undefined; | ||
| const standardShebangs = ["/bin/sh", "/bin/bash", "/usr/bin/env bash", "/usr/bin/env sh"]; | ||
| const isStandard = hasShebang && standardShebangs.some(s => firstLine.includes(s)); |
There was a problem hiding this comment.
[/codebase-design] The arrow-function parameter s shadows the s schema import from "rig". This doesn't break runtime behaviour but defeats IntelliSense inside the callback and will confuse readers.
💡 Suggested fix
Rename the parameter to avoid the collision:
const isStandard = hasShebang && standardShebangs.some(sh => firstLine.includes(sh));| @@ -0,0 +1,43 @@ | |||
| # 441 - Shell Shebang Glob Validator | |||
|
|
|||
| ```rig | |||
There was a problem hiding this comment.
[/codebase-design] Two separate imports from "rig" — consolidate them. The project convention (per AGENTS.md) is a single import from the rig alias.
💡 Suggested fix
import { agent, p, s, defineTool, repair } from "rig";| model: "small", | ||
| input: s.object({ targetDir: s.string }), | ||
| instructions: p`List files in the target directory: ${p.bash("find . -type f -size +0c")}. | ||
| For each file, call measureCompressionRatio to measure how compressible it is. |
There was a problem hiding this comment.
[/grill-with-docs] The agent declares input: s.object({ targetDir: s.string }) but the p.bash call hardcodes find . -type f, completely ignoring the input. This makes targetDir a dead field that misleads users of the sample.
💡 Suggested fix
Either use the input in the bash command via p.readInput, or remove the input field:
instructions: p`List files in the target directory: ${p.bash("find ${p.readInput('targetDir')} -type f -size +0c")}`,Or drop the input declaration entirely and always scan the current directory.
| const target = await readlink(linkPath); | ||
| const isRelative = !target.startsWith("/"); | ||
| let status: "valid" | "broken" | "relative"; | ||
| try { |
There was a problem hiding this comment.
[/diagnosing-bugs] The broken-link detection is incorrect. lstat(linkPath) does not follow symlinks — it always succeeds on the symlink file itself, so the catch branch for "broken" is never reached.
💡 Suggested fix
Use stat (which follows the link) to detect broken symlinks:
import { lstat, readlink, stat } from "node:fs/promises";
const target = await readlink(linkPath);
const isRelative = !target.startsWith("/");
let status: "valid" | "broken" | "relative";
try {
await stat(linkPath); // follows the link; throws if broken
status = isRelative ? "relative" : "valid";
} catch {
status = "broken";
}| typeMatch ? typeMatch[1] as "feat" | "fix" | "chore" | "docs" | "style" | "refactor" | "test" | ||
| : isValid ? "other" | ||
| : "invalid"; | ||
| const issue = isValid ? undefined : "Does not match conventional commit format: type(scope): description"; |
There was a problem hiding this comment.
[/diagnosing-bugs] Dead code: the isValid ? "other" branch is unreachable. isValid requires matching conventionalPattern, which already requires a valid type prefix — so typeMatch is always truthy when isValid is true. The "other" category is therefore never assigned.
💡 Analysis
conventionalPattern = /^(feat|fix|chore|docs|style|refactor|test)(...)?: .+/
A subject matching this regex always matches the inner type group, so typeMatch is non-null whenever isValid is true. Rewrite the guard to reflect the actual intent:
const category = typeMatch
? (typeMatch[1] as ...)
: "invalid";Or add a distinct "other" pattern if you genuinely want to represent non-conventional but syntactically valid messages.
Summary
Added 10 new rig sample files to
skills/rig/samples/.Typecheck failures
Tasks 4 and 9 required fixes before passing:
WorkflowMetarequires adescriptionfield (not justname).parallel()uses a homogeneous generic type, so mixed-type parallel agent calls must usePromise.allinstead.call()requires a second input argument even for agents with no declared input schema.WorkflowMeta.descriptionissue.call()returnsT | null, requiring null-coalescing before destructuring.call()second argument required.Tasks run