一键导入
spike
Use for rapid prototyping, experiments, exploring ideas without production quality requirements, validating technical feasibility, or when user invokes /spike
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for rapid prototyping, experiments, exploring ideas without production quality requirements, validating technical feasibility, or when user invokes /spike
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when researching state-of-the-art algorithms for a problem, finding academic papers, comparing algorithm approaches, needing paper citations, or user invokes /algorithm-research
Use when researching algorithms, data structures, optimization, performance, or need modern alternatives to classic algorithms
Use when creating benchmarks, measuring performance, comparing implementations, or user invokes /benchmark. Provides step-by-step workflow for benchmark creation, data generation, and results interpretation.
Use when analyzing code cognitive load, onboarding difficulty, or user invokes /cognitive-audit for complexity analysis and refactoring recommendations
Use when analyzing cognitive load, code complexity, onboarding difficulty, readability concerns, maintainability issues, or applying Ousterhout principles for deep modules, reducing complexity, and strategic programming approaches
Use when implementing concurrent operations, choosing between concurrency models, designing async workflows, or working with parallel data processing
| name | spike |
| description | Use for rapid prototyping, experiments, exploring ideas without production quality requirements, validating technical feasibility, or when user invokes /spike |
Rapid prototyping for exploring ideas and proving concepts without production quality requirements.
Invoke with /spike when:
Skip this skill when:
/feature instead)/spike Add user email preferences
/spike Try GraphQL subscriptions for live updates
/spike Experiment with Nx for ML predictions
Expects a spike goal as the argument.
This skill typically uses:
mix compile)Enables fast iteration with deliberately reduced quality gates:
# SPIKE: comments on every file/function.claude/spike-debt.mdCheck if SPIKE mode is safe for this goal:
Analyzing SPIKE request: [goal]
Checking appropriateness:
- Security impact: [Low/Medium/High]
- Data integrity risk: [Low/Medium/High]
- Production user exposure: [None/Limited/Direct]
Decision: [Safe for SPIKE | Proceed with caution | Requires production quality]
If HIGH risk:
SPIKE Mode Not Appropriate
This feature involves:
- [Security/Data/User risk]
Recommendation: Use /feature for full TDD implementation
SPIKE is for learning and exploration, not production-critical code.
Initialize or read existing .claude/spike-debt.md:
# SPIKE Technical Debt
Track all SPIKE code for future migration to production quality.
## Active SPIKEs
### [Goal] - [Date Started]
**Purpose**: Quick exploration of [what you're testing]
**Status**: Experimenting | Validated (works) | Abandoned (didn't work)
**Migration Priority**: Low | Medium | High
**Estimated Migration Effort**: [X hours/days]
**Files**:
- lib/my_app/[module].ex
- lib/my_app_web/live/[live].ex
- test/[basic_test].exs (smoke tests only)
**What We Learned**:
- [Key insights from exploration]
- [What worked well]
- [What needs improvement]
**Migration Notes**:
- Need comprehensive tests (currently 2 smoke tests)
- Add typespecs (0 functions have specs)
- Implement proper error handling (only happy path)
- Add complexity analysis
---
## Migrated SPIKEs
[Archive of completed migrations]
---
## Abandoned SPIKEs
[Archive of experiments that didn't pan out]
Launch developer agent (Haiku) with SPIKE constraints:
Launching developer (Haiku) in SPIKE mode...
SPIKE Goal: [user's goal]
SPIKE Constraints:
- Focus on working code FAST
- Skip type annotations initially
- Minimal tests (1-2 smoke tests only)
- Basic error handling (happy path focus)
- Mark everything with # SPIKE: comments
- Use simplest approach, not best approach
- No comprehensive test suite
- No production error handling
- No performance optimization
- No complexity analysis
Agent will:
1. Create minimal working implementation
2. Add # SPIKE: marker to every file/function
3. Write 1-2 smoke tests (basic functionality only)
4. Document what works in spike-debt.md
5. Note migration requirements
Target: Working prototype in <1 hour
Waiting for implementation...
All SPIKE code MUST include clear markers:
File-level marker:
# SPIKE: Email preferences experiment - 2025-01-16
# This is prototype code for exploring user preference storage.
# Migration required before production. See .claude/spike-debt.md
defmodule MyApp.UserPreferences do
# SPIKE: Minimal implementation for testing concept
def get_preferences(user_id) do
# Implementation...
end
end
Function-level markers:
defmodule MyApp.Accounts do
# SPIKE: Quick prototype - needs proper error handling
def update_email_preferences(user, preferences) do
# Only handles happy path
Repo.update!(changeset)
end
end
Test markers:
# SPIKE: Smoke tests only - need comprehensive test suite for production
defmodule MyApp.UserPreferencesTest do
use MyApp.DataCase
# SPIKE: Basic happy path test
test "get_preferences/1 returns preferences" do
user = insert(:user)
assert {:ok, _prefs} = UserPreferences.get_preferences(user.id)
end
end
Update .claude/spike-debt.md with findings:
## Active SPIKEs
### Email Preferences - 2025-01-16
**Purpose**: Test storing user email preferences in JSONB column vs separate table
**Status**: Validated (JSONB approach works well)
**Migration Priority**: Medium
**Estimated Migration Effort**: 4-6 hours
**Files**:
- lib/my_app/user_preferences.ex (85 lines)
- lib/my_app/accounts.ex (updated, 3 new functions)
- lib/my_app_web/live/preferences_live.ex (120 lines)
- test/my_app/user_preferences_test.exs (2 smoke tests)
**What We Learned**:
- JSONB approach is flexible and performant for <100 fields
- Phoenix LiveView handles preference updates cleanly
- No N+1 queries with current approach
- Need validation on JSONB structure
- Need indexes on JSONB fields for search
**Migration Notes**:
- Add comprehensive tests (need ~15 tests for all cases)
- Add typespecs (@spec for 6 public functions)
- Implement input validation and error handling
- Add JSONB field indexes
- Document JSONB schema structure
- Add complexity analysis (current O(n) should be fine)
**Performance Note**:
- Tested with 1,000 users - no issues
- Need benchmarks if scaling to 100K+ users
Provide clear summary of SPIKE:
# SPIKE Complete: [Goal]
## What We Built
**Working prototype** in [time]
- [Feature 1]
- [Feature 2]
- [N] smoke tests
## What We Learned
**Technical Validation**:
- [What worked]
- [What didn't work]
**Unknowns**:
- [Items needing more research]
## Code Quality
**Current State** (SPIKE):
- No type annotations (0/N functions)
- Minimal tests (N smoke tests)
- Basic error handling (happy path only)
- No performance analysis
- All marked with # SPIKE: comments
**Migration Required**:
- Comprehensive tests: ~N tests (X hours)
- Type annotations: N functions (X hours)
- Error handling: all edge cases (X hours)
- Documentation: (X hours)
- Total: ~X hours to production quality
## Files Created
- [list of SPIKE files]
## Next Steps
**Option 1: Migrate to Production** (recommended if approach validated)
Run: `/spike-migrate lib/my_app/[module].ex`
**Option 2: Continue Experimenting**
- Keep as SPIKE
- Test with real users (non-production)
- Gather more feedback
**Option 3: Abandon**
- Approach didn't work as expected
- Archive in spike-debt.md
- Try different approach
## Technical Debt Tracked
Updated `.claude/spike-debt.md` with migration requirements and learnings.
Minimum viable:
# SPIKE: markers on all files/functionsExplicitly skip:
Stop and migrate when:
Stop and abandon when:
Keep spiking when:
SPIKE code skips some precommit checks:
# Run precommit on SPIKE code
/precommit
# Modified behavior:
- Compilation (still required - no broken code)
- Formatting (still required - readable code)
- Credo warnings allowed (not errors)
- Minimal test coverage acceptable
# Note in output:
SPIKE Code Detected
Files with # SPIKE: markers found.
This is prototype code - migration required before production.
See .claude/spike-debt.md for migration plan.
Track how long SPIKE code lives:
## Active SPIKEs
### [Feature] - Created: 2025-01-16
**Age**: 3 days
**Status**: Validated
Warning: SPIKE is >7 days old
Consider migrating to production or abandoning.
SPIKEs should be short-lived experiments.
Recommended limits:
SPIKE Mode Not Appropriate
Goal: "Add user authentication"
This involves security, which requires production quality:
- Comprehensive testing (authentication must be bulletproof)
- Proper error handling (security failures must be safe)
- Typespecs (clear contracts for security functions)
Use: /feature for full TDD implementation
SPIKE is for exploration, not security.
Creating .claude/spike-debt.md...
# SPIKE Technical Debt
Track all SPIKE code for future migration.
[Initial template created]
SPIKE tracker initialized
Every SPIKE needs clear migration path:
## Migration Checklist for [Feature]
**Current State** (SPIKE):
- [ ] 0/6 functions have type annotations
- [ ] 2/15 tests implemented (smoke only)
- [ ] 3/8 error cases handled
- [ ] 0 complexity analysis done
- [ ] 0 performance benchmarks
**Migration Tasks** (8 hours estimated):
1. Add type annotations (1 hour)
- 6 public functions
- Follow project patterns
2. Comprehensive tests (4 hours)
- Success cases (3 tests)
- Error cases (8 tests)
- Edge cases (4 tests)
- Criticality: 9-10
3. Error handling (2 hours)
- Network failures
- Invalid input
- Database errors
- Timeout handling
4. Documentation (1 hour)
- Module docs
- Function docs
- Usage examples
**Ready for migration**: Run /spike-migrate lib/my_app/[module].ex
SPIKE succeeds when:
# SPIKE:/spike-migrate - Upgrade SPIKE to production quality/feature - Full production implementation (use instead of SPIKE for critical code)/precommit - Modified checks for SPIKE code/learn - Document patterns discovered during SPIKE/review - Will detect SPIKE code and suggest migration