fix(config): look for more than just crush.md

Amolith and Crush created

Crush used to show the initialization popup even when the project uses
something other than `CRUSH.md`. Crush already has support for loading
those other context files, like `CLAUDE.md` or `AGENTS.md`, so this just
changes the popup check logic to look for the same set it loads

Co-Authored-By: Crush <crush@charm.land>

Change summary

internal/config/init.go | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)

Detailed changes

internal/config/init.go 🔗

@@ -4,6 +4,7 @@ import (
 	"fmt"
 	"os"
 	"path/filepath"
+	"slices"
 	"strings"
 	"sync/atomic"
 )
@@ -50,30 +51,38 @@ func ProjectNeedsInitialization() (bool, error) {
 		return false, fmt.Errorf("failed to check init flag file: %w", err)
 	}
 
-	crushExists, err := crushMdExists(cfg.WorkingDir())
+	someContextFileExists, err := contextPathsExist(cfg.WorkingDir())
 	if err != nil {
-		return false, fmt.Errorf("failed to check for CRUSH.md files: %w", err)
+		return false, fmt.Errorf("failed to check for context files: %w", err)
 	}
-	if crushExists {
+	if someContextFileExists {
 		return false, nil
 	}
 
 	return true, nil
 }
 
-func crushMdExists(dir string) (bool, error) {
+func contextPathsExist(dir string) (bool, error) {
 	entries, err := os.ReadDir(dir)
 	if err != nil {
 		return false, err
 	}
 
+	// Create a slice of lowercase filenames for lookup with slices.Contains
+	var files []string
 	for _, entry := range entries {
-		if entry.IsDir() {
-			continue
+		if !entry.IsDir() {
+			files = append(files, strings.ToLower(entry.Name()))
 		}
+	}
+
+	// Check if any of the default context paths exist in the directory
+	for _, path := range defaultContextPaths {
+		// Extract just the filename from the path
+		_, filename := filepath.Split(path)
+		filename = strings.ToLower(filename)
 
-		name := strings.ToLower(entry.Name())
-		if name == "crush.md" {
+		if slices.Contains(files, filename) {
 			return true, nil
 		}
 	}