xiaohongshu
xiaohongshu
executing-plans-review
Verification, drift detection, and snapshot logic for executing-plans
Full skill instructions
This document contains detailed verification, drift detection, and snapshot logic for the executing-plans skill.
Save context snapshots to enable recovery after compaction events. This preserves the executing-plans skill's state and progress across context compaction.
Call saveSnapshot() at these critical points:
FUNCTION saveSnapshot():
session = current session name
// Read current state via MCP
Tool: mcp__plugin_mermaid-collab_mermaid__get_session_state
Args: { "project": "<cwd>", "session": session }
Returns: state = { "phase": "...", "completedTasks": [...], "pendingTasks": [...], ... }
// Save snapshot via MCP
Tool: mcp__plugin_mermaid-collab_mermaid__save_snapshot
Args: {
"project": "<cwd>",
"session": session,
"activeSkill": "executing-plans",
"currentStep": "implementation",
"inProgressItem": null,
"pendingQuestion": null,
"recentContext": [
{
"type": "progress",
"content": "Completed tasks: {state.completedTasks}. Pending: {state.pendingTasks}. Last wave: {wave number}"
}
]
}
// Note: version and timestamp are automatically added
// Update collab state to mark snapshot exists
Tool: mcp__plugin_mermaid-collab_mermaid__update_session_state
Args: {
"project": "<cwd>",
"session": session,
"hasSnapshot": true,
"lastSnapshot": "<current-ISO-timestamp>"
}
After wave completes with test suite passing:
[Wave N tasks all complete]
-> Run full test suite: npm run test:ci
-> If tests FAIL: Stop, report failure (don't save)
-> If tests PASS:
- saveSnapshot()
- Update task diagram (all Wave N tasks -> "completed")
- Show wave completion report
- Proceed to next wave
Example snapshot after Wave 1:
{
"version": 1,
"timestamp": "2026-01-21T14:35:22Z",
"activeSkill": "executing-plans",
"currentStep": "implementation",
"completedTasks": ["task-planning-skill", "gather-goals-types", "brainstorming-cleanup"],
"pendingTasks": ["collab-routing", "executing-plans-tdd-skip", "pre-compact-script"],
"recentContext": [
{
"type": "progress",
"content": "Completed tasks: task-planning-skill, gather-goals-types, brainstorming-cleanup. Pending: 3 tasks. Last wave: 1"
}
]
}
After each task completes (per-task verification):
[Task execution completes]
-> Compare implementation against design doc
-> Check for drift
-> If verification PASSES:
- saveSnapshot() with updated completedTasks list
- Unlock dependent tasks
- Proceed to next ready task
-> If verification FAILS:
- Keep task as in_progress
- Request fixes before saving
Before batch completion report:
[All ready tasks complete, about to report to user]
-> saveSnapshot()
-> Show progress report with completed tasks
-> Show which tasks are ready next
-> Wait for user feedback
At final completion:
[All tasks complete and verified]
-> saveSnapshot()
-> Show implementation summary
-> Invoke finishing-a-development-branch skill
-> (After finishing-a-development-branch completes: cleanup collab session)
When within a collab workflow, run verification after each task completes:
Verification Steps:
verify-phase hook (if available)On Verification Success:
collab-state.json: move task from pendingTasks to completedTaskslastActivity timestampFUNCTION markTaskComplete(taskId):
session = current session name
// 1. Read current state
Tool: mcp__plugin_mermaid-collab_mermaid__get_session_state
Args: { "project": "<cwd>", "session": session }
Returns: state = { "completedTasks": [...], "pendingTasks": [...], ... }
// 2. Move task from pending to completed
newCompleted = [...state.completedTasks, taskId]
newPending = state.pendingTasks.filter(t => t !== taskId)
// 3. Update session state via MCP (updates progress bar)
Tool: mcp__plugin_mermaid-collab_mermaid__update_session_state
Args: {
"project": "<cwd>",
"session": session,
"completedTasks": newCompleted,
"pendingTasks": newPending
}
// 4. Update task execution diagram (visual progress)
// Change from executing (blue) to completed (green)
Tool: mcp__plugin_mermaid-collab_mermaid__patch_diagram
Args: {
"project": "<cwd>",
"session": session,
"id": "task-execution",
"old_string": "style {taskId} fill:#bbdefb,stroke:#1976d2,stroke-width:3px", // executing
"new_string": "style {taskId} fill:#c8e6c9,stroke:#2e7d32" // completed
}
// If patch fails (task wasn't marked executing), try from waiting state:
// old_string: "style {taskId} fill:#e0e0e0,stroke:#9e9e9e" // waiting
IMPORTANT: You MUST call markTaskComplete(taskId) after each task passes verification. This:
On Verification Failure:
in_progress (not completed)Unlocking Dependents:
for each task T where T.depends-on includes completed_task:
if all(T.depends-on) are completed:
move T from pending to ready
After implementer reports completion, check for drift:
Read design doc: Tool: mcp__plugin_mermaid-collab_mermaid__get_document Args: { "project": "<cwd>", "session": "<session>", "id": "design" }
Read implemented files (from task's file list)
FOR each function/type in the task's Interface section: Compare: - Function name matches? - Parameter names and types match? - Return type matches? - Logic follows Pseudocode steps?
IF mismatch found: ADD to drift_list: { type: "signature" | "logic" | "scope" | "missing", design_says: <from design doc>, implementation_has: <from code>, file: <file path>, line: <line number if applicable> }
IF drift_list is not empty: FOR each drift in drift_list:
Analyze:
severity = assess_severity(drift) // contract vs detail
intent = assess_intent(drift) // improvement vs misunderstanding
precedent = assess_precedent(drift) // will this encourage more drift?
reversibility = assess_reversibility(drift)
Generate pros:
- [benefit of keeping this change]
- [another benefit if applicable]
Generate cons:
- [drawback of keeping this change]
- [another drawback if applicable]
Determine recommendation:
IF drift.type == "signature": recommend = "REJECT"
ELSE IF drift.type == "logic" AND same_result: recommend = "ACCEPT"
ELSE IF drift.type == "scope": recommend = "REJECT"
ELSE IF drift.type == "missing": recommend = "REJECT"
Present to user:
```
DRIFT DETECTED in task [task-id]:
## What Changed
| Type | Design Says | Implementation Has |
|------|-------------|-------------------|
| {drift.type} | {drift.design_says} | {drift.implementation_has} |
## Analysis
**Pros of keeping this change:**
- {pro1}
- {pro2}
**Cons of keeping this change:**
- {con1}
- {con2}
**Suggested choice:** {recommend}
**Reasoning:** {explanation based on severity, intent, precedent, reversibility}
## Your Decision
1. Reject - revert and re-implement per design
2. Accept - update design doc to include this change
3. Discuss - need more context before deciding
```
IF user chooses "Reject":
IF user chooses "Accept":
IF user chooses "Discuss":
IF drift_list is empty:
When drift is detected and requires a design doc update, use the proposed tag:
For section-level changes:
<!-- status: proposed: <drift-description> -->
<new-section-content>
For inline changes:
<!-- propose-start: <drift-description> --><new-text><!-- propose-end -->
Process:
Tool: mcp__plugin_mermaid-collab_mermaid__patch_document
Args: {
"project": "<cwd>",
"session": "<session>",
"id": "design",
"old_string": "<unique text at insertion point>",
"new_string": "<unique text><!-- propose-start: description --><content><!-- propose-end -->"
}
mcp__plugin_mermaid-collab_mermaid__update_document({ "id": "design", "content": <updated> })After user decision:
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