Skip to content

Commit fcc9f97

Browse files
committed
Setup permissions once.
Signed-off-by: Lars Marowsky-Bree <lars@marowsky-bree.eu>
1 parent bbfa3d8 commit fcc9f97

8 files changed

Lines changed: 63 additions & 1 deletion

File tree

skills/py-code-health/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Remove dead code and consolidate duplication to keep codebase clean and maintain
2323
- **vulture**: AST-based dead code detection
2424
- **pylint**: Duplicate code detection
2525

26+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
27+
2628
## Dead Code Detection
2729

2830
### Find Unused Code

skills/py-complexity/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Effective use of context windows.
2828
- **xenon**: CI/CD threshold enforcement
2929
- **wily**: Track trends across git history
3030

31+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
32+
3133
## Discovery Phase
3234

3335
### Measure Complexity

skills/py-git-hooks/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Configure git pre-commit hooks using the pre-commit framework to enforce code qu
2525
- **mypy**: Standard Python type checker
2626
- **basedpyright**: Enhanced type analysis
2727

28+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
29+
2830
## Setup Workflow
2931

3032
### Step 1: Check for Existing Hooks

skills/py-modernize/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Upgrade Python projects to use modern tooling, syntax, and patterns following En
2525
- **pyupgrade**: Auto-upgrade syntax to newer Python
2626
- **ruff**: Modern linter with UP rules
2727

28+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
29+
2830
## Package Manager: pip → uv
2931

3032
### Why uv?

skills/py-quality-setup/SKILL.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,55 @@ A.When using `pyrightconfig.json` for multi-package projects, REMOVE the `tool.b
161161
basedpyright .
162162
```
163163

164-
6. **Configure git hooks** (if requested)
164+
6. **Configure Claude Code permissions**
165+
166+
Write `.claude/settings.local.json` so all py-* skills can run without permission prompts. If the file already exists, merge new entries into the existing `allow` list without removing user entries.
167+
168+
```json
169+
{
170+
"permissions": {
171+
"allow": [
172+
"Bash(ruff *)",
173+
"Bash(mypy *)",
174+
"Bash(basedpyright *)",
175+
"Bash(pytest *)",
176+
"Bash(vulture *)",
177+
"Bash(pylint *)",
178+
"Bash(radon *)",
179+
"Bash(lizard *)",
180+
"Bash(wily *)",
181+
"Bash(bandit *)",
182+
"Bash(mutmut *)",
183+
"Bash(pyupgrade *)",
184+
"Bash(scc *)",
185+
"Bash(pre-commit *)",
186+
"Bash(uv *)",
187+
"Bash(pip *)",
188+
"Bash(python3 *)",
189+
"Bash(python *)",
190+
"Bash(source *)",
191+
"Bash(which *)",
192+
"Bash(mkdir *)",
193+
"Bash(chmod *)",
194+
"Bash(ls *)",
195+
"Bash(cp *)",
196+
"Bash(git add *)",
197+
"Bash(git diff *)",
198+
"Bash(git status *)",
199+
"Bash(git log *)",
200+
"Bash(git ls-files *)",
201+
"Bash(git checkout *)",
202+
"Bash(git branch *)",
203+
"Bash(git commit *)"
204+
],
205+
"deny": []
206+
}
207+
}
208+
```
209+
210+
**Merge logic**: Read existing file, parse JSON, take union of `allow` lists, write back. Create `.claude/` directory if needed.
211+
212+
7. **Configure git hooks** (if requested)
165213
- Set up pre-commit hook to run linters
166214
- See py-git-hooks skill
167215

@@ -214,6 +262,7 @@ ignore_missing_imports = true
214262
- [ ] ruff check passes (or only expected errors)
215263
- [ ] mypy . passes (or only expected errors)
216264
- [ ] basedpyright . passes (or only expected errors)
265+
- [ ] `.claude/settings.local.json` exists with permissions for all quality tools
217266

218267
## Examples
219268

skills/py-refactor/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Follow this impact-based prioritization:
3838
```
3939
1. If quality tools not configured (pyproject.toml):
4040
→ Invoke: py-quality-setup
41+
(also configures .claude/settings.local.json permissions for all tools)
4142
4243
2. Add analysis tools to [dependency-groups] dev in pyproject.toml:
4344
"radon", "vulture", "pylint", "bandit", "lizard",

skills/py-security/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Find and fix security vulnerabilities in Python code following Engineering Chart
2424
- **bandit**: AST-based security scanner
2525
- **ruff --select S**: Built-in Bandit rules (faster alternative)
2626

27+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
28+
2729
## Discovery Phase
2830

2931
### Run Security Scanners

skills/py-test-quality/SKILL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Measure test coverage and verify test suite effectiveness using coverage analysi
2525
- **mutmut**: Mutation testing - verifies tests catch bugs
2626
- **cosmic-ray**: Advanced mutation testing (slower)
2727

28+
**Permissions**: Run py-quality-setup first to configure `.claude/settings.local.json` with all needed tool permissions.
29+
2830
## Coverage Analysis
2931

3032
### Measure Coverage

0 commit comments

Comments
 (0)