بنقرة واحدة
pwrl-work-sync-status
Synchronize task status with GitHub Issues when integration is enabled
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Synchronize task status with GitHub Issues when integration is enabled
التثبيت باستخدام 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-sync-status |
| description | Synchronize task status with GitHub Issues when integration is enabled |
| argument-hint | [Task file path, new status, summary message (optional)] |
ask_user_question, ask_user, ask_user_input, vscode/askQuestions or any available extension/tool for user interaction for all decisionsPurpose: A reusable utility that synchronizes task status with GitHub Issues. Called by other micro-skills (pwrl-work-prepare, pwrl-work-execute) when GitHub integration is enabled. Gracefully skips if integration is disabled.
| Argument | Required | Description |
|---|---|---|
taskFile | Yes | Path to task file (e.g., docs/tasks/in-progress/u1-task.md) |
newStatus | Yes | New status value: to-do, in-progress, for-review, done, blocked |
summaryMessage | No | Brief summary to include in comment |
commitHash | No | Commit hash to reference in comment |
blockedReason | No | Reason for blocked status |
dryRun | No | Boolean flag (true) to preview without making changes |
success: true | false
action: synced | skipped | failed
issueNumber: 123 | null
labelsAdded: [in-progress]
labelsRemoved: [to-do]
commentPosted: true | false
error: error message | null
Read .pwrlrc.json to determine if GitHub Issues integration is enabled:
{
"integrations": {
"githubIssues": true,
"github": {
"owner": "wicttor",
"repo": "pwrl"
}
}
}
If githubIssues is false or missing:
{ success: true, action: "skipped", error: null }If githubIssues is true but no github.owner/github.repo:
{ success: false, action: "failed", error: "Missing owner/repo config" }If enabled and configured:
Check that the GitHub CLI is installed and authenticated:
gh auth status 2>/dev/null
If command fails:
gh auth login to authenticate"{ success: false, action: "failed", error: "GitHub CLI not authenticated" }If successful:
gh api user --jq .loginRead the task file frontmatter and extract the github-issue field:
---
unit-id: S1
github-issue: 123
---
If github-issue is missing or empty:
{ success: true, action: "skipped", error: null }If github-issue is present:
Manage issue labels based on task status:
Status-to-label mapping:
| Status | Labels to Add | Labels to Remove |
|---|---|---|
to-do | pwrl-task, to-do | in-progress, for-review, done, blocked |
in-progress | pwrl-task, in-progress | to-do, for-review, done, blocked |
for-review | pwrl-task, for-review | to-do, in-progress, done, blocked |
done | pwrl-task, done | to-do, in-progress, for-review, blocked |
blocked | pwrl-task, blocked | to-do, in-progress, for-review, done |
Implementation:
# Get current labels
gh issue view <issue> --json labels --jq '.labels[].name'
# Update labels
gh issue edit <issue> \
--add-label "<labels>" \
--remove-label "<labels>"
In dry-run mode:
[DRY-RUN] Would update issue #123:
Add labels: in-progress
Remove labels: to-do
Error handling:
404): Log warning, return action: "failed"action: "failed" with error messagePost an informative comment to the issue based on the new status:
Status: in-progress
🚀 Started work on this task
- **Task file:** `docs/tasks/in-progress/2026-06-05-u1-task.md`
- **Started:** 2026-06-05T12:00:00Z
- **Branch:** `feat/xyz` (if available)
- **Summary:** [optional summaryMessage]
Status: for-review
🔍 Ready for review
- **Implementation summary:** [optional summaryMessage]
- **Commits:** [optional commitHash]
- **Changed files:** [list of files modified — from task frontmatter]
Status: done
✅ Task complete
- **Completed:** 2026-06-05T14:00:00Z
- **Final commits:** [optional commitHash]
- **Review approval:** [reviewer, if available]
Status: blocked
🚫 Task blocked
- **Reason:** [blockedReason or "Unknown"]
- **Blocking task:** [unit ID from task, if specified]
- **Next steps:** [resolution needed]
Implementation:
gh issue comment <issue> -b "<formatted markdown>"
Error handling:
For certain status transitions:
When status → in-progress:
gh issue edit <issue> --add-assignee @meWhen status → done:
gh issue close <issue>gh issue edit <issue> --remove-assignee <user>When status → to-do or blocked:
gh issue reopen <issue> (for to-do)Log and return the sync result:
# Success
success: true
action: synced
issueNumber: 123
labelsAdded: [in-progress]
labelsRemoved: [to-do]
commentPosted: true
error: null
# Skipped (GitHub disabled or no issue linked)
success: true
action: skipped
issueNumber: null
labelsAdded: []
labelsRemoved: []
commentPosted: false
error: null
# Failed
success: false
action: failed
issueNumber: 123
labelsAdded: []
labelsRemoved: []
commentPosted: false
error: "Issue #123 not found in repository wicttor/pwrl"
| Scenario | Handling |
|---|---|
| GitHub disabled in config | Skip silently, return action: skipped |
| GitHub CLI not installed | Log warning, return action: failed, ask to install |
| Credentials not authenticated | Log warning, return action: failed, ask for gh auth login |
| Issue not found (404) | Log warning, return action: failed |
| API rate limit exceeded | Log error, return action: failed, suggest retry later |
| Network/API error | Log error, return action: failed with error message |
| Invalid issue number | Log error, return action: failed, ask to fix frontmatter |
| Comment posting fails | Log warning, continue (non-critical) |
Retry guidance:
gh auth login and retry.pwrlrc.jsonFor unit testing without GitHub CLI or credentials, mock the gh CLI using stubs:
If testing via shell scripts, create a mock gh wrapper:
# tests/mocks/gh-mock.sh
#!/bin/bash
# Mock GitHub CLI for testing
case "$1" in
auth)
echo "Authenticated as test-user"
exit 0
;;
issue)
if [[ "$3" == "123" ]]; then
echo '{"number": 123, "title": "Test Issue"}'
else
echo "HTTP 404: Issue not found" >&2
exit 1
fi
;;
api)
echo '{"login": "test-user"}'
;;
*)
echo "Unknown command: $1" >&2
exit 1
;;
esac
In test:
export PATH="./tests/mocks:$PATH"
/pwrl-work-sync-status tests/fixtures/task-mock.md in-progress
# Now uses mock-gh.sh instead of real gh CLI
Simplest: Disable GitHub integration in test config:
// tests/.pwrlrc.test.json
{
"integrations": {
"githubIssues": false
}
}
Skill will return action: skipped without any GitHub CLI calls.
If testing with real gh CLI but no real repo:
# Create test issue in real repo
gh issue create --title "Test sync issue" --body "For pwrl-work-sync-status tests"
# Use returned issue number in test fixtures
Update test fixture:
---
unit-id: TEST-1
github-issue: 9999 # Use real issue from your repo
---
Clean up after test: gh issue delete 9999
For CI/CD environments: Use Approach 2 (mock config disable) — requires no external dependencies, fastest For local development: Use Approach 1 (mock gh wrapper) — most realistic, covers error paths For integration tests: Use Approach 3 (real issue) — validates actual GitHub API behavior (but clean up after)
When dryRun: true, preview changes without making API calls:
/pwrl-work-sync-status docs/tasks/in-progress/u1-task.md in-progress --dryRun=true
Output:
[DRY-RUN] Would sync task U1 to GitHub issue #123:
- Add labels: in-progress
- Remove labels: to-do
- Post comment: "🚀 Started work..."
- Update assignee: wicttor
✅ Success if:
⚠️ Partial success if:
❌ Fail if:
gh) — For all GitHub API interactions.pwrlrc.json — For integration configurationpwrl-work-prepare (S3), pwrl-work-execute (S5).pwrlrc.json — integrations.githubIssues flag