on main help sign in
chore: improve initalize text
commit4a2e54099c9f124ed6e066ca7f5a2796a8ea998f authorKujtim Hoxha <kujtimii.h@gmail.com> dateThu 10 Jul 2025, 20:59 (1 year ago) parentd7baec0
3 files changed+18−18
internal/llm/prompt/initialize.go+14 internal/tui/components/chat/splash/splash.go+2−9 internal/tui/components/dialogs/commands/commands.go+2−9
internal/llm/prompt/initialize.gonew file+14
@@ -0,0 +1,14 @@
1+package prompt
2+
3+func Initialize() string {
4+ return `Please analyze this codebase and create a **CRUSH.md** file containing:
5+
6+- Build/lint/test commands - especially for running a single test
7+- Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
8+
9+The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20-30 lines long.
10+If there's already a **CRUSH.md**, improve it.
11+
12+If there are Cursor rules` + " (in `.cursor/rules/` or `.cursorrules`) or Copilot rules (in `.github/copilot-instructions.md`), make sure to include them.\n" +
13+ "Add the `.crush` directory to the `.gitignore` file if it's not already there."
14+}
internal/tui/components/chat/splash/splash.go+2−9
@@ -10,6 +10,7 @@ import (
1010 tea "github.com/charmbracelet/bubbletea/v2"
1111 "github.com/charmbracelet/crush/internal/config"
1212 "github.com/charmbracelet/crush/internal/fur/provider"
13+ "github.com/charmbracelet/crush/internal/llm/prompt"
1314 "github.com/charmbracelet/crush/internal/tui/components/chat"
1415 "github.com/charmbracelet/crush/internal/tui/components/completions"
1516 "github.com/charmbracelet/crush/internal/tui/components/core"
@@ -242,14 +243,6 @@ func (s *splashCmp) saveAPIKeyAndContinue(apiKey string) tea.Cmd {
242243
243244func (s *splashCmp) initializeProject() tea.Cmd {
244245 s.needsProjectInit = false
245− prompt := `Please analyze this codebase and create a CRUSH.md file containing:
246−1. Build/lint/test commands - especially for running a single test
247−2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
248−
249−The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20 lines long.
250−If there's already a CRUSH.md, improve it.
251−If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.
252−Add the .crush directory to the .gitignore file if it's not already there.`
253246
254247 if err := config.MarkProjectInitialized(); err != nil {
255248 return util.ReportError(err)
@@ -261,7 +254,7 @@ Add the .crush directory to the .gitignore file if it's not already there.`
261254 cmds = append(cmds,
262255 util.CmdHandler(chat.SessionClearedMsg{}),
263256 util.CmdHandler(chat.SendMsg{
264− Text: prompt,
257+ Text: prompt.Initialize(),
265258 }),
266259 )
267260 }
internal/tui/components/dialogs/commands/commands.go+2−9
@@ -6,6 +6,7 @@ import (
66 tea "github.com/charmbracelet/bubbletea/v2"
77 "github.com/charmbracelet/lipgloss/v2"
88
9+ "github.com/charmbracelet/crush/internal/llm/prompt"
910 "github.com/charmbracelet/crush/internal/tui/components/chat"
1011 "github.com/charmbracelet/crush/internal/tui/components/completions"
1112 "github.com/charmbracelet/crush/internal/tui/components/core"
@@ -239,16 +240,8 @@ func (c *commandDialogCmp) defaultCommands() []Command {
239240 Title: "Initialize Project",
240241 Description: "Create/Update the CRUSH.md memory file",
241242 Handler: func(cmd Command) tea.Cmd {
242− prompt := `Please analyze this codebase and create a CRUSH.md file containing:
243− 1. Build/lint/test commands - especially for running a single test
244− 2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
245−
246− The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20 lines long.
247− If there's already a CRUSH.md, improve it.
248− If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.
249− Add the .crush directory to the .gitignore file if it's not already there.`
250243 return util.CmdHandler(chat.SendMsg{
251− Text: prompt,
244+ Text: prompt.Initialize(),
252245 })
253246 },
254247 },