بنقرة واحدة
pwrl-work-prepare
Set up execution environment, create task lists, and select execution mode
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Set up execution environment, create task lists, and select execution mode
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Extract, classify, deduplicate, structure, and save learnings from code, commits, tasks, and documentation
Create structured implementation plans with three tiers (Fast/Standard/Deep). Pure skill pipeline orchestrator—no agent routing.
Review code changes through 4-phase micro-skill pipeline (scope, prepare, analyze, report)
Execute implementation work efficiently through 4-phase micro-skill pipeline
Verify repository state and confirm session completion before committing.
Create a clear session commit with state and next steps. Orchestrates checkpoint and commit micro-skills, optionally chains to pwrl-learnings.
| name | pwrl-work-prepare |
| description | Set up execution environment, create task lists, and select execution mode |
| argument-hint | [Classified context from pwrl-work-triage] |
ask_user_question, ask_user, ask_user_input, vscode/askQuestions or any available extension/tool for user interaction for all decisionsPurpose: Bridges triage output and task execution. Confirms branch strategy, creates or updates task lists, detects the appropriate execution mode (inline/serial/parallel), checks GitHub integration readiness, and produces a prepared context ready for execution.
Accepts a classified context object from pwrl-work-triage:
unit-id, dependencies, files, etc.)units, complexity, etc.)prompt, complexity, etc.)branchStrategy: new-branch | direct-commit
branchName: feat/xyz | null
taskList:
source: plan | task | prompt
taskCount: 5
tasks:
- unit-id: S1
file: docs/tasks/in-progress/2026-06-05-s1-task.md
dependencies: []
status: in-progress
executionMode: inline | serial | parallel
executionModeReasoning: "3+ tasks with dependencies → serial"
githubIntegration:
enabled: true | false
tasksLinked: 3
readyForSync: true | false
Ask user and document the branch approach:
Prompt: "Should this work be on a new branch or commit directly to the current branch ([current-branch])?
Rules:
If new branch:
feat/<short-description> or fix/<short-description>git checkout -b <name>Branch created: <name>If direct commit:
Output:
branchStrategy: new-branch
branchName: feat/slice-pwrl-work
branchCreated: true
When the triage output is from a plan file:
units list:
docs/tasks/to-do/YYYY-MM-DD-[unitId]-[slug].md---
unit-id: U1
plan: docs/plans/YYYY-MM-DD-NNN-plan.md
status: to-do
created: YYYY-MM-DD
dependencies: [list from plan]
files: [list from plan]
---
Populate task body with:
Create or update docs/tasks/INDEX.md:
Important: If task files already exist (detected by matching unitId in frontmatter), skip creation and use existing files
When triage output is a single task file:
CRITICAL: Move task file docs/tasks/to-do/ → docs/tasks/in-progress/
to-do/ folderstatus: to-do → status: in-progressdocs/tasks/in-progress/ with same filenameto-do/Task moved: docs/tasks/to-do/[file] → docs/tasks/in-progress/[file]Verify dependencies:
docs/tasks/INDEX.md (or INDEX-S*.md) for each dependency's statusto-do or in-progress: warn userUpdate docs/tasks/INDEX.md:
Status Transition:
to-do/ (status: to-do) → in-progress/ (status: in-progress)
When triage output is a bare prompt:
NEW: Task Status State Machine & Validation
Before detecting mode, validate task status transitions:
State Diagram:
to-do → in-progress → for-review → done
↑ │
└────────────── blocked ◄────────────┘
Transition Validation Rules:
done if any dependencies not done → Error: "Cannot mark done: S2 still in-progress"in-progress if already for-review → Error: "Review must complete before re-entering in-progress"Validation pseudocode:
validateTransition(taskId, newStatus):
currentStatus = taskCurrentStatus(taskId)
if currentStatus == newStatus:
return OK # Idempotent
# Get dependencies from globalDependencyGraph
deps = graph.getDependencies(taskId)
if newStatus == "done":
for dep in deps:
if dep.status != "done" and dep.status != "for-review":
return ERROR("Cannot mark done: {dep.unit-id} still {dep.status}")
return OK
Apply to all tasks in taskList:
Execute Automatic Mode Selection
Apply automatic mode selection based on task count, dependencies, and file conflicts:
Decision tree (updated for cross-plan):
taskCount = number of tasks in taskList
if taskCount <= 2:
→ INLINE (direct execution, no subagents needed)
if taskCount >= 3:
→ Check dependency graph (including cross-plan edges)
→ Build file-to-task map from each task's `files` field
→ Detect any file conflicts (same file touched by 2+ tasks)
if any dependencies exist between tasks:
IF critical path spans multiple plans:
→ SERIAL (forced; need sync points between groups)
ELSE:
→ Check for file conflicts
if file conflicts detected:
→ SERIAL (forced; parallel would create race conditions)
else:
→ PARALLEL with topological grouping (see step 5 below)
else if any file conflicts detected:
→ SERIAL (forced; parallel would create race conditions)
else:
→ PARALLEL (independent tasks with no file overlap; use parallelization groups)
File conflict detection heuristic:
files fieldCritical path analysis for cross-plan:
criticalPathMultiPlan: true/falseParallel execution constraints:
Output:
executionMode: serial
executionModeReasoning: "5 tasks with sequential dependency chain (S1→S2→S3→S5→S6→S7)"
hasFileLevelConflicts: false
conflictingFiles: []
parallelSafetyGate: not-applicable
criticalPathMultiPlan: false
Purpose: Generate task parallelization clusters for parallel/cross-plan execution.
Algorithm (Modified Kahn's Topological Sort):
topologicalSortWithGroups(tasks, dependencies):
inDegree = computeInDegrees(tasks, dependencies)
groups = []
current_group = []
while tasks_remaining:
# Find all tasks with inDegree == 0 (no remaining dependencies)
ready_tasks = [t for t in tasks if inDegree[t] == 0]
if NOT ready_tasks:
return ERROR("Circular dependency detected")
# Check for file conflicts within ready_tasks
for task in ready_tasks:
# If task conflicts with any already in current_group, start new group
if hasFileConflict(task, current_group):
if current_group:
groups.append(current_group)
current_group = [task]
else:
current_group.append(task)
# Move to next level
for task in ready_tasks:
inDegree[task] = -1 # Mark as processed
for dependent in dependencies[task]:
inDegree[dependent] -= 1
if current_group:
groups.append(current_group)
return { parallelGroups: groups, syncPoints: [after-group-N for N in 1..len(groups)] }
Output format:
parallelGroups:
- group: 0
tasks: [S1, U1, U2] # These can run parallel (no file conflicts)
duration_estimate: "5 min"
- group: 1
tasks: [S2, U3] # Depends on group 0; can run parallel within group
duration_estimate: "3 min"
- group: 2
tasks: [S3] # Single task
duration_estimate: "2 min"
syncPoints:
- syncPoint: 0
after_group: 0
validation: "No file conflicts; commit atomically"
- syncPoint: 1
after_group: 1
validation: "No file conflicts; commit atomically"
execution_strategy: "Parallel within groups; serial between groups; atomic commits per sync point"
cross_plan_groups:
{ group_0: ["plan-A", "plan-B"], group_1: ["plan-A"], group_2: ["plan-A"] }
Step 1 — Multi-plan task discovery:
docs/tasks/**/*.md (all plans)unit-id and plan fieldunit-id matches current task → found existing taskunit-id found in different plan → error "Duplicate unit-id: S1 in plans A and B"Step 2 — Cross-reference validation:
plan field in task frontmatter matches the plan we're executingStep 3 — Status field validation:
to-do → in-progress)Before proceeding to execution, present a summary and ask for confirmation:
📋 Preparation Summary
| Item | Value |
|---|---|
| Branch | feat/slice-pwrl-work (new) |
| Tasks | 5 tasks: S1 → S2 → S3 → S5 → S6 |
| Mode | Serial (dependent chain) |
| GitHub | Enabled, 3 tasks linked |
Ready to begin execution?
If cancelled:
Work cancelled by user at preparation checkpointin-progress| Scenario | Handling |
|---|---|
| Branch creation fails | Log git error; ask user: "Resolve git state manually or retry?" |
| Malformed task frontmatter | Log details; ask user to fix and retry |
| Circular dependencies detected | Fail; ask user to resolve circular references |
| User cancels at checkpoint | Exit gracefully; preserve current state |
| Blocking dependencies exist | Warn; ask user: "Proceed anyway or wait for dependencies?" |
| GitHub integration check fails | Log warning; continue without sync |
| Task file doesn't exist | Offer to create from plan; ask user: "Create task or provide different path?" |
| INDEX.md is missing | Create automatically; warn user |
| No tasks in task list | Block execution; ask user to review and confirm task list |
| Execution mode indeterminate | Ask user to specify preferred mode |
| Dependency chain >5 deep | Flag for review; user can accept or simplify |
| File conflicts detected | Force serial mode; inform user |
| GitHub sync skipped (missing issues) | Log warning; continue without sync |
Retry limit: 3 attempts per operation, then ask user to fix manually.
Fallback: If all retries fail, log the error and ask user: "Retry, skip, or abort?"
.pwrlrc.json — For GitHub integration checkdocs/analysis/2026-06-05-pwrl-work-structure-analysis.mdpwrl-work-triage/SKILL.mdpwrl-work skill (Phase 1: Prepare Context, lines 49-121)pwrl-work-execute (consumes prepared context)pwrl-work-sync-status (called for GitHub sync if enabled)