fix(cli): 1.33.1, --skill installs reported failure and were not tracked

Merged
DA
12d ago
+143-9

Requested by Daniel · project thread

What this PR does

Fixes the 1.33.0 regression behind the drop in skill installs and the red prod smoke test since run 76 (2026-11-09 01:43 UTC).

#1467 replaced source: 'github_main' with a bare source in installIndividualSkill's trackDownload call (cli-tool/src/index.js:1536). The variable exists only in installIndividualMod. So every catalog skill install wrote all its files, then threw ReferenceError: source is not defined, which the catch reported as a network_error failure:

FAIL skill    development/skill-creator   Error installing skill: source is not defined
Installed 0 of 1 · 1 failed
Retry:  npx claude-code-templates@latest --skill development/skill-creator

trackDownload never ran, so no component_downloads row. GitHub rate limiting is not involved: SKILL.md (32,987 bytes) was downloaded in the failing smoke run. External skills (source.json) use a separate function and were not affected.

  • Restore source: 'github_main'.
  • cli-tool/tests/unit/skill-install.node-test.js: --skill against a stubbed GitHub; checks the files, the exec bit, true returned, and one trackDownload('skill', …, {source: 'github_main'}) + a success outcome. Fails on 1.33.0 with the same error.
  • .github/workflows/cli-ci.yml: the root npm test runs with no dependencies (version-sync.yml), so nothing loaded index.js before release. The new job runs npm ci, npm run test:install-paths and eslint@8.57.0 --rule no-undef over cli-tool/src + cli-tool/bin (browser-only analytics-web/ excluded). On 1.33.0 the lint flags exactly this line; on this branch it is clean.
  • Version 1.33.1 (not published), CHANGELOG. The 1.33.1 release also carries the cct binary removal (#1469), already on main.

Type

  • New component
  • Change to an existing component
  • CLI (cli-tool/src, cli-tool/bin)
  • Website (dashboard/)
  • Docs or other

How I tested it

  • Reproduced from the npm 1.33.0 tarball: --skill development/skill-creator → FAIL … source is not defined, files written.
  • npm pack of this branch, the smoke test's full batch (agent, command, mcp, hook, setting, skill, mod) against the real GitHub and aitmpl.com: Installed 7 of 7 · 0 failed, exit 0; skill-creator 17 files; no cct in bin/.
  • npm test (root) green; npm run test:install-paths passes on this branch and fails with the old line.

Release: needs npm publish from Daniel. Touches cli-tool/src, .github/ and package.json, so it merges by hand (no automerge).


Generated by Claude Code


Summary by cubic

Fixes the 1.33.0 regression in the CLI (cli-tool/) where every --skill install reported failure and was never download-tracked. A ReferenceError: source is not defined in installIndividualSkill's tracking call made the command write all files, then print FAIL, skip the component_downloads row, and exit 1 in a batch. External skills (source.json) used a separate function and were unaffected.

Bug Fixes

  • Restored source: 'github_main' in installIndividualSkill's trackDownload call; --skill installs now return true and are counted as success.
  • Added cli-tool/tests/unit/skill-install.node-test.js, a --skill install against a stubbed GitHub that asserts the files, exec bit, return value, and trackDownload payload; it fails on 1.33.0 with the same error.
  • Added .github/workflows/cli-ci.yml to run npm ci, npm run test:install-paths, and an eslint no-undef pass over cli-tool/src and cli-tool/bin on CLI PRs; the root npm test previously ran without dependencies.
  • No new components or environment variables were added; the catalog (docs/components.json) needs no regeneration.