Chuyển tới nội dung chính

Tools Index

AI Agent Instructions

Vai trò của thư mục này: /tools/ chứa toàn bộ automation scripts của RAC. Các script viết bằng Python standard library (zero-dependency) để có thể chạy trong bất kỳ CI runner container nào.

Kiến trúc shared library:

  • /tools/lib/frontmatter.py — Shared parser cho YAML frontmatter và simple YAML. Tất cả tools đều import module này.
  • Mỗi tool nằm trong sub-directory riêng với một index.md mô tả chi tiết usage.

Mapping tool → CI stage:

ToolCI StageTriggerMô tả
validate.pyvalidateMọi branch push và MR eventPass 1: schema/field validation. Pass 2: broken link check.
generate_pir.pyreport-generationincident/* branch (manual trigger)Đọc scratchpad.json → sinh PIR draft qua self-hosted LLM.
drift_analyzer.pyreview-automationNightly schedule trên mainScan expired docs, phân tích git drift, output review report.
schema_migrate.py(manual)Chạy thủ công khi bump schema versionBulk-update frontmatter khi profile.yaml thay đổi major version.

Environment variables quan trọng:

OKF_LLM_BASE_URL — URL endpoint của self-hosted LLM (OpenAI-compatible API)
OKF_LLM_MODEL — Model ID để generate PIR content

Sub-directories

Tool DirectoryScriptMô tả
/tools/validate/index.mdvalidate.pySchema + semantic link validator
/tools/report/index.mdgenerate_pir.pyAI PIR generator với LLM integration
/tools/review/index.mddrift_analyzer.pyExpired document drift analyzer
/tools/migrate/index.mdschema_migrate.pySchema version migration tool
/tools/docusaurus/index.md(website/)Docusaurus v3 static site — plugins, CI/CD, Cloudflare Pages
X

Graph View