Rà soát Công cụ Có sẵn — Tools Inventory
Rà soát Công cụ Có sẵn — Tools Inventory
v1.2 | 2026-03-10 S109 — 111 DOT tools (108 registered, 3 orphan). DOT Việt hoá 18 categories. +dot-duplicate-engine (kế hoạch, Luật v1.2). +dot-registry-crosscheck v3 (kiểm chứng ngược). +dot-layer-integrity-audit v2 (check mô tả). +dot-registry-baseline-set. +dot-update-tool-categories-vn. Rà soát những gì Directus, Nuxt, Langroid, Agency OS, nguồn mở ĐÃ CÓ để tận dụng tối đa.
search_knowledge("tools inventory công cụ có sẵn")
NGUYÊN TẮC: TẬN DỤNG TRƯỚC, XÂY SAU
Trước khi xây bất cứ thứ gì → kiểm tra 4 nguồn theo thứ tự:
- Directus built-in (system collections, APIs, Flows, hooks)
- Nuxt/Agency OS built-in (modules, composables, UI components)
- Nguồn mở bên ngoài (npm packages, Directus extensions, tools)
- Code mới (CHỈ KHI 1-3 không giải quyết được)
1. DIRECTUS — CÁI GÌ ĐÃ CÓ SẴN
1.1 Registry System (Directus = Registry Engine bẩm sinh)
Directus BẢN CHẤT đã là 1 metadata registry engine. Mỗi collection, field, relation đều có metadata record.
| Directus system collection | Chức năng | Có sẵn |
|---|---|---|
directus_collections |
Registry TẤT CẢ collections + metadata (note, icon, group, color, singleton, translations) | ✅ |
directus_fields |
Registry TẤT CẢ fields + metadata (note, interface, display, options, sort, group, translations, validations) | ✅ |
directus_relations |
Registry TẤT CẢ relationships | ✅ |
directus_permissions |
Registry TẤT CẢ access control rules | ✅ |
directus_flows |
Registry TẤT CẢ automation flows | ✅ |
directus_operations |
Registry TẤT CẢ flow operations | ✅ |
directus_activity |
Audit log TẤT CẢ actions | ✅ |
directus_revisions |
Version history TẤT CẢ item changes | ✅ |
Phát hiện quan trọng: Directus ĐÃ CÓ registry cho database entities. Vấn đề: chúng ta KHÔNG KHAI THÁC.
Cụ thể thiếu gì:
meta.notetrên collections và fields: ✅ ĐÃ ĐIỀN 100% (PHASE1-FILL PR #450). Coverage: 100% fields, 100% collection notes.meta.grouptrên collections: ✅ ĐÃ TỔ CHỨC 86.8% (PHASE1-FILL). 14 ungrouped = top-level parents.- Field
note: ✅ ĐÃ ĐIỀN 100% — Vietnamese descriptions cho 695 fields. - Field
translations: Hỗ trợ đa ngôn ngữ cho field names. ĐÃ CÓ. KHÔNG DÙNG. - Content Versioning: Theo dõi thay đổi nội dung. ĐÃ CÓ.
KẾT LUẬN: ✅ Metadata cơ bản ĐÃ HOÀN THÀNH 100% (PHASE1-FILL). Không còn fields/collections trống note. Tiếp theo: tạo registry collections cho thực thể chưa có (DOT tools, pages, collections, agents) → REGISTRY-ENGINE mission.
1.2 Automation (Directus Flows)
| Khả năng | Trạng thái | Giới hạn |
|---|---|---|
| Event trigger (item create/update/delete) | ✅ Có | Không CRUD cùng collection với trigger |
| Schedule trigger (cron) | ✅ Có | |
| Webhook trigger | ✅ Có | |
| Send notification | ✅ Có | |
| Send webhook | ✅ Có | |
| Run script (JavaScript) | ✅ Có | Sandbox, limited APIs |
| Condition logic | ✅ Có | |
| Loop/iteration | ❌ KHÔNG | Cần external service |
Dùng cho: Tầng 5 (giám sát) — khi collection thay đổi → trigger kiểm tra → cảnh báo. Nhưng giới hạn: không loop, không CRUD cùng collection.
1.3 Directus APIs đã có
| API | Dùng cho |
|---|---|
/collections |
Quản lý collections (CRUD) — ADMIN ONLY |
/fields |
Quản lý fields (CRUD) — ADMIN ONLY |
/fields/:collection |
List fields của 1 collection |
/relations |
Quản lý relationships |
/schema/snapshot |
Export TOÀN BỘ schema (JSON) — rất hữu ích cho audit |
/schema/diff |
So sánh schema hiện tại với snapshot — phát hiện drift |
/schema/apply |
Áp dụng schema changes — migration |
/activity |
Audit log |
/revisions |
Version history |
/server/info |
Server info + health |
Phát hiện: /schema/snapshot + /schema/diff = công cụ phát hiện schema drift có sẵn. ✅ ĐÃ KHAI THÁC — DOT tools dot-schema-snapshot + dot-schema-diff (PR #449).
1.4 Directus Extensions ecosystem
| Extension type | Dùng cho | Có sẵn |
|---|---|---|
| Hooks | Chạy code khi event xảy ra (không giới hạn như Flows) | ✅ Có thể tự viết |
| Endpoints | Custom API routes trong Directus | ✅ Có thể tự viết |
| Modules | Custom pages trong Directus Admin UI | ✅ Có thể tự viết |
| Interfaces | Custom field inputs | ✅ |
| Displays | Custom field displays | ✅ |
| Panels | Dashboard widgets | ✅ |
Quan trọng: Directus Hooks = giải pháp cho giới hạn Flows. Hook có thể chạy arbitrary code (bao gồm loop, CRUD bất kỳ collection) khi event xảy ra.
2. NUXT / AGENCY OS — CÁI GÌ ĐÃ CÓ
2.1 Nuxt UI v2.22.3
23 components đang dùng, ~15+ chưa dùng. Đã inventory trong Assembly SSOT.
2.2 Agency OS Template
| Feature | Trạng thái | Khai thác |
|---|---|---|
| Portal pages (projects, tasks, invoices) | ✅ Có | Dùng làm mẫu cho knowledge pages |
| Auth + SSO | ✅ Có | Chưa cần |
| Layout system (sidebar, header, content) | ✅ Có | Đang dùng |
| Composables (useDirectus, useAsyncData) | ✅ Có | Đang dùng |
| SEO + sitemap | ✅ Có | Đang dùng |
2.3 Nuxt Modules ecosystem
| Module | Dùng cho | Trạng thái |
|---|---|---|
| @nuxt/content | File-based CMS | Không cần (dùng Directus) |
| @nuxtjs/i18n | Đa ngôn ngữ UI | Chưa cài, CẦN cho Vietnamese labels |
| @vueuse/nuxt | Utility composables | Chưa cài, HỮU ÍCH |
3. AGENT DATA / LANGROID — CÁI GÌ ĐÃ CÓ
| Feature | Trạng thái | Khai thác |
|---|---|---|
| Document CRUD | ✅ | Đang dùng cho SSOT |
| Vector search (RAG) | ✅ | Đang dùng |
| Event system (webhooks → Directus sync) | ✅ | Đang dùng |
| Batch read | ✅ | Đang dùng |
| Patch document | ✅ | Đang dùng |
| Audit sync (/kb/audit-sync) | ✅ | Đang dùng |
4. NGUỒN MỞ BÊN NGOÀI CẦN XEM XÉT
4.1 Cho Tầng 2 (Registry + Metadata)
| Tool | Mục đích | Đánh giá |
|---|---|---|
| Directus schema/snapshot API | Export/diff/apply schema — phát hiện drift | ★★★ ĐÃ CÓ SẴN, chỉ cần DÙNG |
| Directus Hooks extension | Entity lifecycle enforcement — chặn tạo không qua quy trình | ★★★ Cần viết |
| Directus Tags interface | Gắn tags cho items (classification) | ★★ Đã có sẵn trong Directus |
4.2 Cho Tầng 5 (Giám sát)
| Tool | Mục đích | Đánh giá |
|---|---|---|
| Directus Flows (cron) | Chạy kiểm tra định kỳ | ★★★ Đã có |
| Directus Hooks | Realtime enforcement — chặn ngay khi vi phạm | ★★★ Cần viết |
| Prefect | Orchestration cho complex workflows | ★★ Planned, chưa triển khai |
4.3 Cho batch metadata
| Tool | Mục đích | Đánh giá |
|---|---|---|
Directus /fields API |
Batch update field notes/metadata | ★★★ Đã có, qua DOT script |
/schema/snapshot |
Export toàn bộ → phân tích → tìm fields thiếu note | ★★★ |
DOT script mới: dot-metadata-audit |
Quét all fields → báo cáo coverage % | ✅ ĐÃ TẠO (PR #449) |
DOT script: dot-metadata-fill |
Bulk fill Vietnamese metadata cho collections/fields. 695 fields, 38 collections filled. | ✅ ĐÃ TẠO (PR #450) |
5. GAP ANALYSIS — THIẾU GÌ THỰC SỰ
KHÔNG cần tạo mới (chỉ cần KHAI THÁC):
- Collection/field metadata → Directus
meta.note,meta.group,translationsĐÃ CÓ - Schema audit →
/schema/snapshot+/schema/diffĐÃ CÓ - Activity log →
directus_activityĐÃ CÓ - Version history →
directus_revisionsĐÃ CÓ - Field grouping → Directus field groups ĐÃ CÓ
- Config versioning →
directus_revisionsĐÃ CÓ (GPT đề xuất xây mới — KHÔNG CẦN) - Event bus → Directus Flows + Hooks + Agent Data Events ĐỦ (GPT đề xuất xây mới — KHÔNG CẦN)
- UI layouts registry → Nuxt layout system + Agency OS ĐÃ CÓ (GPT đề xuất — KHÔNG CẦN)
CẦN tạo mới:
collection_registry— meta-layer: phân loại collections (core/module/data), owner, status vòng đời, tầng kiến trúc → REGISTRY-ENGINE Mission 1ui_tables→ ✅ ĐÃ TẠO (table_registry PR #445, 8 records)ui_pages— registry routes/pages → REGISTRY-ENGINE Mission 1— đợi khi cầnui_componentsdot_tools— registry DOT tools (thay markdown file) → REGISTRY-ENGINE Mission 1— đợi khi cầnapi_endpointsentity_dependencies— dependency graph → Phase 2-3schema_change_requests— schema governance → Phase 2-3— đợi khi cầnevent_registry- Directus Hook extension — entity lifecycle enforcement → Phase 2-3
- DOT:
dot-metadata-audit— ✅ ĐÃ TẠO (PR #449) - DOT:
dot-metadata-fill— ✅ ĐÃ TẠO (PR #450) - DOT:
dot-schema-snapshot— ✅ ĐÃ TẠO (PR #449) - DOT:
dot-schema-diff— ✅ ĐÃ TẠO (PR #449) - DOT:
dot-entity-create— script chuẩn tạo entity mới → REGISTRY-ENGINE - DOT:
dot-registry-diff— quét toàn bộ, phát hiện lệch → REGISTRY-ENGINE Mission 3 - meta_catalog → ✅ ĐÃ TẠO (S105, 11 records)
agents— registry agents → REGISTRY-ENGINE Mission 1- Cron job / Directus Flow — auto-count, auto-ID → REGISTRY-ENGINE Mission 2
TỔNG KẾT (cập nhật S106 — Phase 2 bắt đầu):
- 70% nhu cầu = ĐÃ KHAI THÁC Directus (note ✅ 100%, group ✅ 86.8%, schema snapshot ✅, audit ✅, 13 auto-ID flows ✅)
- 20% = ĐÃ TẠO registry collections — 13 entries trong meta_catalog, 248+ items populated, 3-layer UI
- 10% = CẦN LÀM TIẾP — Orphan Scanner (TD-094), Duplicate Engine (TD-083), dot-catalog-sync auto (TD-085)
DOT tools cốt lõi S106: dot-schema-snapshot, dot-schema-diff, dot-metadata-audit, dot-metadata-fill, dot-registry-diff, dot-registry-populate, dot-flow-setup-auto-id, dot-schema-registry-collections-ensure, dot-schema-checkpoint-node-identity.
Công cụ nguồn mở đánh giá:
- Ansible — ★★★ cho VPS migration (TD-092). Industry standard. Playbook trong Git.
- n8n — ★★ cho workflow orchestration Phase 3+. Self-hostable. CHƯA CẦN ngay.
- Grafana/Prometheus — ❌ quá nặng. Nuxt + meta_catalog đủ cho monitoring.
- Apache Atlas/DataHub — ❌ quá nặng. Directus IS registry engine.
Đồ sẵn có cho Orphan Scanner: Directus API (list_collections, get_items) + bash (ls, find, grep) + Agent Data API (upload report) = ĐỦ. Không cần tool bên ngoài.