Skip to content

[rig-tasks] Add 10 rig samples — 2026-08-28 - #504

Merged
pelikhan merged 1 commit into
mainfrom
rig-tasks/2026-08-28-b580b322270c1efc
Aug 29, 2026
Merged

[rig-tasks] Add 10 rig samples — 2026-08-28#504
pelikhan merged 1 commit into
mainfrom
rig-tasks/2026-08-28-b580b322270c1efc

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

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

# File Description Typecheck
1 481-git-blame-line-age-analyzer.md Git blame line age analyzer (defineTool + p.glob + s.record) pass
2 482-ts-mapped-type-extractor.md TypeScript mapped type extractor (defineTool + p.glob + steering) pass
3 483-dotenv-drift-detector.md dotenv vs process.env drift detector (p.readOptional + p.bash + s.enum) pass
4 484-vitest-snapshot-reporter.md Vitest snapshot reporter workflow (workflow + Promise.all parallel subagents) pass
5 485-git-stale-branch-reporter.md Git stale branch reporter (defineTool + execSync + repair addon) pass
6 486-ts-abstract-class-finder.md TypeScript abstract class finder (defineTool + p.glob + steering) pass
7 487-git-tag-message-extractor.md Git tag message extractor (defineTool + p.bash + s.enum) pass
8 488-parallel-dep-audit-workflow.md Parallel dep audit workflow (workflow + Promise.all concurrent agents) pass
9 489-ts-union-type-writer.md TypeScript union type writer (p.writeInput + input schema + repair) pass
10 490-json-schema-field-classifier.md JSON schema field classifier (defineTool + p.glob + s.record nested) pass

Typecheck failures

Tasks 4, 8, and 10 initially failed typecheck and were fixed before committing:

  • Tasks 4 & 8 (workflow API): WorkflowMeta requires description (not just name); workflow() does not accept an output field (type is inferred from body); call() returns T | null so Promise.all results need a type-predicate filter before reduce().
  • Task 10 (index signature): Record<string, unknown> requires bracket notation schema["properties"] — dot access triggers TS4111 noPropertyAccessFromIndexSignature.

Tasks run

  • (reused) Git blame line age analyzer
  • (reused) TypeScript mapped type extractor
  • (reused) dotenv vs process.env drift detector
  • (reused) Vitest snapshot count reporter workflow
  • (reused) Git stale branch age reporter
  • (reused) TypeScript abstract class finder
  • (new) Git tag message extractor
  • (new) Parallel dependency audit workflow
  • (new) TypeScript union type writer
  • (new) JSON schema field classifier

Generated by Daily Rig Task Generator · sonnet46 167.8 AIC · ⌖ 10.2 AIC · ⊞ 6.8K ·

- 481 git-blame-line-age-analyzer: defineTool+p.glob, s.record output
- 482 ts-mapped-type-extractor: defineTool+p.glob, steering addon
- 483 dotenv-drift-detector: p.readOptional+p.bash, s.enum classification
- 484 vitest-snapshot-reporter: workflow with Promise.all parallel subagents
- 485 git-stale-branch-reporter: defineTool with node:child_process, repair addon
- 486 ts-abstract-class-finder: defineTool+p.glob, steering addon
- 487 git-tag-message-extractor: defineTool+p.bash, s.enum classification
- 488 parallel-dep-audit-workflow: workflow with two concurrent auditor agents
- 489 ts-union-type-writer: p.writeInput, input schema, validateVariant tool
- 490 json-schema-field-classifier: defineTool+p.glob, s.record nested output

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 29, 2026 14:03
@pelikhan
pelikhan merged commit be24b1c into main Aug 29, 2026
1 check passed
@github-actions

github-actions Bot commented Aug 29, 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 /diagnosing-bugs, /codebase-design, and /grill-with-docs — requesting changes on two correctness issues and one instructions/schema mismatch.

📋 Key Themes & Highlights

