normogen/.gooserules
goose 17efc4f656 docs: reconcile documentation with reality (P3)
Make the project's documentation match the code and remove the sprawl. The docs
claimed Phase 2.8 (drug interactions) was 'planning/0%' and the backend '~91%
complete' — both wrong: 2.8 is implemented and live, plus the P0/P1 security
and test work is done. Five root CI/CD docs described a 'docker-build' CI job
that was removed; ~18 backend/ status snapshots and ~24 docs/implementation
duplicates cluttered the tree.

Deletions (85 files):
- Root: 4 stale CI/CD reports (CI-CD-{COMPLETION-REPORT,IMPLEMENTATION-SUMMARY,
  STATUS-REPORT,FINAL-STATUS}.md) — all describe the removed docker-build job.
- backend/: 18 phase/build/fix snapshots and code-dump .txt files.
- docs/: the 3 one-time reorg reports; ~17 docs/implementation duplicates and
  process artifacts; 4 stale docs/development CI docs + git snapshots;
  redundant deployment/testing files.
- thoughts/: STATUS.md (said Phase 2.4 in-progress), superseded phase notes and
  duplicative research inputs. tmp/ (928KB of CI debug logs, gitignored).

Moves (18 files):
- 9 genuine decision records -> docs/adr/ (Architecture Decision Records),
  date-prefixes stripped, with an index README.
- 8 historical-but-valuable phase plans/specs + the old CI-CD-FINAL-SOLUTION ->
  docs/archive/ (now-populated, with a README explaining it's superseded
  material). thoughts/ tree removed.

Rewrites (13 files) to match reality:
- Drop the fake '% complete' figures everywhere in favor of Implemented /
  In-Progress / Planned with concrete endpoint/feature lists.
- Phase 2.8 -> Implemented; add /api/interactions/* and /api/auth/{refresh,
  logout} to the endpoint lists; fix 'Rust 1.93' -> edition 2021.
- Add a Security section (token_version validation, hashed refresh-token
  persistence, fail-fast config, real-IP audit) and correct the test-coverage
  and deployment claims to reality.
- New canonical docs/development/CI-CD.md (4 jobs: format/clippy/build/test,
  mongo service, no docker-build + why).
- README, docs/README, product/{STATUS,ROADMAP,PROGRESS,README,introduction},
  implementation/README, development/README, testing/README, AI_AGENT_GUIDE,
  .cursorrules, .gooserules all updated.

Verified: greps for 'Phase 2.8 (Planning)', 'PLANNING (0%)', 'Rust 1.93',
'91%/10%/85% complete', and 'docker-build' return nothing outside docs/archive;
all internal doc links resolve; backend/src untouched (cargo build clean).
2026-06-27 16:02:16 -03:00

119 lines
3.6 KiB
Text

# Goose-Specific Rules for Normogen
## Agent Configuration
- **Agent Name**: goose
- **Working Directory**: /home/asoliver/desarrollo/normogen
- **Available Tools**: apps, chatrecall, computercontroller, context7, developer, extensionmanager, memory, repomix, skills, todo
## Goose-Specific Behaviors
### Tool Usage
1. **ALWAYS batch multiple tool operations into ONE execute_code call**
- ❌ WRONG: Separate execute_code calls for read file, then write file
- ✅ RIGHT: One execute_code with a script that reads AND writes
2. **Use read_module before calling unfamiliar tools**
- Check tool signatures to understand required vs optional parameters
- Tool signature format: `toolName({ param1: type, param2?: type }): string`
3. **Provide tool_graph parameter**
- Describe execution flow for UI
- Each node has: tool, description, depends_on
### Task Management
1. **Update todo immediately when given a task**
- Capture all explicit AND implicit requirements
- Break down into subtasks
2. **Confirm before implementing code changes**
- Show what you plan to change
- Wait for user approval
3. **Commit with relevant messages when making changes**
- Use conventional commit format
- Reference related issues/phases
### Global Hints to Follow
- Run unit tests before committing any changes
- Prefer functional programming patterns where applicable
- Do not suppress warnings - fix root cause or prompt for correct handling
## Project-Specific Context
### Quick Commands
```bash
# Backend
cd backend && cargo build
cd backend && cargo test
cd backend && cargo clippy
cd backend && docker compose up -d
# Frontend
cd web/normogen-web && npm install
cd web/normogen-web && npm start
cd web/normogen-web && npm test
# Testing
./docs/testing/quick-test.sh
./docs/testing/test-api-endpoints.sh
```
### File Locations
- Backend handlers: `backend/src/handlers/`
- Backend models: `backend/src/models/`
- Frontend pages: `web/normogen-web/src/pages/`
- Frontend services: `web/normogen-web/src/services/`
### Current Phase
- Phase 2.8 (Drug Interactions) implemented
- Backend: Phase 2.x feature-complete, security-hardened
- Frontend: early stage (Login/Register + API/store; router not wired)
- Open work: frontend (Phase 3)
### Code Patterns
- Backend: Repository pattern, async/await, Result<_, ApiError>
- Frontend: Functional components, Zustand, Material-UI
- Auth: JWT with middleware on protected routes
- Testing: cargo test, npm test, integration scripts
## Before Making Changes
1. Read [AI_QUICK_REFERENCE.md](docs/AI_QUICK_REFERENCE.md)
2. Check [product/STATUS.md](docs/product/STATUS.md) for current progress
3. Review existing code patterns
4. Plan your approach
## Common Workflows
### Add Backend Feature
1. Add model to `backend/src/models/`
2. Add handler to `backend/src/handlers/`
3. Register route in `backend/src/main.rs`
4. Add tests
5. Update docs
### Add Frontend Feature
1. Add types to `web/normogen-web/src/types/api.ts`
2. Add API service to `web/normogen-web/src/services/api.ts`
3. Add Zustand store
4. Create page/component
5. Add route
## Testing Before Committing
- Run `cargo test` in backend
- Run `cargo clippy` and fix warnings
- Run `npm test` in frontend if changed
- Run integration tests in `docs/testing/`
## Commit Guidelines
- Format: `feat(scope): description`
- Examples:
- `feat(backend): implement drug interaction checking`
- `fix(medication): resolve adherence calculation bug`
- `docs(ai): add goose-specific rules`
---
**Goose Rules Version**: 1.0
**Last Updated**: 2026-03-09
**For detailed guide**: See [docs/AI_AGENT_GUIDE.md](docs/AI_AGENT_GUIDE.md)