Portfolio Environment Analysis Skill
Purpose
Answer structured questions about an engineering portfolio environment by querying REST endpoints, resolving data conflicts, and computing precise metrics. Three task families appear:
- Portfolio Mix Review — classifying closed work items into portfolio categories, comparing actual vs. target mix, identifying under-invested categories, and recommending rebalance actions.
- SLA Aging Audit — identifying primary SLA-relevant work items, computing overdue counts and breach rates, building escalation queues, and reporting duplicate clusters.
- Release Readiness Assessment — evaluating milestone completion, gating work items, unresolved high-impact blockers, critical dependency chains, and a ship decision.
Environment Access
- Base URL and auth token are provided at runtime via
environment_access.md. - All requests use header
X-Env-Token: <token>. - Available endpoints:
GET /api/work-items— all work items (paginated or full list)GET /api/work-items/{item_id}— single work itemGET /api/mix-targets— target mix percentages per scopeGET /api/sla-policy— SLA days-to-due by severityGET /api/releases— release recordsGET /api/releases/{release_id}— single releaseGET /api/milestones— milestone recordsGET /api/dependencies— dependency relationshipsGET /api/blockers— blocker recordsPOST /api/query— restricted SQL query (same auth header)
- Authoritative fields: use
status,work_type,closed_at,created_at,due_at,owner,duplicate_of,milestone_id,release_id,team,product_area,severity,labels,titledirectly from/api/work-items. - Stale/decoy fields:
mirror_statusandlegacy_categoryare non-authoritative mirrors or exports. Ignore them. Setignored_mirror_status_and_legacy_category: truewhen the schema requires it.
Portfolio Category Mapping
Map each work item's work_type to exactly one portfolio category:
| work_type | Portfolio Category |
|---|---|
| Feature | NewFeature |
| Enhancement | NewFeature |
| Refactor | TechDebt |
| Chore | TechDebt |
| Dependency | TechDebt |
| Bug | TechDebt |
| Incident | Reliability |
| Reliability | Reliability |
| Security | Security |
| Compliance | Security |
Signal conflict resolution: When work_type alone is ambiguous and labels contain strong competing signals (e.g., Enhancement with reliability/outage labels, or chore with flaky/reliability labels), prefer the label-driven category. The hierarchy is: conflicting label signals > work_type default. Enhancements with reliability/outage/latency/flaky labels should map to Reliability. Chores with reliability/flaky labels may also map to Reliability depending on the label strength. When in doubt, trust work_type as the primary signal.
Common Data Preparation
Filtering in-scope items
- Match
teamandproduct_areaas specified in the task scope. - For quarter-based reviews, retain only items with
closed_atin the target quarter (e.g.,2025-10-01to2025-12-31for Q4). - Exclude duplicates: items where
status == "Duplicate"ORduplicate_ofis not null. - Exclude cancelled: items where
status == "Cancelled". - Excluded IDs should be reported in answer fields (
excluded_duplicate_ids,excluded_cancelled_ids,excluded_distractor_idsas applicable).
Sorting
- ID lists: sort lexicographically (ascending) unless otherwise specified.
- Items ordered by time: sort by
closed_atascending, thenidascending. - Mix/gap tables: rows appear in the fixed order NewFeature, TechDebt, Reliability, Security.
- Teams and product areas: sort alphabetically unless the template specifies a fixed order.
Rounding
- Percentages: 1 decimal place (e.g.,
33.3). - Rates and scores: 3 decimal places (e.g.,
0.273). - Gap = actual − target (percentage points, 1 decimal).
Task Family 1: Portfolio Mix Review
Steps
- Fetch
/api/work-itemsand/api/mix-targets. - Filter to in-scope items (team, product_area, quarter, non-duplicate, non-cancelled).
- Classify each included item into a portfolio category using the mapping above.
- Compute
category_counts(item counts, not story points). - Compute
category_percentages=count / total * 100, rounded to 1 decimal. - Look up target mix from
/api/mix-targetsusingscope_id. Target values are fractions (e.g.,0.34=34.0%). - Build
gap_table: each row hastarget_pct,actual_pct,gap_pct = actual_pct - target_pct. under_invested_categories: categories with negativegap_pct, sorted most-negative first.follow_up_action:- If any negative gaps:
action = "REBALANCE_CAPACITY",primary_category= category with most negative gap,rationale_code = "LARGEST_NEGATIVE_GAP". - If no negative gaps:
action = "MAINTAIN_CURRENT_MIX",rationale_code = "NO_NEGATIVE_GAPS". - If contradictory data:
action = "INVESTIGATE_DATA_QUALITY",rationale_code = "DATA_CONFLICT".
- If any negative gaps:
exclusion_flags: list excluded duplicate IDs and cancelled IDs. Setignored_mirror_status_and_legacy_category: true.
Task Family 2: SLA Aging Audit
Concepts
- Primary = not a duplicate (no
duplicate_of, status ≠ Duplicate) and not cancelled. - SLA population = primary items in SLA categories (Reliability, Security), open on the as-of date OR closed within the recent-closed window.
- Open on as-of date =
closed_atis null ORclosed_at > as_of. - Recently closed =
closed_atwithin[as_of − window_days, as_of]. - As-of snapshot: an item only counts if
created_at ≤ as_of(it had to exist on the snapshot date). - SLA deadline =
created_at + sla_days[severity](from/api/sla-policy). - Overdue = SLA deadline < as_of AND item was open on as_of.
- Recently-closed items that were overdue when closed (closed_at > sla_deadline) also count as overdue.
- Aging = days past SLA deadline. Bucket: 0–3, 4–7, 8–14, 15–30, 31+.
- Breach rate = overdue primary count / included primary count, 3 decimal places.
- Duplicate clusters: group by
duplicate_of. Each cluster hasprimary_id(the canonical item) andduplicate_ids(sorted). Report clusters for in-scope items where the duplicate is in an SLA category. - Missing owner: included primary items where
owneris null. - Escalation queue: overdue items sorted by severity (S1 first), then by days overdue descending, then by ID ascending.
Steps
- Fetch
/api/work-itemsand/api/sla-policy. - Filter by team and SLA category (Reliability, Security).
- Exclude duplicates and cancelled items.
- Apply as-of snapshot filter (
created_at ≤ as_of). - Include items open on as-of or recently closed.
- Compute SLA deadline per item and determine overdue status.
- Compute aging bucket counts.
- Build overdue team counts and top hotspot (team + owner pair with most overdue).
- Collect duplicate clusters from all in-scope duplicate records.
- Compute breach rate.
Task Family 3: Release Readiness Assessment
Concepts
- Release work items: items with
release_idmatching the target release. - Primary: not duplicate/cancelled and no
duplicate_of. - Complete statuses: Verified, Done, Closed, Deployed.
- Milestone completion: per milestone, count primary items that are complete vs. total primary items.
- Gating items: non-complete primary release work items.
- High-impact unresolved blockers: severity = High or Critical AND status ≠ Resolved.
- Blocker cause counts: key = exact cause string, value = count of matching high-impact unresolved blockers.
- Critical dependency chains: ordered path of work item IDs from a release work item to a non-complete dependency item. A dependency is "non-complete" if its status is not in the complete set. Follow transitive dependencies (BFS).
- Readiness score = completed primary / total primary, rounded to 3 decimal places.
- Ship decision:
NO_SHIPif any high-impact unresolved blockers exist.SHIP_WITH_WATCHif readiness < 1.0 but no high-impact blockers.SHIPif readiness = 1.0 and no unresolved blockers.
Steps
- Fetch
/api/releases,/api/milestones,/api/work-items,/api/blockers,/api/dependencies. - Filter work items by
release_id. - Compute milestone completion metrics.
- Identify gating items (non-complete primary release items).
- Aggregate blocker cause counts (high-impact, unresolved only).
- Trace critical dependency chains from release work items to non-complete dependencies.
- Compute readiness score.
- Determine ship decision.