Skip to content

Improve update-skia skill: extract references, add scripts, improve tone - #3574

Merged
mattleibow merged 1 commit into
mainfrom
dev/improve-update-skia-skill
Mar 24, 2026
Merged

mattleibow merged 1 commit into
mainfrom
dev/improve-update-skia-skill

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Summary

Restructure the update-skia skill to reduce SKILL.md from 559→428 lines and make error-prone phases harder to get wrong.

Problem

During a recent Skia milestone update, multiple skill phases were executed incorrectly:

  • Phase 6 (version updates) was partially done — missing cgmanifest commitHash, azure-pipelines-variables.yml
  • Phase 7 (bindings) — HarfBuzz was reverted reactively after test failure instead of proactively
  • Phase 3 (validation) was skipped entirely
  • Phase 4 used wrong base branch (main instead of skiasharp)

Root cause: the skill was 559 lines with reference material, mechanical instructions, and workflow phases all mixed together. The most error-prone phases were prose instructions instead of scripts.

Changes

References extracted (consulted on demand, not always loaded):

  • references/known-gotchas.md — 10 lessons learned + troubleshooting table
  • references/typical-changes.md — files changed in a typical update
  • references/validation-prompt.md — Phase 3 validation agent prompt template

Scripts added (mechanical work that should not be done manually):

  • scripts/update-versions.ps1 — Phase 6: Updates ALL version files and runs verification. Exits non-zero if stale refs remain. Handles VERSIONS.txt, cgmanifest.json, azure-pipelines-variables.yml, SK_C_INCREMENT.
  • scripts/regenerate-bindings.ps1 — Phase 7: Runs generator, proactively reverts HarfBuzz, reports new functions needing wrappers.

Tone improvements (per skill-creator guidelines):

  • Replace commanding caps with explanations of why each phase matters
  • Replace unusable checkbox pre-flight with workflow shape overview
  • Add version-checking triggers to description for better skill matching

Restructure the update-skia skill to reduce SKILL.md from 559 to 428 lines and
make error-prone phases impossible to get wrong:

References extracted:
- references/known-gotchas.md — 10 lessons learned + troubleshooting table
- references/typical-changes.md — files changed in a typical update
- references/validation-prompt.md — Phase 3 validation agent prompt template

Scripts added:
- scripts/update-versions.ps1 — Phase 6: Updates ALL version files (VERSIONS.txt,
  cgmanifest.json, azure-pipelines-variables.yml, SK_C_INCREMENT) and runs
  mandatory verification greps. Exits non-zero if stale references remain.
- scripts/regenerate-bindings.ps1 — Phase 7: Runs generator, PROACTIVELY reverts
  HarfBuzz bindings, reports diff summary, lists new functions needing wrappers.

Tone improvements (per skill-creator guidelines):
- Replace commanding caps (MANDATORY/MUST/NEVER) with explanations of WHY
- Replace unusable checkbox pre-flight with workflow overview
- Explain Phase 8 rationale instead of RE-READ warning
- Add version-checking triggers to description

Co-authored-by: Copilot <[email protected]>
@mattleibow
mattleibow merged commit c1836d9 into main Mar 24, 2026
1 check passed
@mattleibow
mattleibow deleted the dev/improve-update-skia-skill branch March 24, 2026 22:46
mattleibow added a commit that referenced this pull request Jun 11, 2026
Fix SKIASHARP_VERSION yaml missed by the m148 bump (#4144)

Context: #4125
Context: #3247
Context: #3574

The m148 milestone bump (#4125) updated every version number in
scripts/VERSIONS.txt to 4.148.0 but left scripts/azure-templates-variables.yml
at SKIASHARP_VERSION: 4.147.0 — even though that variable's own comment requires
it to match the nuget version in VERSIONS.txt. It is a compile-time constant
feeding the BUILD_NUMBER counter expression and cannot be derived dynamically,
so the stale value silently mismatches the rest of the release.

This was not a manual oversight: the update-skia Phase 6 script
(.agents/skills/update-skia/scripts/update-versions.ps1) was pointed at a file
that no longer exists. #3247 moved SKIASHARP_VERSION out of the deleted
scripts/azure-pipelines-variables.yml into scripts/azure-templates-variables.yml
(Apr 2025). When the script was authored in #3574 (Mar 2026) it referenced the
old, already-deleted filename, and its `Test-Path ... else { skip }` guard made
the miss invisible — so the m148 run skipped the file with no error and no gate
failure.

~~ The fix ~~

  * Bump SKIASHARP_VERSION to 4.148.0 in scripts/azure-templates-variables.yml.
  * Repoint update-versions.ps1 Step 3 at scripts/azure-templates-variables.yml,
    replace only the SKIASHARP_VERSION line via a targeted regex, and hard-fail
    (Write-Error) if the file is missing instead of silently skipping — a future
    rename now breaks loudly.
  * Replace the stale-only verification (which merely checked the old milestone
    number was gone) with a positive assertion that SKIASHARP_VERSION exactly
    equals the target nuget version. Per GPT-5.5 review the old check would have
    falsely passed if the value were stuck on a different milestone (e.g.
    4.146.0, where the replace is a no-op) or carried a suffix (4.147.0-preview.2
    -> 4.148.0-preview.2 no longer contains 147).
  * Update SKILL.md and references/typical-changes.md to the correct filename.

Verified: PowerShell parses clean; simulated the gate against 4.146.0 (fails as
expected) and 4.147.0 (passes at 4.148.0).

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant