ci: auto-generate AGENTS.md for agent-friendly SDK discovery#176
ci: auto-generate AGENTS.md for agent-friendly SDK discovery#176jcpsimmons wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f897d5c. Configure here.
| if git diff --quiet -- AGENTS.md; then | ||
| echo "AGENTS.md is already current." | ||
| exit 0 | ||
| fi |
There was a problem hiding this comment.
First run silently skips commit of new AGENTS.md
High Severity
git diff --quiet -- AGENTS.md only compares tracked files. Since AGENTS.md does not yet exist in the repository, the first run creates it as an untracked file. git diff --quiet exits 0 for untracked files (reports no changes), so the workflow prints "AGENTS.md is already current" and exits without ever committing the newly generated file. This makes the entire first run a silent no-op. The check needs to also detect a newly created untracked AGENTS.md, for example by additionally checking git status --porcelain -- AGENTS.md.
Reviewed by Cursor Bugbot for commit f897d5c. Configure here.
Adds a workflow that regenerates AGENTS.md on every push to main, producing an agent-friendly description of the SDK for use by LLM-based assistants and routing layers. Uses a GitHub App token, Vertex auth, Claude Code action with a prompt file, and loop-prevention via paths-ignore and commit-message skip patterns. The generated file is committed back to main by the cio-claude-assistant bot.
f897d5c to
2564e91
Compare


Summary
Adds a CI workflow that auto-generates an
AGENTS.mdfile at the repo root on every push tomain. The file is an agent-friendly description of this SDK, optimized for LLM-based coding assistants and routing layers that need to pick the right Customer.io SDK for a given task.What this PR adds
.github/workflows/agents-md-update.yml: Workflow that regeneratesAGENTS.mdand commits the result back tomain. Uses a GitHub App token, Vertex auth, Claude Code action driven by a prompt file, and loop prevention viapaths-ignoreand commit-message skip patterns..github/prompts/update-agents-md.md: The prompt that Claude Code runs. Defines the required structure (What this is, Install, Initialize, Common calls, Auth and regions, When to use this vs cdp-analytics-js, Best for, Links) and the style rules.Notes for this repo
npm ci --prefix docs, and nomake docs-generatestep.make docs-checkvalidation step yet. Nothing to validate.paths-ignoreand theGuard update scopestep are scoped toAGENTS.mdonly.Setup blocker for the maintainer
The repo currently has zero Actions secrets set (
gh api repos/customerio/customerio-node/actions/secretsreturnstotal_count: 0). The workflow expects these, presumably inherited from the org or set explicitly:CIO_CLAUDE_ASSISTANT_APP_IDCIO_CLAUDE_ASSISTANT_APP_PRIVATE_KEYGCP_WORKLOAD_IDENTITY_PROVIDERVERTEX_GCP_SERVICE_ACCOUNTAlso, the workflow runs on
cio-ubuntu-slim, which is a self-hosted runner label. Confirm that runner pool is reachable from this repo. Thecio-claude-assistantGitHub App needs to be installed on this repo withcontents: write.Once the secrets and runner are in place, merging this PR will trigger the first run, which will generate
AGENTS.mdand push it back tomainas a follow-up commit.Test plan
cio-claude-assistantGitHub App is installed on this repocio-ubuntu-slimself-hosted runner is reachableAGENTS.mdis created and committed back tomainAGENTS.mdcontains all required sections (What this is, Install, Initialize, Common calls, Auth and regions, When to use this vs cdp-analytics-js, Best for, Links)workflow_dispatch, verify it is a no-op (no commit pushed)docs: update agents mdis correctly skippedNote
Medium Risk
Adds a privileged GitHub Actions workflow that authenticates to GCP and pushes commits to
main, so misconfiguration or prompt/action behavior could create unintended commits or CI failures.Overview
Adds an automated
agents md updateGitHub Actions workflow that runs on pushes tomain(andworkflow_dispatch) to regenerateAGENTS.mdvia the Claude Code action, then commits and pushes changes back tomainwith loop-prevention conditions.Introduces a dedicated prompt file that strictly defines the required
AGENTS.mdstructure, content constraints, and style rules, and the workflow includes a guard to fail if any file other thanAGENTS.mdis modified.Reviewed by Cursor Bugbot for commit 2564e91. Bugbot is set up for automated code reviews on this repo. Configure here.