When you identify a change that needs to happen in the immutable kernel (bin/lazar or src/), you cannot apply it yourself — sandbox-exec blocks writes there, and chflags uchg blocks them at the OS level too. Instead, stage a complete proposal in workspace/ that the user can review and apply with one command.
When to use
You found a bug in the kernel (e.g. error path doesn't emit structured output, missing flag, incorrect timeout).
You need a new kernel feature (e.g. a new CLI flag, a new event type in the stream).
You want to update a seed skill (those are baked into the binary at compile time).
You can articulate the patch precisely and it's small enough to review.
Do NOT use this for things that should be skills. The kernel does ONE thing — runs bash + records events. Adding behavior to skills is always preferred.
How to use
Pick a short kebab-case slug for the proposal (e.g. http-error-emit, add-resume-flag).
Apply your changes inside $LAZAR_HOME/workspace/proposals/<slug>/src/:
# edit src/src/main.rs, src/sandbox.sb, src/seed-skills/<...> as needed
Write a README explaining what changed and why:
cat > $LAZAR_HOME/workspace/proposals/<slug>/README.md <<'EOF'
# <slug>
## Summary
<one paragraph: what the change does>
## Why
<observed problem or new capability needed>
## Files changed
- src/src/main.rs (lines ~X-Y): <what>
- src/seed-skills/...: <what>
## Risk
<what could break, what to test after applying>
EOF
Tell the user:
I've staged a kernel patch at $LAZAR_HOME/workspace/proposals/<slug>/.
Review with: diff -u --recursive $LAZAR_HOME/src $LAZAR_HOME/workspace/proposals/<slug>/src
Apply with: bash $LAZAR_HOME/scripts/kernel-apply.sh <slug>
Principles
Never partial. Always stage the FULL src/ tree. kernel-apply.sh does a directory copy; if you only stage main.rs, the rebuild gets your main.rs but loses any other changes you didn't realize were paired.
Always include a README. A patch you can't explain isn't a patch worth applying.
Keep proposals small. Big rewrites should be split. The user has to read every line of the diff.
Prefer skills over kernel changes. If you can express the fix as a skill, do that instead — no upgrade ceremony required.
Record the proposal in memory after the user applies it, so future-you knows what kernel features exist.
Anti-pattern
Do not "propose" by just describing the change in prose. Stage the full edited src/ tree. The user shouldn't have to re-derive your patch from your description.
1---2name: propose-kernel-patch3description: propose-kernel-patch4---5# propose-kernel-patch67When you identify a change that needs to happen in the immutable kernel (`bin/lazar` or `src/`), you cannot apply it yourself — sandbox-exec blocks writes there, and `chflags uchg` blocks them at the OS level too. **Instead, stage a complete proposal in workspace/ that the user can review and apply with one command.**89## When to use1011- You found a bug in the kernel (e.g. error path doesn't emit structured output, missing flag, incorrect timeout).12- You need a new kernel feature (e.g. a new CLI flag, a new event type in the stream).13- You want to update a seed skill (those are baked into the binary at compile time).14- You can articulate the patch precisely *and* it's small enough to review.1516Do NOT use this for things that should be skills. The kernel does ONE thing — runs bash + records events. Adding behavior to skills is always preferred.1718## How to use19201. Pick a short kebab-case slug for the proposal (e.g. `http-error-emit`, `add-resume-flag`).21222. Create the proposal directory:2324 mkdir -p $LAZAR_HOME/workspace/proposals/<slug>/src/src25 mkdir -p $LAZAR_HOME/workspace/proposals/<slug>/src/seed-skills26273. Copy the FULL current kernel as the starting point:2829 cp -R $LAZAR_HOME/src/. $LAZAR_HOME/workspace/proposals/<slug>/src/30314. Apply your changes inside `$LAZAR_HOME/workspace/proposals/<slug>/src/`:3233 # edit src/src/main.rs, src/sandbox.sb, src/seed-skills/<...> as needed34355. Write a README explaining what changed and why:3637 cat > $LAZAR_HOME/workspace/proposals/<slug>/README.md <<'EOF'38 # <slug>3940 ## Summary41 <one paragraph: what the change does>4243 ## Why44 <observed problem or new capability needed>4546 ## Files changed47 - src/src/main.rs (lines ~X-Y): <what>48 - src/seed-skills/...: <what>4950 ## Risk51 <what could break, what to test after applying>52 EOF53546. Tell the user:5556 I've staged a kernel patch at $LAZAR_HOME/workspace/proposals/<slug>/.57 Review with: diff -u --recursive $LAZAR_HOME/src $LAZAR_HOME/workspace/proposals/<slug>/src58 Apply with: bash $LAZAR_HOME/scripts/kernel-apply.sh <slug>5960## Principles6162- **Never partial.** Always stage the FULL src/ tree. `kernel-apply.sh` does a directory copy; if you only stage main.rs, the rebuild gets your main.rs but loses any other changes you didn't realize were paired.63- **Always include a README.** A patch you can't explain isn't a patch worth applying.64- **Keep proposals small.** Big rewrites should be split. The user has to read every line of the diff.65- **Prefer skills over kernel changes.** If you can express the fix as a skill, do that instead — no upgrade ceremony required.66- **Record the proposal in memory** after the user applies it, so future-you knows what kernel features exist.6768## Anti-pattern6970Do not "propose" by just describing the change in prose. Stage the full edited src/ tree. The user shouldn't have to re-derive your patch from your description.
Run npx skillmds@latest add jasonkneen/propose-kernel-patch in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
propose-kernel-patch It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
jasonkneen (@jasonkneen) published this skill. Their other Agent Skills are listed on their SkillMD profile.