EstateWise Engineering
Use this skill for most coding tasks in this repository.
Mission
Implement the smallest defensible change in the correct subsystem, preserve contracts, and validate only the touched surface.
Step 1: Classify The Work
Identify the owning subsystem before editing:
backend/: Express API, auth, chat, forums, properties, graph, commute, Swagger, Prometheus, tRPC bridge.
frontend/: Next.js pages, REST client wrapper, local tRPC API, charts, map, forums, auth flows.
mcp/: stdio MCP server, tool registry, token flows, monitoring, web research, A2A bridge.
agentic-ai/: default orchestrator, LangGraph runtime, CrewAI runtime, HTTP server, A2A endpoints.
grpc/: market_pulse.proto, service logic, server bootstrap.
deployment-control/: deployment API, job runner, kubectl integration, Nuxt UI.
- Infra/docs: Docker, Kubernetes, Helm, Terraform, cloud folders, Jenkins/GitLab/GitHub docs, root architecture docs.
If the task spans multiple subsystems, sequence work from contract producer to contract consumer.
Step 2: Find Real Entry Points
Use rg first. Do not broad-scan once the owning files are clear.
High-value anchors:
- Backend bootstrap:
backend/src/server.ts
- Backend routes/controllers/services:
backend/src/routes/, backend/src/controllers/, backend/src/services/
- Graph workflows:
backend/src/graph/
- Frontend shared REST wrapper:
frontend/lib/api.ts
- Frontend pages:
frontend/pages/chat.tsx, frontend/pages/insights.tsx, frontend/pages/map.tsx, frontend/pages/market-pulse.tsx
- Frontend local tRPC:
frontend/pages/api/trpc/[trpc].ts, frontend/server/api/routers/insights.ts
- MCP entry + registry:
mcp/src/server.ts, mcp/src/tools/index.ts
- Agentic runtime entrypoints:
agentic-ai/src/index.ts, agentic-ai/src/http/server.ts, agentic-ai/src/orchestrator/
- gRPC contract + service:
grpc/proto/market_pulse.proto, grpc/src/services/marketPulseService.ts
- Deployment-control API/UI:
deployment-control/src/server.ts, deployment-control/ui/
Step 3: Apply The Subsystem Playbook
Backend
- Update route/controller/service in
backend/src/.
- Preserve middleware and route order in
backend/src/server.ts.
- If an endpoint or payload changes, update frontend callers, MCP wrappers, and docs in the same task.
- Add or adjust tests under
backend/tests.
- Keep Swagger annotations aligned when endpoint behavior changes.
Frontend
- Patch the smallest owning page or component.
- Check both
frontend/lib/api.ts and direct page-level fetches for backend URL or payload assumptions.
- Keep large files like
chat.tsx and insights.tsx localized.
- Update Jest/Cypress/Selenium coverage only where behavior actually changed.
- If a route or page capability changed, update
frontend/README.md.
MCP
- Update the correct tool module in
mcp/src/tools/.
- Preserve Zod input validation and stringified text outputs for client portability.
- Register new tool modules or exports in the registry when needed.
- Validate with
npm run build and at least one client:call.
- Update
mcp/README.md when tool names, inputs, or outputs change.
Agentic AI
- Decide which runtime owns the change: default orchestrator, LangGraph, CrewAI, or HTTP/A2A layer.
- Keep tool call contracts aligned with the MCP server.
- Validate with a realistic goal run after build.
- Update
agentic-ai/README.md when runtime flags, server endpoints, or workflow semantics change.
gRPC
- Treat
grpc/proto/market_pulse.proto as the contract source.
- Keep backward compatibility unless the task explicitly requests a breaking change.
- Update handlers and server wiring after proto changes.
- Run proto lint and tests on proto edits.
- Update
grpc/README.md examples when RPC behavior changes.
Deployment Control
- Keep API and UI behavior aligned.
- Preserve job status semantics and output handling.
- Be explicit about trust boundaries; there is no built-in auth/RBAC.
- Validate both API and UI build paths when touched.
- Update
deployment-control/README.md for endpoint or workflow changes.
Step 4: Guard Cross-Service Contracts
When one layer changes, immediately inspect its dependents:
Use /estatewise-contracts if the contract surface is nontrivial.
Step 5: Validate Only What Changed
Use the smallest sufficient check set:
Root:
npm run format or npm run lint only when requested or when broad formatting-sensitive files changed.
Backend:
cd backend && npm run build
cd backend && npm run test
Frontend:
cd frontend && npm run build
cd frontend && npm run test
cd frontend && npm run lint
MCP:
cd mcp && npm run build
cd mcp && npm run client:call -- <tool> '<json>'
Agentic AI:
cd agentic-ai && npm run build
cd agentic-ai && npm run dev "realistic goal"
gRPC:
cd grpc && npm run build
cd grpc && npm run test
cd grpc && npm run proto:check
Deployment Control:
cd deployment-control && npm run build
- or
cd deployment-control && npm run build:api && npm run build:ui
If environment dependencies block validation, state exactly what was skipped and why.
High-Risk Areas
backend/src/server.ts: middleware order, metrics, swagger, routing, boot behavior.
backend/src/services/geminiChat.service.ts: core generation flow and prompt behavior.
frontend/pages/chat.tsx: huge page with many direct API calls.
frontend/pages/insights.tsx: large page with multiple graph/analytics flows.
frontend/lib/api.ts: shared REST client contract.
mcp/src/core/http.ts and mcp/src/core/token.ts: global behavior across many tools.
agentic-ai/src/http/server.ts: HTTP + A2A contract surface.
grpc/proto/market_pulse.proto: source of truth for gRPC changes.
Done Criteria
Do not stop at code edits. The task is complete only when:
- The requested behavior is implemented in the correct subsystem.
- Affected validations ran, or skips are explicitly documented.
- Producer and consumer paths were updated for any contract change.
- Relevant package or root docs were updated.
- The handoff includes exact files changed and validation commands run.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: estatewise-engineering3description: Default implementation playbook for the EstateWise monorepo. Use when adding or fixing behavior in backend, frontend, MCP, agentic-ai, gRPC, deployment-control, tests, or docs. Use when this capability is needed.4---56# EstateWise Engineering78Use this skill for most coding tasks in this repository.910## Mission1112Implement the smallest defensible change in the correct subsystem, preserve contracts, and validate only the touched surface.1314## Step 1: Classify The Work1516Identify the owning subsystem before editing:1718- `backend/`: Express API, auth, chat, forums, properties, graph, commute, Swagger, Prometheus, tRPC bridge.19- `frontend/`: Next.js pages, REST client wrapper, local tRPC API, charts, map, forums, auth flows.20- `mcp/`: stdio MCP server, tool registry, token flows, monitoring, web research, A2A bridge.21- `agentic-ai/`: default orchestrator, LangGraph runtime, CrewAI runtime, HTTP server, A2A endpoints.22- `grpc/`: `market_pulse.proto`, service logic, server bootstrap.23- `deployment-control/`: deployment API, job runner, kubectl integration, Nuxt UI.24- Infra/docs: Docker, Kubernetes, Helm, Terraform, cloud folders, Jenkins/GitLab/GitHub docs, root architecture docs.2526If the task spans multiple subsystems, sequence work from contract producer to contract consumer.2728## Step 2: Find Real Entry Points2930Use `rg` first. Do not broad-scan once the owning files are clear.3132High-value anchors:3334- Backend bootstrap: `backend/src/server.ts`35- Backend routes/controllers/services: `backend/src/routes/`, `backend/src/controllers/`, `backend/src/services/`36- Graph workflows: `backend/src/graph/`37- Frontend shared REST wrapper: `frontend/lib/api.ts`38- Frontend pages: `frontend/pages/chat.tsx`, `frontend/pages/insights.tsx`, `frontend/pages/map.tsx`, `frontend/pages/market-pulse.tsx`39- Frontend local tRPC: `frontend/pages/api/trpc/[trpc].ts`, `frontend/server/api/routers/insights.ts`40- MCP entry + registry: `mcp/src/server.ts`, `mcp/src/tools/index.ts`41- Agentic runtime entrypoints: `agentic-ai/src/index.ts`, `agentic-ai/src/http/server.ts`, `agentic-ai/src/orchestrator/`42- gRPC contract + service: `grpc/proto/market_pulse.proto`, `grpc/src/services/marketPulseService.ts`43- Deployment-control API/UI: `deployment-control/src/server.ts`, `deployment-control/ui/`4445## Step 3: Apply The Subsystem Playbook4647### Backend48491. Update route/controller/service in `backend/src/`.502. Preserve middleware and route order in `backend/src/server.ts`.513. If an endpoint or payload changes, update frontend callers, MCP wrappers, and docs in the same task.524. Add or adjust tests under `backend/tests`.535. Keep Swagger annotations aligned when endpoint behavior changes.5455### Frontend56571. Patch the smallest owning page or component.582. Check both `frontend/lib/api.ts` and direct page-level fetches for backend URL or payload assumptions.593. Keep large files like `chat.tsx` and `insights.tsx` localized.604. Update Jest/Cypress/Selenium coverage only where behavior actually changed.615. If a route or page capability changed, update `frontend/README.md`.6263### MCP64651. Update the correct tool module in `mcp/src/tools/`.662. Preserve Zod input validation and stringified text outputs for client portability.673. Register new tool modules or exports in the registry when needed.684. Validate with `npm run build` and at least one `client:call`.695. Update `mcp/README.md` when tool names, inputs, or outputs change.7071### Agentic AI72731. Decide which runtime owns the change: default orchestrator, LangGraph, CrewAI, or HTTP/A2A layer.742. Keep tool call contracts aligned with the MCP server.753. Validate with a realistic goal run after build.764. Update `agentic-ai/README.md` when runtime flags, server endpoints, or workflow semantics change.7778### gRPC79801. Treat `grpc/proto/market_pulse.proto` as the contract source.812. Keep backward compatibility unless the task explicitly requests a breaking change.823. Update handlers and server wiring after proto changes.834. Run proto lint and tests on proto edits.845. Update `grpc/README.md` examples when RPC behavior changes.8586### Deployment Control87881. Keep API and UI behavior aligned.892. Preserve job status semantics and output handling.903. Be explicit about trust boundaries; there is no built-in auth/RBAC.914. Validate both API and UI build paths when touched.925. Update `deployment-control/README.md` for endpoint or workflow changes.9394## Step 4: Guard Cross-Service Contracts9596When one layer changes, immediately inspect its dependents:9798- Backend REST change:99 - `frontend/lib/api.ts`100 - page-level direct `fetch(...)` usage in `frontend/pages/`101 - MCP tools under `mcp/src/tools/`102 - docs in `backend/README.md`, `frontend/README.md`, and root docs if public behavior changed103104- Frontend local tRPC change:105 - `frontend/server/api/routers/`106 - `frontend/lib/trpc.tsx`107 - consuming pages/components108109- MCP tool change:110 - `mcp/src/client.ts`111 - agentic-ai MCP wrappers or runtime assumptions112 - `mcp/README.md`113114- Agentic A2A or HTTP change:115 - `agentic-ai/src/http/server.ts`116 - `mcp/src/tools/a2a.ts`117 - `agentic-ai/README.md`118119- gRPC contract change:120 - `grpc/src/services/`121 - any clients/examples/docs122123Use `/estatewise-contracts` if the contract surface is nontrivial.124125## Step 5: Validate Only What Changed126127Use the smallest sufficient check set:128129- Root:130 - `npm run format` or `npm run lint` only when requested or when broad formatting-sensitive files changed.131132- Backend:133 - `cd backend && npm run build`134 - `cd backend && npm run test`135136- Frontend:137 - `cd frontend && npm run build`138 - `cd frontend && npm run test`139 - `cd frontend && npm run lint`140141- MCP:142 - `cd mcp && npm run build`143 - `cd mcp && npm run client:call -- <tool> '<json>'`144145- Agentic AI:146 - `cd agentic-ai && npm run build`147 - `cd agentic-ai && npm run dev "realistic goal"`148149- gRPC:150 - `cd grpc && npm run build`151 - `cd grpc && npm run test`152 - `cd grpc && npm run proto:check`153154- Deployment Control:155 - `cd deployment-control && npm run build`156 - or `cd deployment-control && npm run build:api && npm run build:ui`157158If environment dependencies block validation, state exactly what was skipped and why.159160## High-Risk Areas161162- `backend/src/server.ts`: middleware order, metrics, swagger, routing, boot behavior.163- `backend/src/services/geminiChat.service.ts`: core generation flow and prompt behavior.164- `frontend/pages/chat.tsx`: huge page with many direct API calls.165- `frontend/pages/insights.tsx`: large page with multiple graph/analytics flows.166- `frontend/lib/api.ts`: shared REST client contract.167- `mcp/src/core/http.ts` and `mcp/src/core/token.ts`: global behavior across many tools.168- `agentic-ai/src/http/server.ts`: HTTP + A2A contract surface.169- `grpc/proto/market_pulse.proto`: source of truth for gRPC changes.170171## Done Criteria172173Do not stop at code edits. The task is complete only when:1741751. The requested behavior is implemented in the correct subsystem.1762. Affected validations ran, or skips are explicitly documented.1773. Producer and consumer paths were updated for any contract change.1784. Relevant package or root docs were updated.1795. The handoff includes exact files changed and validation commands run.180181---182> Converted and distributed by [TomeVault](https://tomevault.io/claim/hoangsonww) — claim your Tome and manage your conversions.183<!-- tomevault:4.0:skill_md:2026-04-11 -->