Skip to content

Add command target presets for extras init#179

Open
TIR44 wants to merge 1 commit into
runkids:mainfrom
TIR44:feature/extras-command-target-presets
Open

Add command target presets for extras init#179
TIR44 wants to merge 1 commit into
runkids:mainfrom
TIR44:feature/extras-command-target-presets

Conversation

@TIR44
Copy link
Copy Markdown
Contributor

@TIR44 TIR44 commented May 31, 2026

Addresses #146.

Summary

  • Added command target preset expansion for extras init commands (claude / claude-code, cursor, codex).
  • Mapped global presets to ~/.claude/commands, ~/.cursor/commands, and ~/.codex/prompts; mapped project presets to .claude/commands and .cursor/commands.
  • Rejected the project codex preset with a clear message because Codex prompt files are home-scoped rather than project-discovered.
  • Updated CLI help, TUI placeholders, and docs for command invocation differences.

Validation

  • go test ./cmd/skillshare -run 'TestResolveExtraInitTargetPresets|TestCmdExtrasInit_Commands' -count=1\n- make test-unit

@TIR44 TIR44 force-pushed the feature/extras-command-target-presets branch from cf34171 to ea84676 Compare May 31, 2026 13:20
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces command target presets (claude, cursor, and codex) for the 'extras init commands' command, allowing users to easily configure common agent directories in both global and project modes. It updates the command-line help, documentation, and interactive TUI placeholders, and adds corresponding unit tests. The review feedback highlights a potential compatibility issue in the tests where t.Chdir is used, which requires Go 1.24 or later, and suggests a backward-compatible alternative using os.Chdir and t.Cleanup.


func TestCmdExtrasInit_CommandsProjectPresets(t *testing.T) {
root := t.TempDir()
t.Chdir(root)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using t.Chdir requires Go 1.24 or later. If the project supports older Go versions (such as Go 1.22 or 1.23), this will cause a compilation error. Consider using os.Chdir with t.Cleanup to restore the working directory for backward compatibility. Note that you will also need to import the os package.

Suggested change
t.Chdir(root)
oldWD, err := os.Getwd()
if err != nil {
t.Fatalf("get wd: %v", err)
}
if err := os.Chdir(root); err != nil {
t.Fatalf("chdir: %v", err)
}
t.Cleanup(func() {
_ = os.Chdir(oldWD)
})

@TIR44 TIR44 force-pushed the feature/extras-command-target-presets branch from ea84676 to 7605ed7 Compare May 31, 2026 13:23
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