Skip to content

Add weekly AI docs audit via Copilot coding agent#35

Open
jfversluis wants to merge 2 commits intomainfrom
feature/ai-docs-keeper
Open

Add weekly AI docs audit via Copilot coding agent#35
jfversluis wants to merge 2 commits intomainfrom
feature/ai-docs-keeper

Conversation

@jfversluis
Copy link
Copy Markdown
Member

@jfversluis jfversluis commented Mar 29, 2026

Summary

Adds a GitHub Agentic Workflow (gh aw) that automatically keeps AI configuration files in sync with the codebase.

How it works

The workflow is defined as a Markdown file (.github/workflows/ai-docs-audit.md) that compiles to a GitHub Actions lock file via gh aw compile. It runs weekly or on-demand.

  1. Agent scans merged PRs from the past 7 days to understand what changed
  2. Audits AI config files against actual source code:
    • AGENTS.md — MCP tools table (scans [McpServerTool] attributes), package list, build commands, feeds
    • .github/copilot-instructions.md — code generation guidance, conventions
    • .github/instructions/*.instructions.md — architecture, MCP tools guide, testing, packaging
  3. Opens a draft PR via safe-outputs if anything needs updating, or creates an issue noting all files are current

Why GitHub Agentic Workflows?

Feature gh-aw approach Plain Actions + Copilot coding agent
Agent permissions Read-only by default Requires write access
Write operations Safe-outputs (separate jobs) Agent writes directly
Threat detection Built-in pipeline None
Network Sandboxed with allowlist Full internet access
Tool access Explicit allowlisting Full toolset

Files

File Purpose
.github/workflows/ai-docs-audit.md Workflow definition (natural language + YAML frontmatter)
.github/workflows/ai-docs-audit.lock.yml Compiled GitHub Actions YAML (auto-generated, do not edit)
.github/aw/actions-lock.json SHA-pinned action references
.gitattributes Marks .lock.yml files as generated

Notes

  • Weekly schedule with workflow_dispatch for on-demand runs
  • Draft PRs only — human review required before merge
  • close-older-issues: true on the issue output cleans up stale audit issues
  • To recompile after editing: gh aw compile .github/workflows/ai-docs-audit.md

Introduces a scheduled GitHub Actions workflow that runs weekly (Sunday 03:00 UTC)
to detect when merged PRs have changed things documented in AI config files
(AGENTS.md, instruction files, copilot-instructions.md).

The workflow:
1. Collects all PRs merged in the past 7 days with their changed files
2. Creates an issue summarizing what changed
3. Assigns the issue to the Copilot coding agent with a custom 'docs-keeper'
   agent profile that knows which files to audit and how to verify accuracy

The docs-keeper custom agent (.github/agents/docs-keeper.md) specializes in
auditing MCP tool tables, package lists, architecture diagrams, build commands,
and conventions against the actual source code.

Also supports workflow_dispatch for on-demand runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis jfversluis added the ai-docs-audit Automated weekly AI config file audit label Mar 29, 2026
Copilot AI review requested due to automatic review settings March 29, 2026 18:41

This comment was marked as outdated.

Replace the manual GitHub Actions YAML + custom agent approach with a proper
GitHub Agentic Workflow (.md + compiled .lock.yml).

The workflow:
- Runs weekly (schedule: weekly) or on-demand (workflow_dispatch)
- Agent runs read-only, reviews merged PRs from the past 7 days
- Audits AI config files (AGENTS.md, instruction files) against actual source
- Opens a draft PR via safe-outputs if anything is stale
- Creates an issue if nothing needs updating (for audit trail)

Built-in security from gh-aw:
- Sandboxed agent execution with network isolation
- Read-only permissions; writes via safe-outputs only
- Threat detection pipeline before any PR is created
- Tool allowlisting (edit, bash, github only)

Files:
- .github/workflows/ai-docs-audit.md — workflow definition
- .github/workflows/ai-docs-audit.lock.yml — compiled Actions YAML
- .github/aw/actions-lock.json — SHA-pinned action references
- .gitattributes — marks lock files as generated

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis jfversluis requested a review from Copilot March 29, 2026 18:55
@jfversluis
Copy link
Copy Markdown
Member Author

We should probably merge #34 first

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


## Rules

- Only modify files listed in the `allowed-files` safe output config.
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

The workflow instructions mention an allowed-files safe-outputs config, but the frontmatter safe-outputs: section does not define any file allowlist (and there’s no other allowed-files configuration in this workflow). This makes the rule unenforceable and increases the risk of the agent generating patches that touch unintended files. Either add the missing allowlist configuration (if supported) and align the prompt to it, or remove/replace this rule with the actual enforcement mechanism used by gh-aw/safe-outputs.

Suggested change
- Only modify files listed in the `allowed-files` safe output config.
- Only modify AI configuration and documentation files covered by this audit (AGENTS.md, copilot-instructions.md, instruction files, and related docs).

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +76
## Step 2: Audit each AI config file

For each file below, verify its contents against the actual source code.

### AGENTS.md

- **MCP tools table**: Scan every `[McpServerTool]` attribute in
`src/DevFlow/**/Mcp/Tools/*.cs`. The table in AGENTS.md must list every tool
with its correct name, source file, and description. Regenerate the entire
table from source rather than patching individual rows.
- **Package list**: Check all `.csproj` files for `IsPackable=true` and
cross-reference with the documented package list.
- **Build commands**: Verify solution filter paths (`ls src/DevFlow/*.slnf
src/Client/*.slnf 2>/dev/null`) and ensure build commands are correct.
- **NuGet feeds**: Compare `NuGet.config` with the documented feed list.
- **SDK version**: Check `global.json` against documented version.

### .github/copilot-instructions.md

- **Platform patterns**: Verify that documented code patterns (Core/Platform,
`#if` guards, handler registration) still match actual source conventions.
- **MCP tool conventions**: Check that naming conventions (`maui_` prefix,
snake_case, parameter ordering) match actual tools.
- **Arcade gotchas**: Verify documented build system quirks are still relevant.

Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

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

Several files called out as existing audit targets (AGENTS.md, .github/copilot-instructions.md, and .github/instructions/*.instructions.md) are not currently present in the repo. As written, the workflow doesn’t say what to do in that case (create baseline files vs. report missing vs. skip), which could lead to unexpected PRs on the first run. Please clarify the expected behavior when an audited file/directory is missing and ensure the safe-outputs/write restrictions match that behavior.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-docs-audit Automated weekly AI config file audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants