@micka33/pi-karpathy-skill 1.2.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/LICENSE +21 -0
- package/README.md +62 -0
- package/package.json +35 -0
- package/skills/karpathy-guidelines/SKILL.md +71 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 pi-karpathy-skill contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# pi-karpathy-skill
|
|
2
|
+
|
|
3
|
+
Pi package that provides the `karpathy-guidelines` skill to coding agents.
|
|
4
|
+
|
|
5
|
+
The skill contains behavioral guidelines inspired by [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on common LLM coding pitfalls: think before coding, keep solutions simple, make surgical changes, and define verifiable success criteria.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
From npm:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:@micka33/pi-karpathy-skill
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
From this repository:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pi install git:git@github.com:Micka33/pi-karpathy-skill.git@latest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For project-local installation: Use the `-l` flag:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pi install -l npm:@micka33/pi-karpathy-skill@latest
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Pi auto-discovers the skill from this package. You can also force-load it in a pi session:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
/skill:karpathy-guidelines
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Package contents
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
skills/
|
|
39
|
+
└── karpathy-guidelines/
|
|
40
|
+
└── SKILL.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Publishing
|
|
44
|
+
|
|
45
|
+
Releases are published automatically by GitHub Actions when a semver tag is pushed:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git tag v0.1.0
|
|
49
|
+
git push origin v0.1.0
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The release workflow for an agent publishing the next version:
|
|
53
|
+
|
|
54
|
+
1. Run `git fetch --tags --force && git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n 1` to get the highest existing `vX.Y.Z` git tag in the repo.
|
|
55
|
+
2. Choose the next semver version by bumping it according to the requested changes.
|
|
56
|
+
3. Ask the user to confirm the next version you chose.
|
|
57
|
+
4. Create and push a matching tag, for example `git tag v0.0.1 && git push origin main v0.0.1`.
|
|
58
|
+
5. Verify the GitHub Actions release run succeeds.
|
|
59
|
+
|
|
60
|
+
## Attribution
|
|
61
|
+
|
|
62
|
+
Skill content is adapted from [`multica-ai/andrej-karpathy-skills`](https://github.com/multica-ai/andrej-karpathy-skills) and is licensed MIT.
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@micka33/pi-karpathy-skill",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Pi package providing the Karpathy Guidelines skill for safer, simpler coding-agent behavior.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Micka33/pi-karpathy-skill.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Micka33/pi-karpathy-skill/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/Micka33/pi-karpathy-skill#readme",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"pi-package",
|
|
20
|
+
"pi-skill",
|
|
21
|
+
"agent-skills",
|
|
22
|
+
"coding-agent",
|
|
23
|
+
"karpathy"
|
|
24
|
+
],
|
|
25
|
+
"files": [
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"skills"
|
|
29
|
+
],
|
|
30
|
+
"pi": {
|
|
31
|
+
"skills": [
|
|
32
|
+
"./skills"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: karpathy-guidelines
|
|
3
|
+
description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Karpathy guidelines
|
|
7
|
+
|
|
8
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
|
|
9
|
+
|
|
10
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
11
|
+
|
|
12
|
+
## 1. Think Before Coding
|
|
13
|
+
|
|
14
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
15
|
+
|
|
16
|
+
Before implementing:
|
|
17
|
+
|
|
18
|
+
- State your assumptions explicitly. If uncertain, ask.
|
|
19
|
+
- If multiple interpretations exist, present them - don't pick silently.
|
|
20
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
21
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
22
|
+
|
|
23
|
+
## 2. Simplicity First
|
|
24
|
+
|
|
25
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
26
|
+
|
|
27
|
+
- No features beyond what was asked.
|
|
28
|
+
- No abstractions for single-use code.
|
|
29
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
30
|
+
- No error handling for impossible scenarios.
|
|
31
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
32
|
+
|
|
33
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
34
|
+
|
|
35
|
+
## 3. Surgical Changes
|
|
36
|
+
|
|
37
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
38
|
+
|
|
39
|
+
When editing existing code:
|
|
40
|
+
|
|
41
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
42
|
+
- Don't refactor things that aren't broken.
|
|
43
|
+
- Match existing style, even if you'd do it differently.
|
|
44
|
+
- If you notice unrelated dead code, mention it - don't delete it.
|
|
45
|
+
|
|
46
|
+
When your changes create orphans:
|
|
47
|
+
|
|
48
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
49
|
+
- Don't remove pre-existing dead code unless asked.
|
|
50
|
+
|
|
51
|
+
The test: Every changed line should trace directly to the user's request.
|
|
52
|
+
|
|
53
|
+
## 4. Goal-Driven Execution
|
|
54
|
+
|
|
55
|
+
**Define success criteria. Loop until verified.**
|
|
56
|
+
|
|
57
|
+
Transform tasks into verifiable goals:
|
|
58
|
+
|
|
59
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
60
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
61
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
62
|
+
|
|
63
|
+
For multi-step tasks, state a brief plan:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
1. [Step] → verify: [check]
|
|
67
|
+
2. [Step] → verify: [check]
|
|
68
|
+
3. [Step] → verify: [check]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|