
deep-work
Structured development workflow that separates research, planning, and implementation into distinct phases with persistent markdown artifacts. Use when starting any non-trivial feature, refactor, bug investigation, or codebase change. Trigger on: "deep work", "research and plan", "plan before coding", "write a plan", "research this codebase", "don't code yet", "understand then implement", or when the user wants a disciplined approach to a complex task. Also use when the user says "research", "plan", "annotate", "implement the plan", or references research.md/plan.md artifacts.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/petekp/agent-skills --skill deep-work- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads deep-work automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Deep Work
Structured workflow that separates thinking from typing. Never write code until a written plan has been reviewed and approved.
Workflow Overview
Research → Plan → Annotate (repeat 1-6x) → Todo List → Implement → Feedback
All artifacts persist as markdown files in .claude/ (not the project root).
Phase 1: Research
Deeply read the relevant codebase before doing anything else. Write findings to .claude/research.md.
How to research:
- Read every file in the target area — not just signatures, but implementations, edge cases, error handling
- Trace data flows end-to-end
- Identify existing patterns, conventions, utilities, and caching layers
- Note integration points with other parts of the system
- Write a detailed report to
.claude/research.md
Research depth signals: Read deeply. Understand intricacies. Go through everything. Surface-level reading is not acceptable. Continue until you have a thorough understanding.
Template: See references/research-template.md for the research document structure.
Critical rule: Stop after writing research.md. Do not proceed to planning until the user has reviewed the research and confirmed it's accurate.
Phase 2: Plan
Write a detailed implementation plan to .claude/plan.md. Base the plan on the actual codebase — read source files before suggesting changes.
Plan contents:
- Explanation of the approach and rationale
- Code snippets showing actual changes (not pseudocode)
- File paths that will be modified or created
- Considerations and trade-offs
- Things explicitly not being changed and why
Template: See references/plan-template.md for the plan document structure.
Reference implementations: If the user provides reference code from other projects, study it and adapt the approach to fit the current codebase's patterns.
Critical rule: End the plan with "Ready for your review. Add inline notes directly to .claude/plan.md and tell me when to address them." Do not implement.
Phase 3: Annotation Cycle
The user adds inline notes directly into plan.md. When they say "address my notes" or similar:
- Read
.claude/plan.mdthoroughly, finding all user annotations - User annotations are any text that wasn't in your original plan — look for corrections, questions, overrides, and constraints
- Address every single annotation: update sections, remove rejected approaches, incorporate domain knowledge
- Remove the annotation text itself after addressing it (keep the plan clean)
- End with: "All notes addressed. Review again or say 'add the todo list' when satisfied."
Critical rule: Do not implement. The phrase "don't implement yet" is a hard constraint. Repeat the annotation cycle until the user explicitly approves.
Phase 4: Todo List
When the user approves the plan, add a granular task checklist to .claude/plan.md:
## Tasks
### Phase 1: [Phase Name]
- [ ] Task 1 — specific, actionable description
- [ ] Task 2 — specific, actionable description
### Phase 2: [Phase Name]
- [ ] Task 3 — specific, actionable description
- [ ] Task 4 — specific, actionable description
Each task should be small enough to complete in one focused step. Include all phases needed to fully implement the plan.
Critical rule: Do not implement yet. Wait for user confirmation to begin.
Phase 5: Implementation
When the user says "implement" or "go":
- Execute every task in the plan sequentially
- After completing each task, update
.claude/plan.md— change- [ ]to- [x] - Do not stop until all tasks are completed
- Run the project's type checker / linter after each phase to catch issues early
- Do not add unnecessary comments, docstrings, or type workarounds (
any,unknown)
Code quality rules during implementation:
- No unnecessary comments or jsdocs
- No
anyorunknowntypes (TypeScript projects) - Run typecheck/lint continuously
- Follow existing codebase patterns exactly
Phase 6: Feedback
During implementation, the user may provide terse corrections. These are sufficient because full context exists in the plan and session:
- "You missed the dedup function" → implement what was missed
- "Move this to the admin app" → relocate as directed
- "Wider" / "2px gap" / "still cropped" → adjust and re-check
- "Make it look like the users table" → read that reference, match it exactly
On reverts: If the user says "I reverted everything" — re-read the current file state, narrow scope to exactly what they specify, and re-implement cleanly.
Prompt Reference
See references/prompts.md for ready-to-use prompts for each phase that the user can copy and adapt.
FAQ
What does the deep-work skill do?
Structured development workflow that separates research, planning, and implementation into distinct phases with persistent markdown artifacts. Use when starting any non-trivial feature, refactor, bug investigation, or codebase change. Trigger on: "deep work", "research and plan", "plan before coding", "write a plan", "research this codebase", "don't code yet", "understand then implement", or when the user wants a disciplined approach to a complex task. Also use when the user says "research", "plan", "annotate", "implement the plan", or references research.md/plan.md artifacts.
How do I install deep-work?
Run npx skills add https://github.com/petekp/agent-skills --skill deep-work in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/deep-work/ (personal) or .claude/skills/deep-work/ (project).
Which AI agents can use deep-work?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is deep-work safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains deep-work?
It is published by petekp in petekp/agent-skills. It has 41 recorded installs.
More from petekp/agent-skills
typography
petekp/agent-skills
Apply professional typography principles to create readable, hierarchical, and aesthetically refined interfaces. Use when setting type scales, choosing fonts, adjusting spacing, designing text-heavy layouts, implementing dark mode typography, or when asked about readability, font pairing, line height, measure, typographic hierarchy, variable fonts, font loading, or OpenType features.
macos-app-design
petekp/agent-skills
Open the skill to read its SKILL.md instructions.
optimize-agent-docs
petekp/agent-skills
Build a retrieval-optimized knowledge layer over agent documentation in dotfiles (.claude, .codex, .cursor, .aider). Use when asked to "optimize docs", "improve agent knowledge", "make docs more efficient", or when documentation has accumulated and retrieval feels inefficient. Generates a manifest mapping task-contexts to knowledge chunks, optimizes information density, and creates compiled artifacts for efficient agent consumption.
codebase-study-guide
petekp/agent-skills
Generate a pedagogically-grounded study guide for learning an unfamiliar codebase. Use when the user wants to onboard onto a codebase, understand a project's architecture, create learning materials for a team, or asks things like "help me learn this codebase", "create an onboarding guide", "I'm new to this project", "how does this system work", "study guide for this repo", or "explain this codebase to me". Produces a structured document that builds understanding from purpose to systems to patterns, using evidence-based learning techniques (elaborative interrogation, concept mapping, threshold concepts, worked examples, progressive disclosure).
unix-macos-engineer
petekp/agent-skills
Open the skill to read its SKILL.md instructions.
explainer-visuals
petekp/agent-skills
Create high-quality animated explainer visuals for essays and blog posts. Use when the user wants to visualize concepts, processes, data, or ideas with interactive web animations. Triggers on requests like "create a visual for", "animate this concept", "make an explainer", "visualize this idea", "diagram this process", "show this data", or when essay content would benefit from visual explanation. Handles abstract concepts (mental models, frameworks), technical processes (algorithms, systems), and data visualization (trends, comparisons). Outputs self-contained HTML/CSS/JS that embeds directly in web content.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.