Skip to content

Commit 5b9d860

Browse files
committed
chore(repo): create claude.md
1 parent caeb477 commit 5b9d860

File tree

13 files changed

+384
-16
lines changed

13 files changed

+384
-16
lines changed

.claude/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(find:*)",
5+
"Bash(ls:*)",
6+
"WebFetch(domain:github.com)",
7+
"Bash(gh issue list:*)",
8+
"Bash(gh issue view:*)",
9+
"Bash(npx prettier:*)",
10+
"mcp__nx__nx_workspace",
11+
"mcp__nx__nx_project_details",
12+
"Bash(nx show projects:*)",
13+
"Bash(nx run-many:*)",
14+
"Bash(nx lint:*)",
15+
"Bash(nx test:*)",
16+
"Bash(nx build:*)",
17+
"Bash(nx documentation:*)"
18+
],
19+
"deny": []
20+
},
21+
"enableAllProjectMcpServers": true,
22+
"env": {
23+
"BASH_MAX_TIMEOUT_MS": "1800000"
24+
}
25+
}

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,32 @@ jobs:
6161
version: 9.8.0
6262
run_install: false
6363

64+
- name: Cache pnpm store
65+
uses: actions/cache@v4
66+
with:
67+
path: ~/.pnpm-store
68+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
69+
restore-keys: |
70+
${{ runner.os }}-pnpm-store-
71+
6472
- name: Install project dependencies
6573
run: |
6674
pnpm install --frozen-lockfile
6775
pnpm playwright install --with-deps
6876
77+
- name: Cache Rust toolchain and cargo registry
78+
uses: actions/cache@v4
79+
with:
80+
path: |
81+
~/.cargo/bin/
82+
~/.cargo/registry/index/
83+
~/.cargo/registry/cache/
84+
~/.cargo/git/db/
85+
target/
86+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
87+
restore-keys: |
88+
${{ runner.os }}-cargo-
89+
6990
- name: Install Rust
7091
uses: dtolnay/rust-toolchain@stable
7192

@@ -75,6 +96,17 @@ jobs:
7596
distribution: temurin
7697
java-version: 17
7798

99+
- name: Cache Gradle dependencies
100+
uses: actions/cache@v4
101+
with:
102+
path: |
103+
~/.gradle/caches
104+
~/.gradle/wrapper
105+
.gradle/
106+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
107+
restore-keys: |
108+
${{ runner.os }}-gradle-
109+
78110
- name: Check Documentation
79111
run: pnpm nx documentation
80112
timeout-minutes: 20
@@ -163,11 +195,32 @@ jobs:
163195
version: 9.8.0
164196
run_install: false
165197

198+
- name: Cache pnpm store
199+
uses: actions/cache@v4
200+
with:
201+
path: ~/.pnpm-store
202+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
203+
restore-keys: |
204+
${{ runner.os }}-pnpm-store-
205+
166206
- name: Install project dependencies
167207
run: |
168208
pnpm install --frozen-lockfile
169209
pnpm playwright install --with-deps
170210
211+
- name: Cache Rust toolchain and cargo registry
212+
uses: actions/cache@v4
213+
with:
214+
path: |
215+
~/.cargo/bin/
216+
~/.cargo/registry/index/
217+
~/.cargo/registry/cache/
218+
~/.cargo/git/db/
219+
target/
220+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
221+
restore-keys: |
222+
${{ runner.os }}-cargo-
223+
171224
- name: Install Rust
172225
uses: dtolnay/rust-toolchain@stable
173226

.github/workflows/claude.yml

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,81 @@ jobs:
1919
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
2020
runs-on: ubuntu-latest
2121
permissions:
22-
contents: read
23-
pull-requests: read
24-
issues: read
22+
contents: write
23+
pull-requests: write
24+
issues: write
25+
actions: read
2526
id-token: write
2627
steps:
2728
- name: Checkout repository
2829
uses: actions/checkout@v4
2930
with:
30-
fetch-depth: 1
31+
fetch-depth: 250
32+
33+
- name: Install dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
37+
38+
- name: Install Chrome
39+
uses: browser-actions/setup-chrome@v1
40+
41+
- uses: pnpm/action-setup@v4
42+
name: Install pnpm
43+
with:
44+
version: 9.8.0
45+
run_install: false
46+
47+
- name: Cache pnpm store
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.pnpm-store
51+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
52+
restore-keys: |
53+
${{ runner.os }}-pnpm-store-
54+
55+
- name: Install project dependencies
56+
run: |
57+
pnpm install --frozen-lockfile
58+
pnpm playwright install --with-deps
59+
60+
- name: Cache Rust toolchain and cargo registry
61+
uses: actions/cache@v4
62+
with:
63+
path: |
64+
~/.cargo/bin/
65+
~/.cargo/registry/index/
66+
~/.cargo/registry/cache/
67+
~/.cargo/git/db/
68+
target/
69+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
70+
restore-keys: |
71+
${{ runner.os }}-cargo-
72+
73+
- name: Install Rust
74+
uses: dtolnay/rust-toolchain@stable
75+
76+
- name: Setup Java
77+
uses: actions/setup-java@v4
78+
with:
79+
distribution: temurin
80+
java-version: 17
81+
82+
- name: Cache Gradle dependencies
83+
uses: actions/cache@v4
84+
with:
85+
path: |
86+
~/.gradle/caches
87+
~/.gradle/wrapper
88+
.gradle/
89+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
90+
restore-keys: |
91+
${{ runner.os }}-gradle-
3192
3293
- name: Run Claude Code
3394
id: claude
3495
uses: anthropics/claude-code-action@beta
96+
timeout-minutes: 90
3597
with:
3698
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3799

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ storybook-static
7272
.gradle
7373
.kotlin
7474