Key Themes

  • Shell injection (481, 485, 487): User-supplied filePath, branch, and tag values are interpolated directly into execSync template literals. Paths with spaces or metacharacters will silently break or be exploitable. Switch to spawnSync with an argument array.
  • Incorrect per-class metrics (486): methodCount and abstractMethodCount are computed against the whole file instead of the matched class body, so any multi-class file produces wrong numbers for every class.
  • Schema/instructions mismatch (489): typeSource is declared in the output schema but omitted from the Return clause in the instructions; this teaches readers that partial instructions are fine, when in practice it causes avoidable repair turns.

Positive Highlights

  • ✅ Workflow samples (484, 488) correctly handle call() returning T | null with type-predicate filters before reduce() — good pattern to demonstrate
  • ✅ Bracket notation for Record<string, unknown> in 490 is a nice explicit fix worth keeping
  • ✅ Consistent use of s.optional for fields that may be absent (oldestFile, newestFile, etc.) is clean

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

const { execSync } = await import("node:child_process");
let output = "";
try {
output = execSync(`git blame --line-porcelain -- ${filePath}`, { encoding: "utf-8" });

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.

[/diagnosing-bugs] Shell injection risk: filePath is interpolated directly into the execSync command — a path with spaces or shell metacharacters will break or be exploited at runtime.

💡 Suggested fix

Use spawnSync with an argument array to avoid shell interpretation:

const { spawnSync } = await import("node:child_process");
const result = spawnSync("git", ["blame", "--line-porcelain", "--", filePath], { encoding: "utf-8" });
output = result.stdout;

The same pattern applies to samples 485 (branch in git log) and 487 (tag in git cat-file).

while ((m = classPattern.exec(content)) !== null) {
const name = m[1];
const methodMatches = content.match(/\b(?:public|protected|private|async)?\s+\w+\s*[(<]/g) ?? [];
const abstractMatches = content.match(abstractMethodPattern) ?? [];

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] Incorrect per-class metrics: methodCount and abstractMethodCount are counted from the entire file content, not from within each class body. If a file has multiple classes, every class gets the same (wrong) counts.

💡 Suggested fix

Slice the content between the class opening brace and its matching close brace before counting methods:

// find the index of '{' after the class declaration, then track brace depth to find the end
const start = m.index + m[0].length - 1; // index of '{'
let depth = 1, i = start + 1;
while (i < content.length && depth > 0) {
  if (content[i] === '{') depth++;
  else if (content[i] === '}') depth--;
  i++;
}
const body = content.slice(start, i);
const methodMatches = body.match(/(?:public|protected|private|async)?\s+\w+\s*[(<]/g) ?? [];
const abstractMatches = body.match(abstractMethodPattern) ?? [];

As a sample, this inaccuracy teaches readers that the pattern is correct when it isn't.

instructions: p`You are given a typeName, variants array, and outputFile path via input. For each variant in input.variants, call validateVariant to check it is a valid TypeScript identifier. Build a TypeScript union type declaration: "export type <typeName> = <variant1> | <variant2> | ...;" using only valid variants. Write the declaration to input.outputFile using ${p.writeInput("outputFile", "typeSource")}. Return outputFile, variantsWritten (valid variants), isValid (true if all variants passed), linesEmitted (line count of the declaration).`,
output: s.object({
typeSource: s.string,
outputFile: s.path,

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.

[/grill-with-docs] typeSource is in the output schema but not mentioned in the Return clause of the instructions — the LLM may omit it or produce it inconsistently, causing validation failures that trigger unnecessary repair turns.

💡 Suggested fix

Add it explicitly to the return list:

Return outputFile, typeSource (the full TypeScript declaration string), variantsWritten (valid variants only), isValid (true if all variants passed), and linesEmitted (line count).

repair() will catch it eventually, but as a teaching sample this sets a misleading precedent that incomplete instructions are fine.

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant