[rig-tasks] Add 10 rig samples — 2026-08-23 - #475
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 and /codebase-design — no blocking issues, but there are recurring patterns worth addressing.
📋 Key Themes
Key Themes
- Unused input fields (455, 456):
targetDiris declared ininputbut the instructions hardcodefind ./p.glob("**/*"). Readers will copy this pattern and be confused when the input value has no effect. - Naming mismatch (454):
parallel-multi-tool-workflowperforms sequentialawaitcalls, not parallel ones. The PR description explains this was a fix for a type error, but the name wasn't updated. - Unbounded glob (456):
p.glob("**/*")with no depth limit or exclusion patterns is risky in real workspaces (node_modules, .git, large binaries). 455 already usesfindwith-maxdepth 3— 456 should follow suit. - Heuristic caveat missing (453): The ternary regex
/?[^:]+:/gfalse-positives on TypeScript type annotations. Fine for a sample, but a brief comment would set expectations.
Positive Highlights
- ✅
repair()addon consistently used on all agents that parse structured output - ✅
node:import prefix used throughout - ✅ Good variety of patterns:
p.bash,p.glob,p.readInput,steering, workflow phases - ✅ Typecheck failures caught and fixed before commit
- ✅ 458
resolveSymlinkhas a clean broken-link guard with.catch()
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 41.6 AIC · ⌖ 4.55 AIC · ⊞ 6.3K
Comment /matt to run again
| const zlibCompressionAnalyzer = agent({ | ||
| model: "small", | ||
| input: s.object({ targetDir: s.string }), | ||
| instructions: p`List files to analyze using: ${p.bash("find . -maxdepth 3 -type f -not -path './.git/*' | head -30")}. Call measureCompressionRatio for each file path. Return the full analysis.`, |
There was a problem hiding this comment.
[/grill-with-docs] targetDir is declared in input but never used — the instruction hardcodes find . regardless. This makes the input a no-op, misleading readers who use this as a pattern.
💡 Suggested fix
Either remove the targetDir input field and document that the agent scans from cwd, or thread it into the command with p.readInput("targetDir").
|
|
||
| // Agent role: Compute cryptographic hashes for all files in targetDir. | ||
| const fileCryptoHashReporter = agent({ | ||
| model: "small", |
There was a problem hiding this comment.
[/grill-with-docs] Same issue as 455: targetDir and algorithm are declared in input but p.glob("**/*") ignores targetDir, and the instruction says to use algorithm from input but it is only passed via prompt text — the LLM may not reliably forward it to the tool.
💡 Suggested fix
For targetDir: scope the glob to p.readInput("targetDir") or remove the input field. For algorithm: since tool parameter defaults handle it, either remove it from input or wire it explicitly with p.readInput("algorithm").
| const parallelMultiToolWorkflow = workflow({ | ||
| meta: { name: "parallel-multi-tool-workflow", description: "Run file count and env health agents and combine results" }, | ||
| body: async ({ call, phase }) => { | ||
| phase("Gather"); |
There was a problem hiding this comment.
[/codebase-design] The name parallelMultiToolWorkflow and file name 454-parallel-multi-tool-workflow imply parallel execution, but both call() invocations are sequential await — there is no parallelism. This is a naming/expectation mismatch that could confuse readers looking for a parallel pattern.
💡 Suggested fix
Either rename to 454-sequential-multi-agent-workflow, or if parallel execution is desired, check whether Promise.all([call(...), call(...)]) is supported by the runtime for concurrent agent calls.
| parameters: s.object({ filePath: s.path, algorithm: s.optional(s.string) }), | ||
| handler: async ({ filePath, algorithm = "sha256" }: { filePath: string; algorithm?: string }) => { | ||
| const buf = await readFile(filePath); | ||
| const hash = createHash(algorithm).update(buf).digest("hex"); |
There was a problem hiding this comment.
[/grill-with-docs] p.glob("**/*") will match all files including binaries, node_modules, .git objects, etc. Without a maxdepth or exclusion, this risks flooding the LLM with thousands of paths and potentially hashing very large binary files.
💡 Suggested fix
Bound the glob or use a bash command with exclusions, similar to 455:
instructions: p`Find files to hash: ${p.bash("find . -maxdepth 3 -type f -not -path './.git/*' -not -path './node_modules/*' | head -30")}`,| parameters: s.object({ filePath: s.path }), | ||
| handler: async ({ filePath }: { filePath: string }) => { | ||
| const content = await readFile(filePath, "utf8"); | ||
| const nestedBraces = (content.match(/\{[^{}]*\{/g) ?? []).length; |
There was a problem hiding this comment.
[/grill-with-docs] The regex /?[^:]+:/g for ternary detection will false-positive on object literals, type annotations, and template strings — common in TypeScript. The scoring formula thus systematically over-counts complexity in type-heavy files.
💡 Suggested fix
This is a sample, so perfect accuracy isn't required, but a brief comment acknowledging the limitation would help readers calibrate expectations:
// Heuristic only — type annotations and object literals may inflate ternary count
const ternaries = (content.match(/\?[^:]+:/g) ?? []).length;
Summary
Added 10 new rig sample files to
skills/rig/samples/.Typecheck failures
Task 4 — Parallel multi-tool workflow (fixed before commit)
Initial generation imported
call/parallelfrom"rig"(not valid — these are workflow body params). Also usedparallel()with heterogeneous agent output types (not supported). Fixed by switching to sequentialawait call(...)calls. Also requiredmeta.descriptionwhich was missing.Task 9 — XML attribute extractor (fixed before commit)
Declared an unused
tagPatternregex variable (TS6133). Fixed by removing the dead variable.Tasks run