agentic-team-templates 0.3.0
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/README.md +280 -0
- package/bin/cli.js +5 -0
- package/package.json +47 -0
- package/src/index.js +521 -0
- package/templates/_shared/code-quality.md +162 -0
- package/templates/_shared/communication.md +114 -0
- package/templates/_shared/core-principles.md +62 -0
- package/templates/_shared/git-workflow.md +165 -0
- package/templates/_shared/security-fundamentals.md +173 -0
- package/templates/blockchain/.cursorrules/defi-patterns.md +520 -0
- package/templates/blockchain/.cursorrules/gas-optimization.md +339 -0
- package/templates/blockchain/.cursorrules/overview.md +130 -0
- package/templates/blockchain/.cursorrules/security.md +318 -0
- package/templates/blockchain/.cursorrules/smart-contracts.md +364 -0
- package/templates/blockchain/.cursorrules/testing.md +415 -0
- package/templates/blockchain/.cursorrules/web3-integration.md +538 -0
- package/templates/blockchain/CLAUDE.md +389 -0
- package/templates/cli-tools/.cursorrules/architecture.md +412 -0
- package/templates/cli-tools/.cursorrules/arguments.md +406 -0
- package/templates/cli-tools/.cursorrules/distribution.md +546 -0
- package/templates/cli-tools/.cursorrules/error-handling.md +455 -0
- package/templates/cli-tools/.cursorrules/overview.md +136 -0
- package/templates/cli-tools/.cursorrules/testing.md +537 -0
- package/templates/cli-tools/.cursorrules/user-experience.md +545 -0
- package/templates/cli-tools/CLAUDE.md +356 -0
- package/templates/data-engineering/.cursorrules/data-modeling.md +367 -0
- package/templates/data-engineering/.cursorrules/data-quality.md +455 -0
- package/templates/data-engineering/.cursorrules/overview.md +85 -0
- package/templates/data-engineering/.cursorrules/performance.md +339 -0
- package/templates/data-engineering/.cursorrules/pipeline-design.md +280 -0
- package/templates/data-engineering/.cursorrules/security.md +460 -0
- package/templates/data-engineering/.cursorrules/testing.md +452 -0
- package/templates/data-engineering/CLAUDE.md +974 -0
- package/templates/devops-sre/.cursorrules/capacity-planning.md +653 -0
- package/templates/devops-sre/.cursorrules/change-management.md +584 -0
- package/templates/devops-sre/.cursorrules/chaos-engineering.md +651 -0
- package/templates/devops-sre/.cursorrules/disaster-recovery.md +641 -0
- package/templates/devops-sre/.cursorrules/incident-management.md +565 -0
- package/templates/devops-sre/.cursorrules/observability.md +714 -0
- package/templates/devops-sre/.cursorrules/overview.md +230 -0
- package/templates/devops-sre/.cursorrules/postmortems.md +588 -0
- package/templates/devops-sre/.cursorrules/runbooks.md +760 -0
- package/templates/devops-sre/.cursorrules/slo-sli.md +617 -0
- package/templates/devops-sre/.cursorrules/toil-reduction.md +567 -0
- package/templates/devops-sre/CLAUDE.md +1007 -0
- package/templates/documentation/.cursorrules/adr.md +277 -0
- package/templates/documentation/.cursorrules/api-documentation.md +411 -0
- package/templates/documentation/.cursorrules/code-comments.md +253 -0
- package/templates/documentation/.cursorrules/maintenance.md +260 -0
- package/templates/documentation/.cursorrules/overview.md +82 -0
- package/templates/documentation/.cursorrules/readme-standards.md +306 -0
- package/templates/documentation/CLAUDE.md +120 -0
- package/templates/fullstack/.cursorrules/api-contracts.md +331 -0
- package/templates/fullstack/.cursorrules/architecture.md +298 -0
- package/templates/fullstack/.cursorrules/overview.md +109 -0
- package/templates/fullstack/.cursorrules/shared-types.md +348 -0
- package/templates/fullstack/.cursorrules/testing.md +386 -0
- package/templates/fullstack/CLAUDE.md +349 -0
- package/templates/ml-ai/.cursorrules/data-engineering.md +483 -0
- package/templates/ml-ai/.cursorrules/deployment.md +601 -0
- package/templates/ml-ai/.cursorrules/model-development.md +538 -0
- package/templates/ml-ai/.cursorrules/monitoring.md +658 -0
- package/templates/ml-ai/.cursorrules/overview.md +131 -0
- package/templates/ml-ai/.cursorrules/security.md +637 -0
- package/templates/ml-ai/.cursorrules/testing.md +678 -0
- package/templates/ml-ai/CLAUDE.md +1136 -0
- package/templates/mobile/.cursorrules/navigation.md +246 -0
- package/templates/mobile/.cursorrules/offline-first.md +302 -0
- package/templates/mobile/.cursorrules/overview.md +71 -0
- package/templates/mobile/.cursorrules/performance.md +345 -0
- package/templates/mobile/.cursorrules/testing.md +339 -0
- package/templates/mobile/CLAUDE.md +233 -0
- package/templates/platform-engineering/.cursorrules/ci-cd.md +778 -0
- package/templates/platform-engineering/.cursorrules/developer-experience.md +632 -0
- package/templates/platform-engineering/.cursorrules/infrastructure-as-code.md +600 -0
- package/templates/platform-engineering/.cursorrules/kubernetes.md +710 -0
- package/templates/platform-engineering/.cursorrules/observability.md +747 -0
- package/templates/platform-engineering/.cursorrules/overview.md +215 -0
- package/templates/platform-engineering/.cursorrules/security.md +855 -0
- package/templates/platform-engineering/.cursorrules/testing.md +878 -0
- package/templates/platform-engineering/CLAUDE.md +850 -0
- package/templates/utility-agent/.cursorrules/action-control.md +284 -0
- package/templates/utility-agent/.cursorrules/context-management.md +186 -0
- package/templates/utility-agent/.cursorrules/hallucination-prevention.md +253 -0
- package/templates/utility-agent/.cursorrules/overview.md +78 -0
- package/templates/utility-agent/.cursorrules/token-optimization.md +369 -0
- package/templates/utility-agent/CLAUDE.md +513 -0
- package/templates/web-backend/.cursorrules/api-design.md +255 -0
- package/templates/web-backend/.cursorrules/authentication.md +309 -0
- package/templates/web-backend/.cursorrules/database-patterns.md +298 -0
- package/templates/web-backend/.cursorrules/error-handling.md +366 -0
- package/templates/web-backend/.cursorrules/overview.md +69 -0
- package/templates/web-backend/.cursorrules/security.md +358 -0
- package/templates/web-backend/.cursorrules/testing.md +395 -0
- package/templates/web-backend/CLAUDE.md +366 -0
- package/templates/web-frontend/.cursorrules/accessibility.md +296 -0
- package/templates/web-frontend/.cursorrules/component-patterns.md +204 -0
- package/templates/web-frontend/.cursorrules/overview.md +72 -0
- package/templates/web-frontend/.cursorrules/performance.md +325 -0
- package/templates/web-frontend/.cursorrules/state-management.md +227 -0
- package/templates/web-frontend/.cursorrules/styling.md +271 -0
- package/templates/web-frontend/.cursorrules/testing.md +311 -0
- package/templates/web-frontend/CLAUDE.md +399 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Utility Agent Overview
|
|
2
|
+
|
|
3
|
+
Specialized agent template for context management, hallucination prevention, action control, and token optimization.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This utility agent template provides agents with the ability to:
|
|
8
|
+
- Manage conversation context efficiently
|
|
9
|
+
- Prevent hallucinations and ensure accuracy
|
|
10
|
+
- Control actions to prevent unruly behavior
|
|
11
|
+
- Optimize token usage for cost and efficiency
|
|
12
|
+
|
|
13
|
+
## Core Capabilities
|
|
14
|
+
|
|
15
|
+
### 1. Context Management
|
|
16
|
+
- Monitor context window usage
|
|
17
|
+
- Summarize context at 80% capacity
|
|
18
|
+
- Preserve essential information
|
|
19
|
+
- Compress redundant data
|
|
20
|
+
|
|
21
|
+
### 2. Hallucination Prevention
|
|
22
|
+
- Verify all claims against context
|
|
23
|
+
- Flag uncertain information
|
|
24
|
+
- Refuse to invent information
|
|
25
|
+
- Request clarification when needed
|
|
26
|
+
|
|
27
|
+
### 3. Action Control
|
|
28
|
+
- Validate actions before execution
|
|
29
|
+
- Prevent destructive operations
|
|
30
|
+
- Ensure scope alignment
|
|
31
|
+
- Request permission for dangerous operations
|
|
32
|
+
|
|
33
|
+
### 4. Token Optimization
|
|
34
|
+
- Track token consumption
|
|
35
|
+
- Optimize responses for efficiency
|
|
36
|
+
- Batch operations
|
|
37
|
+
- Use concise communication
|
|
38
|
+
|
|
39
|
+
## When to Use
|
|
40
|
+
|
|
41
|
+
Use this template when building agents that need to:
|
|
42
|
+
- Handle long conversations
|
|
43
|
+
- Prevent errors and hallucinations
|
|
44
|
+
- Control resource usage
|
|
45
|
+
- Ensure safe operation
|
|
46
|
+
- Optimize for cost/efficiency
|
|
47
|
+
|
|
48
|
+
## Key Files
|
|
49
|
+
|
|
50
|
+
- `CLAUDE.md`: Main development guide
|
|
51
|
+
- `.cursorrules/context-management.md`: Context management rules
|
|
52
|
+
- `.cursorrules/hallucination-prevention.md`: Accuracy rules
|
|
53
|
+
- `.cursorrules/action-control.md`: Safety rules
|
|
54
|
+
- `.cursorrules/token-optimization.md`: Efficiency rules
|
|
55
|
+
|
|
56
|
+
## Integration
|
|
57
|
+
|
|
58
|
+
This template can be combined with other templates:
|
|
59
|
+
- Use with `web-frontend` for frontend development agents
|
|
60
|
+
- Use with `web-backend` for backend development agents
|
|
61
|
+
- Use with `fullstack` for full-stack development agents
|
|
62
|
+
- Use with `mobile` for mobile development agents
|
|
63
|
+
|
|
64
|
+
## Best Practices
|
|
65
|
+
|
|
66
|
+
1. **Monitor Continuously**: Track context and tokens throughout
|
|
67
|
+
2. **Summarize Proactively**: Don't wait until limits are hit
|
|
68
|
+
3. **Verify Always**: Check information before claiming
|
|
69
|
+
4. **Validate Actions**: Ensure safety and scope alignment
|
|
70
|
+
5. **Optimize Early**: Be efficient from the start
|
|
71
|
+
|
|
72
|
+
## Summary
|
|
73
|
+
|
|
74
|
+
This utility agent template ensures agents are:
|
|
75
|
+
- ✅ **Accurate**: No hallucinations
|
|
76
|
+
- ✅ **Safe**: No unruly actions
|
|
77
|
+
- ✅ **Efficient**: Optimized token usage
|
|
78
|
+
- ✅ **Reliable**: Proper context management
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# Token Optimization
|
|
2
|
+
|
|
3
|
+
Rules for efficient token usage and resource management.
|
|
4
|
+
|
|
5
|
+
## Core Principle
|
|
6
|
+
|
|
7
|
+
**Maximize value per token: Be concise, clear, and efficient.**
|
|
8
|
+
|
|
9
|
+
## Token Tracking
|
|
10
|
+
|
|
11
|
+
### Monitor Usage
|
|
12
|
+
|
|
13
|
+
Track token consumption throughout conversation:
|
|
14
|
+
- Input tokens (user messages + context)
|
|
15
|
+
- Output tokens (agent responses)
|
|
16
|
+
- Total tokens (cumulative)
|
|
17
|
+
- Estimated cost (if applicable)
|
|
18
|
+
|
|
19
|
+
### Capacity Awareness
|
|
20
|
+
|
|
21
|
+
- **< 50%**: Normal operation
|
|
22
|
+
- **50-80%**: Monitor closely
|
|
23
|
+
- **80-90%**: Optimize aggressively
|
|
24
|
+
- **> 90%**: Critical - summarize context
|
|
25
|
+
|
|
26
|
+
## Optimization Strategies
|
|
27
|
+
|
|
28
|
+
### 1. Use Toon Format for Prompt Optimization
|
|
29
|
+
|
|
30
|
+
**Use toon format instead of JSON for data passing in prompts/responses to reduce token usage.**
|
|
31
|
+
|
|
32
|
+
**❌ Inefficient (JSON in prompts)**:
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"status": "success",
|
|
36
|
+
"data": {
|
|
37
|
+
"user": {
|
|
38
|
+
"id": "123",
|
|
39
|
+
"name": "John Doe",
|
|
40
|
+
"email": "john@example.com"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**✅ Efficient (Toon format in prompts)**:
|
|
47
|
+
```
|
|
48
|
+
status:success
|
|
49
|
+
data.user.id:123
|
|
50
|
+
data.user.name:John Doe
|
|
51
|
+
data.user.email:john@example.com
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**⚠️ CRITICAL: Data Storage Rules**
|
|
55
|
+
|
|
56
|
+
- **Prompt/Response Optimization**: Use toon format to reduce tokens
|
|
57
|
+
- **Data Storage**: **NEVER use toon** - Always use JSON, YAML, or other standard formats
|
|
58
|
+
- **File Storage**: Always use standard formats (JSON, YAML, TOML, etc.)
|
|
59
|
+
- **API Responses**: Use JSON (standard format)
|
|
60
|
+
- **Configuration Files**: Use standard formats (JSON, YAML, TOML)
|
|
61
|
+
|
|
62
|
+
**When to use toon**:
|
|
63
|
+
- ✅ Internal prompt data passing
|
|
64
|
+
- ✅ Temporary data in conversation context
|
|
65
|
+
- ✅ Token-optimized intermediate representations
|
|
66
|
+
|
|
67
|
+
**When NOT to use toon**:
|
|
68
|
+
- ❌ File storage (use JSON/YAML/TOML)
|
|
69
|
+
- ❌ Database storage (use standard formats)
|
|
70
|
+
- ❌ API responses (use JSON)
|
|
71
|
+
- ❌ Configuration files (use standard formats)
|
|
72
|
+
- ❌ Any persistent data storage
|
|
73
|
+
|
|
74
|
+
### 2. Concise Communication
|
|
75
|
+
|
|
76
|
+
**❌ Verbose (High Token Usage)**:
|
|
77
|
+
```
|
|
78
|
+
I understand that you want me to implement a user authentication system
|
|
79
|
+
for your application. This is an important feature that will allow users
|
|
80
|
+
to securely log in and access their accounts. Let me start by reading
|
|
81
|
+
the existing codebase to understand the current structure and then I'll
|
|
82
|
+
implement the authentication functionality step by step.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**✅ Concise (Low Token Usage)**:
|
|
86
|
+
```
|
|
87
|
+
Implementing user authentication. Reading codebase structure, then
|
|
88
|
+
implementing OAuth2 flow.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 3. Batch Operations
|
|
92
|
+
|
|
93
|
+
**❌ Inefficient (Multiple Round Trips)**:
|
|
94
|
+
```
|
|
95
|
+
[Round 1] Reading file1.ts...
|
|
96
|
+
[Round 2] Reading file2.ts...
|
|
97
|
+
[Round 3] Reading file3.ts...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**✅ Efficient (Single Round Trip)**:
|
|
101
|
+
```
|
|
102
|
+
[Single round] Reading file1.ts, file2.ts, file3.ts...
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 4. Selective Context
|
|
106
|
+
|
|
107
|
+
**❌ Inefficient (Reading Entire Files)**:
|
|
108
|
+
```
|
|
109
|
+
Reading 5000-line file when only need 50 lines...
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**✅ Efficient (Reading Specific Sections)**:
|
|
113
|
+
```
|
|
114
|
+
Reading lines 100-150 of file.ts (relevant section only)...
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 5. Remove Redundancy
|
|
118
|
+
|
|
119
|
+
**❌ Redundant**:
|
|
120
|
+
```
|
|
121
|
+
The function calculates the total. It takes items as input. It returns
|
|
122
|
+
the total. The total is the sum of all item prices.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**✅ Concise**:
|
|
126
|
+
```
|
|
127
|
+
Function calculates sum of item prices.
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Response Optimization
|
|
131
|
+
|
|
132
|
+
### Structure Responses Efficiently
|
|
133
|
+
|
|
134
|
+
**Format**:
|
|
135
|
+
- Use bullet points for lists
|
|
136
|
+
- Use code blocks for code
|
|
137
|
+
- Use tables for structured data
|
|
138
|
+
- Skip unnecessary explanations
|
|
139
|
+
|
|
140
|
+
### Example: Optimized Response
|
|
141
|
+
|
|
142
|
+
**❌ Verbose**:
|
|
143
|
+
```
|
|
144
|
+
I've successfully implemented the user authentication feature. The
|
|
145
|
+
implementation includes a login component that allows users to sign in
|
|
146
|
+
with their Google account using OAuth2. The component handles the OAuth
|
|
147
|
+
flow, manages the session with secure HTTP-only cookies, and includes
|
|
148
|
+
proper error handling for various edge cases. I've also added loading
|
|
149
|
+
states to provide user feedback during the authentication process.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**✅ Concise**:
|
|
153
|
+
```
|
|
154
|
+
✅ Authentication implemented:
|
|
155
|
+
- OAuth2 login with Google
|
|
156
|
+
- Session management (HTTP-only cookies)
|
|
157
|
+
- Error handling + loading states
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Tool Call Optimization
|
|
161
|
+
|
|
162
|
+
### Batch Related Operations
|
|
163
|
+
|
|
164
|
+
**❌ Inefficient**:
|
|
165
|
+
```typescript
|
|
166
|
+
// Multiple separate calls
|
|
167
|
+
read_file('src/auth/login.ts');
|
|
168
|
+
// wait
|
|
169
|
+
read_file('src/auth/session.ts');
|
|
170
|
+
// wait
|
|
171
|
+
read_file('tests/auth/login.test.ts');
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**✅ Efficient**:
|
|
175
|
+
```typescript
|
|
176
|
+
// Single batched call
|
|
177
|
+
read_file('src/auth/login.ts');
|
|
178
|
+
read_file('src/auth/session.ts');
|
|
179
|
+
read_file('tests/auth/login.test.ts');
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Use Specific Searches
|
|
183
|
+
|
|
184
|
+
**❌ Inefficient**:
|
|
185
|
+
```
|
|
186
|
+
Reading entire codebase to find function...
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**✅ Efficient**:
|
|
190
|
+
```
|
|
191
|
+
Searching for "calculateTotal" function...
|
|
192
|
+
[uses grep or codebase_search]
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Cache Frequently Accessed Info
|
|
196
|
+
|
|
197
|
+
**❌ Inefficient**:
|
|
198
|
+
```
|
|
199
|
+
[Re-reading same file multiple times]
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**✅ Efficient**:
|
|
203
|
+
```
|
|
204
|
+
[Reading once, referencing in memory]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Context Management
|
|
208
|
+
|
|
209
|
+
### Include Only Relevant Context
|
|
210
|
+
|
|
211
|
+
**❌ Inefficient**:
|
|
212
|
+
- Including entire conversation history
|
|
213
|
+
- Including completed work details
|
|
214
|
+
- Including irrelevant file contents
|
|
215
|
+
- Including redundant information
|
|
216
|
+
|
|
217
|
+
**✅ Efficient**:
|
|
218
|
+
- Summarizing old context
|
|
219
|
+
- Including only active files
|
|
220
|
+
- Focusing on current task
|
|
221
|
+
- Removing completed work
|
|
222
|
+
|
|
223
|
+
### Proactive Summarization
|
|
224
|
+
|
|
225
|
+
At 80% capacity:
|
|
226
|
+
1. Identify what's essential
|
|
227
|
+
2. Summarize old context
|
|
228
|
+
3. Remove redundant information
|
|
229
|
+
4. Preserve active context
|
|
230
|
+
|
|
231
|
+
## Communication Patterns
|
|
232
|
+
|
|
233
|
+
### Use Abbreviations (When Clear)
|
|
234
|
+
|
|
235
|
+
- ✅ "API" instead of "Application Programming Interface"
|
|
236
|
+
- ✅ "OAuth" instead of "Open Authorization"
|
|
237
|
+
- ✅ "DB" instead of "Database" (in technical context)
|
|
238
|
+
- ❌ Don't abbreviate if it reduces clarity
|
|
239
|
+
|
|
240
|
+
### Use Symbols and Formatting
|
|
241
|
+
|
|
242
|
+
- ✅ "✅" instead of "Successfully completed"
|
|
243
|
+
- ✅ "❌" instead of "This is incorrect"
|
|
244
|
+
- ✅ "⚠️" instead of "Warning"
|
|
245
|
+
- ✅ Bullet points instead of paragraphs
|
|
246
|
+
|
|
247
|
+
### Skip Unnecessary Words
|
|
248
|
+
|
|
249
|
+
**Remove**:
|
|
250
|
+
- "I think that..."
|
|
251
|
+
- "It seems like..."
|
|
252
|
+
- "I believe..."
|
|
253
|
+
- "In my opinion..."
|
|
254
|
+
- "Let me tell you that..."
|
|
255
|
+
|
|
256
|
+
**Keep**:
|
|
257
|
+
- Direct statements
|
|
258
|
+
- Action items
|
|
259
|
+
- Results
|
|
260
|
+
- Errors
|
|
261
|
+
|
|
262
|
+
## Examples
|
|
263
|
+
|
|
264
|
+
### Example 1: Code Explanation
|
|
265
|
+
|
|
266
|
+
**❌ Verbose**:
|
|
267
|
+
```
|
|
268
|
+
This function takes an array of items and calculates the total price
|
|
269
|
+
by iterating through each item and adding up their prices. It uses
|
|
270
|
+
the reduce method which is a functional programming approach that
|
|
271
|
+
accumulates values. The function returns a number representing the
|
|
272
|
+
total sum.
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**✅ Concise**:
|
|
276
|
+
```
|
|
277
|
+
Function sums item prices using reduce, returns total.
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Example 2: Status Update
|
|
281
|
+
|
|
282
|
+
**❌ Verbose**:
|
|
283
|
+
```
|
|
284
|
+
I've successfully completed the implementation of the user authentication
|
|
285
|
+
feature. All the tests are passing, the code has been formatted, and
|
|
286
|
+
I've updated the documentation. The feature is now ready for review.
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**✅ Concise**:
|
|
290
|
+
```
|
|
291
|
+
✅ Auth feature complete:
|
|
292
|
+
- Tests passing
|
|
293
|
+
- Code formatted
|
|
294
|
+
- Docs updated
|
|
295
|
+
Ready for review.
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Example 3: Error Report
|
|
299
|
+
|
|
300
|
+
**❌ Verbose**:
|
|
301
|
+
```
|
|
302
|
+
I encountered an error while trying to execute the command. The error
|
|
303
|
+
message indicates that there's a problem with the file path. It seems
|
|
304
|
+
like the file doesn't exist at the specified location. I need you to
|
|
305
|
+
verify the file path and make sure the file actually exists before I
|
|
306
|
+
can proceed.
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**✅ Concise**:
|
|
310
|
+
```
|
|
311
|
+
❌ Error: File not found at specified path.
|
|
312
|
+
Please verify file exists and path is correct.
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Token Budget Allocation
|
|
316
|
+
|
|
317
|
+
### Prioritize
|
|
318
|
+
|
|
319
|
+
1. **User Intent** (High priority)
|
|
320
|
+
2. **Active Code** (High priority)
|
|
321
|
+
3. **Error Messages** (High priority)
|
|
322
|
+
4. **Completed Work** (Low priority - summarize)
|
|
323
|
+
5. **Old Context** (Low priority - compress)
|
|
324
|
+
|
|
325
|
+
### Allocate Wisely
|
|
326
|
+
|
|
327
|
+
- **80%** for current task
|
|
328
|
+
- **15%** for recent context
|
|
329
|
+
- **5%** for old context (summarized)
|
|
330
|
+
|
|
331
|
+
## Monitoring and Alerts
|
|
332
|
+
|
|
333
|
+
### Token Usage Alerts
|
|
334
|
+
|
|
335
|
+
At thresholds:
|
|
336
|
+
- **50%**: "Context at 50%, monitoring usage"
|
|
337
|
+
- **75%**: "Context at 75%, will summarize at 80%"
|
|
338
|
+
- **80%**: "Summarizing context to optimize usage"
|
|
339
|
+
- **90%**: "⚠️ Context critical, aggressive optimization"
|
|
340
|
+
|
|
341
|
+
### Optimization Actions
|
|
342
|
+
|
|
343
|
+
When usage is high:
|
|
344
|
+
1. Summarize old context
|
|
345
|
+
2. Remove redundant information
|
|
346
|
+
3. Batch operations
|
|
347
|
+
4. Use concise communication
|
|
348
|
+
5. Focus on essential only
|
|
349
|
+
|
|
350
|
+
## Enforcement
|
|
351
|
+
|
|
352
|
+
- Monitor token usage continuously
|
|
353
|
+
- Optimize proactively (not reactively)
|
|
354
|
+
- Use concise communication
|
|
355
|
+
- Batch operations when possible
|
|
356
|
+
- Summarize context at 80%
|
|
357
|
+
- Remove redundancy immediately
|
|
358
|
+
|
|
359
|
+
## Summary
|
|
360
|
+
|
|
361
|
+
- ✅ Use toon format for prompt optimization (token reduction)
|
|
362
|
+
- ✅ **NEVER use toon for data storage** (use JSON/YAML/standard formats)
|
|
363
|
+
- ✅ Be concise and clear
|
|
364
|
+
- ✅ Batch related operations
|
|
365
|
+
- ✅ Use specific searches
|
|
366
|
+
- ✅ Summarize context proactively
|
|
367
|
+
- ✅ Remove redundancy
|
|
368
|
+
- ✅ Monitor usage continuously
|
|
369
|
+
- ✅ Optimize before hitting limits
|