xiaohongshu
xiaohongshu
discover
Discovery-first development workflow. Use BEFORE creating worktrees for any non-trivial feature. Explores requirements through questions, proposes approaches, validates design incrementally, and generates implementation plans with verification commands.
Full skill instructions
Turn ideas into validated designs and executable plans through structured dialogue.
Always use /discover before worktree creation when:
Skip discovery for:
The discovery process has three phases:
Phase 1: Understand → Ask questions, explore codebase
Phase 2: Design → Propose approaches, validate design
Phase 3: Plan → Write executable implementation plan
Key principles:
Before asking any questions, explore the codebase to understand:
Use Task tool with subagent_type=Explore to search:
- Related files and patterns
- Existing similar features
- Architecture and conventions
Use AskUserQuestion tool to ask ONE question at a time.
Question design principles:
Example questions:
// Good: Specific, multiple choice, has recommendation
AskUserQuestion({
questions: [{
question: "Should webhooks support retry on failure?",
header: "Retry behavior",
options: [
{ label: "Yes, with exponential backoff (Recommended)", description: "Retries 3 times with 1s, 5s, 30s delays" },
{ label: "Yes, with fixed interval", description: "Retries 3 times with 30s delay each" },
{ label: "No retries", description: "Single delivery attempt, failures logged only" }
],
multiSelect: false
}]
})
// Bad: Too many questions at once
AskUserQuestion({
questions: [
{ question: "Retry behavior?", ... },
{ question: "Payload format?", ... },
{ question: "Authentication?", ... }, // Too many!
{ question: "Rate limiting?", ... }
]
})
Question topics to cover:
Stop asking when you can confidently:
Present 2-3 different approaches with trade-offs:
## Approach Options
### Option A: Event-driven webhooks (Recommended)
**How it works:** Events emit to a queue, webhook service consumes and delivers.
**Pros:**
- Decoupled from main flow
- Easy to add retry logic
- Scalable
**Cons:**
- More infrastructure (queue)
- Eventual consistency
**I recommend this because:** It matches our existing event patterns and
keeps webhook delivery from blocking core operations.
### Option B: Synchronous webhooks
**How it works:** Direct HTTP call during event handling.
**Pros:**
- Simpler, no queue needed
- Immediate feedback
**Cons:**
- Blocks event processing
- No built-in retry
- Harder to scale
Ask user to confirm approach:
AskUserQuestion({
questions: [
{
question: 'Which approach should we use?',
header: 'Approach',
options: [
{
label: 'Option A: Event-driven (Recommended)',
description: 'Queue-based delivery with retry support',
},
{ label: 'Option B: Synchronous', description: 'Direct HTTP calls, simpler but blocking' },
],
multiSelect: false,
},
],
});
After approach is selected, present the detailed design in 200-300 word sections.
After each section, ask: "Does this section look right?"
Sections to cover:
// After presenting a section
AskUserQuestion({
questions: [
{
question: 'Does this data model design look right?',
header: 'Data model',
options: [
{ label: 'Yes, proceed', description: 'Move to the next section' },
{ label: 'Needs adjustment', description: 'I have feedback on this section' },
],
multiSelect: false,
},
],
});
Create a plan document at:
docs/plans/YYYY-MM-DD-<feature-name>.md
Plan structure:
# [Feature Name] Implementation Plan
**Goal:** One sentence describing what this builds
**Architecture:** 2-3 sentences about the approach
**Key decisions:**
- Decision 1 and why
- Decision 2 and why
---
## Tasks
### Task 1: [Component Name]
**Independent:** Yes/No (if No, list dependencies)
**Estimated scope:** Small (1-2 files) / Medium (3-5 files) / Large (6+ files)
**Files:**
- Create: `exact/path/to/new-file.ts`
- Modify: `exact/path/to/existing.ts` (lines 45-67)
- Test: `exact/path/to/test-file.test.ts`
**Steps:**
1. Write failing test for [specific behavior]
```typescript
// Exact test code
```
pnpm test path/to/test → Expect: FAIL with "[specific error]"// Key implementation code (not everything, but enough to guide)
pnpm test path/to/test → Expect: PASSgit commit -m "feat: add [component]"Verification: pnpm test path/to/test --grep "specific test"
Acceptance criteria:
Task 1 (independent) ──┐
├──► Task 3 ──► Task 4
Task 2 (independent) ──┘
Parallelizable: Tasks 1, 2 Sequential: Task 3 (after 1,2), Task 4 (after 3)
| Task | Verification Command | Expected Output |
|---|---|---|
| 1 | pnpm test packages/core --grep WebhookConfig | All tests pass |
| 2 | pnpm test packages/core --grep WebhookDelivery | All tests pass |
| 3 | pnpm build | Exit code 0 |
| 4 | pnpm test:e2e --grep webhook | E2E tests pass |
### Step 7: Handoff to Worktree
After plan is written, offer to create worktree:
```javascript
AskUserQuestion({
questions: [{
question: "Plan saved to docs/plans/2026-02-01-webhook-support.md. Ready to create worktree?",
header: "Create worktree",
options: [
{ label: "Yes, create worktree now (Recommended)", description: "Creates isolated worktree with plan already loaded" },
{ label: "No, I'll review the plan first", description: "You can create worktree later with /worktree-manager" },
{ label: "Make changes to the plan", description: "Edit the plan before proceeding" }
],
multiSelect: false
}]
})
If user says yes, invoke worktree creation:
# Using Skill tool
Skill(skill: 'claude-worktree-manager', args: 'create <feature-name> --plan docs/plans/YYYY-MM-DD-<feature-name>.md')
User: /discover add webhook support for integrations
Agent: [Explores codebase - finds existing integration patterns, event system]
Agent: [AskUserQuestion]
"What events should trigger webhook delivery?"
□ Integration lifecycle (connected, disconnected) (Recommended)
□ Agent actions (tool calls, completions)
□ All events (comprehensive but noisy)
User: "Integration lifecycle"
Agent: [AskUserQuestion]
"Should webhooks support retry on failure?"
□ Yes, with exponential backoff (Recommended)
□ No retries
...
[After enough questions]
Agent: "Based on our discussion, here are two approaches..."
[Presents options, user picks one]
Agent: "Let me walk through the design. First, the data model..."
[Presents 250 words on data model]
"Does this look right?"
User: "Yes, proceed"
Agent: [Continues through all sections]
Agent: "Writing implementation plan..."
[Writes docs/plans/2026-02-01-webhook-support.md]
Agent: [AskUserQuestion]
"Plan complete. Ready to create worktree?"
□ Yes, create worktree now
User: "Yes"
Agent: [Creates worktree with plan]
"Worktree created at ~/claude-worktrees/orient/webhook-support-1234567890
The worktree agent will read the plan at docs/plans/2026-02-01-webhook-support.md
and execute tasks with verification."
After discovery:
claude-worktree-manager - Creates isolated worktree with planworktree-operations - Guides development in worktreePlan execution (in worktree):
For certain task types, recommend specialized agents in .claude/agents/ instead of general worktrees:
| Task Type | Recommended Agent | When to Use |
|---|---|---|
| Code review | /agent code-reviewer | PR reviews, pattern enforcement, code audits |
| Writing tests | /agent test-writer | Adding tests, improving coverage, debugging test failures |
| Database changes | /agent migration | Schema changes, new tables, column modifications |
| OAuth integrations | /agent integration | Adding new services (Linear, Notion, GitHub, etc.) |
| Documentation | /agent docs | README updates, skill creation, API docs |
When to recommend agents vs worktrees:
Example recommendations in discovery:
// If user wants to add tests
"For adding tests, I recommend using `/agent test-writer` which is
specialized for writing and running tests with Vitest patterns."
// If user wants schema changes
"Database migrations require extra care. I recommend `/agent migration`
which uses Opus model and has safety checks for destructive operations."
// If user wants a larger feature with multiple concerns
"This feature involves schema changes, new API endpoints, and tests.
Let's create a full implementation plan and use a worktree."
Don't:
Do:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience