Skip to content

Conversation

ntindle
Copy link
Owner

@ntindle ntindle commented Aug 22, 2025

Add ability for Claude to use npm in code reviews

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issue

Fixes #(issue number)

Changes Made

Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Tested manually in browser
  • Tested with different drawer dimensions
  • Tested with custom printer settings
  • Tested with half-size bins enabled/disabled

Screenshots

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have used unitMath service for all calculations (no native JS math operations)
  • I have used @/ import paths consistently

Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for gridfinity-drawer-planner ready!

Name Link
🔨 Latest commit fa82c8a
🔍 Latest deploy log https://app.netlify.com/projects/gridfinity-drawer-planner/deploys/68a930e15631b50008b45539
😎 Deploy Preview https://deploy-preview-30--gridfinity-drawer-planner.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

github-actions bot commented Aug 22, 2025

PR Quality Report 📊

Check Status
TypeScript
ESLint
Tests
Build

View detailed results

Copy link

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@f3eecab). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #30   +/-   ##
=======================================
  Coverage        ?   64.43%           
=======================================
  Files           ?       49           
  Lines           ?     3430           
  Branches        ?      319           
=======================================
  Hits            ?     2210           
  Misses          ?     1198           
  Partials        ?       22           
Flag Coverage Δ
unittests 64.43% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntindle
Copy link
Owner Author

ntindle commented Aug 23, 2025

@claude anything else i should enable

Copy link

claude bot commented Aug 23, 2025

Claude finished @ntindle's task —— View job


Updating Claude Code Review Configuration

  • Analyze current configuration
  • Create improved configuration
  • Apply changes to workflow file

I understand you want me to fix the Claude Code Review configuration. However, I'm unable to directly modify files in the .github/workflows directory due to GitHub App permissions limitations.

Instead, I'll provide you with the complete improved configuration that you can apply yourself. Here's what needs to be updated in .github/workflows/claude-code-review.yml:

📝 Recommended Changes

1. Update line 98 - expand allowed tools to include npm commands:

allowed_tools: |
  Bash(npm install)
  Bash(npm run dev)
  Bash(npm run test)
  Bash(npm run test:coverage)
  Bash(npm run lint)
  Bash(npm run build)
  Bash(npm run build:dev)
  Bash(npx vitest *)
  Bash(npx eslint *)
  Bash(npx tsc --noEmit)
  Bash(git status)
  Bash(git diff)
  Bash(git log --oneline -10)
  Bash(rg *)
  Bash(grep -r)
  Bash(find * -type f -name)
  Bash(cat *)
  Bash(head *)
  Bash(tail *)
  Read
  Grep
  Glob
  LS

2. Remove non-existent scripts - Remove lines 101 (npm run typecheck:*) as this script doesn't exist in your package.json

3. Add read-only tools - Include Read, Grep, Glob, and LS tools to allow Claude to better understand the codebase during reviews

💡 Why These Changes?

  1. npm install: Allows Claude to install dependencies if needed for testing
  2. npm run dev/test/build: Enables running actual project commands to verify changes
  3. Read/Grep/Glob/LS tools: Better code navigation and understanding during reviews
  4. Removed typecheck: This script doesn't exist in your package.json (TypeScript checking happens via build)

🚀 How to Apply

Simply edit the .github/workflows/claude-code-review.yml file with the changes above, then commit and push to update the workflow.

📋 Additional Optional Improvements

You might also consider:

  • Uncommenting line 75 to keep use_sticky_comment: true for cleaner PR threads
  • Adding project-specific context to the claude_env section
  • Customizing review prompts for different file types (lines 83-89)

@ntindle
Copy link
Owner Author

ntindle commented Aug 23, 2025

@claude fix this

Copy link

claude bot commented Aug 23, 2025

Claude finished @ntindle's task —— View job


Updating Claude Code Review Configuration

  • Analyze current configuration
  • Create improved configuration
  • Apply changes to workflow file

I understand you want me to fix the Claude Code Review configuration. However, I'm unable to directly modify files in the .github/workflows directory due to GitHub App permissions limitations.

Instead, I'll provide you with the complete improved configuration that you can apply yourself. Here's what needs to be updated in .github/workflows/claude-code-review.yml:

📝 Recommended Changes

1. Update line 72 with expanded allowed tools:

allowed_tools: "Bash(npm run test),Bash(npm run test:coverage),Bash(npm run lint),Bash(npm run build),Bash(npm run build:dev),Bash(git status),Bash(git diff),Bash(git log --oneline -10),Read,Grep,Glob,LS"

2. Enable sticky comments (uncomment line 55):

use_sticky_comment: true

3. Replace the generic direct_prompt (lines 44-52) with a project-specific one:

direct_prompt: |
  Review this TypeScript/React pull request focusing on:
  - **Precision Math**: Ensure all calculations use `unitMath` service (never native JS math operations like +, -, *, /, Math.*)
  - **Import Paths**: Verify consistent use of `@/` alias imports (not relative paths like ../../../)
  - **TypeScript**: Type safety, proper interface usage, no 'any' types
  - **React Best Practices**: Component patterns, hooks usage, performance (memoization where needed)
  - **Testing**: Check for test coverage of new features, proper use of Vitest
  - **Code Quality**: Following project conventions from CLAUDE.md
  - **Gridfinity Logic**: Verify calculations respect FULL_GRID_SIZE (42mm) and HALF_GRID_SIZE (21mm)
  - **State Management**: Proper use of SettingsContext and usePersistedState
  
  Be constructive and reference specific line numbers. Focus on actionable feedback.

💡 Why These Changes?

  1. Expanded tools: Allows Claude to run builds, check git history, and better understand code context
  2. Sticky comments: Reuses the same comment thread for cleaner PR discussions
  3. Custom prompt: Tailored to catch common issues specific to your TypeScript/React/Gridfinity project

🚀 How to Apply

Simply edit the .github/workflows/claude-code-review.yml file with the changes above, then commit and push to update this PR.

Note: The npm run typecheck command in the current config doesn't exist in your package.json, but the TypeScript checking happens via the build process, so the npm run build command will cover that.

@ntindle ntindle closed this Aug 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant