Engineering Portfolio Environment
Use this skill to solve tasks that ask for a JSON answer from the shared engineering portfolio environment. The recurring job is to query the environment, separate authoritative records from stale mirrors/distractors, compute the requested metrics, and emit exactly the schema in input/payloads/answer_template.json.
First Pass
- Read the user prompt and
input/payloads/answer_template.json.
- Read the task's runtime access file if supplied. Use its base URL when the prompt contains
<TASK_ENV_BASE_URL>.
- Fetch only the collections needed for the answer. Typical endpoints are:
GET /api/work-items
GET /api/work-items/{item_id}
GET /api/mix-targets
GET /api/sla-policy
GET /api/releases
GET /api/releases/{release_id}
GET /api/milestones
GET /api/dependencies
GET /api/blockers
POST /api/query only when the runtime file supplies the required token/header
- Build a small local calculation script or notebook-style command when the task has many records. Prefer deterministic calculations over manual counting.
- Return only the JSON object unless the prompt asks for prose.
Authoritative Fields
Prefer the current authoritative work item fields:
status, closed_at, created_at, due_at
duplicate_of
team, product_area, release_id, milestone_id
work_type, labels, title
owner, severity, priority
Treat mirror_status, legacy_category, stale exports, and labels such as stale-export as warning signals, not truth. Do not let stale mirror fields make an incomplete item complete, resurrect a duplicate, or override the category precedence below.
Shared Work Item Rules
Use a primary record only when it is not cancelled or duplicate:
- Exclude any item with
status equal to Duplicate or Cancelled.
- Exclude any item with a non-null
duplicate_of, even when its status looks closed.
- Count items, not story points, unless the prompt explicitly says otherwise.
Treat these statuses as complete for readiness or closed-work denominators when paired with the relevant dates: Closed, Done, Deployed, Verified, and Complete. Treat Backlog, In Progress, Review, and Reopened as non-complete.
When reconstructing an as-of view, compare dates to the as-of date. If an item was created after the as-of date, exclude it. If it closed after the as-of date, treat it as still open at the as-of date.
Portfolio Category Precedence
When the prompt says to resolve conflicting type, label, and title signals, classify from lowercased tokens in work_type, labels, and title. Apply this precedence, stopping at the first match:
Security: security, cve, auth, encryption, compliance
Reliability: reliability, incident, outage, latency, flaky
TechDebt: tech-debt, tech debt, refactor, cleanup, migration, dependency, chore
NewFeature: feature, enhancement, rollout, customer-request
This precedence is intentional: security/auth/encryption beats reliability, reliability beats cleanup/refactor/migration, and cleanup/migration beats generic feature/rollout wording. Use legacy_category only if the prompt explicitly asks for legacy data.
Portfolio Mix Tasks
For closed portfolio mix reviews:
- Filter work items to the prompt scope: quarter, teams, product area or areas, and any explicit scope conditions.
- Include only primary records with
closed_at inside the quarter and an authoritative complete status.
- Sort included work item IDs as the template requests; common ordering is
closed_at ascending, then id ascending.
- Find the target mix from
/api/mix-targets, preferring the explicit scope_id row when supplied. Convert target fractions to percentage points by multiplying by 100.
- Compute category counts by item count.
- Compute actual percentage as
count / total * 100, rounded to one decimal place.
- Compute gap as
actual_pct - target_pct, rounded to one decimal place. Use the rounded one-decimal actual and target values when reproducing one-decimal tables.
- List under-invested categories where
gap_pct is negative, ordered from most negative to least negative.
- For rebalancing recommendations, choose the largest negative gap as the primary category. Use the second negative gap as secondary when the schema has one; use
null when there is no secondary deficit. If no categories are negative, use the schema's maintain/no-negative option when available.
- If the recommendation schema requires an
owner_team, choose an in-scope team with direct evidence in the deficient category, such as the team owning the only or most recent included item in that category. If there is no included item for that category, choose the team with the lowest included count in that category, using the template's allowed values and deterministic tie-breaks.
- Report excluded duplicate, cancelled, or distractor IDs only when the schema asks. These should be same-scope records that looked eligible but failed primary closed-work rules; order them exactly as the template says.
SLA Aging Tasks
For SLA population, use the prompt's teams, categories, as-of date, and recent closed window.
Include a primary work item when all are true:
- It is a primary record under the shared work item rules.
- Its team is in scope.
- Its category is in scope by the portfolio precedence.
created_at is on or before the as-of date.
- It is open as of the as-of date, or it closed inside the recent closed window ending on the as-of date.
For each included item:
- Use
effective_date = closed_at when closed_at is on or before the as-of date; otherwise use the as-of date.
- It is overdue when
effective_date > due_at. Due on the as-of date is not overdue.
- Age in days is
effective_date - created_at.
- Buckets are inclusive:
0-3, 4-7, 8-14, 15-30, 31+.
Common SLA outputs:
included_primary_ids: sort lexicographically unless the template says otherwise.
overdue_primary_ids: lexicographic subset of included primary IDs.
missing_owner_ids: included primary IDs where owner is missing/null.
breach_rate or sla_breach_rate: overdue_count / included_count, rounded to three decimals.
- Team overdue counts: group overdue included primary records by team; list teams alphabetically.
- Top hotspot: group overdue included primary records by
(team, owner), using UNASSIGNED for missing owners; choose highest count, then deterministic alphabetical tie-breaks unless the prompt specifies another rule.
- Severity counts: count overdue included primary records by severity keys such as
S1 through S4, filling absent severities with zero when required.
- Escalation queue: order overdue primary IDs by severity rank
S1, S2, S3, S4, then older due_at, then lower numeric priority, then id.
- Duplicate clusters: report excluded duplicate records whose
duplicate_of points to an included primary. Sort clusters by primary_id, and sort duplicate_ids lexicographically.
Release Readiness Tasks
For release assessments, query releases, milestones, work items, blockers, and dependencies.
- Select work items by authoritative
release_id; do not use stale mirror release/status fields as release truth.
- Exclude duplicate/cancelled records from milestone denominators.
- For each milestone in the release, count primary release work with matching
milestone_id.
complete_primary is the number of primary milestone items with a complete authoritative status.
primary_total is the primary milestone denominator.
completion_pct = complete_primary / primary_total * 100, rounded to one decimal place.
- Sort milestone rows by
milestone_id ascending.
readiness_score = total_complete_primary / total_primary, rounded to three decimals.
For blockers:
- An unresolved blocker has
resolved_at null and a non-resolved status.
- High-impact blockers are
High or Critical severity unless the prompt defines a different set.
- Count unresolved high-impact blocker causes by exact
cause text. Sort keys alphabetically when object order is visible and the prompt gives no other order.
- Gating work item IDs are non-complete primary release work items tied to unresolved high-impact blockers, plus any other non-complete work the prompt explicitly defines as gating. Sort and de-duplicate.
For dependency chains:
- Build a directed graph from
blocked_id to depends_on_id.
- Start from gating non-complete release work unless the prompt broadens the start set.
- Follow dependency edges until a terminal dependency is reached or a cycle would repeat an ID.
- Include a chain only when it ends at a non-complete primary dependency. Omit chains that end only in complete, duplicate, cancelled, or out-of-scope non-gating records.
- Sort chains lexicographically by the full ordered ID path.
Ship decision policy must follow the prompt when supplied. A reliable default is:
NO_SHIP if non-complete gating release work has unresolved High/Critical blockers or critical dependency chains.
SHIP_WITH_WATCH if the release is otherwise complete enough to ship but has unresolved watch items, lower-impact blockers, or unresolved high-impact blockers only on completed work.
SHIP only when primary release work is complete and no unresolved blocker/dependency risk remains.
Output Discipline
Mirror the answer template exactly:
- Preserve required keys and nested shapes.
- Use arrays, numbers, booleans, and nulls with the JSON types requested by the template.
- Fill zero-count categories, severities, and teams when the template requires fixed keys.
- Use the ordering rules in the prompt/template over the defaults in this skill.
- Round only at the requested output precision.
- Validate by checking every included/excluded ID against the scope rules before finalizing.
1---2name: engineering-portfolio-env3description: Solve JSON audit tasks against the shared engineering portfolio task environment. Use for portfolio mix reviews, SLA aging and breach audits, release readiness assessments, milestone completion, blocker and dependency analysis, duplicate/cancelled exclusions, stale mirror/export field handling, and exact answer_template.json output from work-items, mix-targets, SLA policy, releases, milestones, blockers, dependencies, or restricted query endpoints.4metadata:5 source: https://skillmd.com/skills/prism-shadow/engineering-portfolio-env6---78# Engineering Portfolio Environment910Use this skill to solve tasks that ask for a JSON answer from the shared engineering portfolio environment. The recurring job is to query the environment, separate authoritative records from stale mirrors/distractors, compute the requested metrics, and emit exactly the schema in `input/payloads/answer_template.json`.1112## First Pass13141. Read the user prompt and `input/payloads/answer_template.json`.152. Read the task's runtime access file if supplied. Use its base URL when the prompt contains `<TASK_ENV_BASE_URL>`.163. Fetch only the collections needed for the answer. Typical endpoints are:17 - `GET /api/work-items`18 - `GET /api/work-items/{item_id}`19 - `GET /api/mix-targets`20 - `GET /api/sla-policy`21 - `GET /api/releases`22 - `GET /api/releases/{release_id}`23 - `GET /api/milestones`24 - `GET /api/dependencies`25 - `GET /api/blockers`26 - `POST /api/query` only when the runtime file supplies the required token/header274. Build a small local calculation script or notebook-style command when the task has many records. Prefer deterministic calculations over manual counting.285. Return only the JSON object unless the prompt asks for prose.2930## Authoritative Fields3132Prefer the current authoritative work item fields:3334- `status`, `closed_at`, `created_at`, `due_at`35- `duplicate_of`36- `team`, `product_area`, `release_id`, `milestone_id`37- `work_type`, `labels`, `title`38- `owner`, `severity`, `priority`3940Treat `mirror_status`, `legacy_category`, stale exports, and labels such as `stale-export` as warning signals, not truth. Do not let stale mirror fields make an incomplete item complete, resurrect a duplicate, or override the category precedence below.4142## Shared Work Item Rules4344Use a primary record only when it is not cancelled or duplicate:4546- Exclude any item with `status` equal to `Duplicate` or `Cancelled`.47- Exclude any item with a non-null `duplicate_of`, even when its `status` looks closed.48- Count items, not story points, unless the prompt explicitly says otherwise.4950Treat these statuses as complete for readiness or closed-work denominators when paired with the relevant dates: `Closed`, `Done`, `Deployed`, `Verified`, and `Complete`. Treat `Backlog`, `In Progress`, `Review`, and `Reopened` as non-complete.5152When reconstructing an as-of view, compare dates to the as-of date. If an item was created after the as-of date, exclude it. If it closed after the as-of date, treat it as still open at the as-of date.5354## Portfolio Category Precedence5556When the prompt says to resolve conflicting type, label, and title signals, classify from lowercased tokens in `work_type`, `labels`, and `title`. Apply this precedence, stopping at the first match:57581. `Security`: `security`, `cve`, `auth`, `encryption`, `compliance`592. `Reliability`: `reliability`, `incident`, `outage`, `latency`, `flaky`603. `TechDebt`: `tech-debt`, `tech debt`, `refactor`, `cleanup`, `migration`, `dependency`, `chore`614. `NewFeature`: `feature`, `enhancement`, `rollout`, `customer-request`6263This precedence is intentional: security/auth/encryption beats reliability, reliability beats cleanup/refactor/migration, and cleanup/migration beats generic feature/rollout wording. Use `legacy_category` only if the prompt explicitly asks for legacy data.6465## Portfolio Mix Tasks6667For closed portfolio mix reviews:68691. Filter work items to the prompt scope: quarter, teams, product area or areas, and any explicit scope conditions.702. Include only primary records with `closed_at` inside the quarter and an authoritative complete status.713. Sort included work item IDs as the template requests; common ordering is `closed_at` ascending, then `id` ascending.724. Find the target mix from `/api/mix-targets`, preferring the explicit `scope_id` row when supplied. Convert target fractions to percentage points by multiplying by 100.735. Compute category counts by item count.746. Compute actual percentage as `count / total * 100`, rounded to one decimal place.757. Compute gap as `actual_pct - target_pct`, rounded to one decimal place. Use the rounded one-decimal actual and target values when reproducing one-decimal tables.768. List under-invested categories where `gap_pct` is negative, ordered from most negative to least negative.779. For rebalancing recommendations, choose the largest negative gap as the primary category. Use the second negative gap as secondary when the schema has one; use `null` when there is no secondary deficit. If no categories are negative, use the schema's maintain/no-negative option when available.7810. If the recommendation schema requires an `owner_team`, choose an in-scope team with direct evidence in the deficient category, such as the team owning the only or most recent included item in that category. If there is no included item for that category, choose the team with the lowest included count in that category, using the template's allowed values and deterministic tie-breaks.7911. Report excluded duplicate, cancelled, or distractor IDs only when the schema asks. These should be same-scope records that looked eligible but failed primary closed-work rules; order them exactly as the template says.8081## SLA Aging Tasks8283For SLA population, use the prompt's teams, categories, as-of date, and recent closed window.8485Include a primary work item when all are true:8687- It is a primary record under the shared work item rules.88- Its team is in scope.89- Its category is in scope by the portfolio precedence.90- `created_at` is on or before the as-of date.91- It is open as of the as-of date, or it closed inside the recent closed window ending on the as-of date.9293For each included item:9495- Use `effective_date = closed_at` when `closed_at` is on or before the as-of date; otherwise use the as-of date.96- It is overdue when `effective_date > due_at`. Due on the as-of date is not overdue.97- Age in days is `effective_date - created_at`.98- Buckets are inclusive: `0-3`, `4-7`, `8-14`, `15-30`, `31+`.99100Common SLA outputs:101102- `included_primary_ids`: sort lexicographically unless the template says otherwise.103- `overdue_primary_ids`: lexicographic subset of included primary IDs.104- `missing_owner_ids`: included primary IDs where `owner` is missing/null.105- `breach_rate` or `sla_breach_rate`: `overdue_count / included_count`, rounded to three decimals.106- Team overdue counts: group overdue included primary records by team; list teams alphabetically.107- Top hotspot: group overdue included primary records by `(team, owner)`, using `UNASSIGNED` for missing owners; choose highest count, then deterministic alphabetical tie-breaks unless the prompt specifies another rule.108- Severity counts: count overdue included primary records by severity keys such as `S1` through `S4`, filling absent severities with zero when required.109- Escalation queue: order overdue primary IDs by severity rank `S1`, `S2`, `S3`, `S4`, then older `due_at`, then lower numeric `priority`, then `id`.110- Duplicate clusters: report excluded duplicate records whose `duplicate_of` points to an included primary. Sort clusters by `primary_id`, and sort `duplicate_ids` lexicographically.111112## Release Readiness Tasks113114For release assessments, query releases, milestones, work items, blockers, and dependencies.1151161. Select work items by authoritative `release_id`; do not use stale mirror release/status fields as release truth.1172. Exclude duplicate/cancelled records from milestone denominators.1183. For each milestone in the release, count primary release work with matching `milestone_id`.1194. `complete_primary` is the number of primary milestone items with a complete authoritative status.1205. `primary_total` is the primary milestone denominator.1216. `completion_pct = complete_primary / primary_total * 100`, rounded to one decimal place.1227. Sort milestone rows by `milestone_id` ascending.1238. `readiness_score = total_complete_primary / total_primary`, rounded to three decimals.124125For blockers:126127- An unresolved blocker has `resolved_at` null and a non-resolved `status`.128- High-impact blockers are `High` or `Critical` severity unless the prompt defines a different set.129- Count unresolved high-impact blocker causes by exact `cause` text. Sort keys alphabetically when object order is visible and the prompt gives no other order.130- Gating work item IDs are non-complete primary release work items tied to unresolved high-impact blockers, plus any other non-complete work the prompt explicitly defines as gating. Sort and de-duplicate.131132For dependency chains:133134- Build a directed graph from `blocked_id` to `depends_on_id`.135- Start from gating non-complete release work unless the prompt broadens the start set.136- Follow dependency edges until a terminal dependency is reached or a cycle would repeat an ID.137- Include a chain only when it ends at a non-complete primary dependency. Omit chains that end only in complete, duplicate, cancelled, or out-of-scope non-gating records.138- Sort chains lexicographically by the full ordered ID path.139140Ship decision policy must follow the prompt when supplied. A reliable default is:141142- `NO_SHIP` if non-complete gating release work has unresolved High/Critical blockers or critical dependency chains.143- `SHIP_WITH_WATCH` if the release is otherwise complete enough to ship but has unresolved watch items, lower-impact blockers, or unresolved high-impact blockers only on completed work.144- `SHIP` only when primary release work is complete and no unresolved blocker/dependency risk remains.145146## Output Discipline147148Mirror the answer template exactly:149150- Preserve required keys and nested shapes.151- Use arrays, numbers, booleans, and nulls with the JSON types requested by the template.152- Fill zero-count categories, severities, and teams when the template requires fixed keys.153- Use the ordering rules in the prompt/template over the defaults in this skill.154- Round only at the requested output precision.155- Validate by checking every included/excluded ID against the scope rules before finalizing.