| name | state-manager |
| description | Manage issue lifecycle states (close, reopen, update state) via Fractary CLI |
| model | haiku |
State Manager Skill
You handle closing issues, reopening issues, and transitioning between workflow states.
This skill is CRITICAL for FABER workflows - the Release phase depends on your close-issue operation to actually close issues when work is complete.
close-issue Parameters
issue_id(required): Issue identifierclose_comment(optional): Comment to post when closingwork_id(optional): FABER work identifier for trackingworking_directory(optional): Project directory path
Example Request
{
"operation": "close-issue",
"parameters": {
"issue_id": "123",
"close_comment": "Fixed in PR #456",
"work_id": "faber-abc123"
}
}
reopen-issue Parameters
issue_id(required): Issue identifierreopen_comment(optional): Comment to post when reopening
NOTE: reopen-issue CLI command is not yet implemented. Returns NOT_IMPLEMENTED error.
update-state Parameters
issue_id(required): Issue identifiertarget_state(required): Universal state name (open, closed)
NOTE: For GitHub, only closed state is supported via CLI. Use labels for intermediate states.
Close Issue
fractary work issue close <number> --json
CLI Response Format
Success:
{
"status": "success",
"data": {
"id": "123",
"number": 123,
"title": "Fix login page crash",
"state": "closed",
"closed_at": "2025-01-29T15:30:00Z",
"url": "https://github.com/owner/repo/issues/123"
}
}
Execution Pattern
# Close issue
result=$(fractary work issue close "$ISSUE_NUMBER" --json 2>&1)
cli_status=$(echo "$result" | jq -r '.status')
if [ "$cli_status" = "success" ]; then
issue_state=$(echo "$result" | jq -r '.data.state')
closed_at=$(echo "$result" | jq -r '.data.closed_at')
fi
Adding Close Comment (if provided)
If close_comment is provided, post comment before closing:
# Post comment first
fractary work comment create "$ISSUE_NUMBER" --body "$CLOSE_COMMENT" --json
# Then close
fractary work issue close "$ISSUE_NUMBER" --json
Purpose: Close an issue with optional comment
CLI Available: ✅ Yes
Flow:
- Validate issue_id present
- If close_comment provided, post comment first
- Execute
fractary work issue close <number> --json - Return normalized issue JSON with state=closed
Example Response:
{
"status": "success",
"operation": "close-issue",
"result": {
"id": "123",
"identifier": "#123",
"state": "closed",
"closedAt": "2025-01-29T15:30:00Z",
"url": "https://github.com/owner/repo/issues/123",
"platform": "github"
}
}
reopen-issue
Purpose: Reopen a closed issue with optional comment
CLI Available: ❌ No - Command not yet implemented
Response:
{
"status": "error",
"operation": "reopen-issue",
"code": "NOT_IMPLEMENTED",
"message": "CLI command 'issue reopen' not yet available",
"details": "See WORK-00356-1-missing-cli-work-commands.md for tracking"
}
update-state
Purpose: Transition issue to target workflow state
CLI Available: Partial - only closed state supported
Universal States:
open- Issue is open (use reopen - NOT IMPLEMENTED)in_progress- Use labels insteadin_review- Use labels insteaddone- Use labels insteadclosed- ✅ Supported viaissue close
Flow for closed state:
- Validate issue_id and target_state present
- If target_state is "closed", use
fractary work issue close - For other states, return NOT_IMPLEMENTED error
Success (close-issue):
{
"status": "success",
"operation": "close-issue",
"result": {
"id": "123",
"identifier": "#123",
"state": "closed",
"closedAt": "2025-01-29T15:30:00Z",
"url": "https://github.com/owner/repo/issues/123",
"platform": "github"
}
}
Error (reopen-issue):
{
"status": "error",
"operation": "reopen-issue",
"code": "NOT_IMPLEMENTED",
"message": "CLI command 'issue reopen' not yet available"
}
Error (issue not found):
{
"status": "error",
"operation": "close-issue",
"code": "NOT_FOUND",
"message": "Issue #999 not found"
}
Issue Not Found
- CLI returns error code "NOT_FOUND"
- Return error JSON with message "Issue not found"
Already Closed
- CLI may return warning
- Return success with current state
Authentication Failed
- CLI returns error code "AUTH_FAILED"
- Return error with auth failure message
Operation Not Implemented
- For reopen-issue and non-close update-state
- Return error with code "NOT_IMPLEMENTED"
CLI Not Found
- Check if
fractarycommand exists - Return error suggesting:
npm install -g @fractary/cli
Start/End Message Format
Start Message
🎯 STARTING: State Manager
Operation: close-issue
Issue ID: #123
Parameters: {close_comment, work_id}
───────────────────────────────────────
End Message (Success)
✅ COMPLETED: State Manager
Operation: close-issue
Issue: #123 → state=closed
Platform: github
───────────────────────────────────────
End Message (Not Implemented)
⚠️ NOT IMPLEMENTED: State Manager
Operation: reopen-issue
CLI command not yet available
See: WORK-00356-1-missing-cli-work-commands.md
───────────────────────────────────────
Dependencies
@fractary/cli >= 0.3.0- Fractary CLI with work modulejq- JSON parsing- work-manager agent for routing
Migration Notes
Previous implementation: Used handler scripts (handler-work-tracker-github, etc.) Current implementation: Uses Fractary CLI directly
Available Operations
- ✅
close-issue-fractary work issue close
Not Yet Available
- ❌
reopen-issue- Awaiting CLI implementation - ❌
update-state(non-closed) - Use labels for intermediate states
See specs/WORK-00356-1-missing-cli-work-commands.md for CLI implementation tracking.