Portfolio Work-Item Analysis Skill
Perform structured portfolio analysis against a shared API environment — mix reviews, SLA aging audits, and release-readiness assessments — using work items, targets, SLA policies, releases, milestones, blockers, and dependencies.
Environment
The task environment provides a base URL (<TASK_ENV_BASE_URL>) with endpoints and credentials documented in environment_access.md. That file lists:
- The base URL for all API calls.
- An optional
X-Env-Token header (name and value) required for POST /api/query (SQL endpoint).
- The set of allowed endpoints.
Endpoint catalog (availability varies per task):
| Method |
Path |
Purpose |
| GET |
/api/work-items |
List all work items |
| GET |
/api/work-items/{item_id} |
Single work item detail |
| GET |
/api/mix-targets |
Target category mix percentages per scope |
| GET |
/api/sla-policy |
SLA policy definitions |
| GET |
/api/releases |
List releases |
| GET |
/api/releases/{release_id} |
Single release detail |
| GET |
/api/milestones |
Milestones for a release |
| GET |
/api/dependencies |
Work-item dependency graph |
| GET |
/api/blockers |
Blockers on work items |
| POST |
/api/query |
Restricted SQL query (requires auth header) |
Always fetch the environment data fresh — do not assume cached values. Use only the endpoints listed in environment_access.md.
Data Integrity Rules
Primary vs. Duplicate Records
Work items can appear multiple times. For every scope, identify and use exactly one primary (canonical) record per logical work item:
- If a work item has a
duplicate_of field pointing to another item ID, it is a duplicate — exclude it from primary counts and list it in the duplicate cluster for the target primary.
- If multiple records share the same logical identity but none points to another, treat the one with the earliest
created_at (or the one referenced by others) as primary.
- Group duplicates into duplicate clusters: each cluster has a
primary_id and a sorted list of duplicate_ids.
Stale Mirror Fields
Never trust mirror, export, or computed snapshot fields that may be out of date. Always read authoritative source fields:
- For release status: use the live release API, not a mirrored
release_status on a work item.
- For work item state: use the work item's own status/state field, not a denormalized copy on a parent object.
- For category classification: use the work item's primary category field; if that is missing or ambiguous, fall back to labels and title signals in that order.
Cancelled and Distractor Records
- Cancelled items in scope are excluded from the primary working set. Report them in the exclusion list.
- Distractor records appear to match the scope (same quarter, teams, or product area) but are not primary closed portfolio work — exclude them from counts and list them separately.
Portfolio Categories
All work items are classified into exactly one of four categories:
| Category |
Description |
NewFeature |
New feature development, enhancements, user-facing additions |
TechDebt |
Technical debt reduction, refactoring, code quality, tooling |
Reliability |
Availability, performance, incident response, monitoring, resilience |
Security |
Vulnerabilities, auth/authz, encryption, compliance, threat mitigation |
Classification priority when signals conflict:
- The work item's explicit
portfolio_category or type field.
- The work item's
labels or tags.
- Keywords in the work item's
title.
If still ambiguous after all three signals, classify as TechDebt.
Ordering Conventions
Apply these stable orderings consistently:
| Entity |
Order |
| Work item ID lists |
Lexicographically ascending (string sort) |
| Team names |
Alphabetically ascending |
| Category rows in tables |
Fixed order: NewFeature, TechDebt, Reliability, Security |
| Included work items |
closed_at ascending, then ID ascending |
| Duplicate clusters |
By primary_id lexicographically |
| IDs within a duplicate cluster |
Lexicographically ascending |
| Milestone completion rows |
By milestone_id ascending |
| Dependency chains |
Lexicographically by the full path (joined with → or equivalent) |
| Under-invested categories |
Most negative gap to least negative gap |
| Escalation queue |
By severity descending (S1 before S2, etc.), then by age descending (oldest first) |
Precision Standards
| Metric |
Precision |
Example |
| Percentages (completion, mix shares, gaps) |
1 decimal place |
42.5 |
| Rates and scores (breach rate, readiness score) |
3 decimal places |
0.167 |
| Counts |
Integer |
12 |
Round using standard rounding (half-up). Do not round intermediate values — only round the final reported value.
Calculation Patterns
Mix Gap Analysis
For each category:
actual_pct = (category_count / total_included) × 100, rounded to 1 decimal place.
gap_pct = actual_pct − target_pct, rounded to 1 decimal place.
- A negative gap means under-investment.
- The category with the most negative gap is the largest deficit.
SLA Aging
- Overdue: a primary work item whose
age_days (from creation or SLA start to the as-of date) exceeds its SLA target. The SLA target is determined by the item's severity and category from the SLA policy data.
- Aging buckets: Count items by days since SLA start into buckets:
0–3, 4–7, 8–14, 15–30, 31+.
- Breach rate:
overdue_primary_count ÷ included_primary_count, rounded to 3 decimal places.
Release Readiness
- Ship decision: Based on milestone completion, unresolved high-impact blockers, and critical dependencies.
SHIP: all milestones at ≥ threshold, zero unresolved high-impact blockers, no critical dependency gaps.
SHIP_WITH_WATCH: minor gaps exist but are manageable with monitoring.
NO_SHIP: significant blockers, incomplete milestones, or broken dependency chains.
- Readiness score:
completed_primary_work ÷ total_primary_work, rounded to 3 decimal places.
- Gating work items: non-complete primary work items that block readiness (sorted, unique).
- Critical dependency chains: ordered paths from a blocked release work item through dependencies to a non-complete dependency.
Hotspot Analysis (SLA)
- For each team, count overdue primary records.
- The top hotspot is the
(team, owner) pair with the highest overdue count. If an owner is missing, report UNASSIGNED.
- Ties go to the first team alphabetically.
Output Convention
Return a single JSON object matching the supplied answer_template.json schema exactly:
- Do not include prose, explanations, or commentary outside the JSON.
- All required fields must be present.
- No additional properties beyond those defined in the schema.
- Use the exact enum values, field names, and structure from the template.
- Empty arrays must be
[], not null or absent.
Workflow
- Read the prompt and
answer_template.json to understand the scope and required output shape.
- Read
environment_access.md for the base URL, allowed endpoints, and query credentials.
- Fetch all relevant data from the environment endpoints — work items, targets, SLA policies, releases, milestones, blockers, dependencies as the task requires.
- Filter to in-scope records using the task's scope constraints (teams, quarter, product area, release ID, as-of date, etc.).
- Classify each included work item into exactly one portfolio category.
- Separate primary records from duplicates, cancelled items, and distractors.
- Calculate the required metrics using the formulas above.
- Order all lists according to the ordering conventions.
- Validate that every value matches the schema's constraints (enums, patterns, types, ranges).
- Return the single JSON object — nothing else.
1---2name: self-attempt-02-643description: Portfolio Work-Item Analysis Skill4---5# Portfolio Work-Item Analysis Skill67Perform structured portfolio analysis against a shared API environment — mix reviews, SLA aging audits, and release-readiness assessments — using work items, targets, SLA policies, releases, milestones, blockers, and dependencies.89## Environment1011The task environment provides a base URL (`<TASK_ENV_BASE_URL>`) with endpoints and credentials documented in `environment_access.md`. That file lists:1213- The base URL for all API calls.14- An optional `X-Env-Token` header (name and value) required for `POST /api/query` (SQL endpoint).15- The set of allowed endpoints.1617**Endpoint catalog** (availability varies per task):1819| Method | Path | Purpose |20|--------|------|---------|21| GET | `/api/work-items` | List all work items |22| GET | `/api/work-items/{item_id}` | Single work item detail |23| GET | `/api/mix-targets` | Target category mix percentages per scope |24| GET | `/api/sla-policy` | SLA policy definitions |25| GET | `/api/releases` | List releases |26| GET | `/api/releases/{release_id}` | Single release detail |27| GET | `/api/milestones` | Milestones for a release |28| GET | `/api/dependencies` | Work-item dependency graph |29| GET | `/api/blockers` | Blockers on work items |30| POST | `/api/query` | Restricted SQL query (requires auth header) |3132Always fetch the environment data fresh — do not assume cached values. Use only the endpoints listed in `environment_access.md`.3334## Data Integrity Rules3536### Primary vs. Duplicate Records3738Work items can appear multiple times. For every scope, identify and use exactly one **primary** (canonical) record per logical work item:3940- If a work item has a `duplicate_of` field pointing to another item ID, it is a **duplicate** — exclude it from primary counts and list it in the duplicate cluster for the target primary.41- If multiple records share the same logical identity but none points to another, treat the one with the earliest `created_at` (or the one referenced by others) as primary.42- Group duplicates into **duplicate clusters**: each cluster has a `primary_id` and a sorted list of `duplicate_ids`.4344### Stale Mirror Fields4546Never trust mirror, export, or computed snapshot fields that may be out of date. Always read authoritative source fields:4748- For release status: use the live release API, not a mirrored `release_status` on a work item.49- For work item state: use the work item's own status/state field, not a denormalized copy on a parent object.50- For category classification: use the work item's primary category field; if that is missing or ambiguous, fall back to labels and title signals in that order.5152### Cancelled and Distractor Records5354- **Cancelled** items in scope are excluded from the primary working set. Report them in the exclusion list.55- **Distractor** records appear to match the scope (same quarter, teams, or product area) but are not primary closed portfolio work — exclude them from counts and list them separately.5657## Portfolio Categories5859All work items are classified into exactly one of four categories:6061| Category | Description |62|----------|-------------|63| `NewFeature` | New feature development, enhancements, user-facing additions |64| `TechDebt` | Technical debt reduction, refactoring, code quality, tooling |65| `Reliability` | Availability, performance, incident response, monitoring, resilience |66| `Security` | Vulnerabilities, auth/authz, encryption, compliance, threat mitigation |6768Classification priority when signals conflict:691. The work item's explicit `portfolio_category` or `type` field.702. The work item's `labels` or `tags`.713. Keywords in the work item's `title`.7273If still ambiguous after all three signals, classify as `TechDebt`.7475## Ordering Conventions7677Apply these stable orderings consistently:7879| Entity | Order |80|--------|-------|81| Work item ID lists | Lexicographically ascending (string sort) |82| Team names | Alphabetically ascending |83| Category rows in tables | Fixed order: `NewFeature`, `TechDebt`, `Reliability`, `Security` |84| Included work items | `closed_at` ascending, then ID ascending |85| Duplicate clusters | By `primary_id` lexicographically |86| IDs within a duplicate cluster | Lexicographically ascending |87| Milestone completion rows | By `milestone_id` ascending |88| Dependency chains | Lexicographically by the full path (joined with `→` or equivalent) |89| Under-invested categories | Most negative gap to least negative gap |90| Escalation queue | By severity descending (S1 before S2, etc.), then by age descending (oldest first) |9192## Precision Standards9394| Metric | Precision | Example |95|--------|-----------|---------|96| Percentages (completion, mix shares, gaps) | 1 decimal place | `42.5` |97| Rates and scores (breach rate, readiness score) | 3 decimal places | `0.167` |98| Counts | Integer | `12` |99100Round using standard rounding (half-up). Do not round intermediate values — only round the final reported value.101102## Calculation Patterns103104### Mix Gap Analysis105106For each category:107- `actual_pct = (category_count / total_included) × 100`, rounded to 1 decimal place.108- `gap_pct = actual_pct − target_pct`, rounded to 1 decimal place.109- A negative gap means under-investment.110- The category with the most negative gap is the largest deficit.111112### SLA Aging113114- **Overdue**: a primary work item whose `age_days` (from creation or SLA start to the as-of date) exceeds its SLA target. The SLA target is determined by the item's severity and category from the SLA policy data.115- **Aging buckets**: Count items by days since SLA start into buckets: `0–3`, `4–7`, `8–14`, `15–30`, `31+`.116- **Breach rate**: `overdue_primary_count ÷ included_primary_count`, rounded to 3 decimal places.117118### Release Readiness119120- **Ship decision**: Based on milestone completion, unresolved high-impact blockers, and critical dependencies.121 - `SHIP`: all milestones at ≥ threshold, zero unresolved high-impact blockers, no critical dependency gaps.122 - `SHIP_WITH_WATCH`: minor gaps exist but are manageable with monitoring.123 - `NO_SHIP`: significant blockers, incomplete milestones, or broken dependency chains.124- **Readiness score**: `completed_primary_work ÷ total_primary_work`, rounded to 3 decimal places.125- **Gating work items**: non-complete primary work items that block readiness (sorted, unique).126- **Critical dependency chains**: ordered paths from a blocked release work item through dependencies to a non-complete dependency.127128### Hotspot Analysis (SLA)129130- For each team, count overdue primary records.131- The top hotspot is the `(team, owner)` pair with the highest overdue count. If an owner is missing, report `UNASSIGNED`.132- Ties go to the first team alphabetically.133134## Output Convention135136Return a single JSON object matching the supplied `answer_template.json` schema exactly:137138- Do not include prose, explanations, or commentary outside the JSON.139- All required fields must be present.140- No additional properties beyond those defined in the schema.141- Use the exact enum values, field names, and structure from the template.142- Empty arrays must be `[]`, not `null` or absent.143144## Workflow1451461. **Read** the prompt and `answer_template.json` to understand the scope and required output shape.1472. **Read** `environment_access.md` for the base URL, allowed endpoints, and query credentials.1483. **Fetch** all relevant data from the environment endpoints — work items, targets, SLA policies, releases, milestones, blockers, dependencies as the task requires.1494. **Filter** to in-scope records using the task's scope constraints (teams, quarter, product area, release ID, as-of date, etc.).1505. **Classify** each included work item into exactly one portfolio category.1516. **Separate** primary records from duplicates, cancelled items, and distractors.1527. **Calculate** the required metrics using the formulas above.1538. **Order** all lists according to the ordering conventions.1549. **Validate** that every value matches the schema's constraints (enums, patterns, types, ranges).15510. **Return** the single JSON object — nothing else.