## In your AGENTS.md## Testing- Run single file: `npm test -- path/to/file.test.ts`- Run fast smoke tests: `npm test -- --testPathPattern=smoke`- Full suite takes ~3 minutes, use `--bail` for early exit on failure
## In your AGENTS.md## Validation Commands- Lint (auto-fix): `npm run lint:fix`- Type check: `npm run typecheck`- Full validation: `npm run validate` (lint + typecheck + test)Always run `npm run lint:fix` after making changes.
## In your AGENTS.md## Project Structure- `src/components/` - React components (one per file)- `src/hooks/` - Custom React hooks- `src/services/` - API and business logic- `src/types/` - TypeScript type definitions- `tests/` - Test files mirror src/ structureWhen adding a new component:1. Create component in `src/components/ComponentName/`2. Add index.ts for exports3. Add ComponentName.test.tsx in same directory
Simple edit, formatting → Haiku 4.5 (0.4×)Implement feature from spec → GPT-5.3-Codex (0.7×)Debug complex issue → Sonnet 4.5 (1.2×)Architecture planning → Opus 4.7 (1x, 2x after 4/30) or Opus 4.6 (2×)Bulk file processing → Droid Core (MiniMax M2.7 at 0.12× or Kimi K2.6 at 0.4×)
**仕様モードを使わない場合:**Turn 1: Start implementing → wrong approach → wasted tokensTurn 2: Undo and try different approach → more tokensTurn 3: Finally get it rightTotal: 3 turns of implementation tokens
**Spec Modeで:**Turn 1: Plan with exploration → correct approach identifiedTurn 2: Implement correctlyTotal: 1 turn of planning + 1 turn of implementation
**コストが高い:**Turn 1: "Add logging to userService"Turn 2: "Add logging to orderService"Turn 3: "Add logging to paymentService"(3 turns, context rebuilt each time)
**効率的:**Turn 1: "Add structured logging to all services in src/services/. Use the pattern from src/lib/logger.ts. Services: user, order, payment."(1 turn, pattern established once)
## まとめ:トークン効率的なワークフロー1. Set up your project └─ AGENTS.md with commands └─ Fast tests └─ Linting configured └─ IDE plugin installed2. Start each task right └─ Use Spec Mode for complex work └─ Be specific about the goal └─ Reference existing patterns3. Choose the right model └─ Simple → Haiku/Droid Core └─ Standard → Codex/Sonnet └─ Complex → Opus (with reasoning)4. Monitor and adjust └─ Check /cost periodically └─ Identify expensive patterns └─ Refine your approach