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.
Provides reusable patterns for GitHub CLI error handling, duplicate detection, batch tracking, and Projects metadata updates. Automatically triggers when commands need recovery flows, idempotency checks, or consistent operation summaries.
/plugin marketplace add sjnims/requirements-expert/plugin install requirements-expert@requirements-expert-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/pattern-usage.mdreferences/implementation-details.md| 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