One audit, three workstreams, shipped to productionMột lần rà soát, ba luồng công việc, đã lên production
A three-agent audit of the VietConnect app and the TradeWithViet content-automation skills turned into 13 verified commits: type-safety restored, a fragmented UI unified into one premium design system, and the TWV publishing rails collapsed from seven to one with a slot-lock that prevents double-posts. Merged to main and deployed live.Một lần rà soát bằng ba agent trên app VietConnect và bộ kỹ năng tự động hóa nội dung TradeWithViet đã thành 13 commit đã kiểm chứng: khôi phục type-safety, gom giao diện rời rạc thành một hệ thiết kế cao cấp thống nhất, và rút các đường xuất bản của TWV từ bảy xuống một, kèm khóa khung giờ chống đăng trùng. Đã merge vào main và deploy live.
6-layer thinking chainChuỗi tư duy 6 tầng
"Review my website codebase and the TWV skills to see what to upgrade, make more efficient, and more premium." Later: "push and deploy live.""Rà soát codebase website và các kỹ năng TWV xem có thể nâng cấp, hiệu quả hơn, giao diện cao cấp hơn." Sau đó: "push và deploy live."
- Next.js 16 and Tailwind v4 differ from training-data conventions (no tailwind.config; tokens live in globals.css).
- The database type file is hand-maintained, not generated.
- The EN/VI i18n parity gate must stay at 100%.
- TWV skills live outside the repo (gitignored) and the WordPress site is live, so no experiments there.
- Buffer is on the FREE plan; no OAuth possible in a headless session.
- Next.js 16 và Tailwind v4 khác với quy ước trong dữ liệu huấn luyện (không có tailwind.config; token nằm trong globals.css).
- Tệp kiểu dữ liệu (database types) được bảo trì tay, không phải sinh tự động.
- Cổng kiểm tra đồng bộ i18n EN/VI phải giữ 100%.
- Kỹ năng TWV nằm ngoài repo (gitignore) và trang WordPress đang chạy thật, nên không thử nghiệm ở đó.
- Buffer đang ở gói MIỄN PHÍ; không thể chạy OAuth trong phiên không tương tác.
- Do everything inline, in order — simplest to follow, but slow and it buries root causes.
- One big-bang PR — fast to open, but unreviewable and risky to deploy.
- Audit-first with parallel agents, then phase-by-phase shippable commits (chosen) — more coordination up front, but each change is small, independent, and verifiable.
- Only surface fixes — cheap, but leaves the type-safety and double-post problems intact.
- Làm tuần tự từng việc — dễ theo dõi nhất, nhưng chậm và che mất nguyên nhân gốc.
- Một PR gộp tất cả — mở nhanh, nhưng không review nổi và rủi ro khi deploy.
- Rà soát trước bằng agent song song, rồi commit theo từng pha ship được (đã chọn) — tốn phối hợp lúc đầu, nhưng mỗi thay đổi nhỏ, độc lập, kiểm chứng được.
- Chỉ vá bề mặt — rẻ, nhưng để nguyên vấn đề type-safety và đăng trùng.
How the work was organizedCách tổ chức công việc
The session ran as a fan-out: audit agents produced findings, plan agents turned findings into phased plans, and execution agents applied the plans on non-overlapping files so they could run at the same time without colliding.Phiên làm việc chạy theo mô hình tỏa nhánh: agent rà soát tạo ra phát hiện, agent kế hoạch biến phát hiện thành kế hoạch theo pha, và agent thực thi áp kế hoạch lên các tệp không chồng lấn nên chạy đồng thời mà không xung đột.
| Technical termThuật ngữ kỹ thuật | Plain nameTên dễ hiểu | RoleVai trò |
|---|---|---|
Explore agents ×3 | Read-only auditorsNgười rà soát chỉ-đọc | Codebase health, UI premium-ness, TWV skill ecosystem — each returned a findings report, none edited code.Sức khỏe codebase, độ cao cấp giao diện, hệ kỹ năng TWV — mỗi bên trả về báo cáo phát hiện, không sửa code. |
Plan agents ×2 | Design plannersNgười lập kế hoạch | Turned the UI and TWV findings into phased, independently-shippable plans with locked decisions.Biến phát hiện UI và TWV thành kế hoạch theo pha, ship được độc lập, với các quyết định đã chốt. |
Execution agents | ImplementersNgười thực thi | Applied token migrations, type fixes, slot-lock rail, skill reconciliation — each on a disjoint file set, run in parallel.Áp di trú token, sửa kiểu, đường khóa khung giờ, hòa giải kỹ năng — mỗi bên trên nhóm tệp tách rời, chạy song song. |
lint:colors gate | Color guardCổng gác màu | A grep script that fails the build if any raw palette class (zinc/gray/indigo/teal…) reappears outside the pitch deck.Một script grep làm hỏng build nếu bất kỳ class màu thô (zinc/gray/indigo/teal…) tái xuất ngoài bộ slide pitch. |
Read it in 30 seconds: audits map the terrain, plans choose the route, implementers walk disjoint paths at once, and gates (type-check, tests, color-guard) confirm each step before the next.
Đọc trong 30 giây: rà soát vẽ địa hình, kế hoạch chọn đường, người thực thi đi các lối tách rời cùng lúc, và các cổng (kiểm kiểu, test, gác màu) xác nhận từng bước trước khi sang bước sau.
What ran, in orderĐã chạy theo thứ tự
Layered decision cardsCác quyết định theo tầng
Artifact mapBản đồ tệp tạo ra
| PathĐường dẫn | WhatLà gì | Who reads itAi dùng |
|---|---|---|
src/app/globals.css | Single design-token source: primary/wine/gold/success ramps, elevation + motion tokens, heading font ruleNguồn token thiết kế duy nhất: dải primary/wine/gold/success, token độ nổi + chuyển động, quy tắc font tiêu đề | Every componentMọi component |
src/types/database.ts | Types + Relationships + 6 tables + 8 RPCs — the fix that killed all 19 'as any' castsKiểu + Relationships + 6 bảng + 8 RPC — bản sửa xóa hết 19 ép kiểu 'as any' | Every Supabase queryMọi truy vấn Supabase |
src/middleware.ts | Reuses session user for the dashboard guard; excludes sitemap/robots from intl routingTái dùng phiên người dùng cho chốt dashboard; loại sitemap/robots khỏi định tuyến i18n | Every requestMọi request |
src/app/[locale]/(auth)/forgot-password + reset-password | New password-reset flow (login linked a dead route)Luồng đặt lại mật khẩu mới (login trỏ vào route chết) | Users who forgot their passwordNgười dùng quên mật khẩu |
src/components/suppliers/tier-config.ts | Shared tier colors (diamond=wine, verified=success, standard=gold) replacing 3 duplicated mapsMàu hạng dùng chung (diamond=wine, verified=success, standard=gold) thay 3 bản trùng lặp | Supplier card + profileThẻ + hồ sơ nhà cung cấp |
scripts/twv-automation/twv_config.py | Single config source: channel map, capacity, timing, slot-keyNguồn cấu hình duy nhất: bản đồ kênh, sức chứa, giờ, khóa khung giờ | All TWV publishingToàn bộ xuất bản TWV |
scripts/twv-automation/wp_twv.py | queue_buffer_safe() slot-lock — the one sanctioned Buffer railqueue_buffer_safe() khóa khung giờ — đường Buffer được phép duy nhất | Every scheduled TWV postMọi bài TWV đã lên lịch |
scripts/twv-automation/README.md | Inventory mapping each surviving script to its owning skill + the no-one-shots ruleBản kiểm kê ánh xạ mỗi script còn lại tới kỹ năng sở hữu + quy tắc cấm one-shot | Future maintenanceBảo trì về sau |
docs/decisions.md | Appended the 2026-07-02 upgrade decisions so they are never re-litigatedGhi thêm các quyết định nâng cấp 2026-07-02 để không phải bàn lại | Every future sessionMọi phiên sau này |
- Stripe price IDs are still placeholders — revenue stays blocked until you create real products in the Stripe Dashboard and paste their price IDs into src/lib/stripe/products.ts. This is the single highest-value remaining task.ID giá Stripe vẫn là chỗ giữ chỗ — doanh thu còn bị chặn cho tới khi bạn tạo sản phẩm thật trong Stripe Dashboard và dán ID giá vào src/lib/stripe/products.ts. Đây là việc còn lại có giá trị cao nhất.
- To make the Vercel Preview check green on future PRs, add NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY to the Preview environment in Vercel project settings (Production already has them).Để cổng Vercel Preview xanh ở các PR sau, thêm NEXT_PUBLIC_SUPABASE_URL và NEXT_PUBLIC_SUPABASE_ANON_KEY vào môi trường Preview trong cài đặt project Vercel (Production đã có sẵn).
- The daily clip-drip launchd job was retired (its schedule had expired). A clean daily template sits at ~/Library/LaunchAgents/archive-twv/com.twv.clip-drip.plist.new-template — copy it back and bootstrap it only when you have fresh clips queued; it is now slot-locked and QA-gated.Tác vụ clip-drip hằng ngày đã gỡ (lịch của nó hết hạn). Một mẫu daily sạch nằm ở ~/Library/LaunchAgents/archive-twv/com.twv.clip-drip.plist.new-template — copy lại và bootstrap chỉ khi bạn có clip mới trong hàng đợi; nó nay đã có khóa khung giờ và cổng QA.
- Archive oneshot-tariff-long-jul3.py after July 3 once its Facebook post is confirmed live.Lưu trữ oneshot-tariff-long-jul3.py sau ngày 3/7 khi bài Facebook của nó đã xác nhận live.