A development workflow template for Claude Code that enforces end-to-end development processes through a hook system, ensuring AI agents follow TDD (Test-Driven Development) and code review best practices for feature development and bug fixes.
- Design First: Enforces design canvas creation before implementation
- Test-Driven Development (TDD): Enforces test case creation before writing code
- Code Simplification: Blocks commits until code-simplifier agent review is complete
- Code Review: Blocks pushes until pr-review agent review is complete
- CI Verification: Blocks task completion until CI passes
- E2E Testing: Enforces E2E test execution on Preview environment
.
βββ CLAUDE.md # Project config and workflow documentation
βββ .claude/
β βββ settings.json # Claude Code hooks configuration
β βββ hooks/ # Hook scripts
β β βββ lib.sh # Shared utility functions
β β βββ state-manager.sh # Workflow state management
β β βββ check-design-canvas.sh # Design canvas check
β β βββ check-test-plan.sh # Test plan check
β β βββ check-code-simplifier.sh # Code simplification check
β β βββ check-pr-review.sh # PR review check
β β βββ check-unit-tests.sh # Unit tests check
β β βββ warn-skip-verification.sh # --no-verify warning
β β βββ post-file-edit-reminder.sh # Post-edit reminder
β β βββ post-git-action-clear.sh # Git action state cleanup
β β βββ post-git-push.sh # Post-push verification reminder
β β βββ verify-completion.sh # Task completion verification
β βββ skills/ # Claude Code skills
β βββ github-workflow/ # GitHub development workflow skill
β βββ SKILL.md # Main skill definition (12-step workflow)
β βββ references/ # Reference documentation
β β βββ commit-conventions.md # Branch naming & commit standards
β β βββ review-commands.md # GitHub CLI & GraphQL commands
β βββ scripts/ # Utility scripts
β βββ reply-to-comments.sh # Reply to PR review comments
β βββ resolve-threads.sh # Batch resolve review threads
βββ docs/
β βββ designs/ # Design canvas documents
β βββ test-cases/ # Test case documents
β βββ templates/ # Document templates
β βββ design-canvas-template.md
β βββ test-case-template.md
βββ .github/ # (CI workflow needs manual setup)
# Using GitHub CLI
gh repo create my-project --template zxkane/claude-code-workflow
# Or manually clone
git clone https://github.com/zxkane/claude-code-workflow.git my-project
cd my-project
rm -rf .git
git init- Update CLAUDE.md: Modify project overview, tech stack, etc.
- Adjust hook scripts: Modify file matching patterns based on project needs
- Configure CI: Adjust GitHub Actions workflow based on project requirements
When using Claude Code for development, hooks will automatically enforce the workflow.
The github-workflow skill provides Claude Code with comprehensive guidance to follow the development workflow. Skills are automatically triggered by natural language prompts or can be invoked via slash commands.
Claude Code will automatically activate the github-workflow skill when you use these phrases:
| Category | Example Prompts |
|---|---|
| Design | "design a feature", "create UI mockup", "create design canvas" |
| PR Management | "create a PR", "push changes", "merge PR" |
| Code Review | "address review comments", "resolve review threads", "handle reviewer findings" |
| Bot Reviews | "/q review", "/codex review", "respond to Amazon Q", "respond to Codex" |
| CI/CD | "check CI status", "wait for checks to pass" |
You can also explicitly invoke the skill:
/github-workflow <action>
Examples:
/github-workflow check the review comments
/github-workflow create a PR for this feature
/github-workflow resolve all review threads
- Skill Detection: When you mention workflow-related tasks, Claude Code automatically loads the
github-workflowskill - Step-by-Step Guidance: The skill provides the 12-step workflow with detailed instructions
- Tool Integration: Uses Pencil MCP for design, GitHub MCP/CLI for PR management, Chrome DevTools for E2E testing
- Hook Enforcement: Pre/Post hooks validate each step is completed before proceeding
User: "I want to add a new feature for user authentication"
Claude Code will:
1. Load github-workflow skill automatically
2. Guide you through:
- Step 1: Create design canvas using Pencil tool
- Step 2: Write test cases (TDD)
- Step 3-4: Implementation + Unit tests
- Step 5-6: Code review agents (code-simplifier, pr-review)
- Step 7: Create PR and monitor CI
- Step 8-11: Handle reviewer bot comments
- Step 12: E2E verification
Step 1: Design Canvas (Pencil)
β
Step 2: Test Cases (TDD)
β
Step 3: Implementation
β
Step 4: Unit Tests Pass
β
Step 5: code-simplifier review β commit
β
Step 6: pr-review review β push
β
Step 7: Wait for CI to pass
β
Step 8: E2E Tests (Chrome DevTools)
β
β
Task Complete β Peer Review
| Hook | Trigger | Behavior |
|---|---|---|
| check-design-canvas | git commit | Reminds to create design docs |
| check-test-plan | Write/Edit new file | Reminds to create test plan |
| check-code-simplifier | git commit | Blocks unreviewed commits |
| check-pr-review | git push | Blocks unreviewed pushes |
| check-unit-tests | git commit | Reminds to run unit tests |
| warn-skip-verification | git --no-verify | Warns about skipping verification |
| Hook | Trigger | Behavior |
|---|---|---|
| post-git-action-clear | git commit/push success | Clears completed states |
| post-git-push | git push success | Reminds CI and E2E verification |
| post-file-edit-reminder | Write/Edit source code | Reminds to run tests |
| Hook | Trigger | Behavior |
|---|---|---|
| verify-completion | Task end | Blocks tasks without verification |
The workflow integrates with several MCP (Model Context Protocol) tools:
| Tool | Purpose | Workflow Step |
|---|---|---|
| Pencil MCP | Design canvas creation (.pen files) |
Step 1: Design |
| GitHub MCP | PR creation, review management | Steps 7-11: PR & Review |
| Chrome DevTools MCP | E2E testing on preview environments | Step 12: E2E Tests |
get_editor_state() # Check current .pen file status
open_document("path.pen") # Open existing or create new design
get_guidelines(topic) # Get design guidelines
get_style_guide(tags) # Get style inspiration
batch_design(operations) # Create design elements
get_screenshot() # Validate design visually
# Reply to a specific review comment
.claude/skills/github-workflow/scripts/reply-to-comments.sh <owner> <repo> <pr> <comment_id> "<message>"
# Resolve all unresolved review threads
.claude/skills/github-workflow/scripts/resolve-threads.sh <owner> <repo> <pr>Use state-manager.sh to manage workflow states:
# View current states
.claude/hooks/state-manager.sh list
# Mark action as complete
.claude/hooks/state-manager.sh mark design-canvas
.claude/hooks/state-manager.sh mark test-plan
.claude/hooks/state-manager.sh mark code-simplifier
.claude/hooks/state-manager.sh mark pr-review
.claude/hooks/state-manager.sh mark unit-tests
.claude/hooks/state-manager.sh mark e2e-tests
# Clear state
.claude/hooks/state-manager.sh clear <action>
.claude/hooks/state-manager.sh clear-allLocation: docs/templates/design-canvas-template.md
Includes:
- Problem statement
- Architecture design
- API design
- Data model
- UI design
- Security considerations
Location: docs/templates/test-case-template.md
Includes:
- Test scenario definitions
- Test steps
- Expected results
- Priority markers
- Acceptance criteria
Ensure these official Claude Code plugins are enabled:
code-simplifier@claude-plugins-official- Code simplification reviewpr-review-toolkit@claude-plugins-official- Comprehensive PR review
For full workflow support, configure these MCP servers:
| Server | Purpose | Configuration |
|---|---|---|
| Pencil | Design canvas creation | See Pencil MCP documentation |
| GitHub | PR and review management | gh auth login for CLI access |
| Chrome DevTools | E2E testing | Chrome with remote debugging enabled |
CI workflow needs to be added manually (see docs/github-actions-setup.md).
Default CI includes:
- Lint & Type Check
- Unit Tests (with coverage)
- Build
Optional:
- E2E Tests (Playwright)
- Deploy Preview
Note: Due to GitHub token permission restrictions, CI workflow files need to be added manually. See
docs/github-actions-setup.mdfor complete configuration instructions.
This template is based on the Claude Code memory and hook system implementation from VidSyllabus.
MIT License