Rename "use" command to "add" for better clarity#3
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Renamed the CLI command from
usetoaddthroughout the codebase to provide clearer semantics about what the command does—adding bundles to a repository.Key Changes
CommandNametype to use"add"instead of"use".command("use")to.command("add")"add"instead of"use"addcommandskul usetoskul addrequireGitContext()function signature to accept"add"instead of"use"addcommand name and verify the new command behaviorImplementation Details
https://claude.ai/code/session_01TPqobs11mh34qc8N2i1zEt