From f02cc49b067643818f38e97a28e7e18b9af40b98 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Fri, 30 May 2025 21:26:52 -0400 Subject: [PATCH] feat(repo): enhance Claude Code workflow and settings (#31405) ## Current Behavior The Claude Code setup has basic workflow automation but lacks comprehensive tooling permissions and detailed guidance for issue management. The workflow documentation contains redundant sections and some outdated commands. ## Expected Behavior With these changes, the Claude Code integration will have: - Enhanced tool permissions for better CI/CD workflow support - Comprehensive GitHub CLI commands for efficient multi-issue management - Clear mandatory requirements for PR template completion - Streamlined documentation with accurate command references ## Related Issue(s) This PR builds upon the initial Claude Code setup from #31380 by refining the workflow configuration and improving the developer experience. --- .claude/commands/issue-workflow-guide.md | 17 ----------------- .claude/settings.json | 5 +++++ .github/workflows/claude.yml | 1 + CLAUDE.md | 19 +++++++++++++++++-- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.claude/commands/issue-workflow-guide.md b/.claude/commands/issue-workflow-guide.md index 58df1a74f7..ed9f1db8fe 100644 --- a/.claude/commands/issue-workflow-guide.md +++ b/.claude/commands/issue-workflow-guide.md @@ -2,23 +2,6 @@ ## 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 diff --git a/.claude/settings.json b/.claude/settings.json index a3f89bf256..23c3487b84 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -3,11 +3,15 @@ "allow": [ "Bash(find:*)", "Bash(ls:*)", + "Bash(mkdir:*)", "WebFetch(domain:github.com)", + "WebFetch(domain:www.typescriptlang.org)", "Bash(git log:*)", "Bash(gh issue list:*)", "Bash(gh issue view:*)", "Bash(npx prettier:*)", + "Bash(nx prepush:*)", + "Bash(pnpm commit:*)", "Bash(rg:*)", "mcp__nx__nx_docs", "mcp__nx__nx_workspace", @@ -15,6 +19,7 @@ "Bash(nx show projects:*)", "Bash(nx run-many:*)", "Bash(nx run:*)", + "Bash(nx affected:*)", "Bash(nx lint:*)", "Bash(nx test:*)", "Bash(nx build:*)", diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 491f9e82bc..f0267cbbf1 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -89,4 +89,5 @@ jobs: timeout-minutes: 90 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + allowed_tools: "Bash,Edit,Read,Write,Glob,Grep,LS,MultiEdit,NotebookRead,NotebookEdit" diff --git a/CLAUDE.md b/CLAUDE.md index b899127abd..76a89666cf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -58,7 +58,7 @@ After code changes are made, please make sure to format the files with prettier ```bash # Full validation suite - run before committing -pnpm nx prepush +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. @@ -94,8 +94,22 @@ When working on a GitHub issue, follow this systematic approach: ```bash # Get issue details using GitHub CLI (replace ISSUE_NUMBER with actual number) gh issue view ISSUE_NUMBER + +# View multiple issues efficiently in one command +gh issue list --limit 50 --json number,title,state,labels,assignees,updatedAt,body --jq '.[] | select(.number == 123 or .number == 456 or .number == 789)' + +# Or filter by specific criteria to get multiple related issues +gh issue list --label "bug" --state "open" --json number,title,body,labels --jq '.[]' +gh issue list --assignee "@me" --json number,title,body,state --jq '.[]' ``` +**Tip**: Instead of running `gh issue view` multiple times, use `gh issue list` with JSON output and filtering to gather information about multiple issues in a single command. This is much more efficient than viewing issues one at a time. + +**Always provide clickable links**: When discussing GitHub issues or PRs, always include the full GitHub URL so the user can easily open them in their browser. For example: + +- Issue #12345: https://github.com/nrwl/nx/issues/12345 +- PR #67890: https://github.com/nrwl/nx/pull/67890 + When cloning reproduction repos, please clone within `./tmp/claude/repro-ISSUE_NUMBER` ### 2. Analyze the Plan @@ -117,13 +131,14 @@ Use the testing workflow from the "Essential Commands" section. ### 5. Submit Pull Request - Create a descriptive PR title that references the issue +- **Always fill in the PR template** - don't leave it empty - 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: +**IMPORTANT**: When creating a pull request, you MUST fill in the template found in `.github/PULL_REQUEST_TEMPLATE.md`. Do not leave the template sections empty. The template includes: ### Required Sections