Skip to content

Commit 874ec7d

Browse files
committed
chore(repo): create claude.md and configure claude
1 parent 9046512 commit 874ec7d

File tree

16 files changed

+674
-27
lines changed

16 files changed

+674
-27
lines changed

.claude/commands/commit.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Commit Command
2+
3+
## Description
4+
5+
Create a git commit following Nx repository standards and validation requirements.
6+
7+
## Usage
8+
9+
```bash
10+
/commit [message]
11+
```
12+
13+
## What this command does:
14+
15+
1. **Pre-commit validation**: Runs the full validation suite (`pnpm nx prepush`) to ensure code quality
16+
2. **Formatting**: Automatically formats changed files with Prettier
17+
3. **Testing**: Runs tests on affected projects to validate changes
18+
4. **Commit creation**: Creates a well-formed commit with proper message formatting (without co-author attribution)
19+
5. **Status reporting**: Provides clear feedback on the commit process
20+
21+
## Workflow:
22+
23+
1. Format any modified files with Prettier
24+
2. Run the prepush validation suite
25+
3. If validation passes, stage relevant changes
26+
4. Create commit with descriptive message
27+
5. Provide summary of what was committed
28+
29+
## Commit Message Format:
30+
31+
- Use conventional commit format when appropriate
32+
- Include scope (e.g., `feat(core):`, `fix(angular):`, `docs(nx):`)
33+
- Keep first line under 72 characters
34+
- Include detailed description if needed
35+
36+
## Examples:
37+
38+
- `/commit "feat(core): add new project graph visualization"`
39+
- `/commit "fix(react): resolve build issues with webpack config"`
40+
- `/commit "docs(nx): update getting started guide"`
41+
42+
## Validation Requirements:
43+
44+
- All tests must pass
45+
- Code must be properly formatted
46+
- No linting errors
47+
- E2E tests for affected areas should pass

