Skip to content

add command ​

FieldValue
Slugcmd-add
Statusimplemented
Last review2026-08-09

Summary ​

skli add {ide} {kind} {path} references a local Package (Skill, Rule, or Agent) in the current project's ProjectManifest ({cwd}/.skli/skli.json). Does not install files; does not write to the ProjectIndex. If the ProjectManifest is missing, error inviting npx @zortracks/skli init.

User flows ​

Flow-01 — Reference a local Package ​

Persona: developer.
Preconditions: ProjectManifest present; path points to an existing file or directory.

StepActionExpected resultError
1skli add <ide> <kind> <path>ide / kind validatedinvalid / missing
2—path resolved; exists (file or directory)path does not exist
3—ProjectManifest readProjectManifest missing → message npx @zortracks/skli init
4—Upsert entry: source=local, path, versioning=none, ide (no version, no repos, no ides)EACCES
5—Success message; exit code 0—

Flow-02 — Package already referenced (same id) ​

StepActionExpected resultError
1skli add <ide> <kind> <path> with id already presentEntry updated; success—

Flow-03 — ProjectManifest missing ​

StepActionExpected resultError
1skli add <ide> <kind> <path> without {cwd}/.skli/skli.jsonNo writeClear error inviting npx @zortracks/skli init; exit code ≠ 0

Data model ​

Package entry — see config-manifests.

Field writtenValue
Key (id)Basename of path without extension
source"local"
pathPath relative to cwd if possible, otherwise absolute (POSIX separators)
versioning"none"
ideIdeId from CLI

No repos, no version, no ides.

CLI ​

skli add <ide> <kind> <path>

Arguments:
  ide     IdeId: cursor | claude | codex | copilot | windsurf
  kind    PackageKind: skill | rule | agent
  path    Local Package path (file or directory)

Business rules ​

IdRule
BR-cmd-add-001ide, kind, and path are required.
BR-cmd-add-002kind ∈ PackageKind (skill, rule, agent).
BR-cmd-add-003path must exist (file or directory); otherwise error.
BR-cmd-add-004ProjectManifest = {cwd}/.skli/skli.json; if missing: error inviting npx @zortracks/skli init (do not create the file).
BR-cmd-add-005Write the entry in the map matching kind (skills / rules / agents).
BR-cmd-add-006Id = basename of path without extension.
BR-cmd-add-007Entry: source=local, path relative if possible, versioning=none, ide; omit repos, version, ides.
BR-cmd-add-008Same id already present: upsert, no error.
BR-cmd-add-009Do not modify the ProjectIndex.
BR-cmd-add-010ide ∈ IdeId.

User scenarios ​

After npx @zortracks/skli init, from the repo: skli add cursor rule .cursor/rules/specs-documentation.mdc records the rule in .skli/skli.json.

Dependencies ​

Out of scope ​

  • ProjectManifest creation (→ cmd-init).
  • File install / copy (→ install).
  • ProjectIndex.
  • Global / IDE scope.

Acceptance criteria ​

  • [x] skli add <ide> <kind> <path> upserts a local Package entry with ide in the ProjectManifest map.
  • [x] Refuses if ProjectManifest missing with message npx @zortracks/skli init.
  • [x] Refuses invalid ide/kind or missing path.
  • [x] Idempotent (upsert) for the same id.
  • [x] Does not touch ~/.skli/projects.json.

Terminology ​

See domain-glossary.

Implementation notes ​

src/commands/add.ts + manifest helpers (readProjectManifest / writeProjectManifest / addPackageToManifest).

Released under the MIT License.