on main help sign in
chore: improve initalize text
4a2e540Kujtim Hoxha
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 (
10 tea "github.com/charmbracelet/bubbletea/v2"
10 tea "github.com/charmbracelet/bubbletea/v2"
11 "github.com/charmbracelet/crush/internal/config"
11 "github.com/charmbracelet/crush/internal/config"
12 "github.com/charmbracelet/crush/internal/fur/provider"
12 "github.com/charmbracelet/crush/internal/fur/provider"
13+ "github.com/charmbracelet/crush/internal/llm/prompt"
13 "github.com/charmbracelet/crush/internal/tui/components/chat"
14 "github.com/charmbracelet/crush/internal/tui/components/chat"
14 "github.com/charmbracelet/crush/internal/tui/components/completions"
15 "github.com/charmbracelet/crush/internal/tui/components/completions"
15 "github.com/charmbracelet/crush/internal/tui/components/core"
16 "github.com/charmbracelet/crush/internal/tui/components/core"
@@ -242,14 +243,6 @@ func (s *splashCmp) saveAPIKeyAndContinue(apiKey string) tea.Cmd {
242
243
243func (s *splashCmp) initializeProject() tea.Cmd {
244func (s *splashCmp) initializeProject() tea.Cmd {
244 s.needsProjectInit = false
245 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.`
253
246
254 if err := config.MarkProjectInitialized(); err != nil {
247 if err := config.MarkProjectInitialized(); err != nil {
255 return util.ReportError(err)
248 return util.ReportError(err)
@@ -261,7 +254,7 @@ Add the .crush directory to the .gitignore file if it's not already there.`
261 cmds = append(cmds,
254 cmds = append(cmds,
262 util.CmdHandler(chat.SessionClearedMsg{}),
255 util.CmdHandler(chat.SessionClearedMsg{}),
263 util.CmdHandler(chat.SendMsg{
256 util.CmdHandler(chat.SendMsg{
264− Text: prompt,
257+ Text: prompt.Initialize(),
265 }),
258 }),
266 )
259 )
267 }
260 }
internal/tui/components/dialogs/commands/commands.go+2−9
@@ -6,6 +6,7 @@ import (
6 tea "github.com/charmbracelet/bubbletea/v2"
6 tea "github.com/charmbracelet/bubbletea/v2"
7 "github.com/charmbracelet/lipgloss/v2"
7 "github.com/charmbracelet/lipgloss/v2"
8
8
9+ "github.com/charmbracelet/crush/internal/llm/prompt"
9 "github.com/charmbracelet/crush/internal/tui/components/chat"
10 "github.com/charmbracelet/crush/internal/tui/components/chat"
10 "github.com/charmbracelet/crush/internal/tui/components/completions"
11 "github.com/charmbracelet/crush/internal/tui/components/completions"
11 "github.com/charmbracelet/crush/internal/tui/components/core"
12 "github.com/charmbracelet/crush/internal/tui/components/core"
@@ -239,16 +240,8 @@ func (c *commandDialogCmp) defaultCommands() []Command {
239 Title: "Initialize Project",
240 Title: "Initialize Project",
240 Description: "Create/Update the CRUSH.md memory file",
241 Description: "Create/Update the CRUSH.md memory file",
241 Handler: func(cmd Command) tea.Cmd {
242 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.`
250 return util.CmdHandler(chat.SendMsg{
243 return util.CmdHandler(chat.SendMsg{
251− Text: prompt,
244+ Text: prompt.Initialize(),
252 })
245 })
253 },
246 },
254 },
247 },