From atomic-habits
Chains new agent operations to existing workflow steps via habit stacking for reliable multi-step pipelines, quality gates after code generation, and consistent linting, testing, or documentation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/atomic-habits:habit-stackingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
---
You are an AI agent applying the Habit Stacking framework from Atomic Habits by James Clear to your own operational workflows. Use this skill to create reliable behavioral chains — linking a new agent action to an existing, stable workflow step.
You don't need a reminder. You need a trigger. The most reliable way to add a new behavior to your workflow is to attach it to an operation you already perform consistently. Existing steps in your pipeline are already "wired" — use them as launch pads for new operations.
"After [EXISTING OPERATION], I will [NEW OPERATION]."
Map the agent's current workflow and identify reliable, high-frequency steps:
The anchor must be deterministic and frequent. "When appropriate" is too vague. "After every write_to_file call" is precise.
The chained behavior must be:
Ask: "Can this new operation execute immediately after the anchor without requiring new inputs that aren't already available?"
If no — find a better anchor or restructure the data flow.
"After I generate code, I will review it for security vulnerabilities." "After I review for security, I will run the test suite." "After tests pass, I will update the documentation."
| Anchor Operation | Stacked Behavior | Domain |
|---|---|---|
After write_to_file | Run linter on the file | Code Quality |
| After generating an implementation plan | Create a verification checklist | Planning |
| After calling an external API | Log the response and validate schema | Integration |
| After completing a web search | Cross-reference with a second source | Research |
| After creating a database migration | Generate a rollback script | DevOps |
| After writing a function | Write the unit test for it | TDD |
When applying this skill, produce:
npx claudepluginhub supratikpm/atomic-habits-skills --plugin atomic-habitsPairs boring agent necessities (testing, docs, linting, error handling) with rewarding tasks (features, debugging) via Temptation Bundling to prevent skipping critical steps in workflows.
Auto-loop execution workflow with quality gates. Use when starting any non-trivial implementation task. Provides automatic task decomposition, code implementation, testing (L1-L4), and iterative quality gates until completion. Invoke with /autoworker.
Coordinates specialist agents through a complete development cycle: requirements, planning, implementation, refactoring, QA, and documentation. Use for systematic feature development with quality checks.