on main help sign in
Merge pull request #23 from charmbracelet/andrey/cha-62-opencodemd-should-probably-be-opencodemd-by-default

feat: normalize `CRUSH.md` as the default name

commitfecea6e97f14e43fb7673d663e2859f97b15bf94 authorKujtim Hoxha <kujtimii.h@gmail.com> dateSat 14 Jun 2025, 09:00 (1 year ago) parent8adc4c05f84289
6 files changed+13−13
crush.md → CRUSH.md README.md+1−1 internal/config/init.go+3−3 internal/llm/prompt/coder.go+3−3 internal/tui/components/dialogs/commands/commands.go+3−3 internal/tui/components/dialogs/init/init.go+3−3
crush.md → CRUSH.mdrenamed

The content is the same.

README.md+1−1
@@ -491,7 +491,7 @@ Crush includes several built-in commands:
491491
492492| Command | Description |
493493| ------------------ | --------------------------------------------------------------------------------------------------- |
494−| Initialize Project | Creates or updates the Crush.md memory file with project-specific information |
494+| Initialize Project | Creates or updates the CRUSH.md memory file with project-specific information |
495495| Compact Session | Manually triggers the summarization of the current session, creating a new session with the summary |
496496
497497## MCP (Model Context Protocol)
internal/config/init.go+3−3
@@ -38,13 +38,13 @@ func ShouldShowInitDialog() (bool, error) {
3838 return false, fmt.Errorf("failed to check init flag file: %w", err)
3939 }
4040
41− // Check if any variation of crush.md already exists in working directory
41+ // Check if any variation of CRUSH.md already exists in working directory
4242 crushExists, err := crushMdExists(WorkingDirectory())
4343 if err != nil {
44− return false, fmt.Errorf("failed to check for crush.md files: %w", err)
44+ return false, fmt.Errorf("failed to check for CRUSH.md files: %w", err)
4545 }
4646 if crushExists {
47− // Crush.md already exists, don't show the dialog
47+ // CRUSH.md already exists, don't show the dialog
4848 return false, nil
4949 }
5050
internal/llm/prompt/coder.go+3−3
@@ -76,12 +76,12 @@ const baseAnthropicCoderPrompt = `You are Crush, an interactive CLI tool that he
7676IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure.
7777
7878# Memory
79−If the current working directory contains a file called Crush.md, it will be automatically added to your context. This file serves multiple purposes:
79+If the current working directory contains a file called CRUSH.md, it will be automatically added to your context. This file serves multiple purposes:
80801. Storing frequently used bash commands (build, test, lint, etc.) so you can use them without searching each time
81812. Recording the user's code style preferences (naming conventions, preferred libraries, etc.)
82823. Maintaining useful information about the codebase structure and organization
8383
84−When you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to Crush.md. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to Crush.md so you can remember it for next time.
84+When you spend time searching for commands to typecheck, lint, build, or test, you should ask the user if it's okay to add those commands to CRUSH.md. Similarly, when learning about code style preferences or important codebase information, ask if it's okay to add that to CRUSH.md so you can remember it for next time.
8585
8686# Tone and style
8787You should be concise, direct, and to the point. When you run a non-trivial bash command, you should explain what the command does and why you are running it, to make sure the user understands what you are doing (this is especially important when you are running a command that will make changes to the user's system).
@@ -156,7 +156,7 @@ The user will primarily request you perform software engineering tasks. This inc
1561561. Use the available search tools to understand the codebase and the user's query.
1571572. Implement the solution using all tools available to you
1581583. Verify the solution if possible with tests. NEVER assume specific test framework or test script. Check the README or search codebase to determine the testing approach.
159−4. VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to crush.md so that you will know to run it next time.
159+4. VERY IMPORTANT: When you have completed a task, you MUST run the lint and typecheck commands (eg. npm run lint, npm run typecheck, ruff, etc.) if they were provided to you to ensure your code is correct. If you are unable to find the correct command, ask the user for the command to run and if they supply it, proactively suggest writing it to CRUSH.md so that you will know to run it next time.
160160
161161NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
162162
internal/tui/components/dialogs/commands/commands.go+3−3
@@ -231,14 +231,14 @@ func (c *commandDialogCmp) defaultCommands() []Command {
231231 {
232232 ID: "init",
233233 Title: "Initialize Project",
234− Description: "Create/Update the Crush.md memory file",
234+ Description: "Create/Update the CRUSH.md memory file",
235235 Handler: func(cmd Command) tea.Cmd {
236− prompt := `Please analyze this codebase and create a Crush.md file containing:
236+ prompt := `Please analyze this codebase and create a CRUSH.md file containing:
237237 1. Build/lint/test commands - especially for running a single test
238238 2. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
239239
240240 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.
241− If there's already a crush.md, improve it.
241+ If there's already a CRUSH.md, improve it.
242242 If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.`
243243 return util.CmdHandler(chat.SendMsg{
244244 Text: prompt,
internal/tui/components/dialogs/init/init.go+3−3
@@ -106,7 +106,7 @@ func (m *initDialogCmp) renderContent() string {
106106
107107 explanation := t.S().Text.
108108 Width(m.width - 4).
109− Render("Initialization generates a new Crush.md file that contains information about your codebase, this file serves as memory for each project, you can freely add to it to help the agents be better at their job.")
109+ Render("Initialization generates a new CRUSH.md file that contains information about your codebase, this file serves as memory for each project, you can freely add to it to help the agents be better at their job.")
110110
111111 question := t.S().Text.
112112 Width(m.width - 4).
@@ -174,12 +174,12 @@ func (m *initDialogCmp) Position() (int, int) {
174174func (m *initDialogCmp) handleInitialization(initialize bool) tea.Cmd {
175175 if initialize {
176176 // Run the initialization command
177− prompt := `Please analyze this codebase and create a Crush.md file containing:
177+ prompt := `Please analyze this codebase and create a CRUSH.md file containing:
1781781. Build/lint/test commands - especially for running a single test
1791792. Code style guidelines including imports, formatting, types, naming conventions, error handling, etc.
180180
181181The file you create will be given to agentic coding agents (such as yourself) that operate in this repository. Make it about 20 lines long.
182−If there's already a crush.md, improve it.
182+If there's already a CRUSH.md, improve it.
183183If there are Cursor rules (in .cursor/rules/ or .cursorrules) or Copilot rules (in .github/copilot-instructions.md), make sure to include them.`
184184
185185 // Mark the project as initialized