| 1 | # Project Instructions for AI Agents
|
|---|
| 2 |
|
|---|
| 3 | This file provides instructions and context for AI coding agents working on this project.
|
|---|
| 4 |
|
|---|
| 5 | <!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:7510c1e2 -->
|
|---|
| 6 | ## Beads Issue Tracker
|
|---|
| 7 |
|
|---|
| 8 | This project uses **bd (beads)** for issue tracking. Run `bd prime` to see full workflow context and commands.
|
|---|
| 9 |
|
|---|
| 10 | ### Quick Reference
|
|---|
| 11 |
|
|---|
| 12 | ```bash
|
|---|
| 13 | bd ready # Find available work
|
|---|
| 14 | bd show <id> # View issue details
|
|---|
| 15 | bd update <id> --claim # Claim work
|
|---|
| 16 | bd close <id> # Complete work
|
|---|
| 17 | ```
|
|---|
| 18 |
|
|---|
| 19 | ### Rules
|
|---|
| 20 |
|
|---|
| 21 | - Use `bd` for ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists
|
|---|
| 22 | - Run `bd prime` for detailed command reference and session close protocol
|
|---|
| 23 | - Use `bd remember` for persistent knowledge — do NOT use MEMORY.md files
|
|---|
| 24 |
|
|---|
| 25 | **Architecture in one line:** issues live in a local Dolt DB; sync uses `refs/dolt/data` on your git remote; `.beads/issues.jsonl` is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/SYNC_CONCEPTS.md for details and anti-patterns.
|
|---|
| 26 |
|
|---|
| 27 | ## Session Completion
|
|---|
| 28 |
|
|---|
| 29 | **When ending a work session**, you MUST complete ALL steps below. Work is NOT complete until `git push` succeeds.
|
|---|
| 30 |
|
|---|
| 31 | **MANDATORY WORKFLOW:**
|
|---|
| 32 |
|
|---|
| 33 | 1. **File issues for remaining work** - Create issues for anything that needs follow-up
|
|---|
| 34 | 2. **Run quality gates** (if code changed) - Tests, linters, builds
|
|---|
| 35 | 3. **Update issue status** - Close finished work, update in-progress items
|
|---|
| 36 | 4. **PUSH TO REMOTE** - This is MANDATORY:
|
|---|
| 37 | ```bash
|
|---|
| 38 | git pull --rebase
|
|---|
| 39 | git push
|
|---|
| 40 | git status # MUST show "up to date with origin"
|
|---|
| 41 | ```
|
|---|
| 42 | 5. **Clean up** - Clear stashes, prune remote branches
|
|---|
| 43 | 6. **Verify** - All changes committed AND pushed
|
|---|
| 44 | 7. **Hand off** - Provide context for next session
|
|---|
| 45 |
|
|---|
| 46 | **CRITICAL RULES:**
|
|---|
| 47 | - Work is NOT complete until `git push` succeeds
|
|---|
| 48 | - NEVER stop before pushing - that leaves work stranded locally
|
|---|
| 49 | - NEVER say "ready to push when you are" - YOU must push
|
|---|
| 50 | - If push fails, resolve and retry until it succeeds
|
|---|
| 51 | <!-- END BEADS INTEGRATION -->
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | ## Build & Test
|
|---|
| 56 |
|
|---|
| 57 | ```bash
|
|---|
| 58 | npm start # production: node src/server.js
|
|---|
| 59 | npm run dev # watch mode
|
|---|
| 60 | npm test # unit tests (built-in node:test runner, no extra deps)
|
|---|
| 61 | ```
|
|---|
| 62 |
|
|---|
| 63 | Tests live in `test/*.test.js` and run against an in-memory SQLite
|
|---|
| 64 | (`DATABASE_PATH=':memory:'`), so they never touch real data. Cover new
|
|---|
| 65 | permission logic with tests — `PermissionsService.canAdminSite` was once
|
|---|
| 66 | silently broken; see `test/site-permissions.test.js`.
|
|---|
| 67 |
|
|---|
| 68 | ## Architecture Overview
|
|---|
| 69 |
|
|---|
| 70 | _Add a brief overview of your project architecture_
|
|---|
| 71 |
|
|---|
| 72 | ## Conventions & Patterns
|
|---|
| 73 |
|
|---|
| 74 | _Add your project-specific conventions here_
|
|---|