This skill should be used when the user asks to "implement recovery flow", "add error handling to command", "handle gh operation failures", "implement idempotency check", "prevent duplicate issues", "check before creating", "implement batch tracking", "track created and failed items", "implement two-layer metadata", "update custom fields and labels", "standardize command patterns", or when developing or modifying /re:* commands that need consistent error handling, duplicate detection, batch operation tracking, or GitHub Projects metadata updates.
From requirements-expertnpx claudepluginhub sjnims/requirements-expert --plugin requirements-expertThis skill uses the workspace's default tool permissions.
examples/pattern-usage.mdreferences/implementation-details.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Configures Istio traffic management with VirtualServices, DestinationRules for routing, canary/blue-green deployments, circuit breakers, load balancing, and fault injection in service meshes.
| Pattern | Purpose | Section |
|---|---|---|
| Recovery Flow | Handle gh operation failures | Interactive error recovery |
| Idempotency Check | Prevent duplicate issue creation | Query-before-create |
| Batch Tracking | Track multi-item operation results | Summary reporting |
| Two-Layer Metadata | Update custom fields AND labels | GitHub Projects metadata |
Commands reference these patterns by name rather than reimplementing. When developing or modifying /re:* commands, apply the relevant patterns to ensure consistent behavior across the plugin.
Pattern application:
For full implementation details, see references/implementation-details.md.
These four patterns provide consistent, reusable behavior across all /re:* commands:
Each pattern is designed for AI consumption—terse core definitions with detailed implementations in references/.
When: Any gh CLI operation fails (network, auth, permissions, rate limit).
Options: Present via AskUserQuestion:
| Option | Action |
|---|---|
| Retry | Re-attempt the failed operation |
| Skip | Add to failed[], continue to next item |
| Check permissions | Run gh auth status, display result, re-ask |
| Stop | Exit immediately with summary of completed work |
AskUserQuestion Structure:
header: "Operation Failed"
question: "[Operation] failed: [error message]. How would you like to proceed?"
options:
- label: "Retry"
description: "Attempt the operation again"
- label: "Skip"
description: "Skip this item and continue with the next"
- label: "Check permissions"
description: "Verify GitHub CLI authentication status"
- label: "Stop"
description: "Stop processing and show summary"
Variations:
re:init: 3-option (no Skip) - single operation, nothing to skipre:discover-vision: Adds "Save draft" - preserve work on failureWhen: Before creating any GitHub issue (vision, epic, story, task).
Flow:
gh issue list --repo [repo] --label "type:[type]" --json number,titleAskUserQuestionAskUserQuestion Structure:
header: "Duplicate Found"
question: "An issue titled '[title]' already exists (#[number]). How would you like to proceed?"
options:
- label: "Skip"
description: "Keep existing issue, don't create duplicate"
- label: "Update"
description: "Update the existing issue with new content"
- label: "Create anyway"
description: "Create new issue despite duplicate"
Tracking integration:
skipped[] with existing issue numberupdated[] after successful editcreated[]When: Processing multiple items (epics, stories, tasks, priority updates).
Lists: Initialize at command start:
created[] – New items successfully createdskipped[] – Items skipped (duplicates or user choice)updated[] – Existing items modifiedfailed[] – Operations that failed (with error reason)Summary Output Template:
## Summary
**Created:** [N] new [item-type]
- #[number] - [Title]
- #[number] - [Title]
**Updated:** [N] existing [item-type]
- #[number] - [Title] (updated [fields])
**Skipped:** [N] [item-type] (duplicates)
- [Title] (existing #[number])
**Failed:** [N] [item-type]
- [Title]: [error reason]
Display rules:
#[number] linksVariation: re:prioritize adds partial[] for items where custom field updated but label failed.
When: Setting Type, Priority, or Status on GitHub Project items.
Why two layers:
| Layer | Command | Purpose |
|---|---|---|
| Custom Field | gh project item-edit --field-id [id] --value "[val]" | Project views, boards, filtering |
| Label | gh issue edit [number] --add-label "[label]" | Cross-project queries, GitHub search |
Operation order: Always update custom field first, then label.
Label mapping:
| Field Value | Label |
|---|---|
| Vision | type:vision |
| Epic | type:epic |
| Story | type:story |
| Task | type:task |
| Must Have | priority:must-have |
| Should Have | priority:should-have |
| Could Have | priority:could-have |
| Won't Have | priority:wont-have |
Tracking integration:
updated[]partial[] (non-blocking)failed[]Patterns work together in command workflows:
For each item to process:
1. Idempotency Check → determines if create/update/skip
2. Create or Update operation
- On failure → Recovery Flow
- On success → Two-Layer Metadata Update
3. Track result in appropriate Batch Tracking list
After all items:
4. Display Batch Tracking Summary
Cross-pattern data flow:
| From Pattern | To Pattern | Data |
|---|---|---|
| Idempotency Check | Batch Tracking | skipped[], updated[] |
| Recovery Flow (Skip) | Batch Tracking | failed[] |
| Two-Layer Metadata | Batch Tracking | updated[], partial[], failed[] |
| Command | Recovery | Idempotency | Batch | Two-Layer |
|---|---|---|---|---|
| re:init | ✓ | ✓ | – | – |
| re:discover-vision | ✓ | ✓ | – | ✓ |
| re:identify-epics | ✓ | ✓ | ✓ | ✓ |
| re:create-stories | ✓ | ✓ | ✓ | ✓ |
| re:create-tasks | ✓ | ✓ | ✓ | ✓ |
| re:prioritize | ✓ | – | ✓ | ✓ |
| re:review | – | – | – | – |
| re:status | – | – | – | – |
For detailed implementation guidance:
references/implementation-details.md - Full implementation flows with code examplesWorking examples from actual commands:
examples/pattern-usage.md - Pattern application in re:identify-epics