Skip to content

CLAUDE.md, PR babysitter, local dev skills + symlinks for Codex/Cursor#15613

Merged
pzelasko merged 6 commits into
mainfrom
agents-md-claude-md
Apr 17, 2026
Merged

CLAUDE.md, PR babysitter, local dev skills + symlinks for Codex/Cursor#15613
pzelasko merged 6 commits into
mainfrom
agents-md-claude-md

Conversation

@pzelasko
Copy link
Copy Markdown
Collaborator

@pzelasko pzelasko commented Apr 15, 2026

Important

The Update branch button must only be pressed in very rare occassions.
An outdated branch is never blocking the merge of a PR.
Please reach out to the automation team before pressing that button.

What does this PR do ?

  • Add CLAUDE.md and symlinks for Codex/Cursor - my first take anyway, provides minimal guidance for NeMo Speech usage and development.
  • I symlinked CLAUDE.md -> AGENTS.md and .claude/skills to .codex/skill and .cursor/skills, and checked that the existing skills are correctly discovered by all three harnesses.
  • There's also a post-hook for Claude that makes it run linters after every change with the same rules as in repo CI checks (i.e. don't touch files that weren't modified).
  • a GitHub Action for babysitting PRs (getting to green CI semi-autonomously)
  • three skills /verify, /babysit-pr and /fix-issue - intended for local development use with a harness if that's preferable to triggering it through GH actions

PR babysitter GH action logic:

When there is a check failure, and Has Babysitter label is set, the agent will debug and post a comment with fix plan, pinging the PR author. The author can respond in a comment or react with a 👍🏻 emoji on the agent's comment. The agent determines the response and if approved, implements the plan. At any time this can be disabled by removing Has Babysitter label. The agent uses Agent Plan Pending Approval and Agent Plan Approved labels on the to manage state, and cleans them up after PR is merged.

Collection: [Note which collection this PR will affect]

Changelog

  • Add CLAUDE.md and symlinks for Codex/Cursor

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@pzelasko
Copy link
Copy Markdown
Collaborator Author

/claude review

