Conventions
Communication Rules
- Language: Thai first. Write in Thai as the primary language across KB and chat.
- English only when it fits better — use English for (a) loanwords/technical terms that read more naturally in English (e.g. schema, streak, invalidation, cache), or (b) words that are punchier / more fun in English (slang, goblin names, etc.). Mix freely: Thai sentence + English term where it lands harder.
- No Chinese characters anywhere.
- Concise, direct responses — under 4 lines when possible
- Use contractions (I'll, don't — หรือ 'ฉันจะ', 'ไม่ต้อง' ในภาษาไทย)
- No emojis unless explicitly asked
- Answer first, then act
- Skip intros ("I'll help you with...")
Startup Check
Before starting any task, check if ./TODOS.md exists in the current project root:
- If present, read and notify the user: "📋 Open TODOs: N items"
- Ask if they want to work on a TODO or proceed with the current request
- Record the session decision
Scope Budget
OKF ต้อง Maintain ขนาดให้เท่านี้ — ห้ามเกิน:
| ระดับ | ไฟล์ที่อนุญาต | จำนวนสูงสุด |
|---|---|---|
| ต่อ project | profile.md, agent.md, status.md | 3 ไฟล์ |
| system/ | conventions.md, glossary.md, personalities.md, sync-log.md | 4 ไฟล์ |
| root/ | index.md, SETUP.md, package.json | 3 ไฟล์ |
| รวม | ทั้งหมดใน ~/OKF/ ไม่รวม scripts/, skills/, plan/, templates/ | ไม่เกิน 35 ไฟล์ .md |
กฎเหล็ก:
- ห้ามเพิ่ม
commands.md,dependencies.md,structure.mdเข้าไปใน project — ทุกอย่างรวมอยู่ในprofile.md - ห้ามเพิ่ม system file ใหม่นอกเหนือจาก 4 ตัวที่มี — ถ้าต้องการ content ใหม่ ให้ merge ลงไฟล์ที่มีอยู่
- ห้ามเพิ่ม root .md ใหม่ —
index.mdคือ entry point เดียว - ถ้า project ไหนต้องการมากกว่า 3 ไฟล์ ให้ถาม user ก่อน
check scopetrigger จะตรวจสอบและแจ้งเตือนถ้าเกิน budget
Project Files
Each project has 2-3 files in ~/OKF/projects/<project>/:
| File | Type | Description |
|---|---|---|
profile.md | project-profile | Tech stack, architecture, dependencies, commands, structure |
agent.md | agent-profile | Agent personality, triggers, patterns, changelog |
status.md | project-status | Changelog, known issues, design decisions (optional) |
Universal Prompt
Copy this block into AI tool custom instructions / system prompt:
You have access to a shared knowledge base at ~/OKF/. Before any task:
- Read
~/OKF/index.md— project roster and global rules - Read
./AGENTS.mdin current project root — follow its## KBlinks - Read every file linked in that
## KBsection - Read
~/OKF/system/conventions.mdfor communication rules - Start working
Projects:
| Project | Profile | Agent | Status |
|---|---|---|---|
| data.mcky.space | profile | agent | status |
| habby | profile | agent | status |
| mcky.space | profile | agent | status |
| paper | profile | agent | status |
| collage | profile | agent | status |
| truck | profile | agent | status |
Shared: ~/OKF/system/conventions.md
Rules:
- No Chinese characters — Thai or English only
- Concise, direct answers (< 4 lines when possible)
- Read index.md + AGENTS.md + linked KB files before writing code
File Format
Project docs use OKF format — YAML frontmatter + Markdown body.
---
type: project-profile | agent-profile | project-status
id: <project>-profile | <project>-agent | <project>-status
project: <project-name>
last_updated: YYYY-MM-DD
status: active
---AGENTS.md Convention
Each project root may have AGENTS.md with 2 sections:
## KB— links to KB files in~/OKF/projects/<project>/## Local— project-specific notes (env files, setup tricks)
Plan Workflow
For multi-step tasks:
- Create
~/OKF/plan/<todo-name>.md— YAML frontmatter (id, version, status, created, updated) + goal, steps (checkboxes), files, verification - Run
cd ~/kb.mcky.space && node scripts/build-site.cjs— copies plan files to Starlight content - Execute — use opencode's todowrite for in-session progress tracking
- Update plan.md at milestones — commit each update (git history = version log)
- Persist — plans stay in
plan/directory after completion - Name — one file per task, named after the todo (kebab-case)
---
id: plan-my-task
version: 1
status: in_progress
created: 2026-07-09
updated: 2026-07-09
---
# Plan: My TaskCheck Scope
ตรวจสอบว่า OKF ยังอยู่ใน Scope Budget หรือไม่:
- นับ
.mdfiles ในprojects/— ห้ามเกิน 3 ไฟล์ต่อ project - นับ
.mdfiles ในsystem/— ห้ามเกิน 5 ไฟล์ - นับ
.mdfiles ที่ root — ห้ามเกิน 3 ไฟล์ - รวมทั้งหมดต้องไม่เกิน 35
.mdfiles - ถ้าเกิน: แจ้ง user พร้อมรายการไฟล์ที่ควร merge หรือลบ
Node.js Setup (Termux)
| Tool | Command |
|---|---|
| Node version | v22.14.0 (ARM64, /usr/local/node-v22.14.0-linux-arm64/) |
| Run dev | Use node directly (shebang unavailable) |
| Vite | node node_modules/vite/bin/vite.js build |
| ESLint | node node_modules/.bin/eslint src/ |
| Vitest | node node_modules/.bin/vitest run |
| Next.js dev | npx next dev -H localhost |
| npm | Works normally |
| Supabase CLI | Not available on Termux (CI only) |
| cwebp | Available — cwebp -q 80 input.jpg -o output.webp |
| sharp / ffmpeg | Not available |
Git Rules
- Project code (~/truck/, etc.) — follow project conventions
Deployment Rules
| What changes | Action |
|---|---|
| KB files (projects/, system/) | Edit locally, push when asked |
การเข้าถึง KB
KB ถูก maintain โดยการอ่านและเขียนไฟล์ .md โดยตรง — source of truth คือไฟล์ markdown ไม่มี tooling layer คั่นกลาง
OpenCode Permissions
External directories allowed:
~/OKF/**~/truck/**~/mcky.space/**~/habby/**~/collage/**~/data.mcky.space/**~/paper/**
Build Site
cd ~/kb.mcky.space && npm run sync— pull latest content from~/OKF/git add -A && git commit -m "docs: update KB" && git push- Vercel auto-deploys from GitHub (
ktypez/kb.mcky.space)
Or just say "build site" to trigger this workflow.
Note: generate must be run locally before push since content lives in ~/OKF/ (not in git).
KB Sync
สั่ง "sync kb" หรือ "refresh kb" หรือ "update kb" เมื่อต้องการให้ตรวจสอบและอัปเดตฐานความรู้ทั้งหมดให้ตรงกับสถานะปัจจุบันของทุกโปรเจกต์
ขั้นตอนที่จะดำเนินการ:
- อ่าน
package.jsonและไฟล์ config ของทุกโปรเจกต์ - เปรียบเทียบกับข้อมูลปัจจุบันใน
~/OKF/projects/*/ - อัปเดต
profile.md,status.md,agent.mdตามสภาพจริง - ตรวจสอบสถานะโปรเจกต์ (active/archived)
- commit + push การเปลี่ยนแปลง
- commit + push การเปลี่ยนแปลง — Vercel auto-deploys
คำที่ใช้ได้: "sync kb", "refresh kb", "update kb", "อัปเดต kb", "ทำให้ kb ทันสมัย"