spike-then-refactor-into-components

spike-then-refactor-into-components is a skill for Claude Code, Codex from lossless-group/lossless-agent-skills. It costs 185 tokens per session (1,636 once invoked), scanned A, original, MIT.

A workflow for first building a user-interface idea freely, then moving the approved result into the project's shared components and visual style. A component is a reusable piece of interface, such as a button or card.

In plain words
What is it for?
Use it to prototype pages or features, then refactor their markup, colors, spacing, and effects into the design system.
Why use it?
It avoids limiting early exploration while preventing the finished product from filling up with duplicated, inconsistent interface code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions Codex.

Good fit Use it to prototype pages or features, then refactor their markup, colors, spacing, and effects into the design system.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add lossless-group/lossless-agent-skills --skill spike-then-refactor-into-components
Clone the repo
git clone --depth 1 https://github.com/lossless-group/lossless-agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spike-then-refactor-into-components

README.md
[![agentmods](https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components/github.svg)](https://agentmods.dev/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components)
Your own site
<a href="https://agentmods.dev/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components"><img src="https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spike-then-refactor-into-components

Your own site · 80×15
<a href="https://agentmods.dev/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components"><img src="https://agentmods.dev/badge/skills/lossless-group/lossless-agent-skills/spike-then-refactor-into-components.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 185 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,636 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00185 $0.01636
Opus 5.5 $0.00074 $0.00654
Sonnet 5.5 $0.00037 $0.00327
Haiku 4.5 $0.00018 $0.00164

Measured 20d ago against content hash a6f5c084dc44, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

spike-then-refactor-into-components scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

spike-then-refactor-into-components/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Spike, then refactor into components

Coding agents are faster and better at building new features, pages and UI when they aren't thinking about the existing component library. Holding a library in mind while being creative pulls every new idea toward what already exists. So we let creative work break free of the library, and then refactor it back into the library once it's approved.

The design system has two halves, and a spike breaks free of both: the component library (it builds its own markup) and the theme (it hard-codes colors, fonts, spacing and effects). The refactor brings it back into both.

The second half is the discipline. Most developers forget it, and the team pays later: one-off markup everywhere, the same card built four ways, a theme change that has to be made in twelve files, and a /design-system page that no longer describes the site.

1. Make the gametime decision, out loud

Before writing UI, decide whether to use the component library, and say so in one line ("Spiking this freely; refactor after approval" or "Building from the library: Card, SectionHeader").

Use the library Break free (spike)
Extending a pattern the site already has The emphasis is to be creative: a new page, a new feature, a redesign, design variants
A small change to an existing page The library would steer the idea toward what exists
Consistency is the point (a new entry in a list, another pricing tier) Exploring several directions before anyone picks one
A component exists that fits without contortion Fitting it would need props or variants nobody has wanted before

When unsure and the work is visible to a stakeholder, spike. A spike that gets approved is cheap to refactor; a library-bound build that misses the brief is expensive to redo.

2. Spike freely, and mark it

Write it the fastest clear way: inline markup, local styles, hard-coded content. Still follow the hard rules (Astro and Svelte only, no React or JSX habits, semantic tokens in styles where you can). Mark every file the spike created or reshaped, so the refactor can't be forgotten:

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago First seen · 125 lines · 185 tokens per session scan A a6f5c084dc44

Subscribe to this mod's changes

spike-then-refactor-into-components is a skill published in the GitHub repository lossless-group/lossless-agent-skills (4 stars, last pushed yesterday), licensed MIT. It adds 185 tokens to every session and 1,636 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-10.

Related

spike-then-refactor-into-components compared with skills from other repositories

spike-then-refactor-into-components next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
spike-then-refactor-into-componentslossless-group/lossless-agent-skillsSkill4yesterdayMITA185Claude Code, Codex
gsd-sketchopen-gsd/gsd-coreSkill12kyesterdayMITA27Claude Code
gsd-ui-phaseopen-gsd/gsd-coreSkill12kyesterdayMITA18Claude Code
gsd-ui-reviewopen-gsd/gsd-coreSkill12kyesterdayMITA17Claude Code
top-designwondelai/skillsSkill2.8k9d agoMITA113Claude Code, Codex
web-typographywondelai/skillsSkill2.8k9d agoMITA128Claude Code, Codex
userinterface-wikiopen-gsd/gsd-piSkill1.4k2d agoMITA52Claude Code, Codex