Comment thread .claude/settings.json
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The directory-filter case patterns (docs/*, nemo/collections/*, etc.) are relative, but tool_input.file_path from Claude Code's Write/Edit tools is always an absolute path (e.g. /home/user/NeMo/nemo/collections/asr/foo.py). Since bash case matching requires docs/* to match from the start of the string, none of these exclusions will ever trigger — so black/isort will run on every .py file, including the collections that pyproject.toml extend-exclude is supposed to skip.

One fix: strip the path to repo-relative before the filter, e.g.:

Suggested change
"type": "command",
"command": "jq -r '.tool_input.file_path' | { read -r f; f=\"${f#\"$(git rev-parse --show-toplevel)/\"}\"; case \"$f\" in *.py) ;; *) exit 0;; esac; case \"$f\" in docs/*|external/*|examples/*) exit 0;; nemo/collections/speechlm2/*) ;; nemo/collections/*) exit 0;; esac; black --quiet \"$f\"; isort --quiet \"$f\"; } 2>/dev/null || true",

Or use wildcard prefixes like */docs/* in the patterns.

@github-actions
Copy link
Copy Markdown
Contributor

[🤖]: Hi @pzelasko 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

@github-actions github-actions Bot removed the Run CICD label Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@vmendelev vmendelev left a comment

Choose a reason for hiding this comment

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

Great first step!

Comment thread CLAUDE.md
@vmendelev vmendelev self-requested a review April 16, 2026 12:22
vmendelev
vmendelev previously approved these changes Apr 16, 2026
Comment thread .claude/skills/verify/SKILL.md
Comment thread CLAUDE.md Outdated
Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@pzelasko
Copy link
Copy Markdown
Collaborator Author

@nithinraok @vmendelev I addressed your reviews.
I also added:

  • a GitHub Action for babysitting PRs (getting to green CI autonomously)
  • two skills /babysit-pr and /fix-issue - intended for local development use with a harness if that's preferable to triggering it through GH actions

@pzelasko pzelasko added Has Babysitter Claude autonomously takes over the quest to get to a green CI. labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

I'm taking over this PR. I'll ping the author if I can't figure it out.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

I'm taking over this PR. I'll ping the author if I can't figure it out.

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@pzelasko pzelasko changed the title Add CLAUDE.md and symlinks for Codex/Cursor CLAUDE.md, PR babysitter, local dev skills + symlinks for Codex/Cursor Apr 16, 2026
@nithinraok
Copy link
Copy Markdown
Member

/claude review

Comment thread CLAUDE.md Outdated
nithinraok
nithinraok previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Member

@nithinraok nithinraok left a comment

Choose a reason for hiding this comment

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

Great work towards automating!

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

[🤖]: Hi @pzelasko 👋,

We wanted to let you know that a CICD pipeline for this PR just finished successfully.

So it might be time to merge this PR or get some approvals.

Signed-off-by: Piotr Żelasko <petezor@gmail.com>
@pzelasko
Copy link
Copy Markdown
Collaborator Author

Following offline discussion about this PR with @chtruong814, we decided to make the PR babysitter GH action less autonomous for now. New logic:

When there is a check failure, and Has Babysitter label is set, the agent will debug and post a comment with fix plan, pinging the PR author. The author can respond in a comment or react with a 👍🏻 emoji on the agent's comment. The agent determines the response and if approved, implements the plan. At any time this can be disabled by removing Has Babysitter label. The agent uses Agent Plan Pending Approval and Agent Plan Approved labels on the to manage state, and cleans them up after PR is merged.

Copy link
Copy Markdown
Collaborator

@chtruong814 chtruong814 left a comment

Choose a reason for hiding this comment

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

I just focused on the github action. main concern is the authorization check and ensuring this overall workflow does not run if someone is not a speech team member.

Comment thread .github/workflows/claude-babysit-pr.yml Outdated
issue_comment:
types: [created]
schedule:
- cron: '*/5 * * * *'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why does this need to run on a schedule?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It was to detect the 👍🏻 emoji. I decided to drop this to simplify - approval can now be only done via comment.

issues: write
id-token: write

jobs:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We probably should have checks that this is only running on branches or PRs for internal users. The claude code action should also have a check on the user that triggers the event has write access. But there's a lot going on here, and I think we should ensure nothing happens if it's for forks/external contributors.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hardened every step with a "preflight" verification

Comment thread .github/workflows/claude-babysit-pr.yml Outdated
contains(github.event.pull_request.labels.*.name, 'Has Babysitter')) ||
(github.event_name == 'pull_request_review' &&
contains(github.event.review.body, '@claude') &&
contains(github.event.pull_request.labels.*.name, 'Has Babysitter'))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We may need to check for a specific @claude /command because there may be other claude actions in this repo that could inadvertently trigger this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The other actions are /claude so they don't conflict. I'd rather keep this as natural language thing, we might want to evolve this into a chat later.

}
} catch (e) {
core.setFailed(`${username} is not a member of NVIDIA Speech Team`);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

oh great. you do have this check.

Comment thread .github/workflows/claude-babysit-pr.yml Outdated
github.event_name == 'pull_request' &&
github.event.action == 'labeled' &&
github.event.label.name == 'Agent Plan Approved' &&
contains(github.event.pull_request.labels.*.name, 'Has Babysitter')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think anyone can add a label? So this would get triggered if someone adds Has Babysitter and then Agent Plan Approved. I guess someone manually adding the label is also approving? And in theory nothing happens if there's no ` comment?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hardened against this

context.payload.comment?.user?.login ||
context.payload.review?.user?.login;
try {
const res = await github.rest.teams.getMembershipForUserInOrg({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel this should probably happen as a prequisite for all the jobs in the workflow?

Addresses Charlie's review on #15613. Adds per-job preflights that verify
the acting user (label sender / approval commenter / execute-fix sender) is
an active NVIDIA-NeMo/speech_team member, and fork-guards every PR-scoped
job so the babysitter never runs on forks. Also blocks manual-label bypass
by requiring a bot-authored plan comment before execute-fix proceeds, and
drops the cron+reaction approval path in favor of natural-language replies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pzelasko
Copy link
Copy Markdown
Collaborator Author

@chtruong814 addressed review, see 318c08b

@pzelasko
Copy link
Copy Markdown
Collaborator Author

Bypassing CI - the PR doesn't touch any code

@pzelasko pzelasko merged commit b1cb6de into main Apr 17, 2026
125 checks passed
@pzelasko pzelasko deleted the agents-md-claude-md branch April 17, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Has Babysitter Claude autonomously takes over the quest to get to a green CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants