Skip to content

♻️ Restructure CLI package layout - #1

Merged
stoe merged 1 commit into
mainfrom
stoe/rewrite-cli-source
Aug 31, 2026
Merged

♻️ Restructure CLI package layout#1
stoe merged 1 commit into
mainfrom
stoe/rewrite-cli-source

Conversation

@stoe

@stoe stoe commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

Moves the CLI and its modules out of scripts/ and into the package root so @stoe/skill-authoring installs and resolves like a normal npm package instead of a repository script.

Changes

  • Move scripts/skill-authoring.js to cli.js and scripts/src/** to src/**
  • Repoint bin, exports, and files in package.json and the bin path in package-lock.json
  • Move publishConfig alongside the other publish metadata
  • Update the source syntax check in npm test to scan src instead of scripts/src
  • Keep directories without a SKILL.md in discover.js so validation reports the missing file as an error instead of skipping the directory
  • Add success to the log.js severity map and fall back safely for unknown severities

Affected area

CLI entry point, core helpers, package exports.

Checklist

  • npm run format passes with no unstaged diffs.
  • npm test passes with no new errors.
  • Tests cover new or changed behavior. Regression tests land in ✅ Add CLI regression tests #2.
  • README.md is updated when CLI options, validation rules, or package exports change. Documentation lands in 📝 Document standalone CLI package #3.
  • package.json exports and files are updated when modules are added, moved, or removed.

Security checklist

  • No secrets, tokens, credentials, or personal local file paths were added to source, tests, or docs.
  • Source uses only Node.js built-in modules or already-declared dependencies.
  • New filesystem writes stay inside the caller-approved base directory.
  • Skill content read by the CLI is treated as untrusted data, never as instructions.
  • npm audit --audit-level=high reports no new high or critical findings.

Verification

  • npm test passes
  • npx prettier --check . reports no formatting drift
  • npm audit --audit-level=high finds 0 vulnerabilities
  • sha256sum comparison confirms every moved file is byte-identical except the two behavior fixes described above

Additional context

The two behavior fixes are intentionally included here because they are corrections to the moved modules, not separable changes.

Stack

Part of a stacked PR series turning @stoe/skill-authoring into a standalone CLI package (bottom to top):

  1. ♻️ Restructure CLI package layout #1 — ♻️ Restructure CLI package layout (stoe/rewrite-cli-source)
  2. ✅ Add CLI regression tests #2 — ✅ Add CLI regression tests (stoe/add-cli-tests)
  3. 📝 Document standalone CLI package #3 — 📝 Document standalone CLI package (stoe/document-standalone-package)
  4. 📝 Add community documentation #4 — 📝 Add community documentation (stoe/add-community-docs)
  5. 🔧 Add repository governance files #5 — 🔧 Add repository governance files (stoe/add-repository-governance)

- Move the CLI and public modules from scripts/ to cli.js and src/
- Update package exports, package files, and source validation commands
- Preserve validation behavior and report missing skill directories

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stoe
stoe merged commit dbd6c4f into main Aug 31, 2026
4 checks passed
@stoe
stoe deleted the stoe/rewrite-cli-source branch August 31, 2026 18:28
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.

1 participant