ai-agent-rules 0.15.2__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.
- ai_agent_rules-0.15.2.dist-info/METADATA +451 -0
- ai_agent_rules-0.15.2.dist-info/RECORD +52 -0
- ai_agent_rules-0.15.2.dist-info/WHEEL +5 -0
- ai_agent_rules-0.15.2.dist-info/entry_points.txt +3 -0
- ai_agent_rules-0.15.2.dist-info/licenses/LICENSE +22 -0
- ai_agent_rules-0.15.2.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 +123 -0
- ai_rules/agents/cursor.py +70 -0
- ai_rules/agents/goose.py +47 -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 +279 -0
- ai_rules/bootstrap/updater.py +344 -0
- ai_rules/bootstrap/version.py +52 -0
- ai_rules/cli.py +2434 -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/CLAUDE.md +1 -0
- ai_rules/config/claude/agents/code-reviewer.md +121 -0
- ai_rules/config/claude/commands/agents-md.md +422 -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 +119 -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/cursor/keybindings.json +14 -0
- ai_rules/config/cursor/settings.json +81 -0
- ai_rules/config/goose/.goosehints +1 -0
- ai_rules/config/goose/config.yaml +55 -0
- ai_rules/config/profiles/default.yaml +6 -0
- ai_rules/config/profiles/work.yaml +11 -0
- ai_rules/config.py +644 -0
- ai_rules/display.py +40 -0
- ai_rules/mcp.py +369 -0
- ai_rules/profiles.py +187 -0
- ai_rules/symlinks.py +207 -0
- ai_rules/utils.py +35 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Prompt Engineering Templates
|
|
2
|
+
|
|
3
|
+
Quick reference for proven prompting frameworks. Use these templates to structure your prompts effectively.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## CO-STAR: Writing & Content Creation
|
|
8
|
+
|
|
9
|
+
**Use for**: Marketing copy, technical documentation, business communications, content generation
|
|
10
|
+
|
|
11
|
+
**Components**: **C**ontext, **O**bjective, **S**tyle, **T**one, **A**udience, **R**esponse format
|
|
12
|
+
|
|
13
|
+
**Template**:
|
|
14
|
+
```
|
|
15
|
+
Context: [Background and situation]
|
|
16
|
+
Objective: [What you want to accomplish]
|
|
17
|
+
Style: [Writing style - formal, casual, technical, etc.]
|
|
18
|
+
Tone: [Emotional quality - professional, enthusiastic, etc.]
|
|
19
|
+
Audience: [Who will read this and their characteristics]
|
|
20
|
+
Response format:
|
|
21
|
+
- [Section 1]
|
|
22
|
+
- [Section 2]
|
|
23
|
+
- [etc.]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Example**:
|
|
27
|
+
```
|
|
28
|
+
Context: Launching new API feature for real-time webhook notifications for payment events.
|
|
29
|
+
Objective: Write product announcement blog post generating excitement and driving adoption.
|
|
30
|
+
Style: Technical but accessible, conversational yet professional
|
|
31
|
+
Tone: Enthusiastic and developer-friendly
|
|
32
|
+
Audience: Software developers integrating with our payment API
|
|
33
|
+
Response format:
|
|
34
|
+
- Catchy headline (under 60 characters)
|
|
35
|
+
- Opening paragraph (2-3 sentences)
|
|
36
|
+
- "What's New" section with technical details
|
|
37
|
+
- "Why This Matters" section
|
|
38
|
+
- "Getting Started" with code example
|
|
39
|
+
- Call-to-action
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## ROSES: Decision Support
|
|
45
|
+
|
|
46
|
+
**Use for**: Strategic business decisions, technical architecture choices, resource allocation, risk assessment
|
|
47
|
+
|
|
48
|
+
**Components**: **R**ole, **O**bjective, **S**cenario, **E**xpected Output, **S**tyle
|
|
49
|
+
|
|
50
|
+
**Template**:
|
|
51
|
+
```
|
|
52
|
+
Role: [Perspective to take, expertise level]
|
|
53
|
+
Objective: [Specific decision to be made]
|
|
54
|
+
Scenario:
|
|
55
|
+
- [Current state]
|
|
56
|
+
- [Key constraints]
|
|
57
|
+
- [Available resources]
|
|
58
|
+
- [Relevant background]
|
|
59
|
+
Expected Output:
|
|
60
|
+
- [Format element 1]
|
|
61
|
+
- [Format element 2]
|
|
62
|
+
- [etc.]
|
|
63
|
+
Style: [How to present - data-driven, practical, etc.]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Example**:
|
|
67
|
+
```
|
|
68
|
+
Role: CTO evaluating infrastructure decisions for rapidly growing startup
|
|
69
|
+
Objective: Decide whether to adopt Kubernetes for microservices architecture
|
|
70
|
+
Scenario:
|
|
71
|
+
- 12 microservices on EC2 with manual bash deployment
|
|
72
|
+
- Team of 8 engineers, 3 have container experience
|
|
73
|
+
- Growing 30% quarter-over-quarter
|
|
74
|
+
- Deployment issues causing 2-3 hour downtime monthly
|
|
75
|
+
- Budget allows 2-3 months of infrastructure work
|
|
76
|
+
Expected Output:
|
|
77
|
+
- Clear recommendation (Kubernetes, stay on EC2, or hybrid)
|
|
78
|
+
- 3-5 key decision factors ranked by importance
|
|
79
|
+
- Risk assessment with mitigation strategies
|
|
80
|
+
- Implementation timeline
|
|
81
|
+
- Estimated engineering time investment
|
|
82
|
+
Style: Data-driven and practical, focused on team capabilities and business impact
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Architecture-First: Software Development
|
|
88
|
+
|
|
89
|
+
**Use for**: New features, components, refactoring, integrations, code generation
|
|
90
|
+
|
|
91
|
+
**Pattern**: Context → Goal → Constraints → Technical Requirements
|
|
92
|
+
|
|
93
|
+
**Template**:
|
|
94
|
+
```
|
|
95
|
+
Context: [Existing system architecture, tech stack, current implementation]
|
|
96
|
+
- [Tech stack]
|
|
97
|
+
- [Current implementation]
|
|
98
|
+
- [Integration points]
|
|
99
|
+
|
|
100
|
+
Goal: [What to implement]
|
|
101
|
+
|
|
102
|
+
Constraints:
|
|
103
|
+
- [Non-negotiable limit 1]
|
|
104
|
+
- [Non-negotiable limit 2]
|
|
105
|
+
- [Non-negotiable limit 3]
|
|
106
|
+
|
|
107
|
+
Technical Requirements:
|
|
108
|
+
- [Specific approach/tool 1]
|
|
109
|
+
- [Specific approach/tool 2]
|
|
110
|
+
- [Specific approach/tool 3]
|
|
111
|
+
|
|
112
|
+
[Request architecture design first, then implementation]
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Example**:
|
|
116
|
+
```
|
|
117
|
+
Context: Express.js API with PostgreSQL. JWT tokens in PostgreSQL sessions table.
|
|
118
|
+
API serves 5000+ requests/minute during peak. Running on AWS with 4 EC2 instances.
|
|
119
|
+
|
|
120
|
+
Goal: Implement rate limiting to prevent API abuse on authentication endpoints.
|
|
121
|
+
|
|
122
|
+
Constraints:
|
|
123
|
+
- Must work with existing JWT auth without code changes
|
|
124
|
+
- Should not add latency >10ms (p95)
|
|
125
|
+
- Scale across multiple instances (shared state)
|
|
126
|
+
- Cannot require additional database queries per request
|
|
127
|
+
|
|
128
|
+
Technical Requirements:
|
|
129
|
+
- Use Redis for distributed rate limit tracking (already running for cache)
|
|
130
|
+
- Implement sliding window algorithm
|
|
131
|
+
- Different limits for authenticated vs unauthenticated
|
|
132
|
+
- Configurable limits per endpoint
|
|
133
|
+
- Return 429 with Retry-After header
|
|
134
|
+
- Integrate with existing structured logging
|
|
135
|
+
|
|
136
|
+
Provide architecture design first, then implement rate limiting middleware.
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Security-First Two-Stage: Security-Critical Code
|
|
142
|
+
|
|
143
|
+
**CRITICAL**: Research shows 40%+ of AI code has vulnerabilities without explicit security prompting.
|
|
144
|
+
|
|
145
|
+
**Use for**: User input handling, authentication, payments, database queries, file operations, API integrations
|
|
146
|
+
|
|
147
|
+
**Pattern**: Stage 1 (Functional) → Stage 2 (Security Hardening)
|
|
148
|
+
|
|
149
|
+
**Stage 1 Template**:
|
|
150
|
+
```
|
|
151
|
+
Implement [feature description]:
|
|
152
|
+
- [Functional requirement 1]
|
|
153
|
+
- [Functional requirement 2]
|
|
154
|
+
- [Functional requirement 3]
|
|
155
|
+
|
|
156
|
+
Provide the implementation.
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Stage 2 Template**:
|
|
160
|
+
```
|
|
161
|
+
Review the [feature name] for security vulnerabilities:
|
|
162
|
+
|
|
163
|
+
[PASTE CODE FROM STAGE 1]
|
|
164
|
+
|
|
165
|
+
Harden against:
|
|
166
|
+
- SQL injection / NoSQL injection
|
|
167
|
+
- XSS (Cross-Site Scripting)
|
|
168
|
+
- CSRF (Cross-Site Request Forgery)
|
|
169
|
+
- Command injection / Path traversal
|
|
170
|
+
- Input validation bypass
|
|
171
|
+
- Authentication/authorization bypass
|
|
172
|
+
- Information disclosure in errors
|
|
173
|
+
- Hard-coded credentials
|
|
174
|
+
- [Other relevant vulnerabilities]
|
|
175
|
+
|
|
176
|
+
Provide security-hardened version with security comments.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Example**:
|
|
180
|
+
|
|
181
|
+
*Stage 1*:
|
|
182
|
+
```
|
|
183
|
+
Implement user registration endpoint for Express.js API:
|
|
184
|
+
- Accept email, password, username
|
|
185
|
+
- Validate email format
|
|
186
|
+
- Hash password with bcrypt
|
|
187
|
+
- Store in PostgreSQL users table
|
|
188
|
+
- Return success with user ID or error response
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
*Stage 2*:
|
|
192
|
+
```
|
|
193
|
+
Review this registration endpoint for security vulnerabilities:
|
|
194
|
+
|
|
195
|
+
[PASTE CODE]
|
|
196
|
+
|
|
197
|
+
Harden against:
|
|
198
|
+
- SQL injection (parameterized queries)
|
|
199
|
+
- Email injection
|
|
200
|
+
- Password policy (min 12 chars, complexity)
|
|
201
|
+
- Rate limiting (prevent brute force)
|
|
202
|
+
- Input sanitization (username restrictions)
|
|
203
|
+
- Error message disclosure (don't reveal if email exists)
|
|
204
|
+
- Timing attacks on checks
|
|
205
|
+
- Bcrypt salt rounds (secure hashing)
|
|
206
|
+
- Input length limits (prevent DoS)
|
|
207
|
+
|
|
208
|
+
Provide security-hardened version.
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Quick Selection Guide
|
|
214
|
+
|
|
215
|
+
| Task Type | Framework | Key Benefit |
|
|
216
|
+
|-----------|-----------|-------------|
|
|
217
|
+
| Blog posts, docs, marketing | CO-STAR | Complete content specification |
|
|
218
|
+
| Business decisions, architecture | ROSES | Structured analysis & recommendation |
|
|
219
|
+
| Code generation, features | Architecture-First | Prevents misaligned solutions |
|
|
220
|
+
| Auth, payments, user input | Security Two-Stage | 50%+ vulnerability reduction |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## General Tips
|
|
225
|
+
|
|
226
|
+
1. **Be specific** - Vague inputs produce vague outputs
|
|
227
|
+
2. **Include examples** - Show desired format when possible (except reasoning models)
|
|
228
|
+
3. **State constraints explicitly** - "Must" and "Cannot" are clear
|
|
229
|
+
4. **Provide context about WHY** - Helps models make better decisions
|
|
230
|
+
5. **Match format to output** - Structure your prompt like desired output
|
|
231
|
+
6. **For Claude 4**: Be even more explicit, don't assume error handling
|
|
232
|
+
7. **For security code**: Always use two-stage approach
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[python]": {
|
|
3
|
+
"editor.formatOnSave": true,
|
|
4
|
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
|
5
|
+
"editor.codeActionsOnSave": {
|
|
6
|
+
"source.organizeImports": "explicit"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"[rust]": {
|
|
10
|
+
"editor.formatOnSave": true
|
|
11
|
+
},
|
|
12
|
+
"breadcrumbs.enabled": false,
|
|
13
|
+
"claudeCode.preferredLocation": "panel",
|
|
14
|
+
"cursor.cmdk.autoSelect": false,
|
|
15
|
+
"cursor.composer.shouldAutoScrollToBottom": false,
|
|
16
|
+
"cursor.cpp.disabledLanguages": [
|
|
17
|
+
"plaintext",
|
|
18
|
+
"scminput"
|
|
19
|
+
],
|
|
20
|
+
"cursor.cpp.enablePartialAccepts": true,
|
|
21
|
+
"cursor.semanticSearch.includePullRequests": false,
|
|
22
|
+
"explorer.confirmDelete": false,
|
|
23
|
+
"explorer.confirmDragAndDrop": false,
|
|
24
|
+
"files.exclude": {
|
|
25
|
+
"**/.git": true,
|
|
26
|
+
"**/.svn": true,
|
|
27
|
+
"**/.hg": true,
|
|
28
|
+
"**/CVS": true,
|
|
29
|
+
"**/.DS_Store": true,
|
|
30
|
+
"**/Thumbs.db": true,
|
|
31
|
+
"**/.venv": true,
|
|
32
|
+
"**/.pytest_cache": true
|
|
33
|
+
},
|
|
34
|
+
"files.watcherExclude": {
|
|
35
|
+
"**/.git/objects/**": true,
|
|
36
|
+
"**/.git/subtree-cache/**": true,
|
|
37
|
+
"**/node_modules/*/**": true,
|
|
38
|
+
"**/.hg/store/**": true,
|
|
39
|
+
"**/.venv/**": true,
|
|
40
|
+
"**/.pytest_cache": true
|
|
41
|
+
},
|
|
42
|
+
"go.toolsManagement.autoUpdate": true,
|
|
43
|
+
"python.terminal.activateEnvironment": false,
|
|
44
|
+
"rubyLsp.enabledFeatures": {
|
|
45
|
+
"codeActions": true,
|
|
46
|
+
"diagnostics": true,
|
|
47
|
+
"documentHighlights": true,
|
|
48
|
+
"documentLink": true,
|
|
49
|
+
"documentSymbols": true,
|
|
50
|
+
"foldingRanges": true,
|
|
51
|
+
"formatting": true,
|
|
52
|
+
"hover": true,
|
|
53
|
+
"inlayHint": true,
|
|
54
|
+
"onTypeFormatting": true,
|
|
55
|
+
"selectionRanges": true,
|
|
56
|
+
"semanticHighlighting": true,
|
|
57
|
+
"completion": true,
|
|
58
|
+
"codeLens": true,
|
|
59
|
+
"definition": true,
|
|
60
|
+
"workspaceSymbol": true,
|
|
61
|
+
"signatureHelp": true,
|
|
62
|
+
"typeHierarchy": true
|
|
63
|
+
},
|
|
64
|
+
"rust-analyzer.rustfmt.overrideCommand": null,
|
|
65
|
+
"security.workspace.trust.untrustedFiles": "open",
|
|
66
|
+
"terminal.explorerKind": "external",
|
|
67
|
+
"terminal.external.osxExec": "iTerm.app",
|
|
68
|
+
"terminal.integrated.allowedLinkSchemes": [
|
|
69
|
+
"file",
|
|
70
|
+
"http",
|
|
71
|
+
"https",
|
|
72
|
+
"mailto",
|
|
73
|
+
"vscode",
|
|
74
|
+
"vscode-insiders",
|
|
75
|
+
"docker-desktop"
|
|
76
|
+
],
|
|
77
|
+
"terminal.integrated.copyOnSelection": true,
|
|
78
|
+
"terminal.integrated.defaultLocation": "editor",
|
|
79
|
+
"terminal.integrated.enableMultiLinePasteWarning": false,
|
|
80
|
+
"workbench.colorTheme": "Visual Studio Dark"
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@~/AGENTS.md
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
OPENAI_BASE_PATH: v1/chat/completions
|
|
2
|
+
GOOSE_MODE: auto
|
|
3
|
+
GOOSE_ROUTER_TOOL_SELECTION_STRATEGY: default
|
|
4
|
+
OPENAI_HOST: https://api.openai.com
|
|
5
|
+
extensions:
|
|
6
|
+
chatrecall:
|
|
7
|
+
enabled: false
|
|
8
|
+
type: platform
|
|
9
|
+
name: chatrecall
|
|
10
|
+
description: Search past conversations and load session summaries for contextual memory
|
|
11
|
+
bundled: true
|
|
12
|
+
available_tools: []
|
|
13
|
+
memory:
|
|
14
|
+
enabled: false
|
|
15
|
+
type: builtin
|
|
16
|
+
name: memory
|
|
17
|
+
description: ''
|
|
18
|
+
display_name: Memory
|
|
19
|
+
timeout: 300
|
|
20
|
+
bundled: true
|
|
21
|
+
available_tools: []
|
|
22
|
+
developer:
|
|
23
|
+
enabled: true
|
|
24
|
+
type: builtin
|
|
25
|
+
name: developer
|
|
26
|
+
description: ''
|
|
27
|
+
display_name: Developer
|
|
28
|
+
timeout: 300
|
|
29
|
+
bundled: true
|
|
30
|
+
available_tools: []
|
|
31
|
+
todo:
|
|
32
|
+
enabled: false
|
|
33
|
+
type: platform
|
|
34
|
+
name: todo
|
|
35
|
+
description: Enable a todo list for Goose so it can keep track of what it is doing
|
|
36
|
+
bundled: true
|
|
37
|
+
available_tools: []
|
|
38
|
+
computercontroller:
|
|
39
|
+
enabled: true
|
|
40
|
+
type: builtin
|
|
41
|
+
name: computercontroller
|
|
42
|
+
description: ''
|
|
43
|
+
display_name: Computer Controller
|
|
44
|
+
timeout: 300
|
|
45
|
+
bundled: true
|
|
46
|
+
available_tools: []
|
|
47
|
+
extensionmanager:
|
|
48
|
+
enabled: false
|
|
49
|
+
type: platform
|
|
50
|
+
name: Extension Manager
|
|
51
|
+
description: Enable extension management tools for discovering, enabling, and disabling extensions
|
|
52
|
+
bundled: true
|
|
53
|
+
available_tools: []
|
|
54
|
+
GOOSE_AUTO_COMPACT_THRESHOLD: 0.0
|
|
55
|
+
GOOSE_MODEL: goose-claude-4-5-sonnet
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
name: work
|
|
2
|
+
description: Work laptop with extended context model
|
|
3
|
+
extends: null
|
|
4
|
+
settings_overrides:
|
|
5
|
+
claude:
|
|
6
|
+
env:
|
|
7
|
+
ANTHROPIC_DEFAULT_SONNET_MODEL: "claude-sonnet-4-5-20250929[1m]"
|
|
8
|
+
CLAUDE_CODE_SUBAGENT_MODEL: "claude-sonnet-4-5-20250929[1m]"
|
|
9
|
+
model: opusplan
|
|
10
|
+
exclude_symlinks: []
|
|
11
|
+
mcp_overrides: {}
|