Skip to content

feat: daily agentic workflow that runs rig to summarize files and post an issue#145

Merged
pelikhan merged 7 commits into
mainfrom
copilot/create-sample-agentic-workflow
Jul 25, 2026
Merged

feat: daily agentic workflow that runs rig to summarize files and post an issue#145
pelikhan merged 7 commits into
mainfrom
copilot/create-sample-agentic-workflow

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Adds a daily agentic workflow that drives rig (Copilot SDK) to summarize TypeScript source files — first individually via a subagent, then globally — and posts the result as a GitHub issue.

Changes

  • skills/rig/samples/140-file-summarizer.md — new rig sample with two chained agents:
    • summarizeFile (mini) reads one file via p.readInput("path") and returns a 1–2 sentence summary
    • projectSummarizer (small) discovers .ts files with p.bash(...), fans out to summarizeFile per file, then synthesizes a globalSummary
const summarizeFile = agent({
  name: "file-summarizer", model: "mini",
  input: { path: s.path },
  instructions: p`Summarize the following file in 1-2 sentences:\n${p.readInput("path")}`,
  output: FileSummary,
});

const projectSummarizer = agent({
  name: "project-summarizer", model: "small",
  agents: { summarizeFile },
  instructions: p`
List TypeScript source files (excluding node_modules and .git):
${p.bash("find . -name '*.ts' -not -path '*/node_modules/*' -not -path '*/.git/*' | sort | head -20")}
Call summarizeFile for each file path, then write a concise globalSummary of the whole project.
`,
  output: s.object({ files: s.array(FileSummary), globalSummary: s.string }),
});
  • .github/workflows/daily-rig-file-summarizer.md — copilot agentic workflow (strict: true, schedule: daily) that:
    1. Runs npm install then node skills/rig/rig.ts skills/rig/samples/140-file-summarizer.md
    2. Emits a create-issue safe output with per-file summary table + global summary; closes the previous day's issue automatically via close-older-issues: true
  • .github/workflows/daily-rig-file-summarizer.lock.yml — compiled lock file (generated by gh aw compile)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot rig must use copilot-sdk

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot rig must use copilot-sdk

Added configureAgent(copilotEngine()) to the sample — the import now includes configureAgent and copilotEngine from "rig" and explicitly wires the Copilot SDK engine. Commit: fix: explicitly configure copilotEngine in sample 140.

Copilot AI requested a review from pelikhan July 25, 2026 12:55
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot

  • must configure copilot.copilot-sdk: true

…flow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot

  • must configure copilot.copilot-sdk: true...

Added features:\n copilot-sdk: true to the workflow frontmatter and recompiled. The lock file now includes GH_AW_INFO_FEATURES: '{"copilot-sdk":true}'.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot make it a single file - all in the markdown of the AW.

Review copilot-sdk frontmatter syntax

…ate sample

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot make it a single file - all in the markdown of the AW.

Review copilot-sdk frontmatter syntax

Done. The rig program is now embedded directly in .github/workflows/daily-rig-file-summarizer.md as a bash heredoc (cat > /tmp/gh-aw/agent/file-summarizer.ts << 'RIGEOF' ... RIGEOF), eliminating the separate skills/rig/samples/140-file-summarizer.md file.

Regarding frontmatter syntax: features:\n copilot-sdk: true is confirmed correct — it compiles to GH_AW_INFO_FEATURES: '{"copilot-sdk":true}' in the lock file. Lock regenerated with gh aw compile — 0 errors, 0 warnings.

Commit: refactor: consolidate rig program inline in AW markdown; remove separate sample

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot add a reference to the rig skill in the frontmatter and remove the details, just use a core region with the "rig" language to enable it

… block

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add a reference to the rig skill in the frontmatter and remove the details, just use a core region with the "rig" language to enable it

Done. The workflow now:

  1. References the rig skill in the frontmatter: skills: - githubnext/rig/skills/rig/SKILL.md@<sha>
  2. Replaces the verbose heredoc + run steps with a single rig code block containing the TypeScript program

The agent loads the rig SKILL.md as context, runs npm install, then executes the rig block directly. Lock recompiled — 0 errors, 0 warnings.

Commit: feat: add rig skill ref to frontmatter, replace heredoc with rig code block

Copilot AI requested a review from pelikhan July 25, 2026 13:25
Comment on lines +35 to +40
Install dependencies, run the rig program below, and post a `create-issue` safe output
with the results.

```bash
npm install 2>&1
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot not needed , instead say "Run this rig"

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.

Replaced the verbose instruction block and npm install bash step with "Run this rig". Lock file recompiled — 0 errors, 0 warnings.

Comment on lines +14 to +16
engine: copilot
features:
copilot-sdk: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot copilot-sdk is a child field of engine

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.

Moved copilot-sdk: true to a child field of engine: — now engine:\n id: copilot\n copilot-sdk: true. Lock recompiled — 0 errors (1 expected experimental-feature warning).

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review July 25, 2026 14:10
@pelikhan
pelikhan merged commit 86e4423 into main Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants