最近校准: 2026-03-11
Before any runtime verification or manual testing, ensure local services are running. Use $local-services to start the minimum set (infrastructure + tgo-api + tgo-ai) or check current status.
Run it when:
- You need to run
$functional-verificationbut services are not up - Starting a new development session that involves backend changes
Skip when:
- Only making docs, config, or frontend-only changes that don't need a running server
- Services are already confirmed running via
$local-servicesstatus check
Before modifying runtime, API, or cross-service code, use $implementation-strategy to analyze change impact — it maps files to service ownership, outputs the dependency graph, and lists sync points.
Run it when:
- Changes touch
repos/*/app/api/,repos/*/app/services/,repos/*/app/runtime/, orrepos/*/app/schemas/ - Changes span 2+ services
- You're unsure which upstream/downstream services are affected
Skip when:
- Single-service, single-file changes with obvious scope (e.g., fixing a typo in one component)
Run $code-change-verification before marking work complete when changes affect runtime code, build, or tests. This runs lint, type-check, and build per service.
Run it when:
- Changes touch any code in
repos/*/
Skip when:
- Changes are docs-only (
AGENTS.md,README.md,.skills/) - Changes are config-only (
.env*,docker-compose*,Makefile) with no code impact
Use $db-migration-check to verify that model changes have corresponding Alembic migrations.
Run it when:
- Changes touch
models/*.pyormodels/**/*.pyin any service
Skip when:
- No model files were modified
Use $cross-service-sync to detect schema/type changes that may need synchronized updates in other services.
Run it when:
- Changes touch files under
schemas/,types/, or API response structures - Changes modify Pydantic models that are consumed by other services
Skip when:
- Schema changes are internal to a single service with no external consumers
Use $streaming-protocol-check to verify streaming protocol consistency across producer (tgo-ai), relay (tgo-api), and consumers (tgo-web, tgo-widget-js, tgo-widget-miniprogram).
Run it when:
- Changes touch
streaming/,wukongim, SSE,stream.delta,MixedStreamParser, orjson-rendercode
Skip when:
- Changes don't involve any streaming or real-time messaging paths
Use $functional-verification alongside $code-change-verification to validate API changes at runtime using tgo-cli (staff) and tgo-widget-cli (visitor). This goes beyond static checks — it makes real API calls.
Run it when:
- Changes affect backend API endpoints, service logic, chat flow, agent config, knowledge/RAG, workflow, or platform integration
- Local services are running (use
$local-servicesfirst if not)
Skip when:
- Changes are frontend-only or static-check is sufficient
- Local services are not available and cannot be started
Use $pr-draft-summary when reporting code changes as complete — it generates a change summary grouped by service with commit history and diff stats.
Run it when:
- Work is finished and ready to commit or create a pull request
Skip when:
- Trivial or conversation-only tasks where no PR summary is expected
- Read the target service's
AGENTS.mdbefore making changes. - If changes span multiple services or touch APIs, run
$implementation-strategyto understand impact. - If local services are needed, run
$local-servicesto start the minimum set. - Make changes — follow the target service's Rules and Constraints.
- If model files changed, run
$db-migration-check. - If schema/type files changed, run
$cross-service-sync. - If streaming code changed, run
$streaming-protocol-check. - Run
$code-change-verificationto validate lint/type-check/build. - If backend logic changed and services are running, run
$functional-verificationalongside$code-change-verification. - When work is complete, run
$pr-draft-summaryto generate the PR summary.
graph TB
WEB[tgo-web] --> API[tgo-api]
WIDGET[tgo-widget-js] --> API
MINI[tgo-widget-miniprogram] --> API
API --> AI[tgo-ai]
API --> RAG[tgo-rag]
API --> PLATFORM[tgo-platform]
API --> WORKFLOW[tgo-workflow]
API --> PLUGIN[tgo-plugin-runtime]
API --> DEVICE[tgo-device-control]
AI --> PLUGIN
AGENT[tgo-device-agent] --> DEVICE
API --> IM[WuKongIM]
| Service | Dir | Role | Port |
|---|---|---|---|
| tgo-api | repos/tgo-api |
Core API gateway, multi-tenant | 8000 |
| tgo-ai | repos/tgo-ai |
LLM, Agent runtime | 8081 |
| tgo-rag | repos/tgo-rag |
Knowledge base, RAG | 18082 |
| tgo-platform | repos/tgo-platform |
Channel message sync | 8003 |
| tgo-workflow | repos/tgo-workflow |
Workflow engine | 8004 |
| tgo-plugin-runtime | repos/tgo-plugin-runtime |
Plugin & MCP runtime | 8090 |
| tgo-device-control | repos/tgo-device-control |
Device management | 8085 |
| tgo-device-agent | repos/tgo-device-agent |
Device-side Go agent | N/A |
| tgo-web | repos/tgo-web |
Admin frontend | 5173 |
| tgo-widget-js | repos/tgo-widget-js |
Visitor chat widget | 5174 |
| tgo-widget-miniprogram | repos/tgo-widget-miniprogram |
WeChat mini-program widget | N/A |
| tgo-cli | repos/tgo-cli |
Staff CLI + MCP server | N/A |
| tgo-widget-cli | repos/tgo-widget-cli |
Visitor CLI + MCP server | N/A |
Infra: PostgreSQL + pgvector, Redis, WuKongIM, Celery (RAG/Workflow workers)
- No bare
dict(Python) orany(TypeScript) in business interfaces - No cross-service direct DB access — use HTTP clients in
services/ - No hardcoded URLs, secrets, or environment addresses — use
.env+ config - Model/table changes must include Alembic migration
- Migration and code must be committed together
- Backend: Python 3.11, FastAPI, SQLAlchemy 2, Alembic, Pydantic v2
- Frontend: tgo-web (React 19 + TS + Vite 7 + Zustand), tgo-widget-js (React 18 + TS + Vite 5)
- Device: Go 1.22 (tgo-device-agent)
- Mini-program: Pure JS (ES5), WeChat native components
cp .env.dev.example .env.dev
make devOptional dev helpers:
make dev PROFILES=monitoring
make dev DISABLE=tgo-rag-beat,tgo-workflow-workerrepos/tgo-ai/AGENTS.mdrepos/tgo-api/AGENTS.mdrepos/tgo-web/AGENTS.mdrepos/tgo-rag/AGENTS.mdrepos/tgo-platform/AGENTS.mdrepos/tgo-workflow/AGENTS.mdrepos/tgo-plugin-runtime/AGENTS.mdrepos/tgo-device-control/AGENTS.mdrepos/tgo-device-agent/AGENTS.mdrepos/tgo-widget-js/AGENTS.mdrepos/tgo-widget-miniprogram/AGENTS.mdrepos/tgo-cli/AGENTS.mdrepos/tgo-widget-cli/AGENTS.md