You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

toh-framework

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toh-framework - npm Package Compare versions

Comparing version
1.4.0
to
1.5.0
+1
-1
bin/toh-cli.js

@@ -50,3 +50,3 @@ #!/usr/bin/env node

.option('-t, --target <path>', 'Target directory', process.cwd())
.option('-i, --ide <ides>', 'IDEs to configure (claude,cursor,gemini,codex)', 'claude,cursor')
.option('-i, --ide <ides>', 'IDEs to configure (claude,cursor,gemini,codex)', 'claude,cursor,gemini')
.option('-q, --quick', 'Quick install without prompts')

@@ -53,0 +53,0 @@ .action(async (options) => {

@@ -15,18 +15,33 @@ /**

try {
// Create .claude directory structure
// v1.4.0: Claude Code needs .claude/ folder for slash commands to work
// Copy resources from .toh/ to .claude/
const tohDir = join(targetDir, '.toh');
const claudeDir = join(targetDir, '.claude');
// Create .claude/ directory structure
await fs.ensureDir(join(claudeDir, 'skills'));
await fs.ensureDir(join(claudeDir, 'agents'));
await fs.ensureDir(join(claudeDir, 'commands'));
await fs.ensureDir(join(claudeDir, 'memory', 'archive'));
// Copy resources from .toh/ to .claude/ (if .toh/ exists)
if (fs.existsSync(join(tohDir, 'skills'))) {
await fs.copy(join(tohDir, 'skills'), join(claudeDir, 'skills'), { overwrite: true });
}
if (fs.existsSync(join(tohDir, 'agents'))) {
await fs.copy(join(tohDir, 'agents'), join(claudeDir, 'agents'), { overwrite: true });
}
if (fs.existsSync(join(tohDir, 'commands'))) {
await fs.copy(join(tohDir, 'commands'), join(claudeDir, 'commands'), { overwrite: true });
}
if (fs.existsSync(join(tohDir, 'templates'))) {
await fs.copy(join(tohDir, 'templates'), join(claudeDir, 'templates'), { overwrite: true });
}
// Create .toh/memory directory structure (v1.1.0 - Memory System)
const tohDir = join(targetDir, '.toh');
const memoryDir = join(tohDir, 'memory');
const archiveDir = join(memoryDir, 'archive');
await fs.ensureDir(archiveDir);
// Create memory template files (always English)
// Create memory template files in .claude/memory/
const memoryDir = join(claudeDir, 'memory');
await createMemoryFiles(memoryDir);
// Create CLAUDE.md with Toh Framework rules
// Create CLAUDE.md with Toh Framework rules (references .claude/*)
const claudeMdPath = join(targetDir, 'CLAUDE.md');

@@ -105,3 +120,3 @@ const claudeMdContent = generateClaudeMd(language);

## Important Notes
- Using Toh Framework v1.2.x
- Using Toh Framework v1.5.x
- Memory System is active

@@ -156,5 +171,5 @@

### Communication Style
- **ALWAYS respond in Thai (ภาษาไทย)**
- Be friendly and use polite particles (ครับ/ค่ะ)
- You can use Thai expressions naturally
- **Respond in the same language the user uses** (if they write Thai, respond Thai; if English, respond English)
- Default to Thai if unclear
- Be friendly and use polite particles (ครับ/ค่ะ) when speaking Thai

@@ -185,3 +200,4 @@ ### UI Labels & Text

### Communication Style
- **ALWAYS respond in English**
- **Respond in the same language the user uses** (if they write Thai, respond Thai; if English, respond English)
- Default to English if unclear
- Be professional and clear

@@ -308,3 +324,3 @@

\`\`\`
STEP 1: Check .toh/memory/ folder
STEP 1: Check .claude/memory/ folder
├── Folder doesn't exist? → Create it first!

@@ -322,5 +338,5 @@ └── Folder exists? → Continue to Step 2

STEP 3: Selective Read (load these 3 files)
├── .toh/memory/active.md (~500 tokens)
├── .toh/memory/summary.md (~1,000 tokens)
└── .toh/memory/decisions.md (~500 tokens)
├── .claude/memory/active.md (~500 tokens)
├── .claude/memory/summary.md (~1,000 tokens)
└── .claude/memory/decisions.md (~500 tokens)
⚠️ DO NOT read archive/ unless user asks about history!

@@ -361,3 +377,3 @@

\`\`\`
.toh/
.claude/
└── memory/

@@ -388,11 +404,92 @@ ├── active.md # Current task (always loaded)

## Skills & Agents
## Skills & Agents (Claude Code)
Skills and Agents are located in:
All Toh Framework resources are in \`.claude/\` folder:
- \`.claude/skills/\` - Technical skills for each domain
- \`.claude/agents/\` - Specialized AI agents
- \`.claude/commands/\` - Command definitions
- \`.claude/memory/\` - Memory system files
## 🚨 MANDATORY: Skills & Agents Loading
> **CRITICAL:** Before executing ANY /toh: command, you MUST load the required skills and agents!
### Command → Skills → Agents Map
| Command | Load These Skills (from \`.claude/skills/\`) | Load Agent (from \`.claude/agents/\`) |
|---------|------------------------------------------|-----------------------------------|
| \`/toh:vibe\` | \`vibe-orchestrator\`, \`premium-experience\`, \`design-mastery\`, \`ui-first-builder\` | \`vibe-agent.md\` |
| \`/toh:ui\` | \`ui-first-builder\`, \`design-excellence\`, \`response-format\` | \`ui-agent.md\` |
| \`/toh:dev\` | \`dev-engineer\`, \`backend-engineer\`, \`response-format\` | \`dev-agent.md\` |
| \`/toh:design\` | \`design-mastery\`, \`design-excellence\`, \`premium-experience\` | \`design-agent.md\` |
| \`/toh:test\` | \`test-engineer\`, \`debug-protocol\`, \`error-handling\` | \`test-agent.md\` |
| \`/toh:connect\` | \`backend-engineer\`, \`integrations\` | \`connect-agent.md\` |
| \`/toh:plan\` | \`plan-orchestrator\`, \`business-context\`, \`smart-routing\` | \`plan-agent.md\` |
| \`/toh:fix\` | \`debug-protocol\`, \`error-handling\`, \`test-engineer\` | \`core-orchestrator.md\` |
| \`/toh:line\` | \`platform-specialist\`, \`integrations\` | \`platform-agent.md\` |
| \`/toh:mobile\` | \`platform-specialist\`, \`ui-first-builder\` | \`platform-agent.md\` |
| \`/toh:ship\` | \`version-control\`, \`progress-tracking\` | \`core-orchestrator.md\` |
### Core Skills (Always Available)
These skills apply to ALL commands:
- \`memory-system\` - Memory read/write protocol
- \`response-format\` - 3-section response format
- \`smart-routing\` - Command routing logic
### Loading Protocol:
\`\`\`
STEP 1: User types /toh:[command]
STEP 2: IMMEDIATELY read required skills from table above
Example: /toh:vibe → Read 4 skill files:
- .claude/skills/vibe-orchestrator/SKILL.md
- .claude/skills/premium-experience/SKILL.md
- .claude/skills/design-mastery/SKILL.md
- .claude/skills/ui-first-builder/SKILL.md
STEP 3: Read the corresponding agent file
Example: .claude/agents/vibe-agent.md
STEP 4: Execute following skill + agent instructions
STEP 5: Use 3-section response format (from response-format skill)
STEP 6: Save memory (from memory-system skill)
\`\`\`
### ⚠️ NEVER Skip Skills!
- Skills contain CRITICAL best practices
- Skills have design tokens, patterns, and rules
- Without skills, output quality drops significantly
- If skill file not found, warn user and continue with defaults
## 🔒 Skills Loading Checkpoint (REQUIRED)
> **ENFORCEMENT:** You MUST report skills loaded at the START of your response!
### Required Response Start:
\`\`\`markdown
📚 **Skills Loaded:**
- skill-name-1 ✅ (brief what you learned)
- skill-name-2 ✅ (brief what you learned)
🤖 **Agent:** agent-name
💾 **Memory:** Loaded ✅
---
[Then continue with your work...]
\`\`\`
### Why This Matters:
- If you don't report skills → You didn't read them
- If you skip skills → Output quality drops significantly
- Skills have design tokens, patterns, and critical rules
- This checkpoint proves you followed the protocol
**⚠️ REMEMBER:**
- Read relevant skill BEFORE starting any work
- Read relevant skill from \`.claude/skills/\` BEFORE starting any work
- Follow Memory Protocol EVERY time

@@ -399,0 +496,0 @@ - If memory is empty but project has code → Analyze and populate first!

@@ -142,3 +142,3 @@ /**

- **Response Language:** Always respond in English
- **Response Language:** Respond in the same language the user uses (if unclear, default to English)
- **UI Labels/Buttons:** English (Save, Cancel, Dashboard)

@@ -149,3 +149,3 @@ - **Mock Data:** English names, addresses, phone numbers

If user requests Thai language, then switch to Thai.
If user writes in Thai, respond in Thai.

@@ -231,4 +231,23 @@ ## 🚨 Command Recognition (CRITICAL)

**Auto-save** after tasks, **Auto-load** on new sessions.
## 🚨 MANDATORY: Memory Protocol
> **CRITICAL:** You MUST follow this protocol EVERY time!
### BEFORE Starting ANY Work:
1. Check \`.toh/memory/\` folder exists
2. Read: \`.toh/memory/active.md\`, \`.toh/memory/summary.md\`, \`.toh/memory/decisions.md\`
3. If files empty but project has code → ANALYZE and populate first!
4. Acknowledge: "Memory loaded! [Brief context]"
### AFTER Completing ANY Work:
1. Update \`.toh/memory/active.md\` - what was done, next steps
2. Update \`.toh/memory/decisions.md\` - if decisions were made
3. Update \`.toh/memory/summary.md\` - if feature completed
4. Confirm: "Memory saved ✅"
### ⚠️ CRITICAL RULES:
- NEVER start work without reading memory!
- NEVER finish work without saving memory!
- Memory files must ALWAYS be in English!
## Command Usage Examples

@@ -293,5 +312,65 @@

## 🚨 MANDATORY: Skills & Agents Loading
> **CRITICAL:** Before executing ANY /toh: command, you MUST load the required skills!
### Command → Skills Map
| Command | Load These Skills (from \`.toh/skills/\`) |
|---------|------------------------------------------|
| \`/toh:vibe\` | \`vibe-orchestrator\`, \`premium-experience\`, \`design-mastery\`, \`ui-first-builder\` |
| \`/toh:ui\` | \`ui-first-builder\`, \`design-excellence\`, \`response-format\` |
| \`/toh:dev\` | \`dev-engineer\`, \`backend-engineer\`, \`response-format\` |
| \`/toh:design\` | \`design-mastery\`, \`design-excellence\`, \`premium-experience\` |
| \`/toh:test\` | \`test-engineer\`, \`debug-protocol\`, \`error-handling\` |
| \`/toh:connect\` | \`backend-engineer\`, \`integrations\` |
| \`/toh:plan\` | \`plan-orchestrator\`, \`business-context\`, \`smart-routing\` |
| \`/toh:fix\` | \`debug-protocol\`, \`error-handling\`, \`test-engineer\` |
| \`/toh:line\` | \`platform-specialist\`, \`integrations\` |
| \`/toh:mobile\` | \`platform-specialist\`, \`ui-first-builder\` |
| \`/toh:ship\` | \`version-control\`, \`progress-tracking\` |
### Core Skills (Always Available)
- \`memory-system\` - Memory read/write protocol
- \`response-format\` - 3-section response format
- \`smart-routing\` - Command routing logic
### Loading Protocol:
1. User types /toh:[command]
2. Read required skill files from \`.toh/skills/[skill-name]/SKILL.md\`
3. Execute following skill instructions
4. Save memory after completion
### ⚠️ NEVER Skip Skills!
Skills contain CRITICAL best practices, design tokens, and rules.
## 🔒 Skills Loading Checkpoint (REQUIRED)
> **ENFORCEMENT:** You MUST report skills loaded at the START of your response!
### Required Response Start:
\`\`\`markdown
📚 **Skills Loaded:**
- skill-name-1 ✅ (brief what you learned)
- skill-name-2 ✅ (brief what you learned)
🤖 **Agent:** agent-name
💾 **Memory:** Loaded ✅
---
[Then continue with your work...]
\`\`\`
### Why This Matters:
- If you don't report skills → You didn't read them
- If you skip skills → Output quality drops significantly
- Skills have design tokens, patterns, and critical rules
- This checkpoint proves you followed the protocol
## Skills Reference
Skills are located in \`.claude/skills/\` or \`.toh/skills/\`:
All skills are in \`.toh/skills/\` (Central Resources):
- \`vibe-orchestrator\` - Core methodology

@@ -301,5 +380,11 @@ - \`ui-first-builder\` - UI patterns

- \`design-excellence\` - Design system
- \`design-mastery\` - 13 business design profiles
- \`premium-experience\` - Premium multi-page apps
- \`test-engineer\` - Testing with Playwright
- \`backend-engineer\` - Supabase integration
- \`platform-specialist\` - LINE, Mobile, Desktop
- \`memory-system\` - Memory protocol
- \`response-format\` - Response structure
- \`debug-protocol\` - Debugging guide
- \`error-handling\` - Error handling patterns

@@ -366,3 +451,3 @@ ## Getting Started

- **ภาษาในการตอบ:** ตอบเป็นภาษาไทยเสมอ
- **ภาษาในการตอบ:** ตอบตามภาษาที่ผู้ใช้พิมพ์มา (ถ้าไม่แน่ใจ ให้ใช้ภาษาไทย)
- **UI Labels/Buttons:** ภาษาไทย (บันทึก, ยกเลิก, แดชบอร์ด)

@@ -373,3 +458,3 @@ - **Mock Data:** ชื่อไทย, ที่อยู่ไทย, เบอร์โทรไทย

ถ้าผู้ใช้ต้องการภาษาอังกฤษ ค่อยเปลี่ยน
ถ้าผู้ใช้พิมพ์เป็นภาษาอังกฤษ ก็ตอบเป็นภาษาอังกฤษ

@@ -455,4 +540,23 @@ ## 🚨 การรับคำสั่ง (สำคัญมาก!)

**Auto-save** หลังทำงาน, **Auto-load** เมื่อเริ่ม session ใหม่
## 🚨 บังคับ: Memory Protocol
> **สำคัญมาก:** ต้องทำตามนี้ทุกครั้ง!
### ก่อนเริ่มทำงาน:
1. เช็ค \`.toh/memory/\` folder มีไหม
2. อ่าน: \`.toh/memory/active.md\`, \`.toh/memory/summary.md\`, \`.toh/memory/decisions.md\`
3. ถ้าไฟล์ว่างแต่มี code → วิเคราะห์โปรเจคก่อน!
4. บอก User: "Memory loaded! [สรุปสั้นๆ]"
### หลังทำงานเสร็จ:
1. อัพเดท \`.toh/memory/active.md\` - สิ่งที่ทำ, ขั้นตอนถัดไป
2. อัพเดท \`.toh/memory/decisions.md\` - ถ้ามีการตัดสินใจ
3. อัพเดท \`.toh/memory/summary.md\` - ถ้า feature เสร็จ
4. บอก User: "Memory saved ✅"
### ⚠️ กฎสำคัญ:
- ห้ามเริ่มงานโดยไม่อ่าน memory!
- ห้ามจบงานโดยไม่บันทึก memory!
- Memory files ต้องเป็นภาษาอังกฤษเสมอ!
## ตัวอย่างการใช้งาน

@@ -517,5 +621,65 @@

## 🚨 บังคับ: โหลด Skills & Agents
> **สำคัญมาก:** ก่อน execute คำสั่ง /toh: ใดๆ ต้องโหลด skills ที่เกี่ยวข้อง!
### คำสั่ง → Skills Map
| คำสั่ง | โหลด Skills เหล่านี้ (จาก \`.toh/skills/\`) |
|--------|-------------------------------------------|
| \`/toh:vibe\` | \`vibe-orchestrator\`, \`premium-experience\`, \`design-mastery\`, \`ui-first-builder\` |
| \`/toh:ui\` | \`ui-first-builder\`, \`design-excellence\`, \`response-format\` |
| \`/toh:dev\` | \`dev-engineer\`, \`backend-engineer\`, \`response-format\` |
| \`/toh:design\` | \`design-mastery\`, \`design-excellence\`, \`premium-experience\` |
| \`/toh:test\` | \`test-engineer\`, \`debug-protocol\`, \`error-handling\` |
| \`/toh:connect\` | \`backend-engineer\`, \`integrations\` |
| \`/toh:plan\` | \`plan-orchestrator\`, \`business-context\`, \`smart-routing\` |
| \`/toh:fix\` | \`debug-protocol\`, \`error-handling\`, \`test-engineer\` |
| \`/toh:line\` | \`platform-specialist\`, \`integrations\` |
| \`/toh:mobile\` | \`platform-specialist\`, \`ui-first-builder\` |
| \`/toh:ship\` | \`version-control\`, \`progress-tracking\` |
### Core Skills (ใช้ได้เสมอ)
- \`memory-system\` - ระบบ Memory
- \`response-format\` - รูปแบบการตอบ 3 ส่วน
- \`smart-routing\` - การ route คำสั่ง
### ขั้นตอนการโหลด:
1. ผู้ใช้พิมพ์ /toh:[command]
2. อ่าน skill files จาก \`.toh/skills/[skill-name]/SKILL.md\`
3. ทำงานตามคำสั่งใน skill
4. บันทึก memory หลังเสร็จ
### ⚠️ ห้ามข้าม Skills!
Skills มี best practices, design tokens และกฎสำคัญ
## 🔒 Skills Loading Checkpoint (บังคับ)
> **บังคับ:** ต้องรายงาน skills ที่โหลดมาที่ต้นของ response!
### รูปแบบการเริ่มต้น Response:
\`\`\`markdown
📚 **Skills ที่โหลด:**
- skill-name-1 ✅ (สรุปสั้นๆ ว่าได้อะไร)
- skill-name-2 ✅ (สรุปสั้นๆ ว่าได้อะไร)
🤖 **Agent:** ชื่อ agent
💾 **Memory:** โหลดแล้ว ✅
---
[แล้วค่อยทำงานต่อ...]
\`\`\`
### ทำไมต้องทำ:
- ถ้าไม่รายงาน skills → แปลว่าไม่ได้อ่าน
- ถ้าข้าม skills → คุณภาพงานจะลดลงมาก
- Skills มี design tokens, patterns และกฎสำคัญ
- Checkpoint นี้พิสูจน์ว่าทำตาม protocol
## Skills Reference
Skills อยู่ที่ \`.claude/skills/\` หรือ \`.toh/skills/\`:
Skills ทั้งหมดอยู่ที่ \`.toh/skills/\` (Central Resources):
- \`vibe-orchestrator\` - Core methodology

@@ -525,5 +689,9 @@ - \`ui-first-builder\` - UI patterns

- \`design-excellence\` - Design system
- \`design-mastery\` - 13 business design profiles
- \`premium-experience\` - Premium multi-page apps
- \`test-engineer\` - Testing with Playwright
- \`backend-engineer\` - Supabase integration
- \`platform-specialist\` - LINE, Mobile, Desktop
- \`memory-system\` - Memory protocol
- \`response-format\` - Response structure

@@ -530,0 +698,0 @@ ## เริ่มต้นใช้งาน

@@ -112,3 +112,3 @@ /**

- **Response Language:** Always respond in English
- **Response Language:** Respond in the same language the user uses (if unclear, default to English)
- **UI Labels/Buttons:** English (Save, Cancel, Dashboard)

@@ -119,3 +119,3 @@ - **Mock Data:** English names, addresses, phone numbers

If user requests Thai language, then switch to Thai.
If user writes in Thai, respond in Thai.

@@ -223,4 +223,23 @@ ## Behavior Rules

**Auto-save** after tasks, **Auto-load** on new sessions.
## 🚨 MANDATORY: Memory Protocol
> **CRITICAL:** You MUST follow this protocol EVERY time!
### BEFORE Starting ANY Work:
1. Check \`.toh/memory/\` folder exists
2. Read: \`@.toh/memory/active.md\`, \`@.toh/memory/summary.md\`, \`@.toh/memory/decisions.md\`
3. If files empty but project has code → ANALYZE and populate first!
4. Acknowledge: "Memory loaded! [Brief context]"
### AFTER Completing ANY Work:
1. Update \`@.toh/memory/active.md\` - what was done, next steps
2. Update \`@.toh/memory/decisions.md\` - if decisions were made
3. Update \`@.toh/memory/summary.md\` - if feature completed
4. Confirm: "Memory saved ✅"
### ⚠️ CRITICAL RULES:
- NEVER start work without reading memory!
- NEVER finish work without saving memory!
- Memory files must ALWAYS be in English!
## Project Structure

@@ -246,2 +265,85 @@

## Central Resources (.toh/)
All Toh Framework resources are in the \`.toh/\` folder:
- \`@.toh/skills/\` - Technical skills (design-mastery, premium-experience, etc.)
- \`@.toh/agents/\` - Specialized AI agents
- \`@.toh/commands/\` - Command definitions
- \`@.toh/memory/\` - Memory system files
## 🚨 MANDATORY: Skills & Agents Loading
> **CRITICAL:** Before executing ANY /toh: command, you MUST load the required skills and agents!
### Command → Skills → Agents Map
| Command | Load These Skills | Load Agent |
|---------|------------------|------------|
| \`/toh:vibe\` | \`@.toh/skills/vibe-orchestrator/SKILL.md\`, \`@.toh/skills/premium-experience/SKILL.md\`, \`@.toh/skills/design-mastery/SKILL.md\`, \`@.toh/skills/ui-first-builder/SKILL.md\` | \`@.toh/agents/vibe-agent.md\` |
| \`/toh:ui\` | \`@.toh/skills/ui-first-builder/SKILL.md\`, \`@.toh/skills/design-excellence/SKILL.md\` | \`@.toh/agents/ui-agent.md\` |
| \`/toh:dev\` | \`@.toh/skills/dev-engineer/SKILL.md\`, \`@.toh/skills/backend-engineer/SKILL.md\` | \`@.toh/agents/dev-agent.md\` |
| \`/toh:design\` | \`@.toh/skills/design-mastery/SKILL.md\`, \`@.toh/skills/design-excellence/SKILL.md\` | \`@.toh/agents/design-agent.md\` |
| \`/toh:test\` | \`@.toh/skills/test-engineer/SKILL.md\`, \`@.toh/skills/debug-protocol/SKILL.md\` | \`@.toh/agents/test-agent.md\` |
| \`/toh:connect\` | \`@.toh/skills/backend-engineer/SKILL.md\`, \`@.toh/skills/integrations/SKILL.md\` | \`@.toh/agents/connect-agent.md\` |
| \`/toh:plan\` | \`@.toh/skills/plan-orchestrator/SKILL.md\`, \`@.toh/skills/business-context/SKILL.md\` | \`@.toh/agents/plan-agent.md\` |
| \`/toh:fix\` | \`@.toh/skills/debug-protocol/SKILL.md\`, \`@.toh/skills/error-handling/SKILL.md\` | \`@.toh/agents/core-orchestrator.md\` |
### Core Skills (Always Available)
- \`@.toh/skills/memory-system/SKILL.md\` - Memory read/write protocol
- \`@.toh/skills/response-format/SKILL.md\` - 3-section response format
- \`@.toh/skills/smart-routing/SKILL.md\` - Command routing logic
### Loading Protocol:
1. User types /toh:[command]
2. IMMEDIATELY read required skills using @ reference
3. Read corresponding agent file
4. Execute following skill + agent instructions
5. Save memory after completion
### ⚠️ NEVER Skip Skills!
Skills contain CRITICAL best practices, design tokens, and rules.
## 🔒 Skills Loading Checkpoint (REQUIRED)
> **ENFORCEMENT:** You MUST report skills loaded at the START of your response!
### Required Response Start:
\`\`\`markdown
📚 **Skills Loaded:**
- skill-name-1 ✅ (brief what you learned)
- skill-name-2 ✅ (brief what you learned)
🤖 **Agent:** agent-name
💾 **Memory:** Loaded ✅
---
[Then continue with your work...]
\`\`\`
### Why This Matters:
- If you don't report skills → You didn't read them
- If you skip skills → Output quality drops significantly
- Skills have design tokens, patterns, and critical rules
- This checkpoint proves you followed the protocol
### Example:
\`\`\`markdown
📚 **Skills Loaded:**
- design-mastery ✅ (13 business profiles, design tokens)
- design-excellence ✅ (anti-patterns to avoid, spacing rules)
🤖 **Agent:** design-reviewer
💾 **Memory:** Loaded - working on Restaurant POS system
---
## ✅ What I Did
...
\`\`\`
## Mock Data Examples

@@ -298,3 +400,3 @@

- **ภาษาในการตอบ:** ตอบเป็นภาษาไทยเสมอ
- **ภาษาในการตอบ:** ตอบตามภาษาที่ผู้ใช้พิมพ์มา (ถ้าไม่แน่ใจ ให้ใช้ภาษาไทย)
- **UI Labels/Buttons:** ภาษาไทย (บันทึก, ยกเลิก, แดชบอร์ด)

@@ -305,3 +407,3 @@ - **Mock Data:** ชื่อไทย, ที่อยู่ไทย, เบอร์โทรไทย

ถ้าผู้ใช้ต้องการภาษาอังกฤษ ค่อยเปลี่ยน
ถ้าผู้ใช้พิมพ์เป็นภาษาอังกฤษ ก็ตอบเป็นภาษาอังกฤษ

@@ -408,4 +510,23 @@ ## กฎที่ต้องปฏิบัติ

**Auto-save** หลังทำงาน, **Auto-load** เมื่อเริ่ม session ใหม่
## 🚨 บังคับ: Memory Protocol
> **สำคัญมาก:** ต้องทำตามนี้ทุกครั้ง!
### ก่อนเริ่มทำงาน:
1. เช็ค \`.toh/memory/\` folder มีไหม
2. อ่าน: \`@.toh/memory/active.md\`, \`@.toh/memory/summary.md\`, \`@.toh/memory/decisions.md\`
3. ถ้าไฟล์ว่างแต่มี code → วิเคราะห์โปรเจคก่อน!
4. บอก User: "Memory loaded! [สรุปสั้นๆ]"
### หลังทำงานเสร็จ:
1. อัพเดท \`@.toh/memory/active.md\` - สิ่งที่ทำ, ขั้นตอนถัดไป
2. อัพเดท \`@.toh/memory/decisions.md\` - ถ้ามีการตัดสินใจ
3. อัพเดท \`@.toh/memory/summary.md\` - ถ้า feature เสร็จ
4. บอก User: "Memory saved ✅"
### ⚠️ กฎสำคัญ:
- ห้ามเริ่มงานโดยไม่อ่าน memory!
- ห้ามจบงานโดยไม่บันทึก memory!
- Memory files ต้องเป็นภาษาอังกฤษเสมอ!
## โครงสร้าง Project

@@ -431,2 +552,67 @@

## Central Resources (.toh/)
ทรัพยากรทั้งหมดของ Toh Framework อยู่ใน \`.toh/\`:
- \`@.toh/skills/\` - ทักษะเฉพาะทาง (design-mastery, premium-experience ฯลฯ)
- \`@.toh/agents/\` - AI Agents เฉพาะทาง
- \`@.toh/commands/\` - คำสั่งต่างๆ
- \`@.toh/memory/\` - ไฟล์ Memory System
## 🚨 บังคับ: โหลด Skills & Agents
> **สำคัญมาก:** ก่อน execute คำสั่ง /toh: ใดๆ ต้องโหลด skills และ agents ที่เกี่ยวข้อง!
### คำสั่ง → Skills → Agents
| คำสั่ง | โหลด Skills | โหลด Agent |
|--------|------------|------------|
| \`/toh:vibe\` | \`@.toh/skills/vibe-orchestrator/SKILL.md\`, \`@.toh/skills/premium-experience/SKILL.md\`, \`@.toh/skills/design-mastery/SKILL.md\` | \`@.toh/agents/vibe-agent.md\` |
| \`/toh:ui\` | \`@.toh/skills/ui-first-builder/SKILL.md\`, \`@.toh/skills/design-excellence/SKILL.md\` | \`@.toh/agents/ui-agent.md\` |
| \`/toh:dev\` | \`@.toh/skills/dev-engineer/SKILL.md\`, \`@.toh/skills/backend-engineer/SKILL.md\` | \`@.toh/agents/dev-agent.md\` |
| \`/toh:design\` | \`@.toh/skills/design-mastery/SKILL.md\`, \`@.toh/skills/design-excellence/SKILL.md\` | \`@.toh/agents/design-agent.md\` |
| \`/toh:test\` | \`@.toh/skills/test-engineer/SKILL.md\`, \`@.toh/skills/debug-protocol/SKILL.md\` | \`@.toh/agents/test-agent.md\` |
| \`/toh:connect\` | \`@.toh/skills/backend-engineer/SKILL.md\`, \`@.toh/skills/integrations/SKILL.md\` | \`@.toh/agents/connect-agent.md\` |
| \`/toh:plan\` | \`@.toh/skills/plan-orchestrator/SKILL.md\`, \`@.toh/skills/business-context/SKILL.md\` | \`@.toh/agents/plan-agent.md\` |
| \`/toh:fix\` | \`@.toh/skills/debug-protocol/SKILL.md\`, \`@.toh/skills/error-handling/SKILL.md\` | \`@.toh/agents/core-orchestrator.md\` |
### Core Skills (ใช้ได้เสมอ)
- \`@.toh/skills/memory-system/SKILL.md\` - ระบบ Memory
- \`@.toh/skills/response-format/SKILL.md\` - รูปแบบการตอบ 3 ส่วน
### ขั้นตอนการโหลด:
1. ผู้ใช้พิมพ์ /toh:[command]
2. อ่าน skills ที่จำเป็นจาก @ reference ทันที
3. อ่าน agent ที่เกี่ยวข้อง
4. ทำงานตามคำสั่งใน skill + agent
5. บันทึก memory หลังเสร็จ
### ⚠️ ห้ามข้าม Skills!
Skills มี best practices, design tokens และกฎสำคัญ
## 🔒 Skills Loading Checkpoint (บังคับ)
> **บังคับ:** ต้องรายงาน skills ที่โหลดมาที่ต้นของ response!
### รูปแบบการเริ่มต้น Response:
\`\`\`markdown
📚 **Skills ที่โหลด:**
- skill-name-1 ✅ (สรุปสั้นๆ ว่าได้อะไร)
- skill-name-2 ✅ (สรุปสั้นๆ ว่าได้อะไร)
🤖 **Agent:** ชื่อ agent
💾 **Memory:** โหลดแล้ว ✅
---
[แล้วค่อยทำงานต่อ...]
\`\`\`
### ทำไมต้องทำ:
- ถ้าไม่รายงาน skills → แปลว่าไม่ได้อ่าน
- ถ้าข้าม skills → คุณภาพงานจะลดลงมาก
- Skills มี design tokens, patterns และกฎสำคัญ
- Checkpoint นี้พิสูจน์ว่าทำตาม protocol
## ตัวอย่าง Mock Data

@@ -433,0 +619,0 @@

@@ -11,6 +11,5 @@ /**

const geminiDir = path.join(targetDir, '.gemini');
const agentsDir = path.join(geminiDir, 'agents');
// Create directories
await fs.ensureDir(agentsDir);
// Create .gemini directory (config only, no agents/commands - they're in .toh/)
await fs.ensureDir(geminiDir);

@@ -24,32 +23,24 @@ // Create .toh/memory directory structure (v1.1.0 - Memory System)

// Create memory template files
await createMemoryFiles(memoryDir, language);
await createMemoryFiles(memoryDir);
// Copy agents to .gemini/agents/
const srcAgentsDir = path.join(srcDir, 'agents');
if (await fs.pathExists(srcAgentsDir)) {
const agentFiles = await fs.readdir(srcAgentsDir);
for (const file of agentFiles) {
if (file.endsWith('.md') && file !== 'README.md') {
await fs.copy(
path.join(srcAgentsDir, file),
path.join(agentsDir, `toh-${file}`)
);
}
}
}
// v1.4.0: NO LONGER copy agents/commands to .gemini/
// All resources are now in .toh/ (Central Resources)
// Gemini will reference them via contextFiles in settings.json
// Create GEMINI.md - Main instructions
// Create GEMINI.md - Main instructions (references .toh/)
const geminiMd = language === 'th' ? generateGeminiMdTH() : generateGeminiMdEN();
await fs.writeFile(path.join(geminiDir, 'GEMINI.md'), geminiMd);
// Create settings.json for auto-loading
// Create settings.json for auto-loading from .toh/ central resources
const settings = {
"contextFiles": [
".gemini/GEMINI.md",
".gemini/agents/*.md",
".toh/agents/*.md",
".toh/commands/*.md",
".toh/skills/**/*.md",
".toh/memory/*.md"
],
"systemInstruction": language === 'th'
? "คำสั่งการทำงานอยู่ใน .gemini/GEMINI.md ปฏิบัติตาม Toh Framework methodology ตอบเป็นภาษาไทย"
: "Your operating instructions are in .gemini/GEMINI.md. Follow the Toh Framework methodology. Respond in English.",
? "คำสั่งการทำงานอยู่ใน .gemini/GEMINI.md ปฏิบัติตาม Toh Framework methodology ทรัพยากรอยู่ใน .toh/ ตอบตามภาษาที่ผู้ใช้พิมพ์มา"
: "Your operating instructions are in .gemini/GEMINI.md. Follow the Toh Framework methodology. All resources are in .toh/. Respond in the same language the user uses.",
"model": "gemini-2.5-flash"

@@ -67,5 +58,7 @@ };

