一键导入
spike
Conduct empirical technical investigations using isolated subagents to compare alternatives or validate assumptions through prototype testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Conduct empirical technical investigations using isolated subagents to compare alternatives or validate assumptions through prototype testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
You must load this skill if you are creating or updating standalone documentation.
This skill should be used when the user asks to "skillify this", "turn this into a skill", "make a skill out of what we just did", "generalize this task into a reusable skill", or otherwise wants to capture a just-completed session task as a new skill or fold it into an existing one.
Browser automation using the puppeteer NPM package. Use when performing tasks on websites as a user would, taking screenshots, filling forms, or navigating web applications.
Load this skill immediately after a user mentions "@goodfoot/claude-code-hooks" or Claude Code hooks.
Load this skill immediately after a user mentions "@goodfoot/codex-hooks" or Codex hooks.
Load this skill immediately after a user mentions "@goodfoot/codex-hooks" or Codex hooks.
| name | spike |
| description | Conduct empirical technical investigations using isolated subagents to compare alternatives or validate assumptions through prototype testing. |
Use the Task() tool to launch a subagent to perform a technical spike investigation.
Use when technology has NOT been chosen and you need to compare 2-3 viable approaches.
Derive these values from your context:
[SPIKE_QUESTION]: Format as "Which approach ([A] vs [B] vs [C]) best supports [use case] with [constraints]?"[SCRATCHPAD_PATH]: Format as [PROJECT_PATH]/scratchpad/[test-name]/
[test-name]: Use kebab-case like realtime-comparison or socketio-vs-sse[PROJECT_PATH] is a placeholder for the project directory (e.g., projects/active/my-project)[APPROACHES]: List 2-3 technologies with versions (e.g., ["Socket.io v4.6.1 (WebSocket)", "EventSource (SSE)", "long-polling"])[COMPARISON_CRITERIA]: Measurable aspects (e.g., "Developer experience, bidirectional communication, horizontal scaling")[SPIKE_CONTEXT]: XML-formatted technical context with absolute paths (see section below)[SUBAGENT_INSTRUCTIONS]: Specific testing steps for prototyping each approach[SUBAGENT_DESCRIPTION]: Short kebab-case identifier (e.g., "realtime-comparison-spike")Always use: subagent_type="general-purpose" and model="sonnet"
Use when technology IS chosen but specific capability/compatibility needs verification.
Derive these values from your context:
[SPIKE_QUESTION]: Format as "Does [Library@version] support [specific capability]?"[SCRATCHPAD_PATH]: Format as [PROJECT_PATH]/scratchpad/[test-name]/
[test-name]: Use kebab-case like redis-compatibility-check or react-query-types-export[PROJECT_PATH] placeholder represents the project directory (e.g., projects/active/my-project)[APPROACH]: Single technology to validate (e.g., "Socket.io v4.6.1 with @socket.io/redis-adapter")[VALIDATION_CRITERIA]: What needs verification (e.g., "Redis adapter compatibility for horizontal scaling")[SPIKE_CONTEXT]: XML-formatted technical context with absolute paths (see section below)[SUBAGENT_INSTRUCTIONS]: Specific testing steps for validating the capability[SUBAGENT_DESCRIPTION]: Short kebab-case identifier (e.g., "redis-compatibility-check")Always use: subagent_type="general-purpose" and model="sonnet"
Structure [SUBAGENT_CONTEXT] and [SPIKE_CONTEXT] using semantic XML tags that organize technical details:
When comparing alternatives:
<spike-purpose>
[Why this investigation is needed and what decision depends on it]
</spike-purpose>
<approaches-to-test>
[List of 2-3 specific approaches/technologies to prototype and compare]
</approaches-to-test>
<comparison-criteria>
[Specific criteria for comparison - e.g., developer experience, scaling capability, performance]
</comparison-criteria>
<technical-context>
[Relevant technical constraints, requirements, or existing patterns]
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/[test-name]/
</scratchpad-path>
When validating a chosen approach:
<spike-purpose>
[Why this validation is needed and what implementation step depends on it]
</spike-purpose>
<approach-to-validate>
[Specific technology, library version, or integration to test]
</approach-to-validate>
<validation-criteria>
[What needs to be verified - specific capability, API behavior, compatibility]
</validation-criteria>
<technical-context>
[Relevant technical constraints, version requirements, or integration points]
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/[test-name]/
</scratchpad-path>
Instruct the subagent to document findings in a structured format within the scratchpad:
Comparison Result Template (when testing multiple approaches):
## [Question]
- **Question**: [The technical question being investigated]
- **Approaches Tested**: [Approach 1, Approach 2, Approach 3]
- **Comparison Criteria**: [Criterion 1, Criterion 2, Criterion 3]
- **Result**: [Recommendation with rationale]
- **Evidence**:
- [Approach 1]: [Specific findings from prototype]
- [Approach 2]: [Specific findings from prototype]
- [Approach 3]: [Specific findings from prototype]
- **Artifacts**: `[PROJECT_PATH]/scratchpad/[test-name]/` contains:
- `approach-[name1]/` - [Description]
- `approach-[name2]/` - [Description]
- `approach-[name3]/` - [Description]
- `comparison.md` - Side-by-side analysis
- `recommendation.md` - Selection rationale
- `results.md` - Findings using template format
- **Impact**: [How this result influences the Technical Approach or implementation]
Validation Result Template (when testing single approach):
## [Question]
- **Question**: [The specific capability or compatibility question]
- **Approach Tested**: [Technology/version being validated]
- **Result**: [Pass/Fail or capability confirmation]
- **Evidence**: [Concrete demonstration - working code, API output, test results]
- **Artifacts**: `[PROJECT_PATH]/scratchpad/[test-name]/` contains:
- `test-implementation/` - [Description]
- `results.md` - Detailed findings
- **Impact**: [How this result confirms feasibility or influences implementation details]
**Comparison Spike Example**:
User message: "Compare WebSocket (Socket.io), Server-Sent Events (EventSource), and long-polling for real-time notifications. Compare developer experience, bidirectional communication support, and horizontal scaling capability. Use scratchpad path [PROJECT_PATH]/scratchpad/realtime-comparison/"
Derived values:
[SUBAGENT_INSTRUCTIONS]:
Compare three real-time communication approaches for a notification system. Create working prototypes of each approach in the scratchpad and compare them against specific criteria.
Create prototypes in `[PROJECT_PATH]/scratchpad/realtime-comparison/`:
1. `approach-socketio/` - Socket.io v4.6.1 implementation with Redis adapter for horizontal scaling
2. `approach-sse/` - Native EventSource implementation with separate POST endpoint for client→server
3. `approach-polling/` - Long-polling implementation with state management
For each prototype:
- Implement basic notification delivery
- Test bidirectional communication (or document limitation)
- Prototype horizontal scaling approach
- Document developer experience observations
Create comparison documents:
- `comparison.md` - Side-by-side analysis of all three approaches against criteria
- `recommendation.md` - Clear recommendation with rationale
Document findings using the Comparison Result Template in `results.md`.
[SPIKE_CONTEXT]:
<spike-purpose>
Notification system requires real-time delivery with horizontal scaling. Multiple approaches exist but no clear winner without empirical testing. This spike will inform the Technical Approach section by selecting the optimal technology.
</spike-purpose>
<approaches-to-test>
1. Socket.io v4.6.1 (WebSocket) - bidirectional, requires Redis adapter for scaling
2. Native EventSource (SSE) - server→client only, simpler protocol
3. Long-polling - fallback approach, works everywhere
</approaches-to-test>
<comparison-criteria>
- Developer experience: setup complexity, debugging, ecosystem support
- Bidirectional communication: can clients send data without separate endpoint?
- Horizontal scaling: can scale across multiple server instances?
</comparison-criteria>
<technical-context>
Existing system uses Express.js v4.18.2 in `packages/api/src/server.ts`. Production runs 5 instances behind load balancer. Redis v7.0 available for pub/sub if needed.
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/realtime-comparison/
</scratchpad-path>
Use the Task() tool to launch the spike investigation:
<invoke name="Agent">
<parameter name="description">realtime-comparison-spike</parameter>
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="model">sonnet</parameter>
<parameter name="prompt">
<spike-purpose>
Notification system requires real-time delivery with horizontal scaling. Multiple approaches exist but no clear winner without empirical testing. This spike will inform the Technical Approach section by selecting the optimal technology.
</spike-purpose>
<approaches-to-test>
1. Socket.io v4.6.1 (WebSocket) - bidirectional, requires Redis adapter for scaling
2. Native EventSource (SSE) - server→client only, simpler protocol
3. Long-polling - fallback approach, works everywhere
</approaches-to-test>
<comparison-criteria>
- Developer experience: setup complexity, debugging, ecosystem support
- Bidirectional communication: can clients send data without separate endpoint?
- Horizontal scaling: can scale across multiple server instances?
</comparison-criteria>
<technical-context>
Existing system uses Express.js v4.18.2 in `packages/api/src/server.ts`. Production runs 5 instances behind load balancer. Redis v7.0 available for pub/sub if needed.
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/realtime-comparison/
</scratchpad-path>
<instructions>
Compare three real-time communication approaches for a notification system. Create working prototypes of each approach in the scratchpad and compare them against specific criteria.
Create prototypes in `[PROJECT_PATH]/scratchpad/realtime-comparison/`:
1. `approach-socketio/` - Socket.io v4.6.1 implementation with Redis adapter for horizontal scaling
2. `approach-sse/` - Native EventSource implementation with separate POST endpoint for client→server
3. `approach-polling/` - Long-polling implementation with state management
For each prototype:
- Implement basic notification delivery
- Test bidirectional communication (or document limitation)
- Prototype horizontal scaling approach
- Document developer experience observations
Create comparison documents:
- `comparison.md` - Side-by-side analysis of all three approaches against criteria
- `recommendation.md` - Clear recommendation with rationale
Document findings using the Comparison Result Template in `results.md`.
</instructions>
</parameter>
</invoke>
**Validation Spike Example**:
User message: "Verify Socket.io v4.6.1 supports Redis adapter for horizontal scaling. Use scratchpad path [PROJECT_PATH]/scratchpad/redis-compatibility/"
Derived values:
[SUBAGENT_INSTRUCTIONS]:
Verify Socket.io v4.6.1 supports Redis adapter for horizontal scaling.
Create test implementation in `[PROJECT_PATH]/scratchpad/redis-compatibility/`:
1. `test-implementation/` - Socket.io v4.6.1 with Redis adapter configuration
2. Install required packages: socket.io@4.6.1, @socket.io/redis-adapter
3. Test multi-instance communication through Redis
4. Document configuration steps and any compatibility issues
Create results document:
- `results.md` - Pass/fail result with concrete evidence
Document findings using the Validation Result Template.
[SPIKE_CONTEXT]:
<spike-purpose>
Plan proposes Socket.io for real-time notifications with Redis adapter for horizontal scaling. Must verify this specific version supports the adapter before committing to implementation.
</spike-purpose>
<approach-to-validate>
Socket.io v4.6.1 with @socket.io/redis-adapter - configuration and multi-instance communication
</approach-to-validate>
<validation-criteria>
- Can install and configure Redis adapter with Socket.io v4.6.1
- Messages propagate correctly across multiple Socket.io instances
- No version compatibility issues or breaking changes
</validation-criteria>
<technical-context>
Production environment uses Redis v7.0. Target deployment has 5 Node.js instances behind load balancer. Existing stack uses Express.js v4.18.2 in `packages/api/src/server.ts`.
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/redis-compatibility/
</scratchpad-path>
Use the Task() tool to launch the spike investigation:
<invoke name="Agent">
<parameter name="description">redis-compatibility-check</parameter>
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="model">sonnet</parameter>
<parameter name="prompt">
<spike-purpose>
Plan proposes Socket.io for real-time notifications with Redis adapter for horizontal scaling. Must verify this specific version supports the adapter before committing to implementation.
</spike-purpose>
<approach-to-validate>
Socket.io v4.6.1 with @socket.io/redis-adapter - configuration and multi-instance communication
</approach-to-validate>
<validation-criteria>
- Can install and configure Redis adapter with Socket.io v4.6.1
- Messages propagate correctly across multiple Socket.io instances
- No version compatibility issues or breaking changes
</validation-criteria>
<technical-context>
Production environment uses Redis v7.0. Target deployment has 5 Node.js instances behind load balancer. Existing stack uses Express.js v4.18.2 in `packages/api/src/server.ts`.
</technical-context>
<scratchpad-path>
[PROJECT_PATH]/scratchpad/redis-compatibility/
</scratchpad-path>
<instructions>
Verify Socket.io v4.6.1 supports Redis adapter for horizontal scaling.
Create test implementation in `[PROJECT_PATH]/scratchpad/redis-compatibility/`:
1. `test-implementation/` - Socket.io v4.6.1 with Redis adapter configuration
2. Install required packages: socket.io@4.6.1, @socket.io/redis-adapter
3. Test multi-instance communication through Redis
4. Document configuration steps and any compatibility issues
Create results document:
- `results.md` - Pass/fail result with concrete evidence
Document findings using the Validation Result Template.
</instructions>
</parameter>
</invoke>
### Spike Execution Principles
When multiple independent spike questions need investigation, launch all spikes in parallel by combining all Task() calls into a single message:
<invoke name="Agent">
<parameter name="description">spike-question-1</parameter>
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="model">sonnet</parameter>
<parameter name="prompt">
[SPIKE_CONTEXT for question 1]
<instructions>
[SUBAGENT_INSTRUCTIONS for question 1]
</instructions>
</parameter>
</invoke>
<invoke name="Agent">
<parameter name="description">spike-question-2</parameter>
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="model">sonnet</parameter>
<parameter name="prompt">
[SPIKE_CONTEXT for question 2]
<instructions>
[SUBAGENT_INSTRUCTIONS for question 2]
</instructions>
</parameter>
</invoke>
<invoke name="Agent">
<parameter name="description">spike-question-3</parameter>
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="model">sonnet</parameter>
<parameter name="prompt">
[SPIKE_CONTEXT for question 3]
<instructions>
[SUBAGENT_INSTRUCTIONS for question 3]
</instructions>
</parameter>
</invoke>
Important: All Task() invocations must be in a SINGLE message to execute simultaneously. This maximizes efficiency when investigating multiple independent technical questions.
The subagent will create artifacts in the scratchpad directory. Review these to ensure quality:
For Comparison Spikes (testing multiple approaches):
comparison.md provides side-by-side analysisrecommendation.md contains clear selection rationaleresults.md follows the Comparison Result TemplateFor Validation Spikes (testing single approach):
test-implementation/ directory contains working test coderesults.md contains pass/fail determination with evidenceCheck that spike results meet quality criteria:
Comparison Spikes Should Have:
Validation Spikes Should Have:
Quality Criteria (Both Types):
If spike results have these problems, request revision:
After validating spike quality, incorporate findings:
Add to Technical Spike Results section (if plan has this section):
Update Technical Approach section:
Update Technology Stack (if needed):
Summarize findings in conversational language:
Example: "I tested three real-time communication approaches in the scratchpad. Socket.io with Redis adapter provided the best combination of bidirectional support and horizontal scaling. The prototypes confirmed it works with our Express.js setup, so I've updated the Technical Approach to use Socket.io v4.6.1."