Skip to content

Add S360 Weekly Reporter skill, Fixes AB#3597463#431

Merged
shahzaibj merged 14 commits into
masterfrom
shahzaibj/s360-reporter-skill
Jun 9, 2026
Merged

Add S360 Weekly Reporter skill, Fixes AB#3597463#431
shahzaibj merged 14 commits into
masterfrom
shahzaibj/s360-reporter-skill

Conversation

@shahzaibj

@shahzaibj shahzaibj commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the S360 Weekly Reporter skill to the android-complete repo. This Copilot skill automates the weekly S360 compliance report for the Android Auth team fetching live data from the S360 MCP server, matching items to ADO PBIs, and generating a polished Outlook-compatible HTML email report.

What's included

File Description
.github/skills/s360-reporter/SKILL.md Skill instructions full workflow (Steps 0-6), edge cases, field mappings
.github/skills/s360-reporter/generate-report.js Node.js HTML report generator (data-driven, Outlook-compatible styling)
.github/skills/s360-reporter/report-template.md HTML building blocks, color palette, and design rationale
agency.toml Registers S360, ADO, WorkIQ, M365 User, and ES Chat MCP servers
.vscode/mcp.json MCP server configuration for S360 Breeze
.github/copilot-instructions.md Adds s360-reporter to the skills reference table

Workflow overview

  1. Discover team via org chart (M365 User MCP)
  2. Collect last week's report (user paste or WorkIQ fallback)
  3. Fetch S360 items service-targeted + person-targeted, merged and deduped
  4. Match existing PBIs from last week's report, ADO tag/title search, keyword search
  5. Create missing PBIs in ADO with proper area/iteration paths
  6. Generate HTML report and open browser preview for copy/paste into Outlook

Triggers

/s360-reporter, "S360 report", "generate S360 report", "weekly S360", "S360 status"

Fixes AB#3597463

@shahzaibj shahzaibj requested a review from a team as a code owner May 9, 2026 18:54
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

@github-actions github-actions Bot changed the title Add S360 Weekly Reporter skill Add S360 Weekly Reporter skill, Fixes AB#3597463 May 9, 2026
shahzaibj and others added 9 commits May 9, 2026 11:59
…h email draft

- Add committed Node.js report generator (generate-report.js) that reads JSON
  input and produces Outlook-compatible HTML reports
- Auto-create PBIs without user confirmation, default area path and computed iteration
- Add Step 4b to auto-close resolved PBIs (transition to Done)
- Scope WorkIQ email query to last 7 days for freshness
- Add Graph API email draft (POST /v1.0/me/messages) with file fallback
- Add Quick Mode for CLI-only summary without full report
- Filter person-targeted items to team members via org chart
- Update edge cases for new features

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When ActionOwnerAlias is empty, omit System.AssignedTo from the PBI
instead of falling back to the S360 AssignedTo field (which defaults
to the manager). Show 'Unassigned' in the report for manual triage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Root cause of bad report quality:
1. Program headings used raw API codes (ADFunGlobal, ADFunCompliance)
   instead of ProgramDisplayName. Added explicit priority-ordered
   extraction: ProgramDisplayName > campaign > TeamName > filter (mapped)
2. Missing titles had no fallback. Added fallback to WaveDisplayName
3. Dedup was too weak for multi-target KPIs (CFS endpoints). Added
   fuzzy dedup by KpiId with merge-and-count logic.

Also: owner name now falls back to nameMap from Step 0 when
S360Dimensions.ActionOwner is empty.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove mail MCP from agency.toml (no longer needed)
- Remove Outlook draft creation from Step 6 (user copies from browser preview instead)
- Replace Mail Search fallback in Step 3a with ask_user prompt
- Remove Mail MCP edge case entry
- Update SKILL.md prerequisites to reflect removal

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shahzaibj shahzaibj force-pushed the shahzaibj/s360-reporter-skill branch from 1f342c3 to 3a709cf Compare May 9, 2026 19:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rpdome