function generateGeminiMdEN() {
return `# Toh Framework - Gemini CLI Integration
return `# Toh Framework - Gemini CLI / Google Antigravity Integration
> **"Type Once, Have it all!"** - AI-Orchestration Driven Development
>
> **Compatible with:** Gemini CLI, Google Antigravity, and any tool that reads .gemini/ config

@@ -97,3 +90,3 @@ ## Identity

- **Response Language:** Always respond in English
- **Response Language:** Respond in the same language the user uses (if unclear, default to English)
- **UI Labels/Buttons:** English (Save, Cancel, Dashboard)

@@ -104,3 +97,3 @@ - **Mock Data:** English names, addresses, phone numbers

If user requests Thai language, then switch to Thai.
If user writes in Thai, respond in Thai.

@@ -136,3 +129,3 @@ ## 🚨 Command Recognition (CRITICAL)

3. **No Confirmation for Described Commands** - If description exists, execute without asking
4. **Read Agent File First** - Load \`.gemini/agents/toh-[relevant-agent].md\` for full instructions
4. **Read Agent File First** - Load \`.toh/agents/[relevant-agent].md\` for full instructions
5. **Follow Memory Protocol** - Always read/write memory before/after execution

@@ -180,2 +173,49 @@

## 🚨 MANDATORY: Memory Protocol
> **CRITICAL:** You MUST follow this protocol EVERY time. No exceptions!
### BEFORE Starting ANY Work:
\`\`\`
STEP 1: Check .toh/memory/ folder
├── Folder doesn't exist? → Create it first!
└── Folder exists? → Continue to Step 2
STEP 2: Read these 3 files (MANDATORY)
├── .toh/memory/active.md
├── .toh/memory/summary.md
└── .toh/memory/decisions.md
STEP 3: If files are empty but project has code:
→ ANALYZE project first and populate memory!
STEP 4: Acknowledge to User
"Memory loaded! [Brief summary of context]"
\`\`\`
### AFTER Completing ANY Work:
\`\`\`
STEP 1: Update active.md (ALWAYS!)
├── Current Focus → What was just done
├── Just Completed → Add what you finished
└── Next Steps → What should be done next
STEP 2: Update decisions.md (if any decisions made)
└── Add row: | Date | Decision | Reason |
STEP 3: Update summary.md (if feature completed)
└── Add to Completed Features list
STEP 4: Confirm to User
"Memory saved ✅"
\`\`\`
### ⚠️ CRITICAL RULES:
1. **NEVER start work without reading memory first!**
2. **NEVER finish work without saving memory!**
3. **NEVER ask "should I save memory?" - just do it automatically!**
4. **Memory files must ALWAYS be in English!**
## Behavior Rules

@@ -199,11 +239,83 @@

## Central Resources (.toh/)
All Toh Framework resources are in the \`.toh/\` folder (Central Resources):
- \`.toh/skills/\` - Technical skills (design-mastery, premium-experience, etc.)
- \`.toh/agents/\` - Specialized AI agents
- \`.toh/commands/\` - Command definitions
- \`.toh/memory/\` - Memory system files
## 🚨 MANDATORY: Skills & Agents Loading
> **CRITICAL:** Before executing ANY /toh: command, you MUST load the required skills and agents!
### Command → Skills → Agents Map
| Command | Load These Skills (from \`.toh/skills/\`) | Load Agent (from \`.toh/agents/\`) |
|---------|------------------------------------------|-----------------------------------|
| \`/toh:vibe\` | \`vibe-orchestrator\`, \`premium-experience\`, \`design-mastery\`, \`ui-first-builder\` | \`vibe-agent.md\` |
| \`/toh:ui\` | \`ui-first-builder\`, \`design-excellence\`, \`response-format\` | \`ui-agent.md\` |
| \`/toh:dev\` | \`dev-engineer\`, \`backend-engineer\`, \`response-format\` | \`dev-agent.md\` |
| \`/toh:design\` | \`design-mastery\`, \`design-excellence\`, \`premium-experience\` | \`design-agent.md\` |
| \`/toh:test\` | \`test-engineer\`, \`debug-protocol\`, \`error-handling\` | \`test-agent.md\` |
| \`/toh:connect\` | \`backend-engineer\`, \`integrations\` | \`connect-agent.md\` |
| \`/toh:plan\` | \`plan-orchestrator\`, \`business-context\`, \`smart-routing\` | \`plan-agent.md\` |
| \`/toh:fix\` | \`debug-protocol\`, \`error-handling\`, \`test-engineer\` | \`core-orchestrator.md\` |
| \`/toh:line\` | \`platform-specialist\`, \`integrations\` | \`platform-agent.md\` |
| \`/toh:mobile\` | \`platform-specialist\`, \`ui-first-builder\` | \`platform-agent.md\` |
| \`/toh:ship\` | \`version-control\`, \`progress-tracking\` | \`core-orchestrator.md\` |
### Core Skills (Always Available)
- \`memory-system\` - Memory read/write protocol
- \`response-format\` - 3-section response format
- \`smart-routing\` - Command routing logic
### Loading Protocol:
1. User types /toh:[command]
2. IMMEDIATELY read required skills from \`.toh/skills/[skill-name]/SKILL.md\`
3. Read corresponding agent from \`.toh/agents/\`
4. Execute following skill + agent instructions
5. Save memory after completion
### ⚠️ NEVER Skip Skills!
Skills contain CRITICAL best practices, design tokens, and rules.
## 🔒 Skills Loading Checkpoint (REQUIRED)
> **ENFORCEMENT:** You MUST report skills loaded at the START of your response!
### Required Response Start:
\`\`\`markdown
📚 **Skills Loaded:**
- skill-name-1 ✅ (brief what you learned)
- skill-name-2 ✅ (brief what you learned)
🤖 **Agent:** agent-name
💾 **Memory:** Loaded ✅
---
[Then continue with your work...]
\`\`\`
### Why This Matters:
- If you don't report skills → You didn't read them
- If you skip skills → Output quality drops significantly
- Skills have design tokens, patterns, and critical rules
- This checkpoint proves you followed the protocol
## Agent Files
Agent files are located at \`.gemini/agents/\`:
- \`toh-ui-builder.md\` - Creates UI components and pages
- \`toh-dev-builder.md\` - Adds logic, state, API integration
- \`toh-design-reviewer.md\` - Improves design quality
- \`toh-test-runner.md\` - Tests and fixes issues
- \`toh-backend-connector.md\` - Connects to Supabase
- \`toh-platform-adapter.md\` - Platform adaptation (LINE, Mobile)
Agent files are located at \`.toh/agents/\`:
- \`vibe-agent.md\` - Creates new projects with UI + Logic
- \`ui-agent.md\` - Creates UI components and pages
- \`dev-agent.md\` - Adds logic, state, API integration
- \`design-agent.md\` - Improves design quality
- \`test-agent.md\` - Tests and fixes issues
- \`connect-agent.md\` - Connects to Supabase
- \`plan-agent.md\` - Analyzes and plans projects
- \`platform-agent.md\` - Platform adaptation (LINE, Mobile)
- \`core-orchestrator.md\` - Main orchestration

@@ -225,6 +337,8 @@ ## Getting Started

function generateGeminiMdTH() {
return `# Toh Framework - Gemini CLI Integration
return `# Toh Framework - Gemini CLI / Google Antigravity Integration
> **"Type Once, Have it all!"** - AI-Orchestration Driven Development
> **"สั่งแล้วจบ ไม่ถาม ไม่รอ"**
>
> **รองรับ:** Gemini CLI, Google Antigravity, และ tools อื่นที่อ่าน .gemini/ config

@@ -256,3 +370,3 @@ ## Identity

- **ภาษาในการตอบ:** ตอบเป็นภาษาไทยเสมอ
- **ภาษาในการตอบ:** ตอบตามภาษาที่ผู้ใช้พิมพ์มา (ถ้าไม่แน่ใจ ให้ใช้ภาษาไทย)
- **UI Labels/Buttons:** ภาษาไทย (บันทึก, ยกเลิก, แดชบอร์ด)

@@ -263,3 +377,3 @@ - **Mock Data:** ชื่อไทย, ที่อยู่ไทย, เบอร์โทรไทย

ถ้าผู้ใช้ต้องการภาษาอังกฤษ ค่อยเปลี่ยน
ถ้าผู้ใช้พิมพ์เป็นภาษาอังกฤษ ก็ตอบเป็นภาษาอังกฤษ

@@ -295,3 +409,3 @@ ## 🚨 การรับคำสั่ง (สำคัญมาก!)

3. **ไม่ต้องถามยืนยันถ้ามี Description** - มี description = ทำเลย
4. **อ่าน Agent File ก่อน** - โหลด \`.gemini/agents/toh-[agent].md\` เพื่อดูคำแนะนำ
4. **อ่าน Agent File ก่อน** - โหลด \`.toh/agents/[agent].md\` เพื่อดูคำแนะนำ
5. **ทำตาม Memory Protocol** - อ่าน/เขียน memory ก่อน/หลังทำงาน

@@ -339,2 +453,49 @@

## 🚨 บังคับ: Memory Protocol
> **สำคัญมาก:** ต้องทำตามนี้ทุกครั้ง ห้ามข้าม!
### ก่อนเริ่มทำงาน:
\`\`\`
STEP 1: เช็ค .toh/memory/ folder
├── ไม่มี? → สร้างก่อน!
└── มีแล้ว? → ไปต่อ Step 2
STEP 2: อ่าน 3 ไฟล์นี้ (บังคับ!)
├── .toh/memory/active.md
├── .toh/memory/summary.md
└── .toh/memory/decisions.md
STEP 3: ถ้าไฟล์ว่างแต่โปรเจคมี code:
→ วิเคราะห์โปรเจคก่อนแล้ว populate memory!
STEP 4: บอก User
"Memory loaded! [สรุปสั้นๆ]"
\`\`\`
### หลังทำงานเสร็จ:
\`\`\`
STEP 1: อัพเดท active.md (ต้องทำเสมอ!)
├── Current Focus → สิ่งที่เพิ่งทำ
├── Just Completed → เพิ่มงานที่เสร็จ
└── Next Steps → ขั้นตอนถัดไป
STEP 2: อัพเดท decisions.md (ถ้ามีการตัดสินใจ)
└── เพิ่มแถว: | Date | Decision | Reason |
STEP 3: อัพเดท summary.md (ถ้า feature เสร็จ)
└── เพิ่มใน Completed Features
STEP 4: บอก User
"Memory saved ✅"
\`\`\`
### ⚠️ กฎสำคัญ:
1. **ห้ามเริ่มงานโดยไม่อ่าน memory!**
2. **ห้ามจบงานโดยไม่บันทึก memory!**
3. **ห้ามถาม "จะ save memory ไหม?" - ทำอัตโนมัติเลย!**
4. **Memory files ต้องเป็นภาษาอังกฤษเสมอ!**
## กฎที่ต้องปฏิบัติ

@@ -358,11 +519,87 @@

## Central Resources (.toh/)
ทรัพยากรทั้งหมดของ Toh Framework อยู่ใน \`.toh/\` (Central Resources):
- \`.toh/skills/\` - ทักษะเฉพาะทาง (design-mastery, premium-experience ฯลฯ)
- \`.toh/agents/\` - AI Agents เฉพาะทาง
- \`.toh/commands/\` - คำสั่งต่างๆ
- \`.toh/memory/\` - ไฟล์ Memory System
**⚠️ สำคัญ:**
- อ่าน skill ที่เกี่ยวข้องจาก \`.toh/skills/\` ก่อนเริ่มทำงาน
- Skills มี best practices และคำแนะนำโดยละเอียด
## 🚨 บังคับ: โหลด Skills & Agents
> **สำคัญมาก:** ก่อน execute คำสั่ง /toh: ใดๆ ต้องโหลด skills และ agents ที่เกี่ยวข้อง!
### คำสั่ง → Skills → Agents
| คำสั่ง | โหลด Skills เหล่านี้ (จาก \`.toh/skills/\`) | โหลด Agent (จาก \`.toh/agents/\`) |
|--------|-------------------------------------------|----------------------------------|
| \`/toh:vibe\` | \`vibe-orchestrator\`, \`premium-experience\`, \`design-mastery\`, \`ui-first-builder\` | \`vibe-agent.md\` |
| \`/toh:ui\` | \`ui-first-builder\`, \`design-excellence\`, \`response-format\` | \`ui-agent.md\` |
| \`/toh:dev\` | \`dev-engineer\`, \`backend-engineer\`, \`response-format\` | \`dev-agent.md\` |
| \`/toh:design\` | \`design-mastery\`, \`design-excellence\`, \`premium-experience\` | \`design-agent.md\` |
| \`/toh:test\` | \`test-engineer\`, \`debug-protocol\`, \`error-handling\` | \`test-agent.md\` |
| \`/toh:connect\` | \`backend-engineer\`, \`integrations\` | \`connect-agent.md\` |
| \`/toh:plan\` | \`plan-orchestrator\`, \`business-context\`, \`smart-routing\` | \`plan-agent.md\` |
| \`/toh:fix\` | \`debug-protocol\`, \`error-handling\`, \`test-engineer\` | \`core-orchestrator.md\` |
| \`/toh:line\` | \`platform-specialist\`, \`integrations\` | \`platform-agent.md\` |
| \`/toh:mobile\` | \`platform-specialist\`, \`ui-first-builder\` | \`platform-agent.md\` |
| \`/toh:ship\` | \`version-control\`, \`progress-tracking\` | \`core-orchestrator.md\` |
### Core Skills (ใช้ได้เสมอ)
- \`memory-system\` - ระบบ Memory
- \`response-format\` - รูปแบบการตอบ 3 ส่วน
- \`smart-routing\` - การ route คำสั่ง
### ขั้นตอนการโหลด:
1. ผู้ใช้พิมพ์ /toh:[command]
2. อ่าน skills ที่จำเป็นจาก \`.toh/skills/[skill-name]/SKILL.md\` ทันที
3. อ่าน agent ที่เกี่ยวข้องจาก \`.toh/agents/\`
4. ทำงานตามคำสั่งใน skill + agent
5. บันทึก memory หลังเสร็จ
### ⚠️ ห้ามข้าม Skills!
Skills มี best practices, design tokens และกฎสำคัญ
## 🔒 Skills Loading Checkpoint (บังคับ)
> **บังคับ:** ต้องรายงาน skills ที่โหลดมาที่ต้นของ response!
### รูปแบบการเริ่มต้น Response:
\`\`\`markdown
📚 **Skills ที่โหลด:**
- skill-name-1 ✅ (สรุปสั้นๆ ว่าได้อะไร)
- skill-name-2 ✅ (สรุปสั้นๆ ว่าได้อะไร)
🤖 **Agent:** ชื่อ agent
💾 **Memory:** โหลดแล้ว ✅
---
[แล้วค่อยทำงานต่อ...]
\`\`\`
### ทำไมต้องทำ:
- ถ้าไม่รายงาน skills → แปลว่าไม่ได้อ่าน
- ถ้าข้าม skills → คุณภาพงานจะลดลงมาก
- Skills มี design tokens, patterns และกฎสำคัญ
- Checkpoint นี้พิสูจน์ว่าทำตาม protocol
## ไฟล์ Agents
ไฟล์ agents อยู่ที่ \`.gemini/agents/\`:
- \`toh-ui-builder.md\` - สร้าง UI
- \`toh-dev-builder.md\` - เพิ่ม Logic
- \`toh-design-reviewer.md\` - ปรับ Design
- \`toh-test-runner.md\` - ทดสอบระบบ
- \`toh-backend-connector.md\` - เชื่อม Backend
- \`toh-platform-adapter.md\` - Platform adaptation
ไฟล์ agents อยู่ที่ \`.toh/agents/\`:
- \`vibe-agent.md\` - สร้างโปรเจคใหม่
- \`ui-agent.md\` - สร้าง UI
- \`dev-agent.md\` - เพิ่ม Logic
- \`design-agent.md\` - ปรับ Design
- \`test-agent.md\` - ทดสอบระบบ
- \`connect-agent.md\` - เชื่อม Backend
- \`plan-agent.md\` - วางแผนโปรเจค
- \`platform-agent.md\` - Platform (LINE, Mobile)
- \`core-orchestrator.md\` - ควบคุมทั้งหมด

@@ -382,1 +619,85 @@ ## เริ่มต้นใช้งาน

}
/**
* Create memory template files for the Memory System
* Always in English for consistency
*/
async function createMemoryFiles(memoryDir) {
const timestamp = new Date().toISOString().split('T')[0];
// active.md
const activeContent = `# 🔥 Active Task
## Current Focus
[Waiting for user command]
## In Progress
- (none)
## Just Completed
- (none)
## Next Steps
- Waiting for user command
## Blockers / Issues
- (none)
---
*Last updated: ${timestamp}*
`;
// summary.md
const summaryContent = `# 📋 Project Summary
## Project Overview
- Name: [Project Name]
- Type: [Type]
- Tech Stack: Next.js 14, Tailwind, shadcn/ui, Zustand, Supabase
## Completed Features
- (none)
## Current State
Project just initialized - ready for commands
## Key Files
- (will update when files are created)
## Important Notes
- Using Toh Framework v1.4.0
- Memory System is active
---
*Last updated: ${timestamp}*
`;
// decisions.md
const decisionsContent = `# 🧠 Key Decisions
## Architecture Decisions
| Date | Decision | Reason |
|------|----------|--------|
| ${timestamp} | Use Toh Framework | AI-Orchestration Driven Development |
## Design Decisions
| Date | Decision | Reason |
|------|----------|--------|
## Business Logic
| Date | Decision | Reason |
|------|----------|--------|
## Rejected Ideas
| Date | Idea | Why Rejected |
|------|------|--------------|
---
*Last updated: ${timestamp}*
`;
// Write files
await fs.writeFile(path.join(memoryDir, 'active.md'), activeContent);
await fs.writeFile(path.join(memoryDir, 'summary.md'), summaryContent);
await fs.writeFile(path.join(memoryDir, 'decisions.md'), decisionsContent);
}

@@ -169,3 +169,3 @@ /**

{ name: '📝 Cursor', value: 'cursor', checked: true },
{ name: '💎 Gemini CLI (Google)', value: 'gemini', checked: false },
{ name: '💎 Gemini CLI / Antigravity (Google)', value: 'gemini', checked: true },
{ name: '🧠 Codex CLI (OpenAI)', value: 'codex', checked: false }

@@ -254,11 +254,12 @@ ],

// v1.4.0: All resources go to .toh/ (Central Resources)
switch (componentName) {
case 'skills':
destPath = join(targetDir, '.claude', 'skills');
destPath = join(targetDir, '.toh', 'skills');
break;
case 'agents':
destPath = join(targetDir, '.claude', 'agents');
destPath = join(targetDir, '.toh', 'agents');
break;
case 'commands':
destPath = join(targetDir, '.claude', 'commands');
destPath = join(targetDir, '.toh', 'commands');
break;

@@ -406,4 +407,6 @@ case 'templates':

function printNextSteps(config) {
const isEN = config.language === 'en';
console.log(chalk.cyan('┌────────────────────────────────────────────────────────────┐'));
console.log(chalk.cyan('│') + chalk.bold.white(' 🎉 Toh Framework v1.1.0 Installed! ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.bold.white(' 🎉 Toh Framework v1.5.0 Installed! ') + chalk.cyan('│'));
console.log(chalk.cyan('├────────────────────────────────────────────────────────────┤'));

@@ -413,5 +416,11 @@

console.log(chalk.cyan('│') + chalk.white(' Claude Code: ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:plan') + chalk.gray(' - 🧠 วางแผนและ orchestrate งาน ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - 🎨 เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:help') + chalk.gray(' - 📚 ดูรายการ commands ทั้งหมด ') + chalk.cyan('│'));
if (isEN) {
console.log(chalk.cyan('│') + chalk.green(' /toh:plan') + chalk.gray(' - 🧠 Plan and orchestrate tasks ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - 🎨 Create new project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:help') + chalk.gray(' - 📚 Show all commands ') + chalk.cyan('│'));
} else {
console.log(chalk.cyan('│') + chalk.green(' /toh:plan') + chalk.gray(' - 🧠 วางแผนและ orchestrate งาน ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - 🎨 เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:help') + chalk.gray(' - 📚 ดูรายการ commands ทั้งหมด ') + chalk.cyan('│'));
}
console.log(chalk.cyan('│') + chalk.white(' ') + chalk.cyan('│'));

@@ -422,3 +431,7 @@ }

console.log(chalk.cyan('│') + chalk.white(' Cursor: ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' @toh') + chalk.gray(' - เรียก Toh agent ') + chalk.cyan('│'));
if (isEN) {
console.log(chalk.cyan('│') + chalk.green(' @toh') + chalk.gray(' - Call Toh agent ') + chalk.cyan('│'));
} else {
console.log(chalk.cyan('│') + chalk.green(' @toh') + chalk.gray(' - เรียก Toh agent ') + chalk.cyan('│'));
}
console.log(chalk.cyan('│') + chalk.white(' ') + chalk.cyan('│'));

@@ -428,5 +441,10 @@ }

if (config.ides.includes('gemini') || config.ides.includes('gemini-cli')) {
console.log(chalk.cyan('│') + chalk.white(' Gemini CLI: ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' gemini') + chalk.gray(' - Start Gemini CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' Gemini CLI / Google Antigravity: ') + chalk.cyan('│'));
if (isEN) {
console.log(chalk.cyan('│') + chalk.green(' gemini') + chalk.gray(' - Start Gemini CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - Create new project ') + chalk.cyan('│'));
} else {
console.log(chalk.cyan('│') + chalk.green(' gemini') + chalk.gray(' - Start Gemini CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
}
console.log(chalk.cyan('│') + chalk.white(' ') + chalk.cyan('│'));

@@ -437,4 +455,9 @@ }

console.log(chalk.cyan('│') + chalk.white(' Codex CLI: ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' codex') + chalk.gray(' - Start Codex CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
if (isEN) {
console.log(chalk.cyan('│') + chalk.green(' codex') + chalk.gray(' - Start Codex CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - Create new project ') + chalk.cyan('│'));
} else {
console.log(chalk.cyan('│') + chalk.green(' codex') + chalk.gray(' - Start Codex CLI in project ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.green(' /toh:vibe') + chalk.gray(' - เริ่มสร้างโปรเจคใหม่ ') + chalk.cyan('│'));
}
console.log(chalk.cyan('│') + chalk.white(' ') + chalk.cyan('│'));

@@ -446,8 +469,14 @@ }

console.log(chalk.cyan('├────────────────────────────────────────────────────────────┤'));
console.log(chalk.cyan('│') + chalk.bold.yellow(' ✨ New in v1.1.0: ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 🧠 /toh:plan - The Brain (orchestrate all agents) ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 💾 Auto Memory - AI remembers across sessions ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 📚 Enhanced /toh:dev - Read API docs from URLs ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.bold.yellow(' ✨ New in v1.5.0: ') + chalk.cyan('│'));
if (isEN) {
console.log(chalk.cyan('│') + chalk.white(' • 🌌 Google Antigravity - Full Support! ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 🔒 Memory Protocol - Mandatory load/save ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 📋 Skills Checkpoint - AI reports loaded skills ') + chalk.cyan('│'));
} else {
console.log(chalk.cyan('│') + chalk.white(' • 🌌 Google Antigravity - รองรับเต็มรูปแบบ! ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 🔒 Memory Protocol - บังคับ load/save ทุกครั้ง ') + chalk.cyan('│'));
console.log(chalk.cyan('│') + chalk.white(' • 📋 Skills Checkpoint - AI รายงาน skills ที่โหลด ') + chalk.cyan('│'));
}
console.log(chalk.cyan('└────────────────────────────────────────────────────────────┘'));
console.log('');
}
{
"name": "toh-framework",
"version": "1.4.0",
"version": "1.5.0",
"type": "module",
"description": "AI-Orchestration Driven Development Framework - สั่งแล้วจบ ไม่ถาม ไม่รอ",
"description": "AI-Orchestration Driven Development Framework - Type Once, Have it all!",
"author": {

@@ -24,3 +24,7 @@ "name": "Wasin Treesinthuros",

"claude",
"claude-code",
"cursor",
"gemini",
"antigravity",
"google-antigravity",
"vibe-coding",

@@ -27,0 +31,0 @@ "agentic",

# 🎯 Toh Framework
<!-- Logo - พี่โตใส่รูป logo ได้ที่นี่ -->
<!--
<p align="center">
<img src="./assets/logo.png" alt="Toh Framework" width="200">
</p>
-->
> **"Type Once, Have it all!"** - AI-Orchestration Driven Development

@@ -14,2 +21,14 @@

## 🤖 Supported IDEs
| IDE | Status | Notes |
|-----|--------|-------|
| 🧠 **Claude Code** | ✅ Full Support | Slash commands, Memory system |
| 📝 **Cursor** | ✅ Full Support | @ file references |
| 🌌 **Google Antigravity** | ✅ **NEW!** Full Support | Latest Gemini integration |
| 💎 **Gemini CLI** | ✅ Full Support | Context files auto-loaded |
| 🤖 **Codex CLI** | ✅ Supported | OpenAI agents |
> 📖 **[🇹🇭 Thai Documentation](docs/README-TH.md)**
## 💡 Why Toh?

@@ -39,6 +58,46 @@

## 🆕 What's New in v1.4.0
## 🆕 What's New in v1.5.0
### ✨ Smart Single Command & Premium Experience
### 🌌 Google Antigravity - Full Support!
Now fully supports Google's **Antigravity** (Gemini IDE)! Install once, use everywhere:
```bash
npx toh-framework install
# Select: Claude Code ✅, Cursor ✅, Gemini CLI / Antigravity ✅
```
### 🏗️ Dual Folder Architecture
| IDE | Folder | Why |
|-----|--------|-----|
| Claude Code | `.claude/` | Required for slash commands |
| Others | `.toh/` | Central resources |
Both contain identical skills, agents, and commands - fully synced on install!
### 🔒 Memory Protocol Enforcement
- ✅ Mandatory memory load/save on EVERY task
- ✅ Skills loading checkpoint - AI must report what it loaded
- ✅ English-only memory files for consistency
- ✅ Cross-IDE memory compatibility
### 📋 Skills Loading Checkpoint
AI now MUST report skills at the start of every response:
```markdown
📚 **Skills Loaded:**
- design-mastery ✅ (13 business profiles)
- premium-experience ✅ (5+ pages, animations)
🤖 **Agent:** vibe-agent
💾 **Memory:** Loaded ✅
```
---
## ✨ v1.4.0 Features (Still Available!)
| Feature | Description |

@@ -45,0 +104,0 @@ |---------|-------------|

@@ -484,2 +484,5 @@ # /toh - Smart Single Command v3.0

4. **Zero Errors** - `npm run build` must pass before delivery
- If error → Fix immediately, don't tell user to fix!
- Loop until build passes 100%
- Common fixes: Tailwind classes, imports, types
5. **3-Section Response** - Every response uses the format

@@ -486,0 +489,0 @@ 6. **Save Memory** - Never finish without updating memory

@@ -137,5 +137,37 @@ ---

└── formatDate, formatCurrency, etc.
```
7. START Dev Server
### Phase 4.5: Zero Error Check (MANDATORY!) 🚨
```
7. 🔍 BUILD & VERIFY (ห้ามข้าม!)
ขั้นตอน:
├── npm run build
│ ├── ✅ Pass → ไปต่อ Phase 5
│ └── ❌ Error → แก้ทันที! (ดูด้านล่าง)
└── npm run dev → VERIFY it runs!
⚠️ Common Errors ที่ต้องแก้:
1. Tailwind CSS Classes ไม่ถูก:
❌ className="text-primary-500" (ไม่มีใน default)
✅ className="text-primary" หรือเพิ่มใน tailwind.config
2. Import ผิด:
❌ import { Button } from "@/components/ui/Button"
✅ import { Button } from "@/components/ui/button"
3. Missing dependencies:
→ npm install [package]
4. Type errors:
→ แก้ types ให้ถูกต้อง
🔄 Loop จนกว่าจะ:
└── npm run build → SUCCESS (exit code 0)
❌ ห้าม deliver ถ้ายังมี error!
❌ ห้ามบอก user ให้ไป /toh:fix เอง!
```

@@ -379,2 +411,4 @@

7. **NEVER** forget to tell user what to do next - Response Excellence!
8. **NEVER** deliver with build errors - ต้อง `npm run build` ผ่านก่อน!
9. **NEVER** tell user to fix errors themselves - แก้ให้เสร็จก่อน deliver!

@@ -388,5 +422,6 @@ ## ✅ Rules (ต้องทำเสมอ!)

5. **ALWAYS** apply Anti AI-Looking rules
6. **ALWAYS** run dev server and verify
7. **ALWAYS** use Response Excellence format
8. **ALWAYS** tell user exactly what they got and what to do
6. **ALWAYS** run `npm run build` and fix ALL errors before deliver
7. **ALWAYS** run dev server and verify
8. **ALWAYS** use Response Excellence format
9. **ALWAYS** tell user exactly what they got and what to do

@@ -402,3 +437,4 @@ ---

- [ ] Mock data realistic (ไม่ใช่ Lorem ipsum)
- [ ] **`npm run build` ผ่าน 100% ไม่มี error** 🚨
- [ ] User รู้ว่าได้อะไร ต้องทำอะไร ไม่ต้องถามซ้ำ
- [ ] ดีกว่า Lovable ตั้งแต่แรก! 🎉
# 🧠 Toh Framework - Smart Memory System
> ระบบ Memory อัตโนมัติที่ทำให้ AI ไม่ลืมงาน แม้เปลี่ยน Chat, IDE, หรือ Model
> Automatic Memory System that ensures AI never forgets work, even when changing Chat, IDE, or Model.

@@ -9,13 +9,13 @@ ---

### ปัญหาที่แก้
- ❌ Token เต็ม → Context หาย
- ❌ เปลี่ยน Chat → ต้องอธิบายใหม่
- ❌ ย้าย IDE (Claude → Cursor) → ลืมทุกอย่าง
- ❌ ย้าย Model → Context หาย
### Problems Solved
- ❌ Token limit reached → Context lost
- ❌ Change Chat → Have to explain everything again
- ❌ Switch IDE (Claude → Cursor) → Forget everything
- ❌ Switch Model → Context lost
### Solution
- ✅ Auto-save ทุกครั้งที่ทำงานเสร็จ
- ✅ Auto-load ทุกครั้งที่เริ่ม session
- ✅ User ไม่ต้องทำอะไรเลย
- ✅ ใช้ได้ทุก IDE, ทุก Model
- ✅ Auto-save after every task completion
- ✅ Auto-load at every session start
- ✅ User doesn't have to do anything
- ✅ Works across all IDEs, all Models

@@ -29,6 +29,6 @@ ---

└── memory/
├── active.md # 🔥 งานปัจจุบัน (~500 tokens)
├── summary.md # 📋 สรุปโปรเจค (~1,000 tokens)
├── decisions.md # 🧠 การตัดสินใจสำคัญ (~500 tokens)
└── archive/ # 📦 ประวัติเก่า (โหลดเมื่อต้องการ)
├── active.md # 🔥 Current task (~500 tokens)
├── summary.md # 📋 Project summary (~1,000 tokens)
├── decisions.md # 🧠 Key decisions (~500 tokens)
└── archive/ # 📦 Historical data (load on-demand)
├── 2024-11-27.md

@@ -38,3 +38,3 @@ └── ...

### Total Context Load: ~2,000 tokens (เท่านั้น!)
### Total Context Load: ~2,000 tokens (only!)

@@ -45,3 +45,3 @@ ---

### 1. `active.md` - งานปัจจุบัน
### 1. `active.md` - Current Task

@@ -52,3 +52,3 @@ ```markdown

## Current Focus
[สิ่งที่กำลังทำอยู่ตอนนี้]
[What is being worked on right now]

@@ -60,9 +60,9 @@ ## In Progress

## Just Completed
- [x] Task ที่เพิ่งทำเสร็จ
- [x] Recently completed task
## Next Steps
- สิ่งที่ต้องทำต่อ
- What needs to be done next
## Blockers / Issues
- ปัญหาที่ติดอยู่ (ถ้ามี)
- Problems encountered (if any)

@@ -73,3 +73,3 @@ ---

### 2. `summary.md` - สรุปโปรเจค
### 2. `summary.md` - Project Summary

@@ -80,15 +80,15 @@ ```markdown

## Project Overview
- Name: [ชื่อโปรเจค]
- Type: [ประเภท เช่น SaaS, E-commerce]
- Name: [Project name]
- Type: [Type e.g. SaaS, E-commerce]
- Tech Stack: Next.js 14, Tailwind, shadcn/ui, Zustand, Supabase
## Completed Features
- ✅ Feature 1 - [คำอธิบายสั้น]
- ✅ Feature 2 - [คำอธิบายสั้น]
- ✅ Feature 1 - [Short description]
- ✅ Feature 2 - [Short description]
## Current State
[สถานะปัจจุบันของโปรเจค]
[Current project status]
## Key Files
- `src/app/page.tsx` - หน้าหลัก
- `src/app/page.tsx` - Main page
- `src/stores/` - State management

@@ -98,3 +98,3 @@ - `src/components/` - UI Components

## Important Notes
- [สิ่งสำคัญที่ต้องจำ]
- [Important things to remember]

@@ -105,3 +105,3 @@ ---

### 3. `decisions.md` - การตัดสินใจสำคัญ
### 3. `decisions.md` - Key Decisions

@@ -114,4 +114,3 @@ ```markdown

|------|----------|--------|
| 2024-11-27 | ใช้ Zustand แทน Redux | เรียบง่าย เหมาะกับ Solo Dev |
| 2024-11-27 | ใช้ shadcn/ui | Customizable, ไม่ bloat |
| [date] | Use Toh Framework | AI-Orchestration Driven Development |

@@ -121,14 +120,7 @@ ## Design Decisions

|------|----------|--------|
| 2024-11-27 | สี Primary: Blue | ตาม brand guideline |
## Business Logic
## Technical Decisions
| Date | Decision | Reason |
|------|----------|--------|
| 2024-11-27 | Free tier 100 items | เพื่อดึงดูด users |
## Rejected Ideas
| Date | Idea | Why Rejected |
|------|------|--------------|
| 2024-11-27 | ใช้ Redux | ซับซ้อนเกินไป |
---

@@ -138,148 +130,105 @@ *Last updated: [timestamp]*

### 4. `archive/YYYY-MM-DD.md` - ประวัติรายวัน
---
```markdown
# 📦 Archive: 2024-11-27
## 🔄 Memory Protocol
## Sessions
### Session 1 (09:00)
- สร้างหน้า Login
- เชื่อม Supabase Auth
### BEFORE Starting Any Work
### Session 2 (14:00)
- แก้ bug validation
- เพิ่ม loading state
```
STEP 1: Check .toh/memory/ folder
├── Folder doesn't exist? → Create it!
└── Folder exists? → Continue to Step 2
## Completed Tasks
- [x] Login page
- [x] Auth integration
- [x] Form validation
STEP 2: Load these 3 files (MANDATORY)
├── .toh/memory/active.md
├── .toh/memory/summary.md
└── .toh/memory/decisions.md
## Notes
- พบ bug ใน Safari ต้องแก้ภายหลัง
STEP 3: Check if files have real data
├── Files empty/default? → ANALYZE PROJECT FIRST!
│ ├── Scan app/, components/, types/, stores/
│ ├── Update summary.md with what exists
│ └── Update active.md with current state
└── Files have data? → Continue working
STEP 4: Acknowledge context loaded
(Brief confirmation to user)
```
---
### AFTER Completing Any Work
## 🔄 Auto-Save Flow
```
STEP 1: Update active.md (ALWAYS!)
├── Current Focus → What was just done
├── In Progress → Mark completed items
├── Just Completed → Add what you finished
└── Next Steps → What should be done next
STEP 2: Update decisions.md (if decisions were made)
└── Add row: | Date | Decision | Reason |
STEP 3: Update summary.md (if feature completed)
└── Add to Completed Features list
STEP 4: Confirm to user
└── "Memory saved ✅"
```
┌─────────────────────────────────────────────────────────┐
│ Agent ทำงานเสร็จ (เช่น /toh:ui สร้าง component เสร็จ) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ 🔄 AUTO-SAVE TRIGGER │
│ │
│ 1. อัพเดท active.md │
│ - เพิ่มใน "Just Completed" │
│ - อัพเดท "Current Focus" │
│ - อัพเดท "Next Steps" │
│ │
│ 2. เพิ่มใน decisions.md (ถ้ามีการตัดสินใจใหม่) │
│ │
│ 3. ถ้า active.md ยาวเกิน 50 lines: │
│ - สรุปลง summary.md │
│ - ย้ายของเก่าไป archive/ │
│ │
│ 4. อัพเดท timestamp │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ ✅ Memory บันทึกแล้ว - User ไม่ต้องทำอะไร │
└─────────────────────────────────────────────────────────┘
```
---
## 🔄 Auto-Load Flow
## ⚠️ Critical Rules
```
┌─────────────────────────────────────────────────────────┐
│ User เริ่ม Session ใหม่ │
│ (เปิด Chat ใหม่ / เปลี่ยน IDE / เปลี่ยน Model) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ 🔄 AUTO-LOAD (เมื่อ User พิมพ์คำสั่ง /toh:*) │
│ │
│ 1. ตรวจสอบว่ามี .toh/memory/ หรือไม่ │
│ │
│ 2. ถ้ามี → โหลด: │
│ - active.md (งานปัจจุบัน) │
│ - summary.md (สรุปโปรเจค) │
│ - decisions.md (การตัดสินใจ) │
│ │
│ 3. AI เข้าใจ context ทันที (~2,000 tokens) │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ AI: "สวัสดีค่ะ! หนูจำได้ว่าเรากำลังทำ [active task] │
│ โปรเจคนี้เป็น [summary] จะทำต่อไหมคะ?" │
└─────────────────────────────────────────────────────────┘
```
1. **NEVER start work without loading memory first!**
2. **NEVER finish work without saving memory!**
3. **NEVER ask user "should I save memory?" - just do it automatically!**
4. **If memory files are empty but project has code → ANALYZE and populate first!**
5. **Memory files must ALWAYS be in English for consistency!**
---
## 📋 Memory Instructions for AI
## 🔧 Memory Commands
### เมื่อเริ่ม Session (Auto-Load)
| Command | Action |
|---------|--------|
| `/toh:memory` | Show current memory status |
| `/toh:memory save` | Force save all memory files |
| `/toh:memory load` | Force reload all memory files |
| `/toh:memory clear` | Archive and reset memory |
```
1. ตรวจสอบ .toh/memory/ folder
2. ถ้ามี → อ่านไฟล์ทั้ง 3 (active, summary, decisions)
3. ทำความเข้าใจ context
4. พร้อมทำงานต่อ
```
---
### เมื่อทำงานเสร็จ (Auto-Save)
## 💡 Best Practices
```
1. สรุปสิ่งที่ทำไป
2. อัพเดท active.md:
- ย้ายจาก "In Progress" → "Just Completed"
- อัพเดท "Next Steps"
3. ถ้ามีการตัดสินใจสำคัญ → เพิ่มใน decisions.md
4. ถ้า active.md ยาวเกิน → archive
5. อัพเดท timestamp
```
### For AI Agents
- Load memory at the START of every conversation
- Save memory at the END of every task
- Keep active.md focused (only current task)
- Archive old tasks when switching to new ones
### เมื่อต้องการข้อมูลเก่า
### For Users
- Trust the system - it works automatically
- Check `.toh/memory/` if something seems wrong
- Use `/toh:memory` to see current state
```
1. ดูใน archive/ folder
2. โหลดเฉพาะวันที่เกี่ยวข้อง
3. ไม่ต้องโหลดทั้งหมด
```
---
## 🎯 Key Principles
## 📊 Token Budget
1. **User ไม่ต้องทำอะไร** - ทุกอย่างอัตโนมัติ
2. **Context น้อย** - โหลดแค่ ~2,000 tokens
3. **IDE-agnostic** - ใช้ได้ทุก IDE
4. **Model-agnostic** - ย้าย model ได้
5. **Human-readable** - ไฟล์เป็น Markdown อ่านได้
| File | Max Tokens | Purpose |
|------|------------|---------|
| active.md | ~500 | Current task details |
| summary.md | ~1,000 | Project overview |
| decisions.md | ~500 | Key decisions log |
| **Total** | **~2,000** | Fits easily in context |
---
## 🔧 Technical Notes
## 🔗 Cross-IDE Compatibility
### Memory File Format: Markdown
- อ่านง่ายทั้ง AI และ Human
- Edit ด้วยมือได้ถ้าต้องการ
- Version control ได้ (git)
Memory system works identically across:
- ✅ Claude Code
- ✅ Cursor
- ✅ Gemini CLI / Google Antigravity
- ✅ Codex CLI
### Token Budget
| File | Max Lines | ~Tokens |
|------|-----------|---------|
| active.md | 30 | 500 |
| summary.md | 60 | 1,000 |
| decisions.md | 30 | 500 |
| **Total** | 120 | **2,000** |
### Archive Strategy
- เก็บ 7 วันล่าสุด
- เก่ากว่า 7 วัน → auto-delete (optional)
- หรือเก็บไว้ตลอด (default)
Same files, same format, same behavior!
# 🔥 Active Task
## Current Work
[ยังไม่มีงานที่กำลังทำ - เริ่มต้นด้วย /toh:vibe หรือ /toh:plan]
[No active task - Start with /toh:vibe or /toh:plan]
## Last Action
[ยังไม่มี]
[None yet]
## Next Steps
- เริ่มโปรเจคใหม่ด้วย `/toh:vibe`
- หรือวางแผนด้วย `/toh:plan`
- Start a new project with `/toh:vibe`
- Or plan with `/toh:plan`
## Blockers
[ไม่มี]
[None]
---
Updated: {{TIMESTAMP}}
# 🧠 Key Decisions
> บันทึกการตัดสินใจสำคัญของโปรเจค เพื่อให้ AI และ Developer เข้าใจเหตุผลเบื้องหลัง
> Record important project decisions so AI and developers understand the reasoning.

@@ -11,5 +11,5 @@ ---

|------|----------|--------|
| {{DATE}} | ใช้ Toh Framework | AI-Orchestration Driven Development |
| {{DATE}} | Use Toh Framework | AI-Orchestration Driven Development |
| {{DATE}} | Next.js 14 App Router | Server Components, Better Performance |
| {{DATE}} | Zustand สำหรับ State | Simple, No Boilerplate |
| {{DATE}} | Zustand for State | Simple, No Boilerplate |

@@ -16,0 +16,0 @@ ---

@@ -14,6 +14,6 @@ # 📋 Project Summary

## Completed Features
[ยังไม่มี]
[None yet]
## In Progress
[ยังไม่มี]
[None yet]

@@ -20,0 +20,0 @@ ## Project Structure