chore(repo): setup claude code (#31380)
## Summary This PR integrates Claude Code AI assistant capabilities into the Nx repository through GitHub Actions and workspace configuration. ## Changes Made ### 🤖 GitHub Actions Integration - **Added `.github/workflows/claude.yml`**: GitHub Actions workflow that triggers Claude Code on: - Issue comments containing `@claude` - Pull request review comments containing `@claude` - Pull request reviews containing `@claude` - New issues with `@claude` in title or body - Configured appropriate permissions for repository access and PR/issue management - See [Claude Code GitHub Actions documentation](https://docs.anthropic.com/en/docs/claude-code/cli-usage#github-actions) for usage details ### 📝 Project Documentation & Configuration - **Added `CLAUDE.md`**: Comprehensive instructions for Claude Code including: - Repository-specific guidance and best practices - Essential commands for development workflow - Testing procedures (individual projects → affected projects → e2e tests) - GitHub issue resolution workflow - Pre-push validation requirements - **Added `.claude/settings.json`**: Claude Code permissions and environment configuration - **Added `.mcp.json`**: Model Context Protocol server configuration for Nx workspace integration ### 🔧 Workspace Setup - **Updated `package.json`**: Added `nx-mcp` dependency for enhanced workspace integration - **Updated `pnpm-lock.yaml`**: Lock file changes for new dependency - **Updated `.gitignore`**: Added Claude-specific ignore patterns - **Updated `CODEOWNERS`**: Assigned ownership of Claude-related files to @FrozenPandaz - **Updated `CONTRIBUTING.md`**: Enhanced contribution guidelines with technology stack information ## Benefits - Enables AI-assisted development and issue resolution through GitHub - Provides Claude with deep understanding of Nx workspace structure via MCP - Establishes clear development workflows and validation procedures - Maintains security through configured permissions and environment settings ## Usage After this PR is merged, team members and contributors can: 1. Comment `@claude` in issues or PRs to get AI assistance 2. Use Claude Code locally with enhanced Nx workspace understanding 3. Follow established workflows for testing and validation For more information, see the [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code). ## Test Plan - [x] Verify GitHub Actions workflow syntax is valid - [x] Confirm Claude Code configuration files are properly structured - [x] Validate new dependency integration - [x] Test workflow triggers on issue/PR interactions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7595d8a5e1
commit
8cec6ceebb
47
.claude/commands/commit.md
Normal file
47
.claude/commands/commit.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Commit Command
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
Create a git commit following Nx repository standards and validation requirements.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/commit [message]
|
||||||
|
```
|
||||||
|
|
||||||
|
## What this command does:
|
||||||
|
|
||||||
|
1. **Pre-commit validation**: Runs the full validation suite (`pnpm nx prepush`) to ensure code quality
|
||||||
|
2. **Formatting**: Automatically formats changed files with Prettier
|
||||||
|
3. **Testing**: Runs tests on affected projects to validate changes
|
||||||
|
4. **Commit creation**: Creates a well-formed commit with proper message formatting (without co-author attribution)
|
||||||
|
5. **Status reporting**: Provides clear feedback on the commit process
|
||||||
|
|
||||||
|
## Workflow:
|
||||||
|
|
||||||
|
1. Format any modified files with Prettier
|
||||||
|
2. Run the prepush validation suite
|
||||||
|
3. If validation passes, stage relevant changes
|
||||||
|
4. Create commit with descriptive message
|
||||||
|
5. Provide summary of what was committed
|
||||||
|
|
||||||
|
## Commit Message Format:
|
||||||
|
|
||||||
|
- Use conventional commit format when appropriate
|
||||||
|
- Include scope (e.g., `feat(core):`, `fix(angular):`, `docs(nx):`)
|
||||||
|
- Keep first line under 72 characters
|
||||||
|
- Include detailed description if needed
|
||||||
|
|
||||||
|
## Examples:
|
||||||
|
|
||||||
|
- `/commit "feat(core): add new project graph visualization"`
|
||||||
|
- `/commit "fix(react): resolve build issues with webpack config"`
|
||||||
|
- `/commit "docs(nx): update getting started guide"`
|
||||||
|
|
||||||
|
## Validation Requirements:
|
||||||
|
|
||||||
|
- All tests must pass
|
||||||
|
- Code must be properly formatted
|
||||||
|
- No linting errors
|
||||||
|
- E2E tests for affected areas should pass
|
||||||
155
.claude/commands/gh-issue-plan.md
Normal file
155
.claude/commands/gh-issue-plan.md
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
# GitHub Issue Planning and Resolution
|
||||||
|
|
||||||
|
This command provides guidance for both automated and manual GitHub issue workflows.
|
||||||
|
|
||||||
|
## Automated Workflow (GitHub Actions)
|
||||||
|
|
||||||
|
The automated workflow consists of two phases:
|
||||||
|
|
||||||
|
### Phase 1: Planning (`@claude plan` or `claude:plan` label)
|
||||||
|
|
||||||
|
- Claude analyzes the issue and creates a detailed implementation plan
|
||||||
|
- Plan is posted as a comment on the issue
|
||||||
|
- Issue is labeled with `claude:planned`
|
||||||
|
|
||||||
|
### Phase 2: Implementation (`@claude implement` or `claude:implement` label)
|
||||||
|
|
||||||
|
- Claude implements the solution based on the plan
|
||||||
|
- Runs validation tests and creates a feature branch
|
||||||
|
- Suggests opening a PR with proper formatting
|
||||||
|
|
||||||
|
## Planning Phase Template
|
||||||
|
|
||||||
|
When creating a plan (either automated or manual), include these sections:
|
||||||
|
|
||||||
|
### Problem Analysis
|
||||||
|
|
||||||
|
- Root cause identification
|
||||||
|
- Impact assessment
|
||||||
|
- Related components or systems affected
|
||||||
|
|
||||||
|
### Proposed Solution
|
||||||
|
|
||||||
|
- High-level approach
|
||||||
|
- Alternative solutions considered
|
||||||
|
- Trade-offs and rationale
|
||||||
|
|
||||||
|
### Implementation Details
|
||||||
|
|
||||||
|
- Files that need to be modified
|
||||||
|
- Key changes required
|
||||||
|
- Dependencies or prerequisites
|
||||||
|
|
||||||
|
### Testing Strategy
|
||||||
|
|
||||||
|
- Unit tests to add/modify
|
||||||
|
- Integration tests needed
|
||||||
|
- E2E test considerations
|
||||||
|
|
||||||
|
### Validation Steps
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Test specific affected projects
|
||||||
|
nx run-many -t test,build,lint -p PROJECT_NAME
|
||||||
|
|
||||||
|
# Test all affected projects
|
||||||
|
nx affected -t build,test,lint
|
||||||
|
|
||||||
|
# Run affected e2e tests
|
||||||
|
nx affected -t e2e-local
|
||||||
|
|
||||||
|
# Format code
|
||||||
|
npx nx prettier -- FILES
|
||||||
|
|
||||||
|
# Final validation
|
||||||
|
pnpm nx prepush
|
||||||
|
```
|
||||||
|
|
||||||
|
### Risks and Considerations
|
||||||
|
|
||||||
|
- Breaking changes
|
||||||
|
- Performance implications
|
||||||
|
- Migration requirements
|
||||||
|
|
||||||
|
## Manual Workflow
|
||||||
|
|
||||||
|
When working on a GitHub issue manually, follow this systematic approach:
|
||||||
|
|
||||||
|
## 1. Get Issue Details
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
|
||||||
|
gh issue view ISSUE_NUMBER
|
||||||
|
```
|
||||||
|
|
||||||
|
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
|
||||||
|
|
||||||
|
## 2. Analyze the Plan
|
||||||
|
|
||||||
|
- Look for a plan or implementation details in the issue description
|
||||||
|
- Check comments for additional context or clarification
|
||||||
|
- Identify affected projects and components
|
||||||
|
|
||||||
|
## 3. Implement the Solution
|
||||||
|
|
||||||
|
- Follow the plan outlined in the issue
|
||||||
|
- Make focused changes that address the specific problem
|
||||||
|
- Ensure code follows existing patterns and conventions
|
||||||
|
|
||||||
|
## 4. Run Full Validation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Test specific affected projects first
|
||||||
|
nx run-many -t test,build,lint -p PROJECT_NAME
|
||||||
|
|
||||||
|
# Test all affected projects
|
||||||
|
nx affected -t build,test,lint
|
||||||
|
|
||||||
|
# Run affected e2e tests
|
||||||
|
nx affected -t e2e-local
|
||||||
|
|
||||||
|
# Final pre-push validation
|
||||||
|
pnpm nx prepush
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Submit Pull Request
|
||||||
|
|
||||||
|
- Create a descriptive PR title that references the issue
|
||||||
|
- Include "Fixes #ISSUE_NUMBER" in the PR description
|
||||||
|
- Provide a clear summary of changes made
|
||||||
|
- Request appropriate reviewers
|
||||||
|
|
||||||
|
## Pull Request Template
|
||||||
|
|
||||||
|
When creating a pull request, follow the template found in `.github/PULL_REQUEST_TEMPLATE.md`. The template includes:
|
||||||
|
|
||||||
|
### Required Sections
|
||||||
|
|
||||||
|
1. **Current Behavior**: Describe the behavior we have today
|
||||||
|
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
|
||||||
|
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
|
||||||
|
|
||||||
|
### Template Format
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Current Behavior
|
||||||
|
|
||||||
|
<!-- This is the behavior we have today -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
|
||||||
|
<!-- This is the behavior we should expect with the changes in this PR -->
|
||||||
|
|
||||||
|
## Related Issue(s)
|
||||||
|
|
||||||
|
<!-- Please link the issue being fixed so it gets closed when this is merged. -->
|
||||||
|
|
||||||
|
Fixes #ISSUE_NUMBER
|
||||||
|
```
|
||||||
|
|
||||||
|
### Guidelines
|
||||||
|
|
||||||
|
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
|
||||||
|
- Read the submission guidelines in CONTRIBUTING.md before posting
|
||||||
|
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
|
||||||
|
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged
|
||||||
47
.claude/commands/issue-workflow-guide.md
Normal file
47
.claude/commands/issue-workflow-guide.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Claude Issue Workflow Usage Guide
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
### For Planning Phase
|
||||||
|
|
||||||
|
1. Comment `@claude plan` on any issue, OR
|
||||||
|
2. Add the label `claude:plan` to trigger automatic planning
|
||||||
|
|
||||||
|
### For Implementation Phase
|
||||||
|
|
||||||
|
1. Comment `@claude implement` on an issue with a plan, OR
|
||||||
|
2. Add the label `claude:implement` to trigger automatic implementation
|
||||||
|
|
||||||
|
## Workflow Labels
|
||||||
|
|
||||||
|
- `claude:plan` - Triggers the planning workflow
|
||||||
|
- `claude:planned` - Added after planning is complete
|
||||||
|
- `claude:implement` - Triggers the implementation workflow
|
||||||
|
- `claude:implemented` - Added after implementation is complete
|
||||||
|
|
||||||
|
## Expected Outputs
|
||||||
|
|
||||||
|
### Planning Phase
|
||||||
|
|
||||||
|
- Detailed analysis comment posted to issue
|
||||||
|
- Implementation plan with steps and file changes
|
||||||
|
- Testing strategy and validation steps
|
||||||
|
- Risk assessment
|
||||||
|
|
||||||
|
### Implementation Phase
|
||||||
|
|
||||||
|
- Code changes made according to plan
|
||||||
|
- Tests run and validated
|
||||||
|
- Feature branch created: `fix/issue-{number}`
|
||||||
|
- PR suggestion with proper title format
|
||||||
|
|
||||||
|
## Manual Override
|
||||||
|
|
||||||
|
If you need to work on an issue manually, use the `/gh-issue-plan` command for structured guidance following the same workflow patterns.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- Ensure you're on the authorized users list
|
||||||
|
- Check that the issue has sufficient detail for analysis
|
||||||
|
- For implementation, ensure a plan comment exists from the planning phase
|
||||||
|
- If workflows fail, check the Actions tab for detailed logs
|
||||||
29
.claude/settings.json
Normal file
29
.claude/settings.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(find:*)",
|
||||||
|
"Bash(ls:*)",
|
||||||
|
"WebFetch(domain:github.com)",
|
||||||
|
"Bash(git log:*)",
|
||||||
|
"Bash(gh issue list:*)",
|
||||||
|
"Bash(gh issue view:*)",
|
||||||
|
"Bash(npx prettier:*)",
|
||||||
|
"Bash(rg:*)",
|
||||||
|
"mcp__nx__nx_docs",
|
||||||
|
"mcp__nx__nx_workspace",
|
||||||
|
"mcp__nx__nx_project_details",
|
||||||
|
"Bash(nx show projects:*)",
|
||||||
|
"Bash(nx run-many:*)",
|
||||||
|
"Bash(nx run:*)",
|
||||||
|
"Bash(nx lint:*)",
|
||||||
|
"Bash(nx test:*)",
|
||||||
|
"Bash(nx build:*)",
|
||||||
|
"Bash(nx documentation:*)"
|
||||||
|
],
|
||||||
|
"deny": []
|
||||||
|
},
|
||||||
|
"enableAllProjectMcpServers": true,
|
||||||
|
"env": {
|
||||||
|
"BASH_MAX_TIMEOUT_MS": "1800000"
|
||||||
|
}
|
||||||
|
}
|
||||||
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@ -11,6 +11,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
||||||
|
PNPM_HOME: ~/.pnpm
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main-linux:
|
main-linux:
|
||||||
@ -61,10 +62,23 @@ jobs:
|
|||||||
version: 9.8.0
|
version: 9.8.0
|
||||||
run_install: false
|
run_install: false
|
||||||
|
|
||||||
- name: Install project dependencies
|
- uses: actions/setup-node@v4
|
||||||
run: |
|
with:
|
||||||
pnpm install --frozen-lockfile
|
node-version: 20
|
||||||
pnpm playwright install --with-deps
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Cache Rust toolchain and cargo registry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
@ -75,6 +89,14 @@ jobs:
|
|||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
|
- name: Install project dependencies
|
||||||
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
pnpm playwright install --with-deps
|
||||||
|
|
||||||
- name: Check Documentation
|
- name: Check Documentation
|
||||||
run: pnpm nx documentation
|
run: pnpm nx documentation
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
@ -163,14 +185,32 @@ jobs:
|
|||||||
version: 9.8.0
|
version: 9.8.0
|
||||||
run_install: false
|
run_install: false
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Cache Rust toolchain and cargo registry
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install project dependencies
|
- name: Install project dependencies
|
||||||
run: |
|
run: |
|
||||||
pnpm install --frozen-lockfile
|
pnpm install --frozen-lockfile
|
||||||
pnpm playwright install --with-deps
|
pnpm playwright install --with-deps
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
- name: Set SHAs
|
- name: Set SHAs
|
||||||
uses: nrwl/nx-set-shas@v4
|
uses: nrwl/nx-set-shas@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
92
.github/workflows/claude.yml
vendored
Normal file
92
.github/workflows/claude.yml
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
name: Claude Code
|
||||||
|
|
||||||
|
env:
|
||||||
|
PNPM_HOME: ~/.pnpm
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened, assigned]
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude:
|
||||||
|
if: |
|
||||||
|
contains(fromJson('["AgentEnder", "barbados-clemens", "Cammisuli", "Coly010", "FrozenPandaz", "isaacplmann", "JamesHenry", "jaysoo", "leosvelperez", "mandarini", "MaxKless", "meeroslav", "nartc", "philipjfulcher", "vsavkin", "xiongemi"]'), github.actor) &&
|
||||||
|
((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
||||||
|
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
issues: write
|
||||||
|
actions: read
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 250
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
|
||||||
|
|
||||||
|
- name: Install Chrome
|
||||||
|
uses: browser-actions/setup-chrome@v1
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v4
|
||||||
|
name: Install pnpm
|
||||||
|
with:
|
||||||
|
version: 9.8.0
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Cache cargo
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
.cargo-cache
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
|
- name: Install project dependencies
|
||||||
|
run: |
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
pnpm playwright install --with-deps
|
||||||
|
|
||||||
|
- name: Run Claude Code
|
||||||
|
id: claude
|
||||||
|
uses: anthropics/claude-code-action@beta
|
||||||
|
timeout-minutes: 90
|
||||||
|
with:
|
||||||
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -72,6 +72,8 @@ storybook-static
|
|||||||
.gradle
|
.gradle
|
||||||
.kotlin
|
.kotlin
|
||||||
|
|
||||||
|
.claude/settings.local.json
|
||||||
|
|
||||||
.cursor/rules/nx-rules.mdc
|
.cursor/rules/nx-rules.mdc
|
||||||
.github/instructions/nx.instructions.md
|
.github/instructions/nx.instructions.md
|
||||||
|
|
||||||
|
|||||||
9
.mcp.json
Normal file
9
.mcp.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"nx": {
|
||||||
|
"command": "pnpm",
|
||||||
|
"args": ["nx-mcp", "."],
|
||||||
|
"env": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
157
CLAUDE.md
Normal file
157
CLAUDE.md
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
When responding to queries about this repository:
|
||||||
|
|
||||||
|
1. Use the `nx_workspace` mcp tool for understanding the workspace architecture when appropriate
|
||||||
|
2. Suggest relevant commands from the "Essential Commands" section when applicable
|
||||||
|
3. Highlight Nx's focus on monorepos and its key features like smart task execution, code generation, and project graph analysis
|
||||||
|
4. Mention the plugin ecosystem and support for various frameworks when relevant
|
||||||
|
5. Emphasize the importance of running the full validation suite before committing changes
|
||||||
|
|
||||||
|
Always strive to provide accurate, helpful responses that align with the best practices and workflows described in this file.
|
||||||
|
|
||||||
|
## GitHub Issue Response Mode
|
||||||
|
|
||||||
|
When responding to GitHub issues, determine your approach based on how the request is phrased:
|
||||||
|
|
||||||
|
### Plan-First Mode (Default)
|
||||||
|
|
||||||
|
Use this approach when users ask you to:
|
||||||
|
|
||||||
|
- "analyze", "investigate", "assess", "review", "examine", or "plan"
|
||||||
|
- Or when the request is ambiguous
|
||||||
|
|
||||||
|
In this mode:
|
||||||
|
|
||||||
|
1. Provide a detailed analysis of the issue
|
||||||
|
2. Create a comprehensive implementation plan
|
||||||
|
3. Break down the solution into clear steps
|
||||||
|
4. Then please post the plan as a comment on the issue
|
||||||
|
|
||||||
|
### Immediate Implementation Mode
|
||||||
|
|
||||||
|
Use this approach when users ask you to:
|
||||||
|
|
||||||
|
- "fix", "implement", "solve", "build", "create", "update", or "add"
|
||||||
|
- Or when they explicitly request immediate action
|
||||||
|
|
||||||
|
In this mode:
|
||||||
|
|
||||||
|
1. Analyze the issue quickly
|
||||||
|
2. Implement the complete solution immediately
|
||||||
|
3. Make all necessary code changes. Please make multiple commits so that the changes are easier to review.
|
||||||
|
4. Run appropriate tests and validation
|
||||||
|
5. If the tests, are not passing, please fix the issues and continue doing this up to 3 more times until the tests pass
|
||||||
|
6. Once the tests pass, push a branch and then suggest opening a PR which has a description of the changes made, and that
|
||||||
|
it make sure that it explicitly says "Fixes #ISSUE_NUMBER" to automatically close the issue when the PR is merged.
|
||||||
|
|
||||||
|
## Avoid making changes to generated files
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Essential Commands
|
||||||
|
|
||||||
|
### Code Formatting
|
||||||
|
|
||||||
|
After code changes are made, please make sure to format the files with prettier via `npx prettier -- FILE_NAME`
|
||||||
|
|
||||||
|
### Pre-push Validation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Full validation suite - run before committing
|
||||||
|
pnpm nx prepush
|
||||||
|
```
|
||||||
|
|
||||||
|
If the prepush validation suite fails, please fix the issues before proceeding with your work. This ensures that all code adheres to the project's standards and passes all tests.
|
||||||
|
|
||||||
|
### Testing Changes
|
||||||
|
|
||||||
|
After code changes are made, first test the specific project where the changes were made:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nx run-many -t test,build,lint -p PROJECT_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
After verifying the individual project, validate that the changes in projects which have been affected:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Test only affected projects (recommended for development)
|
||||||
|
nx affected -t build,test,lint
|
||||||
|
```
|
||||||
|
|
||||||
|
As the last step, run the e2e tests to fully ensure that changes are valid:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run affected e2e tests (recommended for development)
|
||||||
|
nx affected -t e2e-local
|
||||||
|
```
|
||||||
|
|
||||||
|
## Fixing GitHub Issues
|
||||||
|
|
||||||
|
When working on a GitHub issue, follow this systematic approach:
|
||||||
|
|
||||||
|
### 1. Get Issue Details
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
|
||||||
|
gh issue view ISSUE_NUMBER
|
||||||
|
```
|
||||||
|
|
||||||
|
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
|
||||||
|
|
||||||
|
### 2. Analyze the Plan
|
||||||
|
|
||||||
|
- Look for a plan or implementation details in the issue description
|
||||||
|
- Check comments for additional context or clarification
|
||||||
|
- Identify affected projects and components
|
||||||
|
|
||||||
|
### 3. Implement the Solution
|
||||||
|
|
||||||
|
- Follow the plan outlined in the issue
|
||||||
|
- Make focused changes that address the specific problem
|
||||||
|
- Ensure code follows existing patterns and conventions
|
||||||
|
|
||||||
|
### 4. Run Full Validation
|
||||||
|
|
||||||
|
Use the testing workflow from the "Essential Commands" section.
|
||||||
|
|
||||||
|
### 5. Submit Pull Request
|
||||||
|
|
||||||
|
- Create a descriptive PR title that references the issue
|
||||||
|
- Include "Fixes #ISSUE_NUMBER" in the PR description
|
||||||
|
- Provide a clear summary of changes made
|
||||||
|
- Request appropriate reviewers
|
||||||
|
|
||||||
|
## Pull Request Template
|
||||||
|
|
||||||
|
When creating a pull request, follow the template found in `.github/PULL_REQUEST_TEMPLATE.md`. The template includes:
|
||||||
|
|
||||||
|
### Required Sections
|
||||||
|
|
||||||
|
1. **Current Behavior**: Describe the behavior we have today
|
||||||
|
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
|
||||||
|
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
|
||||||
|
|
||||||
|
### Template Format
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
## Current Behavior
|
||||||
|
|
||||||
|
<!-- This is the behavior we have today -->
|
||||||
|
|
||||||
|
## Expected Behavior
|
||||||
|
|
||||||
|
<!-- This is the behavior we should expect with the changes in this PR -->
|
||||||
|
|
||||||
|
## Related Issue(s)
|
||||||
|
|
||||||
|
<!-- Please link the issue being fixed so it gets closed when this is merged. -->
|
||||||
|
|
||||||
|
Fixes #ISSUE_NUMBER
|
||||||
|
```
|
||||||
|
|
||||||
|
### Guidelines
|
||||||
|
|
||||||
|
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
|
||||||
|
- Read the submission guidelines in CONTRIBUTING.md before posting
|
||||||
|
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
|
||||||
|
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged
|
||||||
@ -191,6 +191,11 @@ rust-toolchain.toml @nrwl/nx-native-reviewers
|
|||||||
/.husky/** @nrwl/nx-pipelines-reviewers
|
/.husky/** @nrwl/nx-pipelines-reviewers
|
||||||
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
|
/packages/workspace/src/generators/ci-workflow/** @nrwl/nx-pipelines-reviewers
|
||||||
|
|
||||||
|
# Claude AI Integration
|
||||||
|
CLAUDE.md @FrozenPandaz
|
||||||
|
.claude/** @FrozenPandaz
|
||||||
|
.mcp.json @FrozenPandaz
|
||||||
|
|
||||||
# Global Files
|
# Global Files
|
||||||
project.json @FrozenPandaz @vsavkin
|
project.json @FrozenPandaz @vsavkin
|
||||||
jest.config.ts @nrwl/nx-testing-tools-reviewers @FrozenPandaz
|
jest.config.ts @nrwl/nx-testing-tools-reviewers @FrozenPandaz
|
||||||
|
|||||||
@ -27,14 +27,25 @@ can [submit a Pull Request](https://github.com/nrwl/nx/blob/master/CONTRIBUTING.
|
|||||||
|
|
||||||
Source code and documentation are included in the top-level folders listed below.
|
Source code and documentation are included in the top-level folders listed below.
|
||||||
|
|
||||||
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
|
|
||||||
and API docs.
|
|
||||||
- `e2e` - E2E tests.
|
|
||||||
- `packages` - Source code for Nx packages such as Angular, React, Web, NestJS, Next and others including generators and
|
- `packages` - Source code for Nx packages such as Angular, React, Web, NestJS, Next and others including generators and
|
||||||
executors (or builders).
|
executors (or builders).
|
||||||
|
- `e2e` - E2E tests for the Nx packages
|
||||||
|
- `graph` - Source code for the Nx Graph application which shows the project graph, task graph, project details, and more in the browser.
|
||||||
|
- `docs` - Markdown and configuration files for documentation including tutorials, guides for each supported platform,
|
||||||
|
and API docs.
|
||||||
|
- `nx-dev` - Source code for the Nx documentation site which displays the markdown in `docs` and more.
|
||||||
|
- `tools` - Workspace-specific tooling and plugins
|
||||||
- `scripts` - Miscellaneous scripts for project tasks such as building documentation, testing, and code formatting.
|
- `scripts` - Miscellaneous scripts for project tasks such as building documentation, testing, and code formatting.
|
||||||
- `tmp` - Folder used by e2e tests. If you are a WebStorm user, make sure to mark this folder as excluded.
|
- `tmp` - Folder used by e2e tests. If you are a WebStorm user, make sure to mark this folder as excluded.
|
||||||
|
|
||||||
|
## Technologies
|
||||||
|
|
||||||
|
This repo contains a mix of different technologies, including:
|
||||||
|
|
||||||
|
- **Rust**: The core of Nx is written in Rust, which provides performance and safety.
|
||||||
|
- **TypeScript**: The primary language for Nx packages and the Nx DevKit.
|
||||||
|
- **Kotlin**: Used for the Gradle and Java plugins.
|
||||||
|
|
||||||
## Development Workstation Setup
|
## Development Workstation Setup
|
||||||
|
|
||||||
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`).
|
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`).
|
||||||
@ -374,6 +385,57 @@ To simplify and automate the process of committing with this format,
|
|||||||
**Nx is a [Commitizen](https://github.com/commitizen/cz-cli) friendly repository**, just do `git add` and
|
**Nx is a [Commitizen](https://github.com/commitizen/cz-cli) friendly repository**, just do `git add` and
|
||||||
execute `pnpm commit`.
|
execute `pnpm commit`.
|
||||||
|
|
||||||
|
##### Using the Interactive Commit Tool
|
||||||
|
|
||||||
|
Instead of `git commit`, use:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm commit
|
||||||
|
```
|
||||||
|
|
||||||
|
This will launch an interactive prompt that will:
|
||||||
|
|
||||||
|
1. Ask you to select the type of change (feat, fix, docs, cleanup, chore)
|
||||||
|
2. Let you choose the appropriate scope from the predefined list
|
||||||
|
3. Guide you through writing a clear, descriptive commit message
|
||||||
|
4. Ensure your commit follows the conventional commit format
|
||||||
|
|
||||||
|
##### Available Commit Types
|
||||||
|
|
||||||
|
- **feat**: A new feature
|
||||||
|
- **fix**: A bug fix
|
||||||
|
- **docs**: Documentation only changes
|
||||||
|
- **cleanup**: A code change that neither fixes a bug nor adds a feature
|
||||||
|
- **chore**: Other changes that don't modify src or test files
|
||||||
|
|
||||||
|
##### Available Scopes
|
||||||
|
|
||||||
|
The repository includes many predefined scopes. Use the one which is most specific to the changes being committed
|
||||||
|
|
||||||
|
- **core**: anything Nx core specific
|
||||||
|
- **angular**: anything Angular specific
|
||||||
|
- **react**: anything React specific
|
||||||
|
- **nextjs**: anything Next specific
|
||||||
|
- **node**: anything Node specific
|
||||||
|
- **devkit**: devkit-related changes
|
||||||
|
- **graph**: anything graph app specific
|
||||||
|
- **testing**: anything testing specific (e.g. jest or cypress)
|
||||||
|
- **misc**: misc stuff
|
||||||
|
- **repo**: anything related to managing the repo itself
|
||||||
|
- **nx-dev**: anything related to docs infrastructure
|
||||||
|
|
||||||
|
For the complete list of available scopes, see `/scripts/commitizen.js`.
|
||||||
|
|
||||||
|
##### Example Commits
|
||||||
|
|
||||||
|
```bash
|
||||||
|
feat(core): add new project graph visualization
|
||||||
|
fix(angular): resolve build issues with standalone components
|
||||||
|
docs(misc): update contributing guidelines
|
||||||
|
chore(repo): bump dependencies
|
||||||
|
cleanup(devkit): refactor utility functions for better readability
|
||||||
|
```
|
||||||
|
|
||||||
#### PR releases
|
#### PR releases
|
||||||
|
|
||||||
If you are working on a particularly complex change or feature addition, you can request a dedicated Nx release for the associated pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate.
|
If you are working on a particularly complex change or feature addition, you can request a dedicated Nx release for the associated pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate.
|
||||||
|
|||||||
@ -78,8 +78,10 @@
|
|||||||
"@nuxt/kit": "^3.10.0",
|
"@nuxt/kit": "^3.10.0",
|
||||||
"@nuxt/schema": "^3.10.0",
|
"@nuxt/schema": "^3.10.0",
|
||||||
"@nx/angular": "21.2.0-beta.1",
|
"@nx/angular": "21.2.0-beta.1",
|
||||||
|
"@nx/conformance": "2.0.1",
|
||||||
"@nx/cypress": "21.2.0-beta.1",
|
"@nx/cypress": "21.2.0-beta.1",
|
||||||
"@nx/devkit": "21.2.0-beta.1",
|
"@nx/devkit": "21.2.0-beta.1",
|
||||||
|
"@nx/enterprise-cloud": "2.0.1",
|
||||||
"@nx/esbuild": "21.2.0-beta.1",
|
"@nx/esbuild": "21.2.0-beta.1",
|
||||||
"@nx/eslint": "21.2.0-beta.1",
|
"@nx/eslint": "21.2.0-beta.1",
|
||||||
"@nx/eslint-plugin": "21.2.0-beta.1",
|
"@nx/eslint-plugin": "21.2.0-beta.1",
|
||||||
@ -88,8 +90,6 @@
|
|||||||
"@nx/key": "2.0.1",
|
"@nx/key": "2.0.1",
|
||||||
"@nx/next": "21.2.0-beta.1",
|
"@nx/next": "21.2.0-beta.1",
|
||||||
"@nx/playwright": "21.2.0-beta.1",
|
"@nx/playwright": "21.2.0-beta.1",
|
||||||
"@nx/conformance": "2.0.1",
|
|
||||||
"@nx/enterprise-cloud": "2.0.1",
|
|
||||||
"@nx/powerpack-license": "2.0.1",
|
"@nx/powerpack-license": "2.0.1",
|
||||||
"@nx/react": "21.2.0-beta.1",
|
"@nx/react": "21.2.0-beta.1",
|
||||||
"@nx/rsbuild": "21.2.0-beta.1",
|
"@nx/rsbuild": "21.2.0-beta.1",
|
||||||
@ -270,6 +270,7 @@
|
|||||||
"npm-package-arg": "11.0.1",
|
"npm-package-arg": "11.0.1",
|
||||||
"nuxt": "^3.10.0",
|
"nuxt": "^3.10.0",
|
||||||
"nx": "21.2.0-beta.1",
|
"nx": "21.2.0-beta.1",
|
||||||
|
"nx-mcp": "^0.0.9",
|
||||||
"octokit": "^2.0.14",
|
"octokit": "^2.0.14",
|
||||||
"open": "^8.4.0",
|
"open": "^8.4.0",
|
||||||
"openai": "~4.3.1",
|
"openai": "~4.3.1",
|
||||||
|
|||||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@ -903,6 +903,9 @@ importers:
|
|||||||
nx:
|
nx:
|
||||||
specifier: 21.2.0-beta.1
|
specifier: 21.2.0-beta.1
|
||||||
version: 21.2.0-beta.1(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))
|
version: 21.2.0-beta.1(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11))
|
||||||
|
nx-mcp:
|
||||||
|
specifier: ^0.0.9
|
||||||
|
version: 0.0.9
|
||||||
octokit:
|
octokit:
|
||||||
specifier: ^2.0.14
|
specifier: ^2.0.14
|
||||||
version: 2.1.0(encoding@0.1.13)
|
version: 2.1.0(encoding@0.1.13)
|
||||||
@ -15378,6 +15381,10 @@ packages:
|
|||||||
nwsapi@2.2.12:
|
nwsapi@2.2.12:
|
||||||
resolution: {integrity: sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==}
|
resolution: {integrity: sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==}
|
||||||
|
|
||||||
|
nx-mcp@0.0.9:
|
||||||
|
resolution: {integrity: sha512-MtwJnHABkxiJG+cgSmrfS8u4xuy4g09lhRrOY/dbg91ajgvcHYEUNv3DArX+0ULiUWOFOTfIqd3yDp9rIzRmHw==}
|
||||||
|
hasBin: true
|
||||||
|
|
||||||
nx@21.2.0-beta.1:
|
nx@21.2.0-beta.1:
|
||||||
resolution: {integrity: sha512-g/TarsaRChAcDjWmQhR7Tbz5SVXBSBHYmkQj+ZcuQXvPVIHCcbXYPbDe63gPfXqI5YEGiXaIrUuF2yRMmeWYsA==}
|
resolution: {integrity: sha512-g/TarsaRChAcDjWmQhR7Tbz5SVXBSBHYmkQj+ZcuQXvPVIHCcbXYPbDe63gPfXqI5YEGiXaIrUuF2yRMmeWYsA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@ -39755,6 +39762,8 @@ snapshots:
|
|||||||
|
|
||||||
nwsapi@2.2.12: {}
|
nwsapi@2.2.12: {}
|
||||||
|
|
||||||
|
nx-mcp@0.0.9: {}
|
||||||
|
|
||||||
nx@21.2.0-beta.1(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)):
|
nx@21.2.0-beta.1(@swc-node/register@1.9.1(@swc/core@1.5.7(@swc/helpers@0.5.11))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.5.7(@swc/helpers@0.5.11)):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@napi-rs/wasm-runtime': 0.2.4
|
'@napi-rs/wasm-runtime': 0.2.4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user