11---
22name : Daily Rig File Summarizer
33description : >
4- Each day, runs a rig program that uses a file-summarizer subagent to summarize
4+ Each day, runs an inline rig program that uses a file-summarizer subagent to summarize
55 each TypeScript source file individually via the Copilot SDK, synthesizes a global
66 project summary, and posts the result as a GitHub issue.
77on :
@@ -30,7 +30,7 @@ safe-outputs:
3030
3131## Task
3232
33- Run the rig file summarizer program, which uses a Copilot SDK subagent to summarize
33+ Run an inline rig file- summarizer program that uses a Copilot SDK subagent to summarize
3434each TypeScript source file individually and then synthesizes a global project summary.
3535Post the result as a GitHub issue.
3636
@@ -40,16 +40,53 @@ Post the result as a GitHub issue.
4040npm install 2>&1
4141```
4242
43- ### Step 2 — Run the rig file summarizer
43+ ### Step 2 — Write the rig program
4444
4545``` bash
46- node skills/rig/rig.ts skills/rig/samples/140-file-summarizer.md 2>&1
46+ mkdir -p /tmp/gh-aw/agent && cat > /tmp/gh-aw/agent/file-summarizer.ts << 'RIGEOF '
47+ import { agent, configureAgent, copilotEngine, p, s } from "rig";
48+
49+ configureAgent(copilotEngine());
50+
51+ const FileSummary = s.object({ path: s.path, summary: s.string });
52+
53+ const summarizeFile = agent({
54+ name: "file-summarizer",
55+ model: "mini",
56+ input: { path: s.path },
57+ instructions: p`Summarize the following file in 1-2 sentences:\n${p.readInput("path")}`,
58+ output: FileSummary,
59+ });
60+
61+ const projectSummarizer = agent({
62+ name: "project-summarizer",
63+ model: "small",
64+ agents: { summarizeFile },
65+ instructions: p`
66+ List TypeScript source files (excluding node_modules and .git):
67+ ${p.bash("find . -name '*.ts' -not -path '*/node_modules/*' -not -path '*/.git/*' | sort | head -20")}
68+ Call summarizeFile for each file path, then write a concise globalSummary of the whole project.
69+ `,
70+ output: s.object({
71+ files: s.array(FileSummary),
72+ globalSummary: s.string,
73+ }),
74+ });
75+
76+ export default projectSummarizer;
77+ RIGEOF
78+ ```
79+
80+ ### Step 3 — Run the rig file summarizer
81+
82+ ``` bash
83+ node skills/rig/rig.ts /tmp/gh-aw/agent/file-summarizer.ts 2>&1
4784```
4885
4986Capture the JSON output object ` {"files":[...],"globalSummary":"..."} ` printed to stdout.
5087If the program exits with a non-zero code, emit ` noop ` with the error and stop.
5188
52- ### Step 3 — Create an issue
89+ ### Step 4 — Create an issue
5390
5491Emit a ` create-issue ` safe output with:
5592
0 commit comments