rpdome commented May 19, 2026

Copy link
Copy Markdown
Member

This seems to work for me.
The only suggestion is to add agency as a requirement in the instruction.

shahzaibj and others added 4 commits June 8, 2026 16:30
Two team feedback fixes:

1. ETA showing 'No ETA' even when set in S360 portal:
   - Skill previously read only `CurrentETA`. For `OutOfSla` items, the
     S360 portal column is labeled 'ETA (Missed SLA)' and the API surfaces
     the value under a different field name, leaving `CurrentETA` null.
   - Add new 'ETA Field Resolution' subsection listing candidate fields
     (`CurrentETA`, `ETA`, `MissedSLAETA`, `S360Dimensions.ETA`,
     `CustomDimensions.ETA`, plus a name-contains-'ETA' fallback) and a
     diagnostic instruction to grep the raw item JSON when the resolved
     value is still null on a Missed SLA item.

2. Existing Bugs not being picked up:
   - Skill previously treated Step 3 as PBI-only. Dome noted that S360 items
     with existing Bugs (common for security/compliance defects) were being
     flagged as 'needs creation', producing duplicate work items.
   - Rename Step 3 to 'Find Existing Work Items (PBIs or Bugs)'.
   - Step 3a: AB# references are type-agnostic; capture 'Bug NNNN' too.
   - Step 3b: explicitly do not type-filter the WIQL query; also fetch
     `System.WorkItemType` so downstream steps know Bug vs PBI.
   - Step 3c: pass `workItemType: ['Product Backlog Item', 'Bug']` to
     `search_workitem`; do not post-filter out Bug hits.
   - Step 3d/3e: merge and owner-override apply to both Bugs and PBIs.
   - Step 4: clarified that creation is still PBI-only (we never file new
     Bugs from this skill  we only match and reuse existing ones).
   - Step 4b: renamed to 'Auto-Close Resolved Work Items'; works for Bugs too.
   - Step 5a JSON schema: `pbi` field accepts any ADO work item ID.

generate-report.js needs no changes  its `pbiUrl()` already builds a
type-agnostic ADO work-item URL that works for both PBIs and Bugs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds two scripts that encode the dedup rules the skill workflow has been
re-implementing ad-hoc each week. Moving them out of prose and into code so
the rules are enforced consistently and cannot be skipped or reinterpreted.

merge-items.js
  Filters person-targeted S360 items down to team-relevant ones and
  deduplicates by KpiActionItemId. Drops items that match only on
  AssignedTo (the person query already filters on assignedTo, so that
  alone is not a relevance signal).

reduce-items.js
  Groups merged items into logical report rows. Per-finding items (items
  whose URL contains a _workitems/edit/{id} link) get their own row keyed
  on the ADO work-item ID. Items without per-finding work items can
  umbrella-merge by KpiId+baseTitle+TargetId (e.g. CFS multi-endpoint
  case). Includes:
    - Reused-ID detection (a shared template work item must not collapse
      unrelated rows).
    - Known per-finding KPI set (Nightwatch) as defense-in-depth fallback
      so a missing URL cannot silently re-introduce the umbrella bug.
    - Strict ISO date parsing for ETA candidate fields.
    - Deterministic sort: same input always produces identical output.
    - URL-coverage and ID-conflict warnings to stderr.

SKILL.md
  Step 1c now invokes merge-items.js; Step 2 invokes reduce-items.js.
  The dedup rules are kept as the reference spec the scripts implement,
  so reviewers can verify behavior and the rules remain enforceable as a
  manual fallback if Node.js is unavailable.

Verified on the current week's data:
  - 13 Nightwatch Security Code Bugs  13 distinct rows (regression case).
  - 22 SDL Annual Assessment Bugs  22 distinct rows (the old hard-coded
    "SDL = 1 row per service" logic was silently hiding all of them; same
    class of bug as Nightwatch).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shahzaibj shahzaibj merged commit deab28c into master Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants