Skip to content

Commit 31d2dbd

Browse files
Copilotpelikhan
andauthored
refactor: consolidate rig program inline in AW markdown; remove separate sample
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
1 parent 70603c6 commit 31d2dbd

3 files changed

Lines changed: 45 additions & 44 deletions

File tree

.github/workflows/daily-rig-file-summarizer.lock.yml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-rig-file-summarizer.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Daily Rig File Summarizer
33
description: >
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.
77
on:
@@ -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
3434
each TypeScript source file individually and then synthesizes a global project summary.
3535
Post the result as a GitHub issue.
3636

@@ -40,16 +40,53 @@ Post the result as a GitHub issue.
4040
npm 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

4986
Capture the JSON output object `{"files":[...],"globalSummary":"..."}` printed to stdout.
5087
If 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

5491
Emit a `create-issue` safe output with:
5592

skills/rig/samples/140-file-summarizer.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)