.claude/commands/gh-issue-plan.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# GitHub Issue Planning and Resolution
2+
3+
This command provides guidance for both automated and manual GitHub issue workflows.
4+
5+
## Automated Workflow (GitHub Actions)
6+
7+
The automated workflow consists of two phases:
8+
9+
### Phase 1: Planning (`@claude plan` or `claude:plan` label)
10+
11+
- Claude analyzes the issue and creates a detailed implementation plan
12+
- Plan is posted as a comment on the issue
13+
- Issue is labeled with `claude:planned`
14+
15+
### Phase 2: Implementation (`@claude implement` or `claude:implement` label)
16+
17+
- Claude implements the solution based on the plan
18+
- Runs validation tests and creates a feature branch
19+
- Suggests opening a PR with proper formatting
20+
21+
## Planning Phase Template
22+
23+
When creating a plan (either automated or manual), include these sections:
24+
25+
### Problem Analysis
26+
27+
- Root cause identification
28+
- Impact assessment
29+
- Related components or systems affected
30+
31+
### Proposed Solution
32+
33+
- High-level approach
34+
- Alternative solutions considered
35+
- Trade-offs and rationale
36+
37+
### Implementation Details
38+
39+
- Files that need to be modified
40+
- Key changes required
41+
- Dependencies or prerequisites
42+
43+
### Testing Strategy
44+
45+
- Unit tests to add/modify
46+
- Integration tests needed
47+
- E2E test considerations
48+
49+
### Validation Steps
50+
51+
```bash
52+
# Test specific affected projects
53+
nx run-many -t test,build,lint -p PROJECT_NAME
54+
55+
# Test all affected projects
56+
nx affected -t build,test,lint
57+
58+
# Run affected e2e tests
59+
nx affected -t e2e-local
60+
61+
# Format code
62+
npx nx prettier -- FILES
63+
64+
# Final validation
65+
pnpm nx prepush
66+
```
67+
68+
### Risks and Considerations
69+
70+
- Breaking changes
71+
- Performance implications
72+
- Migration requirements
73+
74+
## Manual Workflow
75+
76+
When working on a GitHub issue manually, follow this systematic approach:
77+
78+
## 1. Get Issue Details
79+
80+
```bash
81+
# Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number)
82+
gh issue view ISSUE_NUMBER
83+
```
84+
85+
When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER`
86+
87+
## 2. Analyze the Plan
88+
89+
- Look for a plan or implementation details in the issue description
90+
- Check comments for additional context or clarification
91+
- Identify affected projects and components
92+
93+
## 3. Implement the Solution
94+
95+
- Follow the plan outlined in the issue
96+
- Make focused changes that address the specific problem
97+
- Ensure code follows existing patterns and conventions
98+
99+
## 4. Run Full Validation
100+
101+
```bash
102+
# Test specific affected projects first
103+
nx run-many -t test,build,lint -p PROJECT_NAME
104+
105+
# Test all affected projects
106+
nx affected -t build,test,lint
107+
108+
# Run affected e2e tests
109+
nx affected -t e2e-local
110+
111+
# Final pre-push validation
112+
pnpm nx prepush
113+
```
114+
115+
## 5. Submit Pull Request
116+
117+
- Create a descriptive PR title that references the issue
118+
- Include "Fixes #ISSUE_NUMBER" in the PR description
119+
- Provide a clear summary of changes made
120+
- Request appropriate reviewers
121+
122+
## Pull Request Template
123+
124+
When creating a pull request, follow the template found in `.github/PULL_REQUEST_TEMPLATE.md`. The template includes:
125+
126+
### Required Sections
127+
128+
1. **Current Behavior**: Describe the behavior we have today
129+
2. **Expected Behavior**: Describe the behavior we should expect with the changes in this PR
130+
3. **Related Issue(s)**: Link the issue being fixed so it gets closed when the PR is merged
131+
132+
### Template Format
133+
134+
```markdown
135+
## Current Behavior
136+
137+
<!-- This is the behavior we have today -->
138+
139+
## Expected Behavior
140+
141+
<!-- This is the behavior we should expect with the changes in this PR -->
142+
143+
## Related Issue(s)
144+
145+
<!-- Please link the issue being fixed so it gets closed when this is merged. -->
146+
147+
Fixes #ISSUE_NUMBER
148+
```
149+
150+
### Guidelines
151+
152+
- Ensure your commit message follows the conventional commit format (use `pnpm commit`)
153+
- Read the submission guidelines in CONTRIBUTING.md before posting
154+
- For complex changes, you can request a dedicated Nx release by mentioning the Nx team
155+
- Always link the related issue using "Fixes #ISSUE_NUMBER" to automatically close it when merged
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Claude Issue Workflow Usage Guide
2+
3+
## Quick Start
4+
5+
### For Planning Phase
6+
7+
1. Comment `@claude plan` on any issue, OR
8+
2. Add the label `claude:plan` to trigger automatic planning
9+
10+
### For Implementation Phase
11+
12+
1. Comment `@claude implement` on an issue with a plan, OR
13+
2. Add the label `claude:implement` to trigger automatic implementation
14+
15+
## Workflow Labels
16+
17+
- `claude:plan` - Triggers the planning workflow
18+
- `claude:planned` - Added after planning is complete
19+
- `claude:implement` - Triggers the implementation workflow
20+
- `claude:implemented` - Added after implementation is complete
21+
22+
## Expected Outputs
23+
24+
### Planning Phase
25+
26+
- Detailed analysis comment posted to issue
27+
- Implementation plan with steps and file changes
28+
- Testing strategy and validation steps
29+
- Risk assessment
30+
31+
### Implementation Phase
32+
33+
- Code changes made according to plan
34+
- Tests run and validated
35+
- Feature branch created: `fix/issue-{number}`
36+
- PR suggestion with proper title format
37+
38+
## Manual Override
39+
40+
If you need to work on an issue manually, use the `/gh-issue-plan` command for structured guidance following the same workflow patterns.
41+
42+
## Troubleshooting
43+
44+
- Ensure you're on the authorized users list
45+
- Check that the issue has sufficient detail for analysis
46+
- For implementation, ensure a plan comment exists from the planning phase
47+
- If workflows fail, check the Actions tab for detailed logs

.claude/settings.json

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

.github/workflows/ci.yml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111

1212
env:
1313
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
14+
PNPM_HOME: ~/.pnpm
1415

1516
jobs:
1617
main-linux:
@@ -61,10 +62,26 @@ jobs:
6162
version: 9.8.0
6263
run_install: false
6364

64-
- name: Install project dependencies
65-
run: |
66-
pnpm install --frozen-lockfile
67-
pnpm playwright install --with-deps
65+
- uses: actions/setup-node@v4
66+
with:
67+
node-version: 20
68+
cache: 'pnpm'
69+
70+
- name: Cache Rust toolchain and cargo registry
71+
uses: actions/cache@v4
72+
with:
73+
path: |
74+
~/.cargo/bin/
75+
~/.cargo/registry/index/
76+
~/.cargo/registry/cache/
77+
~/.cargo/git/db/
78+
target/
79+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
80+
restore-keys: |
81+
${{ runner.os }}-cargo-
82+
83+
- name: Setup Gradle
84+
uses: gradle/actions/setup-gradle@v4
6885

6986
- name: Install Rust
7087
uses: dtolnay/rust-toolchain@stable
@@ -75,6 +92,11 @@ jobs:
7592
distribution: temurin
7693
java-version: 17
7794

95+
- name: Install project dependencies
96+
run: |
97+
pnpm install --frozen-lockfile
98+
pnpm playwright install --with-deps
99+
78100
- name: Check Documentation
79101
run: pnpm nx documentation
80102
timeout-minutes: 20
@@ -163,14 +185,32 @@ jobs:
163185
version: 9.8.0
164186
run_install: false
165187

188+
- uses: actions/setup-node@v4
189+
with:
190+
node-version: 20
191+
cache: 'pnpm'
192+
193+
- name: Cache Rust toolchain and cargo registry
194+
uses: actions/cache@v4
195+
with:
196+
path: |
197+
~/.cargo/bin/
198+
~/.cargo/registry/index/
199+
~/.cargo/registry/cache/
200+
~/.cargo/git/db/
201+
target/
202+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
203+
restore-keys: |
204+
${{ runner.os }}-cargo-
205+
206+
- name: Install Rust
207+
uses: dtolnay/rust-toolchain@stable
208+
166209
- name: Install project dependencies
167210
run: |
168211
pnpm install --frozen-lockfile
169212
pnpm playwright install --with-deps
170213
171-
- name: Install Rust
172-
uses: dtolnay/rust-toolchain@stable
173-
174214
- name: Set SHAs
175215
uses: nrwl/nx-set-shas@v4
176216
with:

0 commit comments

Comments
 (0)