.claude/skills/pm-implement/SKILL.md
Implement a task, phase, or entire work package. Reads context, analyzes target files, implements code changes, runs tests, and updates task states. Auto-transitions linked entities on start and completion. Use when the user says "implement", "start working on", "execute", "build this", or references a task/phase/WP ID and wants code changes made.
npx skillsauth add pinkroosterai/PinkRoosterMcp pm-implementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Given a task ID, phase ID, or work package ID, load full context from PinkRooster, understand requirements, implement code changes, run tests, and update state. For phases and WPs, tasks are executed sequentially in dependency order.
Parse $ARGUMENTS to determine execution mode:
Task mode — format proj-{N}-wp-{N}-task-{N}:
-task-{N} suffixPhase mode — format proj-{N}-wp-{N}-phase-{N}:
-phase-{N} suffixWP mode — format proj-{N}-wp-{N}:
--dry-run flag: If present, perform Steps 1-3 only — show the execution plan without implementing. Remove the flag before ID parsing.
If the ID format doesn't match any pattern, report:
"Invalid ID format. Expected one of: proj-N-wp-N-task-N, proj-N-wp-N-phase-N, or proj-N-wp-N"
Call mcp__pinkrooster__get_work_package_details with the extracted WP ID.
From the response, extract:
name, description, plan, type, priority, state, linkedIssueIds, linkedFeatureRequestIdsphases[] with their tasks, ordered by phase numbername, description, acceptanceCriterianame, description, implementationNotes, targetFiles, attachments, blockedBy, statephases[].tasks[][targetTask]state is NOT terminal (Completed/Cancelled/Replaced)blockedBy first, then tasks whose blockers appear earlier in the queuePresent the execution plan:
## Execution Plan: {mode} mode
**WP**: {wpId} "{wpName}"
**Tasks to execute**: {count} of {totalTasks}
**Skipping**: {skippedCount} already terminal
| # | Task ID | Task Name | Phase | Blocked By |
|---|---------|-----------|-------|------------|
| 1 | {id} | {name} | {phase} | — |
| 2 | {id} | {name} | {phase} | {blocker} |
| ... |
If --dry-run: Display the plan and STOP. Report: "Dry run complete. Remove --dry-run to execute."
Before executing any tasks, automatically transition parent and linked entities to active states. No user confirmation needed — the user opted into implementation by invoking this skill.
Also create a rollback point so we can revert if things go wrong:
git stash push -m "pm-implement-checkpoint-{wpId}" --include-untracked 2>/dev/null; git stash pop 2>/dev/null
This ensures any unstaged user work is safe. Then note the current commit hash as the rollback target:
git rev-parse HEAD
Auto-activate WP: If the WP state is inactive (NotStarted or Blocked):
mcp__pinkrooster__create_or_update_work_package with projectId, workPackageId, and state: "Implementing"Auto-activate linked Issues: For each issue ID in linkedIssueIds:
mcp__pinkrooster__get_issue_details to check statemcp__pinkrooster__create_or_update_issue with projectId, issueId, and state: "Implementing"Auto-activate linked FRs: For each FR ID in linkedFeatureRequestIds:
mcp__pinkrooster__get_feature_request_details to check statusmcp__pinkrooster__create_or_update_feature_request with projectId, featureRequestId, and status: "InProgress"For each task in the queue, run the Task Execution Loop (Steps 5a–5h):
If task.blockedBy is non-empty:
If task.state is already terminal (Completed/Cancelled/Replaced):
Before reading target code, check if the task involves patterns or technologies not already established in the codebase. This step prevents wasted implementation time — getting the approach right upfront is cheaper than debugging a wrong approach.
When to research:
implementationNotes mention a library, pattern, or API you haven't seen in the codebase (e.g., "use HMAC-SHA256 signing", "implement exponential backoff", "add RFC 7807 ProblemDetails")When to skip (most tasks):
implementationNotes reference specific existing files to followHow to research:
WebSearch with targeted queries (e.g., "ASP.NET Core background service IHostedService pattern")WebFetch for specific library documentationIf targetFiles is provided:
mcp__serena__get_symbols_overview to understand structureIf targetFiles is empty:
Always: Use Serena's mcp__serena__find_symbol or mcp__serena__find_referencing_symbols to understand how existing code connects to what needs changing.
Call mcp__pinkrooster__create_or_update_task with:
taskId: the current task IDstate: ImplementingReport: "Task {taskId} → Implementing ({currentIndex}/{totalInQueue})"
## [{currentIndex}/{totalInQueue}] Implementing: {taskId} "{taskName}"
### Context
- **WP**: {wpName}
- **Phase**: {phaseName}
- **Description**: {taskDescription}
- **Implementation Notes**: {implementationNotes}
- **Target Files**: {list of files}
- **Research**: {key finding, if research was performed}
### Implementation Plan
1. {Step-by-step plan based on task details and code analysis}
2. ...
Execute the implementation plan:
After implementation, run tests in two tiers to balance speed and confidence:
Tier 1: Targeted tests (run first — fast feedback):
For .NET changes, identify the most relevant test file:
# If the task touches a specific service/controller, run its test class
dotnet test --filter "FullyQualifiedName~{RelevantTestClass}" PinkRooster.slnx
For Dashboard changes:
cd src/dashboard && npx vitest run {relevant-test-file} --reporter=verbose
If targeted tests pass, proceed to Tier 2. If they fail, fix and re-run targeted tests first.
Tier 2: Broad tests (run at phase boundaries or after Tier 1 passes):
dotnet test or npm test)If tests fail:
If a task's implementation breaks the build or tests and 3 fix attempts haven't resolved it:
git stash push -m "pm-implement-failed-{taskId}"## Implementation Failed: {taskId} "{taskName}"
Failed after 3 fix attempts. Changes stashed as `pm-implement-failed-{taskId}`.
### Error
{last test/build error output}
### What was attempted
1. {fix attempt 1 summary}
2. {fix attempt 2 summary}
3. {fix attempt 3 summary}
### Recovery options
- Review stashed changes: `git stash show -p "stash@{0}"`
- Apply and fix manually: `git stash pop`
- Discard and retry: `git stash drop`
- Skip this task and continue: `/pm-implement {next-task-or-phase-id}`
Call mcp__pinkrooster__create_or_update_task with:
taskId: the current task IDstate: CompletedReport cascade results: If stateChanges are returned (phase auto-complete, WP auto-complete, auto-unblock), display them:
{taskId} "{taskName}" → Completed
Cascades:
- {entityType} {entityId}: {oldState} → {newState} ({reason})
Auto-complete linked entities on WP completion: If stateChanges contains a WP auto-complete:
linkedIssueIds — if the issue is not terminal:
mcp__pinkrooster__create_or_update_issue with state: "Completed"linkedFeatureRequestIds — if the FR is not terminal:
mcp__pinkrooster__create_or_update_feature_request with status: "Completed"Update local state: Mark this task as completed in the in-memory queue so subsequent dependency checks reflect the new state.
When stateChanges from Step 5h contains a phase auto-complete, run verification before proceeding to the next phase's tasks:
stateChanges for any entry where entityType is Phase and newState is Completed/pm-verify {phaseId} to verify all criteriaPhase {phaseId} verification failed:
- {criterionName}: {failureReason}
Fix the issues and re-run: `/pm-implement {remaining-phase-or-wp-id}`
Or skip verification and complete: `/pm-done {phaseId}`
Stop processing the queue — do not proceed to subsequent phases.This gate ensures each phase's acceptance criteria are met before moving on. In task mode, this step is skipped entirely (single-task execution doesn't trigger phase completion).
After all tasks in the queue have been processed:
## Execution Complete: {wpId or phaseId}
### Results
| Task ID | Task Name | Result |
|---------|-----------|--------|
| {id} | {name} | Completed |
| {id} | {name} | Skipped (blocked) |
| {id} | {name} | Already complete |
| {id} | {name} | Failed (stashed) |
### Stats
- **Implemented**: {count}
- **Skipped (blocked)**: {count}
- **Already terminal**: {count}
- **Failed**: {count}
### State Transitions
- WP {wpId}: {oldState} → {newState} (if changed)
- Issue {issueId}: {oldState} → {newState} (if auto-activated or auto-completed)
- FR {frId}: {oldStatus} → {newStatus} (if auto-activated or auto-completed)
- {All task/phase/WP cascades accumulated during execution}
### Changes Made
- {file}: {summary}
- ...
### Tests
- {test results summary}
### Next Steps
- **Task mode only**: Mark complete: `/pm-done {taskId}`
- **Phase/WP mode**: Verify criteria: `/pm-verify {wpId}` → then `/pm-done {wpId}`
- **Standalone WP completion**: If WP auto-completed, finalize linked entities: `/pm-done {wpId}`
- Continue with next priority: `/pm-next`
- Check overall progress: `/pm-status`
/pm-donetools
Verify acceptance criteria for a phase or entire work package. Runs verification based on each criterion's method (AutomatedTest, Manual, AgentReview) and records results via the MCP tool.
development
Diagnose the root cause of a bug, error, crash, or unexpected behavior. Traces through code, logs, services, database state, and git history to find why something is broken. Researches error messages online for known issues. Produces a diagnosis with evidence and suggested fix. Use when the user reports a problem, error message, stack trace, test failure, or says things like "why is this happening", "this is broken", "I'm getting an error", "something's wrong with...", "debug this", or "figure out why...".
development
Review and prioritize open issues and feature requests. Analyzes severity, age, and codebase impact to recommend priority adjustments and next steps.
tools
Show project status dashboard with issue/FR/WP counts, active items, blocked items, and priority next actions. Use when the user asks about project status, progress, what's happening, what needs attention, or what to work on.