Workflow Automation with Claude Code: Real-World Examples
Automate repetitive development tasks with Claude Code skills. Learn practical workflow automation with real examples you can implement today.
Automate repetitive development tasks with Claude Code skills. Learn practical workflow automation with real examples you can implement today.
Every developer has repetitive tasks they wish would just... disappear. The morning routine of checking PRs, updating dependencies, reviewing issues. The end-of-day ritual of committing, pushing, updating tickets.
Claude Code can automate these workflows. Not by replacing your judgment, but by handling the mechanical parts so you can focus on what matters.
This tutorial covers real-world workflow automation. Not toy examples—actual workflows used by development teams to save hours every week.
Good automation targets tasks that are:
Bad automation targets:
Manual ─────────────────────────────────────► Autonomous
│ │ │
│ │ │
Triggered Assisted Automatic
(you start it) (AI helps) (AI does it)
Most workflows fall in the middle—Claude helps but you stay in control.
Every morning, you need to:
This takes 15-30 minutes of context-switching.
Create a morning briefing skill that gathers everything in one place.
.claude/commands/morning.md:
---
description: Generate morning standup briefing
---
# Morning Standup Prep
When the user runs /morning, generate a comprehensive briefing for starting the day.
## Gather Information
### Git Status
1. Run `git status` to see local changes
2. Run `git log --oneline -5` to see recent commits
3. Check for unpushed commits
### GitHub PRs
1. List open PRs you authored: `gh pr list --author @me`
2. List PRs requesting your review: `gh pr list --search "review-requested:@me"`
3. For each, note: title, age, CI status, comments
### GitHub Issues
1. List assigned issues: `gh issue list --assignee @me`
2. List issues you're mentioned in: `gh issue list --search "mentions:@me"`
### CI/CD Status
1. Check recent workflow runs: `gh run list --limit 5`
2. Note any failures
## Generate Briefing
Format the output as:
Good morning! Here's your briefing for [DATE]:
## Additional Context
If there's a `.claude/project-context.md` file, incorporate any project-specific context (sprint goals, upcoming deadlines, etc.).
/morning
Time saved: 15-20 minutes every morning.
At day's end, you should:
But it's easy to forget steps when you're tired.
.claude/commands/eod.md:
---
description: End-of-day wrap-up routine
---
# End of Day Wrap-up
When the user runs /eod, help them wrap up their work day properly.
## Check Current State
1. Run `git status` to see uncommitted changes
2. Run `git stash list` to see any stashed work
3. Check what branch we're on
## Handle Uncommitted Work
If there are uncommitted changes:
### Option A: Changes are complete
- Help create a proper commit
- Push to remote
### Option B: Work in progress
- Create a WIP commit with clear message
- Example: "WIP: Dashboard component - filtering works, need to add sorting"
- Push to branch
### Option C: Changes should be stashed
- Stash with descriptive message
- Example: "WIP dashboard before switching to bugfix"
## Update Issues (if configured)
If the user has been working on a specific issue:
- Ask if they want to update the issue status
- Add a progress comment summarizing what was done
## Tomorrow's Context
Create/update `.claude/tomorrow.md` with:
- What was accomplished today
- Current blockers
- What to pick up tomorrow
- Any notes for context
## Checklist
Before finishing, verify:
- [ ] All meaningful changes committed
- [ ] Remote is up to date
- [ ] WIP is documented
- [ ] Tomorrow file updated
Output: "Day wrapped! See you tomorrow."
/eod
Time saved: Prevents forgotten commits, lost context, and morning confusion.
Dependencies need regular updates, but the process is tedious:
.claude/commands/deps.md:
---
description: Safely update project dependencies
---
# Dependency Update Workflow
When the user runs /deps, systematically update dependencies.
## Phase 1: Discovery
1. Check package manager:
- If `package.json`: use npm/yarn
- If `requirements.txt`: use pip
- If `Cargo.toml`: use cargo
2. List outdated packages:
- npm: `npm outdated`
- pip: `pip list --outdated`
- cargo: `cargo outdated`
3. Categorize updates:
- **Patch** (1.2.3 → 1.2.4): Usually safe
- **Minor** (1.2.3 → 1.3.0): Generally safe, check changelog
- **Major** (1.2.3 → 2.0.0): Breaking changes likely
## Phase 2: Safe Updates
Start with low-risk updates:
1. Update all patch versions
2. Run tests: `npm test` / `pytest` / `cargo test`
3. If tests pass, commit: "chore(deps): patch updates"
4. If tests fail, revert and note the problematic package
## Phase 3: Minor Updates
For each minor update:
1. Check the changelog/release notes
2. Look for deprecation warnings
3. Update the single package
4. Run tests
5. If pass, commit individually: "chore(deps): update [package] to [version]"
6. If fail, revert and document
## Phase 4: Major Updates
For each major update:
1. STOP and inform the user
2. Show the changelog highlights
3. List potential breaking changes
4. Ask for explicit approval before updating
5. If approved, update and test thoroughly
6. Document any migration steps taken
## Output Format
Updated (safe):
Updated (reviewed):
Needs Manual Review:
Skipped (test failures):
All tests passing: Yes/No Commits created: 3
/deps
Time saved: 30-60 minutes per update cycle, with fewer broken builds.
PR reviews should be thorough, but it's easy to miss things:
.claude/commands/review-pr.md:
---
description: Comprehensive PR review checklist
arguments:
- name: pr
description: PR number to review
required: true
---
# PR Review Workflow
When the user runs /review-pr [number], perform a comprehensive review.
## Fetch PR Information
1. Get PR details: `gh pr view [number]`
2. Get diff: `gh pr diff [number]`
3. Get PR comments: `gh pr view [number] --comments`
4. Check CI status: `gh pr checks [number]`
## Review Categories
### 1. Code Quality
- [ ] Code follows project style guide
- [ ] No obvious bugs or logic errors
- [ ] Error handling is appropriate
- [ ] No unnecessary complexity
- [ ] Comments explain "why", not "what"
### 2. Security
- [ ] No hardcoded secrets or credentials
- [ ] User input is validated/sanitized
- [ ] No SQL injection vulnerabilities
- [ ] Auth checks are in place where needed
- [ ] Sensitive data is not logged
### 3. Testing
- [ ] New code has tests
- [ ] Tests cover edge cases
- [ ] Tests are meaningful (not just for coverage)
- [ ] No flaky tests introduced
### 4. Documentation
- [ ] README updated if needed
- [ ] API changes documented
- [ ] Code comments for complex logic
- [ ] Migration steps if breaking changes
### 5. Performance
- [ ] No obvious performance issues
- [ ] Database queries are efficient
- [ ] No N+1 query patterns
- [ ] Large data sets handled properly
### 6. Compatibility
- [ ] Backward compatible (or breaking changes documented)
- [ ] Works across supported platforms
- [ ] No deprecated APIs used
## Generate Review
Format output as:
```markdown
## PR Review: #[number] - [title]
### Summary
[1-2 sentence summary of what this PR does]
### Recommendation: APPROVE / REQUEST_CHANGES / COMMENT
### Findings
#### Must Fix
- [Critical issues that must be addressed]
#### Should Fix
- [Important improvements recommended]
#### Consider
- [Nice-to-have suggestions]
#### Positive Notes
- [What's done well]
### Checklist Results
Security: ✓ Pass
Testing: ⚠ Needs attention - missing edge case tests
Documentation: ✓ Pass
Performance: ✓ Pass
Ask if the user wants to:
### Usage
/review-pr 123
**Time saved:** Ensures consistent, thorough reviews. Catches issues before merge.
## Workflow 5: Release Preparation
### The Problem
Releases involve many steps:
1. Update version numbers
2. Generate changelog
3. Run full test suite
4. Build artifacts
5. Create release notes
6. Tag and push
Missing a step can cause production issues.
### The Solution
**.claude/commands/release.md:**
```markdown
---
description: Prepare a new release
arguments:
- name: version
description: Version number (e.g., 1.2.0)
required: true
- name: type
description: Release type (major, minor, patch)
required: false
---
# Release Preparation Workflow
When the user runs /release [version], prepare a release.
## Pre-flight Checks
1. Verify on main/master branch
2. Verify working directory is clean
3. Verify all tests pass
4. Check that CI is green
If any check fails, STOP and report the issue.
## Version Updates
1. Update version in:
- package.json (Node.js)
- setup.py / pyproject.toml (Python)
- Cargo.toml (Rust)
- Any other version files
2. Search for hardcoded versions that need updating
## Changelog Generation
1. Get commits since last release:
`git log $(git describe --tags --abbrev=0)..HEAD --oneline`
2. Categorize commits:
- **Features**: commits starting with `feat:`
- **Bug Fixes**: commits starting with `fix:`
- **Breaking Changes**: commits with `BREAKING:`
- **Other**: remaining commits
3. Generate CHANGELOG.md entry:
```markdown
## [version] - YYYY-MM-DD
### Features
- Description of feature (#PR)
### Bug Fixes
- Description of fix (#PR)
### Breaking Changes
- Description of breaking change
### Other
- Other notable changes
If anything fails, STOP and report.
Commit version changes:
git commit -am "chore: release [version]"
Create annotated tag:
git tag -a v[version] -m "Release [version]"
Show the user:
git push origin maingit push origin v[version]gh release create v[version] --notes-file RELEASE_NOTES.mdRelease Preparation Complete
============================
Version: 1.2.0
Commits included: 15
Features: 3
Bug fixes: 7
Breaking changes: 0
Files modified:
- package.json (version bump)
- CHANGELOG.md (new entry)
Tag created: v1.2.0
Ready to push? Awaiting confirmation...
### Usage
/release 1.2.0
**Time saved:** Prevents release mistakes. Ensures consistency.
## Building Your Own Workflows
### Step 1: Identify the Workflow
Document your current manual process:
1. What do you do step by step?
2. What decisions do you make?
3. What can go wrong?
4. What tools do you use?
### Step 2: Determine Automation Level
For each step, decide:
- **Automatic:** AI does it without asking
- **Assisted:** AI does it, shows results
- **Prompted:** AI asks before doing
- **Manual:** User does it themselves
### Step 3: Write the Skill
Use this template:
```markdown
---
description: [What this workflow does]
arguments: [Any parameters needed]
---
# [Workflow Name]
## Trigger
[When/how this runs]
## Steps
[Numbered list of what happens]
## Decision Points
[Where user input is needed]
## Error Handling
[What to do when things fail]
## Output
[What the user sees at the end]
After using the workflow for a week:
Update the skill accordingly.
Workflows can build on each other:
## Daily Development Flow
/morning → Work → /commit → Work → /eod
## Weekly Maintenance Flow
/deps → /review-pr [all pending] → /release [if ready]
## Sprint Flow
Sprint Start: /sprint-setup
Daily: /morning, /standup, /eod
Sprint End: /release, /retro
One workflow = one purpose. Don't combine "update deps" with "deploy to prod."
Running a workflow twice should be safe. Don't assume state.
Always let users skip steps or abort the workflow.
Workflows should output what they're doing. Silent automation is scary automation.
Begin with more prompts for confirmation. Remove them as trust builds.
Workflow automation with Claude Code transforms repetitive tasks into single commands. The key is identifying patterns in your work and encoding them as skills.
Start with one workflow. Refine it. Add another. Over time, you'll build a personalized automation suite that saves hours every week.
| Workflow | Command | Time Saved |
|---|---|---|
| Morning prep | /morning | 15-20 min/day |
| End of day | /eod | 10 min/day |
| Dependency updates | /deps | 30-60 min/cycle |
| PR reviews | /review-pr | 15 min/review |
| Release prep | /release | 30 min/release |
Ready to automate testing specifically? Check out Test-Driven Development with Claude Code for TDD workflow automation.
Teaches Claude how to use the linear-CLI tool for issue tracking
Build Model Context Protocol (MCP) servers and integrations. Create custom tools and capabilities for Claude.
Lab environment for experimenting with Claude superpowers and capabilities.
Create and manage command structures for agent workflows.