Commit Graph
7 Commits
Author SHA1 Message Date
Gordon LamandCopilot d47a6c93b7 Add copilot-pr-autopilot skill (#1944)
* Add copilot-pr-autopilot skill

Skill that drives any GitHub pull request through repeated rounds of
Copilot Code Review until the agent has either resolved every thread
or explicitly escalated it to the human. Triggered via GraphQL (no
@copilot mention needed), triages every open thread with a fix /
decline / escalate rubric, replies and resolves each thread citing
the pushed SHA, then re-triggers until HEAD is reviewed with zero
threads awaiting the agent's reply.

Includes step scripts (01 request-review, 02 check-review-status,
03 list-open-threads, 08 reply-and-resolve, 10 cleanup-outdated),
shared library (_lib.ps1) with gh-CLI wrappers (Invoke-Gh,
Invoke-GhGraphQL, ConvertFrom-GhJson, Assert-GhReady), reply
templates, and reference docs for each step.

Repo-agnostic. Requires gh CLI on PATH and repo Triage/Write for
full autopilot; external PR authors get single-iteration mode with
manual re-trigger via the UI re-request button or a substantive
push.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review: split per-step references + add recap-gate circuit breaker

- Fix #1: give steps 1/7/10 their own reference files
  (01-request-review.md, 07-commit-push.md, 10-cleanup.md); trim the
  inline bodies out of orchestration.md so it stays cross-cutting only.
- Fix #3: add a recurring round-cap & recap gate to 09-convergence.md —
  default STOP every 10th round, recap all prior rounds, detect drift
  (out-of-scope / over-engineering / wrong-direction / belongs-in-separate-PR)
  with CONTINUE / REVERT-AND-SHIP / HAND-OFF verdicts. Agent reasoning,
  no new script.
- Surface the gate from SKILL.md and orchestration.md; regenerate
  docs/README.skills.md. Markdown-only change; scripts unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(copilot-pr-autopilot): surface recap gate in decision pseudo-code; clarify Copilot+human convergence and round definition

- Inject the round-cap recap gate into the '## Decision: loop back or exit'
  pseudo-code else-branch so an agent following the code block (not just the
  prose) runs the STOP-every-10th-round check before looping.
- Broaden the 'never terminal' paragraph: non-convergence is driven by a
  Copilot finding OR a human review comment (this skill handles both); the
  loop ends only when there are no new comments from either source AND every
  open thread (Copilot or human) has an agent reply/escalation.
- Define a 'round' explicitly as one execution of step 1 (01-request-review),
  i.e. one Copilot-review trigger — the cap counts review rounds, not tool
  calls or fix edits.

Markdown-only; no script changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* copilot-pr-autopilot: make recap-gate round count deterministic

Add 09-review-round.ps1: counts Copilot Code Review submissions straight
from the PR's API history (full GraphQL pagination), so the recap-gate
trigger is a derived number, not a fallible agent mental tally. This
removes the exact failure mode the skill exists to survive — a count
drifting across a long run (the real 156-round case).

The script reports Round + RecapDue (Round % RecapInterval == 0) only;
it never stops the loop or picks the verdict. CONTINUE / REVERT-AND-SHIP
/ HAND-OFF stays agent reasoning. 09-convergence.md updated to reference
the deterministic count while preserving 'no script stops the loop' and
'non-convergence = Copilot finding OR human comment'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Regenerate docs/README.skills.md for copilot-pr-autopilot (add 09-review-round.ps1)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-01 11:09:58 +10:00
Gordon LamandCopilot 5c0a993189 feat: add hooks authoring instruction 🤖🤖🤖 (#1507)
* feat: add hooks authoring instruction

Add hooks.instructions.md with portable guidance for writing GitHub Copilot hooks:
- Folder structure, config schema, and all field documentation
- Script contract: stdin JSON, exit codes, stdout/stderr channels
- Payload schemas for all common events (sessionStart, sessionEnd, userPromptSubmitted, preToolUse, postToolUse, errorOccurred, agentStop)
- Per-event deny mechanisms (structured JSON for preToolUse, non-zero exit for others)
- Matcher support for host-level tool filtering
- Three impactful examples: commit gate, auto-format, dangerous command blocker
- Bash and PowerShell templates
- Cross-platform guidance (Python through both entries)
- Anti-patterns, design rules, and portability notes (GitHub Copilot vs Claude Code)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address PR review comments

- Document both toolArgs (JSON string) and tool_input/toolInput (object) variants with defensive parsing
- Update sessionStart stdout to reflect additionalContext injection support
- Document preToolUse stdout output fields: modifiedArgs/updatedInput, additionalContext
- Add matcher field note about local verification
- Remove undocumented notification event from event table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address round 2 review comments

- Defensive toolArgs parsing in all 3 example scripts (handle toolArgs string, tool_input, toolInput)
- PowerShell type check: test -is [string] before ConvertFrom-Json, init to null
- commit-gate.sh: add package.json existence guard before jq
- block-dangerous.sh: truncate command in deny reason and stderr to avoid leaking secrets
- Consistent defensive parsing helper across all Bash examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: handle toolArgs as string or object in jq, fix short_cmd scoping

- All 3 Bash example jq blocks now check toolArgs type before fromjson
- short_cmd defined before the deny/log branch to avoid set -u error
- Consistent defensive pattern across commit-gate, format-on-save, block-dangerous

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove accidentally committed agency.toml

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: expand Portability Note into CLI vs VS Code vs Cloud Agent section

Address Aaron's review: replace the thin portability bullet points with
a concrete comparison table covering what is the same (config schema,
event name casing, fields) and what differs (hook loading, shell
environment, tool argument field names). Add a 'How to write portable
hooks' checklist. Separate Claude Code into its own subsection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: simplify to toolArgs-only parsing, clean portability section

- toolArgs is the documented contract — remove tool_input/toolInput defensive
  fallbacks from all examples and the Script Contract template
- Simplify portability section: same config everywhere, one-line note about
  cloud agent requiring default branch
- All 3 example scripts now use simple toolArgs pipe parsing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 10:03:51 +10:00
Gordon LamandCopilot ae2c51d9cc fix: improve security-review skill discovery (#1515)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-29 12:15:27 +10:00
8eed96741f Improve agent skills instructions with quality authoring patterns (#1232)
* Improve agent skills instructions with quality authoring patterns

Add practical, platform-agnostic authoring guidance to
agent-skills.instructions.md based on community best practices:

- Expand applyTo to cover all skills/**/SKILL.md paths
- Add writing guidance for every recommended body section with examples
  (When to Use, Prerequisites, Step-by-Step Workflows, Gotchas,
  Troubleshooting, References)
- Add 'Writing High-Impact Skills' section with 5 principles:
  - Focus on what the agent doesn't know
  - Context budget awareness for descriptions
  - Gotchas as highest-signal content
  - Flexible guidelines over rigid steps
  - Progressive disclosure for large skills
- Fix description constraints: add 10-char minimum, single-quote wrapping
- Reconcile Step-by-Step Workflows with Flexible Guidelines advice
- Consolidate Workflow Execution Pattern under Common Patterns
- Standardize terminology (agent vs AI agent)
- Align line thresholds (200 soft / 500 hard)
- Update validation checklist with new quality criteria

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update instructions/agent-skills.instructions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address PR review: make instructions platform-agnostic

- Replace 'GitHub Copilot'-specific language with generic 'the agent'
- Add skills/<skill-name>/ to Directory Structure table for repo layouts
- Fix relative path in flexible guidelines example (./references/)
- Update description and intro to be platform-neutral

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert terminology changes per reviewer feedback

Restore 'Copilot' and 'AI agent' terminology to match
the original doc's conventions. Keep new substantive content
(Writing High-Impact Skills, Gotchas, expanded examples).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Aaron Powell <me@aaron-powell.com>
2026-04-09 15:27:02 +10:00
Gordon LamandCopilot f91c1a5b4b feat: add winmd-api-search skill for Windows desktop API discovery (#860)
* feat: add winmd-api-search skill for Windows desktop API discovery

Add a skill that helps find and explore Windows desktop APIs (WinRT/WinAppSDK).
It searches a local WinMD metadata cache to discover APIs for platform capabilities
like camera, file access, notifications, UI controls, AI/ML, sensors, and networking.

Includes bundled scripts:
- Update-WinMdCache.ps1: generates the JSON cache from SDK and NuGet packages
- Invoke-WinMdQuery.ps1: searches types, members, enums, and namespaces
- cache-generator: .NET tool that parses WinMD files into JSON

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: sync winmd-api-search with latest upstream changes

Updates from PowerToys source branch:
- Detect installed WinAppSDK runtime via Get-AppxPackage
- Respect NUGET_PACKAGES env var for global packages path
- Use OS architecture for runtime package detection
- Fix method/event visibility to use MemberAccessMask equality
- Fix EnumerationOptions, TypeSpecification decoding, search sort
- Robust scan with case-insensitive dedup and multi-path search
- Deduplicate packages by (Id, Version)
- Fix assets.json selection and pin SRM version
- Fix SDK version sorting and global namespace handling

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove en-us locale from Microsoft Learn URLs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: filter assets.json by package type; unique scan-mode manifests

- Filter assets.json libraries by type==package to skip project references
- Append short path hash to manifest names in scan mode to avoid collisions
- Support prefix match in query script for scan-mode manifest names

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 09:37:13 +11:00
Gordon LamandCopilot 35a690f28e Update instructions/prompt.instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-08 18:02:10 +08:00
Gordon LamandCopilot fc16945701 Update instructions/prompt.instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-08 18:02:02 +08:00