Skip to content

Commit 862a89e

Browse files
Install Claude code factory pattern
Add Claude Code Action workflows: - claude.yml: responds to @claude mentions on issues/PRs - claude-auto-assign.yml: auto-tags @claude on new org-member issues - claude-code-review.yml: automated PR review via code-review plugin Add CLAUDE.md with repo-specific instructions for Claude.
1 parent 4ccd4dd commit 862a89e

File tree

4 files changed

+171
-0
lines changed

4 files changed

+171
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Auto-assign Claude on new issues
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
tag-claude:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
members: read
13+
steps:
14+
- name: Check org membership and tag Claude
15+
uses: actions/github-script@v7
16+
with:
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
script: |
19+
const author = context.payload.issue.user.login;
20+
const org = context.repo.owner;
21+
const body = context.payload.issue.body || '';
22+
23+
// Already has @claude — no need to add it
24+
if (body.includes('@claude')) {
25+
console.log('Issue body already contains @claude, skipping.');
26+
return;
27+
}
28+
29+
// Always trigger for the Claude bot itself
30+
const isClaudeBot = author === 'claude[bot]';
31+
32+
let isMember = false;
33+
if (!isClaudeBot) {
34+
try {
35+
await github.rest.orgs.checkMembershipForUser({ org, username: author });
36+
isMember = true;
37+
} catch (e) {
38+
isMember = false;
39+
}
40+
}
41+
42+
if (!isClaudeBot && !isMember) {
43+
console.log(`Skipping: ${author} is not a member of ${org}`);
44+
return;
45+
}
46+
47+
await github.rest.issues.createComment({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
issue_number: context.issue.number,
51+
body: '@claude please implement this issue'
52+
});
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, ready_for_review, reopened]
6+
7+
jobs:
8+
claude-review:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
issues: read
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 1
21+
22+
- name: Run Claude Code Review
23+
id: claude-review
24+
uses: anthropics/claude-code-action@v1
25+
with:
26+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
27+
allowed_bots: '*'
28+
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
29+
plugins: 'code-review@claude-code-plugins'
30+
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'

.github/workflows/claude.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
issues: write
25+
id-token: write
26+
actions: read
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@v1
36+
with:
37+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
allowed_bots: "claude[bot]"
39+
additional_permissions: |
40+
actions: read
41+
claude_args: '--allowedTools "Bash(gh pr create:*),Bash(gh pr list:*),Bash(gh pr view:*),Bash(gh issue:*),Bash(gh api:*),Bash(git fetch:*),Bash(git checkout:*),Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git rebase:*),Bash(git log:*),Bash(git diff:*),Bash(git status:*),Bash(go run:*),Bash(go build:*),Bash(go mod tidy:*),Edit,Write,Read,Glob,Grep"'

CLAUDE.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# supermodeltools.github.io — Claude Instructions
2+
3+
## What this repo is
4+
5+
This is the homepage for Supermodel's open-source architecture documentation index, deployed to GitHub Pages at `repos.supermodeltools.com`. It lists repos that have architecture docs generated by [supermodeltools/arch-docs](https://github.com/supermodeltools/arch-docs).
6+
7+
## Project structure
8+
9+
- `repos.yaml` — source of truth for all listed repos (categories, names, descriptions, pills)
10+
- `generate-index.go` — Go static site generator that reads `repos.yaml` and produces `site/index.html`
11+
- `site/` — build output directory (gitignored)
12+
- `.github/workflows/build-index.yml` — builds and deploys to GitHub Pages on push
13+
14+
## Development
15+
16+
- Language: Go 1.24
17+
- Build: `go run generate-index.go`
18+
- The generator uses `text/template` and embeds all HTML/CSS/JS inline
19+
- No external dependencies beyond `gopkg.in/yaml.v3`
20+
21+
## Pull Requests
22+
23+
When asked to implement something and raise a PR, always create the PR using `gh pr create`:
24+
25+
```
26+
gh pr create \
27+
--repo supermodeltools/supermodeltools.github.io \
28+
--title "..." \
29+
--body "..." \
30+
--base main \
31+
--head <branch>
32+
```
33+
34+
## Issues
35+
36+
When creating a GitHub issue, always include `@claude` at the end of the body so the workflow auto-triggers.
37+
38+
## Branch naming
39+
40+
`claude/issue-{number}-{YYYYMMDD}-{HHMM}`
41+
42+
## Commits
43+
44+
Keep commit messages concise and descriptive. Include:
45+
46+
```
47+
Co-Authored-By: Claude <noreply@anthropic.com>
48+
```

0 commit comments

Comments
 (0)