write-code

Implements code changes in isolated git worktrees with incremental commits and quality-gate enforcement.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/mikestopcontinues/agent-skills --skill write-code-mikestopcontinues
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-code
Source: https://github.com/mikestopcontinues/agent-skills/tree/main/claude/skills/write-code
Command: npx skills add https://github.com/mikestopcontinues/agent-skills --skill write-code-mikestopcontinues

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes made directly on main branches or without quality checks lead to broken builds and tangled commits. This Skill enforces a disciplined workflow where every bug fix, refactor, or feature increment happens in an isolated git worktree, lands as atomic commits, and passes the pnpm run check quality gate before each commit. ## Core Features & Use Cases - Worktree Isolation: Refuses edits on main/master and creates a named worktree-<name> branch so changes never touch the primary branch. - Atomic Incremental Commits: Breaks work into tasks where each commit leaves the repo in a passing state, staging only specific files. - Quality-Gate Enforcement: Runs pnpm run check before every commit and provides a recovery procedure when the pre-commit gate denies a commit. - Use Case: When dispatched by execute-plan to implement one phase of a larger plan, this Skill sets up the worktree, implements the phase with tests, commits incrementally, and returns a summary of commits and files touched. ## Quick Start Ask the agent to fix a bug or implement a feature using the write-code skill so the work happens in an isolated worktree with gated commits.

Frequently Asked Questions about write-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make code changes in an isolated git worktree?▼

Create a worktree with `git worktree add .claude/worktrees/worktree-<name> -b worktree-<name>`, cd into it, and run pnpm install. All edits and commits then happen on the worktree branch, leaving main untouched.

How to enforce a quality gate before every git commit?▼

Run `pnpm run check` locally before staging, and rely on the pre-commit-gate hook to run it again at commit time. If the gate fails, fix the root cause, re-stage the files, and create a new commit rather than amending.

Can I commit code directly on the main or master branch?▼

No. The skill stops immediately if the current branch is main or master, and the block-main-edits hook denies such commits. You must create or enter a worktree whose branch name starts with `worktree-` before editing.

What should I do when the pre-commit quality gate fails?▼

Read the failure output, fix the root cause in the working tree, re-stage the specific files, and create a new commit. Do not use `git commit --amend` or bypass with `--no-verify` unless the captain explicitly authorizes it.

When should code changes be escalated instead of implemented?▼

Escalate to the captain when a change modifies a public index.ts export consumed by other modules, or when a quality-gate failure comes from pre-existing breakage unrelated to your change.