This file is the shared working agreement for AI coding agents in this repository.
map-frontend/: Vue 3 + Vite + TypeScript + Piniamaplocation/: Django + Django REST Framework + PostgreSQL/PostGIS- Deployment: GitHub Actions, Elastic Beanstalk, S3, CloudFront
- Keep changes scoped and reversible.
- Preserve the ongoing refactor by extracting logic out of large files instead of growing them again.
- Never introduce or copy secrets, credentials, or production-only values into code, docs, or commits.
- Prefer source-of-truth docs over ad hoc instructions.
- Keep handoffs brief and useful, then keep moving.
- Product name is
KiNDD - NDD Resource Navigator; short form isKiNDD. - Do not introduce
CHLAorChildren's Hospital Los Angelesinto new user-facing copy, docs, app strings, or marketing examples. Existing infrastructure identifiers such as DB users, EB environment names, S3 buckets, package names, and folder paths keep their current names until a dedicated rename. - Do not use emojis in code, docs, app strings, shell scripts, or commit messages.
- Use Vue Composition API for new work.
- Prefer
<script setup>in new components. - Put reusable logic in composables, shared state in Pinia stores, and map UI pieces in focused components.
- Do not add major new logic directly into
map-frontend/src/views/MapView.vueif it can be extracted. - Keep API access driven by
VITE_API_BASE_URL, not hardcoded URLs.
- Use
python3for Django commands. - Keep database configuration environment-driven.
- Use PostGIS-aware patterns for spatial logic.
- Create migrations for schema changes and keep them intentional.
- Do not overwrite unrelated user changes.
- Do not run destructive git commands unless explicitly asked.
- Treat deployment scripts and data-sync scripts as higher risk than app code changes.
- Read the relevant code and the closest source-of-truth docs before editing.
- Check the local diff so you understand in-flight user changes.
- Make the smallest complete change that solves the problem cleanly.
- Run the smallest useful verification for the area you touched.
- Update docs only when behavior, workflow, or setup materially changed.
Use the lightest step that still proves the change:
- Quick smoke:
./scripts/quick-test.sh - Backend tests:
cd maplocation && python3 -m pytest - Frontend tests:
cd map-frontend && npm test - Frontend build:
cd map-frontend && npm run build - Pre-deploy pass:
./scripts/test-deployment-locally.sh
If you cannot run a relevant check, say so clearly in the handoff.
Start here instead of inventing commands or setup details:
README.md: project overview and architectureQUICK_START.md: local setup and daily commands.github/copilot-instructions.md: repo structure, conventions, and test expectationsmaplocation/README.md: backend detailsmap-frontend/ENVIRONMENT_SWITCHING.md: frontend environment switchingdocs/: deeper implementation and deployment notes
For the iOS Neurodegenerative Disorders agent, do not assume the work is related to women's health, menopause, or Stella unless explicitly stated.
Before changing response behavior, prompts, backend formatting, or the iOS Markdown renderer, read:
docs/agent/NDD_RESPONSE_FORMAT_CONTRACT.mddocs/agent/IOS_MARKDOWN_RENDERING_CONTRACT.mddocs/agent/NEURO_SAFETY_AND_SCOPE.mddocs/agent/NDD_RESPONSE_EXAMPLES.mddocs/agent/NDD_RESPONSE_ANTI_PATTERNS.mddocs/agent/STREAMING_MARKDOWN_RULES.md
The agent should produce clean, iOS-safe Markdown. Prefer short paragraphs, bold labels, simple bullets, cautious medical wording, and clear next steps. Avoid raw HTML, complex tables, diagnosis, treatment instructions, unsupported Markdown, and long dense clinical explanations.
When response formatting changes, test narrow iPhone layout, streaming Markdown, bold labels, bullet rendering, links, urgent symptom responses, and caregiver-oriented responses.
There is an ongoing effort to keep the frontend maintainable, especially around the map experience.
- If a change touches large view logic, look first for extraction into:
map-frontend/src/composables/map-frontend/src/stores/map-frontend/src/components/
- Prefer small cleanup steps that leave the app working after each change.
- Avoid mixing broad refactors with unrelated behavior changes.
# Local database
docker-compose -f docker-compose.local.yml up -d
# Backend
cd maplocation
source ../venv/bin/activate
python3 manage.py runserver
# Frontend
cd map-frontend
./switch-env.sh dev
npm run dev
# Fast checks
./scripts/quick-test.sh
./scripts/test-deployment-locally.shWhen working from a freshly-provisioned Cursor Cloud VM (or any other fresh Linux dev environment), the following are not yet set up automatically:
- Docker daemon:
dockerdis not started by default. Runsudo dockerd &>/tmp/dockerd.log &andsudo chmod 666 /var/run/docker.sock. - pgvector: the PostGIS image used in
docker-compose.local.ymldoes not include pgvector. After the container starts:docker exec chla-postgres-local bash -c "apt-get update && apt-get install -y postgresql-16-pgvector" docker exec chla-postgres-local psql -U chla_dev -d chla_local -c "CREATE EXTENSION IF NOT EXISTS vector;"
- Migration 0026 on a fresh DB:
0026_delete_providerfails because0022already dropped theproviderstable. Workaround:python3 manage.py migrate locations 0026_delete_provider --fake python3 manage.py migrate
- Pre-existing test failures: backend pytest fixtures and some vitest tests have failures unrelated to the environment — don't treat those as regressions.
- Basic Auth on the admin/client portal: credentials live in AWS
Secrets Manager under
kindd/prod/basic-auth-password,kindd/prod/admin-password, andkindd/prod/client-password. Fetch withaws secretsmanager get-secret-value --secret-id <id>. Never commit these values.
When finishing a task, report:
- what changed
- what you verified
- any remaining risk, follow-up, or blocked checks
MANDATORY: If you need to help with Pinecone, vector databases, embeddings, semantic search, RAG, or recommendations, you MUST read .agents/PINECONE.md first to determine:
- What questions to ask the user
- How to select the programming language
- Which guide files to consult for implementation details
Do not proceed with Pinecone-related tasks without consulting the appropriate guide files. Use .agents/PINECONE.md as your entry point and follow its "Choosing the Right Guide" section to navigate to the appropriate resources.
@./.agents/PINECONE.md @./.agents/PINECONE-cli.md @./.agents/PINECONE-python.md @./.agents/PINECONE-typescript.md @./.agents/PINECONE-go.md @./.agents/PINECONE-java.md @./.agents/PINECONE-quickstart.md @./.agents/PINECONE-troubleshooting.md