ai-agent-rules 0.11.0__py3-none-any.whl
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.
Potentially problematic release.
This version of ai-agent-rules might be problematic. Click here for more details.
- ai_agent_rules-0.11.0.dist-info/METADATA +390 -0
- ai_agent_rules-0.11.0.dist-info/RECORD +42 -0
- ai_agent_rules-0.11.0.dist-info/WHEEL +5 -0
- ai_agent_rules-0.11.0.dist-info/entry_points.txt +3 -0
- ai_agent_rules-0.11.0.dist-info/licenses/LICENSE +22 -0
- ai_agent_rules-0.11.0.dist-info/top_level.txt +1 -0
- ai_rules/__init__.py +8 -0
- ai_rules/agents/__init__.py +1 -0
- ai_rules/agents/base.py +68 -0
- ai_rules/agents/claude.py +121 -0
- ai_rules/agents/goose.py +44 -0
- ai_rules/agents/shared.py +35 -0
- ai_rules/bootstrap/__init__.py +75 -0
- ai_rules/bootstrap/config.py +261 -0
- ai_rules/bootstrap/installer.py +249 -0
- ai_rules/bootstrap/updater.py +221 -0
- ai_rules/bootstrap/version.py +52 -0
- ai_rules/cli.py +2292 -0
- ai_rules/completions.py +194 -0
- ai_rules/config/AGENTS.md +249 -0
- ai_rules/config/chat_agent_hints.md +1 -0
- ai_rules/config/claude/agents/code-reviewer.md +121 -0
- ai_rules/config/claude/commands/annotate-changelog.md +191 -0
- ai_rules/config/claude/commands/comment-cleanup.md +161 -0
- ai_rules/config/claude/commands/continue-crash.md +38 -0
- ai_rules/config/claude/commands/dev-docs.md +169 -0
- ai_rules/config/claude/commands/pr-creator.md +247 -0
- ai_rules/config/claude/commands/test-cleanup.md +244 -0
- ai_rules/config/claude/commands/update-docs.md +324 -0
- ai_rules/config/claude/hooks/subagentStop.py +92 -0
- ai_rules/config/claude/mcps.json +1 -0
- ai_rules/config/claude/settings.json +116 -0
- ai_rules/config/claude/skills/doc-writer/SKILL.md +293 -0
- ai_rules/config/claude/skills/doc-writer/resources/templates.md +495 -0
- ai_rules/config/claude/skills/prompt-engineer/SKILL.md +272 -0
- ai_rules/config/claude/skills/prompt-engineer/resources/prompt_engineering_guide_2025.md +855 -0
- ai_rules/config/claude/skills/prompt-engineer/resources/templates.md +232 -0
- ai_rules/config/goose/config.yaml +55 -0
- ai_rules/config.py +635 -0
- ai_rules/display.py +40 -0
- ai_rules/mcp.py +370 -0
- ai_rules/symlinks.py +207 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Automatically updates project documentation by analyzing recent commits and detecting changes
|
|
3
|
+
allowed-tools: AskUserQuestion, Bash, Edit, Glob, Grep, Read, TodoWrite, Write
|
|
4
|
+
model: sonnet
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
- Project root: !`git rev-parse --show-toplevel 2>/dev/null || pwd`
|
|
10
|
+
- Current branch: !`git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "NO_BRANCH"`
|
|
11
|
+
- Recent commits: !`git log --oneline -10 2>/dev/null || echo "NO_COMMITS"`
|
|
12
|
+
- Documentation files: !`find . -maxdepth 3 -type f \( -name "README*" -o -name "ARCHITECTURE*" -o -name "CONTRIBUTING*" \) 2>/dev/null | head -10`
|
|
13
|
+
- Last commit message: !`git log -1 --format="%s" 2>/dev/null || echo "NO_COMMITS"`
|
|
14
|
+
|
|
15
|
+
# Update Project Documentation
|
|
16
|
+
|
|
17
|
+
**Usage:**
|
|
18
|
+
- `/update-docs` - Analyze recent commits and update all relevant documentation
|
|
19
|
+
|
|
20
|
+
Automatically updates project documentation after code changes by intelligently analyzing recent commits, detecting what changed, and updating relevant documentation files while preserving existing style and structure.
|
|
21
|
+
|
|
22
|
+
## Five-Phase Methodology
|
|
23
|
+
|
|
24
|
+
### Phase 1: Change Analysis & Scope Detection
|
|
25
|
+
|
|
26
|
+
**Explore recent commit history:**
|
|
27
|
+
1. Review "Recent commits" from Context above
|
|
28
|
+
2. Identify the most recent logical grouping of related changes
|
|
29
|
+
|
|
30
|
+
**Commit Grouping Heuristics:**
|
|
31
|
+
|
|
32
|
+
Use these indicators to determine which commits form a cohesive logical unit:
|
|
33
|
+
|
|
34
|
+
**Related commits (include in same group):**
|
|
35
|
+
- Commit messages with same feature prefix (e.g., "add auth flow", "fix auth bug", "test auth")
|
|
36
|
+
- High file overlap (>50% of changed files appear in multiple commits)
|
|
37
|
+
- Temporal proximity (commits within same day or few hours)
|
|
38
|
+
- Sequential references to same feature, issue number, or component
|
|
39
|
+
|
|
40
|
+
**Separate logical units (stop grouping):**
|
|
41
|
+
- Different feature/component prefixes in messages
|
|
42
|
+
- No file overlap between commits
|
|
43
|
+
- Large time gaps (days or weeks apart)
|
|
44
|
+
- Clearly distinct functional areas
|
|
45
|
+
|
|
46
|
+
**Example decision:**
|
|
47
|
+
```
|
|
48
|
+
Commits:
|
|
49
|
+
1. "add config set-default-profile command" (1h ago, modified: cli.py, config.py)
|
|
50
|
+
2. "add config file persistence" (50min ago, modified: config.py, README.md)
|
|
51
|
+
3. "add tests for default profile" (45min ago, modified: test_config.py)
|
|
52
|
+
4. "fix typo in help text" (40min ago, modified: cli.py)
|
|
53
|
+
5. "update dependencies" (2 days ago, modified: requirements.txt)
|
|
54
|
+
|
|
55
|
+
→ Group commits 1-4 as "default profile feature"
|
|
56
|
+
→ Exclude commit 5 (different feature, time gap)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Analyze combined changes:**
|
|
60
|
+
|
|
61
|
+
Once scope determined, get full diff for the commit group:
|
|
62
|
+
```bash
|
|
63
|
+
# For single commit
|
|
64
|
+
git show <commit-hash>
|
|
65
|
+
|
|
66
|
+
# For multiple commits (e.g., last 4)
|
|
67
|
+
git log -4 --format="%h %s"
|
|
68
|
+
git diff HEAD~4..HEAD
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Detect change patterns using this table:**
|
|
72
|
+
|
|
73
|
+
| Pattern in Code | Feature Type | Documentation Impact |
|
|
74
|
+
|-----------------|--------------|---------------------|
|
|
75
|
+
| `@click.command()`, `@app.command()` | CLI command | CLI reference, examples |
|
|
76
|
+
| `argparse.add_argument()`, `add_parser()` | CLI argument | CLI reference, usage |
|
|
77
|
+
| `@app.route()`, `@router.get()` | API endpoint | API reference, integration guide |
|
|
78
|
+
| `FastAPI()`, `APIRouter()` | API changes | API docs, OpenAPI spec |
|
|
79
|
+
| Function signature changed | Breaking change | Migration guide, changelog |
|
|
80
|
+
| New YAML/TOML/JSON keys in schema | Configuration | Config reference, examples |
|
|
81
|
+
| `deprecated`, `@deprecated` | Deprecation | Deprecation notice, migration path |
|
|
82
|
+
| New class in public API | New feature | API reference, examples |
|
|
83
|
+
| Removed public function/class | Breaking change | Migration guide, what to use instead |
|
|
84
|
+
|
|
85
|
+
**Parse commit messages for type:**
|
|
86
|
+
- `feat:`, "add", "implement", "create" → New feature
|
|
87
|
+
- `fix:`, "bug", "resolve", "patch" → Bug fix
|
|
88
|
+
- `refactor:`, "restructure", "clean up" → Refactoring
|
|
89
|
+
- `breaking:`, "BREAKING CHANGE:" → Breaking change
|
|
90
|
+
- `docs:` → Documentation only (skip updating docs for docs changes)
|
|
91
|
+
|
|
92
|
+
### Phase 2: Documentation Discovery
|
|
93
|
+
|
|
94
|
+
**Auto-discover documentation files:**
|
|
95
|
+
|
|
96
|
+
Search for documentation using these patterns (prioritized):
|
|
97
|
+
|
|
98
|
+
1. **Root-level user docs** (highest priority):
|
|
99
|
+
- `README.md`, `README.rst`, `README.txt`
|
|
100
|
+
- `GETTING_STARTED.md`, `QUICKSTART.md`
|
|
101
|
+
|
|
102
|
+
2. **Root-level developer docs**:
|
|
103
|
+
- `ARCHITECTURE.md`, `DESIGN.md`
|
|
104
|
+
- `CONTRIBUTING.md`, `DEVELOPMENT.md`
|
|
105
|
+
- `CHANGELOG.md`, `CHANGES.md`
|
|
106
|
+
|
|
107
|
+
3. **Documentation directories**:
|
|
108
|
+
- `docs/*.md`, `doc/*.md`
|
|
109
|
+
- `docs/api/*.md`, `docs/cli/*.md`
|
|
110
|
+
- `.github/*.md`
|
|
111
|
+
|
|
112
|
+
4. **Project-specific** (if they exist):
|
|
113
|
+
- `PLAN*.md` (but check if used for development planning)
|
|
114
|
+
- Any files mentioned in commit messages
|
|
115
|
+
|
|
116
|
+
**Check Context above for "Documentation files"** - these are pre-discovered.
|
|
117
|
+
|
|
118
|
+
**Prioritize by documentation type:**
|
|
119
|
+
1. User-facing (README, getting started) - most critical
|
|
120
|
+
2. CLI/API reference sections - document interfaces
|
|
121
|
+
3. Developer docs (ARCHITECTURE, CONTRIBUTING) - technical details
|
|
122
|
+
4. Examples and tutorials - illustrate usage
|
|
123
|
+
|
|
124
|
+
### Phase 3: Impact Analysis
|
|
125
|
+
|
|
126
|
+
**Map detected changes to documentation sections:**
|
|
127
|
+
|
|
128
|
+
Use this decision table to determine what needs updating:
|
|
129
|
+
|
|
130
|
+
| Change Type | README | ARCHITECTURE | CONTRIBUTING | docs/ | Priority |
|
|
131
|
+
|-------------|--------|--------------|--------------|-------|----------|
|
|
132
|
+
| New CLI command | CLI reference, Quick start | - | - | CLI guide | CRITICAL |
|
|
133
|
+
| New CLI argument | CLI reference, Usage | - | - | CLI guide | CRITICAL |
|
|
134
|
+
| New API endpoint | API overview | API architecture | - | API reference | CRITICAL |
|
|
135
|
+
| Breaking change | Upgrade notes, Breaking changes section | System changes | - | Migration guide | CRITICAL |
|
|
136
|
+
| New config option | Configuration section | Config system | - | Config reference | IMPORTANT |
|
|
137
|
+
| Deprecated feature | Deprecation notice | - | - | Migration guide | IMPORTANT |
|
|
138
|
+
| Performance improvement | Changelog, Performance section | Implementation | - | - | IMPORTANT |
|
|
139
|
+
| Bug fix (behavior change) | Changelog | - | - | - | IMPORTANT |
|
|
140
|
+
| Bug fix (no behavior change) | Changelog only | - | - | - | SKIP |
|
|
141
|
+
| Internal refactor | - | - | - | - | SKIP |
|
|
142
|
+
|
|
143
|
+
**Build update plan:**
|
|
144
|
+
1. List all documentation files needing updates
|
|
145
|
+
2. For each file, identify specific sections to modify
|
|
146
|
+
3. Prioritize by CRITICAL → IMPORTANT → SKIP
|
|
147
|
+
|
|
148
|
+
### Phase 4: Style-Preserving Documentation Updates
|
|
149
|
+
|
|
150
|
+
**Before making any changes:**
|
|
151
|
+
|
|
152
|
+
For each documentation file to update:
|
|
153
|
+
|
|
154
|
+
1. **Analyze existing style** (read first 500 lines):
|
|
155
|
+
- Tone: Formal/technical vs casual/accessible
|
|
156
|
+
- Structure: Heading levels (# ## ###), section organization
|
|
157
|
+
- Formatting: Code block language tags, list style (-, *, 1.), table usage
|
|
158
|
+
- Example patterns: Inline examples vs separate files, comment style in code blocks
|
|
159
|
+
|
|
160
|
+
2. **Identify update strategy**:
|
|
161
|
+
- **Insert**: Add new section for new feature (preserve structure)
|
|
162
|
+
- **Update**: Modify existing section (match formatting)
|
|
163
|
+
- **Append**: Add to list (match list style: -, *, or numbered)
|
|
164
|
+
- **Replace**: Outdated info (preserve tone and format)
|
|
165
|
+
|
|
166
|
+
**Make minimal invasive edits:**
|
|
167
|
+
|
|
168
|
+
For each update, use the Edit tool to:
|
|
169
|
+
- Insert new content into existing sections (don't restructure)
|
|
170
|
+
- Update examples to match new behavior (preserve example format)
|
|
171
|
+
- Preserve cross-references and internal links
|
|
172
|
+
- Match existing writing style, tone, and voice
|
|
173
|
+
- Keep same heading hierarchy and conventions
|
|
174
|
+
|
|
175
|
+
**Examples of style matching:**
|
|
176
|
+
|
|
177
|
+
```markdown
|
|
178
|
+
# Existing style (casual, emoji, short sentences)
|
|
179
|
+
## Commands
|
|
180
|
+
|
|
181
|
+
Use these commands:
|
|
182
|
+
- 🚀 `app start` - Start the app
|
|
183
|
+
- 🛑 `app stop` - Stop it
|
|
184
|
+
|
|
185
|
+
# Match this style when adding:
|
|
186
|
+
- ⚙️ `app config` - Configure settings
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```markdown
|
|
190
|
+
# Existing style (formal, technical, detailed)
|
|
191
|
+
### Command Reference
|
|
192
|
+
|
|
193
|
+
#### start
|
|
194
|
+
Initializes the application server and begins listening for incoming requests on the configured port (default: 8080).
|
|
195
|
+
|
|
196
|
+
# Match this style when adding:
|
|
197
|
+
#### configure
|
|
198
|
+
Modifies application configuration settings, persisting changes to the local configuration file (~/.app/config.toml). Accepts key-value pairs via command-line arguments.
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**What NOT to do:**
|
|
202
|
+
- Don't add features not requested or clearly necessary
|
|
203
|
+
- Don't restructure existing documentation
|
|
204
|
+
- Don't change the tone (formal → casual or vice versa)
|
|
205
|
+
- Don't add verbose descriptions if existing docs are concise
|
|
206
|
+
- Don't remove existing content unless it's deprecated/wrong
|
|
207
|
+
|
|
208
|
+
### Phase 5: Verification & Summary
|
|
209
|
+
|
|
210
|
+
**Verify completeness:**
|
|
211
|
+
|
|
212
|
+
After all updates, check:
|
|
213
|
+
- [ ] All significant changes from Phase 1 are documented
|
|
214
|
+
- [ ] Deprecated features removed or marked as deprecated
|
|
215
|
+
- [ ] All examples updated to match new behavior
|
|
216
|
+
- [ ] Cross-references still valid (no broken links to removed sections)
|
|
217
|
+
- [ ] Consistent style maintained throughout each file
|
|
218
|
+
- [ ] No orphaned sections (sections referencing removed features)
|
|
219
|
+
|
|
220
|
+
**Generate summary report:**
|
|
221
|
+
|
|
222
|
+
Provide user with:
|
|
223
|
+
```
|
|
224
|
+
Documentation Updated - Summary
|
|
225
|
+
|
|
226
|
+
Scope Analyzed:
|
|
227
|
+
- Commits: <N> commits from <oldest> to <newest>
|
|
228
|
+
- Feature: <brief description of logical grouping>
|
|
229
|
+
- Changes detected: <list of key changes>
|
|
230
|
+
|
|
231
|
+
Files Updated:
|
|
232
|
+
- <file1>: <what was updated>
|
|
233
|
+
- <file2>: <what was updated>
|
|
234
|
+
|
|
235
|
+
Verification:
|
|
236
|
+
✓ All new features documented
|
|
237
|
+
✓ Examples updated
|
|
238
|
+
✓ Style preserved
|
|
239
|
+
✓ Cross-references valid
|
|
240
|
+
|
|
241
|
+
Review changes: git diff
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Prioritization Framework
|
|
245
|
+
|
|
246
|
+
Use this framework to decide what to document:
|
|
247
|
+
|
|
248
|
+
**Critical (Must Document)**:
|
|
249
|
+
- New user-facing features (CLI commands, API endpoints)
|
|
250
|
+
- Breaking changes requiring migration
|
|
251
|
+
- Security-related changes (authentication, authorization, data handling)
|
|
252
|
+
- Changed behavior for existing features
|
|
253
|
+
- New required configuration
|
|
254
|
+
|
|
255
|
+
**Important (Should Document)**:
|
|
256
|
+
- New optional configuration
|
|
257
|
+
- Performance improvements with visible user impact
|
|
258
|
+
- Behavior-changing bug fixes (even if fixing a bug)
|
|
259
|
+
- New developer-facing features (build tools, dev commands)
|
|
260
|
+
- Enhanced error messages that users will see
|
|
261
|
+
|
|
262
|
+
**Skip (Don't Document)**:
|
|
263
|
+
- Internal refactoring with no external impact
|
|
264
|
+
- Test additions or modifications
|
|
265
|
+
- Code style or formatting changes
|
|
266
|
+
- Dependency updates (unless they cause breaking changes)
|
|
267
|
+
- Trivial bug fixes (typos, off-by-one with no behavior change)
|
|
268
|
+
- Documentation-only changes (don't update docs for docs commits)
|
|
269
|
+
|
|
270
|
+
## Critical Requirements
|
|
271
|
+
|
|
272
|
+
**Change Detection:**
|
|
273
|
+
- Explore recent commits to identify logical grouping (not just HEAD)
|
|
274
|
+
- Use commit message patterns, file overlap, and timestamps
|
|
275
|
+
- Make autonomous decision about scope
|
|
276
|
+
- Analyze combined diff for the identified group
|
|
277
|
+
|
|
278
|
+
**Documentation Discovery:**
|
|
279
|
+
- Auto-discover using intelligent patterns (README*, ARCHITECTURE*, docs/)
|
|
280
|
+
- Check pre-executed Context for available files
|
|
281
|
+
- Prioritize user-facing docs > API/CLI reference > developer docs
|
|
282
|
+
|
|
283
|
+
**Style Preservation:**
|
|
284
|
+
- **ALWAYS** analyze existing style before updating
|
|
285
|
+
- **MUST** match tone (formal vs casual)
|
|
286
|
+
- **MUST** preserve formatting (code blocks, lists, tables)
|
|
287
|
+
- **MUST** maintain heading hierarchy
|
|
288
|
+
- Make minimal invasive changes only
|
|
289
|
+
|
|
290
|
+
**Update Strategy:**
|
|
291
|
+
- Use Edit tool with exact string matching
|
|
292
|
+
- Insert into existing sections (don't restructure)
|
|
293
|
+
- Update examples in-place (preserve format)
|
|
294
|
+
- Remove deprecated content explicitly
|
|
295
|
+
|
|
296
|
+
**Accuracy:**
|
|
297
|
+
- Base all updates on actual code changes (git diff)
|
|
298
|
+
- Don't guess or fabricate features
|
|
299
|
+
- Include concrete technical details (function names, command syntax)
|
|
300
|
+
- Verify examples match actual implementation
|
|
301
|
+
|
|
302
|
+
**Completeness:**
|
|
303
|
+
- Document all CRITICAL changes (user-facing features, breaking changes)
|
|
304
|
+
- Document IMPORTANT changes (config, behavior changes)
|
|
305
|
+
- Skip internal changes with no external impact
|
|
306
|
+
- Generate verification summary for user
|
|
307
|
+
|
|
308
|
+
**DO:**
|
|
309
|
+
- Analyze commit history to find logical groupings
|
|
310
|
+
- Detect changes using pattern matching table
|
|
311
|
+
- Preserve existing documentation style and tone
|
|
312
|
+
- Make minimal edits (insert into existing structure)
|
|
313
|
+
- Update all examples affected by changes
|
|
314
|
+
- Report what was changed in final summary
|
|
315
|
+
|
|
316
|
+
**DO NOT:**
|
|
317
|
+
- Rigidly analyze only HEAD commit (explore recent history)
|
|
318
|
+
- Restructure existing documentation
|
|
319
|
+
- Change tone or writing style
|
|
320
|
+
- Add features or improvements beyond what changed
|
|
321
|
+
- Skip documenting breaking changes or new user features
|
|
322
|
+
- Remove content without confirming it's deprecated
|
|
323
|
+
|
|
324
|
+
Your goal is to keep documentation accurate and up-to-date with code changes while respecting project conventions and minimizing disruption to existing docs structure.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""SubagentStop Hook - Block premature exits and ensure task completion."""
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main() -> None:
|
|
11
|
+
try:
|
|
12
|
+
event_data = json.loads(sys.stdin.read())
|
|
13
|
+
transcript_path = event_data.get("transcript_path", "")
|
|
14
|
+
except Exception as e:
|
|
15
|
+
print(f"Error loading event data: {e}", file=sys.stderr)
|
|
16
|
+
print(json.dumps({"decision": "approve"}))
|
|
17
|
+
return
|
|
18
|
+
|
|
19
|
+
if not transcript_path:
|
|
20
|
+
print(json.dumps({"decision": "approve"}))
|
|
21
|
+
return
|
|
22
|
+
|
|
23
|
+
transcript_file = Path(transcript_path).expanduser()
|
|
24
|
+
if not transcript_file.exists():
|
|
25
|
+
print(json.dumps({"decision": "approve"}))
|
|
26
|
+
return
|
|
27
|
+
|
|
28
|
+
pending_todos = []
|
|
29
|
+
all_assistant_text = ""
|
|
30
|
+
|
|
31
|
+
with open(transcript_file) as f:
|
|
32
|
+
for line in f:
|
|
33
|
+
try:
|
|
34
|
+
msg = json.loads(line)
|
|
35
|
+
|
|
36
|
+
if "message" in msg:
|
|
37
|
+
msg = msg["message"]
|
|
38
|
+
|
|
39
|
+
if msg.get("role") == "assistant":
|
|
40
|
+
content = msg.get("content", [])
|
|
41
|
+
if isinstance(content, list):
|
|
42
|
+
for item in content:
|
|
43
|
+
if (
|
|
44
|
+
item.get("type") == "tool_use"
|
|
45
|
+
and item.get("name") == "TodoWrite"
|
|
46
|
+
):
|
|
47
|
+
todos = item.get("input", {}).get("todos", [])
|
|
48
|
+
pending_todos = [
|
|
49
|
+
t["content"]
|
|
50
|
+
for t in todos
|
|
51
|
+
if t.get("status") == "pending"
|
|
52
|
+
]
|
|
53
|
+
elif item.get("type") == "text":
|
|
54
|
+
all_assistant_text += item.get("text", "") + " "
|
|
55
|
+
except Exception as e:
|
|
56
|
+
print(f"Error parsing message: {e}", file=sys.stderr)
|
|
57
|
+
continue
|
|
58
|
+
|
|
59
|
+
last_assistant_text = all_assistant_text[-2000:]
|
|
60
|
+
|
|
61
|
+
if pending_todos:
|
|
62
|
+
reason = f"INCOMPLETE: {len(pending_todos)} pending tasks:\n"
|
|
63
|
+
reason += "\n".join(f"- {todo}" for todo in pending_todos)
|
|
64
|
+
reason += "\n\nContinue working autonomously until ALL tasks complete."
|
|
65
|
+
print(json.dumps({"decision": "block", "reason": reason}), file=sys.stderr)
|
|
66
|
+
return
|
|
67
|
+
|
|
68
|
+
check_patterns = [
|
|
69
|
+
"would you like me to",
|
|
70
|
+
"should i continue",
|
|
71
|
+
"shall i proceed",
|
|
72
|
+
"let me check with",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
text_lower = last_assistant_text.lower()
|
|
76
|
+
if any(pattern in text_lower for pattern in check_patterns):
|
|
77
|
+
print(
|
|
78
|
+
json.dumps(
|
|
79
|
+
{
|
|
80
|
+
"decision": "block",
|
|
81
|
+
"reason": "INCOMPLETE: Do NOT ask for permission. Continue working autonomously.",
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
file=sys.stderr,
|
|
85
|
+
)
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
print(json.dumps({"decision": "approve"}))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cleanupPeriodDays": 99999,
|
|
3
|
+
"env": {
|
|
4
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-5-20250929",
|
|
5
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101",
|
|
6
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5-20251001",
|
|
7
|
+
"CLAUDE_CODE_SUBAGENT_MODEL": "claude-sonnet-4-5-20250929"
|
|
8
|
+
},
|
|
9
|
+
"permissions": {
|
|
10
|
+
"allow": [
|
|
11
|
+
"Bash(awk:*)",
|
|
12
|
+
"Bash(cargo build:*)",
|
|
13
|
+
"Bash(cargo check:*)",
|
|
14
|
+
"Bash(cargo clean:*)",
|
|
15
|
+
"Bash(cargo run:*)",
|
|
16
|
+
"Bash(cargo test:*)",
|
|
17
|
+
"Bash(cargo tree:*)",
|
|
18
|
+
"Bash(cat:*)",
|
|
19
|
+
"Bash(cd:*)",
|
|
20
|
+
"Bash(chmod:*)",
|
|
21
|
+
"Bash(cp:*)",
|
|
22
|
+
"Bash(curl:*)",
|
|
23
|
+
"Bash(df:*)",
|
|
24
|
+
"Bash(diff:*)",
|
|
25
|
+
"Bash(docker build:*)",
|
|
26
|
+
"Bash(docker builder:*)",
|
|
27
|
+
"Bash(docker image:*)",
|
|
28
|
+
"Bash(docker ps:*)",
|
|
29
|
+
"Bash(docker run:*)",
|
|
30
|
+
"Bash(docker system:*)",
|
|
31
|
+
"Bash(echo:*)",
|
|
32
|
+
"Bash(env:*)",
|
|
33
|
+
"Bash(file:*)",
|
|
34
|
+
"Bash(find:*)",
|
|
35
|
+
"Bash(gh issue list:*)",
|
|
36
|
+
"Bash(gh issue view:*)",
|
|
37
|
+
"Bash(gh pr checks:*)",
|
|
38
|
+
"Bash(gh pr diff:*)",
|
|
39
|
+
"Bash(gh pr list:*)",
|
|
40
|
+
"Bash(gh pr view:*)",
|
|
41
|
+
"Bash(gh release view:*)",
|
|
42
|
+
"Bash(gh release list:*)",
|
|
43
|
+
"Bash(gh run:*)",
|
|
44
|
+
"Bash(gh search issues:*)",
|
|
45
|
+
"Bash(git add:*)",
|
|
46
|
+
"Bash(git branch:*)",
|
|
47
|
+
"Bash(git checkout:*)",
|
|
48
|
+
"Bash(git check-attr:*)",
|
|
49
|
+
"Bash(git check-ignore:*)",
|
|
50
|
+
"Bash(git describe:*)",
|
|
51
|
+
"Bash(git diff:*)",
|
|
52
|
+
"Bash(git fetch:*)",
|
|
53
|
+
"Bash(git log:*)",
|
|
54
|
+
"Bash(git ls-files:*)",
|
|
55
|
+
"Bash(git merge-base:*)",
|
|
56
|
+
"Bash(git pull:*)",
|
|
57
|
+
"Bash(git push:*)",
|
|
58
|
+
"Bash(git remote:*)",
|
|
59
|
+
"Bash(git rev-list:*)",
|
|
60
|
+
"Bash(git rm:*)",
|
|
61
|
+
"Bash(git show:*)",
|
|
62
|
+
"Bash(git tag:*)",
|
|
63
|
+
"Bash(go test:*)",
|
|
64
|
+
"Bash(grep:*)",
|
|
65
|
+
"Bash(head:*)",
|
|
66
|
+
"Bash(hexdump:*)",
|
|
67
|
+
"Bash(just:*)",
|
|
68
|
+
"Bash(ls:*)",
|
|
69
|
+
"Bash(lsof:*)",
|
|
70
|
+
"Bash(mkdir:*)",
|
|
71
|
+
"Bash(npm install:*)",
|
|
72
|
+
"Bash(npm run:*)",
|
|
73
|
+
"Bash(npm view:*)",
|
|
74
|
+
"Bash(readlink:*)",
|
|
75
|
+
"Bash(rg:*)",
|
|
76
|
+
"Bash(sed:*)",
|
|
77
|
+
"Bash(shellcheck:*)",
|
|
78
|
+
"Bash(shfmt:*)",
|
|
79
|
+
"Bash(sort:*)",
|
|
80
|
+
"Bash(stat:*)",
|
|
81
|
+
"Bash(tail:*)",
|
|
82
|
+
"Bash(tar:*)",
|
|
83
|
+
"Bash(tee:*)",
|
|
84
|
+
"Bash(test:*)",
|
|
85
|
+
"Bash(touch:*)",
|
|
86
|
+
"Bash(tr:*)",
|
|
87
|
+
"Bash(tree:*)",
|
|
88
|
+
"Bash(unzip:*)",
|
|
89
|
+
"Bash(uv:*)",
|
|
90
|
+
"Bash(wc:*)",
|
|
91
|
+
"Read(*)",
|
|
92
|
+
"Search(*)",
|
|
93
|
+
"Skill(prompt-engineer)",
|
|
94
|
+
"Skill(doc-writer)",
|
|
95
|
+
"WebFetch",
|
|
96
|
+
"WebSearch"
|
|
97
|
+
],
|
|
98
|
+
"deny": [
|
|
99
|
+
"Bash(gh pr merge:*)",
|
|
100
|
+
"Bash(git push --force:*)",
|
|
101
|
+
"Bash(git reset:*)",
|
|
102
|
+
"Bash(git revert:*)",
|
|
103
|
+
"Bash(git stash drop:*)",
|
|
104
|
+
"Bash(rm -f:*)",
|
|
105
|
+
"Bash(rm -r:*)"
|
|
106
|
+
],
|
|
107
|
+
"defaultMode": "plan"
|
|
108
|
+
},
|
|
109
|
+
"model": "opusplan",
|
|
110
|
+
"hooks": {},
|
|
111
|
+
"statusLine": {
|
|
112
|
+
"type": "command",
|
|
113
|
+
"command": "claude-statusline"
|
|
114
|
+
},
|
|
115
|
+
"alwaysThinkingEnabled": true
|
|
116
|
+
}
|