Skip to content

[rig-tasks] Add 10 rig samples — 2026-07-28 - #261

Merged
pelikhan merged 1 commit into
mainfrom
rig-tasks/2026-07-28-0c83c8cc6e3bf4cb
Jul 28, 2026
Merged

[rig-tasks] Add 10 rig samples — 2026-07-28#261
pelikhan merged 1 commit into
mainfrom
rig-tasks/2026-07-28-0c83c8cc6e3bf4cb

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Added 10 new rig sample files to skills/rig/samples/.

# File Description Typecheck
1 280-commit-churn-classifier.md Classify files by git commit churn frequency; steering addon; s.record output pass
2 281-npm-package-size-estimator.md Estimate NPM package size via npm pack --dry-run; defineTool classifySize pass
3 282-ts-branch-coverage-analyzer.md TypeScript branch coverage with subagent delegation; p.readInput pass
4 283-env-variable-type-inferrer.md Infer env var types from .env.example via p.readOptional + defineTool pass
5 284-makefile-target-extractor.md Extract phony/real Makefile targets; defineTool + repair addon pass
6 285-test-fixture-generator.md Generate test fixtures via signatureAnalyzer subagent + p.writeOutput pass
7 286-toml-config-analyzer.md Analyze TOML configs via p.glob + async defineTool + node:fs/promises pass
8 287-git-checkpoint-summarizer.md Summarize git stashes and recent commits; defineTool classifyCheckpoint pass
9 288-ts-literal-union-extractor.md Extract string literal union types via async defineTool + steering pass
10 289-markdown-heading-validator.md Validate markdown heading structure via p.glob + async defineTool + repair pass

Typecheck failures

No failures — all 10 programs passed typecheck.

Tasks run

  • (reused) Commit churn classifier
  • (reused) NPM package size estimator
  • (reused) TypeScript branch coverage analyzer
  • (reused) Env variable type inferrer
  • (reused) Makefile target extractor
  • (reused) Test fixture generator
  • (new) TOML config section analyzer
  • (new) Git checkpoint summarizer
  • (new) TypeScript literal type union extractor
  • (new) Markdown heading structure validator

Generated by Daily Rig Task Generator · sonnet46 102.7 AIC · ⌖ 9.24 AIC · ⊞ 6.7K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 28, 2026 20:25
@pelikhan
pelikhan merged commit d74646f into main Jul 28, 2026
1 check passed
@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design — requesting changes on two correctness issues in subagent wiring.

📋 Key Themes & Highlights

Key Issues

  • Subagents missing p.readInput (282, 285): Both the branchAnalyzer (282) and signatureAnalyzer (285) declare an input: schema with a file path but their instructions never call p.readInput() to inject the file content. This is a correctness bug — the subagents will operate without seeing the source file.
  • p.bash for file discovery (288): Uses find shell command where p.glob("**/*.ts") is the idiomatic rig intent — inconsistent with 286 and 289 in the same PR.
  • Steering duplicates instructions (280): Threshold rules appear in both steering message and instructions body; single-source-of-truth risk.
  • Hardcoded fixture.ts output path (285): p.writeOutput writes every fixture to the same filename regardless of the functionName input.

Positive Highlights

  • ✅ Good variety of patterns across the 10 samples: s.record, defineTool, subagent delegation, repair, steering, async tool handlers
  • ✅ Consistent use of p.readOptional with fallback strings in 283, 284
  • ✅ Solid defineTool implementations in 283 (type inferrer), 284 (Makefile parser), 287 (checkpoint classifier) — pure functions that are easy to reason about
  • ✅ 286 and 289 correctly use p.glob for workspace file discovery

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 53.9 AIC · ⌖ 4.56 AIC · ⊞ 6.3K
Comment /matt to run again

// Agent role: extract all branch points from the provided TypeScript source code.
const branchAnalyzer = agent({
model: "small",
instructions: p`Analyze the TypeScript source code provided in the input and list every branch point (if/ternary/switch/nullish coalescing). For each branch, identify the enclosing function name, line number, branch type, and whether it appears covered (has a test or usage path). Return an array of branch objects.`,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] The branchAnalyzer subagent declares input: s.object({ filePath: s.path }) but its instructions never call p.readInput("filePath") — the model never sees the source to analyze.

💡 Fix

Follow the existing pattern from sample 159 (ts-branch-coverage.md) — add p.readInput to the subagent's instructions:

instructions: p`Analyze the TypeScript source code:

${p.readInput("filePath")}

For each branch...`,

Without this the subagent receives no file content; its covered flags will be unreliable.

// Agent role: analyze a function signature and return its parameters and return type.
const signatureAnalyzer = agent({
model: "small",
instructions: p`Analyze the TypeScript source provided in the input. Extract the signature details for the specified function: its parameters (name and type), return type, and any JSDoc description. Return structured signature details.`,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] The signatureAnalyzer subagent declares input: s.object({ sourceFile: s.path, functionName: s.string }) but its instructions don't inject the file content with p.readInput("sourceFile") — the model analyzes nothing.

💡 Fix

The subagent needs to read the file to extract the signature:

instructions: p`Analyze the TypeScript source:

${p.readInput("sourceFile")}

Extract the signature of the function named in the input...`,

The parent agent already reads the source at line 26, but the subagent doesn't — it will produce hallucinated signatures.

instructions: p`Extract string literal union type declarations from all TypeScript source files.

TypeScript files:
${p.bash("find . -name '*.ts' -not -path '*/node_modules/*' -not -path '*/.git/*' 2>/dev/null | head -40")}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] Uses p.bash("find . -name '*.ts' ...") when p.glob("**/*.ts") is the idiomatic rig intent for file listing — p.glob is declarative, handled by the harness, and doesn't hardcode shell syntax.

💡 Fix
TypeScript files:
${p.glob("**/*.ts")}

This is consistent with samples 286 and 289 which both use p.glob. Using p.bash for discovery also processes node_modules exclusion in shell, whereas p.glob respects workspace defaults.

// Agent role: classify repository files by commit churn frequency and assign a risk level.
const commitChurnClassifier = agent({
model: "small",
addons: steering({ message: "Be precise: assign riskLevel based on churnCount: >20=critical, >10=volatile, >5=active, else stable." }),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] The steering message duplicates the classification thresholds that are already spelled out in instructions. If the thresholds ever change, they'd need to be updated in two places.

💡 Suggestion

Either remove the steering addon and rely on the clear rules in instructions, or keep only the steering message and shorten the instructions. Compare sample 113 (git-hotspot-analyzer.md) where steering is used for emphasis, not duplication.

If the steering is genuinely needed to keep the LLM on-spec, consider combining repair with a single concise steering message that doesn't restate the full threshold table.


1. Delegate to signatureAnalyzer to get the function signature for the function named in the input.
2. Using the signature, generate fixture code: example inputs, mock helpers, and a vitest describe block.
3. Write the fixture code to fixture.ts: ${p.writeOutput("fixtureCode", "fixture.ts")}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/codebase-design] p.writeOutput("fixtureCode", "fixture.ts") writes a hardcoded filename fixture.ts, ignoring the input functionName. Every call will overwrite the same file, making the agent unusable for generating fixtures for multiple functions.

💡 Suggestion

Use a dynamic path or make suggestedFileName the write target. Since p.writeOutput requires a literal path at definition time, document that the caller should provide the output path via input, or hardcode a pattern like {functionName}.fixture.ts in the suggested filename and let the caller move the file.

Alternatively, remove p.writeOutput and rely solely on the fixtureCode string output — the suggestedFileName field already conveys where to write it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant