Identify mode based on user input and apply corresponding response strategy:
| Mode | Recognition | Strategy |
|---|---|---|
| workflow | Contains feat/fix/refactor/chore, or explicit dev task | Start workflow (mandatory state management) |
| continue | "continue / resume", or unfinished PROJECT_STATE.md exists | Read state file, restore context, enter workflow |
| general | Technical questions, code explanations, general inquiries | Direct answer, no workflow |
When general mode response involves these operations, must prompt user to switch to workflow mode:
- File modifications (create, edit, delete)
- Command execution (git, build, test, etc.)
- Todo changes (add, update tasks)
Prompt format:
⚠️ Development operation detected
Current operation requires:
- [specific operation list]
Recommend switching to workflow mode for state tracking. Switch?
Upon entering workflow mode, the following steps MUST be completed first. No dev actions allowed until done.
-
Check
PROJECT_STATE.md- Not exists → Create immediately (use
docs/PROJECT_STATE_TEMPLATE.md) - Exists → Check if update needed
- Not exists → Create immediately (use
-
Explicitly declare state result in current output (required):
[STATE] PROJECT_STATE.md: checked / updated
⚠️ Missing[STATE]declaration = workflow not started.
Entering workflow mode
[🔍 Clarify] → [📐 Design] → [⚡ Execute] → [✅ Verify] → [📝 Summary]
▲ Current
- Language: English
- Timezone: UTC, YYYY-MM-DD, 24h
Core Principle:
State maintenance is part of workflow, not optional behavior.
In workflow mode, must complete before each response:
- Does PROJECT_STATE.md exist?
- Does current phase / todo / decisions need update?
Provide state anchor in output, e.g.:
[STATE] PROJECT_STATE.md: todo 3 → 2, phase: 📐Design
Even if state unchanged, must include
[STATE]line in every output.
Prevents "state fatigue" in long execution flows.
- Create / update todo
- Complete todo item
- After commit
- Phase transition
- Blockers / decision points
- Even lightweight tasks (single file change, sync, tweak)
⚠️ Cannot skip state update because "task too small".
- Use
docs/PROJECT_STATE_TEMPLATE.md
- Commit frequency: Immediately after completing each todo item
- Don't accumulate: Don't finish entire todo list then commit
- Atomic commits: One commit = one complete, independent change unit
- Generated ≠ Complete
- After completing each todo item:
- Proactively ask if review needed
- Review content:
- Code: logic correctness, type safety, edge cases
- Docs: accuracy, clarity, usable examples
- Fix issues immediately, don't accumulate
Progress: 📐Design → ⚡Execute | Turn 5 | +32 -10 lines
Entering ⚡Execute phase
[🔍 Clarify] → [📐 Design] → [⚡ Execute] → [✅ Verify] → [📝 Summary]
▲ Current
📊 Session Statistics
Turns: 12 | Tokens: ~8.2k | Changes: +156 -23 ~45
🤖 15min | 🧑💻 3h | ⬇️ 2.75h
Review standards: docs/REVIEW_TEMPLATES.md
When any of the following occurs:
- Conversation exceeds 10 turns
- Large code or doc changes
- User indicates insufficient context
- Agent perceives context risk
Must execute the following:
- Pause current task
- Update PROJECT_STATE.md (progress / todos / key decisions)
- Commit all uncommitted changes
- Output switch prompt:
⚠️ Recommend switching to new conversation
Completed:
- [completed task list]
To continue:
- [incomplete task list]
Next: Start new conversation, type "continue <task name>"
| Document | Description |
|---|---|
| PROJECT_STATE.md | Project state record (workflow required) |
| ARCHITECTURE.md | Technical architecture and data flow |
| CLAUDE.md | Claude-specific quick reference |
| .claude/skill-overview.md | Skills overview and connection flow |
| .claude/skill-rtc-integration.md | RTC integration with agora-rtc-react hooks |
| .claude/skill-rtm-integration.md | RTM integration guide |
| .claude/skill-conversational-ai-api.md | AgoraVoiceAI (agora-agent-client-toolkit) integration |
Agora Conversational quick-start Web Demo - A starter template for building real-time conversational applications with Agora SDK.
Architecture: Frontend (React + TypeScript) + Backend (Python FastAPI)
For detailed architecture, see ARCHITECTURE.md
Frontend:
| Item | Value |
|---|---|
| Package Manager | bun |
| Framework | React |
| Language | TypeScript |
| Styling | Tailwind CSS |
| State Management | Zustand |
| Lint/Format | Biome |
Backend:
| Item | Value |
|---|---|
| Framework | FastAPI |
| Language | Python 3.6+ |
| Token Generation | Custom TokenBuilder |
| HTTP Client | requests |
- Frontend: No environment variables needed - all config from backend
- Backend: Must be running on port 8000 before starting frontend
- Run
bun run lintbefore commit and ensure pass - Type-first: All components and functions must be properly typed
- Files:
kebab-case - Components:
PascalCase
Biome enforces consistent formatting and linting rules.
Path alias: @/* → ./src/*
Frontend:
bun dev # Start dev server (requires backend running)
bun build # Production build
bun lint # Run Biome lintBackend (from project root):
cd ../server-python
python3 src/server.py # Start Python service on port 8000Full Stack (from project root):
bun run dev # Starts both frontend and backendgit commit -m "<type>(<scope>): <summary>
## Changes
- <detail 1>
- <detail 2>
Generated with AI Agent"Type: feat / fix / docs / refactor / perf / test / chore / style