xiaohongshu
xiaohongshu
hybrid-ralph
Hybrid architecture combining Ralph's PRD format with Planning-with-Files' structured approach. Auto-generates PRDs from task descriptions, manages parallel story execution with dependency resolution, and provides context-filtered agents for efficient multi-story development.
Full skill instructions
A hybrid architecture combining the best of three approaches:
At the START of any interaction, perform this check to recover context after compression/truncation:
Check if .hybrid-execution-context.md exists in the current directory
If YES:
/plan-cascade:hybrid-resume --autoIf NO but prd.json exists:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/hybrid-context-reminder.py" bothThis ensures context recovery even after:
Context compression (AI summarizes old messages)
Context truncation (old messages deleted)
New conversation session
Claude Code restart
Ralph: Structured PRD format (prd.json), progress tracking patterns, small task philosophy
Planning-with-Files: 3-file planning pattern (task_plan.md, findings.md, progress.txt), Git Worktree support
Claude Code Native: Task tool with subagents for parallel story execution
Generate a PRD from your task description:
/hybrid:auto Implement a user authentication system with login, registration, and password reset
This will:
Load an existing PRD file:
/hybrid:manual path/to/prd.json
After reviewing the PRD:
/approve
This begins parallel execution of stories according to the dependency graph.
project-root/
├── prd.json # Product Requirements Document
├── findings.md # Research findings (tagged by story)
├── progress.txt # Progress tracking
├── .current-story # Currently executing story
├── .locks/ # File locks for concurrent access
└── .agent-outputs/ # Individual agent logs
The prd.json file contains:
id: Unique story identifier (story-001, story-002, etc.)title: Short story titledescription: Detailed story descriptionpriority: high, medium, or lowdependencies: Array of story IDs this story depends onstatus: pending, in_progress, or completeacceptance_criteria: List of completion criteriacontext_estimate: small, medium, large, or xlargetags: Array of tags for categorizationStories are organized into execution batches:
Batch 1 (Parallel):
- story-001: Design database schema
- story-002: Design API endpoints
Batch 2 (After story-001 complete):
- story-003: Implement database schema
Batch 3 (After story-002, story-003 complete):
- story-004: Implement API endpoints
Each agent receives only relevant context:
This keeps context windows focused and efficient.
Filters and extracts relevant context for specific stories.
# Get story details
python3 context_filter.py get-story story-001
# Get context for a story
python3 context_filter.py get-context story-001
# Get execution batch
python3 context_filter.py get-batch 1
# Show full execution plan
python3 context_filter.py plan-batches
Thread-safe file operations with platform-specific locking.
# Read PRD
python3 state_manager.py read-prd
# Mark story complete
python3 state_manager.py mark-complete story-001
# Get all story statuses
python3 state_manager.py get-statuses
Generates PRD from task descriptions and manages story dependencies.
# Validate PRD
python3 prd_generator.py validate
# Show execution batches
python3 prd_generator.py batches
# Create sample PRD
python3 prd_generator.py sample
Manages parallel execution of stories.
# Show execution plan
python3 orchestrator.py plan
# Show execution status
python3 orchestrator.py status
# Execute a batch
python3 orchestrator.py execute-batch 1
Generate PRD from task description.
/hybrid:auto <task description>
Load existing PRD file.
/hybrid:manual [path/to/prd.json]
Create a new Git worktree with isolated environment and initialize Hybrid Ralph mode. This is the primary command for multi-task parallel development.
/hybrid:worktree <task-name> <target-branch> <task-description-or-prd-path>
Arguments:
task-name: Name for the worktree (e.g., "feature-auth", "fix-api-bug")target-branch: Branch to merge into (default: auto-detect main/master)task-description-or-prd-path: Either a task description to generate PRD, or path to existing PRD fileExecution Steps:
When /hybrid:worktree is invoked, execute the following:
Parse Parameters: Extract task-name, target-branch, and PRD argument
Verify Git Repository: Ensure we're in a git repository
Detect Default Branch: Auto-detect main/master branch
Set Variables:
TASK_BRANCH="$TASK_NAME"
ORIGINAL_BRANCH=$(git branch --show-current)
ROOT_DIR=$(pwd)
WORKTREE_DIR="$ROOT_DIR/.worktree/$(basename $TASK_NAME)"
Determine PRD Mode: Check if third argument is existing file or task description
Check for Existing Worktree: If worktree exists, navigate to it; otherwise create new worktree
Create Git Worktree (if new):
git worktree add -b "$TASK_BRANCH" "$WORKTREE_DIR" "$TARGET_BRANCH"
cat > "$WORKTREE_DIR/.planning-config.json" << EOF
{
"mode": "hybrid",
"task_name": "$TASK_NAME",
"task_branch": "$TASK_BRANCH",
"target_branch": "$TARGET_BRANCH",
"worktree_dir": "$WORKTREE_DIR",
"original_branch": "$ORIGINAL_BRANCH",
"root_dir": "$ROOT_DIR",
"created_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
}
EOF
Create Initial Files in worktree (findings.md, progress.txt)
Navigate to Worktree:
cd "$WORKTREE_DIR"
Handle PRD:
PRD_MODE is "load": Copy PRD file to worktreePRD_MODE is "generate": Use Task tool with run_in_background=true to generate PRD
Validate and Display PRD: Show the generated/loaded PRD with review
Show Ready Summary with next steps
Smart PRD Detection:
Approve PRD and begin parallel story execution with batch progression.
/approve
Execution Steps:
Verify PRD Exists: Check if prd.json exists in current directory
Read and Validate PRD: Validate structure and required fields
Calculate Execution Batches: Analyze dependencies and create parallel execution batches
Choose Execution Mode: Ask user to select execution mode:
==========================================
Select Execution Mode
==========================================
[1] Auto Mode - Automatically progress through batches
Pause only on errors
[2] Manual Mode - Require approval before each batch
Full control and review
==========================================
Enter choice [1/2] (default: 1):
Initialize Progress Tracking: Create/initialize progress.txt with execution mode
Launch Batch 1 Agents: For each story in Batch 1, launch a background Task agent with this prompt:
You are executing story {story_id}: {title}
Description: {description}
Acceptance Criteria: {criteria}
Your task:
1. Read relevant code and documentation
2. Implement the story according to acceptance criteria
3. Test your implementation
4. Update findings.md with discoveries (use <!-- @tags: {story_id} -->)
5. Mark complete by appending to progress.txt: [COMPLETE] {story_id}
Execute all necessary bash/powershell commands directly to complete the story.
Work methodically and document your progress.
Monitor and Progress Through Batches:
Based on selected mode:
Auto Mode:
Manual Mode:
Show Completion Status: When all batches complete, show summary
Important:
Edit the PRD in your default editor.
/edit
Show execution status.
/status
1. /hybrid:auto "Implement feature X"
↓
2. Review generated PRD
↓
3. /edit (if needed) or /approve
↓
4. Agents execute stories in parallel batches
↓
5. Monitor with /status
↓
6. All stories complete
1. Create prd.json (or use template)
↓
2. /hybrid:manual prd.json
↓
3. Review and edit as needed
↓
4. /approve
↓
5. Execution begins
When updating findings.md, tag sections with relevant story IDs:
<!-- @tags: story-001,story-002 -->
## Database Schema Discovery
The existing schema uses UUIDs for primary keys...
This allows agents to receive only relevant findings.
Track progress in progress.txt:
[2024-01-15 10:00:00] story-001: [IN_PROGRESS] story-001
[2024-01-15 10:15:00] story-001: [COMPLETE] story-001
[2024-01-15 10:15:00] story-002: [IN_PROGRESS] story-002
The state manager uses platform-specific locking:
Lock files are stored in .locks/ directory.
If PRD validation fails:
/edit to fix issuesIf a story fails:
.agent-outputs/<story-id>.logIf dependency cycles are detected:
/show-dependencies output/edit to break cycles/hybrid:manualThis skill integrates seamlessly with planning-with-files:
/hybrid:manualUse the provided templates as starting points:
templates/prd.json.example - Example PRD structuretemplates/prd_review.md - PRD review display templatetemplates/findings.md - Structured findings templateError: No PRD found in current directory
Solution: Use /hybrid:auto to generate or /hybrid:manual to load.
TimeoutError: Could not acquire lock within 30s
Solution: Run python3 state_manager.py cleanup-locks to remove stale locks.
Validation Error: Unknown dependency 'story-005'
Solution: Edit PRD to fix dependency reference or add missing story.
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