- Detect the actual tech stack from lock files and config files (not assumptions)
- Read existing .claude/settings.local.json and .mcp.json to understand current state
- Include both read-only AND development commands appropriate for each detected tool
- Only include commands for tools actually detected in the project
- Never include absolute paths, user-specific paths, or destructive system commands
Generating settings without detection = wrong package manager commands, missing tools, security risks
This is not optional. Every recommendation requires stack verification.
Update Claude Settings
MANDATORY FIRST RESPONSE PROTOCOL
Before generating ANY settings, you MUST complete this checklist:
- ☐ List all files in the repository root (
ls -la)
- ☐ Detect config and lock files (package.json, pyproject.toml, go.mod, Cargo.toml, etc.)
- ☐ Read dependency files to identify frameworks and libraries
- ☐ Check for monorepo indicators (lerna.json, nx.json, turbo.json, pnpm-workspace.yaml)
- ☐ Check for service integrations (Sentry, Linear, etc.)
- ☐ Read existing .claude/settings.local.json (if it exists)
- ☐ Read existing .mcp.json (if it exists)
- ☐ Announce: "Detected [stack]: generating settings for [N] command categories and [M] WebFetch domains"
Generating settings WITHOUT completing this checklist = wrong permissions and missed tools.
Overview
Analyze a repository to generate recommended Claude Code settings.local.json permissions for read-only commands. Detects the tech stack, build tools, frameworks, services, and monorepo structure to produce accurate, project-specific recommendations.
What this skill does:
- Detects languages, package managers, frameworks, and build tools from config/lock files
- Detects service integrations (Sentry, Linear, etc.)
- Generates a complete
settings.local.json with both read-only AND development commands
- Includes framework-specific commands Claude needs (artisan, next, expo, manage.py, cargo, etc.)
- Suggests relevant WebFetch domains for framework documentation
- Suggests MCP server configurations when applicable
- Merges with existing settings if present
What this skill does NOT do:
- Install or configure any tools
- Modify code or project structure
- Include destructive system commands (rm -rf, format, etc.)
- Guess at tools not detected in the project
- Include user-specific or absolute paths
When to Use
- User says "audit settings", "setup permissions", "configure claude settings", "/update-claude-settings"
- User is setting up a new project with Claude Code
- User wants to review or update existing Claude Code permissions
- $ARGUMENTS provided as guidance (e.g.,
/update-claude-settings add docker commands)
Never generate settings proactively. Only when explicitly requested.
When NOT to Use
- Empty repository — no files to detect; ask user to describe their stack instead
- User wants to run commands — this skill generates permission config, it doesn't execute project commands
- User wants to modify code — this skill only produces settings.local.json and .mcp.json recommendations
- Settings are already comprehensive — if existing settings cover the detected stack, say so
Step 1: Detect Tech Stack
Gate: All languages, package managers, and build tools identified before proceeding to Step 2.
Run detection commands:
# List root directory contents
ls -la
# Find config and lock files (up to 2 levels deep)
find . -maxdepth 2 \( -name "*.toml" -o -name "*.json" -o -name "*.lock" -o -name "*.yaml" -o -name "*.yml" -o -name "Makefile" -o -name "Dockerfile" -o -name "*.tf" \) 2>/dev/null | head -50
Check for these indicator files:
| Category |
Files to Check |
| Python |
pyproject.toml, setup.py, requirements.txt, Pipfile, poetry.lock, uv.lock |
| Node.js |
package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb |
| Go |
go.mod, go.sum |
| Rust |
Cargo.toml, Cargo.lock |
| Ruby |
Gemfile, Gemfile.lock |
| Java/Kotlin |
pom.xml, build.gradle, build.gradle.kts |
| PHP |
composer.json, composer.lock |
| Swift/iOS |
Package.swift, *.xcodeproj, *.xcworkspace, Podfile |
| .NET |
*.csproj, *.sln, nuget.config |
| React Native |
app.json (with expo key), metro.config.js, react-native.config.js, eas.json |
| Build |
Makefile, Dockerfile, docker-compose.yml, docker-compose.yaml |
| Infra |
*.tf files, kubernetes/, helm/, pulumi/, serverless.yml |
| Monorepo |
lerna.json, nx.json, turbo.json, pnpm-workspace.yaml |
Step 2: Detect Frameworks and Services
Gate: All frameworks and service integrations identified before proceeding to Step 3.
Read dependency files to identify frameworks:
package.json → check dependencies and devDependencies
pyproject.toml → check [project.dependencies] or [tool.poetry.dependencies]
Gemfile → check gem names
Cargo.toml → check [dependencies]
composer.json → check require and require-dev
go.mod → check require block
Check for framework-specific indicators:
| Framework |
Detection |
| Next.js |
next in package.json deps, next.config.js/next.config.mjs/next.config.ts |
| React (Vite) |
vite + react in package.json deps, vite.config.ts/vite.config.js |
| Expo/React Native |
expo in package.json deps, app.json with expo key, eas.json |
| Express |
express in package.json deps |
| Laravel |
laravel/framework in composer.json require, artisan file in root |
| Magento |
magento/framework in composer.json require, bin/magento |
| Django |
django in Python deps |
| FastAPI |
fastapi in Python deps |
| Tailwind CSS |
tailwindcss in package.json deps, tailwind.config.js/tailwind.config.ts |
Check for service integrations:
| Service |
Detection |
| Sentry |
sentry-sdk in deps, @sentry/* packages, .sentryclirc, sentry.properties |
| Linear |
Linear config files, .linear/ directory |
| Datadog |
dd-trace in deps, datadog.yaml |
| AWS |
aws-cdk in deps, samconfig.toml, serverless.yml |
| Vercel |
vercel.json, @vercel/* packages |
| Supabase |
supabase/ directory, @supabase/* packages |
| Firebase |
firebase.json, @firebase/* or firebase-admin in deps |
Step 3: Check Existing Settings
Gate: Current settings state understood before proceeding to Step 4.
Read existing configuration files:
# Check existing Claude Code settings
cat .claude/settings.local.json 2>/dev/null || echo "No existing settings"
# Check existing MCP config
cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"
If existing settings are found:
- Note which commands are already allowed
- Note which commands are denied
- Identify gaps (detected tools not in settings)
- Identify stale entries (settings for tools no longer in the project)
Step 4: Build Recommendations
Gate: Complete recommendation generated before proceeding to Step 5.
Build the allow list by combining baseline commands with stack-specific commands.
Baseline Commands (Always Include)
These read-only commands are safe and useful for any project:
[
"Bash(ls:*)",
"Bash(pwd:*)",
"Bash(find:*)",
"Bash(file:*)",
"Bash(stat:*)",
"Bash(wc:*)",
"Bash(head:*)",
"Bash(tail:*)",
"Bash(cat:*)",
"Bash(tree:*)",
"Bash(git status:*)",
"Bash(git log:*)",
"Bash(git diff:*)",
"Bash(git show:*)",
"Bash(git branch:*)",
"Bash(git remote:*)",
"Bash(git tag:*)",
"Bash(git stash list:*)",
"Bash(git rev-parse:*)",
"Bash(gh pr view:*)",
"Bash(gh pr list:*)",
"Bash(gh pr checks:*)",
"Bash(gh pr diff:*)",
"Bash(gh issue view:*)",
"Bash(gh issue list:*)",
"Bash(gh run view:*)",
"Bash(gh run list:*)",
"Bash(gh run logs:*)",
"Bash(gh repo view:*)",
"Bash(gh api:*)"
]
Stack-Specific Commands
Only include commands for tools actually detected in the project. Each section is split into read-only (safe to auto-allow) and development (needed for Claude to work effectively with the framework) commands.
Python
| If Detected |
Read-Only Commands |
Development Commands |
| Any Python |
python --version, python3 --version |
python, python3 |
poetry.lock |
poetry show, poetry env info |
poetry install, poetry add, poetry remove, poetry run, poetry lock |
uv.lock |
uv pip list, uv tree |
uv pip install, uv add, uv remove, uv run, uv sync, uv lock |
Pipfile.lock |
pipenv graph |
pipenv install, pipenv run |
requirements.txt (no other lock) |
pip list, pip show, pip freeze |
pip install |
| pytest detected |
— |
pytest, python -m pytest |
| mypy/pyright detected |
— |
mypy, pyright |
| ruff detected |
— |
ruff check, ruff format |
Python frameworks:
| If Detected |
Development Commands |
| Django |
python manage.py, django-admin (e.g., manage.py runserver, manage.py migrate, manage.py makemigrations, manage.py test, manage.py shell, manage.py createsuperuser) |
| FastAPI |
uvicorn, fastapi (e.g., uvicorn main:app, fastapi dev) |
| Flask |
flask run, flask shell |
| Celery |
celery -A, celery worker, celery beat |
| Alembic |
alembic upgrade, alembic downgrade, alembic revision, alembic history |
Node.js
| If Detected |
Read-Only Commands |
Development Commands |
| Any Node.js |
node --version |
node |
pnpm-lock.yaml |
pnpm list, pnpm why |
pnpm install, pnpm add, pnpm remove, pnpm run, pnpm exec, pnpm dlx, pnpm test |
yarn.lock |
yarn list, yarn info, yarn why |
yarn install, yarn add, yarn remove, yarn run, yarn dlx, yarn test |
bun.lockb |
bun --version |
bun install, bun add, bun remove, bun run, bun test, bunx |
package-lock.json |
npm list, npm view, npm outdated |
npm install, npm run, npm test, npm exec, npx |
TypeScript (tsconfig.json) |
tsc --version |
tsc, tsc --noEmit, npx tsc |
| ESLint detected |
— |
eslint, npx eslint |
| Prettier detected |
— |
prettier, npx prettier |
| Vitest detected |
— |
vitest, npx vitest |
| Jest detected |
— |
jest, npx jest |
Node.js frameworks:
| If Detected |
Development Commands |
| Next.js |
npx next build, npx next dev, npx next start, npx next lint, npx next info |
| Expo/React Native |
npx expo start, npx expo prebuild, npx expo install, npx expo config, npx expo lint, eas build, eas update, eas submit, npx eas --version |
| Vite |
npx vite, npx vite build, npx vite preview |
| Express |
(uses node and package manager run commands — no additional CLI) |
| Tailwind CSS |
npx tailwindcss, npx tailwindcss --watch |
| Storybook |
npx storybook dev, npx storybook build |
| Prisma |
npx prisma generate, npx prisma migrate, npx prisma db push, npx prisma db pull, npx prisma studio, npx prisma format |
| Drizzle |
npx drizzle-kit generate, npx drizzle-kit migrate, npx drizzle-kit push, npx drizzle-kit studio |
PHP
| If Detected |
Read-Only Commands |
Development Commands |
composer.json |
php --version, composer show, composer info |
php, composer install, composer require, composer remove, composer update, composer dump-autoload |
| PHPUnit detected |
— |
phpunit, ./vendor/bin/phpunit |
| PHPStan detected |
— |
phpstan, ./vendor/bin/phpstan |
PHP frameworks:
| If Detected |
Development Commands |
| Laravel |
php artisan (e.g., artisan migrate, artisan make:model, artisan make:controller, artisan make:migration, artisan route:list, artisan config:show, artisan test, artisan tinker, artisan queue:work, artisan schedule:run, artisan db:seed, artisan cache:clear, artisan key:generate, artisan serve) |
| Magento |
php bin/magento (e.g., bin/magento setup:upgrade, bin/magento cache:flush, bin/magento module:status, bin/magento indexer:reindex, bin/magento setup:di:compile) |
| Symfony |
php bin/console (e.g., bin/console doctrine:migrations:migrate, bin/console make:entity, bin/console cache:clear) |
Go
| If Detected |
Read-Only Commands |
Development Commands |
go.mod |
go version, go list, go mod graph, go env |
go build, go run, go test, go vet, go fmt, go mod tidy, go mod download, go generate, go get |
| golangci-lint detected |
— |
golangci-lint run |
Rust
| If Detected |
Read-Only Commands |
Development Commands |
Cargo.toml |
rustc --version, cargo --version, cargo tree, cargo metadata |
cargo build, cargo run, cargo test, cargo check, cargo clippy, cargo fmt, cargo add, cargo remove |
Ruby
| If Detected |
Read-Only Commands |
Development Commands |
Gemfile |
ruby --version, bundle list, bundle show |
bundle install, bundle exec, bundle add |
Ruby frameworks:
| If Detected |
Development Commands |
| Rails |
rails (e.g., rails server, rails console, rails generate, rails db:migrate, rails db:seed, rails test, rails routes) |
| RSpec detected |
rspec, bundle exec rspec |
Java/Kotlin
| If Detected |
Read-Only Commands |
Development Commands |
pom.xml |
java --version, mvn --version, mvn dependency:tree |
mvn compile, mvn test, mvn package, mvn clean, mvn install |
build.gradle / build.gradle.kts |
java --version, gradle --version, gradle dependencies |
gradle build, gradle test, gradle clean, gradle run, ./gradlew |
.NET
| If Detected |
Read-Only Commands |
Development Commands |
*.csproj / *.sln |
dotnet --version, dotnet list package |
dotnet build, dotnet run, dotnet test, dotnet add package, dotnet remove package, dotnet ef |
Build Tools & Infrastructure
| If Detected |
Read-Only Commands |
Development Commands |
Dockerfile |
docker --version, docker ps, docker images |
docker build, docker run, docker exec, docker logs, docker stop, docker rm |
docker-compose.yml |
docker-compose ps, docker-compose config |
docker-compose up, docker-compose down, docker-compose build, docker-compose logs, docker-compose exec |
*.tf files |
terraform --version, terraform providers, terraform state list |
terraform plan, terraform apply, terraform init, terraform validate |
Makefile |
make --version, make -n |
make |
serverless.yml |
serverless --version |
serverless deploy, serverless invoke, serverless logs |
AWS CDK (aws-cdk in deps) |
cdk --version |
cdk synth, cdk diff, cdk deploy, cdk destroy |
Package Manager Exclusion Rules
Only include the package manager actually used by the project:
| If Detected |
Include |
Do NOT Include |
pnpm-lock.yaml |
pnpm commands |
npm, yarn, bun |
yarn.lock |
yarn commands |
npm, pnpm, bun |
bun.lockb |
bun commands |
npm, yarn, pnpm |
package-lock.json |
npm commands |
yarn, pnpm, bun |
poetry.lock |
poetry commands |
pip (unless also has requirements.txt) |
uv.lock |
uv commands |
pip, poetry |
Pipfile.lock |
pipenv commands |
pip, poetry |
If multiple lock files exist, include only the commands for each detected manager.
WebFetch Domains
Add documentation domains for detected frameworks:
| If Detected |
Add Domains |
| Django |
docs.djangoproject.com |
| Flask |
flask.palletsprojects.com |
| FastAPI |
fastapi.tiangolo.com |
| React |
react.dev |
| Next.js |
nextjs.org |
| Expo/React Native |
docs.expo.dev, reactnative.dev |
| Vite |
vite.dev |
| Tailwind CSS |
tailwindcss.com |
| Vue |
vuejs.org |
| Angular |
angular.dev |
| Svelte |
svelte.dev |
| Express |
expressjs.com |
| Rails |
guides.rubyonrails.org, api.rubyonrails.org |
| Laravel |
laravel.com |
| Magento |
developer.adobe.com |
| Go |
pkg.go.dev |
| Rust |
docs.rs, doc.rust-lang.org |
| Docker |
docs.docker.com |
| Kubernetes |
kubernetes.io |
| Terraform |
registry.terraform.io |
| AWS CDK |
docs.aws.amazon.com |
| Firebase |
firebase.google.com |
Always include general-purpose domains:
[
"WebFetch(domain:docs.github.com)",
"WebFetch(domain:cli.github.com)"
]
MCP Server Suggestions
MCP servers are configured in .mcp.json (not settings.local.json). Only suggest MCP servers for detected services.
# Check existing MCP config
cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"
Sentry MCP (if Sentry SDK detected)
{
"mcpServers": {
"sentry": {
"type": "http",
"url": "https://mcp.sentry.dev/mcp/{org-slug}/{project-slug}"
}
}
}
Linear MCP (if Linear usage detected)
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["-y", "@linear/mcp-server"],
"env": {
"LINEAR_API_KEY": "${LINEAR_API_KEY}"
}
}
}
}
Note: Never suggest GitHub MCP. Always use gh CLI commands for GitHub operations.
Step 5: Present Recommendations
Gate: User has reviewed the recommendations before proceeding to Step 6.
Present findings in this structure:
Output Format
## Detected Tech Stack
| Category | Found |
|----------|-------|
| Languages | [detected languages] |
| Package Manager | [detected manager] |
| Frameworks | [detected frameworks] |
| Services | [detected services] |
| Build Tools | [detected tools] |
| Monorepo | [yes/no, tool name] |
## Recommended .claude/settings.local.json
{complete JSON with grouped, commented permissions}
## Recommended .mcp.json (if applicable)
{MCP server config for detected services}
## Changes from Current Settings (if existing settings found)
| Change | Description |
|--------|------------|
| Added | [new commands for detected tools] |
| Removed | [stale commands for tools no longer detected] |
| Unchanged | [commands that remain the same] |
Use AskUserQuestion to confirm before writing any files:
- "Apply these settings?" with options to apply all, apply selectively, or just view
Step 6: Apply Settings
Gate: User approved the recommendations before writing files.
If the user approves:
- Write
.claude/settings.local.json with the recommended permissions
- Write
.mcp.json with MCP server suggestions (if applicable)
- If merging with existing settings, preserve user customizations (deny list, custom commands)
If existing settings exist, show a clear diff of what will change before writing.
Step 7: Verify Applied Settings
Gate: Settings files are valid JSON and contain expected content.
After writing:
- Verify
.claude/settings.local.json is valid JSON:
python3 -c "import json; json.load(open('.claude/settings.local.json'))" 2>&1 || echo "Invalid JSON"
- Verify
.mcp.json is valid JSON (if written):
python3 -c "import json; json.load(open('.mcp.json'))" 2>&1 || echo "Invalid JSON"
- Confirm all detected tools have corresponding commands in the settings
- Confirm no write/modify commands were included
Safety Rules
| Rule |
Reason |
| Never include destructive system commands |
No rm -rf, format, fdisk, or system-level destructive operations |
| Never include absolute paths |
Paths are user-specific and non-portable |
| Never include custom scripts |
Project scripts may have side effects; only standard tool commands |
| Never guess at tools |
Only include commands for tools detected via config/lock files |
| Never include wrong package manager |
If project uses pnpm, don't include npm/yarn commands |
| Always include development commands |
Claude needs build, test, run, install commands to work effectively |
| Always read existing settings first |
Preserve user customizations and deny lists |
| Always verify JSON validity |
Invalid settings.local.json breaks Claude Code |
| Always get user approval before writing |
User must review recommendations before files are modified |
| Never suggest GitHub MCP |
Use gh CLI commands for GitHub operations instead |
Quick Reference: Package Manager Detection
Lock file exists?
├── pnpm-lock.yaml → pnpm (exclude npm, yarn, bun)
├── yarn.lock → yarn (exclude npm, pnpm, bun)
├── bun.lockb → bun (exclude npm, yarn, pnpm)
├── package-lock.json → npm (exclude yarn, pnpm, bun)
├── poetry.lock → poetry (exclude pip unless requirements.txt also exists)
├── uv.lock → uv (exclude pip, poetry)
├── Pipfile.lock → pipenv (exclude pip, poetry)
├── Cargo.lock → cargo
├── Gemfile.lock → bundler
├── go.sum → go
└── composer.lock → composer
Step 8: Verification (MANDATORY)
After completing settings generation, verify the full workflow:
Check 1: Stack Detection Accuracy
Check 2: Command Safety
Check 3: Package Manager Correctness
Check 4: Settings Validity
Check 5: Completeness
Gate: Do NOT mark settings generation complete until all 5 checks pass.
Quality Checklist (Must Score 8/10)
Score yourself honestly before marking settings generation complete:
Stack Detection (0-2 points)
- 0 points: Assumed tech stack without reading config files
- 1 point: Detected some tools but missed others
- 2 points: Detected all languages, package managers, frameworks, services, and build tools from config/lock files
Command Accuracy (0-2 points)
- 0 points: Included commands for undetected tools or missed framework-specific commands
- 1 point: Mostly correct but included wrong package manager or missed development commands
- 2 points: Every command matches a detected tool, includes both read-only and development commands, correct package manager only
Existing Settings Handling (0-2 points)
- 0 points: Overwrote existing settings without reading them
- 1 point: Read existing settings but didn't preserve customizations
- 2 points: Read existing settings, preserved deny list and custom commands, showed clear diff
Output Quality (0-2 points)
- 0 points: Dumped raw JSON without explanation
- 1 point: Provided settings but missing summary table or grouping
- 2 points: Complete output: summary table, grouped/commented JSON, merge instructions if applicable
Verification (0-2 points)
- 0 points: Didn't verify JSON validity or command correctness
- 1 point: Verified JSON but didn't check for write commands or wrong package managers
- 2 points: Verified JSON validity, read-only compliance, package manager correctness, and completeness
Minimum passing score: 8/10
Common Rationalizations (All Wrong)
These are excuses. Don't fall for them:
- "Most projects use npm" → STILL detect the actual package manager from lock files
- "These extra commands might be useful" → STILL only include commands for detected tools
- "Any dev command is fine to include" → STILL verify each command is appropriate for the detected framework
- "The user can fix it later" → Get it right NOW; wrong settings cause permission friction
- "There's no existing settings.local.json" → STILL check; the user may have customizations elsewhere
- "I'll just include all package managers" → STILL exclude package managers not detected in the project
- "Absolute paths work on this machine" → STILL use only portable command names
- "This MCP server would be helpful" → STILL only suggest MCP servers for detected services
Failure Modes
Failure Mode 1: Wrong Package Manager
Symptom: Settings include npm commands but the project uses pnpm (or similar mismatch)
Fix: Always check lock files first. The lock file determines the package manager, not assumptions.
Failure Mode 2: Destructive Commands Included
Symptom: Settings allow rm -rf, system-level destructive operations, or commands that could cause data loss
Fix: Review every command for safety. Development commands (install, build, test, run) are fine; system-level destructive commands are not.
Failure Mode 3: Absolute Paths
Symptom: Settings include /Users/name/bin/tool or /home/user/.local/bin/script
Fix: Never include absolute paths. Only use bare command names that resolve via PATH.
Failure Mode 4: Stale Settings
Symptom: Settings include commands for tools removed from the project
Fix: Always detect the current stack before generating. Cross-reference existing settings against detected tools.
Failure Mode 5: Invalid JSON
Symptom: Claude Code fails to load settings because of JSON syntax errors
Fix: Always validate JSON after writing. Use python3 -c "import json; json.load(open(...))" to verify.
Quick Workflow Summary
STEP 1: DETECT TECH STACK
├── List root directory
├── Find config and lock files
├── Identify languages and package managers
└── Gate: All tools identified
STEP 2: DETECT FRAMEWORKS AND SERVICES
├── Read dependency files
├── Check for service integrations
└── Gate: All frameworks and services identified
STEP 3: CHECK EXISTING SETTINGS
├── Read .claude/settings.local.json
├── Read .mcp.json
├── Note gaps and stale entries
└── Gate: Current state understood
STEP 4: BUILD RECOMMENDATIONS
├── Start with baseline commands
├── Add stack-specific commands
├── Add WebFetch domains
├── Add MCP suggestions
├── Enforce package manager exclusion rules
└── Gate: Complete recommendation generated
STEP 5: PRESENT RECOMMENDATIONS
├── Show detected stack summary
├── Show recommended settings.local.json
├── Show changes from current (if applicable)
├── Get user approval
└── Gate: User reviewed
STEP 6: APPLY SETTINGS
├── Write .claude/settings.local.json
├── Write .mcp.json (if applicable)
├── Preserve existing customizations
└── Gate: User approved and files written
STEP 7: VERIFY SETTINGS
├── Validate JSON
├── Confirm read-only compliance
├── Confirm package manager correctness
└── Gate: Settings verified
STEP 8: VERIFICATION (MANDATORY)
├── Check 1: Stack detection accuracy
├── Check 2: Read-only compliance
├── Check 3: Package manager correctness
├── Check 4: Settings validity
├── Check 5: Completeness
└── Gate: All 5 checks pass
Completion Announcement
When settings generation is complete, announce:
Settings generation complete.
**Quality Score: X/10**
- Stack Detection: X/2
- Command Accuracy: X/2
- Existing Settings Handling: X/2
- Output Quality: X/2
- Verification: X/2
**Detected Stack:**
- Languages: [list]
- Package Manager: [name]
- Frameworks: [list]
- Services: [list]
- Build Tools: [list]
**Settings:**
- Commands allowed: [count]
- WebFetch domains: [count]
- MCP servers suggested: [count]
- Existing settings: [merged / new / unchanged]
**Verification:**
- JSON valid: ✅
- No destructive commands: ✅
- Correct package manager: ✅
- All tools covered (read-only + development): ✅
**Next steps:**
[Review settings in .claude/settings.local.json, restart Claude Code to apply]
Integration with Other Skills
The update-claude-settings skill integrates with:
start — Run update-claude-settings when setting up a new project
map-project — After mapping the project, update settings to match
commit — After generating settings, commit the changes
Workflow Chain:
New project setup
│
▼
update-claude-settings skill (this skill)
│
▼
commit skill (commit settings files)
│
▼
Begin development with correct permissions
1---2name: update-claude-settings-23description: Use when setting up a new project, auditing existing settings, or determining which read-only bash commands to allow. Analyzes the repository to detect tech stack, build tools, frameworks, services, and monorepo structure, then generates recommended Claude Code settings.local.json permissions and MCP server suggestions. Invoke via /update-claude-settings or when user says "audit settings", "setup permissions", "configure claude settings".4---56<EXTREMELY-IMPORTANT>7Before generating ANY settings recommendations, you **ABSOLUTELY MUST**:891. Detect the actual tech stack from lock files and config files (not assumptions)102. Read existing .claude/settings.local.json and .mcp.json to understand current state113. Include both read-only AND development commands appropriate for each detected tool124. Only include commands for tools actually detected in the project135. Never include absolute paths, user-specific paths, or destructive system commands1415**Generating settings without detection = wrong package manager commands, missing tools, security risks**1617This is not optional. Every recommendation requires stack verification.18</EXTREMELY-IMPORTANT>1920# Update Claude Settings2122## MANDATORY FIRST RESPONSE PROTOCOL2324Before generating ANY settings, you **MUST** complete this checklist:25261. ☐ List all files in the repository root (`ls -la`)272. ☐ Detect config and lock files (package.json, pyproject.toml, go.mod, Cargo.toml, etc.)283. ☐ Read dependency files to identify frameworks and libraries294. ☐ Check for monorepo indicators (lerna.json, nx.json, turbo.json, pnpm-workspace.yaml)305. ☐ Check for service integrations (Sentry, Linear, etc.)316. ☐ Read existing .claude/settings.local.json (if it exists)327. ☐ Read existing .mcp.json (if it exists)338. ☐ Announce: "Detected [stack]: generating settings for [N] command categories and [M] WebFetch domains"3435**Generating settings WITHOUT completing this checklist = wrong permissions and missed tools.**3637## Overview3839Analyze a repository to generate recommended Claude Code `settings.local.json` permissions for read-only commands. Detects the tech stack, build tools, frameworks, services, and monorepo structure to produce accurate, project-specific recommendations.4041**What this skill does:**42- Detects languages, package managers, frameworks, and build tools from config/lock files43- Detects service integrations (Sentry, Linear, etc.)44- Generates a complete `settings.local.json` with both read-only AND development commands45- Includes framework-specific commands Claude needs (artisan, next, expo, manage.py, cargo, etc.)46- Suggests relevant WebFetch domains for framework documentation47- Suggests MCP server configurations when applicable48- Merges with existing settings if present4950**What this skill does NOT do:**51- Install or configure any tools52- Modify code or project structure53- Include destructive system commands (rm -rf, format, etc.)54- Guess at tools not detected in the project55- Include user-specific or absolute paths5657## When to Use5859- User says "audit settings", "setup permissions", "configure claude settings", "/update-claude-settings"60- User is setting up a new project with Claude Code61- User wants to review or update existing Claude Code permissions62- $ARGUMENTS provided as guidance (e.g., `/update-claude-settings add docker commands`)6364**Never generate settings proactively.** Only when explicitly requested.6566## When NOT to Use6768- **Empty repository** — no files to detect; ask user to describe their stack instead69- **User wants to run commands** — this skill generates permission config, it doesn't execute project commands70- **User wants to modify code** — this skill only produces settings.local.json and .mcp.json recommendations71- **Settings are already comprehensive** — if existing settings cover the detected stack, say so7273## Step 1: Detect Tech Stack7475**Gate: All languages, package managers, and build tools identified before proceeding to Step 2.**7677Run detection commands:7879```bash80# List root directory contents81ls -la8283# Find config and lock files (up to 2 levels deep)84find . -maxdepth 2 \( -name "*.toml" -o -name "*.json" -o -name "*.lock" -o -name "*.yaml" -o -name "*.yml" -o -name "Makefile" -o -name "Dockerfile" -o -name "*.tf" \) 2>/dev/null | head -5085```8687Check for these indicator files:8889| Category | Files to Check |90|----------|---------------|91| **Python** | `pyproject.toml`, `setup.py`, `requirements.txt`, `Pipfile`, `poetry.lock`, `uv.lock` |92| **Node.js** | `package.json`, `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lockb` |93| **Go** | `go.mod`, `go.sum` |94| **Rust** | `Cargo.toml`, `Cargo.lock` |95| **Ruby** | `Gemfile`, `Gemfile.lock` |96| **Java/Kotlin** | `pom.xml`, `build.gradle`, `build.gradle.kts` |97| **PHP** | `composer.json`, `composer.lock` |98| **Swift/iOS** | `Package.swift`, `*.xcodeproj`, `*.xcworkspace`, `Podfile` |99| **.NET** | `*.csproj`, `*.sln`, `nuget.config` |100| **React Native** | `app.json` (with `expo` key), `metro.config.js`, `react-native.config.js`, `eas.json` |101| **Build** | `Makefile`, `Dockerfile`, `docker-compose.yml`, `docker-compose.yaml` |102| **Infra** | `*.tf` files, `kubernetes/`, `helm/`, `pulumi/`, `serverless.yml` |103| **Monorepo** | `lerna.json`, `nx.json`, `turbo.json`, `pnpm-workspace.yaml` |104105## Step 2: Detect Frameworks and Services106107**Gate: All frameworks and service integrations identified before proceeding to Step 3.**108109Read dependency files to identify frameworks:110111- `package.json` → check `dependencies` and `devDependencies`112- `pyproject.toml` → check `[project.dependencies]` or `[tool.poetry.dependencies]`113- `Gemfile` → check gem names114- `Cargo.toml` → check `[dependencies]`115- `composer.json` → check `require` and `require-dev`116- `go.mod` → check `require` block117118Check for framework-specific indicators:119120| Framework | Detection |121|-----------|-----------|122| **Next.js** | `next` in package.json deps, `next.config.js`/`next.config.mjs`/`next.config.ts` |123| **React (Vite)** | `vite` + `react` in package.json deps, `vite.config.ts`/`vite.config.js` |124| **Expo/React Native** | `expo` in package.json deps, `app.json` with `expo` key, `eas.json` |125| **Express** | `express` in package.json deps |126| **Laravel** | `laravel/framework` in composer.json require, `artisan` file in root |127| **Magento** | `magento/framework` in composer.json require, `bin/magento` |128| **Django** | `django` in Python deps |129| **FastAPI** | `fastapi` in Python deps |130| **Tailwind CSS** | `tailwindcss` in package.json deps, `tailwind.config.js`/`tailwind.config.ts` |131132Check for service integrations:133134| Service | Detection |135|---------|-----------|136| **Sentry** | `sentry-sdk` in deps, `@sentry/*` packages, `.sentryclirc`, `sentry.properties` |137| **Linear** | Linear config files, `.linear/` directory |138| **Datadog** | `dd-trace` in deps, `datadog.yaml` |139| **AWS** | `aws-cdk` in deps, `samconfig.toml`, `serverless.yml` |140| **Vercel** | `vercel.json`, `@vercel/*` packages |141| **Supabase** | `supabase/` directory, `@supabase/*` packages |142| **Firebase** | `firebase.json`, `@firebase/*` or `firebase-admin` in deps |143144## Step 3: Check Existing Settings145146**Gate: Current settings state understood before proceeding to Step 4.**147148Read existing configuration files:149150```bash151# Check existing Claude Code settings152cat .claude/settings.local.json 2>/dev/null || echo "No existing settings"153154# Check existing MCP config155cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"156```157158If existing settings are found:1591. Note which commands are already allowed1602. Note which commands are denied1613. Identify gaps (detected tools not in settings)1624. Identify stale entries (settings for tools no longer in the project)163164## Step 4: Build Recommendations165166**Gate: Complete recommendation generated before proceeding to Step 5.**167168Build the allow list by combining baseline commands with stack-specific commands.169170### Baseline Commands (Always Include)171172These read-only commands are safe and useful for any project:173174```json175[176 "Bash(ls:*)",177 "Bash(pwd:*)",178 "Bash(find:*)",179 "Bash(file:*)",180 "Bash(stat:*)",181 "Bash(wc:*)",182 "Bash(head:*)",183 "Bash(tail:*)",184 "Bash(cat:*)",185 "Bash(tree:*)",186 "Bash(git status:*)",187 "Bash(git log:*)",188 "Bash(git diff:*)",189 "Bash(git show:*)",190 "Bash(git branch:*)",191 "Bash(git remote:*)",192 "Bash(git tag:*)",193 "Bash(git stash list:*)",194 "Bash(git rev-parse:*)",195 "Bash(gh pr view:*)",196 "Bash(gh pr list:*)",197 "Bash(gh pr checks:*)",198 "Bash(gh pr diff:*)",199 "Bash(gh issue view:*)",200 "Bash(gh issue list:*)",201 "Bash(gh run view:*)",202 "Bash(gh run list:*)",203 "Bash(gh run logs:*)",204 "Bash(gh repo view:*)",205 "Bash(gh api:*)"206]207```208209### Stack-Specific Commands210211Only include commands for tools actually detected in the project. Each section is split into **read-only** (safe to auto-allow) and **development** (needed for Claude to work effectively with the framework) commands.212213#### Python214215| If Detected | Read-Only Commands | Development Commands |216|-------------|-------------------|---------------------|217| Any Python | `python --version`, `python3 --version` | `python`, `python3` |218| `poetry.lock` | `poetry show`, `poetry env info` | `poetry install`, `poetry add`, `poetry remove`, `poetry run`, `poetry lock` |219| `uv.lock` | `uv pip list`, `uv tree` | `uv pip install`, `uv add`, `uv remove`, `uv run`, `uv sync`, `uv lock` |220| `Pipfile.lock` | `pipenv graph` | `pipenv install`, `pipenv run` |221| `requirements.txt` (no other lock) | `pip list`, `pip show`, `pip freeze` | `pip install` |222| pytest detected | — | `pytest`, `python -m pytest` |223| mypy/pyright detected | — | `mypy`, `pyright` |224| ruff detected | — | `ruff check`, `ruff format` |225226**Python frameworks:**227228| If Detected | Development Commands |229|-------------|---------------------|230| **Django** | `python manage.py`, `django-admin` (e.g., `manage.py runserver`, `manage.py migrate`, `manage.py makemigrations`, `manage.py test`, `manage.py shell`, `manage.py createsuperuser`) |231| **FastAPI** | `uvicorn`, `fastapi` (e.g., `uvicorn main:app`, `fastapi dev`) |232| **Flask** | `flask run`, `flask shell` |233| **Celery** | `celery -A`, `celery worker`, `celery beat` |234| **Alembic** | `alembic upgrade`, `alembic downgrade`, `alembic revision`, `alembic history` |235236#### Node.js237238| If Detected | Read-Only Commands | Development Commands |239|-------------|-------------------|---------------------|240| Any Node.js | `node --version` | `node` |241| `pnpm-lock.yaml` | `pnpm list`, `pnpm why` | `pnpm install`, `pnpm add`, `pnpm remove`, `pnpm run`, `pnpm exec`, `pnpm dlx`, `pnpm test` |242| `yarn.lock` | `yarn list`, `yarn info`, `yarn why` | `yarn install`, `yarn add`, `yarn remove`, `yarn run`, `yarn dlx`, `yarn test` |243| `bun.lockb` | `bun --version` | `bun install`, `bun add`, `bun remove`, `bun run`, `bun test`, `bunx` |244| `package-lock.json` | `npm list`, `npm view`, `npm outdated` | `npm install`, `npm run`, `npm test`, `npm exec`, `npx` |245| TypeScript (`tsconfig.json`) | `tsc --version` | `tsc`, `tsc --noEmit`, `npx tsc` |246| ESLint detected | — | `eslint`, `npx eslint` |247| Prettier detected | — | `prettier`, `npx prettier` |248| Vitest detected | — | `vitest`, `npx vitest` |249| Jest detected | — | `jest`, `npx jest` |250251**Node.js frameworks:**252253| If Detected | Development Commands |254|-------------|---------------------|255| **Next.js** | `npx next build`, `npx next dev`, `npx next start`, `npx next lint`, `npx next info` |256| **Expo/React Native** | `npx expo start`, `npx expo prebuild`, `npx expo install`, `npx expo config`, `npx expo lint`, `eas build`, `eas update`, `eas submit`, `npx eas --version` |257| **Vite** | `npx vite`, `npx vite build`, `npx vite preview` |258| **Express** | (uses `node` and package manager `run` commands — no additional CLI) |259| **Tailwind CSS** | `npx tailwindcss`, `npx tailwindcss --watch` |260| **Storybook** | `npx storybook dev`, `npx storybook build` |261| **Prisma** | `npx prisma generate`, `npx prisma migrate`, `npx prisma db push`, `npx prisma db pull`, `npx prisma studio`, `npx prisma format` |262| **Drizzle** | `npx drizzle-kit generate`, `npx drizzle-kit migrate`, `npx drizzle-kit push`, `npx drizzle-kit studio` |263264#### PHP265266| If Detected | Read-Only Commands | Development Commands |267|-------------|-------------------|---------------------|268| `composer.json` | `php --version`, `composer show`, `composer info` | `php`, `composer install`, `composer require`, `composer remove`, `composer update`, `composer dump-autoload` |269| PHPUnit detected | — | `phpunit`, `./vendor/bin/phpunit` |270| PHPStan detected | — | `phpstan`, `./vendor/bin/phpstan` |271272**PHP frameworks:**273274| If Detected | Development Commands |275|-------------|---------------------|276| **Laravel** | `php artisan` (e.g., `artisan migrate`, `artisan make:model`, `artisan make:controller`, `artisan make:migration`, `artisan route:list`, `artisan config:show`, `artisan test`, `artisan tinker`, `artisan queue:work`, `artisan schedule:run`, `artisan db:seed`, `artisan cache:clear`, `artisan key:generate`, `artisan serve`) |277| **Magento** | `php bin/magento` (e.g., `bin/magento setup:upgrade`, `bin/magento cache:flush`, `bin/magento module:status`, `bin/magento indexer:reindex`, `bin/magento setup:di:compile`) |278| **Symfony** | `php bin/console` (e.g., `bin/console doctrine:migrations:migrate`, `bin/console make:entity`, `bin/console cache:clear`) |279280#### Go281282| If Detected | Read-Only Commands | Development Commands |283|-------------|-------------------|---------------------|284| `go.mod` | `go version`, `go list`, `go mod graph`, `go env` | `go build`, `go run`, `go test`, `go vet`, `go fmt`, `go mod tidy`, `go mod download`, `go generate`, `go get` |285| golangci-lint detected | — | `golangci-lint run` |286287#### Rust288289| If Detected | Read-Only Commands | Development Commands |290|-------------|-------------------|---------------------|291| `Cargo.toml` | `rustc --version`, `cargo --version`, `cargo tree`, `cargo metadata` | `cargo build`, `cargo run`, `cargo test`, `cargo check`, `cargo clippy`, `cargo fmt`, `cargo add`, `cargo remove` |292293#### Ruby294295| If Detected | Read-Only Commands | Development Commands |296|-------------|-------------------|---------------------|297| `Gemfile` | `ruby --version`, `bundle list`, `bundle show` | `bundle install`, `bundle exec`, `bundle add` |298299**Ruby frameworks:**300301| If Detected | Development Commands |302|-------------|---------------------|303| **Rails** | `rails` (e.g., `rails server`, `rails console`, `rails generate`, `rails db:migrate`, `rails db:seed`, `rails test`, `rails routes`) |304| RSpec detected | `rspec`, `bundle exec rspec` |305306#### Java/Kotlin307308| If Detected | Read-Only Commands | Development Commands |309|-------------|-------------------|---------------------|310| `pom.xml` | `java --version`, `mvn --version`, `mvn dependency:tree` | `mvn compile`, `mvn test`, `mvn package`, `mvn clean`, `mvn install` |311| `build.gradle` / `build.gradle.kts` | `java --version`, `gradle --version`, `gradle dependencies` | `gradle build`, `gradle test`, `gradle clean`, `gradle run`, `./gradlew` |312313#### .NET314315| If Detected | Read-Only Commands | Development Commands |316|-------------|-------------------|---------------------|317| `*.csproj` / `*.sln` | `dotnet --version`, `dotnet list package` | `dotnet build`, `dotnet run`, `dotnet test`, `dotnet add package`, `dotnet remove package`, `dotnet ef` |318319#### Build Tools & Infrastructure320321| If Detected | Read-Only Commands | Development Commands |322|-------------|-------------------|---------------------|323| `Dockerfile` | `docker --version`, `docker ps`, `docker images` | `docker build`, `docker run`, `docker exec`, `docker logs`, `docker stop`, `docker rm` |324| `docker-compose.yml` | `docker-compose ps`, `docker-compose config` | `docker-compose up`, `docker-compose down`, `docker-compose build`, `docker-compose logs`, `docker-compose exec` |325| `*.tf` files | `terraform --version`, `terraform providers`, `terraform state list` | `terraform plan`, `terraform apply`, `terraform init`, `terraform validate` |326| `Makefile` | `make --version`, `make -n` | `make` |327| `serverless.yml` | `serverless --version` | `serverless deploy`, `serverless invoke`, `serverless logs` |328| AWS CDK (`aws-cdk` in deps) | `cdk --version` | `cdk synth`, `cdk diff`, `cdk deploy`, `cdk destroy` |329330### Package Manager Exclusion Rules331332Only include the package manager actually used by the project:333334| If Detected | Include | Do NOT Include |335|-------------|---------|---------------|336| `pnpm-lock.yaml` | pnpm commands | npm, yarn, bun |337| `yarn.lock` | yarn commands | npm, pnpm, bun |338| `bun.lockb` | bun commands | npm, yarn, pnpm |339| `package-lock.json` | npm commands | yarn, pnpm, bun |340| `poetry.lock` | poetry commands | pip (unless also has requirements.txt) |341| `uv.lock` | uv commands | pip, poetry |342| `Pipfile.lock` | pipenv commands | pip, poetry |343344If multiple lock files exist, include only the commands for each detected manager.345346### WebFetch Domains347348Add documentation domains for detected frameworks:349350| If Detected | Add Domains |351|-------------|------------|352| **Django** | `docs.djangoproject.com` |353| **Flask** | `flask.palletsprojects.com` |354| **FastAPI** | `fastapi.tiangolo.com` |355| **React** | `react.dev` |356| **Next.js** | `nextjs.org` |357| **Expo/React Native** | `docs.expo.dev`, `reactnative.dev` |358| **Vite** | `vite.dev` |359| **Tailwind CSS** | `tailwindcss.com` |360| **Vue** | `vuejs.org` |361| **Angular** | `angular.dev` |362| **Svelte** | `svelte.dev` |363| **Express** | `expressjs.com` |364| **Rails** | `guides.rubyonrails.org`, `api.rubyonrails.org` |365| **Laravel** | `laravel.com` |366| **Magento** | `developer.adobe.com` |367| **Go** | `pkg.go.dev` |368| **Rust** | `docs.rs`, `doc.rust-lang.org` |369| **Docker** | `docs.docker.com` |370| **Kubernetes** | `kubernetes.io` |371| **Terraform** | `registry.terraform.io` |372| **AWS CDK** | `docs.aws.amazon.com` |373| **Firebase** | `firebase.google.com` |374375Always include general-purpose domains:376377```json378[379 "WebFetch(domain:docs.github.com)",380 "WebFetch(domain:cli.github.com)"381]382```383384### MCP Server Suggestions385386MCP servers are configured in `.mcp.json` (not `settings.local.json`). Only suggest MCP servers for detected services.387388```bash389# Check existing MCP config390cat .mcp.json 2>/dev/null || echo "No existing .mcp.json"391```392393#### Sentry MCP (if Sentry SDK detected)394395```json396{397 "mcpServers": {398 "sentry": {399 "type": "http",400 "url": "https://mcp.sentry.dev/mcp/{org-slug}/{project-slug}"401 }402 }403}404```405406#### Linear MCP (if Linear usage detected)407408```json409{410 "mcpServers": {411 "linear": {412 "command": "npx",413 "args": ["-y", "@linear/mcp-server"],414 "env": {415 "LINEAR_API_KEY": "${LINEAR_API_KEY}"416 }417 }418 }419}420```421422**Note:** Never suggest GitHub MCP. Always use `gh` CLI commands for GitHub operations.423424## Step 5: Present Recommendations425426**Gate: User has reviewed the recommendations before proceeding to Step 6.**427428Present findings in this structure:429430### Output Format431432```433## Detected Tech Stack434435| Category | Found |436|----------|-------|437| Languages | [detected languages] |438| Package Manager | [detected manager] |439| Frameworks | [detected frameworks] |440| Services | [detected services] |441| Build Tools | [detected tools] |442| Monorepo | [yes/no, tool name] |443444## Recommended .claude/settings.local.json445446{complete JSON with grouped, commented permissions}447448## Recommended .mcp.json (if applicable)449450{MCP server config for detected services}451452## Changes from Current Settings (if existing settings found)453454| Change | Description |455|--------|------------|456| Added | [new commands for detected tools] |457| Removed | [stale commands for tools no longer detected] |458| Unchanged | [commands that remain the same] |459```460461Use AskUserQuestion to confirm before writing any files:462- "Apply these settings?" with options to apply all, apply selectively, or just view463464## Step 6: Apply Settings465466**Gate: User approved the recommendations before writing files.**467468If the user approves:4694701. Write `.claude/settings.local.json` with the recommended permissions4712. Write `.mcp.json` with MCP server suggestions (if applicable)4723. If merging with existing settings, preserve user customizations (deny list, custom commands)473474If existing settings exist, show a clear diff of what will change before writing.475476## Step 7: Verify Applied Settings477478**Gate: Settings files are valid JSON and contain expected content.**479480After writing:4814821. Verify `.claude/settings.local.json` is valid JSON:483484```bash485python3 -c "import json; json.load(open('.claude/settings.local.json'))" 2>&1 || echo "Invalid JSON"486```4874882. Verify `.mcp.json` is valid JSON (if written):489490```bash491python3 -c "import json; json.load(open('.mcp.json'))" 2>&1 || echo "Invalid JSON"492```4934943. Confirm all detected tools have corresponding commands in the settings4954. Confirm no write/modify commands were included496497---498499## Safety Rules500501| Rule | Reason |502|------|--------|503| Never include destructive system commands | No `rm -rf`, `format`, `fdisk`, or system-level destructive operations |504| Never include absolute paths | Paths are user-specific and non-portable |505| Never include custom scripts | Project scripts may have side effects; only standard tool commands |506| Never guess at tools | Only include commands for tools detected via config/lock files |507| Never include wrong package manager | If project uses pnpm, don't include npm/yarn commands |508| Always include development commands | Claude needs build, test, run, install commands to work effectively |509| Always read existing settings first | Preserve user customizations and deny lists |510| Always verify JSON validity | Invalid settings.local.json breaks Claude Code |511| Always get user approval before writing | User must review recommendations before files are modified |512| Never suggest GitHub MCP | Use `gh` CLI commands for GitHub operations instead |513514---515516## Quick Reference: Package Manager Detection517518```519Lock file exists?520├── pnpm-lock.yaml → pnpm (exclude npm, yarn, bun)521├── yarn.lock → yarn (exclude npm, pnpm, bun)522├── bun.lockb → bun (exclude npm, yarn, pnpm)523├── package-lock.json → npm (exclude yarn, pnpm, bun)524├── poetry.lock → poetry (exclude pip unless requirements.txt also exists)525├── uv.lock → uv (exclude pip, poetry)526├── Pipfile.lock → pipenv (exclude pip, poetry)527├── Cargo.lock → cargo528├── Gemfile.lock → bundler529├── go.sum → go530└── composer.lock → composer531```532533---534535## Step 8: Verification (MANDATORY)536537After completing settings generation, verify the full workflow:538539### Check 1: Stack Detection Accuracy540- [ ] Every language detected has corresponding commands in settings541- [ ] No commands included for undetected tools542543### Check 2: Command Safety544- [ ] No destructive system commands included (rm -rf, format, fdisk, etc.)545- [ ] No absolute paths or user-specific paths included546- [ ] Development commands are appropriate for detected frameworks547548### Check 3: Package Manager Correctness549- [ ] Only the detected package manager's commands are included550- [ ] No competing package manager commands present551552### Check 4: Settings Validity553- [ ] `.claude/settings.local.json` is valid JSON (if written)554- [ ] `.mcp.json` is valid JSON (if written)555556### Check 5: Completeness557- [ ] WebFetch domains included for detected frameworks558- [ ] MCP suggestions provided for detected services559- [ ] Existing settings preserved where applicable560561**Gate:** Do NOT mark settings generation complete until all 5 checks pass.562563---564565## Quality Checklist (Must Score 8/10)566567Score yourself honestly before marking settings generation complete:568569### Stack Detection (0-2 points)570- **0 points:** Assumed tech stack without reading config files571- **1 point:** Detected some tools but missed others572- **2 points:** Detected all languages, package managers, frameworks, services, and build tools from config/lock files573574### Command Accuracy (0-2 points)575- **0 points:** Included commands for undetected tools or missed framework-specific commands576- **1 point:** Mostly correct but included wrong package manager or missed development commands577- **2 points:** Every command matches a detected tool, includes both read-only and development commands, correct package manager only578579### Existing Settings Handling (0-2 points)580- **0 points:** Overwrote existing settings without reading them581- **1 point:** Read existing settings but didn't preserve customizations582- **2 points:** Read existing settings, preserved deny list and custom commands, showed clear diff583584### Output Quality (0-2 points)585- **0 points:** Dumped raw JSON without explanation586- **1 point:** Provided settings but missing summary table or grouping587- **2 points:** Complete output: summary table, grouped/commented JSON, merge instructions if applicable588589### Verification (0-2 points)590- **0 points:** Didn't verify JSON validity or command correctness591- **1 point:** Verified JSON but didn't check for write commands or wrong package managers592- **2 points:** Verified JSON validity, read-only compliance, package manager correctness, and completeness593594**Minimum passing score: 8/10**595596---597598## Common Rationalizations (All Wrong)599600These are excuses. Don't fall for them:601602- **"Most projects use npm"** → STILL detect the actual package manager from lock files603- **"These extra commands might be useful"** → STILL only include commands for detected tools604- **"Any dev command is fine to include"** → STILL verify each command is appropriate for the detected framework605- **"The user can fix it later"** → Get it right NOW; wrong settings cause permission friction606- **"There's no existing settings.local.json"** → STILL check; the user may have customizations elsewhere607- **"I'll just include all package managers"** → STILL exclude package managers not detected in the project608- **"Absolute paths work on this machine"** → STILL use only portable command names609- **"This MCP server would be helpful"** → STILL only suggest MCP servers for detected services610611---612613## Failure Modes614615### Failure Mode 1: Wrong Package Manager616617**Symptom:** Settings include npm commands but the project uses pnpm (or similar mismatch)618**Fix:** Always check lock files first. The lock file determines the package manager, not assumptions.619620### Failure Mode 2: Destructive Commands Included621622**Symptom:** Settings allow `rm -rf`, system-level destructive operations, or commands that could cause data loss623**Fix:** Review every command for safety. Development commands (install, build, test, run) are fine; system-level destructive commands are not.624625### Failure Mode 3: Absolute Paths626627**Symptom:** Settings include `/Users/name/bin/tool` or `/home/user/.local/bin/script`628**Fix:** Never include absolute paths. Only use bare command names that resolve via PATH.629630### Failure Mode 4: Stale Settings631632**Symptom:** Settings include commands for tools removed from the project633**Fix:** Always detect the current stack before generating. Cross-reference existing settings against detected tools.634635### Failure Mode 5: Invalid JSON636637**Symptom:** Claude Code fails to load settings because of JSON syntax errors638**Fix:** Always validate JSON after writing. Use `python3 -c "import json; json.load(open(...))"` to verify.639640---641642## Quick Workflow Summary643644```645STEP 1: DETECT TECH STACK646├── List root directory647├── Find config and lock files648├── Identify languages and package managers649└── Gate: All tools identified650651STEP 2: DETECT FRAMEWORKS AND SERVICES652├── Read dependency files653├── Check for service integrations654└── Gate: All frameworks and services identified655656STEP 3: CHECK EXISTING SETTINGS657├── Read .claude/settings.local.json658├── Read .mcp.json659├── Note gaps and stale entries660└── Gate: Current state understood661662STEP 4: BUILD RECOMMENDATIONS663├── Start with baseline commands664├── Add stack-specific commands665├── Add WebFetch domains666├── Add MCP suggestions667├── Enforce package manager exclusion rules668└── Gate: Complete recommendation generated669670STEP 5: PRESENT RECOMMENDATIONS671├── Show detected stack summary672├── Show recommended settings.local.json673├── Show changes from current (if applicable)674├── Get user approval675└── Gate: User reviewed676677STEP 6: APPLY SETTINGS678├── Write .claude/settings.local.json679├── Write .mcp.json (if applicable)680├── Preserve existing customizations681└── Gate: User approved and files written682683STEP 7: VERIFY SETTINGS684├── Validate JSON685├── Confirm read-only compliance686├── Confirm package manager correctness687└── Gate: Settings verified688689STEP 8: VERIFICATION (MANDATORY)690├── Check 1: Stack detection accuracy691├── Check 2: Read-only compliance692├── Check 3: Package manager correctness693├── Check 4: Settings validity694├── Check 5: Completeness695└── Gate: All 5 checks pass696```697698---699700## Completion Announcement701702When settings generation is complete, announce:703704```705Settings generation complete.706707**Quality Score: X/10**708- Stack Detection: X/2709- Command Accuracy: X/2710- Existing Settings Handling: X/2711- Output Quality: X/2712- Verification: X/2713714**Detected Stack:**715- Languages: [list]716- Package Manager: [name]717- Frameworks: [list]718- Services: [list]719- Build Tools: [list]720721**Settings:**722- Commands allowed: [count]723- WebFetch domains: [count]724- MCP servers suggested: [count]725- Existing settings: [merged / new / unchanged]726727**Verification:**728- JSON valid: ✅729- No destructive commands: ✅730- Correct package manager: ✅731- All tools covered (read-only + development): ✅732733**Next steps:**734[Review settings in .claude/settings.local.json, restart Claude Code to apply]735```736737---738739## Integration with Other Skills740741The `update-claude-settings` skill integrates with:742743- **`start`** — Run `update-claude-settings` when setting up a new project744- **`map-project`** — After mapping the project, update settings to match745- **`commit`** — After generating settings, commit the changes746747**Workflow Chain:**748749```750New project setup751 │752 ▼753update-claude-settings skill (this skill)754 │755 ▼756commit skill (commit settings files)757 │758 ▼759Begin development with correct permissions760```