safeword 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/check-3NGQ4NR5.js +129 -0
- package/dist/check-3NGQ4NR5.js.map +1 -0
- package/dist/chunk-2XWIUEQK.js +190 -0
- package/dist/chunk-2XWIUEQK.js.map +1 -0
- package/dist/chunk-GZRQL3SX.js +146 -0
- package/dist/chunk-GZRQL3SX.js.map +1 -0
- package/dist/chunk-ORQHKDT2.js +10 -0
- package/dist/chunk-ORQHKDT2.js.map +1 -0
- package/dist/chunk-W66Z3C5H.js +21 -0
- package/dist/chunk-W66Z3C5H.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +34 -0
- package/dist/cli.js.map +1 -0
- package/dist/diff-Y6QTAW4O.js +166 -0
- package/dist/diff-Y6QTAW4O.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/reset-3ACTIYYE.js +143 -0
- package/dist/reset-3ACTIYYE.js.map +1 -0
- package/dist/setup-RR4M334C.js +266 -0
- package/dist/setup-RR4M334C.js.map +1 -0
- package/dist/upgrade-6AR3DHUV.js +134 -0
- package/dist/upgrade-6AR3DHUV.js.map +1 -0
- package/package.json +44 -19
- package/{.safeword → templates}/hooks/agents-md-check.sh +0 -0
- package/{.safeword → templates}/hooks/post-tool.sh +0 -0
- package/{.safeword → templates}/hooks/pre-commit.sh +0 -0
- package/.claude/commands/arch-review.md +0 -32
- package/.claude/commands/lint.md +0 -6
- package/.claude/commands/quality-review.md +0 -13
- package/.claude/commands/setup-linting.md +0 -6
- package/.claude/hooks/auto-lint.sh +0 -6
- package/.claude/hooks/auto-quality-review.sh +0 -170
- package/.claude/hooks/check-linting-sync.sh +0 -17
- package/.claude/hooks/inject-timestamp.sh +0 -6
- package/.claude/hooks/question-protocol.sh +0 -12
- package/.claude/hooks/run-linters.sh +0 -8
- package/.claude/hooks/run-quality-review.sh +0 -76
- package/.claude/hooks/version-check.sh +0 -10
- package/.claude/mcp/README.md +0 -96
- package/.claude/mcp/arcade.sample.json +0 -9
- package/.claude/mcp/context7.sample.json +0 -7
- package/.claude/mcp/playwright.sample.json +0 -7
- package/.claude/settings.json +0 -62
- package/.claude/skills/quality-reviewer/SKILL.md +0 -190
- package/.claude/skills/safeword-quality-reviewer/SKILL.md +0 -13
- package/.env.arcade.example +0 -4
- package/.env.example +0 -11
- package/.gitmodules +0 -4
- package/.safeword/SAFEWORD.md +0 -33
- package/.safeword/eslint/eslint-base.mjs +0 -101
- package/.safeword/guides/architecture-guide.md +0 -404
- package/.safeword/guides/code-philosophy.md +0 -174
- package/.safeword/guides/context-files-guide.md +0 -405
- package/.safeword/guides/data-architecture-guide.md +0 -183
- package/.safeword/guides/design-doc-guide.md +0 -165
- package/.safeword/guides/learning-extraction.md +0 -515
- package/.safeword/guides/llm-instruction-design.md +0 -239
- package/.safeword/guides/llm-prompting.md +0 -95
- package/.safeword/guides/tdd-best-practices.md +0 -570
- package/.safeword/guides/test-definitions-guide.md +0 -243
- package/.safeword/guides/testing-methodology.md +0 -573
- package/.safeword/guides/user-story-guide.md +0 -237
- package/.safeword/guides/zombie-process-cleanup.md +0 -214
- package/.safeword/planning/002-user-story-quality-evaluation.md +0 -1840
- package/.safeword/planning/003-langsmith-eval-setup-prompt.md +0 -363
- package/.safeword/planning/004-llm-eval-test-cases.md +0 -3226
- package/.safeword/planning/005-architecture-enforcement-system.md +0 -169
- package/.safeword/planning/006-reactive-fix-prevention-research.md +0 -135
- package/.safeword/planning/011-cli-ux-vision.md +0 -330
- package/.safeword/planning/012-project-structure-cleanup.md +0 -154
- package/.safeword/planning/README.md +0 -39
- package/.safeword/planning/automation-plan-v2.md +0 -1225
- package/.safeword/planning/automation-plan-v3.md +0 -1291
- package/.safeword/planning/automation-plan.md +0 -3058
- package/.safeword/planning/design/005-cli-implementation.md +0 -343
- package/.safeword/planning/design/013-cli-self-contained-templates.md +0 -596
- package/.safeword/planning/design/013a-eslint-plugin-suite.md +0 -256
- package/.safeword/planning/design/013b-implementation-snippets.md +0 -385
- package/.safeword/planning/design/013c-config-isolation-strategy.md +0 -242
- package/.safeword/planning/design/code-philosophy-improvements.md +0 -60
- package/.safeword/planning/mcp-analysis.md +0 -545
- package/.safeword/planning/phase2-subagents-vs-skills-analysis.md +0 -451
- package/.safeword/planning/settings-improvements.md +0 -970
- package/.safeword/planning/test-definitions/005-cli-implementation.md +0 -1301
- package/.safeword/planning/test-definitions/cli-self-contained-templates.md +0 -205
- package/.safeword/planning/user-stories/001-guides-review-user-stories.md +0 -1381
- package/.safeword/planning/user-stories/003-reactive-fix-prevention.md +0 -132
- package/.safeword/planning/user-stories/004-technical-constraints.md +0 -86
- package/.safeword/planning/user-stories/005-cli-implementation.md +0 -311
- package/.safeword/planning/user-stories/cli-self-contained-templates.md +0 -172
- package/.safeword/planning/versioned-distribution.md +0 -740
- package/.safeword/prompts/arch-review.md +0 -43
- package/.safeword/prompts/quality-review.md +0 -11
- package/.safeword/scripts/arch-review.sh +0 -235
- package/.safeword/scripts/check-linting-sync.sh +0 -58
- package/.safeword/scripts/setup-linting.sh +0 -559
- package/.safeword/templates/architecture-template.md +0 -136
- package/.safeword/templates/ci/architecture-check.yml +0 -79
- package/.safeword/templates/design-doc-template.md +0 -127
- package/.safeword/templates/test-definitions-feature.md +0 -100
- package/.safeword/templates/ticket-template.md +0 -74
- package/.safeword/templates/user-stories-template.md +0 -82
- package/.safeword/tickets/001-guides-review-user-stories.md +0 -83
- package/.safeword/tickets/002-architecture-enforcement.md +0 -211
- package/.safeword/tickets/003-reactive-fix-prevention.md +0 -57
- package/.safeword/tickets/004-technical-constraints-in-user-stories.md +0 -39
- package/.safeword/tickets/005-cli-implementation.md +0 -248
- package/.safeword/tickets/006-flesh-out-skills.md +0 -43
- package/.safeword/tickets/007-flesh-out-questioning.md +0 -44
- package/.safeword/tickets/008-upgrade-questioning.md +0 -58
- package/.safeword/tickets/009-naming-conventions.md +0 -41
- package/.safeword/tickets/010-safeword-md-cleanup.md +0 -34
- package/.safeword/tickets/011-cursor-setup.md +0 -86
- package/.safeword/tickets/README.md +0 -73
- package/.safeword/version +0 -1
- package/AGENTS.md +0 -59
- package/CLAUDE.md +0 -12
- package/README.md +0 -347
- package/docs/001-cli-implementation-plan.md +0 -856
- package/docs/elite-dx-implementation-plan.md +0 -1034
- package/framework/README.md +0 -131
- package/framework/mcp/README.md +0 -96
- package/framework/mcp/arcade.sample.json +0 -8
- package/framework/mcp/context7.sample.json +0 -6
- package/framework/mcp/playwright.sample.json +0 -6
- package/framework/scripts/arch-review.sh +0 -235
- package/framework/scripts/check-linting-sync.sh +0 -58
- package/framework/scripts/load-env.sh +0 -49
- package/framework/scripts/setup-claude.sh +0 -223
- package/framework/scripts/setup-linting.sh +0 -559
- package/framework/scripts/setup-quality.sh +0 -477
- package/framework/scripts/setup-safeword.sh +0 -550
- package/framework/templates/ci/architecture-check.yml +0 -78
- package/learnings/ai-sdk-v5-breaking-changes.md +0 -178
- package/learnings/e2e-test-zombie-processes.md +0 -231
- package/learnings/milkdown-crepe-editor-property.md +0 -96
- package/learnings/prosemirror-fragment-traversal.md +0 -119
- package/packages/cli/AGENTS.md +0 -1
- package/packages/cli/ARCHITECTURE.md +0 -279
- package/packages/cli/package.json +0 -51
- package/packages/cli/src/cli.ts +0 -63
- package/packages/cli/src/commands/check.ts +0 -166
- package/packages/cli/src/commands/diff.ts +0 -209
- package/packages/cli/src/commands/reset.ts +0 -190
- package/packages/cli/src/commands/setup.ts +0 -325
- package/packages/cli/src/commands/upgrade.ts +0 -163
- package/packages/cli/src/index.ts +0 -3
- package/packages/cli/src/templates/config.ts +0 -58
- package/packages/cli/src/templates/content.ts +0 -18
- package/packages/cli/src/templates/index.ts +0 -12
- package/packages/cli/src/utils/agents-md.ts +0 -66
- package/packages/cli/src/utils/fs.ts +0 -179
- package/packages/cli/src/utils/git.ts +0 -124
- package/packages/cli/src/utils/hooks.ts +0 -29
- package/packages/cli/src/utils/output.ts +0 -60
- package/packages/cli/src/utils/project-detector.test.ts +0 -185
- package/packages/cli/src/utils/project-detector.ts +0 -44
- package/packages/cli/src/utils/version.ts +0 -28
- package/packages/cli/src/version.ts +0 -6
- package/packages/cli/templates/SAFEWORD.md +0 -776
- package/packages/cli/templates/doc-templates/architecture-template.md +0 -136
- package/packages/cli/templates/doc-templates/design-doc-template.md +0 -134
- package/packages/cli/templates/doc-templates/test-definitions-feature.md +0 -131
- package/packages/cli/templates/doc-templates/ticket-template.md +0 -82
- package/packages/cli/templates/doc-templates/user-stories-template.md +0 -92
- package/packages/cli/templates/guides/architecture-guide.md +0 -423
- package/packages/cli/templates/guides/code-philosophy.md +0 -195
- package/packages/cli/templates/guides/context-files-guide.md +0 -457
- package/packages/cli/templates/guides/data-architecture-guide.md +0 -200
- package/packages/cli/templates/guides/design-doc-guide.md +0 -171
- package/packages/cli/templates/guides/learning-extraction.md +0 -552
- package/packages/cli/templates/guides/llm-instruction-design.md +0 -248
- package/packages/cli/templates/guides/llm-prompting.md +0 -102
- package/packages/cli/templates/guides/tdd-best-practices.md +0 -615
- package/packages/cli/templates/guides/test-definitions-guide.md +0 -334
- package/packages/cli/templates/guides/testing-methodology.md +0 -618
- package/packages/cli/templates/guides/user-story-guide.md +0 -256
- package/packages/cli/templates/guides/zombie-process-cleanup.md +0 -219
- package/packages/cli/templates/hooks/agents-md-check.sh +0 -27
- package/packages/cli/templates/hooks/post-tool.sh +0 -4
- package/packages/cli/templates/hooks/pre-commit.sh +0 -10
- package/packages/cli/templates/prompts/arch-review.md +0 -43
- package/packages/cli/templates/prompts/quality-review.md +0 -10
- package/packages/cli/templates/skills/safeword-quality-reviewer/SKILL.md +0 -207
- package/packages/cli/tests/commands/check.test.ts +0 -129
- package/packages/cli/tests/commands/cli.test.ts +0 -89
- package/packages/cli/tests/commands/diff.test.ts +0 -115
- package/packages/cli/tests/commands/reset.test.ts +0 -310
- package/packages/cli/tests/commands/self-healing.test.ts +0 -170
- package/packages/cli/tests/commands/setup-blocking.test.ts +0 -71
- package/packages/cli/tests/commands/setup-core.test.ts +0 -135
- package/packages/cli/tests/commands/setup-git.test.ts +0 -139
- package/packages/cli/tests/commands/setup-hooks.test.ts +0 -334
- package/packages/cli/tests/commands/setup-linting.test.ts +0 -189
- package/packages/cli/tests/commands/setup-noninteractive.test.ts +0 -80
- package/packages/cli/tests/commands/setup-templates.test.ts +0 -181
- package/packages/cli/tests/commands/upgrade.test.ts +0 -215
- package/packages/cli/tests/helpers.ts +0 -243
- package/packages/cli/tests/npm-package.test.ts +0 -83
- package/packages/cli/tests/technical-constraints.test.ts +0 -96
- package/packages/cli/tsconfig.json +0 -25
- package/packages/cli/tsup.config.ts +0 -11
- package/packages/cli/vitest.config.ts +0 -23
- package/promptfoo.yaml +0 -3270
- /package/{framework → templates}/SAFEWORD.md +0 -0
- /package/{packages/cli/templates → templates}/commands/arch-review.md +0 -0
- /package/{packages/cli/templates → templates}/commands/lint.md +0 -0
- /package/{packages/cli/templates → templates}/commands/quality-review.md +0 -0
- /package/{framework/templates → templates/doc-templates}/architecture-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/design-doc-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/test-definitions-feature.md +0 -0
- /package/{framework/templates → templates/doc-templates}/ticket-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/user-stories-template.md +0 -0
- /package/{framework → templates}/guides/architecture-guide.md +0 -0
- /package/{framework → templates}/guides/code-philosophy.md +0 -0
- /package/{framework → templates}/guides/context-files-guide.md +0 -0
- /package/{framework → templates}/guides/data-architecture-guide.md +0 -0
- /package/{framework → templates}/guides/design-doc-guide.md +0 -0
- /package/{framework → templates}/guides/learning-extraction.md +0 -0
- /package/{framework → templates}/guides/llm-instruction-design.md +0 -0
- /package/{framework → templates}/guides/llm-prompting.md +0 -0
- /package/{framework → templates}/guides/tdd-best-practices.md +0 -0
- /package/{framework → templates}/guides/test-definitions-guide.md +0 -0
- /package/{framework → templates}/guides/testing-methodology.md +0 -0
- /package/{framework → templates}/guides/user-story-guide.md +0 -0
- /package/{framework → templates}/guides/zombie-process-cleanup.md +0 -0
- /package/{packages/cli/templates → templates}/hooks/inject-timestamp.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/common.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/jq-fallback.sh +0 -0
- /package/{packages/cli/templates → templates}/markdownlint.jsonc +0 -0
- /package/{framework → templates}/prompts/arch-review.md +0 -0
- /package/{framework → templates}/prompts/quality-review.md +0 -0
- /package/{framework/skills/quality-reviewer → templates/skills/safeword-quality-reviewer}/SKILL.md +0 -0
|
@@ -1,970 +0,0 @@
|
|
|
1
|
-
# Settings.json Improvements Based on Conversation History Analysis
|
|
2
|
-
|
|
3
|
-
**Analysis Date**: 2025-10-26
|
|
4
|
-
**Conversations Analyzed**:
|
|
5
|
-
|
|
6
|
-
- soulless-monorepo: 1,643 messages, 166 Bash calls
|
|
7
|
-
- bitd: 5,414 messages, 479 Bash calls
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Current State Analysis
|
|
12
|
-
|
|
13
|
-
### Tool Usage Frequency
|
|
14
|
-
|
|
15
|
-
**soulless-monorepo** (meta-work focused):
|
|
16
|
-
|
|
17
|
-
- Bash: 166 calls (41%)
|
|
18
|
-
- Edit: 95 calls (23%)
|
|
19
|
-
- Read: 69 calls (17%)
|
|
20
|
-
- TodoWrite: 56 calls (14%)
|
|
21
|
-
|
|
22
|
-
**bitd** (implementation focused):
|
|
23
|
-
|
|
24
|
-
- Bash: 479 calls (30%)
|
|
25
|
-
- Read: 464 calls (29%)
|
|
26
|
-
- Edit: 370 calls (23%)
|
|
27
|
-
- Grep: 137 calls (9%)
|
|
28
|
-
- TodoWrite: 132 calls (8%)
|
|
29
|
-
|
|
30
|
-
### Most Frequent Bash Commands
|
|
31
|
-
|
|
32
|
-
**bitd project**:
|
|
33
|
-
|
|
34
|
-
1. `pnpm test` - 56 uses (type checking, test running)
|
|
35
|
-
2. `wc -l` - 44 uses (counting lines)
|
|
36
|
-
3. `grep` variants - 169 uses (searching)
|
|
37
|
-
4. `pnpm tsc` - 24 uses (type checking)
|
|
38
|
-
5. `ls -la` - 19 uses (listing files)
|
|
39
|
-
6. `cd` commands - 19 uses (navigation)
|
|
40
|
-
7. `pnpm build` - 14 uses (compilation)
|
|
41
|
-
8. `git status/diff/log` - 14 uses (read-only git)
|
|
42
|
-
|
|
43
|
-
**soulless-monorepo project**:
|
|
44
|
-
|
|
45
|
-
1. `cd ~/.claude` - 42 uses (navigation to config)
|
|
46
|
-
2. `wc -l` - 27 uses (counting lines)
|
|
47
|
-
3. `ls -la` - 11 uses (listing files)
|
|
48
|
-
4. `cd` various - 20 uses (navigation)
|
|
49
|
-
5. `grep` variants - 19 uses (searching)
|
|
50
|
-
6. `git status` - 3 uses (read-only git)
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Current Settings.json Gaps
|
|
55
|
-
|
|
56
|
-
### ✅ Already Allowed (Good!)
|
|
57
|
-
|
|
58
|
-
Your current settings already allow:
|
|
59
|
-
|
|
60
|
-
- All git read operations (status, diff, log, show, branch)
|
|
61
|
-
- All gh CLI operations (GitHub API interactions)
|
|
62
|
-
- File inspection (cat, ls, wc, head, tail, find, tree)
|
|
63
|
-
- Text processing (grep, awk, sed for reading, cut, sort, uniq, diff)
|
|
64
|
-
- npm/pnpm info commands (list, view, outdated, etc.)
|
|
65
|
-
- Version checks (node --version, npm --version, etc.)
|
|
66
|
-
- Read, Glob, Grep, WebFetch, WebSearch tools
|
|
67
|
-
|
|
68
|
-
### ❌ Currently Requiring Manual Approval (Safe to Auto-Approve)
|
|
69
|
-
|
|
70
|
-
These operations are **low-risk** and appear **frequently** in your workflows:
|
|
71
|
-
|
|
72
|
-
#### 1. Directory Navigation (61+ uses)
|
|
73
|
-
|
|
74
|
-
**Current**: `Bash(cd:*)` requires approval
|
|
75
|
-
**Risk**: Zero - only changes working directory
|
|
76
|
-
**Usage**: 42 times in soulless-monorepo, 19 times in bitd
|
|
77
|
-
|
|
78
|
-
**Problem**: Every directory change requires manual approval, breaking workflow flow
|
|
79
|
-
|
|
80
|
-
#### 2. Type Checking (29+ uses)
|
|
81
|
-
|
|
82
|
-
**Current**: `Bash(pnpm tsc:*)` requires approval (partially allowed but incomplete)
|
|
83
|
-
**Risk**: Zero - read-only type checking, no file modifications
|
|
84
|
-
**Usage**: 24 times in bitd as `pnpm tsc`, 5 times as `npx tsc`
|
|
85
|
-
|
|
86
|
-
**Problem**: Type checking is a read-only verification step that should be automatic
|
|
87
|
-
|
|
88
|
-
#### 3. Test Execution (56+ uses)
|
|
89
|
-
|
|
90
|
-
**Current**: `Bash(npm test:*)` and `Bash(pnpm test:*)` partially allowed
|
|
91
|
-
**Risk**: Low - tests should be side-effect-free (if poorly written, that's a separate problem)
|
|
92
|
-
**Usage**: 56 times in bitd
|
|
93
|
-
|
|
94
|
-
**Problem**: Running tests is a quality verification step in your TDD workflow
|
|
95
|
-
|
|
96
|
-
#### 4. Build Operations (14+ uses)
|
|
97
|
-
|
|
98
|
-
**Current**: `Bash(npm build:*)` and `Bash(pnpm build:*)` partially allowed
|
|
99
|
-
**Risk**: Low - builds output to dist/build folders, no source modifications
|
|
100
|
-
**Usage**: 14 times in bitd
|
|
101
|
-
|
|
102
|
-
**Problem**: Builds are needed before testing in Electron apps and similar
|
|
103
|
-
|
|
104
|
-
#### 5. Environment Variable Inspection (Missing)
|
|
105
|
-
|
|
106
|
-
**Current**: No explicit allow for `echo $VAR`
|
|
107
|
-
**Risk**: Zero - read-only inspection
|
|
108
|
-
**Usage**: Common in debugging
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Recommended Improvements
|
|
113
|
-
|
|
114
|
-
### Priority 1: High-Frequency, Zero-Risk (Add Immediately)
|
|
115
|
-
|
|
116
|
-
Add these to `permissions.allow`:
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"permissions": {
|
|
121
|
-
"allow": [
|
|
122
|
-
// ... existing entries ...
|
|
123
|
-
|
|
124
|
-
// ============================================
|
|
125
|
-
// DIRECTORY NAVIGATION (61+ uses, zero risk)
|
|
126
|
-
// ============================================
|
|
127
|
-
"Bash(cd *)",
|
|
128
|
-
"Bash(pushd *)",
|
|
129
|
-
"Bash(popd)",
|
|
130
|
-
|
|
131
|
-
// ============================================
|
|
132
|
-
// TYPE CHECKING (29+ uses, zero risk)
|
|
133
|
-
// ============================================
|
|
134
|
-
// TypeScript type checking (no emit, read-only)
|
|
135
|
-
"Bash(npx tsc --noEmit*)",
|
|
136
|
-
"Bash(npx tsc -p * --noEmit*)",
|
|
137
|
-
"Bash(pnpm tsc --noEmit*)",
|
|
138
|
-
"Bash(npm run tsc -- --noEmit*)",
|
|
139
|
-
|
|
140
|
-
// ============================================
|
|
141
|
-
// LINTING & FORMATTING (read-only variants)
|
|
142
|
-
// ============================================
|
|
143
|
-
"Bash(npm run lint*)",
|
|
144
|
-
"Bash(pnpm lint*)",
|
|
145
|
-
"Bash(npx eslint --print-config*)",
|
|
146
|
-
"Bash(npx eslint --max-warnings*)",
|
|
147
|
-
"Bash(npm run format -- --check*)",
|
|
148
|
-
"Bash(pnpm format --check*)",
|
|
149
|
-
"Bash(npx prettier --check*)",
|
|
150
|
-
"Bash(npx prettier --list-different*)",
|
|
151
|
-
|
|
152
|
-
// ============================================
|
|
153
|
-
// ENVIRONMENT INSPECTION (debugging)
|
|
154
|
-
// ============================================
|
|
155
|
-
"Bash(echo $*)",
|
|
156
|
-
"Bash(echo \"$*\")",
|
|
157
|
-
|
|
158
|
-
// ============================================
|
|
159
|
-
// PACKAGE MANAGER READ OPERATIONS
|
|
160
|
-
// ============================================
|
|
161
|
-
"Bash(pnpm config get*)",
|
|
162
|
-
"Bash(npm config get*)",
|
|
163
|
-
"Bash(pnpm list --json*)",
|
|
164
|
-
"Bash(npm list --json*)",
|
|
165
|
-
|
|
166
|
-
// ============================================
|
|
167
|
-
// PROCESS INSPECTION (extended)
|
|
168
|
-
// ============================================
|
|
169
|
-
"Bash(ps aux*)",
|
|
170
|
-
"Bash(pgrep -f*)",
|
|
171
|
-
"Bash(killall -l)",
|
|
172
|
-
|
|
173
|
-
// ============================================
|
|
174
|
-
// FILE INSPECTION (extended)
|
|
175
|
-
// ============================================
|
|
176
|
-
"Bash(realpath*)",
|
|
177
|
-
"Bash(readlink*)",
|
|
178
|
-
"Bash(file -b*)",
|
|
179
|
-
"Bash(stat -f*)",
|
|
180
|
-
"Bash(hexdump -C*)",
|
|
181
|
-
|
|
182
|
-
// ============================================
|
|
183
|
-
// TEXT PROCESSING (extended)
|
|
184
|
-
// ============================================
|
|
185
|
-
"Bash(column -t*)",
|
|
186
|
-
"Bash(expand*)",
|
|
187
|
-
"Bash(unexpand*)",
|
|
188
|
-
"Bash(nl*)",
|
|
189
|
-
"Bash(paste*)",
|
|
190
|
-
"Bash(join*)",
|
|
191
|
-
|
|
192
|
-
// ============================================
|
|
193
|
-
// DISK/SYSTEM INFO (extended)
|
|
194
|
-
// ============================================
|
|
195
|
-
"Bash(df -h*)",
|
|
196
|
-
"Bash(du -sh*)",
|
|
197
|
-
"Bash(du -h --max-depth*)",
|
|
198
|
-
"Bash(quota*)",
|
|
199
|
-
"Bash(vm_stat)",
|
|
200
|
-
"Bash(memory_pressure)",
|
|
201
|
-
"Bash(ioreg*)",
|
|
202
|
-
|
|
203
|
-
// ============================================
|
|
204
|
-
// SHELL UTILITIES
|
|
205
|
-
// ============================================
|
|
206
|
-
"Bash(history*)",
|
|
207
|
-
"Bash(fc -l*)",
|
|
208
|
-
"Bash(alias)",
|
|
209
|
-
"Bash(type*)",
|
|
210
|
-
"Bash(command -v*)",
|
|
211
|
-
|
|
212
|
-
// ============================================
|
|
213
|
-
// COMPARISON & DIFF (extended)
|
|
214
|
-
// ============================================
|
|
215
|
-
"Bash(cmp*)",
|
|
216
|
-
"Bash(sdiff*)",
|
|
217
|
-
"Bash(diff3*)",
|
|
218
|
-
"Bash(colordiff*)"
|
|
219
|
-
]
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
**Impact**: Eliminates ~90% of navigation/inspection interruptions
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Priority 2: Medium-Risk but High-Value (Consider Adding)
|
|
229
|
-
|
|
230
|
-
These operations **can** have side effects, but are part of normal development workflow:
|
|
231
|
-
|
|
232
|
-
```json
|
|
233
|
-
{
|
|
234
|
-
"permissions": {
|
|
235
|
-
"allow": [
|
|
236
|
-
// ============================================
|
|
237
|
-
// TEST EXECUTION (56+ uses in bitd)
|
|
238
|
-
// ============================================
|
|
239
|
-
// Tests SHOULD be side-effect-free
|
|
240
|
-
// If your tests modify production data, fix the tests
|
|
241
|
-
"Bash(npm test*)",
|
|
242
|
-
"Bash(npm t *)",
|
|
243
|
-
"Bash(pnpm test*)",
|
|
244
|
-
"Bash(pnpm t *)",
|
|
245
|
-
"Bash(npx vitest*)",
|
|
246
|
-
"Bash(npx jest*)",
|
|
247
|
-
"Bash(npx playwright test*)",
|
|
248
|
-
|
|
249
|
-
// ============================================
|
|
250
|
-
// BUILD OPERATIONS (14+ uses in bitd)
|
|
251
|
-
// ============================================
|
|
252
|
-
// Builds output to dist/build, don't modify source
|
|
253
|
-
"Bash(npm run build*)",
|
|
254
|
-
"Bash(pnpm build*)",
|
|
255
|
-
"Bash(npx vite build*)",
|
|
256
|
-
"Bash(npx tsc -b*)",
|
|
257
|
-
"Bash(npx tsc --build*)",
|
|
258
|
-
|
|
259
|
-
// ============================================
|
|
260
|
-
// DEVELOPMENT SERVERS (read-only state)
|
|
261
|
-
// ============================================
|
|
262
|
-
// Starting dev servers for testing
|
|
263
|
-
"Bash(npm run dev*)",
|
|
264
|
-
"Bash(pnpm dev*)",
|
|
265
|
-
"Bash(npx vite*)",
|
|
266
|
-
"Bash(npx next dev*)",
|
|
267
|
-
|
|
268
|
-
// ============================================
|
|
269
|
-
// PACKAGE MANAGER SAFE MODIFICATIONS
|
|
270
|
-
// ============================================
|
|
271
|
-
// Already have install/add, these are similar
|
|
272
|
-
"Bash(npm link*)",
|
|
273
|
-
"Bash(pnpm link*)",
|
|
274
|
-
"Bash(npm unlink*)",
|
|
275
|
-
"Bash(pnpm unlink*)"
|
|
276
|
-
]
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
**Trade-offs**:
|
|
282
|
-
|
|
283
|
-
- **Tests**: If tests have side effects (modify databases, files), they could cause issues
|
|
284
|
-
- Mitigation: Fix the tests (tests should be isolated)
|
|
285
|
-
- Your usage: 56 times in bitd - clearly part of TDD workflow
|
|
286
|
-
|
|
287
|
-
- **Builds**: Could fill disk if run repeatedly
|
|
288
|
-
- Mitigation: Builds are necessary (Electron apps need pre-built files for tests)
|
|
289
|
-
- Your usage: 14 times in bitd - needed for development
|
|
290
|
-
|
|
291
|
-
- **Dev servers**: Could start servers on ports
|
|
292
|
-
- Mitigation: Servers shut down when Claude session ends
|
|
293
|
-
- Risk: Low - common development workflow
|
|
294
|
-
|
|
295
|
-
**Recommendation**: Add tests + builds, hold on dev servers (rarely needed unattended)
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
### Priority 3: Context-Specific Auto-Approval (Using Hooks)
|
|
300
|
-
|
|
301
|
-
For operations that are safe in **some contexts** but not others, use PreToolUse hooks:
|
|
302
|
-
|
|
303
|
-
#### Example: Auto-approve git commit in specific directories
|
|
304
|
-
|
|
305
|
-
**File**: `~/.claude/hooks/auto-approve-git-commits.yaml`
|
|
306
|
-
|
|
307
|
-
```yaml
|
|
308
|
-
name: auto-approve-safe-git-commits
|
|
309
|
-
on:
|
|
310
|
-
event: pre-tool-use
|
|
311
|
-
tools:
|
|
312
|
-
- Bash
|
|
313
|
-
conditions:
|
|
314
|
-
# Only match git commit commands
|
|
315
|
-
- type: regex
|
|
316
|
-
pattern: 'git commit.*'
|
|
317
|
-
|
|
318
|
-
script: |
|
|
319
|
-
#!/bin/bash
|
|
320
|
-
|
|
321
|
-
# Auto-approve commits in these safe directories
|
|
322
|
-
SAFE_DIRS=(
|
|
323
|
-
"$HOME/.claude"
|
|
324
|
-
"$HOME/.agents"
|
|
325
|
-
)
|
|
326
|
-
|
|
327
|
-
CWD="$PWD"
|
|
328
|
-
|
|
329
|
-
for dir in "${SAFE_DIRS[@]}"; do
|
|
330
|
-
if [[ "$CWD" == "$dir"* ]]; then
|
|
331
|
-
# In safe directory - auto-approve
|
|
332
|
-
exit 0
|
|
333
|
-
fi
|
|
334
|
-
done
|
|
335
|
-
|
|
336
|
-
# Not in safe directory - ask for approval
|
|
337
|
-
exit 1
|
|
338
|
-
|
|
339
|
-
decision: allow-if-exit-0
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
**Usage**: Git commits in `~/.claude` (42 cd operations there) would auto-approve
|
|
343
|
-
|
|
344
|
-
#### Example: Auto-approve file writes to specific directories
|
|
345
|
-
|
|
346
|
-
**File**: `~/.claude/hooks/auto-approve-safe-writes.yaml`
|
|
347
|
-
|
|
348
|
-
```yaml
|
|
349
|
-
name: auto-approve-safe-writes
|
|
350
|
-
on:
|
|
351
|
-
event: pre-tool-use
|
|
352
|
-
tools:
|
|
353
|
-
- Write
|
|
354
|
-
- Edit
|
|
355
|
-
|
|
356
|
-
script: |
|
|
357
|
-
#!/bin/bash
|
|
358
|
-
|
|
359
|
-
# Get the file path from tool input
|
|
360
|
-
FILE_PATH=$(echo "$TOOL_INPUT" | jq -r '.file_path // empty')
|
|
361
|
-
|
|
362
|
-
# Auto-approve writes to these directories
|
|
363
|
-
SAFE_PATHS=(
|
|
364
|
-
"$HOME/.claude/"
|
|
365
|
-
"$CLAUDE_PROJECT_DIR/.safeword/"
|
|
366
|
-
"/tmp/"
|
|
367
|
-
"$HOME/projects/.*/planning/"
|
|
368
|
-
"$HOME/projects/.*/docs/"
|
|
369
|
-
)
|
|
370
|
-
|
|
371
|
-
for pattern in "${SAFE_PATHS[@]}"; do
|
|
372
|
-
if [[ "$FILE_PATH" =~ $pattern ]]; then
|
|
373
|
-
exit 0 # Auto-approve
|
|
374
|
-
fi
|
|
375
|
-
done
|
|
376
|
-
|
|
377
|
-
exit 1 # Ask for approval
|
|
378
|
-
|
|
379
|
-
decision: allow-if-exit-0
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
**Usage**: Writes to `~/.claude/`, `planning/`, `docs/` auto-approved (documentation work)
|
|
383
|
-
|
|
384
|
-
---
|
|
385
|
-
|
|
386
|
-
## Improved settings.json (Complete File)
|
|
387
|
-
|
|
388
|
-
Save this as `~/.claude/settings.json`:
|
|
389
|
-
|
|
390
|
-
```json
|
|
391
|
-
{
|
|
392
|
-
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
393
|
-
"permissions": {
|
|
394
|
-
"mode": "acceptEdits",
|
|
395
|
-
|
|
396
|
-
"allow": [
|
|
397
|
-
// ============================================
|
|
398
|
-
// GIT READ OPERATIONS
|
|
399
|
-
// ============================================
|
|
400
|
-
"Bash(git status*)",
|
|
401
|
-
"Bash(git diff*)",
|
|
402
|
-
"Bash(git log*)",
|
|
403
|
-
"Bash(git branch*)",
|
|
404
|
-
"Bash(git show*)",
|
|
405
|
-
"Bash(git remote*)",
|
|
406
|
-
"Bash(git ls-files*)",
|
|
407
|
-
"Bash(git ls-tree*)",
|
|
408
|
-
"Bash(git describe*)",
|
|
409
|
-
"Bash(git rev-parse*)",
|
|
410
|
-
"Bash(git rev-list*)",
|
|
411
|
-
"Bash(git config --get*)",
|
|
412
|
-
"Bash(git config --list*)",
|
|
413
|
-
|
|
414
|
-
// ============================================
|
|
415
|
-
// GIT SAFE WRITE OPERATIONS
|
|
416
|
-
// ============================================
|
|
417
|
-
// Note: These are in your current config, keeping them
|
|
418
|
-
"Bash(git add*)",
|
|
419
|
-
"Bash(git commit*)",
|
|
420
|
-
"Bash(git push*)",
|
|
421
|
-
|
|
422
|
-
// ============================================
|
|
423
|
-
// GITHUB CLI (gh)
|
|
424
|
-
// ============================================
|
|
425
|
-
"Bash(gh repo list*)",
|
|
426
|
-
"Bash(gh repo view*)",
|
|
427
|
-
"Bash(gh pr list*)",
|
|
428
|
-
"Bash(gh pr view*)",
|
|
429
|
-
"Bash(gh pr diff*)",
|
|
430
|
-
"Bash(gh pr checks*)",
|
|
431
|
-
"Bash(gh issue list*)",
|
|
432
|
-
"Bash(gh issue view*)",
|
|
433
|
-
"Bash(gh issue create*)",
|
|
434
|
-
"Bash(gh release list*)",
|
|
435
|
-
"Bash(gh release view*)",
|
|
436
|
-
"Bash(gh run list*)",
|
|
437
|
-
"Bash(gh run view*)",
|
|
438
|
-
"Bash(gh run watch*)",
|
|
439
|
-
"Bash(gh run download*)",
|
|
440
|
-
"Bash(gh workflow list*)",
|
|
441
|
-
"Bash(gh workflow view*)",
|
|
442
|
-
"Bash(gh status)",
|
|
443
|
-
"Bash(gh browse)",
|
|
444
|
-
"Bash(gh auth status)",
|
|
445
|
-
"Bash(gh search*)",
|
|
446
|
-
|
|
447
|
-
// ============================================
|
|
448
|
-
// DIRECTORY NAVIGATION ⭐ NEW
|
|
449
|
-
// ============================================
|
|
450
|
-
"Bash(cd *)",
|
|
451
|
-
"Bash(pushd *)",
|
|
452
|
-
"Bash(popd)",
|
|
453
|
-
"Bash(pwd)",
|
|
454
|
-
"Bash(dirs)",
|
|
455
|
-
|
|
456
|
-
// ============================================
|
|
457
|
-
// FILE INSPECTION
|
|
458
|
-
// ============================================
|
|
459
|
-
"Bash(cat *)",
|
|
460
|
-
"Bash(ls *)",
|
|
461
|
-
"Bash(wc *)",
|
|
462
|
-
"Bash(head *)",
|
|
463
|
-
"Bash(tail *)",
|
|
464
|
-
"Bash(file *)",
|
|
465
|
-
"Bash(stat *)",
|
|
466
|
-
"Bash(du *)",
|
|
467
|
-
"Bash(df *)",
|
|
468
|
-
"Bash(find *)",
|
|
469
|
-
"Bash(tree *)",
|
|
470
|
-
"Bash(basename *)",
|
|
471
|
-
"Bash(dirname *)",
|
|
472
|
-
"Bash(realpath *)", // ⭐ NEW
|
|
473
|
-
"Bash(readlink *)", // ⭐ NEW
|
|
474
|
-
|
|
475
|
-
// ============================================
|
|
476
|
-
// TEXT PROCESSING
|
|
477
|
-
// ============================================
|
|
478
|
-
"Bash(grep *)",
|
|
479
|
-
"Bash(awk *)",
|
|
480
|
-
"Bash(sed -n*)", // read-only sed
|
|
481
|
-
"Bash(cut *)",
|
|
482
|
-
"Bash(sort *)",
|
|
483
|
-
"Bash(uniq *)",
|
|
484
|
-
"Bash(tr *)",
|
|
485
|
-
"Bash(diff *)",
|
|
486
|
-
"Bash(comm *)",
|
|
487
|
-
"Bash(column *)", // ⭐ NEW
|
|
488
|
-
"Bash(paste *)", // ⭐ NEW
|
|
489
|
-
"Bash(join *)", // ⭐ NEW
|
|
490
|
-
"Bash(nl *)", // ⭐ NEW
|
|
491
|
-
|
|
492
|
-
// ============================================
|
|
493
|
-
// JSON/DATA PROCESSING
|
|
494
|
-
// ============================================
|
|
495
|
-
"Bash(jq *)",
|
|
496
|
-
|
|
497
|
-
// ============================================
|
|
498
|
-
// SYSTEM INFO
|
|
499
|
-
// ============================================
|
|
500
|
-
"Bash(ps *)",
|
|
501
|
-
"Bash(top -l 1*)",
|
|
502
|
-
"Bash(pgrep *)",
|
|
503
|
-
"Bash(lsof *)",
|
|
504
|
-
"Bash(netstat *)",
|
|
505
|
-
"Bash(uname *)",
|
|
506
|
-
"Bash(hostname)",
|
|
507
|
-
"Bash(whoami)",
|
|
508
|
-
"Bash(id *)",
|
|
509
|
-
"Bash(date *)",
|
|
510
|
-
"Bash(uptime)",
|
|
511
|
-
"Bash(sw_vers)",
|
|
512
|
-
"Bash(arch)",
|
|
513
|
-
"Bash(sysctl *)",
|
|
514
|
-
"Bash(vm_stat)", // ⭐ NEW
|
|
515
|
-
"Bash(memory_pressure)", // ⭐ NEW
|
|
516
|
-
|
|
517
|
-
// ============================================
|
|
518
|
-
// NETWORK INSPECTION
|
|
519
|
-
// ============================================
|
|
520
|
-
"Bash(ifconfig *)",
|
|
521
|
-
"Bash(ping -c*)", // limit to count-based ping
|
|
522
|
-
"Bash(host *)",
|
|
523
|
-
"Bash(dig *)",
|
|
524
|
-
"Bash(nslookup *)",
|
|
525
|
-
"Bash(nc -vz*)",
|
|
526
|
-
|
|
527
|
-
// ============================================
|
|
528
|
-
// PACKAGE MANAGERS - INFO COMMANDS
|
|
529
|
-
// ============================================
|
|
530
|
-
"Bash(brew list*)",
|
|
531
|
-
"Bash(brew info*)",
|
|
532
|
-
"Bash(brew search*)",
|
|
533
|
-
"Bash(brew --version)",
|
|
534
|
-
|
|
535
|
-
"Bash(npm --version)",
|
|
536
|
-
"Bash(npm list*)",
|
|
537
|
-
"Bash(npm info*)",
|
|
538
|
-
"Bash(npm show*)",
|
|
539
|
-
"Bash(npm view*)",
|
|
540
|
-
"Bash(npm search*)",
|
|
541
|
-
"Bash(npm outdated*)",
|
|
542
|
-
"Bash(npm audit*)",
|
|
543
|
-
"Bash(npm audit fix*)",
|
|
544
|
-
"Bash(npm fund*)",
|
|
545
|
-
"Bash(npm diff*)",
|
|
546
|
-
"Bash(npm doctor)",
|
|
547
|
-
"Bash(npm explain*)",
|
|
548
|
-
"Bash(npm find-dupes)",
|
|
549
|
-
"Bash(npm help*)",
|
|
550
|
-
"Bash(npm ls*)",
|
|
551
|
-
"Bash(npm pack*)",
|
|
552
|
-
"Bash(npm prefix*)",
|
|
553
|
-
"Bash(npm query*)",
|
|
554
|
-
"Bash(npm root*)",
|
|
555
|
-
"Bash(npm why*)",
|
|
556
|
-
"Bash(npm config get*)", // ⭐ NEW
|
|
557
|
-
|
|
558
|
-
"Bash(pnpm --version)",
|
|
559
|
-
"Bash(pnpm list*)",
|
|
560
|
-
"Bash(pnpm ls*)",
|
|
561
|
-
"Bash(pnpm info*)",
|
|
562
|
-
"Bash(pnpm view*)",
|
|
563
|
-
"Bash(pnpm outdated*)",
|
|
564
|
-
"Bash(pnpm audit*)",
|
|
565
|
-
"Bash(pnpm why*)",
|
|
566
|
-
"Bash(pnpm licenses*)",
|
|
567
|
-
"Bash(pnpm patch-commit*)",
|
|
568
|
-
"Bash(pnpm config get*)", // ⭐ NEW
|
|
569
|
-
|
|
570
|
-
// ============================================
|
|
571
|
-
// PACKAGE MANAGERS - INSTALL/MODIFY ⭐ KEEP EXISTING
|
|
572
|
-
// ============================================
|
|
573
|
-
"Bash(npm install*)",
|
|
574
|
-
"Bash(npm i *)",
|
|
575
|
-
"Bash(npm ci*)",
|
|
576
|
-
"Bash(npm add*)",
|
|
577
|
-
"Bash(npm remove*)",
|
|
578
|
-
"Bash(npm uninstall*)",
|
|
579
|
-
"Bash(npm update*)",
|
|
580
|
-
"Bash(npm prune*)",
|
|
581
|
-
"Bash(npm dedupe)",
|
|
582
|
-
"Bash(npm rebuild*)",
|
|
583
|
-
|
|
584
|
-
"Bash(pnpm install*)",
|
|
585
|
-
"Bash(pnpm i *)",
|
|
586
|
-
"Bash(pnpm add*)",
|
|
587
|
-
"Bash(pnpm remove*)",
|
|
588
|
-
"Bash(pnpm rm *)",
|
|
589
|
-
"Bash(pnpm update*)",
|
|
590
|
-
"Bash(pnpm up *)",
|
|
591
|
-
"Bash(pnpm prune*)",
|
|
592
|
-
"Bash(pnpm store*)",
|
|
593
|
-
|
|
594
|
-
// ============================================
|
|
595
|
-
// PACKAGE MANAGERS - SCRIPTS
|
|
596
|
-
// ============================================
|
|
597
|
-
"Bash(npm run*)",
|
|
598
|
-
"Bash(npm start*)",
|
|
599
|
-
"Bash(npm test*)", // ⭐ ALREADY IN YOUR CONFIG
|
|
600
|
-
"Bash(npm t *)", // ⭐ NEW
|
|
601
|
-
"Bash(npm build*)", // ⭐ ALREADY IN YOUR CONFIG
|
|
602
|
-
"Bash(npm run lint*)", // ⭐ NEW
|
|
603
|
-
"Bash(npm run format -- --check*)", // ⭐ NEW (read-only format check)
|
|
604
|
-
"Bash(npm exec*)",
|
|
605
|
-
"Bash(npx *)",
|
|
606
|
-
|
|
607
|
-
"Bash(pnpm run*)",
|
|
608
|
-
"Bash(pnpm start*)",
|
|
609
|
-
"Bash(pnpm test*)", // ⭐ NEW (56 uses in bitd)
|
|
610
|
-
"Bash(pnpm t *)", // ⭐ NEW
|
|
611
|
-
"Bash(pnpm build*)", // ⭐ NEW (14 uses in bitd)
|
|
612
|
-
"Bash(pnpm lint*)", // ⭐ NEW
|
|
613
|
-
"Bash(pnpm format --check*)", // ⭐ NEW (read-only)
|
|
614
|
-
"Bash(pnpm exec*)",
|
|
615
|
-
"Bash(pnpm dlx*)",
|
|
616
|
-
"Bash(pnpm create*)",
|
|
617
|
-
"Bash(pnpx *)",
|
|
618
|
-
|
|
619
|
-
// ============================================
|
|
620
|
-
// TYPESCRIPT COMPILER ⭐ ENHANCED
|
|
621
|
-
// ============================================
|
|
622
|
-
"Bash(tsc --version)",
|
|
623
|
-
"Bash(tsc --help*)",
|
|
624
|
-
"Bash(tsc --listFiles*)",
|
|
625
|
-
"Bash(tsc --listFilesOnly*)",
|
|
626
|
-
"Bash(tsc --showConfig*)",
|
|
627
|
-
"Bash(tsc --noEmit*)", // ⭐ NEW - read-only type check
|
|
628
|
-
"Bash(tsc -b*)",
|
|
629
|
-
"Bash(tsc --build*)",
|
|
630
|
-
"Bash(npx tsc --noEmit*)", // ⭐ NEW (29 uses combined)
|
|
631
|
-
"Bash(npx tsc -p * --noEmit*)", // ⭐ NEW
|
|
632
|
-
"Bash(pnpm tsc*)", // ⭐ ENHANCED from your config
|
|
633
|
-
"Bash(npm tsc*)",
|
|
634
|
-
|
|
635
|
-
// ============================================
|
|
636
|
-
// ENVIRONMENT INSPECTION ⭐ NEW
|
|
637
|
-
// ============================================
|
|
638
|
-
"Bash(echo $*)",
|
|
639
|
-
"Bash(echo \"$*\")",
|
|
640
|
-
"Bash(env)",
|
|
641
|
-
"Bash(printenv*)",
|
|
642
|
-
"Bash(export -p)",
|
|
643
|
-
|
|
644
|
-
// ============================================
|
|
645
|
-
// BUILD TOOLS (read-only operations)
|
|
646
|
-
// ============================================
|
|
647
|
-
"Bash(make -n*)", // dry run
|
|
648
|
-
"Bash(make --version)",
|
|
649
|
-
"Bash(gcc --version)",
|
|
650
|
-
"Bash(clang --version)",
|
|
651
|
-
"Bash(xcode-select -p)",
|
|
652
|
-
"Bash(xcrun --show-sdk-path)",
|
|
653
|
-
|
|
654
|
-
// ============================================
|
|
655
|
-
// ARCHIVES (inspection only)
|
|
656
|
-
// ============================================
|
|
657
|
-
"Bash(tar -tf*)",
|
|
658
|
-
"Bash(tar -tzf*)",
|
|
659
|
-
"Bash(unzip -l*)",
|
|
660
|
-
"Bash(gzip -l*)",
|
|
661
|
-
"Bash(zipinfo*)",
|
|
662
|
-
|
|
663
|
-
// ============================================
|
|
664
|
-
// CHECKSUMS & HASHING
|
|
665
|
-
// ============================================
|
|
666
|
-
"Bash(md5*)",
|
|
667
|
-
"Bash(shasum*)",
|
|
668
|
-
"Bash(sha256sum*)",
|
|
669
|
-
"Bash(cksum*)",
|
|
670
|
-
|
|
671
|
-
// ============================================
|
|
672
|
-
// macOS SPECIFIC
|
|
673
|
-
// ============================================
|
|
674
|
-
"Bash(defaults read*)",
|
|
675
|
-
"Bash(system_profiler*)",
|
|
676
|
-
"Bash(diskutil list)",
|
|
677
|
-
"Bash(pmset -g*)",
|
|
678
|
-
"Bash(scutil --get*)",
|
|
679
|
-
"Bash(launchctl list*)",
|
|
680
|
-
"Bash(mdfind*)",
|
|
681
|
-
"Bash(mdls*)",
|
|
682
|
-
"Bash(ioreg*)", // ⭐ NEW
|
|
683
|
-
|
|
684
|
-
// ============================================
|
|
685
|
-
// PDF TOOLS
|
|
686
|
-
// ============================================
|
|
687
|
-
"Bash(pdftotext*)",
|
|
688
|
-
"Bash(pdftoppm*)",
|
|
689
|
-
"Bash(pdfgrep*)",
|
|
690
|
-
|
|
691
|
-
// ============================================
|
|
692
|
-
// EDITOR (Sublime Text)
|
|
693
|
-
// ============================================
|
|
694
|
-
"Bash(subl*)",
|
|
695
|
-
|
|
696
|
-
// ============================================
|
|
697
|
-
// SHELL UTILITIES ⭐ NEW
|
|
698
|
-
// ============================================
|
|
699
|
-
"Bash(history*)",
|
|
700
|
-
"Bash(type*)",
|
|
701
|
-
"Bash(command -v*)",
|
|
702
|
-
"Bash(which*)",
|
|
703
|
-
"Bash(alias)",
|
|
704
|
-
|
|
705
|
-
// ============================================
|
|
706
|
-
// SAFE FILE OPERATIONS ⭐ NEW
|
|
707
|
-
// ============================================
|
|
708
|
-
"Bash(chmod +x*)", // make executable (common for scripts)
|
|
709
|
-
|
|
710
|
-
// ============================================
|
|
711
|
-
// TEMP FILE ACCESS
|
|
712
|
-
// ============================================
|
|
713
|
-
"Read(/tmp/**)",
|
|
714
|
-
"Read(/private/tmp/**)"
|
|
715
|
-
],
|
|
716
|
-
|
|
717
|
-
// ============================================
|
|
718
|
-
// DENIED OPERATIONS (high risk)
|
|
719
|
-
// ============================================
|
|
720
|
-
"deny": [
|
|
721
|
-
"Bash(rm -rf*)",
|
|
722
|
-
"Bash(sudo*)",
|
|
723
|
-
"Bash(curl*)", // use WebFetch instead
|
|
724
|
-
"Bash(wget*)", // use WebFetch instead
|
|
725
|
-
|
|
726
|
-
// Git dangerous operations
|
|
727
|
-
"Bash(git reset --hard*)",
|
|
728
|
-
"Bash(git clean -fd*)",
|
|
729
|
-
"Bash(git push --force*)",
|
|
730
|
-
"Bash(git push -f*)",
|
|
731
|
-
|
|
732
|
-
// GitHub dangerous operations
|
|
733
|
-
"Bash(gh repo delete*)",
|
|
734
|
-
"Bash(gh pr merge*)",
|
|
735
|
-
"Bash(gh release delete*)",
|
|
736
|
-
|
|
737
|
-
// npm/pnpm publishing
|
|
738
|
-
"Bash(npm publish*)",
|
|
739
|
-
"Bash(npm unpublish*)",
|
|
740
|
-
"Bash(npm deprecate*)",
|
|
741
|
-
"Bash(npm owner*)",
|
|
742
|
-
"Bash(npm access*)",
|
|
743
|
-
"Bash(npm token*)",
|
|
744
|
-
"Bash(npm adduser*)",
|
|
745
|
-
"Bash(npm login*)",
|
|
746
|
-
"Bash(npm logout*)",
|
|
747
|
-
"Bash(npm star*)",
|
|
748
|
-
"Bash(npm unstar*)",
|
|
749
|
-
"Bash(npm dist-tag*)",
|
|
750
|
-
|
|
751
|
-
"Bash(pnpm publish*)",
|
|
752
|
-
"Bash(pnpm unpublish*)",
|
|
753
|
-
"Bash(pnpm deprecate*)",
|
|
754
|
-
"Bash(pnpm owner*)",
|
|
755
|
-
"Bash(pnpm access*)",
|
|
756
|
-
"Bash(pnpm token*)",
|
|
757
|
-
"Bash(pnpm adduser*)",
|
|
758
|
-
"Bash(pnpm login*)",
|
|
759
|
-
"Bash(pnpm logout*)",
|
|
760
|
-
|
|
761
|
-
// Sensitive file access
|
|
762
|
-
"Read(**/.env)",
|
|
763
|
-
"Read(**/.env.*)",
|
|
764
|
-
"Read(**/secrets/**)",
|
|
765
|
-
"Read(**/*.key)",
|
|
766
|
-
"Read(**/*.pem)",
|
|
767
|
-
"Read(**/*.p12)",
|
|
768
|
-
"Read(**/*.pfx)",
|
|
769
|
-
"Read(**/credentials.json)",
|
|
770
|
-
"Read(**/.ssh/**)",
|
|
771
|
-
"Read(**/.aws/**)",
|
|
772
|
-
|
|
773
|
-
// Destructive file operations
|
|
774
|
-
"Bash(sed -i*)", // in-place editing (ask first)
|
|
775
|
-
"Bash(rm *)",
|
|
776
|
-
"Bash(mv * /dev/null)",
|
|
777
|
-
"Bash(dd *)"
|
|
778
|
-
],
|
|
779
|
-
|
|
780
|
-
// ============================================
|
|
781
|
-
// TOOL-LEVEL PERMISSIONS
|
|
782
|
-
// ============================================
|
|
783
|
-
"tools": {
|
|
784
|
-
"Read": "allow",
|
|
785
|
-
"Glob": "allow",
|
|
786
|
-
"Grep": "allow",
|
|
787
|
-
"Bash": "ask", // Default ask, but many patterns auto-approved above
|
|
788
|
-
"Edit": "ask", // mode=acceptEdits handles this
|
|
789
|
-
"Write": "ask",
|
|
790
|
-
"WebFetch": "allow",
|
|
791
|
-
"WebSearch": "allow",
|
|
792
|
-
"BashOutput": "allow",
|
|
793
|
-
"Task": "allow",
|
|
794
|
-
"TodoWrite": "allow" // ⭐ NEW - safe, frequent use
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
// ============================================
|
|
798
|
-
// MCP PERMISSIONS
|
|
799
|
-
// ============================================
|
|
800
|
-
"mcp": {
|
|
801
|
-
"context7": "allow",
|
|
802
|
-
"playwright": "allow",
|
|
803
|
-
"fetch": "allow",
|
|
804
|
-
"websearch": "allow"
|
|
805
|
-
}
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
"alwaysThinkingEnabled": true,
|
|
809
|
-
|
|
810
|
-
"feedbackSurveyState": {
|
|
811
|
-
"lastShownTime": 1754058276809
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
```
|
|
815
|
-
|
|
816
|
-
---
|
|
817
|
-
|
|
818
|
-
## Changes Summary
|
|
819
|
-
|
|
820
|
-
### ⭐ New Auto-Approvals (High Impact)
|
|
821
|
-
|
|
822
|
-
1. **cd commands** (61+ uses) - Zero risk navigation
|
|
823
|
-
2. **pnpm test / npm test** (56+ uses) - TDD workflow critical
|
|
824
|
-
3. **pnpm build / npm build** (14+ uses) - Build artifacts
|
|
825
|
-
4. **Type checking** (29+ uses) - Read-only verification
|
|
826
|
-
5. **Linting (check mode)** - Read-only quality checks
|
|
827
|
-
6. **Environment inspection** (echo $VAR) - Debugging
|
|
828
|
-
7. **Directory utilities** (pushd, popd, dirs, realpath, readlink)
|
|
829
|
-
8. **TodoWrite tool** - Frequent, safe
|
|
830
|
-
9. **Extended text processing** (column, paste, join, nl)
|
|
831
|
-
10. **System inspection** (vm_stat, memory_pressure)
|
|
832
|
-
|
|
833
|
-
### ⚠️ Security Improvements
|
|
834
|
-
|
|
835
|
-
Added denials for:
|
|
836
|
-
|
|
837
|
-
- Sensitive file patterns (_.key, _.pem, credentials.json, .ssh/**, .aws/**)
|
|
838
|
-
- Destructive operations (rm, sed -i, dd)
|
|
839
|
-
- Git force operations (push --force, reset --hard, clean)
|
|
840
|
-
|
|
841
|
-
### 📊 Expected Impact
|
|
842
|
-
|
|
843
|
-
**Before**: ~140 manual approvals per conversation (based on Bash call frequency)
|
|
844
|
-
**After**: ~30 manual approvals per conversation (-78% interruptions)
|
|
845
|
-
|
|
846
|
-
**Remaining manual approvals** (as intended):
|
|
847
|
-
|
|
848
|
-
- File writes/edits (Edit, Write tools) - still ask
|
|
849
|
-
- sed -i (in-place edits) - still ask
|
|
850
|
-
- git operations outside safe list - still ask
|
|
851
|
-
- Destructive operations - denied
|
|
852
|
-
|
|
853
|
-
---
|
|
854
|
-
|
|
855
|
-
## Testing the New Settings
|
|
856
|
-
|
|
857
|
-
### Test Plan
|
|
858
|
-
|
|
859
|
-
1. **Backup current settings**:
|
|
860
|
-
|
|
861
|
-
```bash
|
|
862
|
-
cp ~/.claude/settings.json ~/.claude/settings.json.backup
|
|
863
|
-
```
|
|
864
|
-
|
|
865
|
-
2. **Apply new settings**: Replace with improved version
|
|
866
|
-
|
|
867
|
-
3. **Test in bitd project**:
|
|
868
|
-
- Navigate directories: `cd app`, `cd tests` (should auto-approve)
|
|
869
|
-
- Run type check: `pnpm tsc --noEmit` (should auto-approve)
|
|
870
|
-
- Run tests: `pnpm test` (should auto-approve)
|
|
871
|
-
- Run build: `pnpm build` (should auto-approve)
|
|
872
|
-
|
|
873
|
-
4. **Test in soulless-monorepo**:
|
|
874
|
-
- Navigate to config: `cd ~/.claude` (should auto-approve)
|
|
875
|
-
- Count lines: `wc -l *.md` (should auto-approve)
|
|
876
|
-
- List files: `ls -la` (should auto-approve)
|
|
877
|
-
|
|
878
|
-
5. **Verify security**:
|
|
879
|
-
- Try `cat .env` (should be denied if .env exists)
|
|
880
|
-
- Try `rm -rf *` (should be denied)
|
|
881
|
-
- Try `git push --force` (should be denied)
|
|
882
|
-
|
|
883
|
-
### Rollback If Needed
|
|
884
|
-
|
|
885
|
-
```bash
|
|
886
|
-
mv ~/.claude/settings.json.backup ~/.claude/settings.json
|
|
887
|
-
```
|
|
888
|
-
|
|
889
|
-
---
|
|
890
|
-
|
|
891
|
-
## Future Optimizations
|
|
892
|
-
|
|
893
|
-
### Context-Aware Auto-Approval (Hooks)
|
|
894
|
-
|
|
895
|
-
For even more automation, create PreToolUse hooks that:
|
|
896
|
-
|
|
897
|
-
1. **Auto-approve git commits in documentation directories**
|
|
898
|
-
2. **Auto-approve writes to planning/, docs/, .claude/**
|
|
899
|
-
3. **Auto-approve test runs in CI environments**
|
|
900
|
-
4. **Auto-approve builds during TDD workflow**
|
|
901
|
-
|
|
902
|
-
See automation-plan.md Priority 3 section for hook examples.
|
|
903
|
-
|
|
904
|
-
### Project-Specific Overrides
|
|
905
|
-
|
|
906
|
-
For projects with unique needs, create `.claude/settings.json`:
|
|
907
|
-
|
|
908
|
-
**Example - bitd (heavy testing)**:
|
|
909
|
-
|
|
910
|
-
```json
|
|
911
|
-
{
|
|
912
|
-
"permissions": {
|
|
913
|
-
"allow": [
|
|
914
|
-
"Bash(pnpm test -- --ui*)", // Vitest UI mode
|
|
915
|
-
"Bash(pnpm test -- --watch*)", // Watch mode
|
|
916
|
-
"Bash(pnpm test -- --coverage*)" // Coverage reports
|
|
917
|
-
]
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
```
|
|
921
|
-
|
|
922
|
-
**Example - soulless-desktop (Electron)**:
|
|
923
|
-
|
|
924
|
-
```json
|
|
925
|
-
{
|
|
926
|
-
"permissions": {
|
|
927
|
-
"allow": ["Bash(npm run electron*)", "Bash(npm run package*)", "Bash(npm run make*)"]
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
```
|
|
931
|
-
|
|
932
|
-
---
|
|
933
|
-
|
|
934
|
-
## Metrics to Track
|
|
935
|
-
|
|
936
|
-
After applying the new settings, monitor:
|
|
937
|
-
|
|
938
|
-
1. **Approval frequency**: How many Bash calls still require approval?
|
|
939
|
-
2. **False positives**: Did any auto-approved operation cause issues?
|
|
940
|
-
3. **Workflow velocity**: Does development feel faster?
|
|
941
|
-
4. **Security incidents**: Any unintended file access/modification?
|
|
942
|
-
|
|
943
|
-
Track for 1 week, then refine.
|
|
944
|
-
|
|
945
|
-
---
|
|
946
|
-
|
|
947
|
-
## Conclusion
|
|
948
|
-
|
|
949
|
-
**Recommended Action**: Apply the improved settings.json
|
|
950
|
-
|
|
951
|
-
**Expected Results**:
|
|
952
|
-
|
|
953
|
-
- 78% reduction in manual approvals (140 → 30 per conversation)
|
|
954
|
-
- Zero workflow interruptions for navigation, type checking, testing
|
|
955
|
-
- Maintained security boundaries (no sensitive file access, no destructive ops)
|
|
956
|
-
- TDD workflow flows naturally (test → build → verify)
|
|
957
|
-
|
|
958
|
-
**Trade-offs Accepted**:
|
|
959
|
-
|
|
960
|
-
- Tests can run automatically (assumes tests are well-isolated)
|
|
961
|
-
- Builds can run automatically (assumes build artifacts are safe)
|
|
962
|
-
- Type checking auto-runs (zero risk - read-only)
|
|
963
|
-
|
|
964
|
-
**Next Steps**:
|
|
965
|
-
|
|
966
|
-
1. Backup current settings
|
|
967
|
-
2. Apply improved settings
|
|
968
|
-
3. Test in both projects
|
|
969
|
-
4. Monitor for 1 week
|
|
970
|
-
5. Add context-aware hooks (Priority 3) if desired
|