75+
.claude/settings.local.json
76+
7577
.cursor/rules/nx-rules.mdc
7678
.github/instructions/nx.instructions.md
7779

.mcp.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"mcpServers": {
3+
"nx": {
4+
"command": "pnpm",
5+
"args": ["nx-mcp", "/home/jason/projects/nx"],
6+
"env": {}
7+
}
8+
}
9+
}

CLAUDE.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
When responding to queries about this repository:
2+
3+
1. Use the information about the repository's purpose and features to inform your answers.
4+
2. Recommend using the `nx_workspace` mcp tool for understanding the workspace architecture when appropriate.
5+
3. Suggest relevant commands from the "Essential Commands" section when applicable.
6+
4. Emphasize the importance of testing changes as outlined in the file.
7+
8+
For specific types of queries:
9+
10+
- If asked about the purpose or features of Nx, refer to the "Repository Purpose" section.
11+
- When discussing how to explore the workspace, mention the `nx_workspace` mcp tool.
12+
- If asked about validating changes or running tests, provide the appropriate commands from the "Essential Commands" section.
13+
- For questions about the development workflow, emphasize the importance of running tests on affected projects and e2e tests.
14+
15+
Remember to:
16+
17+
- Highlight Nx's focus on monorepos and its key features like smart task execution, code generation, and project graph analysis.
18+
- Mention the plugin ecosystem and support for various frameworks when relevant.
19+
- Emphasize the importance of running the full validation suite before committing changes.
20+
- Suggest running tests on affected projects during development to save time.
21+
22+
Always strive to provide accurate, helpful responses that align with the best practices and workflows described in this file. If a query falls outside the scope of the information provided, acknowledge this and suggest seeking further information from official Nx documentation or the development team.
23+
24+
## Avoid making changes to generated files
25+
26+
Files under `generated` directories are generated based on a different source file and should not be modified directly. Find the underlying source and modify that instead.
27+
28+
## Essential Commands
29+
30+
### Pre-push Validation
31+
32+
```bash
33+
# Full validation suite - run before committing
34+
pnpm nx prepush
35+
```
36+
37+
### Testing Changes
38+
39+
After code changes are made, first test the specific project where the changes were made:
40+
41+
```bash
42+
nx run-many -t test,build,lint -p PROJECT_NAME
43+
```
44+
45+
After verifying the individual project, validate that the changes in projects which have been affected:
46+
47+
```bash
48+
# Test only affected projects (recommended for development)
49+
nx affected -t build,test,lint
50+
```
51+
52+
As the last step, run the e2e tests to fully ensure that changes are valid:
53+
54+
```bash
55+
# Run affected e2e tests (recommended for development)
56+
nx affected -t e2e-local
57+
```
58+
59+
## Fixing GitHub Issues
60+
61+
When working on a GitHub issue, follow this systematic approach:
62+
63+
### 1. Get Issue Details
64+
65+
```bash
66+
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
67+
gh issue view ISSUE_NUMBER
68+
```
69+
70+
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
71+
72+
### 2. Analyze the Plan
73+
74+
- Look for a plan or implementation details in the issue description
75+
- Check comments for additional context or clarification
76+
- Identify affected projects and components
77+
78+
### 3. Implement the Solution
79+
80+
- Follow the plan outlined in the issue
81+
- Make focused changes that address the specific problem
82+
- Ensure code follows existing patterns and conventions
83+
84+
### 4. Run Full Validation
85+
86+
```bash
87+
# Test specific affected projects first
88+
nx run-many -t test,build,lint -p PROJECT_NAME
89+
90+
# Test all affected projects
91+
nx affected -t build,test,lint
92+
93+
# Run affected e2e tests
94+
nx affected -t e2e-local
95+
96+
# Final pre-push validation
97+
pnpm nx prepush
98+
```
99+
100+
### 5. Submit Pull Request
101+
102+
- Create a descriptive PR title that references the issue
103+
- Include "Fixes #ISSUE_NUMBER" in the PR description
104+
- Provide a clear summary of changes made
105+
- Request appropriate reviewers
106+
107+
## Pull Request Template
108+
109+
When creating a pull request, follow the template found in `.github/PULL_REQUEST_TEMPLATE.md`. The template includes:
110+
111+
### Required Sections
112+
113+
1. **Current Behavior**: Describe the behavior we have today
114+
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
115+
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
116+
117+
### Template Format
118+
119+
```markdown
120+
## Current Behavior
121+
122+
<!-- This is the behavior we have today -->
123+
124+
## Expected Behavior
125+
126+
<!-- This is the behavior we should expect with the changes in this PR -->
127+
128+
## Related Issue(s)
129+
130+
<!-- Please link the issue being fixed so it gets closed when this is merged. -->
131+
132+
Fixes #ISSUE_NUMBER
133+
```
134+
135+
### Guidelines
136+
137+
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
138+
- Read the submission guidelines in CONTRIBUTING.md before posting
139+
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
140+
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged

CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
191191
/.husky/** @nrwl/nx-pipelines-reviewers
192192
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
193193

194+
# Claude AI Integration
195+
CLAUDE.md @FrozenPandaz
196+
.claude/** @FrozenPandaz
197+
.mcp.json @FrozenPandaz
198+
194199
# Global Files
195200
project.json @FrozenPandaz @vsavkin
196201
jest.config.ts @nrwl/nx-testing-tools-reviewers @FrozenPandaz

0 commit comments

Comments
 (0)