ai-engineering-kit 0.1.0 → 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 +3 -1
- package/dist/cli.js +71 -27
- package/package.json +1 -1
- package/template/skills/core-workflow/commit-organizer/SKILL.md +174 -0
- package/template/skills/engineering/diagnose/SKILL.md +117 -0
- package/template/skills/engineering/diagnose/scripts/hitl-loop.template.sh +41 -0
- package/template/skills/engineering/grill-with-docs/ADR-FORMAT.md +47 -0
- package/template/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +60 -0
- package/template/skills/engineering/grill-with-docs/SKILL.md +88 -0
- package/template/skills/engineering/improve-codebase-architecture/DEEPENING.md +37 -0
- package/template/skills/engineering/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/template/skills/engineering/improve-codebase-architecture/INTERFACE-DESIGN.md +44 -0
- package/template/skills/engineering/improve-codebase-architecture/LANGUAGE.md +53 -0
- package/template/skills/engineering/improve-codebase-architecture/SKILL.md +81 -0
- package/template/skills/engineering/prototype/LOGIC.md +79 -0
- package/template/skills/engineering/prototype/SKILL.md +30 -0
- package/template/skills/engineering/prototype/UI.md +112 -0
- package/template/skills/engineering/setup-matt-pocock-skills/SKILL.md +121 -0
- package/template/skills/engineering/setup-matt-pocock-skills/domain.md +51 -0
- package/template/skills/engineering/setup-matt-pocock-skills/issue-tracker-github.md +22 -0
- package/template/skills/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +23 -0
- package/template/skills/engineering/setup-matt-pocock-skills/issue-tracker-local.md +19 -0
- package/template/skills/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/template/skills/engineering/tdd/SKILL.md +109 -0
- package/template/skills/engineering/tdd/deep-modules.md +33 -0
- package/template/skills/engineering/tdd/interface-design.md +31 -0
- package/template/skills/engineering/tdd/mocking.md +59 -0
- package/template/skills/engineering/tdd/refactoring.md +10 -0
- package/template/skills/engineering/tdd/tests.md +61 -0
- package/template/skills/engineering/to-issues/SKILL.md +83 -0
- package/template/skills/engineering/to-prd/SKILL.md +74 -0
- package/template/skills/engineering/triage/AGENT-BRIEF.md +168 -0
- package/template/skills/engineering/triage/OUT-OF-SCOPE.md +101 -0
- package/template/skills/engineering/triage/SKILL.md +103 -0
- package/template/skills/engineering/zoom-out/SKILL.md +7 -0
- package/template/skills/misc/git-guardrails-claude-code/SKILL.md +95 -0
- package/template/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
- package/template/skills/misc/migrate-to-shoehorn/SKILL.md +118 -0
- package/template/skills/misc/scaffold-exercises/SKILL.md +106 -0
- package/template/skills/misc/setup-pre-commit/SKILL.md +91 -0
- package/template/skills/productivity/caveman/SKILL.md +49 -0
- package/template/skills/productivity/grill-me/SKILL.md +10 -0
- package/template/skills/productivity/handoff/SKILL.md +15 -0
- package/template/skills/productivity/teach/GLOSSARY-FORMAT.md +35 -0
- package/template/skills/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/template/skills/productivity/teach/MISSION-FORMAT.md +31 -0
- package/template/skills/productivity/teach/RESOURCES-FORMAT.md +32 -0
- package/template/skills/productivity/teach/SKILL.md +131 -0
- package/template/skills/productivity/write-a-skill/SKILL.md +117 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-guardrails-claude-code
|
|
3
|
+
description: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Git Guardrails
|
|
7
|
+
|
|
8
|
+
Sets up a PreToolUse hook that intercepts and blocks dangerous git commands before Claude executes them.
|
|
9
|
+
|
|
10
|
+
## What Gets Blocked
|
|
11
|
+
|
|
12
|
+
- `git push` (all variants including `--force`)
|
|
13
|
+
- `git reset --hard`
|
|
14
|
+
- `git clean -f` / `git clean -fd`
|
|
15
|
+
- `git branch -D`
|
|
16
|
+
- `git checkout .` / `git restore .`
|
|
17
|
+
|
|
18
|
+
When blocked, Claude sees a message telling it that it does not have authority to access these commands.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
|
|
22
|
+
### 1. Ask scope
|
|
23
|
+
|
|
24
|
+
Ask the user: install for **this project only** (`.claude/settings.json`) or **all projects** (`~/.claude/settings.json`)?
|
|
25
|
+
|
|
26
|
+
### 2. Copy the hook script
|
|
27
|
+
|
|
28
|
+
The bundled script is at: [scripts/block-dangerous-git.sh](scripts/block-dangerous-git.sh)
|
|
29
|
+
|
|
30
|
+
Copy it to the target location based on scope:
|
|
31
|
+
|
|
32
|
+
- **Project**: `.claude/hooks/block-dangerous-git.sh`
|
|
33
|
+
- **Global**: `~/.claude/hooks/block-dangerous-git.sh`
|
|
34
|
+
|
|
35
|
+
Make it executable with `chmod +x`.
|
|
36
|
+
|
|
37
|
+
### 3. Add hook to settings
|
|
38
|
+
|
|
39
|
+
Add to the appropriate settings file:
|
|
40
|
+
|
|
41
|
+
**Project** (`.claude/settings.json`):
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"hooks": {
|
|
46
|
+
"PreToolUse": [
|
|
47
|
+
{
|
|
48
|
+
"matcher": "Bash",
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"type": "command",
|
|
52
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Global** (`~/.claude/settings.json`):
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"hooks": {
|
|
66
|
+
"PreToolUse": [
|
|
67
|
+
{
|
|
68
|
+
"matcher": "Bash",
|
|
69
|
+
"hooks": [
|
|
70
|
+
{
|
|
71
|
+
"type": "command",
|
|
72
|
+
"command": "~/.claude/hooks/block-dangerous-git.sh"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If the settings file already exists, merge the hook into existing `hooks.PreToolUse` array — don't overwrite other settings.
|
|
82
|
+
|
|
83
|
+
### 4. Ask about customization
|
|
84
|
+
|
|
85
|
+
Ask if user wants to add or remove any patterns from the blocked list. Edit the copied script accordingly.
|
|
86
|
+
|
|
87
|
+
### 5. Verify
|
|
88
|
+
|
|
89
|
+
Run a quick test:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
echo '{"tool_input":{"command":"git push origin main"}}' | <path-to-script>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Should exit with code 2 and print a BLOCKED message to stderr.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
INPUT=$(cat)
|
|
4
|
+
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')
|
|
5
|
+
|
|
6
|
+
DANGEROUS_PATTERNS=(
|
|
7
|
+
"git push"
|
|
8
|
+
"git reset --hard"
|
|
9
|
+
"git clean -fd"
|
|
10
|
+
"git clean -f"
|
|
11
|
+
"git branch -D"
|
|
12
|
+
"git checkout \."
|
|
13
|
+
"git restore \."
|
|
14
|
+
"push --force"
|
|
15
|
+
"reset --hard"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
for pattern in "${DANGEROUS_PATTERNS[@]}"; do
|
|
19
|
+
if echo "$COMMAND" | grep -qE "$pattern"; then
|
|
20
|
+
echo "BLOCKED: '$COMMAND' matches dangerous pattern '$pattern'. The user has prevented you from doing this." >&2
|
|
21
|
+
exit 2
|
|
22
|
+
fi
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
exit 0
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate-to-shoehorn
|
|
3
|
+
description: Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Migrate to Shoehorn
|
|
7
|
+
|
|
8
|
+
## Why shoehorn?
|
|
9
|
+
|
|
10
|
+
`shoehorn` lets you pass partial data in tests while keeping TypeScript happy. It replaces `as` assertions with type-safe alternatives.
|
|
11
|
+
|
|
12
|
+
**Test code only.** Never use shoehorn in production code.
|
|
13
|
+
|
|
14
|
+
Problems with `as` in tests:
|
|
15
|
+
|
|
16
|
+
- Trained not to use it
|
|
17
|
+
- Must manually specify target type
|
|
18
|
+
- Double-as (`as unknown as Type`) for intentionally wrong data
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm i @total-typescript/shoehorn
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Migration patterns
|
|
27
|
+
|
|
28
|
+
### Large objects with few needed properties
|
|
29
|
+
|
|
30
|
+
Before:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
type Request = {
|
|
34
|
+
body: { id: string };
|
|
35
|
+
headers: Record<string, string>;
|
|
36
|
+
cookies: Record<string, string>;
|
|
37
|
+
// ...20 more properties
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
it("gets user by id", () => {
|
|
41
|
+
// Only care about body.id but must fake entire Request
|
|
42
|
+
getUser({
|
|
43
|
+
body: { id: "123" },
|
|
44
|
+
headers: {},
|
|
45
|
+
cookies: {},
|
|
46
|
+
// ...fake all 20 properties
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
After:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { fromPartial } from "@total-typescript/shoehorn";
|
|
55
|
+
|
|
56
|
+
it("gets user by id", () => {
|
|
57
|
+
getUser(
|
|
58
|
+
fromPartial({
|
|
59
|
+
body: { id: "123" },
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `as Type` → `fromPartial()`
|
|
66
|
+
|
|
67
|
+
Before:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
getUser({ body: { id: "123" } } as Request);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
After:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { fromPartial } from "@total-typescript/shoehorn";
|
|
77
|
+
|
|
78
|
+
getUser(fromPartial({ body: { id: "123" } }));
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `as unknown as Type` → `fromAny()`
|
|
82
|
+
|
|
83
|
+
Before:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
After:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import { fromAny } from "@total-typescript/shoehorn";
|
|
93
|
+
|
|
94
|
+
getUser(fromAny({ body: { id: 123 } }));
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## When to use each
|
|
98
|
+
|
|
99
|
+
| Function | Use case |
|
|
100
|
+
| --------------- | -------------------------------------------------- |
|
|
101
|
+
| `fromPartial()` | Pass partial data that still type-checks |
|
|
102
|
+
| `fromAny()` | Pass intentionally wrong data (keeps autocomplete) |
|
|
103
|
+
| `fromExact()` | Force full object (swap with fromPartial later) |
|
|
104
|
+
|
|
105
|
+
## Workflow
|
|
106
|
+
|
|
107
|
+
1. **Gather requirements** - ask user:
|
|
108
|
+
- What test files have `as` assertions causing problems?
|
|
109
|
+
- Are they dealing with large objects where only some properties matter?
|
|
110
|
+
- Do they need to pass intentionally wrong data for error testing?
|
|
111
|
+
|
|
112
|
+
2. **Install and migrate**:
|
|
113
|
+
- [ ] Install: `npm i @total-typescript/shoehorn`
|
|
114
|
+
- [ ] Find test files with `as` assertions: `grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"`
|
|
115
|
+
- [ ] Replace `as Type` with `fromPartial()`
|
|
116
|
+
- [ ] Replace `as unknown as Type` with `fromAny()`
|
|
117
|
+
- [ ] Add imports from `@total-typescript/shoehorn`
|
|
118
|
+
- [ ] Run type check to verify
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-exercises
|
|
3
|
+
description: Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Scaffold Exercises
|
|
7
|
+
|
|
8
|
+
Create exercise directory structures that pass `pnpm ai-hero-cli internal lint`, then commit with `git commit`.
|
|
9
|
+
|
|
10
|
+
## Directory naming
|
|
11
|
+
|
|
12
|
+
- **Sections**: `XX-section-name/` inside `exercises/` (e.g., `01-retrieval-skill-building`)
|
|
13
|
+
- **Exercises**: `XX.YY-exercise-name/` inside a section (e.g., `01.03-retrieval-with-bm25`)
|
|
14
|
+
- Section number = `XX`, exercise number = `XX.YY`
|
|
15
|
+
- Names are dash-case (lowercase, hyphens)
|
|
16
|
+
|
|
17
|
+
## Exercise variants
|
|
18
|
+
|
|
19
|
+
Each exercise needs at least one of these subfolders:
|
|
20
|
+
|
|
21
|
+
- `problem/` - student workspace with TODOs
|
|
22
|
+
- `solution/` - reference implementation
|
|
23
|
+
- `explainer/` - conceptual material, no TODOs
|
|
24
|
+
|
|
25
|
+
When stubbing, default to `explainer/` unless the plan specifies otherwise.
|
|
26
|
+
|
|
27
|
+
## Required files
|
|
28
|
+
|
|
29
|
+
Each subfolder (`problem/`, `solution/`, `explainer/`) needs a `readme.md` that:
|
|
30
|
+
|
|
31
|
+
- Is **not empty** (must have real content, even a single title line works)
|
|
32
|
+
- Has no broken links
|
|
33
|
+
|
|
34
|
+
When stubbing, create a minimal readme with a title and a description:
|
|
35
|
+
|
|
36
|
+
```md
|
|
37
|
+
# Exercise Title
|
|
38
|
+
|
|
39
|
+
Description here
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If the subfolder has code, it also needs a `main.ts` (>1 line). But for stubs, a readme-only exercise is fine.
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
1. **Parse the plan** - extract section names, exercise names, and variant types
|
|
47
|
+
2. **Create directories** - `mkdir -p` for each path
|
|
48
|
+
3. **Create stub readmes** - one `readme.md` per variant folder with a title
|
|
49
|
+
4. **Run lint** - `pnpm ai-hero-cli internal lint` to validate
|
|
50
|
+
5. **Fix any errors** - iterate until lint passes
|
|
51
|
+
|
|
52
|
+
## Lint rules summary
|
|
53
|
+
|
|
54
|
+
The linter (`pnpm ai-hero-cli internal lint`) checks:
|
|
55
|
+
|
|
56
|
+
- Each exercise has subfolders (`problem/`, `solution/`, `explainer/`)
|
|
57
|
+
- At least one of `problem/`, `explainer/`, or `explainer.1/` exists
|
|
58
|
+
- `readme.md` exists and is non-empty in the primary subfolder
|
|
59
|
+
- No `.gitkeep` files
|
|
60
|
+
- No `speaker-notes.md` files
|
|
61
|
+
- No broken links in readmes
|
|
62
|
+
- No `pnpm run exercise` commands in readmes
|
|
63
|
+
- `main.ts` required per subfolder unless it's readme-only
|
|
64
|
+
|
|
65
|
+
## Moving/renaming exercises
|
|
66
|
+
|
|
67
|
+
When renumbering or moving exercises:
|
|
68
|
+
|
|
69
|
+
1. Use `git mv` (not `mv`) to rename directories - preserves git history
|
|
70
|
+
2. Update the numeric prefix to maintain order
|
|
71
|
+
3. Re-run lint after moves
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git mv exercises/01-retrieval/01.03-embeddings exercises/01-retrieval/01.04-embeddings
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Example: stubbing from a plan
|
|
80
|
+
|
|
81
|
+
Given a plan like:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Section 05: Memory Skill Building
|
|
85
|
+
- 05.01 Introduction to Memory
|
|
86
|
+
- 05.02 Short-term Memory (explainer + problem + solution)
|
|
87
|
+
- 05.03 Long-term Memory
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Create:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
mkdir -p exercises/05-memory-skill-building/05.01-introduction-to-memory/explainer
|
|
94
|
+
mkdir -p exercises/05-memory-skill-building/05.02-short-term-memory/{explainer,problem,solution}
|
|
95
|
+
mkdir -p exercises/05-memory-skill-building/05.03-long-term-memory/explainer
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then create readme stubs:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
exercises/05-memory-skill-building/05.01-introduction-to-memory/explainer/readme.md -> "# Introduction to Memory"
|
|
102
|
+
exercises/05-memory-skill-building/05.02-short-term-memory/explainer/readme.md -> "# Short-term Memory"
|
|
103
|
+
exercises/05-memory-skill-building/05.02-short-term-memory/problem/readme.md -> "# Short-term Memory"
|
|
104
|
+
exercises/05-memory-skill-building/05.02-short-term-memory/solution/readme.md -> "# Short-term Memory"
|
|
105
|
+
exercises/05-memory-skill-building/05.03-long-term-memory/explainer/readme.md -> "# Long-term Memory"
|
|
106
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-pre-commit
|
|
3
|
+
description: Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Pre-Commit Hooks
|
|
7
|
+
|
|
8
|
+
## What This Sets Up
|
|
9
|
+
|
|
10
|
+
- **Husky** pre-commit hook
|
|
11
|
+
- **lint-staged** running Prettier on all staged files
|
|
12
|
+
- **Prettier** config (if missing)
|
|
13
|
+
- **typecheck** and **test** scripts in the pre-commit hook
|
|
14
|
+
|
|
15
|
+
## Steps
|
|
16
|
+
|
|
17
|
+
### 1. Detect package manager
|
|
18
|
+
|
|
19
|
+
Check for `package-lock.json` (npm), `pnpm-lock.yaml` (pnpm), `yarn.lock` (yarn), `bun.lockb` (bun). Use whichever is present. Default to npm if unclear.
|
|
20
|
+
|
|
21
|
+
### 2. Install dependencies
|
|
22
|
+
|
|
23
|
+
Install as devDependencies:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
husky lint-staged prettier
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 3. Initialize Husky
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx husky init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This creates `.husky/` dir and adds `prepare: "husky"` to package.json.
|
|
36
|
+
|
|
37
|
+
### 4. Create `.husky/pre-commit`
|
|
38
|
+
|
|
39
|
+
Write this file (no shebang needed for Husky v9+):
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
npx lint-staged
|
|
43
|
+
npm run typecheck
|
|
44
|
+
npm run test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Adapt**: Replace `npm` with detected package manager. If repo has no `typecheck` or `test` script in package.json, omit those lines and tell the user.
|
|
48
|
+
|
|
49
|
+
### 5. Create `.lintstagedrc`
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"*": "prettier --ignore-unknown --write"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 6. Create `.prettierrc` (if missing)
|
|
58
|
+
|
|
59
|
+
Only create if no Prettier config exists. Use these defaults:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"useTabs": false,
|
|
64
|
+
"tabWidth": 2,
|
|
65
|
+
"printWidth": 80,
|
|
66
|
+
"singleQuote": false,
|
|
67
|
+
"trailingComma": "es5",
|
|
68
|
+
"semi": true,
|
|
69
|
+
"arrowParens": "always"
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 7. Verify
|
|
74
|
+
|
|
75
|
+
- [ ] `.husky/pre-commit` exists and is executable
|
|
76
|
+
- [ ] `.lintstagedrc` exists
|
|
77
|
+
- [ ] `prepare` script in package.json is `"husky"`
|
|
78
|
+
- [ ] `prettier` config exists
|
|
79
|
+
- [ ] Run `npx lint-staged` to verify it works
|
|
80
|
+
|
|
81
|
+
### 8. Commit
|
|
82
|
+
|
|
83
|
+
Stage all changed/created files and commit with message: `Add pre-commit hooks (husky + lint-staged + prettier)`
|
|
84
|
+
|
|
85
|
+
This will run through the new pre-commit hooks — a good smoke test that everything works.
|
|
86
|
+
|
|
87
|
+
## Notes
|
|
88
|
+
|
|
89
|
+
- Husky v9+ doesn't need shebangs in hook files
|
|
90
|
+
- `prettier --ignore-unknown` skips files Prettier can't parse (images, etc.)
|
|
91
|
+
- The pre-commit runs lint-staged first (fast, staged-only), then full typecheck and tests
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: caveman
|
|
3
|
+
description: >
|
|
4
|
+
Ultra-compressed communication mode. Cuts token usage ~75% by dropping
|
|
5
|
+
filler, articles, and pleasantries while keeping full technical accuracy.
|
|
6
|
+
Use when user says "caveman mode", "talk like caveman", "use caveman",
|
|
7
|
+
"less tokens", "be brief", or invokes /caveman.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Respond terse like smart caveman. All technical substance stay. Only fluff die.
|
|
11
|
+
|
|
12
|
+
## Persistence
|
|
13
|
+
|
|
14
|
+
ACTIVE EVERY RESPONSE once triggered. No revert after many turns. No filler drift. Still active if unsure. Off only when user says "stop caveman" or "normal mode".
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Abbreviate common terms (DB/auth/config/req/res/fn/impl). Strip conjunctions. Use arrows for causality (X -> Y). One word when one word enough.
|
|
19
|
+
|
|
20
|
+
Technical terms stay exact. Code blocks unchanged. Errors quoted exact.
|
|
21
|
+
|
|
22
|
+
Pattern: `[thing] [action] [reason]. [next step].`
|
|
23
|
+
|
|
24
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
25
|
+
Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
**"Why React component re-render?"**
|
|
30
|
+
|
|
31
|
+
> Inline obj prop -> new ref -> re-render. `useMemo`.
|
|
32
|
+
|
|
33
|
+
**"Explain database connection pooling."**
|
|
34
|
+
|
|
35
|
+
> Pool = reuse DB conn. Skip handshake -> fast under load.
|
|
36
|
+
|
|
37
|
+
## Auto-Clarity Exception
|
|
38
|
+
|
|
39
|
+
Drop caveman temporarily for: security warnings, irreversible action confirmations, multi-step sequences where fragment order risks misread, user asks to clarify or repeats question. Resume caveman after clear part done.
|
|
40
|
+
|
|
41
|
+
Example -- destructive op:
|
|
42
|
+
|
|
43
|
+
> **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
|
|
44
|
+
>
|
|
45
|
+
> ```sql
|
|
46
|
+
> DROP TABLE users;
|
|
47
|
+
> ```
|
|
48
|
+
>
|
|
49
|
+
> Caveman resume. Verify backup exist first.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time.
|
|
9
|
+
|
|
10
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handoff
|
|
3
|
+
description: Compact the current conversation into a handoff document for another agent to pick up.
|
|
4
|
+
argument-hint: "What will the next session be used for?"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save to the temporary directory of the user's OS - not the current workspace.
|
|
8
|
+
|
|
9
|
+
Include a "suggested skills" section in the document, which suggests skills that the agent should invoke.
|
|
10
|
+
|
|
11
|
+
Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
|
|
12
|
+
|
|
13
|
+
Redact any sensitive information, such as API keys, passwords, or personally identifiable information.
|
|
14
|
+
|
|
15
|
+
If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# GLOSSARY.md Format
|
|
2
|
+
|
|
3
|
+
`GLOSSARY.md` is the canonical language for this teaching workspace. All explainers, exercises, and learning records should adhere to its terminology. Building it is itself part of learning: compressing a concept into a tight definition is evidence the user understands it.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
# {Topic} Glossary
|
|
9
|
+
|
|
10
|
+
{One or two sentence description of the topic this glossary covers.}
|
|
11
|
+
|
|
12
|
+
## Terms
|
|
13
|
+
|
|
14
|
+
**Hypertrophy**:
|
|
15
|
+
Muscle growth driven by mechanical tension and metabolic stress over repeated training sessions.
|
|
16
|
+
_Avoid_: Bulking, getting big
|
|
17
|
+
|
|
18
|
+
**Progressive overload**:
|
|
19
|
+
Systematically increasing the demand on a muscle over time — via load, volume, or intensity.
|
|
20
|
+
_Avoid_: Pushing harder, levelling up
|
|
21
|
+
|
|
22
|
+
**RPE (Rate of Perceived Exertion)**:
|
|
23
|
+
A 1–10 self-rating of how hard a set felt, where 10 is failure and 8 means two reps left in the tank.
|
|
24
|
+
_Avoid_: Effort score, intensity rating
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Rules
|
|
28
|
+
|
|
29
|
+
- **Add a term only when the user understands it.** The glossary is a record of compressed knowledge, not a dictionary the user reads to learn. If the user has just been introduced to a concept, wait until they can use it correctly before promoting it here.
|
|
30
|
+
- **Be opinionated.** When several words exist for the same concept, pick the best one and list the rest as aliases to avoid. This is how language compresses.
|
|
31
|
+
- **Keep definitions tight.** One or two sentences. Define what the term IS, not what it does or how to do it.
|
|
32
|
+
- **Use the glossary's own terms inside definitions.** Once a term is in the glossary, prefer it everywhere — including inside other definitions. This is what makes complex terms easier to grasp later.
|
|
33
|
+
- **Group under subheadings** when natural clusters emerge (e.g. `## Anatomy`, `## Programming`). A flat list is fine when terms cohere.
|
|
34
|
+
- **Flag ambiguities explicitly.** If a term is used loosely in the wider field, note the resolution: "In this workspace, 'set' always means a working set — warm-ups are tracked separately."
|
|
35
|
+
- **Revise as understanding deepens.** A definition the user wrote in week one may be wrong by week six. Update in place; do not leave stale entries.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Learning Record Format
|
|
2
|
+
|
|
3
|
+
Learning records live in `./learning-records/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc. Create the directory lazily — only when the first record is written.
|
|
4
|
+
|
|
5
|
+
They are the teaching equivalent of ADRs: they capture non-obvious lessons, key insights, and stated prior knowledge that will steer future sessions. They are used to calculate the zone of proximal development.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# {Short title of what was learned or established}
|
|
11
|
+
|
|
12
|
+
{1-3 sentences: what was learned (or what prior knowledge was established), and why it matters for future sessions.}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
That is the whole format. A learning record can be a single paragraph. The value is recording _that_ this is now known and _why_ it changes what to teach next — not in filling out sections.
|
|
16
|
+
|
|
17
|
+
## Optional sections
|
|
18
|
+
|
|
19
|
+
Only include these when they add genuine value. Most records won't need them.
|
|
20
|
+
|
|
21
|
+
- **Status** frontmatter (`active | superseded by LR-NNNN`) — useful when an earlier understanding turns out to be wrong and is replaced.
|
|
22
|
+
- **Evidence** — how the user demonstrated the understanding (a question answered, an exercise completed, prior experience cited). Useful when the claim might be revisited.
|
|
23
|
+
- **Implications** — what this unlocks or rules out for future sessions. Worth recording when non-obvious.
|
|
24
|
+
|
|
25
|
+
## Numbering
|
|
26
|
+
|
|
27
|
+
Scan `./learning-records/` for the highest existing number and increment by one.
|
|
28
|
+
|
|
29
|
+
## When to write a learning record
|
|
30
|
+
|
|
31
|
+
Write one when any of these is true:
|
|
32
|
+
|
|
33
|
+
1. **The user demonstrated genuine understanding of something non-trivial** — not just exposure, but evidence they can use the concept correctly. This sets a new floor for what to teach next.
|
|
34
|
+
2. **The user disclosed prior knowledge** — "I already know X." Record it so future sessions don't re-teach it. Also record the _depth_ claimed.
|
|
35
|
+
3. **A misconception was corrected** — the user previously believed something wrong and now sees why. These are high-value: they predict future stumbling blocks for related topics.
|
|
36
|
+
4. **The mission shifted in response to learning** — the user discovered they cared about something different than they thought. Cross-link to [[MISSION.md]] and update it.
|
|
37
|
+
|
|
38
|
+
### What does _not_ qualify
|
|
39
|
+
|
|
40
|
+
- Material that was merely covered. Coverage is not learning. Wait for evidence.
|
|
41
|
+
- Anything already captured tersely in [[GLOSSARY.md]] as a term definition. Don't duplicate.
|
|
42
|
+
- Session-by-session activity logs. Learning records are not a journal — they are decision-grade insights.
|
|
43
|
+
|
|
44
|
+
## Supersession
|
|
45
|
+
|
|
46
|
+
When a later record contradicts an earlier one (the user's understanding deepened or corrected), mark the old record `Status: superseded by LR-NNNN` rather than deleting it. The history of how understanding evolved is itself useful signal.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# MISSION.md Format
|
|
2
|
+
|
|
3
|
+
`MISSION.md` lives at the workspace root. It captures the _reason_ the user is learning this topic. Every teaching decision — what to teach next, which resources to surface, which exercises to design — should trace back to this document.
|
|
4
|
+
|
|
5
|
+
## Template
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
# Mission: {Topic}
|
|
9
|
+
|
|
10
|
+
## Why
|
|
11
|
+
{1-3 sentences. The concrete real-world goal the user is chasing. What changes in their life or work when they have this skill? Avoid abstract framings like "to understand X" — push for the underlying outcome.}
|
|
12
|
+
|
|
13
|
+
## Success looks like
|
|
14
|
+
- {A specific, observable thing the user will be able to do}
|
|
15
|
+
- {Another specific thing}
|
|
16
|
+
- {…}
|
|
17
|
+
|
|
18
|
+
## Constraints
|
|
19
|
+
- {Time, budget, prior commitments, learning preferences, anything that bounds the approach}
|
|
20
|
+
|
|
21
|
+
## Out of scope
|
|
22
|
+
- {Adjacent topics the user explicitly does not want to chase right now — protects the zone of proximal development}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **One mission per workspace.** If the user wants to learn two unrelated things, that is two workspaces.
|
|
28
|
+
- **Concrete over abstract.** "Run a half marathon by October" beats "get fitter." "Ship a Rust CLI to my team" beats "learn Rust."
|
|
29
|
+
- **Push back on vagueness.** If the user cannot articulate why, interview them before writing anything. A bad mission is worse than no mission.
|
|
30
|
+
- **Revise when reality shifts.** Missions change. When the user's goal moves, update this file — don't leave a stale mission steering future sessions.
|
|
31
|
+
- **Keep it short.** If `MISSION.md` runs past a screen, it has stopped being a compass and started being a plan.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# RESOURCES.md Format
|
|
2
|
+
|
|
3
|
+
`RESOURCES.md` is the curated set of trusted sources for this topic. Knowledge for explainers should be drawn from here, not from parametric guesses. Wisdom comes from the communities listed here.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```md
|
|
8
|
+
# {Topic} Resources
|
|
9
|
+
|
|
10
|
+
## Knowledge
|
|
11
|
+
|
|
12
|
+
- [Book: _The Science and Practice of Strength Training_ — Zatsiorsky & Kraemer](https://example.com)
|
|
13
|
+
Foundational text on programming and adaptation. Use for: anything to do with periodisation, recovery, intensity zones.
|
|
14
|
+
- [Article: "How Much Should I Train?" — Greg Nuckols (Stronger By Science)](https://example.com)
|
|
15
|
+
Evidence-based review of volume landmarks. Use for: weekly set targets per muscle group.
|
|
16
|
+
|
|
17
|
+
## Wisdom (Communities)
|
|
18
|
+
|
|
19
|
+
- [r/weightroom](https://reddit.com/r/weightroom)
|
|
20
|
+
High-signal subreddit, moderated against bro-science. Use for: programme critique, plateau troubleshooting.
|
|
21
|
+
- Local: Tuesday strength class at {gym name}
|
|
22
|
+
Use for: real-time coaching feedback on lifts.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **High-trust only.** Prefer primary sources, recognised experts, peer-reviewed work, and communities with strong moderation. If a resource is marketing dressed as education, leave it out.
|
|
28
|
+
- **Annotate every entry.** A bare link is useless in three months. Add one line: what it covers and when to reach for it.
|
|
29
|
+
- **Group by Knowledge / Wisdom.** Mirrors the philosophy in [SKILL.md](./SKILL.md). It is fine for a resource to appear in only one group.
|
|
30
|
+
- **Surface gaps explicitly.** If no good resource exists for an area the mission needs, write a `## Gaps` section listing what is missing. This drives future search.
|
|
31
|
+
- **Prune ruthlessly.** A resource that turned out to be wrong, shallow, or off-mission should be removed, not buried. Better five sharp sources than thirty mediocre ones.
|
|
32
|
+
- **Record community preferences.** If the user has opted out of joining communities, note it here so future sessions don't keep proposing them.
|