@codegiveness/kernel-prompt 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # @codegiveness/kernel-prompt
2
+
3
+ ## 0.1.0
4
+
5
+ ### Initial Release
6
+
7
+ - Ship **`kernel-prompt`** — a prompt-engineering skill that refines or composes a prompt into one paragraph that lands on first try. The skill runs the KERNEL pass: six cuts (Keep it simple, Easy to verify, Reproducible, Narrow scope, Explicit constraints, Logical structure) that turn a vague request into a single paragraph carrying context, task, constraints, format, and verify as flowing prose.
8
+ - Two branches: **Refine** (input is an existing prompt) and **Compose** (input is a task description). Same six letters, different starting material.
9
+ - A grounding step pins vague input terms to concrete codebase symbols before the pass writes against them.
10
+ - A vague-phrasing sweep tests every content clause against a two-reader test and applies one of seven named reformulation patterns when a clause fails.
11
+ - Ships as installable npm prose (`@codegiveness/kernel-prompt`) — no compiled binary, no platform matrix.
12
+ - `kernel-prompt update` pulls the latest version via npm.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 codegiveness
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,111 @@
1
+ # Kernel — a prompt stripped to what works
2
+
3
+ [![skills.sh](https://skills.sh/b/codegiveness/kernel-prompt)](https://skills.sh/codegiveness/kernel-prompt)
4
+ [![npm version](https://img.shields.io/npm/v/@codegiveness/kernel-prompt.svg?style=flat-square)](https://www.npmjs.com/package/@codegiveness/kernel-prompt)
5
+ [![npm downloads](https://img.shields.io/npm/dm/@codegiveness/kernel-prompt.svg?style=flat-square)](https://www.npmjs.com/package/@codegiveness/kernel-prompt)
6
+ [![MIT License](https://img.shields.io/npm/l/@codegiveness/kernel-prompt.svg?style=flat-square)](https://github.com/codegiveness/kernel-prompt/blob/main/LICENSE)
7
+ [![CI](https://github.com/codegiveness/kernel-prompt/actions/workflows/ci.yml/badge.svg)](https://github.com/codegiveness/kernel-prompt/actions/workflows/ci.yml)
8
+ [![CodeQL](https://github.com/codegiveness/kernel-prompt/actions/workflows/codeql.yml/badge.svg)](https://github.com/codegiveness/kernel-prompt/actions/workflows/codeql.yml)
9
+
10
+ Six cuts that turn a vague request into a prompt that lands on first try.
11
+
12
+ ## Quickstart (30-second setup)
13
+
14
+ 1. Run the skills.sh installer:
15
+
16
+ ```bash
17
+ npx skills@latest add codegiveness/kernel-prompt
18
+ ```
19
+
20
+ 2. Pick the skill, and which coding agent you want to install it on (Claude Code, Codex, OpenCode, or others).
21
+
22
+ 3. Bam — you're ready to go. The skill is prose; nothing compiles.
23
+
24
+ ## Install via npm
25
+
26
+ Prefer a managed npm install you control by hand?
27
+
28
+ ```bash
29
+ npm install -g @codegiveness/kernel-prompt
30
+ kernel-prompt install # symlinks the skill into ~/.claude/skills and ~/.agents/skills
31
+ ```
32
+
33
+ Or copy the three files from `skills/engineering/kernel-prompt/` into your project's skill directory — the skill is prose, nothing compiles.
34
+
35
+ To stay current:
36
+
37
+ ```bash
38
+ kernel-prompt update # npm install -g @codegiveness/kernel-prompt@latest
39
+ ```
40
+
41
+ ## Install as a Claude Code plugin
42
+
43
+ This skill also ships as a native Claude Code plugin:
44
+
45
+ ```
46
+ /plugin marketplace add codegiveness/kernel-prompt
47
+ /plugin install kernel-prompt@codegiveness
48
+ ```
49
+
50
+ Or from your shell:
51
+
52
+ ```bash
53
+ claude plugin marketplace add codegiveness/kernel-prompt
54
+ claude plugin install kernel-prompt@codegiveness
55
+ ```
56
+
57
+ Three ways to install, three philosophies:
58
+
59
+ - **[skills.sh](https://skills.sh/codegiveness/kernel-prompt)** copies the skill into your project so you can hack on it and make it your own.
60
+ - **npm** installs the managed package globally and symlinks it into every agent harness you use.
61
+ - **The plugin** keeps it as a read-only, always-current bundle you don't edit — best when you just want the skill to work and follow along as it evolves.
62
+
63
+ ## Why This Skill Exists
64
+
65
+ > "No-one knows exactly what they want."
66
+ >
67
+ > David Thomas & Andrew Hunt, [The Pragmatic Programmer](https://www.amazon.co.uk/Pragmatic-Programmer-Anniversary-Journey-Mastery/dp/B0833F1T3V)
68
+
69
+ Every prompt-engineering failure mode traces back to one root cause: the request was vague. The agent filled the vagueness with its own priors, the priors were wrong, and the output missed. The fix is not a longer prompt — it is a tighter one. A prompt where every clause passes a two-reader test: would two different readers produce outputs matching in type and scope?
70
+
71
+ > "The best modules are deep. They allow a lot of functionality to be accessed through a simple interface."
72
+ >
73
+ > John Ousterhout, [A Philosophy Of Software Design](https://www.amazon.co.uk/Philosophy-Software-Design-2nd/dp/173210221X)
74
+
75
+ `kernel-prompt` is a deep module. Its interface is one paragraph; its behaviour is a six-letter pass — **K**eep it simple, **E**asy to verify, **R**eproducible, **N**arrow scope, **E**xplicit constraints, **L**ogical structure — plus an exhaustive vague-phrasing sweep. That paragraph carries five substances as flowing prose: **context** (grounded codebase symbols), **task** (the operation to perform), **constraints** (type, scope, limits), **format** (the deliverable shape), and **verify** (a checkable success criterion). You hand it a vague request, it returns a paragraph that lands. The simplicity is the point — the depth is in the cuts.
76
+
77
+ > "With a ubiquitous language, conversations among developers and expressions of the code are all derived from the same domain model."
78
+ >
79
+ > Eric Evans, [Domain-Driven Design](https://www.amazon.co.uk/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215)
80
+
81
+ The pass grounds vague terms to concrete codebase symbols before it writes. "The auth service" becomes `refreshToken (src/auth/tokens.ts:42)`. The paragraph carries the grounded vocabulary, not the user's original phrasing — so two readers see the same code, not the same ambiguity.
82
+
83
+ The skill is model-invoked: any agent can reach for it when the task fits, and a user can call it directly. It has no `disable-model-invocation` flag — that's deliberate. A kernel'd prompt is the input every other skill wants.
84
+
85
+ ## Before / after
86
+
87
+ **Vague input:**
88
+
89
+ > Our auth service has a token refresh bug — users get logged out. Fix it, add a test that catches the regression, and update the runbook so on-call knows what to do.
90
+
91
+ **Kernel'd output (one paragraph):**
92
+
93
+ > `refreshToken` (src/auth/tokens.ts:42) drops sessions on token refresh, breaking `TokenStore` (src/auth/store.ts:15); patch `refreshToken` so it stops dropping sessions on refresh failure, add a `bun test` regression that fails before the fix and passes after, and update `docs/runbooks/auth.md` with Symptom, Cause, Fix, and Verification sections (under 200 words each), shipping as one PR — TypeScript strict, no `as any`.
94
+
95
+ The vague input names no symbols; the output grounds every term in a file and function, attaches a checkable success criterion, and carries its constraints inline. That's one pass — six cuts, one sweep, one paragraph.
96
+
97
+ ## Reference
98
+
99
+ The skill splits on one axis — who can invoke it. **User-invoked** skills are reachable only when you type them; their job is to orchestrate. **Model-invoked** skills can be invoked by you _or_ reached for automatically by the agent when the task fits; they hold the reusable discipline. `kernel-prompt` is model-invoked.
100
+
101
+ | Skill | Invocation | Description |
102
+ |---|---|---|
103
+ | [kernel-prompt](./skills/engineering/kernel-prompt/SKILL.md) | Model-invoked | Kernel a prompt — refine or compose it into one paragraph that lands on first try. |
104
+
105
+ ### Files
106
+
107
+ | File | Purpose |
108
+ |---|---|
109
+ | [`SKILL.md`](./skills/engineering/kernel-prompt/SKILL.md) | The KERNEL pass — six cuts (K-E-R-N-E-L) and the vague-phrasing sweep |
110
+ | [`EXAMPLE.md`](./skills/engineering/kernel-prompt/EXAMPLE.md) | A full disclosed pass: grounding, combining, six letters, sweep with per-clause verdicts |
111
+ | [`REFORMULATIONS.md`](./skills/engineering/kernel-prompt/REFORMULATIONS.md) | Seven named patterns for repairing clauses that fail the two-reader test |
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env node
2
+ // kernel-prompt — thin npm wrapper for install / update.
3
+ // The skill itself is prose (skills/engineering/kernel-prompt/*.md); this script
4
+ // only symlinks the skill into the local harness directories or pulls the
5
+ // latest version via npm.
6
+
7
+ import { execSync } from "node:child_process";
8
+ import { existsSync, mkdirSync, readlinkSync, realpathSync, rmSync, symlinkSync } from "node:fs";
9
+ import { dirname, join, resolve } from "node:path";
10
+ import { homedir } from "node:os";
11
+
12
+ const PKG = "@codegiveness/kernel-prompt";
13
+ const SKILL_NAME = "kernel-prompt";
14
+
15
+ // Resolve the skill source relative to this bin file's installed location.
16
+ // npm installs the package so that bin/kernel-prompt.mjs sits at <pkg-root>/bin/.
17
+ const PKG_ROOT = resolve(dirname(new URL(import.meta.url).pathname), "..");
18
+ const SKILL_SRC = join(PKG_ROOT, "skills", "engineering", SKILL_NAME);
19
+
20
+ const DESTS = [
21
+ join(homedir(), ".claude", "skills"),
22
+ join(homedir(), ".agents", "skills"),
23
+ ];
24
+
25
+ function linkSkill() {
26
+ if (!existsSync(SKILL_SRC)) {
27
+ console.error(`error: skill source not found at ${SKILL_SRC}`);
28
+ console.error(" the npm install may be corrupt; reinstall with:");
29
+ console.error(` npm install -g ${PKG}`);
30
+ process.exit(1);
31
+ }
32
+
33
+ for (const dest of DESTS) {
34
+ // Bail if dest is itself a symlink into the package — would pollute the install.
35
+ if (existsSync(dest)) {
36
+ try {
37
+ const resolved = realpathSync(dest);
38
+ if (resolved.startsWith(PKG_ROOT)) {
39
+ console.error(`error: ${dest} is a symlink into the package (${resolved}).`);
40
+ console.error(` Remove it (rm "${dest}") and re-run.`);
41
+ process.exit(1);
42
+ }
43
+ } catch {
44
+ // Not a symlink, or unreadable — proceed.
45
+ }
46
+ }
47
+
48
+ mkdirSync(dest, { recursive: true });
49
+ const target = join(dest, SKILL_NAME);
50
+
51
+ if (existsSync(target) || isSymlink(target)) {
52
+ try { rmSync(target, { recursive: true, force: true }); } catch {}
53
+ }
54
+
55
+ try {
56
+ symlinkSync(SKILL_SRC, target);
57
+ console.log(`linked ${SKILL_NAME} -> ${SKILL_SRC} (${dest})`);
58
+ } catch (err) {
59
+ console.error(`warn: could not link into ${dest}: ${err.message}`);
60
+ }
61
+ }
62
+ }
63
+
64
+ function isSymlink(p) {
65
+ try { readlinkSync(p); return true; } catch { return false; }
66
+ }
67
+
68
+ function update() {
69
+ console.log(`Updating ${PKG}...`);
70
+ try {
71
+ execSync(`npm install -g ${PKG}@latest`, { stdio: "inherit" });
72
+ console.log(`✅ ${PKG} updated.`);
73
+ } catch (err) {
74
+ console.error(`❌ npm install failed: ${err.message}`);
75
+ process.exit(1);
76
+ }
77
+ }
78
+
79
+ const cmd = process.argv[2];
80
+
81
+ switch (cmd) {
82
+ case "install":
83
+ case "link":
84
+ linkSkill();
85
+ break;
86
+ case "update":
87
+ update();
88
+ break;
89
+ case undefined:
90
+ case "help":
91
+ case "--help":
92
+ case "-h":
93
+ console.log(`kernel-prompt — install or update the kernel-prompt skill
94
+
95
+ usage:
96
+ kernel-prompt install symlink the skill into ~/.claude/skills and ~/.agents/skills
97
+ kernel-prompt update pull the latest version via npm
98
+ kernel-prompt help show this help
99
+ `);
100
+ break;
101
+ default:
102
+ console.error(`unknown command: ${cmd}`);
103
+ console.error("run `kernel-prompt help` for usage.");
104
+ process.exit(2);
105
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@codegiveness/kernel-prompt",
3
+ "version": "0.1.0",
4
+ "description": "Kernel — a prompt stripped to what works. Six cuts that turn a vague request into a prompt that lands on first try.",
5
+ "license": "MIT",
6
+ "author": "codegiveness",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/codegiveness/kernel-prompt.git"
10
+ },
11
+ "homepage": "https://github.com/codegiveness/kernel-prompt",
12
+ "bugs": {
13
+ "url": "https://github.com/codegiveness/kernel-prompt/issues"
14
+ },
15
+ "keywords": [
16
+ "prompt-engineering",
17
+ "kernel",
18
+ "prompt",
19
+ "skill",
20
+ "agent",
21
+ "claude-code",
22
+ "opencode",
23
+ "codex",
24
+ "refinement"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "registry": "https://registry.npmjs.org/"
29
+ },
30
+ "bin": {
31
+ "kernel-prompt": "bin/kernel-prompt.mjs"
32
+ },
33
+ "files": [
34
+ "skills/",
35
+ "bin/",
36
+ "README.md",
37
+ "LICENSE",
38
+ "CHANGELOG.md"
39
+ ],
40
+ "scripts": {
41
+ "changeset": "changeset",
42
+ "version": "changeset version"
43
+ },
44
+ "devDependencies": {
45
+ "@changesets/changelog-github": "^0.7.0",
46
+ "@changesets/cli": "^2.30.0"
47
+ },
48
+ "packageManager": "npm@10.9.4"
49
+ }
@@ -0,0 +1,82 @@
1
+ # Worked example
2
+
3
+ Disclosed reference for [`kernel-prompt`](SKILL.md). A full pass: grounding, combining a multi-goal request into one prompt, the six-letter pass, and the exhaustive vague-phrasing sweep with per-clause verdicts.
4
+
5
+ ## Input (vague, multi-goal request)
6
+
7
+ > Our auth service has a token refresh bug — users get logged out. Fix it, add a test that catches the regression, and update the runbook so on-call knows what to do.
8
+
9
+ ## Grounding
10
+
11
+ Input references "auth service," "token refresh," and "runbook" — all vague. Explored the codebase and pinned each to a concrete symbol:
12
+
13
+ - "token refresh bug" → `refreshToken` (src/auth/tokens.ts:42)
14
+ - "users get logged out" → `TokenStore` (src/auth/store.ts:15) drops sessions on refresh failure
15
+ - "runbook" → `docs/runbooks/auth.md`
16
+
17
+ ## Combining vs. chaining
18
+
19
+ Three sub-goals: fix, test, docs. Test whether they combine:
20
+ - Feed linearly? Yes — fix first, then test the fix, then document the fix.
21
+ - Share context + constraints + verify? Yes — same auth module, same bug.
22
+ - One deliverable? Yes — one PR (code + test + doc update).
23
+
24
+ → Combine into one prompt.
25
+
26
+ ## The KERNEL pass
27
+
28
+ **K — Keep it simple.**
29
+ - _Before:_ "Fix the token refresh bug, add a regression test, update the runbook"
30
+ - _After:_ "Fix the token refresh bug in `refreshToken` (src/auth/tokens.ts:42), add a test that reproduces the bug before the fix, and update `docs/runbooks/auth.md` with the symptom and resolution."
31
+
32
+ **E — Easy to verify.**
33
+ - _Before:_ (none)
34
+ - _After:_ "Test fails before the fix, passes after. Runbook entry has Symptom, Cause, Fix, Verification sections."
35
+
36
+ **R — Reproducible.**
37
+ - _unchanged_ — no temporal references in the input.
38
+
39
+ **N — Narrow scope.**
40
+ - _unchanged_ — combined into one deliverable (one PR). Sub-goals feed linearly and share context.
41
+
42
+ **E — Explicit constraints.**
43
+ - _Before:_ (none)
44
+ - _After:_ "TypeScript strict, no `as any`. Test via `bun test`. Runbook update under 200 words per section."
45
+
46
+ **L — Logical structure.**
47
+ - _Before:_ one sentence
48
+ - _After:_ one paragraph carrying context, task, constraints, format, and verify as flowing prose (below)
49
+
50
+ ## Drafted prompt (before sweep)
51
+
52
+ ```
53
+ `refreshToken` (src/auth/tokens.ts:42) drops sessions on token refresh, breaking `TokenStore` (src/auth/store.ts:15); patch it so refresh stops dropping sessions, add a `bun test` regression that fails before the fix and passes after, and update `docs/runbooks/auth.md` with Symptom, Cause, Fix, and Verification sections (under 200 words each), shipping as one PR — TypeScript strict, no `as any`.
54
+ ```
55
+
56
+ ## Vague-phrasing sweep
57
+
58
+ Numbered list, one row per content clause, every clause in the paragraph:
59
+
60
+ 1. "`refreshToken` (src/auth/tokens.ts:42) drops sessions on token refresh" — same file, same bug. **Passes.**
61
+ 2. "breaking `TokenStore` (src/auth/store.ts:15)" — same file, same role. **Passes.**
62
+ 3. "patch it so refresh stops dropping sessions" — two readers would diverge: one patches the specific line, another redesigns the refresh flow. **Fails** — applying **Name the operation**: "patch `refreshToken` so it stops dropping sessions on refresh failure."
63
+ 4. "add a `bun test` regression that fails before the fix and passes after" — same operation, same tool, checkable criterion. **Passes.**
64
+ 5. "update `docs/runbooks/auth.md` with Symptom, Cause, Fix, and Verification sections (under 200 words each)" — same file, same scope, concrete limit. **Passes.**
65
+ 6. "shipping as one PR — TypeScript strict, no `as any`" — same deliverable shape, same constraints. **Passes.**
66
+
67
+ One clause reformulated (clause 3). Re-sweep the replacement: "patch `refreshToken` so it stops dropping sessions on refresh failure" — two readers would both modify `refreshToken` with the same target behavior (no session drop). Same kind (code patch), same coverage (the specific function). **Passes.**
68
+
69
+ ## Final kernel'd prompt (after sweep)
70
+
71
+ ```
72
+ `refreshToken` (src/auth/tokens.ts:42) drops sessions on token refresh, breaking `TokenStore` (src/auth/store.ts:15); patch `refreshToken` so it stops dropping sessions on refresh failure, add a `bun test` regression that fails before the fix and passes after, and update `docs/runbooks/auth.md` with Symptom, Cause, Fix, and Verification sections (under 200 words each), shipping as one PR — TypeScript strict, no `as any`.
73
+ ```
74
+
75
+ ## Completion check
76
+
77
+ 1. Every content clause in the paragraph passes the two-reader test, presented as a numbered list with per-clause verdict. One failure reformulated with pattern named. ✓
78
+ 2. All six letters have before/after or unchanged with cited reason. ✓
79
+ 3. Final prompt matches the L-letter form (one paragraph, all five substances present). ✓
80
+ 4. Final paragraph re-swept — no vague terms introduced. ✓
81
+
82
+ Pass complete.
@@ -0,0 +1,38 @@
1
+ # Reformulations
2
+
3
+ Disclosed reference for [`kernel-prompt`](SKILL.md). When a content clause fails the two-reader test, apply one of the seven patterns below. The table shows concrete examples of each pattern in action.
4
+
5
+ ## Patterns
6
+
7
+ - **Assign a role** — name who is speaking or acting ("Act as a [specific role]")
8
+ - **Name the lens** — specify the analytical frame ("Analyze through psychology, strategy, positioning")
9
+ - **Set a concrete count** — replace "some" or "a few" with a number ("3 sentences", "5 ideas")
10
+ - **Specify the audience** — name who the output is for ("for someone who already knows the basics")
11
+ - **Name the operation** — replace a vague verb, modifier, or noun with the specific action ("Break this down", "Challenge this idea")
12
+ - **Anchor to a real objection** — ground persuasion in a specific counterargument ("using this real objection: [X]")
13
+ - **Add a structural constraint** — require a hook, format, or preservation rule ("with a hook in line 1")
14
+
15
+ ## Examples
16
+
17
+ Each row shows a vague clause and its specific replacement. Rows marked † are marketing-specific examples that illustrate the pattern, not universal reformulations.
18
+
19
+ | Vague | Specific | Pattern |
20
+ |---|---|---|
21
+ | Explain it to me | Act as a [specific role] | Assign a role |
22
+ | Give me information about… | Analyze this through psychology, strategy, and positioning | Name the lens |
23
+ | What is it? | Analyze this through non-obvious angles — cost, risk, timing | Name the lens |
24
+ | Make me a summary | Summarize this through the lens of trade-offs and alternatives | Name the lens |
25
+ | Content ideas | Write it for someone who already knows the basics | Specify the audience |
26
+ | Strategies for… | Break this concept down | Name the operation |
27
+ | Tips for… | Challenge this idea | Name the operation |
28
+ | Examples | Give me 3 examples with the pattern explained | Set a concrete count |
29
+ | Benefits of… | Analyze the benefits through the lens of trade-offs and alternatives | Name the lens |
30
+ | Make me more professional † | Make sure my client understands it in 5 seconds | Add a structural constraint |
31
+ | Improve it | Score this against 3 named criteria: [your criteria] | Set a concrete count |
32
+ | Make it shorter | Summarize it in 3 sentences without losing the main point | Set a concrete count |
33
+ | Make it sound natural | Write it the way I speak, without jargon | Name the operation |
34
+ | Write a post about… † | Write a post for [client] with a hook in line 1 | Specify the audience |
35
+ | I need content ideas † | Give me 5 Reel ideas with the hook and format | Set a concrete count |
36
+ | Fix this | Fix spelling and rhythm without changing my style | Name the operation |
37
+ | Make it more persuasive | Rewrite this to overcome this real objection: [X] | Anchor to a real objection |
38
+ | Write me a caption † | Give me 3 versions and tell me which one you recommend | Set a concrete count |
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: kernel-prompt
3
+ description: Kernel a prompt — refine or compose it into one paragraph that lands on first try. Use when the user wants to refine or compose a prompt. Other skills reach this when they need a kernel'd prompt as input.
4
+ ---
5
+
6
+ A **kernel** is a prompt stripped to what works. This skill runs the KERNEL pass — six cuts that turn a vague request into a prompt that lands on first try.
7
+
8
+ ## Branches
9
+
10
+ Two branches, same six letters, different input material:
11
+ - **Refine** — input is an existing prompt. The "before" for each letter is that prompt's current state.
12
+ - **Compose** — input is a task description. The "before" for each letter is what the task description provides for that letter; if it provides nothing, record _absent_ as the before.
13
+
14
+ ## Grounding
15
+
16
+ Before the pass, pin vague input terms to concrete symbols. When the input references a codebase, system, or API, explore it first (read files, query the index) and record a short grounding inventory: each vague term → the concrete symbol, file, or field it maps to. The pass writes the paragraph against this grounded vocabulary, not the user's original phrasing. Skip grounding only when the input is fully self-contained.
17
+
18
+ ## Combining vs. chaining
19
+
20
+ When the input spans multiple sub-goals, the default is to **combine** them into one prompt. Combine when the sub-goals:
21
+ - Feed linearly (output of one is input to the next, in order).
22
+ - Share the same context, constraints, and verify criteria.
23
+ - Produce one deliverable (one document, one script, one spec).
24
+
25
+ Split into a chain only when sub-goals produce different output types (a script vs. a doc) or need independent execution with different constraints. See [Chaining](#chaining).
26
+
27
+ ## The KERNEL pass
28
+
29
+ Run each letter in order. For each, produce a before/after note, or mark _unchanged_ with a reason that cites what's already in the prompt satisfying that letter (e.g., "unchanged — goal already stated as single sentence in line 1").
30
+
31
+ **K — Keep it simple.** Strip to one clear goal. Cut context that doesn't serve it. If no goal is recoverable from the input, ask the user for one before continuing — do not invent one. This is the one legitimate pause point in the pass.
32
+ - _Before:_ "I need help writing something about Redis"
33
+ - _After:_ "Write a technical tutorial on Redis caching"
34
+
35
+ **E — Easy to verify.** Attach a checkable success criterion. "Engaging" is not checkable; "3 code examples" is. If you can't verify success, the prompt can't deliver it.
36
+
37
+ **R — Reproducible.** Remove temporal references ("current trends", "latest best practices"). Pin specific versions and exact requirements. The prompt should work next month.
38
+
39
+ **N — Narrow scope.** One prompt, one deliverable. If the request genuinely cannot combine (see [Combining vs. chaining](#combining-vs-chaining)), split — see [Chaining](#chaining).
40
+
41
+ **E — Explicit constraints.** List the exact scope: allowed libraries, max function length, output type, target audience. Keep a prohibition only as a hard guardrail you cannot phrase positively, and pair it with the positive target.
42
+ - _Before:_ "Python code"
43
+ - _After:_ "Python stdlib only; functions under 20 lines; output to stdout"
44
+
45
+ **L — Logical structure.** Weave the prompt into **one paragraph** of prose carrying all five substances — context, task, constraints, format, verify — as flowing sentences joined by connectors (`;`, `,`, `and`).
46
+ - _Before:_ scattered labeled lines — `Context: …` / `Task: …` / `Constraints: …`
47
+ - _After:_ one paragraph — e.g. "`refreshToken` (src/auth/tokens.ts:42) drops sessions on refresh; patch it, add a failing-then-passing `bun test`, and update `docs/runbooks/auth.md` — TypeScript strict, no `as any`, one PR."
48
+
49
+ ## Vague-phrasing sweep
50
+
51
+ After the six letters, present the sweep as a numbered list — one row per content clause across the paragraph (the same five substances, now as sentences), every clause, not a representative sample. Each row states the clause and a pass/fail verdict. Apply the two-reader test per clause: would two different readers produce outputs matching in type and scope? "Matching" means same output kind (both produce a Python script, not one script and one prose) and same coverage (both cover the same scope, not one comprehensive and one partial). It does not mean byte-identical implementations.
52
+
53
+ For each failing row, replace the vague clause using a pattern from [`REFORMULATIONS.md`](REFORMULATIONS.md), and name the pattern in the row: "Fails — applying **[Pattern Name]**: [replacement]". No silent reformulation.
54
+
55
+ If no clause fails, state "No reformulations needed" — this is the common outcome when the paragraph is well-constructed and the input was grounded.
56
+
57
+ ## Completion
58
+
59
+ The pass is done when all four hold:
60
+ 1. Every content clause in the paragraph passes the two-reader test, presented as a numbered list with a per-clause verdict. Each failing clause names the REFORMULATIONS.md pattern applied.
61
+ 2. All six letters have a before/after note or _unchanged_ with a cited reason.
62
+ 3. The final prompt matches the L-letter form (one paragraph, all five substances present).
63
+ 4. The final paragraph passes its own two-reader sweep (re-swept after reformulation) — no vague verbs, vague nouns, or unscoped counts introduced in the output.
64
+
65
+ ## Chaining
66
+
67
+ Split a task into a chain only when combining fails the test in [Combining vs. chaining](#combining-vs-chaining). Each prompt in the chain gets its own KERNEL pass.
68
+
69
+ Chain format: numbered list of prompts, each noting its dependency on the prior (`1. → 2. (feeds output of 1) → 3. (feeds output of 2)`).
70
+
71
+ Re-pass rule: treat each prior prompt's output as input to the next. Re-run the vague-phrasing sweep on your own output before passing it forward — do not propagate vague terms across the chain.
72
+
73
+ ## Worked example
74
+
75
+ See [`EXAMPLE.md`](EXAMPLE.md) for a full pass: grounding, combining a multi-goal request into one prompt, the six-letter pass, and the exhaustive vague-phrasing sweep with per-clause verdicts.