Skip to content

Rename "use" command to "add" for better clarity#3

Merged
sjquant merged 8 commits into
mainfrom
claude/replace-use-with-add-xzoZ5
Apr 2, 2026
Merged

Rename "use" command to "add" for better clarity#3
sjquant merged 8 commits into
mainfrom
claude/replace-use-with-add-xzoZ5

Conversation

@sjquant

@sjquant sjquant commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

Renamed the CLI command from use to add throughout the codebase to provide clearer semantics about what the command does—adding bundles to a repository.

Key Changes

  • Updated CommandName type to use "add" instead of "use"
  • Renamed the CLI command definition from .command("use") to .command("add")
  • Updated all command parsing logic to reference "add" instead of "use"
  • Updated error messages to reference the add command
  • Updated suggested actions in status output from skul use to skul add
  • Updated requireGitContext() function signature to accept "add" instead of "use"
  • Updated all test cases to use the new add command name and verify the new command behavior

Implementation Details

  • The change is purely a rename with no functional modifications to the command's behavior
  • All references to the command in error messages, help text, and user-facing output have been updated consistently
  • The command still accepts the same arguments and produces the same results as before

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt

claude added 8 commits April 2, 2026 03:32
Replace all references to the `use` command with `add` across CLI
type definitions, command registration, dispatch logic, error messages,
status output, and tests.

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
`BundleManifest` drops `tool` + `targets` in favour of a `tools` map
where each key is a tool name and each value is that tool's targets.
`parseBundleManifest` validates the new shape including per-tool target
validation. `materializeBundle` now iterates all tools in the manifest,
each with its own reserved-destinations set. `index.ts` derives the tool
string from `Object.keys(manifest.tools).join(", ")` for registry storage.

Closes tasks 30 and 31 from TASKS.md (Multi-Tool Bundle Support).

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
- bundle-materialization.test.ts: update all 9 test manifests from old
  flat {tool, targets} shape to new {tools: {[toolName]: targets}} shape;
  add BundleManifest import for type-safe casts in parameterized tests
- bundle-manifest.ts: validate that each tool entry declares at least one
  target (empty {} now throws "tools.<name> must declare at least one target")
- bundle-manifest.ts: eliminate duplicate listToolDefinitions() call on the
  error path in parseToolName
- bundle-materialization.ts: move reservedDestinations into per-target scope
  (innermost loop) where it semantically belongs; rename to reservedDestinations

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
bundle-manifest.ts:
- Fix path traversal: expectRelativePath now rejects "." and embedded
  "/../" sequences via path.normalize (e.g. "foo/../../etc/passwd")
- Combine tool name lookup: replace parseToolName + getToolDefinition!
  with parseToolDefinition returning ToolDefinition directly, eliminating
  the non-null assertion and the redundant second lookup

bundle-materialization.ts:
- Reject symlinks in copyDirectory with a clear error; previously a
  symlink to a directory would be silently followed, potentially reading
  outside the bundle
- Track destinationDir in ownedDirectories when it is freshly created,
  so cleanup correctly removes tool target directories created by skul

bundle-manifest.test.ts:
- Add rejection cases: "." path, embedded parent traversal, null input,
  array tools

bundle-materialization.test.ts:
- Type skillCases/commandCases/agentCases as Array<[ToolName, string]>
  and narrow computed-key casts to BundleManifest["tools"] instead of
  the looser `as BundleManifest`
- Add codex to agentCases (was missing, .codex/agents path untested)
- Add test: conflict throws when no resolveFileConflict callback provided
- Add test: multi-tool manifest writes files to each tool's native dir
- Add test: symlink in bundle triggers rejection error

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
bundle-materialization.ts:
- assertBundleTargetDirectory now uses lstatSync so a symlink-to-directory
  target path is rejected before materialization begins, not just symlinks
  encountered during traversal
bundle-manifest.ts:
- expectRelativePath returns path.normalize(value) instead of raw value so
  stored paths are canonical (e.g. "foo/./bar" → "foo/bar")
bundle-manifest.test.ts:
- Add rejection cases for missing name and whitespace-only name
bundle-materialization.test.ts:
- Add test: symlink-to-directory inside bundle target throws
- Add test: bundle target path itself being a symlink throws

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
Covers the case where a conflict resolution renames an incoming file to
a destination already taken by a prior file written in the same run.
The resolveDestinationPath loop should detect the second conflict and
call resolveFileConflict again with the new destination.

https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt
@sjquant sjquant merged commit eaf95a6 into main Apr 2, 2026
@sjquant sjquant deleted the claude/replace-use-with-add-xzoZ5 branch April 2, 2026 13:26
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