|
1 | | -- Always run ./check.sh after you made changes |
2 | | -- Never commit unless the user instructed you to |
3 | | -- Never run npm run build or any of the variants. The user is running ./dev.sh in a separate process which continuously rebuilds |
| 1 | +# Development Rules |
| 2 | + |
| 3 | +## First Message |
| 4 | +If the user did not give you a concrete task, read README.md first. |
| 5 | + |
| 6 | +## Commands |
| 7 | +- After code changes: run `./check.sh`. Fix all errors and warnings before committing. |
| 8 | +- The user runs `./dev.sh` in a separate tmux session. Do not run `npm run dev` or `npm run build`. |
| 9 | +- NEVER commit unless the user asks. |
| 10 | + |
| 11 | +## Code Quality |
| 12 | +- No `any` types unless absolutely necessary |
| 13 | +- Check node_modules for external API type definitions instead of guessing |
| 14 | +- NEVER use inline imports (no `await import(...)`, no `import("pkg").Type`) |
| 15 | +- Always ask before removing functionality or code that appears intentional |
| 16 | + |
| 17 | +## Dependencies |
| 18 | +- `@mariozechner/mini-lit`, `@mariozechner/pi-ai`, `@mariozechner/pi-web-ui`, `@mariozechner/pi-agent-core` are linked via `file:` to sibling repos `../mini-lit` and `../pi-mono` |
| 19 | +- Changes to those packages require rebuilding them (the dev watcher handles this) |
| 20 | +- If you need to modify upstream code, edit it in `../pi-mono` or `../mini-lit` directly and rebuild |
| 21 | + |
| 22 | +## Changelog |
| 23 | +Location: `CHANGELOG.md` |
| 24 | + |
| 25 | +### Format |
| 26 | +Use these sections under `## [Unreleased]`: |
| 27 | +- `### Breaking Changes` |
| 28 | +- `### Added` |
| 29 | +- `### Changed` |
| 30 | +- `### Fixed` |
| 31 | +- `### Removed` |
| 32 | + |
| 33 | +### Rules |
| 34 | +- New entries ALWAYS go under `## [Unreleased]` |
| 35 | +- Append to existing subsections, do not create duplicates |
| 36 | +- NEVER modify already-released version sections |
| 37 | + |
| 38 | +## Releasing |
| 39 | +When the user asks to do a release: |
| 40 | +1. Ask: major, minor, or patch? |
| 41 | +2. Ensure `CHANGELOG.md` has entries under `## [Unreleased]` |
| 42 | +3. Run `./release.sh <major|minor|patch>` |
| 43 | + |
| 44 | +The script bumps the version in `static/manifest.chrome.json`, finalizes the changelog, commits, tags, and pushes. GitHub Actions builds and publishes the release. |
| 45 | + |
| 46 | +## Updating the Website |
| 47 | +When the user asks to update the website: |
| 48 | +```bash |
| 49 | +cd site && ./run.sh deploy |
| 50 | +``` |
| 51 | +Requires SSH access to `slayer.marioslab.io`. |
| 52 | + |
| 53 | +The site is static HTML (no backend). Source is in `site/src/frontend/`. |
| 54 | + |
| 55 | +## Style |
| 56 | +- No emojis in commits, code, or comments |
| 57 | +- No fluff or cheerful filler text |
| 58 | +- Technical prose only, direct and concise |
| 59 | + |
| 60 | +## Git Rules |
| 61 | +- NEVER use `git add -A` or `git add .` |
| 62 | +- ALWAYS use `git add <specific-file-paths>` |
| 63 | +- NEVER use `git reset --hard`, `git checkout .`, `git clean -fd`, `git stash` |
| 64 | +- NEVER use `git commit --no-verify` |
| 65 | +- Include `fixes #<number>` or `closes #<number>` in commit messages when applicable |
| 66 | + |
| 67 | +## Project Structure |
| 68 | +``` |
| 69 | +src/ |
| 70 | + sidepanel.ts # Main entry point, agent setup, settings, rendering |
| 71 | + background.ts # Service worker (sidepanel toggle, session locks) |
| 72 | + oauth/ # Browser OAuth flows (Anthropic, OpenAI, GitHub, Gemini) |
| 73 | + dialogs/ # Settings tabs, API key dialogs, welcome setup |
| 74 | + tools/ # Agent tools (navigate, REPL, extract-image, skills, debugger) |
| 75 | + messages/ # Custom message types (navigation, welcome) |
| 76 | + storage/ # IndexedDB storage (sessions, skills, costs) |
| 77 | + prompts/ # System prompt and token counting |
| 78 | + components/ # UI components (Toast, TabPill, OrbAnimation) |
| 79 | +site/ |
| 80 | + src/frontend/ # Static landing page and install instructions |
| 81 | +static/ |
| 82 | + manifest.chrome.json # Extension manifest (version lives here) |
| 83 | +``` |
0 commit comments