From hanakai-yaku
Use when implementing a Hanami 2.x feature, Hanami action, Hanami slice, or any Hanami controller logic using test-driven development (TDD / red-green-refactor). Orchestrates test planning, generates request specs or action unit specs, drives the implementation of Hanami action classes and route configurations, and performs a final code review. Use when starting a new Hanami feature from scratch, adding integration tests for an existing Hanami action, or following a red-green-refactor cycle for any Hanami 2.x component.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hanakai-yaku:tdd-loopThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this workflow when implementing any Hanami 2.x feature using Test-Driven Development.
Use this workflow when implementing any Hanami 2.x feature using Test-Driven Development.
Core principle: Write a failing test → verify it fails for the right reason → implement → verify it passes → review.
| Step | Skill | Handoff Condition |
|---|---|---|
| 1. Plan tests | test-planning-process (from ruby-core-skills) | Test plan written, right test type chosen |
| 2. Write failing test | write-request-spec or write-action-spec | Test exists and fails for the right reason |
| 3. Implement | — | Test passes |
| 4. Review | review-code | No violations found |
[Plan Tests] — Load skill: test-planning-process (from ruby-core-skills)
[Write Failing Test] — Load skill: write-request-spec or write-action-spec
bundle exec rspec spec/requests/... (request spec) or bundle exec rspec spec/actions/... (action spec)tdd-process (from ruby-core-skills)): Do not proceed until the test fails for the right reason.[Implement] — Write minimal code to make the test pass
bundle exec rspec after each change[Review] — Load skill: review-code
Failing request spec (spec/requests/posts/create_spec.rb):
RSpec.describe "POST /posts", type: :request do
it "creates a post and redirects" do
post "/posts", params: { post: { title: "Hello" } }
expect(last_response.status).to eq(302)
end
end
Run: bundle exec rspec spec/requests/posts/create_spec.rb → expect a failure such as ActionNotFound or 404.
Minimal implementation — generate the action and register the route:
# app/actions/posts/create.rb
module MyApp
module Actions
module Posts
class Create < MyApp::Action
def handle(request, response)
response.redirect_to "/posts"
end
end
end
end
end
Run: bundle exec rspec spec/requests/posts/create_spec.rb → expect green.
| Mistake / Red Flag | Why it matters |
|---|---|
| Implementation written before any test | TDD means test first. No exceptions. |
| Skipping the HARD-GATE — assuming the test fails without running it | A passing test without running it first doesn't verify the assertion works — run it to confirm RED |
npx claudepluginhub igmarin/hanakai-yakuGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.