feat: agent skill version validation and update command#452
feat: agent skill version validation and update command#452Paveltarno wants to merge 8 commits intomainfrom
Conversation
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.50-pr.452.1009307Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.50-pr.452.1009307"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.50-pr.452.1009307"
}
}
Preview published to npm registry — try new features instantly! |
7388ec1 to
6a802cc
Compare
6a802cc to
3409576
Compare
Add background version check that reads installed skills' SKILL.md frontmatter for metadata.sourcePackage and warns when the skill version doesn't match the current CLI version. Also adds `base44 agent-skills update` command to update all locally installed agent skills. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use Promise.all to await upgrade and skill checks concurrently instead of sequentially. Remove unnecessary process.env spread in execa call — execa extends env by default. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without spreading process.env, execa replaces the entire environment when env is passed, so npx has no PATH and fails silently. Also reports skill check errors to PostHog via errorReporter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bun 1.3.11 bundler fails to resolve runTask through the barrel re-export when there's a circular dependency via Base44Command → skill-version-check → theme. Import directly from runTask.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move skill-version-check, upgradeNotification, and version-check into cli/utils/command/ as siblings of Base44Command and render. This eliminates the circular dependency through the barrel that caused Bun 1.3.11 to fail resolving runTask. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR #441 moved runTask from barrel export to CLIContext. Update skills update command to destructure from context like all other commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| "author": "", | ||
| "license": "MIT", | ||
| "scripts": { | ||
| "build": "bun run --parallel --filter \"*\" build", |
| import { execa } from "execa"; | ||
| import { getTestOverrides } from "@/core/config.js"; | ||
| import packageJson from "../../../package.json"; | ||
| import packageJson from "../../../../package.json"; |
There was a problem hiding this comment.
oh nvm you moved it inside the folder
| let skillCheckPromise: Promise<StaleSkillInfo[] | null> = | ||
| Promise.resolve(null); |
There was a problem hiding this comment.
do we need to resolve empty promise here? feels weird
| const SKILLS_REPO = "base44/skills"; | ||
|
|
||
| export async function installAllSkills(cwd: string): Promise<void> { | ||
| await execa("npx", ["-y", "skills", "add", SKILLS_REPO, "--all", "-y"], { | ||
| cwd, | ||
| }); | ||
| } |
There was a problem hiding this comment.
Maybe we can move this into skills/utils.ts, I think it's weird that create.ts file importing from skills/update
| export function getSkillsUpdateCommand(): Command { | ||
| return new Base44Command("update", { | ||
| requireAuth: false, | ||
| requireAppConfig: false, |
There was a problem hiding this comment.
Why make this false and then check later we're inside a folder? I think this should be true
| if (!projectRoot) { | ||
| return { | ||
| outroMessage: | ||
| "Not in a Base44 project. Run this command from a project directory.", | ||
| }; | ||
| } |
There was a problem hiding this comment.
once you set the requireAppConfig to true you don't need this check
| printUpgradeNotification(options.upgradeCheck, options.distribution), | ||
| printSkillVersionWarning(options.skillCheck), |
There was a problem hiding this comment.
nit: I like spreading all the properties of options and check just use them, no need to to options. 3 times
| const skills = await listInstalledSkills(projectRoot); | ||
|
|
||
| const results = await Promise.all( | ||
| skills.map(async (skill) => { |
There was a problem hiding this comment.
lets minimize this the only be on our specific package, maybe by using the "name" field
| ).catch((error) => { | ||
| errorReporter.captureException( | ||
| error instanceof Error ? error : new Error(String(error)), | ||
| ); | ||
| return null; | ||
| }); |
There was a problem hiding this comment.
I say lets move this .catch to be inside the startSkillVersionCheck (you can pass errorReporter as an arg)
| if (upgradeInfo) { | ||
| process.stderr.write( | ||
| `${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}\n`, | ||
| ); | ||
| } | ||
| if (staleSkills && staleSkills.length > 0) { | ||
| process.stderr.write(`${formatPlainSkillWarning(staleSkills)}\n`); | ||
| } |
There was a problem hiding this comment.
can you extract this into another function called "warnings" or similar"?
| @@ -0,0 +1,124 @@ | |||
| import { join } from "node:path"; | |||
There was a problem hiding this comment.
consider naming file "skills-version-check" plural
kfirstri
left a comment
There was a problem hiding this comment.
some comments, changes and test for tests/cli :)
Note
Description
Adds a new
base44 agent-skills updatecommand for managing locally installed agent skills, and introduces an automatic stale-skill version check that runs after every command. When installed skills were built for an older version of the CLI, a warning is shown at the end of command output prompting users to update. The project creation flow is also updated to use the new skill installation utility.Related Issue
None
Type of Change
Changes Made
base44 agent-skills updatecommand (packages/cli/src/cli/commands/skills/) that updates locally installed agent skills to the latest version vianpx skills add base44/skills --allskill-version-check.tsutility that readsSKILL.mdfrontmatter to detect skills built for an older CLI version and prints a warning after command executionBase44Command— runs in parallel with the existing upgrade check and emits stale-skill warnings in both interactive and quiet (--quiet) modesversion-check.tsandupgradeNotification.tsfromcli/utils/intocli/utils/command/to co-locate all command-lifecycle utilitiesshowCommandEndinrender.tsto accept an options object (includes bothupgradeCheckandskillCheckpromises)project createto use the newinstallAllSkills()helper and updated the error message to referencebase44 agent-skills updatereadSkillFrontmatterandformatPlainSkillWarningwith fixture SKILL.md filesbuildscript and.superset/to.gitignoreTesting
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The skill version check is only triggered when a command requires app config (
requireAppConfig: true), since project root is needed to list installed skills. Errors during the check are silently captured viaerrorReporterto avoid interrupting the user's workflow.🤖 Generated by Claude | 2026-04-09 10:05 UTC