dev-workflow
REQUIRED workflow for all code changes. MUST load FIRST before planning or implementing features, bugs, refactoring, tests, PRs. Covers full cycle from exploration to pull request. Skip only for: one-off scripts, explanations outside project context.
When & Why to Use This Skill
This Claude skill provides a comprehensive engineering playbook for the full software development lifecycle (SDLC). It establishes a mandatory, phase-based workflow for all code changes—covering exploration, design, implementation, and pull requests. By enforcing 'Design-before-Code' and Test-Driven Development (TDD) principles, it ensures high-quality, maintainable codebases while streamlining collaboration for both human developers and AI agents.
Use Cases
- Standardizing the end-to-end development process for engineering teams to ensure consistent code quality and documentation.
- Implementing a 'Design-before-Code' approach where test cases are defined and verified before any feature implementation.
- Managing systematic bug fixes through a rigorous reproduction, failing test, and minimal fix cycle to prevent regressions.
- Coordinating parallel development tasks across multiple AI agents using isolated worktrees and standardized branch management strategies.
| name | dev-workflow |
|---|---|
| description | | |
| Development workflow for code changes. Load when | implementing features, fixing bugs, writing tests, refactoring, creating PRs, reviewing code. Covers exploration → design → implementation → commit → PR cycle. Keywords: feature, bug, fix, test, refactor, PR, pull request, commit, code review, implement, develop, build. |
| version | "2.0.0" |
Dev Workflow
Engineering standards for code changes. Follow these phases in order.
Core Principles
- Code is truth — Read code first; docs may be outdated
- Design before code — Write tests before implementation
- Tests are design — Tests define behavior, not just verify it
- Minimal blast radius — Touch only necessary files
Priority Stack
Security → Correctness → Data Integrity → Availability → Performance → Docs → Speed
Phase 1: Exploration
Do this FIRST before any planning or coding.
Required Steps
- Create branch:
git checkout -b feature/<name>orfix/<name> - Read relevant code — Understand patterns, find insertion points
- Check if already exists — Search for similar implementations
- Verify docs ↔ code sync — If drift found, fix docs first
Exploration Order
| Step | What to Find |
|---|---|
| 1 | Entry points: main.py, index.ts, main.go |
| 2 | Routes/API handlers |
| 3 | Config files |
| 4 | Related modules (follow imports) |
| 5 | Existing tests |
→ More details: references/exploration.md
Full exploration checklist, doc sync table, branch strategy.Phase 2: Design
STOP. Do not write implementation code until tests are written.
Required Steps
- Define behavior: What does it do? Input → Output?
- Identify test cases:
- Happy path (normal success flow)
- Edge cases (empty, max, concurrent)
- Error cases (what should fail?)
- Write tests FIRST — Tests must fail before implementation exists
Minimum Tests by Change Type
| Change Type | Required Tests |
|---|---|
| New feature | Happy path + edge cases + error handling |
| Bug fix | Reproduces bug + regression guard |
| Refactor | Existing tests must pass; add if coverage insufficient |
Rule: If you can't write a test, you don't understand the requirement yet.
→ More details: references/design.md
Design checklist, test case questions, refactor test requirements.Phase 2-B: Bug Fix (Alternative to Phase 2)
STOP. Do not touch code until you can reproduce the bug.
Required Steps
- Reproduce — Confirm bug exists; if cannot reproduce, ask for more info
- Write failing test — The test IS your bug report
- Understand root cause — Why it fails, not just where
- Fix minimally — Smallest change that makes test pass
- Verify — Failing test passes; full suite passes
When Fix Attempt Fails
| Signal | Action |
|---|---|
| Test passes but bug persists | You're testing wrong thing → get real user data |
| Fix works but breaks something | Patching symptoms → find actual root cause |
| Adding more edge cases | Approach flawed → consider architecture change |
Rule: When a fix fails, don't patch it. Re-examine assumptions.
→ More details: references/bugfix.md
Multi-round debugging guidance, what data to request, architecture checks.Phase 3: Implementation
Prerequisite: Tests are written and failing.
Required Steps
- Run failing tests — Confirm they fail for expected reason
- Write minimal code — Just enough to make tests pass
- Run tests again — Confirm they pass
- Refactor if needed — Tests must still pass
Code Standards
- Type annotations on function signatures
- Small, testable functions
- Explicit error handling (no silent
except:) - No secrets in code — use env vars
Rule: If tests don't pass, don't move forward.
→ More details: references/implementation.md
Handling flaky tests, LLM/API usage, dependency management.Phase 4: Pre-Commit
Complete ALL steps before
git commit.
Required Checklist
[ ] All tests pass
[ ] CHANGELOG.md updated (if user-facing change)
[ ] README.md updated (if CLI/config changed)
[ ] No debug code (console.log, print, commented code)
[ ] No secrets in code
CHANGELOG Sections
| Change Type | Section |
|---|---|
| New feature | ### Added |
| Bug fix | ### Fixed |
| Breaking change | ### Changed |
Commit Format
type(scope): summary
Types: feat | fix | docs | test | chore | refactor
git commit -m "feat(auth): add OAuth2 support"
git commit -m "fix(parser): handle empty input"
→ More details: references/precommit.md
Full doc sync table, task status updates.Phase 5: Pull Request
Prerequisite: Pre-commit checklist complete.
PR Guidelines
- One PR = One concern — Don't mix features, fixes, refactors
- Small PRs — Aim for <400 lines; split large changes
- Complete — Code + Tests + Docs in same PR
PR Description
## What
Brief description.
## Why
Link to issue or explain motivation.
Closes #123 <!-- if applicable -->
## Testing
- [ ] Unit tests added/updated
- [ ] Manual testing (if applicable)
Self-Review Before Submit
- Read your own diff
- Remove debug code
- Check for secrets
- Verify CI passes
→ More details: references/pullrequest.md
Responding to feedback, merge strategies, GitHub issue linking.Code Review (for reviewers)
Review Checklist
| Priority | Check |
|---|---|
| 1. Security | No secrets, input validation |
| 2. Correctness | Logic matches intent, edge cases handled |
| 3. Tests | Tests exist for changes, CI green |
| 4. Docs | CHANGELOG/README updated |
Feedback Severity
| Severity | Action |
|---|---|
| Security/Logic error | Block merge |
| Missing tests/docs | Block merge |
| Style/naming | Comment as nit; don't block |
→ More details: references/review.md
Feedback format examples, PR size guidance.Refactoring
Refactor = change structure, NOT behavior.
Before Refactoring
Ask: "If I break something, will existing tests catch it?"
| Answer | Action |
|---|---|
| Yes | Proceed |
| No / Unsure | Add tests first |
Rule: No test coverage confidence = no permission to refactor.
→ More details: references/refactoring.md
State isolation, config handling, graceful termination.Multi-Agent Collaboration
When multiple agents work in parallel:
# Each agent uses isolated worktree
git worktree add ../project-<role> <branch>
| Role | Workflow |
|---|---|
| Planning | Exploration → define scope |
| Implementation | Exploration → Design → Implementation → Commit → PR |
| Bug fix | Exploration → Bug Fix → Commit → PR |
| Review | Review checklist |
Rule: Each agent still follows full workflow for their role.
→ More details: references/multi-agent.md
Worktree naming, branch strategy, merge flow.Quick Reference
Typical Flows
Feature: Exploration → Design → Implementation → Pre-Commit → PR
Bug Fix: Exploration → Bug Fix → Pre-Commit → PR
Refactor: Exploration → (verify test coverage) → Design → Implementation → Pre-Commit → PR
Task Status (if project uses tracking)
Pending → In Progress → In Review → Done
Roadmap format: | ID | Priority | Item | Status | GH |