Compare commits

...

3 Commits

Author SHA1 Message Date
Aleksandr Lesnenko
1dc8e211f1 simplify CLAUDE.md 2025-04-03 23:14:20 -04:00
Aleksandr Lesnenko
53f8c2b626 add more info to claude.md 2025-04-03 22:30:06 -04:00
Filipe Silva
19b88404d6 devex: add claude tooling 2025-04-03 11:07:20 +01:00
7 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1 @@
Fix flakey test $ARGUMENTS

View File

@@ -0,0 +1 @@
Fix issue $ARGUMENTS

View File

@@ -0,0 +1 @@
Fetch unresolved comments for this branch's PR, then fix them

View File

@@ -0,0 +1 @@
Repro issue $ARGUMENTS in a failing test

1
.gitignore vendored
View File

@@ -132,3 +132,4 @@ modules/drivers/*/.lsp/*
.aider*
/config.yml
CLAUDE.local.md

50
CLAUDE.md Normal file
View File

@@ -0,0 +1,50 @@
# Metabase Development Guide
## Autonomous Development Workflow
- Do not attempt to read or edit files outside the project folder
- Add failing tests first, then fix them
- Work autonomously in small, testable increments
- Run targeted tests, and lint continuously during development
- Prioritize understanding existing patterns before implementing
- Don't commit changes, leave it for the user to review and make commits
## Quick Commands
### JavaScript/TypeScript
- **Lint:** `yarn lint-eslint`
- **Test:** `yarn test-unit path/to/file.unit.spec.js` or `yarn test-unit -t "pattern"`
- **Watch:** `yarn test-unit-watch path/to/file.unit.spec.js`
- **Format:** `yarn prettier`
- **Type Check:** `yarn type-check`
### Clojure
- **Lint:** `./bin/mage kondo [path]`
- **Format:** `./bin/mage cljfmt-files [path]`
- **Test file:** `clojure -X:dev:test :only namespace/test-name`
### ClojureScript
- **Test:** `yarn test-cljs`
## Codebase rules
### General
- Every change MUST include automated tests
- Use isolated unit tests when the change is reasonable to test without complex dependencies
- For more complex cases, write e2e Cypress tests in `e2e/test/scenarios/*`
### Frontend
- Using TypeScript for new code is preferred
- Components should be in their own directories with related files
- Redux Toolkit should be used for the global state management in the frontend
- Customized Mantine UI is used as a main UI component library. Components are exported from `metabase/ui`
- For styling prefer using Mantine UI style props. If necessary, use CSS modules
- Tests should be comprehensive and match the existing patterns
- When writing unit tests use factories such as `createMockCard` for creating test objects
- Tests must not mock internal details of components/functions being tested
- If a javascript/typescript file imports `cljs` file e.g. "cljs/metabase.pivot.js" then you MUST NOT NOT READ IT as it contains transpiled Clojure to JS code. Instead, find the original \*.cljs code

11
bin/claude-prompt Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: claude-prompt <prompt>"
echo " Launches Claude in non-interactive mode with Metabase-specific tools and the given prompt."
exit 1
fi
set -o xtrace
claude -p "$(printf "%q " "$@")" --allowedTools "Bash(./bin/mage:*)" "Bash(clj-kondo:*)" "Bash(clojure:*)", "Bash(grep:*)" "Bash(ls:*)" "Bash(yarn lint:*)" "Bash(yarn test-unit:*)" "WebFetchTool(domain:github.com)" Edit