AgentSkillsCN

verify-cli

在发布新版本之前,对mpak CLI执行冒烟测试,以验证所有命令是否正常运行。

SKILL.md
--- frontmatter
name: verify-cli
description: Run smoke tests against the mpak CLI to verify all commands work correctly before publishing a new release.

Verify CLI

Run a comprehensive set of smoke tests against the mpak CLI to catch regressions before publishing. This skill builds the CLI, then exercises every command category against the live production registry.

Prerequisites

Before running tests, ensure the working directory is the mpak monorepo root (apps/mpak). Build the CLI and SDK fresh:

code
pnpm --filter @nimblebrain/mpak-sdk build && pnpm --filter @nimblebrain/mpak build

All test commands below should be run from packages/cli/ using node dist/index.js.

Test Procedure

Run each test group below. For every command:

  1. Execute the command
  2. Verify the exit code is 0 (unless testing error cases)
  3. Verify the output matches the expected pattern described
  4. Record PASS or FAIL with details

If any test fails, stop and report the failure with full output before continuing.

1. Version and Help

#CommandExpected
1.1node dist/index.js --versionPrints a valid semver version (not "unknown")
1.2node dist/index.js --helpShows usage with commands: search, run, bundle, skill, config, completion
1.3node dist/index.js bundle --helpShows subcommands: search, show, pull, run
1.4node dist/index.js skill --helpShows subcommands: validate, pack, search, show, pull, install, list

2. Unified Search

#CommandExpected
2.1node dist/index.js search "mcp"Returns results grouped into "Bundles (N):" and "Skills (N):" sections with separate tables
2.2node dist/index.js search "mcp" --type bundleOnly shows "Bundles" section, no "Skills" section
2.3node dist/index.js search "mcp" --type skillOnly shows "Skills" section, no "Bundles" section
2.4node dist/index.js search "mcp" --jsonValid JSON with results array and totals object
2.5node dist/index.js search "mcp" --limit 2Each section shows at most 2 results
2.6node dist/index.js search "xyznonexistent999"Prints "No results found" message

Verify that the Bundles table has columns: NAME, VERSION, TRUST, DESCRIPTION. Verify that the Skills table has columns: NAME, VERSION, CATEGORY, DESCRIPTION.

3. Bundle Commands

Use @nimblebraininc/echo as the test bundle (known to exist with trust level L0).

#CommandExpected
3.1node dist/index.js bundle search "echo"Returns at least 1 result including @nimblebraininc/echo
3.2node dist/index.js bundle show @nimblebraininc/echoShows name, version, type, trust level (L0), provenance, statistics, versions, platforms
3.3node dist/index.js bundle show @nimblebraininc/echo --jsonValid JSON with name, latest_version, certification_level fields
3.4node dist/index.js bundle pull @nimblebraininc/echo -o /tmp/mpak-test-echo.mcpbDownloads file to /tmp/mpak-test-echo.mcpb, file exists and is non-empty
3.5node dist/index.js bundle show @nimblebraininc/doesnotexistExits with error containing "not found" (case-insensitive)

After test 3.4, clean up: rm -f /tmp/mpak-test-echo.mcpb

4. Skill Commands

Use @nimblebraininc/skill-author as the test skill (known to exist).

#CommandExpected
4.1node dist/index.js skill search "skill"Returns results including @nimblebraininc/skill-author
4.2node dist/index.js skill show @nimblebraininc/skill-authorShows name, version, description, metadata (category, tags, author), triggers, versions
4.3node dist/index.js skill show @nimblebraininc/skill-author --jsonValid JSON with name, latest_version, category fields
4.4node dist/index.js skill pull @nimblebraininc/skill-author -o /tmp/mpak-test-skill.skillDownloads file, file exists and is non-empty
4.5node dist/index.js skill show @nimblebraininc/doesnotexistExits with error containing "not found" (case-insensitive)

After test 4.4, clean up: rm -f /tmp/mpak-test-skill.skill

5. Config Commands

These test the local config manager at ~/.mpak/config.json.

#CommandExpected
5.1node dist/index.js config set @test/smoke-test smoke_key=smoke_valueSucceeds with confirmation message
5.2node dist/index.js config get @test/smoke-testShows smoke_key with masked value
5.3node dist/index.js config get @test/smoke-test --jsonValid JSON containing smoke_key
5.4node dist/index.js config listLists @test/smoke-test in output
5.5node dist/index.js config clear @test/smoke-test smoke_keySucceeds with confirmation
5.6node dist/index.js config clear @test/smoke-testSucceeds, clears entire package config
5.7node dist/index.js config get @test/smoke-testShows no configuration or empty result

6. Skill Validate and Pack (Local)

Test against the verify-cli skill directory itself (meta!).

#CommandExpected
6.1node dist/index.js skill validate ../../.claude/skills/verify-cliReports validation result (may have warnings, should not error on structure)

7. Error Handling

#CommandExpected
7.1node dist/index.js searchExits with non-zero code, shows error or help about missing argument
7.2node dist/index.js bundle invalidShows help or error about unknown command

Reporting

After all tests complete, print a summary table:

code
## CLI Smoke Test Results

| Group              | Passed | Failed | Total |
|--------------------|--------|--------|-------|
| Version & Help     | N      | N      | 4     |
| Unified Search     | N      | N      | 6     |
| Bundle Commands    | N      | N      | 5     |
| Skill Commands     | N      | N      | 5     |
| Config Commands    | N      | N      | 7     |
| Local Skill Ops    | N      | N      | 1     |
| Error Handling     | N      | N      | 2     |
|--------------------|--------|--------|-------|
| TOTAL              | N      | N      | 30    |

Overall: PASS / FAIL

If any test failed, list each failure with its test number, command, expected result, and actual output.

The CLI is ready to publish only if all 30 tests pass.