Skip to content

Commit 00f2d80

Browse files
committed
chore(repo): create claude.md
1 parent fd9ef50 commit 00f2d80

File tree

12 files changed

+212
-16
lines changed

12 files changed

+212
-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/claude.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,44 @@ 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: Install project dependencies
48+
run: |
49+
pnpm install --frozen-lockfile
50+
pnpm playwright install --with-deps
51+
52+
- name: Install Rust
53+
uses: dtolnay/rust-toolchain@stable
54+
55+
- name: Setup Java
56+
uses: actions/setup-java@v4
57+
with:
58+
distribution: temurin
59+
java-version: 17
3160

3261
- name: Run Claude Code
3362
id: claude

.gitignore

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

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

.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: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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

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

CONTRIBUTING.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,25 @@ can [submit a Pull Request](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.
2727

2828
Source code and documentation are included in the top-level folders listed below.
2929

30-
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
31-
and API docs.
32-
- `e2e` - E2E tests.
3330
- `packages` - Source code for Nx packages such as Angular, React, Web, NestJS, Next and others including generators and
3431
executors (or builders).
32+
- `e2e` - E2E tests for the Nx packages
33+
- `graph` - Source code for the Nx Graph application which shows the project graph, task graph, project details, and more in the browser.
34+
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
35+
and API docs.
36+
- `nx-dev` - Source code for the Nx documentation site which displays the markdown in `docs` and more.
37+
- `tools` - Workspace-specific tooling and plugins
3538
- `scripts` - Miscellaneous scripts for project tasks such as building documentation, testing, and code formatting.
3639
- `tmp` - Folder used by e2e tests. If you are a WebStorm user, make sure to mark this folder as excluded.
3740

41+
## Technologies
42+
43+
This repo contains a mix of different technologies, including:
44+
45+
- **Rust**: The core of Nx is written in Rust, which provides performance and safety.
46+
- **TypeScript**: The primary language for Nx packages and the Nx DevKit.
47+
- **Kotlin**: Used for the Gradle and Java plugins.
48+
3849
## Development Workstation Setup
3950

4051
If you are using `VSCode`, and provided you have [Docker](https://docker.com) installed on your machine, then you can leverage [Dev Containers](https://containers.dev) through this [VSCode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), to easily setup your development environment, with everything needed to contribute to Nx, already installed (namely `NodeJS`, `Yarn`, `Rust`, `Cargo`, plus some useful extensions like `Nx Console`).

docs/generated/cli/affected.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: 'affected - CLI command'
3-
description: 'Run target for affected projects. See https://nx.dev/ci/features/affected for more details.'
2+
title: "affected - CLI command"
3+
description: "Run target for affected projects. "Affected projects" are those that have been changed in the current branch/PR, or that depend on a project that has been changed. See https://nx.dev/using-nx/affected for more details."
44
---
55

66
# affected
77

8-
Run target for affected projects. See [https://nx.dev/ci/features/affected](/ci/features/affected) for more details.
8+
Run target for affected projects. "Affected projects" are those that have been changed in the current branch/PR, or that depend on a project that has been changed. See [https://nx.dev/using-nx/affected](/using-nx/affected) for more details.
99

1010
## Usage
1111

docs/generated/packages/nx/documents/affected.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: 'affected - CLI command'
3-
description: 'Run target for affected projects. See https://nx.dev/ci/features/affected for more details.'
2+
title: "affected - CLI command"
3+
description: "Run target for affected projects. "Affected projects" are those that have been changed in the current branch/PR, or that depend on a project that has been changed. See https://nx.dev/using-nx/affected for more details."
44
---
55

66
# affected
77

8-
Run target for affected projects. See [https://nx.dev/ci/features/affected](/ci/features/affected) for more details.
8+
Run target for affected projects. "Affected projects" are those that have been changed in the current branch/PR, or that depend on a project that has been changed. See [https://nx.dev/using-nx/affected](/using-nx/affected) for more details.
99

1010
## Usage
1111

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@
7878
"@nuxt/kit": "^3.10.0",
7979
"@nuxt/schema": "^3.10.0",
8080
"@nx/angular": "21.2.0-beta.1",
81+
"@nx/conformance": "2.0.1",
8182
"@nx/cypress": "21.2.0-beta.1",
8283
"@nx/devkit": "21.2.0-beta.1",
84+
"@nx/enterprise-cloud": "2.0.1",
8385
"@nx/esbuild": "21.2.0-beta.1",
8486
"@nx/eslint": "21.2.0-beta.1",
8587
"@nx/eslint-plugin": "21.2.0-beta.1",
@@ -88,8 +90,6 @@
8890
"@nx/key": "2.0.1",
8991
"@nx/next": "21.2.0-beta.1",
9092
"@nx/playwright": "21.2.0-beta.1",
91-
"@nx/conformance": "2.0.1",
92-
"@nx/enterprise-cloud": "2.0.1",
9393
"@nx/powerpack-license": "2.0.1",
9494
"@nx/react": "21.2.0-beta.1",
9595
"@nx/rsbuild": "21.2.0-beta.1",
@@ -270,6 +270,7 @@
270270
"npm-package-arg": "11.0.1",
271271
"nuxt": "^3.10.0",
272272
"nx": "21.2.0-beta.1",
273+
"nx-mcp": "^0.0.9",
273274
"octokit": "^2.0.14",
274275
"open": "^8.4.0",
275276
"openai": "~4.3.1",

packages/nx/src/command-line/affected/command-object.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
export const yargsAffectedCommand: CommandModule = {
1616
command: 'affected',
1717
describe:
18-
'Run target for affected projects. See https://nx.dev/ci/features/affected for more details.',
18+
'Run target for affected projects. "Affected projects" are those that have been changed in the current branch/PR, or that depend on a project that has been changed. See https://nx.dev/using-nx/affected for more details.',
1919
builder: (yargs) =>
2020
linkToNxDevAndExamples(
2121
withAffectedOptions(

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)