code-ai-installer 2.3.0 → 2.4.1
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/.agents/skills/karpathy-guidelines/SKILL.md +326 -0
- package/.agents/skills/karpathy-guidelines/agents/claude.json +21 -0
- package/.agents/skills/karpathy-guidelines/agents/copilot.json +21 -0
- package/.agents/skills/karpathy-guidelines/agents/gemini.json +21 -0
- package/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/.agents/skills/karpathy-guidelines/agents/qwen.json +21 -0
- package/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/AGENTS.md +13 -0
- package/CONTEXT.md +14 -8
- package/agents/architect.md +1 -0
- package/agents/conductor.md +1 -0
- package/agents/devops.md +1 -0
- package/agents/product_manager.md +1 -0
- package/agents/reviewer.md +1 -0
- package/agents/senior_full_stack.md +1 -0
- package/agents/tester.md +1 -0
- package/agents/ux_ui_designer.md +1 -0
- package/dist/installer.d.ts +2 -0
- package/dist/installer.js +48 -0
- package/dist/platforms/adapters.js +2 -2
- package/domains/analytics/.agents/skills/karpathy-guidelines/SKILL.md +326 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/claude.json +21 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/copilot.json +21 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/gemini.json +21 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/qwen.json +21 -0
- package/domains/analytics/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/analytics/AGENTS.md +3 -0
- package/domains/analytics/agents/conductor.md +1 -0
- package/domains/analytics/agents/data_analyst.md +2 -1
- package/domains/analytics/agents/designer.md +1 -0
- package/domains/analytics/agents/interviewer.md +1 -0
- package/domains/analytics/agents/layouter.md +1 -0
- package/domains/analytics/agents/mediator.md +1 -0
- package/domains/analytics/agents/researcher.md +1 -0
- package/domains/analytics/agents/strategist.md +1 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +325 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/claude.json +22 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/copilot.json +22 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/gemini.json +22 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/qwen.json +22 -0
- package/domains/analytics/locales/en/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/analytics/locales/en/AGENTS.md +3 -0
- package/domains/analytics/locales/en/agents/data_analyst.md +1 -1
- package/domains/content/.agents/skills/karpathy-guidelines/SKILL.md +326 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/claude.json +21 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/copilot.json +21 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/gemini.json +21 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/qwen.json +21 -0
- package/domains/content/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/content/AGENTS.md +3 -0
- package/domains/content/agents/conductor.md +1 -0
- package/domains/content/agents/copywriter.md +1 -0
- package/domains/content/agents/researcher.md +1 -0
- package/domains/content/agents/reviewer.md +1 -0
- package/domains/content/agents/strategist.md +1 -0
- package/domains/content/agents/visual_concept.md +1 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +325 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/claude.json +22 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/copilot.json +22 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/gemini.json +22 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/qwen.json +22 -0
- package/domains/content/locales/en/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/content/locales/en/AGENTS.md +3 -0
- package/domains/development/.agents/skills/karpathy-guidelines/SKILL.md +326 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/claude.json +21 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/copilot.json +21 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/gemini.json +21 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/qwen.json +21 -0
- package/domains/development/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/development/AGENTS.md +3 -0
- package/domains/development/agents/architect.md +1 -0
- package/domains/development/agents/conductor.md +1 -0
- package/domains/development/agents/devops.md +1 -0
- package/domains/development/agents/product_manager.md +1 -0
- package/domains/development/agents/reviewer.md +1 -0
- package/domains/development/agents/senior_full_stack.md +1 -0
- package/domains/development/agents/tester.md +1 -0
- package/domains/development/agents/ux_ui_designer.md +2 -1
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +325 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/claude.json +22 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/copilot.json +22 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/gemini.json +22 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/qwen.json +22 -0
- package/domains/development/locales/en/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/development/locales/en/AGENTS.md +3 -0
- package/domains/development/locales/en/agents/ux_ui_designer.md +1 -1
- package/domains/product/.agents/skills/karpathy-guidelines/SKILL.md +326 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/claude.json +21 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/copilot.json +21 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/gemini.json +21 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/qwen.json +21 -0
- package/domains/product/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/product/AGENTS.md +3 -0
- package/domains/product/agents/conductor.md +1 -0
- package/domains/product/agents/data_analyst.md +1 -0
- package/domains/product/agents/designer.md +1 -0
- package/domains/product/agents/discovery.md +1 -0
- package/domains/product/agents/layouter.md +1 -0
- package/domains/product/agents/mediator.md +1 -0
- package/domains/product/agents/pm.md +1 -0
- package/domains/product/agents/product_strategist.md +1 -0
- package/domains/product/agents/tech_lead.md +1 -0
- package/domains/product/agents/ux_designer.md +1 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +325 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/claude.json +22 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/copilot.json +22 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/gemini.json +22 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/qwen.json +22 -0
- package/domains/product/locales/en/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/domains/product/locales/en/AGENTS.md +3 -0
- package/locales/en/.agents/skills/karpathy-guidelines/SKILL.md +325 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/claude.json +22 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/copilot.json +22 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/gemini.json +22 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/openai.yaml +8 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/qwen.json +22 -0
- package/locales/en/.agents/skills/karpathy-guidelines/agents/skill.yaml +25 -0
- package/package.json +1 -1
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: karpathy-guidelines
|
|
3
|
+
description: Behavioral guidelines to reduce common LLM mistakes across all tasks — code, design, analytics, product. Apply always.
|
|
4
|
+
license: MIT
|
|
5
|
+
source: https://x.com/karpathy/status/2015883857489522876
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Karpathy Guidelines
|
|
9
|
+
|
|
10
|
+
Behavioral guidelines to reduce common LLM mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876).
|
|
11
|
+
|
|
12
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Think Before Coding
|
|
17
|
+
|
|
18
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
19
|
+
|
|
20
|
+
Before implementing:
|
|
21
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
22
|
+
- If multiple interpretations exist, present them — don't pick silently.
|
|
23
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
24
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
25
|
+
|
|
26
|
+
### Example: Hidden Assumptions
|
|
27
|
+
|
|
28
|
+
**Request:** "Add a feature to export user data"
|
|
29
|
+
|
|
30
|
+
❌ **What LLMs do** — silently assume format, fields, scope:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
def export_users(format='json'):
|
|
34
|
+
users = User.query.all()
|
|
35
|
+
with open('users.json', 'w') as f:
|
|
36
|
+
json.dump([u.to_dict() for u in users], f)
|
|
37
|
+
return f"Exported {len(users)} users"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
✅ **What should happen** — surface assumptions and ask:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Before implementing, I need to clarify:
|
|
44
|
+
|
|
45
|
+
1. Scope: Export all users or filtered subset? (privacy implications)
|
|
46
|
+
2. Format: "export" — download file, background job, or API endpoint?
|
|
47
|
+
3. Fields: Which user fields? (some might be sensitive)
|
|
48
|
+
4. Volume: How many users? (affects approach)
|
|
49
|
+
|
|
50
|
+
What's your preference?
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Example: Multiple Interpretations
|
|
54
|
+
|
|
55
|
+
**Request:** "Make the search faster"
|
|
56
|
+
|
|
57
|
+
❌ **What LLMs do** — silently pick one interpretation and write 200 lines of optimization.
|
|
58
|
+
|
|
59
|
+
✅ **What should happen:**
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
"Make the search faster" could mean:
|
|
63
|
+
|
|
64
|
+
1. Faster response time (< 100ms instead of 500ms)
|
|
65
|
+
→ database indexes, cache | ~2h
|
|
66
|
+
|
|
67
|
+
2. Handle more concurrent searches (throughput)
|
|
68
|
+
→ async/await, connection pooling | ~4h
|
|
69
|
+
|
|
70
|
+
3. Faster perceived speed (UX)
|
|
71
|
+
→ show partial results immediately | ~3h
|
|
72
|
+
|
|
73
|
+
Current search takes ~500ms. Which aspect matters most?
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 2. Simplicity First
|
|
79
|
+
|
|
80
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
81
|
+
|
|
82
|
+
- No features beyond what was asked.
|
|
83
|
+
- No abstractions for single-use code.
|
|
84
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
85
|
+
- No error handling for impossible scenarios.
|
|
86
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
87
|
+
|
|
88
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
89
|
+
|
|
90
|
+
### Example: Over-abstraction
|
|
91
|
+
|
|
92
|
+
**Request:** "Add a function to calculate discount"
|
|
93
|
+
|
|
94
|
+
❌ **What LLMs do** — Strategy pattern, ABC, dataclass, configurator:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
class DiscountStrategy(ABC):
|
|
98
|
+
@abstractmethod
|
|
99
|
+
def calculate(self, amount: float) -> float: pass
|
|
100
|
+
|
|
101
|
+
class PercentageDiscount(DiscountStrategy):
|
|
102
|
+
def __init__(self, percentage: float):
|
|
103
|
+
self.percentage = percentage
|
|
104
|
+
def calculate(self, amount: float) -> float:
|
|
105
|
+
return amount * (self.percentage / 100)
|
|
106
|
+
|
|
107
|
+
@dataclass
|
|
108
|
+
class DiscountConfig:
|
|
109
|
+
strategy: DiscountStrategy
|
|
110
|
+
min_purchase: float = 0.0
|
|
111
|
+
max_discount: float = float('inf')
|
|
112
|
+
|
|
113
|
+
# 40 more lines to use one formula
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
✅ **What should happen:**
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
def calculate_discount(amount: float, percent: float) -> float:
|
|
120
|
+
"""Calculate discount amount. percent should be 0-100."""
|
|
121
|
+
return amount * (percent / 100)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
When to add complexity: only when multiple discount types are actually needed.
|
|
125
|
+
|
|
126
|
+
### Example: Speculative Features
|
|
127
|
+
|
|
128
|
+
**Request:** "Save user preferences to database"
|
|
129
|
+
|
|
130
|
+
❌ **What LLMs do** — cache, validator, merge flag, notifications:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
class PreferenceManager:
|
|
134
|
+
def __init__(self, db, cache=None, validator=None):
|
|
135
|
+
...
|
|
136
|
+
def save(self, user_id, prefs, merge=True, validate=True, notify=False):
|
|
137
|
+
# 50 lines for what could be 3
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
✅ **What should happen:**
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
def save_preferences(db, user_id: int, preferences: dict):
|
|
144
|
+
db.execute(
|
|
145
|
+
"UPDATE users SET preferences = ? WHERE id = ?",
|
|
146
|
+
(json.dumps(preferences), user_id)
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Add caching, validation, merging later — only when actually needed.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 3. Surgical Changes
|
|
155
|
+
|
|
156
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
157
|
+
|
|
158
|
+
When editing existing code:
|
|
159
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
160
|
+
- Don't refactor things that aren't broken.
|
|
161
|
+
- Match existing style, even if you'd do it differently.
|
|
162
|
+
- If you notice unrelated dead code, mention it — don't delete it.
|
|
163
|
+
|
|
164
|
+
When your changes create orphans:
|
|
165
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
166
|
+
- Don't remove pre-existing dead code unless asked.
|
|
167
|
+
|
|
168
|
+
**The test:** Every changed line should trace directly to the user's request.
|
|
169
|
+
|
|
170
|
+
### Example: Drive-by Refactoring
|
|
171
|
+
|
|
172
|
+
**Request:** "Fix the bug where empty emails crash the validator"
|
|
173
|
+
|
|
174
|
+
❌ **What LLMs do** — improve email validation beyond the bug fix, add username validation, change comment style, add docstring.
|
|
175
|
+
|
|
176
|
+
✅ **What should happen — only the lines that fix empty email:**
|
|
177
|
+
|
|
178
|
+
```diff
|
|
179
|
+
def validate_user(user_data):
|
|
180
|
+
# Check email format
|
|
181
|
+
- if not user_data.get('email'):
|
|
182
|
+
+ email = user_data.get('email', '')
|
|
183
|
+
+ if not email or not email.strip():
|
|
184
|
+
raise ValueError("Email required")
|
|
185
|
+
|
|
186
|
+
# Basic email validation
|
|
187
|
+
- if '@' not in user_data['email']:
|
|
188
|
+
+ if '@' not in email:
|
|
189
|
+
raise ValueError("Invalid email")
|
|
190
|
+
|
|
191
|
+
# Check username ← untouched, not in scope
|
|
192
|
+
if not user_data.get('username'):
|
|
193
|
+
raise ValueError("Username required")
|
|
194
|
+
|
|
195
|
+
return True
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Example: Style Drift
|
|
199
|
+
|
|
200
|
+
**Request:** "Add logging to the upload function"
|
|
201
|
+
|
|
202
|
+
❌ **What LLMs do** — add type hints, change single quotes to double quotes, add docstring, reformat whitespace.
|
|
203
|
+
|
|
204
|
+
✅ **What should happen — match existing style:**
|
|
205
|
+
|
|
206
|
+
```diff
|
|
207
|
+
+ import logging
|
|
208
|
+
+
|
|
209
|
+
+ logger = logging.getLogger(__name__)
|
|
210
|
+
+
|
|
211
|
+
def upload_file(file_path, destination):
|
|
212
|
+
+ logger.info(f'Starting upload: {file_path}')
|
|
213
|
+
try:
|
|
214
|
+
with open(file_path, 'rb') as f:
|
|
215
|
+
data = f.read()
|
|
216
|
+
|
|
217
|
+
response = requests.post(destination, files={'file': data})
|
|
218
|
+
|
|
219
|
+
if response.status_code == 200:
|
|
220
|
+
+ logger.info(f'Upload successful: {file_path}')
|
|
221
|
+
return True
|
|
222
|
+
else:
|
|
223
|
+
+ logger.error(f'Upload failed: {file_path}, status={response.status_code}')
|
|
224
|
+
return False
|
|
225
|
+
except Exception as e:
|
|
226
|
+
- print(f"Error: {e}")
|
|
227
|
+
+ logger.exception(f'Upload error: {file_path}')
|
|
228
|
+
return False
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Matched: single quotes, no type hints, existing boolean pattern, spacing style.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## 4. Goal-Driven Execution
|
|
236
|
+
|
|
237
|
+
**Define success criteria. Loop until verified.**
|
|
238
|
+
|
|
239
|
+
Transform tasks into verifiable goals:
|
|
240
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
241
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
242
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
243
|
+
|
|
244
|
+
For multi-step tasks, state a brief plan:
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
1. [Step] → verify: [check]
|
|
248
|
+
2. [Step] → verify: [check]
|
|
249
|
+
3. [Step] → verify: [check]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
253
|
+
|
|
254
|
+
### Example: Incremental with Verification
|
|
255
|
+
|
|
256
|
+
**Request:** "Add rate limiting to the API"
|
|
257
|
+
|
|
258
|
+
❌ **What LLMs do** — implement Redis, multiple strategies, config system, and monitoring in one 300-line commit with no clear verification steps.
|
|
259
|
+
|
|
260
|
+
✅ **What should happen:**
|
|
261
|
+
|
|
262
|
+
```
|
|
263
|
+
Plan for rate limiting:
|
|
264
|
+
|
|
265
|
+
1. Basic in-memory rate limiting (single endpoint)
|
|
266
|
+
Verify: 100 requests → first 10 succeed, rest get 429
|
|
267
|
+
|
|
268
|
+
2. Extract to middleware (all endpoints)
|
|
269
|
+
Verify: existing endpoint tests still pass
|
|
270
|
+
|
|
271
|
+
3. Redis backend (multi-server)
|
|
272
|
+
Verify: rate limit persists across app restarts
|
|
273
|
+
|
|
274
|
+
4. Configuration (rates per endpoint)
|
|
275
|
+
Verify: /search allows 10/min, /users allows 100/min
|
|
276
|
+
|
|
277
|
+
Start with step 1?
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Example: Reproduce Before Fixing
|
|
281
|
+
|
|
282
|
+
**Request:** "The sorting breaks when there are duplicate scores"
|
|
283
|
+
|
|
284
|
+
❌ **What LLMs do** — immediately change sort logic without reproducing the bug.
|
|
285
|
+
|
|
286
|
+
✅ **What should happen:**
|
|
287
|
+
|
|
288
|
+
```python
|
|
289
|
+
# 1. First, write a test that reproduces the bug
|
|
290
|
+
def test_sort_with_duplicate_scores():
|
|
291
|
+
scores = [
|
|
292
|
+
{'name': 'Alice', 'score': 100},
|
|
293
|
+
{'name': 'Bob', 'score': 100},
|
|
294
|
+
{'name': 'Charlie', 'score': 90},
|
|
295
|
+
]
|
|
296
|
+
result = sort_scores(scores)
|
|
297
|
+
assert result[0]['score'] == 100
|
|
298
|
+
assert result[2]['score'] == 90
|
|
299
|
+
assert result[0]['name'] < result[1]['name'] # stable sort
|
|
300
|
+
|
|
301
|
+
# Verify: test fails → bug reproduced
|
|
302
|
+
|
|
303
|
+
# 2. Now fix with stable sort
|
|
304
|
+
def sort_scores(scores):
|
|
305
|
+
return sorted(scores, key=lambda x: (-x['score'], x['name']))
|
|
306
|
+
|
|
307
|
+
# Verify: test passes
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Anti-Patterns Summary
|
|
313
|
+
|
|
314
|
+
| Principle | Anti-Pattern | Fix |
|
|
315
|
+
|---|---|---|
|
|
316
|
+
| Think Before Coding | Silently assumes file format, fields, scope | List assumptions explicitly, ask for clarification |
|
|
317
|
+
| Simplicity First | Strategy pattern for single discount calculation | One function until complexity is actually needed |
|
|
318
|
+
| Surgical Changes | Reformats quotes, adds type hints while fixing bug | Only change lines that fix the reported issue |
|
|
319
|
+
| Goal-Driven | "I'll review and improve the code" | "Write test for bug X → make it pass → verify no regressions" |
|
|
320
|
+
|
|
321
|
+
## Key Insight
|
|
322
|
+
|
|
323
|
+
The "overcomplicated" examples aren't obviously wrong — they follow design patterns and best practices. The problem is **timing**: they add complexity before it's needed.
|
|
324
|
+
|
|
325
|
+
**Good code is code that solves today's problem simply, not tomorrow's problem prematurely.**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "karpathy-guidelines",
|
|
3
|
+
"display_name": "Karpathy Guidelines",
|
|
4
|
+
"description": "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution.",
|
|
5
|
+
"default_prompt": "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design.",
|
|
6
|
+
"triggers": [
|
|
7
|
+
"karpathy-guidelines",
|
|
8
|
+
"karpathy",
|
|
9
|
+
"Karpathy Guidelines",
|
|
10
|
+
"think before coding",
|
|
11
|
+
"simplicity first",
|
|
12
|
+
"surgical changes",
|
|
13
|
+
"goal-driven execution"
|
|
14
|
+
],
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"quality",
|
|
17
|
+
"guidelines",
|
|
18
|
+
"best-practices"
|
|
19
|
+
],
|
|
20
|
+
"tools": [],
|
|
21
|
+
"implicit_invocation": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "karpathy-guidelines",
|
|
3
|
+
"display_name": "Karpathy Guidelines",
|
|
4
|
+
"description": "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution.",
|
|
5
|
+
"default_prompt": "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design.",
|
|
6
|
+
"triggers": [
|
|
7
|
+
"karpathy-guidelines",
|
|
8
|
+
"karpathy",
|
|
9
|
+
"Karpathy Guidelines",
|
|
10
|
+
"think before coding",
|
|
11
|
+
"simplicity first",
|
|
12
|
+
"surgical changes",
|
|
13
|
+
"goal-driven execution"
|
|
14
|
+
],
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"quality",
|
|
17
|
+
"guidelines",
|
|
18
|
+
"best-practices"
|
|
19
|
+
],
|
|
20
|
+
"tools": [],
|
|
21
|
+
"implicit_invocation": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "karpathy-guidelines",
|
|
3
|
+
"display_name": "Karpathy Guidelines",
|
|
4
|
+
"description": "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution.",
|
|
5
|
+
"default_prompt": "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design.",
|
|
6
|
+
"triggers": [
|
|
7
|
+
"karpathy-guidelines",
|
|
8
|
+
"karpathy",
|
|
9
|
+
"Karpathy Guidelines",
|
|
10
|
+
"think before coding",
|
|
11
|
+
"simplicity first",
|
|
12
|
+
"surgical changes",
|
|
13
|
+
"goal-driven execution"
|
|
14
|
+
],
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"quality",
|
|
17
|
+
"guidelines",
|
|
18
|
+
"best-practices"
|
|
19
|
+
],
|
|
20
|
+
"tools": [],
|
|
21
|
+
"implicit_invocation": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Karpathy Guidelines"
|
|
3
|
+
short_description: "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution."
|
|
4
|
+
default_prompt: "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design."
|
|
5
|
+
dependencies:
|
|
6
|
+
tools: []
|
|
7
|
+
policy:
|
|
8
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "karpathy-guidelines",
|
|
3
|
+
"display_name": "Karpathy Guidelines",
|
|
4
|
+
"description": "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution.",
|
|
5
|
+
"default_prompt": "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design.",
|
|
6
|
+
"triggers": [
|
|
7
|
+
"karpathy-guidelines",
|
|
8
|
+
"karpathy",
|
|
9
|
+
"Karpathy Guidelines",
|
|
10
|
+
"think before coding",
|
|
11
|
+
"simplicity first",
|
|
12
|
+
"surgical changes",
|
|
13
|
+
"goal-driven execution"
|
|
14
|
+
],
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"quality",
|
|
17
|
+
"guidelines",
|
|
18
|
+
"best-practices"
|
|
19
|
+
],
|
|
20
|
+
"tools": [],
|
|
21
|
+
"implicit_invocation": true
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 1
|
|
2
|
+
name: "karpathy-guidelines"
|
|
3
|
+
display_name: "Karpathy Guidelines"
|
|
4
|
+
description: "Behavioral guidelines to reduce common LLM mistakes — think before coding, simplicity first, surgical changes, goal-driven execution."
|
|
5
|
+
default_prompt: "Use $karpathy-guidelines when the task requires quality discipline: writing code, reviewing, refactoring, analysis, or design."
|
|
6
|
+
triggers:
|
|
7
|
+
- "karpathy-guidelines"
|
|
8
|
+
- "karpathy"
|
|
9
|
+
- "Karpathy Guidelines"
|
|
10
|
+
- "think before coding"
|
|
11
|
+
- "simplicity first"
|
|
12
|
+
- "surgical changes"
|
|
13
|
+
- "goal-driven execution"
|
|
14
|
+
capabilities:
|
|
15
|
+
- "quality"
|
|
16
|
+
- "guidelines"
|
|
17
|
+
- "best-practices"
|
|
18
|
+
tools: []
|
|
19
|
+
invocation:
|
|
20
|
+
explicit: true
|
|
21
|
+
implicit: true
|
|
22
|
+
localization:
|
|
23
|
+
default_locale: "en"
|
|
24
|
+
available_locales:
|
|
25
|
+
- "en"
|
|
@@ -327,7 +327,7 @@ Data quality array: Verified XX% | Estimated XX% | Assumed XX%
|
|
|
327
327
|
## Framework Executions
|
|
328
328
|
|
|
329
329
|
### Framework Instance 1: [Name]
|
|
330
|
-
**Active Skill:**
|
|
330
|
+
**Active Skill:** `<skill-name>`
|
|
331
331
|
**Quality Gate:** ✅ Defeated (N/N checks)
|
|
332
332
|
|
|
333
333
|
**Analysis Output:**
|