跳至主要内容

Daily Dev Guide

這頁回答「我要改 X,從哪裡開始?」每一列都是可以直接進入 source 的日常路徑。

Change map

我要改先看常跑驗證注意
Watch / points awardwatch_service.go, points_service.godocker compose run --no-deps --rm app go test ./internal/services ./internal/handlersdouble credit、ledger / balance consistency、time window。
Extension heartbeatuseHeartbeat.ts, api.tspnpm --filter ./apps/extension teststale state、runtime config、API shape。
Login / tokenauth_service.go, auth.godocker compose run --no-deps --rm app go test ./internal/services ./internal/middleware ./internal/handlerstoken leak、refresh rotation、role guard。
Dashboard pageapps/dashboard/src/pages, dataProvider.tspnpm --filter ./apps/dashboard test && pnpm --filter ./apps/dashboard buildloading / error state、API contract、auth redirect。
Coupon redemptionspend_service.go, tachiya_client.godocker compose run --no-deps --rm app go test ./internal/services ./internal/handlersidempotency、timeout、partial failure、tachiya contract。
Docs portaldocs/dev-portal, apps/docspnpm build:docsbroken links、stale source paths、scope creep。

PR scope routine

  1. 找到 source issue,確認 Acceptance Criteria。
  2. Domain Maps 找 P0 / P1 domain 邊界。
  3. 若改動跨 backend + frontend、或 diff 可能超過 400 行,先拆 PR。
  4. 若碰到 migration、auth、wallet signature、points ledger、金流或權限模型,PR body 要寫風險與驗證。
  5. 若新增 dependency,必須說明套件名稱、版本、用途、lifecycle script、lockfile 變更與 guardrail 結果。

Useful commands

目的指令
啟動全部服務make dev
停止服務make down
後端測試docker compose run --no-deps --rm app go test ./...
Extension buildpnpm --filter ./apps/extension build
Dashboard buildpnpm --filter ./apps/dashboard build
Docs buildpnpm build:docs
Supply-chain guardrailmake supply-chain-check

Review heuristics

Surface快速檢查
API handlerrequest validation、auth middleware、Swagger / shared type 是否需同步。
Servicetransaction boundary、context cancellation、idempotency、nil error handling。
Frontendloading / error / empty state、double submit、auth token 是否外洩。
Docs是否指回 source、是否把 proposal 寫成已完成事實。