NesVentory
Copilot instructions94 starsChanged 7 months agoMITView on GitHub
Nestarr is a single-container home inventory app: - Frontend: React 19 + TypeScript + Vite (no JSX transform config needed; uses SWC plugin) - Backend: FastAPI (Python) serving the frontend's dist/ as static files - Database: SQLite by default (./data/nestarr.db locally, /app/data/nestarr.db in Docker). PostgreSQL is supported via env vars but not the default. - API: Frontend calls /api/... on the same origin. VITEAPIBASE_URL defaults to "" (same-origin). No proxy needed in production.
- Reads credentials
We split this copilot-instructions.md into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 78
Adding a new API endpoint: create a router function in the relevant file under backend/app/routers/, add the router to main.py's import and …
- Very specific: line 79
Photo types: use constants from src/lib/constants.ts (PHOTO_TYPES.*).
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Nestarr – Copilot Instructions
Commands
Frontend
npm run dev # Dev server on :5173
npm run build # Production build → dist/
npm run preview # Preview production buildBackend tests
# All backend tests
cd backend && PYTHONPATH=. pytest tests/ -v
# Single test file
cd backend && PYTHONPATH=. pytest tests/test_ai_error_handling.py -v
# Single test
cd backend && PYTHONPATH=. pytest tests/test_ai_error_handling.py::TestClassName::test_method_name -vDocker (full stack)
docker compose up --buildArchitecture
Nestarr is a single-container home inventory app:
- Frontend: React 19 + TypeScript + Vite (no JSX transform config needed; uses SWC plugin)
- Backend: FastAPI (Python) serving the frontend's
dist/as static files - Database: SQLite by default (
./data/nestarr.dblocally,/app/data/nestarr.dbin Docker). PostgreSQL is supported via env vars but not the default. - API: Frontend calls
/api/...on the same origin.VITE_API_BASE_URLdefaults to""(same-origin). No proxy needed in production.
Frontend state management
There is no Redux/Zustand/Context store. All shared state lives in App.tsx and is passed down as props. src/lib/api.ts contains all fetch calls (plain fetch, not axios). Types shared between files live in src/lib/api.ts (full API types) and src/lib/types.ts (upload helpers).
Backend layout
backend/app/
main.py # FastAPI app, static file serving, runs run_migrations() on startup
models.py # SQLAlchemy ORM models
schemas.py # Pydantic request/response schemas
crud.py # DB operations
auth.py # JWT (jose), bcrypt, Google OAuth, OIDC, API key auth
database.py # SQLite engine setup, path detection (Docker vs local)
config.py # Pydantic Settings (env vars)
storage.py # Abstract storage: local filesystem or S3
deps.py # FastAPI dependency: get_db()
routers/ # One file per resource (items, locations, auth, printer, ai, …)
niimbot/ # NIIMBOT label printer protocol (Bluetooth + USB/serial)Authentication
- JWT is stored in HttpOnly cookies (not localStorage).
- In
App.tsx,tokenstate is set totrueas a sentinel (the actual token value is never in JS). localStoragestores only non-sensitive user fields:id, email, full_name, role, created_at, updated_at. Never storeapi_key,password_hash, or credentials there.- Three auth methods: password login, Google OAuth SSO, OIDC (Authelia etc.), and per-user API keys via
X-API-Keyheader.
Database migrations
There is no Alembic. New columns are added in run_migrations() inside main.py using a whitelist approach (ALLOWED_TABLES, ALLOWED_COLUMNS, ALLOWED_TYPES). When adding a new column to a model, also add an entry to the migrations list in run_migrations().
UUID handling
models.py defines a custom UUID TypeDecorator that uses PostgreSQL UUID on Postgres and String(36) on SQLite. Always use this custom type (imported from .models) for primary keys and foreign keys, not raw String.
JSON columns
Complex nested data (warranties, contact_info, owner_info, ai_providers, upc_databases, etc.) is stored as JSON columns for SQLite/PostgreSQL compatibility. Document the expected shape in a comment next to the column definition.
NIIMBOT printer
Two integration paths exist in parallel:
- Frontend (Web):
src/lib/niimbot.ts— Web Bluetooth and Web Serial APIs, runs entirely in the browser. - Backend (Server):
backend/app/niimbot/— Python driver usingbleak(BLE) orpyserial(USB), called via REST endpoints inbackend/app/routers/printer.py.
Key conventions
- Adding a new API endpoint: create a router function in the relevant file under
backend/app/routers/, add the router tomain.py's import andapp.include_router()call. - Photo types: use constants from
src/lib/constants.ts(PHOTO_TYPES.*). Valid values:default,data_tag,receipt,warranty,optional,profile. - Document types:
manualorattachment(fromDOCUMENT_TYPES). - User roles:
admin,editor,viewer(fromUserRoleenum inmodels.py). - Version: the canonical version lives in the
VERSIONfile at the repo root.config.pyreads it;App.tsxhardcodes it asAPP_VERSION— keep these in sync. - Legacy components (safe to delete in future cleanup):
DashboardCards.tsx,ItemsTable.tsx,LocationsPage.tsx,LocationsTree.tsx— their functionality was merged intoInventoryPage.tsx. - Required env vars:
SECRET_KEYandJWT_SECRET_KEYmust be set; the app will fail to start without them. All other settings have defaults. auth:unauthorizedevent: fired fromsrc/lib/api.tson 401 responses.App.tsxlistens for it to trigger logout.
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository31 other files it gives its agents.
- .claude/commands/monitoring/agents.mdAGENTS.md
- AgentDB Advanced FeaturesSkill
- AgentDB Learning PluginsSkill
- AgentDB Memory PatternsSkill
- AgentDB Performance OptimizationSkill
- AgentDB Vector SearchSkill
- browserSkill
- github-code-reviewSkill
- github-multi-repoSkill
- github-project-managementSkill
- github-release-managementSkill
- github-workflow-automationSkill
- Hooks AutomationSkill
- Pair ProgrammingSkill
- ReasoningBank with AgentDBSkill
- ReasoningBank IntelligenceSkill
- Skill BuilderSkill
- sparc-methodologySkill
- stream-chainSkill
- swarm-advancedSkill
- Swarm OrchestrationSkill
- V3 CLI ModernizationSkill
- V3 Core ImplementationSkill
- V3 DDD ArchitectureSkill
- V3 Deep IntegrationSkill
- V3 MCP OptimizationSkill
- V3 Memory UnificationSkill
- V3 Performance OptimizationSkill
- V3 Security OverhaulSkill
- V3 Swarm CoordinationSkill
- Verification & Quality AssuranceSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

