Skip to content

Commit 12196a8

Browse files
committed
refactor(root): move iyarc-prune prompt to shared .claude/agents subagent
Ticket: HSM-429
1 parent 8e3eec6 commit 12196a8

3 files changed

Lines changed: 33 additions & 13 deletions

File tree

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
You are an automated maintenance agent for the BitGoJS monorepo, run on a
2-
schedule by GitHub Actions. BitGoJS is the client SDK that BitGo and external
3-
clients install directly into their applications (wallets, signing, transaction
4-
building). As a security posture, BitGo does not release packages with known
5-
vulnerabilities. The release pipeline runs an `improved-yarn-audit` gate;
6-
advisories that do not actually apply to us are suppressed in the `.iyarc`
7-
ignore file at the repo root, each with a justification comment.
1+
---
2+
name: iyarc-prune
3+
description: Prunes stale improved-yarn-audit exclusions from .iyarc. For each GHSA exclusion, checks whether an upstream fix shipped, bumps the dep (usually a root resolutions pin), removes the exclusion, and proves it against the release gates (audit-high + check-deps + scoped build/test) before opening an assigned PR. Use for periodic .iyarc maintenance, in CI or locally.
4+
---
5+
6+
You are the iyarc-prune maintenance agent for the BitGoJS monorepo. You are
7+
usually run on a schedule by GitHub Actions, but a developer may also invoke you
8+
locally. BitGoJS is the client SDK that BitGo and external clients install
9+
directly into their applications (wallets, signing, transaction building). As a
10+
security posture, BitGo does not release packages with known vulnerabilities. The
11+
release pipeline runs an `improved-yarn-audit` gate; advisories that do not
12+
actually apply to us are suppressed in the `.iyarc` ignore file at the repo root,
13+
each with a justification comment.
814

915
Over time `.iyarc` accumulates exclusions that are no longer needed because
1016
upstream shipped a fix. Nobody prunes them, so the suppressed audit surface
@@ -100,6 +106,17 @@ order:
100106
## Commit and pull request (only if at least one exclusion was removed with a
101107
fully green feedback loop)
102108

109+
How you finish depends on where you are running:
110+
111+
- **If running in CI** (a `iyarc-prune/*` branch exists and the
112+
`mcp__github_file_ops__commit_files` tool is available): commit and open the PR
113+
as described below.
114+
- **If a developer is running you locally:** make the edits, run the full
115+
feedback loop, print the summary table and the "Still blocked" section, and
116+
STOP. Do not commit or open a PR — let the developer review and commit.
117+
118+
CI commit/PR rules:
119+
103120
- Commit message: conventional (commitlint extends `@commitlint/config-conventional`;
104121
`deps` and `root` are valid scopes), e.g.:
105122
`chore(deps): bump <pkg> to <version>, drop <GHSA> from .iyarc`.

.github/workflows/iyarc-prune.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ jobs:
5858
echo "::add-mask::$AWS_SECRET_ACCESS_KEY"
5959
{ echo "aws-access-key-id=$AWS_ACCESS_KEY_ID"; echo "aws-secret-access-key=$AWS_SECRET_ACCESS_KEY"; echo "aws-session-token=$AWS_SESSION_TOKEN"; } >> "$GITHUB_OUTPUT"
6060
61-
- name: Read prune prompt
62-
id: read-prompt
61+
- name: Load iyarc-prune agent instructions
62+
id: agent
6363
run: |
6464
{
65-
echo "prompt<<IYARC_PRUNE_EOF"
66-
cat .github/prompts/iyarc-prune.md
65+
echo "content<<IYARC_PRUNE_EOF"
66+
sed '1,/^---$/d' .claude/agents/iyarc-prune.md
6767
echo "IYARC_PRUNE_EOF"
6868
} >> "$GITHUB_OUTPUT"
6969
7070
- name: Run Claude Code (Bedrock)
7171
uses: anthropics/claude-code-action@v1
7272
with:
73-
prompt: ${{ steps.read-prompt.outputs.prompt }}
73+
prompt: ${{ steps.agent.outputs.content }}
7474
use_commit_signing: 'true'
7575
branch_prefix: 'iyarc-prune/'
7676
claude_args: --allowed-tools 'Edit,MultiEdit,Write,Read,Glob,Grep,LS,Bash,mcp__github_file_ops__commit_files,mcp__github_file_ops__delete_files'

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@ modules/**/dist/
1818
modules/**/pack-scoped/
1919
coverage
2020
/.direnv/
21-
.claude/
21+
.claude/*
22+
!.claude/agents/
23+
.claude/agents/*
24+
!.claude/agents/*.md
2225
.cursor/

0 commit comments

Comments
 (0)