Update project metadata and frontend submodule pointer: AGENTS.md: - Document agent deployment and workstreams - Record specialized agents used (backend-architect, javascript-pro, test-automator) - Track implementation completion status Frontend Submodule: - Update submodule reference to latest commit - Includes all frontend features: MapView, Socket.IO, ErrorBoundary - Includes comprehensive error handling across all components - Includes React Router v6 migration - Includes complete testing infrastructure with MSW Changes in Frontend (see frontend submodule commits): - feat: MapView with Leaflet, Socket.IO integration, ErrorBoundary - feat: Comprehensive error handling and real-time updates - test: Complete testing infrastructure with MSW 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Agent Guidelines for Adopt-a-Street
Commands
Backend (from /backend): npm test (no tests configured yet), npx eslint . (lint)
Frontend (from /frontend): npm test (run all tests), npm test -- --testNamePattern="test name" (single test), npm run build (build), npm start (dev server)
Code Style
Backend (Node.js/Express)
- Imports: Use
require()for CommonJS modules; group by: built-in → third-party → local (models, middleware, routes) - Formatting: 2-space indent, trailing commas in objects/arrays, double quotes for strings
- Naming: camelCase for variables/functions, PascalCase for models/schemas, lowercase for routes
- Error Handling: Use try-catch in async routes; log errors with
console.error(err.message); return generic "Server error" (500) or specific error messages (400) - Responses: Return JSON with
res.json()for success,res.status(code).json({ msg: "..." })orres.status(code).send("...")for errors
Frontend (React)
- Imports: ES6
import; group by: React → third-party → local components → context → styles - Components: Functional components with hooks; export default at end
- Naming: PascalCase for components, camelCase for functions/variables
- State: Use
useStatefor local state, Context API for global state (AuthContext pattern) - Error Handling: Handle errors in async operations, display user-friendly messages
General
- Types: No TypeScript configured; use JSDoc comments for complex functions if needed
- ESLint: Follows eslint config in backend; "no-unused-vars" and "no-undef" set to warn