ai-agent-rules 0.15.12__tar.gz
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.15.12/LICENSE +22 -0
- ai_agent_rules-0.15.12/PKG-INFO +475 -0
- ai_agent_rules-0.15.12/README.md +440 -0
- ai_agent_rules-0.15.12/pyproject.toml +123 -0
- ai_agent_rules-0.15.12/setup.cfg +4 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/PKG-INFO +475 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/SOURCES.txt +55 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/dependency_links.txt +1 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/entry_points.txt +3 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/requires.txt +12 -0
- ai_agent_rules-0.15.12/src/ai_agent_rules.egg-info/top_level.txt +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/__init__.py +8 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/__init__.py +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/base.py +68 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/claude.py +123 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/cursor.py +70 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/goose.py +47 -0
- ai_agent_rules-0.15.12/src/ai_rules/agents/shared.py +35 -0
- ai_agent_rules-0.15.12/src/ai_rules/bootstrap/__init__.py +78 -0
- ai_agent_rules-0.15.12/src/ai_rules/bootstrap/config.py +261 -0
- ai_agent_rules-0.15.12/src/ai_rules/bootstrap/installer.py +320 -0
- ai_agent_rules-0.15.12/src/ai_rules/bootstrap/updater.py +361 -0
- ai_agent_rules-0.15.12/src/ai_rules/bootstrap/version.py +35 -0
- ai_agent_rules-0.15.12/src/ai_rules/cli.py +2709 -0
- ai_agent_rules-0.15.12/src/ai_rules/completions.py +194 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/AGENTS.md +250 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/chat_agent_hints.md +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/CLAUDE.md +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/agents/code-reviewer.md +121 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/agents-md.md +435 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/annotate-changelog.md +191 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/comment-cleanup.md +161 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/continue-crash.md +38 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/dev-docs.md +169 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/pr-creator.md +247 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/test-cleanup.md +244 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/commands/update-docs.md +324 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/hooks/subagentStop.py +92 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/mcps.json +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/settings.json +119 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/skills/doc-writer/SKILL.md +293 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/skills/doc-writer/resources/templates.md +495 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/skills/prompt-engineer/SKILL.md +278 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/skills/prompt-engineer/resources/prompt_engineering_guide_2025.md +855 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/claude/skills/prompt-engineer/resources/templates.md +232 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/cursor/keybindings.json +14 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/cursor/settings.json +81 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/goose/.goosehints +1 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/goose/config.yaml +55 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/profiles/default.yaml +6 -0
- ai_agent_rules-0.15.12/src/ai_rules/config/profiles/work.yaml +11 -0
- ai_agent_rules-0.15.12/src/ai_rules/config.py +643 -0
- ai_agent_rules-0.15.12/src/ai_rules/mcp.py +369 -0
- ai_agent_rules-0.15.12/src/ai_rules/profiles.py +187 -0
- ai_agent_rules-0.15.12/src/ai_rules/state.py +47 -0
- ai_agent_rules-0.15.12/src/ai_rules/symlinks.py +207 -0
- ai_agent_rules-0.15.12/src/ai_rules/utils.py +35 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Will Pfleger
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ai-agent-rules
|
|
3
|
+
Version: 0.15.12
|
|
4
|
+
Summary: Manage user-level AI agent configurations
|
|
5
|
+
Author-email: Will Pfleger <pfleger.will@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/willpfleger/ai-rules
|
|
8
|
+
Project-URL: Repository, https://github.com/willpfleger/ai-rules
|
|
9
|
+
Project-URL: Issues, https://github.com/willpfleger/ai-rules/issues
|
|
10
|
+
Keywords: ai,cli,configuration,claude,goose,llm,agent
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Topic :: Utilities
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: click>=8.1
|
|
25
|
+
Requires-Dist: hatch>=1.15.1
|
|
26
|
+
Requires-Dist: packaging>=21.0
|
|
27
|
+
Requires-Dist: pytest>=8.4.2
|
|
28
|
+
Requires-Dist: pytest-cov>=7.0.0
|
|
29
|
+
Requires-Dist: pytest-xdist>=3.8.0
|
|
30
|
+
Requires-Dist: pyyaml>=6.0
|
|
31
|
+
Requires-Dist: rich>=13.0
|
|
32
|
+
Requires-Dist: ruff>=0.14.3
|
|
33
|
+
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# AI Rules
|
|
37
|
+
|
|
38
|
+
Manage AI agent configurations through symlinks. Keep all your configs in one git-tracked location.
|
|
39
|
+
|
|
40
|
+
[](https://pypi.org/project/ai-agent-rules/)
|
|
41
|
+
[](https://pypi.org/project/ai-agent-rules/)
|
|
42
|
+
[](https://pypi.org/project/ai-agent-rules/)
|
|
43
|
+
[](https://github.com/wpfleger96/ai-rules/actions/workflows/ci.yml)
|
|
44
|
+
[](https://github.com/wpfleger96/ai-rules/graphs/contributors)
|
|
45
|
+
[](https://github.com/wpfleger96/ai-rules)
|
|
46
|
+
[](https://github.com/wpfleger96/ai-rules/blob/main/LICENSE)
|
|
47
|
+
|
|
48
|
+
## Overview
|
|
49
|
+
|
|
50
|
+
Consolidates config files for AI coding agents (Claude Code, Cursor, Goose) into a single source of truth via symlinks:
|
|
51
|
+
|
|
52
|
+
- Git-tracked configs synced across machines
|
|
53
|
+
- Edit once, apply everywhere
|
|
54
|
+
- Exclude specific files (e.g., company-managed)
|
|
55
|
+
- Per-agent customizations
|
|
56
|
+
|
|
57
|
+
**Supported:** Claude Code (settings, agents, commands), Cursor (settings, keybindings), Goose (hints, config), Shared (AGENTS.md)
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
**Requirements:** Python 3.10+, [uv](https://github.com/astral-sh/uv)
|
|
62
|
+
|
|
63
|
+
### From PyPI (Recommended)
|
|
64
|
+
|
|
65
|
+
One-command setup from PyPI:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
uvx --from ai-agent-rules ai-rules setup
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
This will:
|
|
72
|
+
1. Install AI agent configuration symlinks
|
|
73
|
+
2. Make `ai-rules` available system-wide
|
|
74
|
+
3. Auto-install optional tools (claude-code-statusline)
|
|
75
|
+
|
|
76
|
+
After setup, you can run `ai-rules` from any directory.
|
|
77
|
+
|
|
78
|
+
### From GitHub (Development)
|
|
79
|
+
|
|
80
|
+
Install from GitHub to get the latest development code:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
uvx --from ai-agent-rules ai-rules setup --github
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This installs from the main branch and auto-detects the GitHub source for future updates.
|
|
87
|
+
|
|
88
|
+
### Local Development
|
|
89
|
+
|
|
90
|
+
For contributing or local development:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
git clone https://github.com/wpfleger96/ai-rules.git
|
|
94
|
+
cd ai-rules
|
|
95
|
+
uv run ai-rules install
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `uv run ai-rules <command>` to test local changes. The global `ai-rules` command continues to run your installed version (PyPI/GitHub).
|
|
99
|
+
|
|
100
|
+
### Updating
|
|
101
|
+
|
|
102
|
+
Check for and install updates:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
ai-rules upgrade # Check and install updates
|
|
106
|
+
ai-rules upgrade --check # Only check for updates
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Auto-update checks run weekly by default. Configure in `~/.ai-rules/update_config.yaml`:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
enabled: true
|
|
113
|
+
frequency: weekly # daily, weekly, never
|
|
114
|
+
notify_only: false
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Usage
|
|
118
|
+
|
|
119
|
+
### User-Level Configuration
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
ai-rules setup # One-time setup: install symlinks + make available system-wide
|
|
123
|
+
ai-rules setup --github # Install from GitHub (pre-release)
|
|
124
|
+
ai-rules setup --profile work # Setup with a specific profile
|
|
125
|
+
ai-rules upgrade # Upgrade to latest version
|
|
126
|
+
ai-rules upgrade --check # Check for updates without installing
|
|
127
|
+
|
|
128
|
+
ai-rules install # Install all agent configs + optional tools
|
|
129
|
+
ai-rules install --agents claude # Install specific agents
|
|
130
|
+
ai-rules install --dry-run # Preview changes
|
|
131
|
+
ai-rules install --force # Skip confirmations
|
|
132
|
+
ai-rules install --rebuild-cache # Rebuild merged settings cache
|
|
133
|
+
|
|
134
|
+
ai-rules status # Check symlink status + optional tools + active profile (✓✗⚠○)
|
|
135
|
+
ai-rules diff # Show config differences
|
|
136
|
+
ai-rules validate # Verify source files exist
|
|
137
|
+
ai-rules update # Re-sync after adding files
|
|
138
|
+
ai-rules uninstall # Remove all symlinks
|
|
139
|
+
ai-rules list-agents # Show available agents
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Configuration Management
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Interactive wizard for first-time setup
|
|
146
|
+
ai-rules config init # Start configuration wizard
|
|
147
|
+
|
|
148
|
+
# View configuration
|
|
149
|
+
ai-rules config show # Show raw config files
|
|
150
|
+
ai-rules config show --merged # Show merged settings with overrides
|
|
151
|
+
ai-rules config show --agent claude # Show config for specific agent
|
|
152
|
+
ai-rules config edit # Edit user config in $EDITOR
|
|
153
|
+
|
|
154
|
+
# Manage exclusions
|
|
155
|
+
ai-rules exclude add "~/.claude/*.json" # Add exclusion pattern (supports globs)
|
|
156
|
+
ai-rules exclude remove "~/.claude/*.json" # Remove exclusion pattern
|
|
157
|
+
ai-rules exclude list # List all exclusions
|
|
158
|
+
|
|
159
|
+
# Manage settings overrides (for machine-specific settings)
|
|
160
|
+
ai-rules override set claude.model "claude-sonnet-4-5-20250929" # Set simple override
|
|
161
|
+
ai-rules override set cursor.editor.fontSize 14 # Override Cursor font size
|
|
162
|
+
ai-rules override set claude.hooks.SubagentStop[0].hooks[0].command "script.py" # Array notation
|
|
163
|
+
ai-rules override unset claude.model # Remove override
|
|
164
|
+
ai-rules override list # List all overrides
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Configuration
|
|
168
|
+
|
|
169
|
+
### Quick Start with Config Wizard
|
|
170
|
+
|
|
171
|
+
Run the interactive configuration wizard for guided setup:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
ai-rules config init
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
This will walk you through:
|
|
178
|
+
1. Selecting common exclusions
|
|
179
|
+
2. Adding custom exclusion patterns (with glob support)
|
|
180
|
+
3. Setting up machine-specific settings overrides
|
|
181
|
+
|
|
182
|
+
### User-Level Config
|
|
183
|
+
|
|
184
|
+
Create `~/.ai-rules-config.yaml` for user-level settings:
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
version: 1
|
|
188
|
+
|
|
189
|
+
# Global exclusions (apply to all contexts)
|
|
190
|
+
# Supports glob patterns: *.json, **/*.yaml, etc.
|
|
191
|
+
exclude_symlinks:
|
|
192
|
+
- "~/.config/goose/config.yaml"
|
|
193
|
+
- "~/.claude/*.log" # Glob: exclude all log files
|
|
194
|
+
- "~/.claude/agents/debug-*.md" # Glob: exclude debug agents
|
|
195
|
+
|
|
196
|
+
# Machine-specific settings overrides
|
|
197
|
+
# Keeps repo settings.json synced via git, but allows local overrides
|
|
198
|
+
settings_overrides:
|
|
199
|
+
claude:
|
|
200
|
+
model: "claude-sonnet-4-5-20250929" # Override model on personal laptop
|
|
201
|
+
# Other settings inherited from base config/claude/settings.json
|
|
202
|
+
cursor:
|
|
203
|
+
editor.fontSize: 14 # Override font size on this machine
|
|
204
|
+
goose:
|
|
205
|
+
provider: "anthropic"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Config File Location:**
|
|
209
|
+
- `~/.ai-rules-config.yaml` - User-specific config (exclusions and overrides)
|
|
210
|
+
- `~/.ai-rules/state.yaml` - Active profile and last install timestamp (auto-managed)
|
|
211
|
+
- `~/.ai-rules/cache/` - Merged settings cache (auto-generated)
|
|
212
|
+
- `~/.ai-rules/update_config.yaml` - Update check configuration
|
|
213
|
+
|
|
214
|
+
### Settings Overrides - Syncing Configs Across Machines
|
|
215
|
+
|
|
216
|
+
**Problem:** You want to sync your `settings.json` via git, but need different settings on different machines (e.g., different model access on work vs personal laptop).
|
|
217
|
+
|
|
218
|
+
**Solution:** Use `settings_overrides` in your user config:
|
|
219
|
+
|
|
220
|
+
```yaml
|
|
221
|
+
# ~/.ai-rules-config.yaml on personal laptop
|
|
222
|
+
settings_overrides:
|
|
223
|
+
claude:
|
|
224
|
+
model: "claude-sonnet-4-5-20250929" # No Opus access
|
|
225
|
+
|
|
226
|
+
# ~/.ai-rules-config.yaml on work laptop
|
|
227
|
+
settings_overrides:
|
|
228
|
+
claude:
|
|
229
|
+
model: "claude-opus-4-20250514" # Has Opus access
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Both machines sync the same `config/claude/settings.json` via git, but each has different local overrides. The system merges them at install time:
|
|
233
|
+
|
|
234
|
+
1. **Base settings** from `config/claude/settings.json` (git-tracked)
|
|
235
|
+
2. **Merged with** overrides from `~/.ai-rules-config.yaml` (local only)
|
|
236
|
+
3. **Cached** in `~/.ai-rules/cache/claude/settings.json`
|
|
237
|
+
4. **Symlinked** to `~/.claude/settings.json`
|
|
238
|
+
|
|
239
|
+
After changing overrides, run:
|
|
240
|
+
```bash
|
|
241
|
+
ai-rules install --rebuild-cache
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
#### Array Notation for Nested Settings
|
|
245
|
+
|
|
246
|
+
Override commands support array index notation for complex nested structures:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Override nested array elements (e.g., hooks)
|
|
250
|
+
ai-rules override set claude.hooks.SubagentStop[0].hooks[0].command "uv run ~/my-hook.py"
|
|
251
|
+
|
|
252
|
+
# Override environment variables
|
|
253
|
+
ai-rules override set claude.env.MY_VAR "value"
|
|
254
|
+
|
|
255
|
+
# The system validates paths and provides helpful suggestions
|
|
256
|
+
ai-rules override set claude.modle "sonnet"
|
|
257
|
+
# Error: Key 'modle' not found at 'modle'
|
|
258
|
+
# Available options: model, env, hooks, statusLine, ...
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Path validation ensures you only set valid overrides that exist in the base settings, preventing typos and configuration errors.
|
|
262
|
+
|
|
263
|
+
### Cursor Settings
|
|
264
|
+
|
|
265
|
+
Cursor settings support the same override mechanism as other agents:
|
|
266
|
+
|
|
267
|
+
```yaml
|
|
268
|
+
# ~/.ai-rules-config.yaml
|
|
269
|
+
settings_overrides:
|
|
270
|
+
cursor:
|
|
271
|
+
editor.fontSize: 14
|
|
272
|
+
terminal.integrated.defaultLocation: "editor"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
> **Note:** `keybindings.json` uses direct symlinks without override merging (array structure).
|
|
276
|
+
|
|
277
|
+
### Profiles - Machine-Specific Configuration
|
|
278
|
+
|
|
279
|
+
Profiles let you group configuration overrides into named presets. Instead of manually maintaining different `~/.ai-rules-config.yaml` files across machines, define profiles once and select them at install time.
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# List available profiles
|
|
283
|
+
ai-rules profile list
|
|
284
|
+
|
|
285
|
+
# View profile details
|
|
286
|
+
ai-rules profile show work
|
|
287
|
+
ai-rules profile show work --resolved # Show with inheritance
|
|
288
|
+
|
|
289
|
+
# Check which profile is active
|
|
290
|
+
ai-rules profile current
|
|
291
|
+
|
|
292
|
+
# Switch to a different profile
|
|
293
|
+
ai-rules profile switch work
|
|
294
|
+
|
|
295
|
+
# Install with a specific profile
|
|
296
|
+
ai-rules install --profile work
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
Profiles are stored in `src/ai_rules/config/profiles/` and support inheritance:
|
|
300
|
+
|
|
301
|
+
```yaml
|
|
302
|
+
# profiles/work.yaml
|
|
303
|
+
name: work
|
|
304
|
+
description: Work laptop with extended context model
|
|
305
|
+
extends: null
|
|
306
|
+
settings_overrides:
|
|
307
|
+
claude:
|
|
308
|
+
env:
|
|
309
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL: "claude-sonnet-4-5-20250929[1m]"
|
|
310
|
+
model: opusplan
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Configuration layers (lowest to highest priority):
|
|
314
|
+
1. Profile overrides
|
|
315
|
+
2. Local `~/.ai-rules-config.yaml` overrides
|
|
316
|
+
|
|
317
|
+
Your local config always wins, so you can use a profile as a base and tweak specific settings per-machine. Profiles are git-tracked and can be shared across your team.
|
|
318
|
+
|
|
319
|
+
The active profile is tracked in `~/.ai-rules/state.yaml` and persists across sessions. Use `profile current` to see which profile is active, or `profile switch` to quickly change profiles without re-running the full install.
|
|
320
|
+
|
|
321
|
+
## Structure
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
config/
|
|
325
|
+
├── AGENTS.md # User-level rules → ~/AGENTS.md, ~/.CLAUDE.md, ~/.config/goose/.goosehints
|
|
326
|
+
├── claude/
|
|
327
|
+
│ ├── settings.json # → ~/.claude/settings.json
|
|
328
|
+
│ ├── agents/*.md # → ~/.claude/agents/*.md (dynamic)
|
|
329
|
+
│ └── commands/*.md # → ~/.claude/commands/*.md (dynamic)
|
|
330
|
+
├── cursor/
|
|
331
|
+
│ ├── settings.json # → ~/Library/Application Support/Cursor/User/ (macOS)
|
|
332
|
+
│ │ # ~/AppData/Roaming/Cursor/User/ (Windows)
|
|
333
|
+
│ │ # ~/.config/Cursor/User/ (Linux)
|
|
334
|
+
│ └── keybindings.json # → (same paths as settings.json)
|
|
335
|
+
└── goose/
|
|
336
|
+
└── config.yaml # → ~/.config/goose/config.yaml
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
> **Note:** The Cursor config files contain the maintainer's personal preferences
|
|
340
|
+
> (e.g., macOS-specific terminal settings). Customize for your environment.
|
|
341
|
+
|
|
342
|
+
## Optional Tools
|
|
343
|
+
|
|
344
|
+
AI Rules automatically installs optional tools that enhance functionality:
|
|
345
|
+
|
|
346
|
+
- **claude-code-statusline** - Custom status line for Claude Code showing token usage, git info, time, and workspace details
|
|
347
|
+
|
|
348
|
+
These tools are installed automatically during `setup` and `install` commands. Check installation status:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
ai-rules status # Shows Optional Tools section
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
If a tool fails to install, ai-rules continues normally (fail-open behavior).
|
|
355
|
+
|
|
356
|
+
## Extending
|
|
357
|
+
|
|
358
|
+
**Add Claude agent/command:**
|
|
359
|
+
1. Create `config/claude/agents/my-agent.md` or `config/claude/commands/my-cmd.md`
|
|
360
|
+
2. Run `ai-rules update`
|
|
361
|
+
|
|
362
|
+
**Add new AI tool:**
|
|
363
|
+
1. Add configs to `config/<tool>/`
|
|
364
|
+
2. Implement `ai_rules/agents/<tool>.py`
|
|
365
|
+
3. Register in `ai_rules/cli.py::get_agents()`
|
|
366
|
+
|
|
367
|
+
## Safety
|
|
368
|
+
|
|
369
|
+
- First-run warnings
|
|
370
|
+
- Timestamped backups (`*.ai-rules-backup.YYYYMMDD-HHMMSS`)
|
|
371
|
+
- Interactive prompts and dry-run mode
|
|
372
|
+
- Only manages symlinks (never deletes real files)
|
|
373
|
+
- Contextual error messages with tips
|
|
374
|
+
|
|
375
|
+
## Development
|
|
376
|
+
|
|
377
|
+
### Quick Start with Just
|
|
378
|
+
|
|
379
|
+
This project uses [just](https://github.com/casey/just) for task automation.
|
|
380
|
+
|
|
381
|
+
**Install just**:
|
|
382
|
+
```bash
|
|
383
|
+
# macOS
|
|
384
|
+
brew install just
|
|
385
|
+
|
|
386
|
+
# Linux
|
|
387
|
+
cargo install just
|
|
388
|
+
# or: sudo apt install just (Ubuntu 23.04+)
|
|
389
|
+
|
|
390
|
+
# Windows
|
|
391
|
+
choco install just
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
**Common commands**:
|
|
395
|
+
```bash
|
|
396
|
+
just # Run quick quality checks (sync, type-check, lint-check, format-check)
|
|
397
|
+
just --list # List all available recipes
|
|
398
|
+
|
|
399
|
+
# Setup
|
|
400
|
+
just setup # First-time setup: sync deps + install git hooks
|
|
401
|
+
just sync # Sync dependencies only
|
|
402
|
+
|
|
403
|
+
# Code Quality
|
|
404
|
+
just check # Quick quality checks (no tests)
|
|
405
|
+
just check-all # All checks including tests
|
|
406
|
+
just lint # Fix linting issues
|
|
407
|
+
just format # Auto-format code
|
|
408
|
+
just type-check # Run mypy type checking
|
|
409
|
+
|
|
410
|
+
# Testing
|
|
411
|
+
just test # Run all tests (default config)
|
|
412
|
+
just test-unit # Unit tests only
|
|
413
|
+
just test-integration # Integration tests only
|
|
414
|
+
just test-cov # Tests with coverage report
|
|
415
|
+
|
|
416
|
+
# Benchmarking
|
|
417
|
+
just benchmark-save # Run and save baseline
|
|
418
|
+
just benchmark-compare # Compare against baseline
|
|
419
|
+
just benchmark-record # Compare and save
|
|
420
|
+
just benchmark-list # List saved benchmarks
|
|
421
|
+
just benchmark-clean # Remove all benchmarks
|
|
422
|
+
|
|
423
|
+
# Build
|
|
424
|
+
just build # Build package
|
|
425
|
+
just rebuild # Clean and build
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Running Tests
|
|
429
|
+
The test suite includes both unit tests and integration tests.
|
|
430
|
+
|
|
431
|
+
Using just (recommended):
|
|
432
|
+
```bash
|
|
433
|
+
just test # Run all tests with default config
|
|
434
|
+
just test-unit # Only unit tests
|
|
435
|
+
just test-integration # Only integration tests
|
|
436
|
+
just test-cov # Tests with coverage report
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Using uv directly:
|
|
440
|
+
```bash
|
|
441
|
+
uv run pytest [--cov=src --cov-report=term-missing] # All tests
|
|
442
|
+
uv run pytest -m unit # Unit tests only
|
|
443
|
+
uv run pytest -m integration # Integration tests only
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
## Troubleshooting
|
|
447
|
+
|
|
448
|
+
**Wrong target:** `ai-rules status` then `ai-rules install --force`
|
|
449
|
+
|
|
450
|
+
**Restore backup:**
|
|
451
|
+
```bash
|
|
452
|
+
ls -la ~/.CLAUDE.md.ai-rules-backup.*
|
|
453
|
+
mv ~/.CLAUDE.md.ai-rules-backup.20250104-143022 ~/.CLAUDE.md
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
**Disable symlink:** Use the exclude command or add to config manually:
|
|
457
|
+
```bash
|
|
458
|
+
ai-rules exclude add "~/.claude/settings.json"
|
|
459
|
+
# Or edit manually: ai-rules config edit
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
**Override not applying:** Rebuild the merged settings cache:
|
|
463
|
+
```bash
|
|
464
|
+
ai-rules install --rebuild-cache
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**View merged settings:** Check what's actually being applied:
|
|
468
|
+
```bash
|
|
469
|
+
ai-rules config show --merged
|
|
470
|
+
ai-rules config show --merged --agent claude
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
## License
|
|
474
|
+
|
|
475
|
+
MIT
|