Skip to content

feat: expose auth's roles as GitHub Copilot custom agents - #3

Merged
aditeyabaral merged 4 commits into
pesu-dev:mainfrom
aditeyabaral:feat/copilot-custom-agents
Sep 26, 2026
Merged

aditeyabaral merged 4 commits into
pesu-dev:mainfrom
aditeyabaral:feat/copilot-custom-agents

Conversation

@aditeyabaral

@aditeyabaral aditeyabaral commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Why

GitHub Copilot, on GitHub.com and in VS Code, lists custom agents only from real
.github/agents/<name>.agent.md files on a repo's default branch. GitHub does not read files
through a submodule, so auth's ten roles in this repo never show up in Copilot's agent picker.

What

  • .github/agents/ becomes the one tool-specific path in project repos (README: "Roles as
    Copilot custom agents"). A project keeps a thin wrapper per role there: the role's frontmatter,
    copied verbatim, and a short body telling the agent to read the role file here, which stays the
    only definition. The wrappers are generated and drift-checked in the project repo, so this
    repo still has no scripts and nothing generated.

  • tools on the four read-only roles (planner, reviewer, security-auditor,
    incident-investigator): ["read", "search", "execute", "github/*"], using Copilot's aliases.
    Their custom agents get no edit tools; the shell stays, because they run tests, git diff and
    curl /metrics. The README says plainly that this is not a sandbox. Other tools ignore the field.

  • auth docs: AGENTS.md (the "never edit" rule, the repo map and the roles section),
    autonomous-workflow ("Using roles"), ci-cd (the pre-commit row, and a new copilot-setup-steps.yml
    row), and fix-ci (a row for a failing sync-agents check, which is what a Dependabot bump that
    changes a role will hit).

  • The fork-only policy, applied to the new moving parts:

    • A Dependabot bump that changes a role's frontmatter fails sync-agents, and nobody but a
      maintainer can push to Dependabot's branch. ci-cd.md ("Dependabot submodule bumps") gives
      both routes (a maintainer pushes the regenerated agents, or anyone supersedes the PR from a
      fork). fix-ci and the README point at it, and the README tells skills contributors when to
      expect it.
    • Copilot's cloud agent opens its PR from a branch in the repo it runs in, which source.yaml
      rejects in pesu-dev/auth. autonomous-workflow.md says to run it on a fork, and that its
      default firewall blocks PESU Academy, so its test runs are partial. AGENTS.md points there.
  • Reference docs: architecture, conventions (mdformat-frontmatter), testing, security (no
    TEST_* in the copilot environment, plus a security-review check for it), update-dependencies
    (copilot-setup-steps.yml pins Python too), navigate-codebase, and common/AGENTS.md
    (generated files are not hand-edited either).

  • Profile logging is deliberate: pesu-auth logs the scraped profile and the auth result at INFO
    so a login can be traced. security.md, conventions.md, the security-review checklist and
    known-issues.md called that a defect; they now describe it as a design choice, and AGENTS.md's
    logging rule says so. The CSRF-token entry stays in known-issues.

Follow-up

The pesu-dev/auth side is ready locally: scripts/sync_agents.py with tests, the ten wrappers, the
sync-agents hook, submodules: true on the pre-commit checkout, and copilot-setup-steps.yml. It
was verified against this branch: pre-commit is green, including the full test suite with live
tests, and editing a role's description makes --check fail. I'll open it once this merges, pinned
to the merge commit.

Checks

uvx pre-commit run --all-files passes locally, and mdformat keeps the new tools lines intact.

🤖 Generated with Claude Code

Copilot lists custom agents only from real .github/agents/<name>.agent.md files on a repo's default
branch, and GitHub does not read files through a submodule, so the roles here were invisible to it.
Projects now keep generated wrappers there (frontmatter copied from the role, body pointing at the
role file), which leaves the role file as the only definition. The generator and its drift check
live in the project repo, so this repo still has nothing generated in it.

The four read-only roles gain a `tools` list in Copilot's aliases, so their custom agents get no
edit tools. Other tools ignore the field.

The README, auth's AGENTS.md, autonomous-workflow, ci-cd and fix-ci describe the wrappers, the
sync-agents check and copilot-setup-steps.yml, which land in pesu-dev/auth with the submodule bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aditeyabaral
aditeyabaral requested a review from a team as a code owner September 26, 2026 02:44
aditeyabaral and others added 3 commits September 25, 2026 21:48
The first commit updated the entry points; these are the reference docs that also describe files,
hooks and workflows the change touches: architecture's file table, the mdformat frontmatter plugin
in conventions, the sync-agents hook in testing, copilot-setup-steps.yml among the places that pin
the Python version, a navigate-codebase row, and that TEST_* secrets never reach Copilot's cloud
agent. common/AGENTS.md extends "do not edit" to files a project generates from this repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three things the earlier commits got wrong or left out:

- A Dependabot bump that changes a role's frontmatter fails sync-agents, and the docs said to fix it
  "on the same PR". That branch lives in pesu-dev/auth, where agents and contributors cannot push.
  ci-cd.md now has the procedure (a maintainer pushes to it, or anyone supersedes it from a fork),
  fix-ci and the README point at it, and the README tells skills contributors when to expect it.
- Copilot's cloud agent opens its pull request from a branch in the repo it runs in, which the
  origin policy rejects in pesu-dev/auth. autonomous-workflow now says to run it on a fork, and that
  its default firewall blocks PESU Academy, so its test runs are partial. AGENTS.md points there.
- The README's "default branch" claim applies to GitHub.com only, and the cloud agent's secrets
  come from the `copilot` environment, not the workflow. security-review gains a check that
  agents gain neither secrets nor edit tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pesu-auth logs the scraped profile and the auth result at INFO so a login can be traced to what PESU
Academy returned. That is a design choice, but security.md, conventions.md, the security-review
checklist and known-issues.md all called it a defect, which invites agents to "fix" it. They now
describe it as deliberate, and AGENTS.md's logging rule says so. The CSRF token entry stays in
known-issues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aditeyabaral
aditeyabaral merged commit 6862d1f into pesu-dev:main Sep 26, 2026
2 checks passed
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.

1 participant