Skip to content

feat: agent skill version validation and update command#452

Open
Paveltarno wants to merge 8 commits intomainfrom
showy-cloche
Open

feat: agent skill version validation and update command#452
Paveltarno wants to merge 8 commits intomainfrom
showy-cloche

Conversation

@Paveltarno
Copy link
Copy Markdown
Collaborator

@Paveltarno Paveltarno commented Mar 29, 2026

Note

Description

Adds a new base44 agent-skills update command 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added base44 agent-skills update command (packages/cli/src/cli/commands/skills/) that updates locally installed agent skills to the latest version via npx skills add base44/skills --all
  • Added skill-version-check.ts utility that reads SKILL.md frontmatter to detect skills built for an older CLI version and prints a warning after command execution
  • Integrated skill version check into Base44Command — runs in parallel with the existing upgrade check and emits stale-skill warnings in both interactive and quiet (--quiet) modes
  • Moved version-check.ts and upgradeNotification.ts from cli/utils/ into cli/utils/command/ to co-locate all command-lifecycle utilities
  • Refactored showCommandEnd in render.ts to accept an options object (includes both upgradeCheck and skillCheck promises)
  • Updated project create to use the new installAllSkills() helper and updated the error message to reference base44 agent-skills update
  • Added unit tests for readSkillFrontmatter and formatPlainSkillWarning with fixture SKILL.md files
  • Added root-level build script and .superset/ to .gitignore

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional 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 via errorReporter to avoid interrupting the user's workflow.


🤖 Generated by Claude | 2026-04-09 10:05 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 29, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.50-pr.452.1009307

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.50-pr.452.1009307"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.50-pr.452.1009307"
  }
}

Preview published to npm registry — try new features instantly!

@Paveltarno Paveltarno marked this pull request as ready for review March 29, 2026 14:46
@Paveltarno Paveltarno force-pushed the showy-cloche branch 4 times, most recently from 6a802cc to 3409576 Compare March 30, 2026 14:03
Paveltarno and others added 7 commits April 9, 2026 12:54
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",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice

import { execa } from "execa";
import { getTestOverrides } from "@/core/config.js";
import packageJson from "../../../package.json";
import packageJson from "../../../../package.json";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this was broken? 🤔

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nvm you moved it inside the folder

Comment on lines +117 to +118
let skillCheckPromise: Promise<StaleSkillInfo[] | null> =
Promise.resolve(null);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to resolve empty promise here? feels weird

Comment on lines +7 to +13
const SKILLS_REPO = "base44/skills";

export async function installAllSkills(cwd: string): Promise<void> {
await execa("npx", ["-y", "skills", "add", SKILLS_REPO, "--all", "-y"], {
cwd,
});
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make this false and then check later we're inside a folder? I think this should be true

Comment on lines +19 to +24
if (!projectRoot) {
return {
outroMessage:
"Not in a Base44 project. Run this command from a project directory.",
};
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once you set the requireAppConfig to true you don't need this check

Comment on lines +37 to +38
printUpgradeNotification(options.upgradeCheck, options.distribution),
printSkillVersionWarning(options.skillCheck),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I like spreading all the properties of options and check just use them, no need to to options. 3 times

Copy link
Copy Markdown
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add tests for tests/cli and not just tests/core

const skills = await listInstalledSkills(projectRoot);

const results = await Promise.all(
skills.map(async (skill) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets minimize this the only be on our specific package, maybe by using the "name" field

Comment on lines +129 to +134
).catch((error) => {
errorReporter.captureException(
error instanceof Error ? error : new Error(String(error)),
);
return null;
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say lets move this .catch to be inside the startSkillVersionCheck (you can pass errorReporter as an arg)

Comment on lines 157 to +164
if (upgradeInfo) {
process.stderr.write(
`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}\n`,
);
}
if (staleSkills && staleSkills.length > 0) {
process.stderr.write(`${formatPlainSkillWarning(staleSkills)}\n`);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you extract this into another function called "warnings" or similar"?

@@ -0,0 +1,124 @@
import { join } from "node:path";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider naming file "skills-version-check" plural

Copy link
Copy Markdown
Collaborator

@kfirstri kfirstri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some comments, changes and test for tests/cli :)

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