fix: support custom output directory in skill init#281
fix: support custom output directory in skill init#281peterj merged 6 commits intoagentregistry-dev:mainfrom
Conversation
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
1 similar comment
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
Done in c4e6873 — extracted |
|
Please check the linter issues @optimus-fulcria |
`arctl skill init myskill ./skills/` now creates the project at ./skills/myskill/ instead of requiring the skill to always be created in the current directory. Fixes agentregistry-dev#196 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Address review feedback: extract path resolution logic into a helper function and add a table-driven unit test covering no output dir, absolute output dir, and relative output dir cases. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add tests for empty extraArgs slice and empty string extraArg to ensure the helper correctly falls back to the default behavior. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
Done in c4e6873: extracted |
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
len() for nil slices returns zero, so the nil check is unnecessary. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
|
This doesn't work - if tells me the skill was created in the /subfolder, but it wasn't. can you please NOT use AI and actually test the functionality, so it works as it's supposed to work? |
peterj
left a comment
There was a problem hiding this comment.
please manually test your PRs.
There was a problem hiding this comment.
For the generation logic we use config directory for some git logic, and the project name for generation. We need to fix it to use the config.Directory for project generation. This is a pre-existing bug, which is why it fails to create the directory locally for the init (cc @peterj)
err = templates.NewGenerator().GenerateProject(templates.ProjectConfig{
NoGit: initNoGit,
Directory: projectPath,
Verbose: false,
ProjectName: projectName,
Empty: initEmpty,
})// we create skill here
destPath := filepath.Join(config.ProjectName, strings.TrimSuffix(path, ".tmpl"))if !config.NoGit {
if err := g.initGitRepo(config.Directory, config.Verbose); err != nil {
// Don't fail the whole operation if git init fails
if config.Verbose {
fmt.Printf("Warning: failed to initialize git repository: %v\n", err)
}
}
}We'd need to update destPath to destPath := filepath.Join(config.Directory, strings.TrimSuffix(path, ".tmpl")).
On a side-but-relevant note, I'd prefer if this was a CLI flag as shown in the description, instead of a positional argument. Output directory is optional, so if we for any reason add any more required positional arguments, this will either get confusing (i.e. arctl skill init test "" argument2) or require breaking CLI command updates to reorder. My opinion though, not sure what others may think.
Signed-off-by: Fabian Gonzalez <[email protected]>
Signed-off-by: Fabian Gonzalez <[email protected]>
inFocus7
left a comment
There was a problem hiding this comment.
Resolved some of the comments I had made. I technically approve this, although would be better to get additional reviewer as I made some changes here.
Thanks for the contribution!
I think you address your comment from yesterday:)
Description
Support a custom output directory in
skill initso users can specify where the skill project is created.What changed:
--output-dirflag toskill initresolveProjectPathhelper function for path resolution logicresolveProjectPathconfig.Directoryinstead ofconfig.ProjectName.Change Type
/kind fix
Changelog
Validation