spike-then-refactor

Guides exploratory coding spikes followed by structured evaluation and rebuild-or-refactor decisions.

2|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/jay-steenbergen/MSSAMentorAgent --skill spike-then-refactor-jay-steenbergen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spike-then-refactor
Source: https://github.com/jay-steenbergen/MSSAMentorAgent/tree/main/.github/skills/methods/spike-then-refactor
Command: npx skills add https://github.com/jay-steenbergen/MSSAMentorAgent --skill spike-then-refactor-jay-steenbergen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When learners face unfamiliar libraries, APIs, or complex problem spaces, they often either freeze or ship messy prototype code as production code. This Skill provides a disciplined teaching protocol for exploratory coding: build a quick throwaway prototype to learn, extract the lessons, then deliberately rebuild or refactor before shipping. ## Core Features & Use Cases - Structured Spike Cycle: Enforces a Spike → Evaluate → Decide → Rebuild/Refactor workflow with time-boxing, a written spike question, and explicit lesson extraction. - Proficiency-Adaptive Coaching: Adjusts mentor behavior across Novice, Familiar, Competent, and Proficient levels, with progression signals recorded in the learner's progress file. - Anti-Pattern Guardrails: Stops common mistakes like writing tests during a spike, refactoring prematurely, or shipping spike code. - Use Case: A learner needs to integrate an unfamiliar authentication library. The mentor time-boxes a 30-minute spike to answer "how does auth work in this framework?", captures lessons learned, then switches to TDD to build the clean implementation. ## Quick Start Ask the mentor to use the spike-then-refactor method to explore how an unfamiliar library or API works before building the real implementation.

Frequently Asked Questions about spike-then-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a spike in software development?

A spike is a time-boxed throwaway prototype built to answer a specific technical question, such as whether a library supports a needed feature. The code is deliberately messy and is either deleted or ruthlessly refactored after the lessons are extracted.

When should I use spike-then-refactor instead of TDD?

Use spike-then-refactor when exploring unfamiliar territory where you don't yet know what the solution looks like. Switch to TDD when requirements are clear and you already understand the pattern you need to build.

How long should a code spike last?

A spike should be time-boxed to 30-60 minutes maximum. If the spike hasn't answered its guiding question by then, stop, evaluate what was learned, and either run a shorter focused spike or change approach.

Should I write tests during a spike?

No. Writing tests during a spike is an anti-pattern because you don't yet know what to test. Tests are written during the rebuild or refactor phase, once the spike has revealed the actual shape of the solution.

How do I decide whether to rebuild or refactor spike code?

Rebuild when the spike has fundamental design flaws; refactor when the structure is sound but messy. If refactoring, write tests first, then clean up one piece at a time, running tests after every change.