[ci, scripts] feat: add agent skills and workflow - #71
Merged
Conversation
Zachary-wW
marked this pull request as draft
May 27, 2026 03:46
Zachary-wW
force-pushed
the
feat/add-skills
branch
2 times, most recently
from
June 2, 2026 12:32
b842546 to
d5d1e64
Compare
Zachary-wW
marked this pull request as ready for review
June 8, 2026 02:56
Zachary-wW
force-pushed
the
feat/add-skills
branch
from
June 9, 2026 02:48
4421d98 to
0610401
Compare
Introduce two general-purpose Claude Code skills plus the project-level configuration that lets any contributor invoke them. Skills (under skills/): - code-review: framework-agnostic PR review prompt. 10 review areas (correctness, security, API design, performance, reliability/obs, testing, readability, docs, conventions, repo hygiene), 4-tier severity (🔴 Critical / 🟠 Major / 🟡 Minor / 🟢 Nit), structured verdict + checklist output. Used by the claude-review workflow. - submit-pr: PR submission workflow. Validates branch state, derives a CI-conformant title from the diff, generates the description, gets user approval, then pushes and opens the PR via gh. Project config: - .claude/settings.json: allow-list a small set of read-only git and pre-commit commands so they run without per-call prompts. - .claude/skills -> ../skills: makes the skills discoverable by Claude Code's project-level skill loader. - .gitignore: keep .claude/projects/ and .claude/credentials/ out of git while allowing settings.json and the skills symlink to be committed. - CLAUDE.md: add a Code Review section telling the reviewer agent to follow skills/code-review/SKILL.md and to post each finding as an inline comment via the create_inline_comment MCP tool, reserving the top-level summary for verdict + checklist only.
Zachary-wW
force-pushed
the
feat/add-skills
branch
from
June 10, 2026 08:24
ef99cae to
c4c3454
Compare
Zachary-wW
force-pushed
the
feat/add-skills
branch
from
June 10, 2026 08:53
c4c3454 to
665fd7f
Compare
Add a comment-triggered workflow that runs Claude Code as a PR review agent, using the upstream anthropics/claude-code-action@v1. How it works: - Trigger: comments matching '@claude' on issues, PRs, PR reviews, and PR review comments. Default phrase per upstream action. - Authorization gate: only OWNER / MEMBER / COLLABORATOR commenters can fire the action, with a self-author bypass for the original PR/issue author. Without this gate, drive-by commenters on a public repo could trigger paid agent runs and execute tools on the self-hosted runner. - Permissions: contents: read (agent reads files only), pull-requests: write + issues: write (agent posts review comments), id-token: write (action's OIDC token request), actions: read. - Routing: env.ANTHROPIC_BASE_URL routes Claude API traffic through the internal gateway. Verified end to end via the Claude Code CLI; the gateway supports tool use + streaming. - Model: 'Claude Sonnet 4.6' — the gateway exposes Claude models with display-name IDs (verified via GET /v1/models). The canonical hyphenated form is rejected as 'no available channel'. - Tools: --allowedTools enables the inline review-comment MCP tool plus the gh / Read / Grep / Glob tools the agent needs to inspect the diff and modified files. - Behavior: prompt is intentionally empty so the action runs in its default agent mode (PR context + GitHub MCP tools auto-injected). Project-wide review guidance lives in CLAUDE.md and skills/code-review/SKILL.md, which the agent loads automatically. - Progress: track_progress: true shows live checkbox progress in the bot's initial PR comment. End-to-end verified on a fork PR: the agent posts severity-tagged inline comments on file:line plus a top-level verdict / summary / checklist, matching the SKILL.md contract.
Add a workflow triggered by '/loongforge-ci' PR comments (or manual workflow_dispatch) that packages PR code together with the Loong-Megatron submodule, uploads it to BOS using runner-local configuration, writes a CI trigger signal file, and notifies the configured Ruliu group. This bridges the public GitHub PR review process with the internal build / test pipeline without exposing internal endpoints in the workflow itself — all internal config (BOS bucket, Ruliu webhook, build trigger path) is read from the self-hosted runner's local filesystem rather than from repo secrets.
Zachary-wW
force-pushed
the
feat/add-skills
branch
from
June 10, 2026 09:23
665fd7f to
20d6df2
Compare
Collaborator
Author
|
/loongforge-ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set up two-pillar agent automation for LoongForge contributors:
skills/—code-review(framework-agnostic PR review prompt) andsubmit-pr(PR submission workflow), discoverable by Claude Code via project-level config.@//-comment-triggered GitHub Actions workflows —claude-review.ymlfor AI PR review,internal-ci.ymlfor bridging public PR review with the internal build pipeline.End-to-end verified on a fork PR: the Claude reviewer reads modified files, follows
skills/code-review/SKILL.md, and posts severity-tagged inline comments onfile:lineplus a top-level verdict / summary / checklist.Changes
Agent skills and Claude project config (commit 1)
skills/code-review/SKILL.md— framework-agnostic review prompt: 10 review areas (correctness, security, API design, performance, reliability/obs, testing, readability, docs, conventions, repo hygiene), 4-tier severity (🔴 Critical / 🟠 Major / 🟡 Minor / 🟢 Nit), structured verdict + checklist output.skills/submit-pr/SKILL.md— PR submission workflow: validates branch state, derives a CI-conformant title from the diff, generates the description, gets user approval, then pushes and opens the PR viagh..claude/settings.json— allow-list a small set of read-onlygitandpre-commitcommands so they run without per-call prompts..claude/skillssymlink →../skillsmakes the skills discoverable by Claude Code's project-level skill loader..gitignore— keep.claude/projects/and.claude/credentials/out of git while allowingsettings.jsonand the skills symlink to be committed.CLAUDE.md— new "Code Review" section directs the reviewer agent to followskills/code-review/SKILL.mdand to post each finding as an inline comment via thecreate_inline_commentMCP tool, reserving the top-level summary for verdict + checklist only.Claude PR review workflow (commit 2)
.github/workflows/claude-review.yml—@claudecomment-triggered review using the upstreamanthropics/claude-code-action@v1.@claudemention onissue_comment,pull_request_review_comment,pull_request_review, orissues(default phrase per upstream action).OWNER/MEMBER/COLLABORATORcommenters can fire the action, with a self-author bypass for the original PR/issue author. Without this gate, drive-by commenters on a public repo could trigger paid agent runs and execute tools on the self-hosted runner.contents: read(agent reads files only),pull-requests: write+issues: write(agent posts comments),id-token: write(the action's OIDC token request),actions: read.env.ANTHROPIC_BASE_URLroutes Claude API traffic through the internal gateway; verified via the Claude Code CLI that the gateway supports tool use + streaming.Claude Sonnet 4.6— the gateway exposes Claude models with display-name IDs (verified viaGET /v1/models); the canonical hyphenated form is rejected.--allowedToolsenables the inline review-comment MCP tool plusgh/Read/Grep/Glob.prompt:is intentionally empty so the action runs in default agent mode — PR context and GitHub MCP tools are auto-injected. Project-wide review guidance lives inCLAUDE.mdandskills/code-review/SKILL.md.track_progress: trueshows live checkbox progress in the bot's PR comment.Internal CI workflow (commit 3)
.github/workflows/internal-ci.yml—/loongforge-ciPR-comment-triggered (or manualworkflow_dispatch) workflow that packages PR code together with the Loong-Megatron submodule, uploads to BOS using runner-local config, writes a CI trigger signal file, and notifies the configured Ruliu group.Test Plan
Skills
code-reviewandsubmit-prSKILL.md files are loaded by Claude Code via the.claude/skills -> ../skillssymlink and discoverable as project skills.Claude review workflow
End-to-end verified on fork PR (
Zachary-wW/LoongForge#8):@claude review this pr.file:line(severity-tagged: 🔴 / 🟠 / 🟡) plus 1 top-level verdict + summary + checklist comment, exactly matching theskills/code-review/SKILL.mdoutput contract.prompt:must be left empty for the action to run in agent mode and inject GitHub tools.id-token: writeis required for the action's OIDC token request.mcp__github_inline_comment__create_inline_commentmust be explicitly allow-listed via--allowedTools.author_associationgate, over-broadcontents: write); both are fixed in commit 2 before merging.Required Setup (admin) Before Running on This Repo
ANTHROPIC_API_KEY— internaloneapi-comategateway key.ANTHROPIC_BASE_URL— internal gateway base URL.[self-hosted, macOS, ARM64]registered to this repo (or shared from the org). The internal API gateway is on the corp network and is not reachable from GitHub-hosted runners.anthropic_api_key+ the workflow's built-inGITHUB_TOKENand OIDC.Notes