Skip to content

fix(init): report skill sync outcomes accurately on the first run - #8580

Merged
domitriusclark merged 3 commits into
mainfrom
claude/ex-3055-sync-report-fixes
Oct 8, 2026
Merged

domitriusclark merged 3 commits into
mainfrom
claude/ex-3055-sync-report-fixes

Conversation

@domitriusclark

@domitriusclark domitriusclark commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

EX-3055. Follow-up to #8556 for the two CodeRabbit comments left open there (1, 2). Both only affected what the first run reported or left on disk; a second netlify init already corrected them.

  • Every download failed: the summary said "Installed Netlify skills in .agents/skills (2 failed)" while nothing was installed and installed was false in the analytics event. It now says "Could not sync Netlify skills in .agents/skills (2 failed)." When other skills are already present it says "Some Netlify skills in .agents/skills could not be synced (1 failed).", and a run that adds skills and also has a failure says "Synced" instead of "Installed".
  • Prior name that differs only by case: on a case-insensitive filesystem the copy was renamed in place but not refreshed, so a stale copy stayed stale and an edited one kept its edits under --reset-context until the next run. After the rename, the copy is now compared with the release and replaced in the same run, as an update, or as a reset under --reset-context.
Testing
  • tests/unit/utils/init/agent-skills.test.ts: five new tests: every download fails; one fails while the rest are current; stale copy under a case-only prior name; a refresh that fails right after that rename (old copy kept, next run finishes); edited copy under a case-only prior name with --reset-context. All five fail on main. The three rename tests assert the end state, so they hold on case-sensitive filesystems too, where the existing install-then-remove path already produced it.
  • npm run test:unit (726 tests), the init integration tests (9), npm run typecheck, npm run lint, npm run format:check and npm run build are clean.

  • Open a bug/issue before writing your code 🧑‍💻 (tracked in Linear as EX-3055)
  • Read the contribution guidelines 📖
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A run where every download failed now says it could not sync instead
of "Installed". A copy renamed in place because its old name differs
only by case is refreshed in the same run: a stale copy is updated,
and an edited one is replaced under --reset-context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@domitriusclark
domitriusclark requested a review from a team as a code owner October 6, 2026 17:45
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0fa33ef8-8f50-4c2f-a6f2-4ec0bcb98f54
📥 Commits

Reviewing files that changed from the base of the PR and between 20f410f and e52216d.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a32f6e2-51c2-4703-a792-0c61f295ea75
📥 Commits

Reviewing files that changed from the base of the PR and between 9a7d0fc and 20f410f.

📒 Files selected for processing (2)
  • src/utils/init/agent-skills.ts
  • tests/unit/utils/init/agent-skills.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Case-only skill renames now refresh stale content during the same sync. Edited content is preserved unless reset is enabled, and a failed refresh leaves the prior copy available for a later sync.
    • Sync status messages now distinguish completed installations from partial syncs. They also report when no skills could be synced, making outcomes clearer when downloads fail.

Walkthrough

The sync now checks whether a skill directory moved from a prior name contains the current manifest content. If the content differs, it attempts installation and records the resulting action. Sync descriptions distinguish failure-only outcomes, additions, and other changes. Tests cover case-only renames, reset behavior, and total or partial download failures.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: amun-sihra

Merge Risk: ⚪ Minimal · up to 20f41

Case-only renames now refresh stale skills in the same run while preserving local edits unless reset is requested. The sync messages distinguish failure outcomes, and no concrete merge-blocking risk remains.

Architecture Summary

Architecture risk: 🔵 Low · up to 20f41

The change affects 2 systems.

Changed systems: src, tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.
  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/utils/init/agent-skills.ts: After moving a prior-name directory that shares an entry with the current-name path, sync now checks its hash against the manifest and attempts installation on mismatch, forcing it only for reset. A successful install records a reset for a modified prior copy or an update otherwise; the current name is marked installed. Previously, this path only moved the directory, marked it installed, and recorded the rename.
  • observed — Modified behavior in src/utils/init/agent-skills.ts: describeSync adds separate failure-only messages depending on whether any skills are current or kept. “Installed” now applies only when additions are the sole changes and there are no failures; other changed outcomes are “Synced.”
  • observed — Modified behavior in tests/unit/utils/init/agent-skills.test.ts: Adds coverage that a stale skill under a case-only prior name is renamed and refreshed to the current release in the same run, then reports both skills current on the next run.
  • observed — Modified behavior in tests/unit/utils/init/agent-skills.test.ts: Adds failure-and-retry coverage for a stale case-only rename: a missing download produces one failed action, preserves the old copy, and leaves no staging directory; restoring the response lets the next sync finish the rename.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the primary change: correcting first-run skill synchronization outcomes.
Description check ✅ Passed The description directly explains the changes to first-run sync reporting and case-only skill renames, and it identifies the related tests.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/netlify-cli@8580

commit: e52216d

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

📊 Benchmark results

Comparing with 6509eba

  • Dependency count: 1,019 (no change)
  • Package size: 380 MB ⬇️ 0.00% decrease vs. 6509eba
  • Number of ts-expect-error directives: 331 ⬆️ 3.63% increase vs. 6509eba

When other skills are present and only some downloads fail, the
summary now says some skills could not be synced instead of "Could
not sync". Adds a test for a refresh that fails right after a
case-only rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@domitriusclark
domitriusclark enabled auto-merge (squash) October 8, 2026 16:12
@domitriusclark
domitriusclark merged commit 0f2b082 into main Oct 8, 2026
37 checks passed
@domitriusclark
domitriusclark deleted the claude/ex-3055-sync-report-fixes branch October 8, 2026 16:21
sarahetter pushed a commit that referenced this pull request Oct 8, 2026
🤖 I have created a release *beep* *boop*
---


## [27.12.0](v27.11.2...v27.12.0)
(2026-10-08)


### Features

* **init:** install Netlify agent skills by default
([#8555](#8555))
([f3d7e82](f3d7e82))
* **init:** sync installed skills with the manifest
([#8556](#8556))
([332666c](332666c))


### Bug Fixes

* **deps:** batch low-risk dependency updates
([#8585](#8585))
([edd9f44](edd9f44))
* **deps:** update content-type to v3 and read the header string
directly ([#8572](#8572))
([969145c](969145c))
* **dev:** use URL separators for static file paths
([#8593](#8593))
([626224b](626224b))
* **init:** report skill sync outcomes accurately on the first run
([#8580](#8580))
([0f2b082](0f2b082))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com>
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.

2 participants