Logo TRIP Compact

TRIP Compact

Cộng đồng
PiLastDigit
TRIP-compact

Rút gọn ARCHI.md khi tệp vượt quá dung lượng khuyến nghị: nén thông minh mà vẫn giữ nội dung liên quan. Dùng --sync để kiểm tra ARCHI.md đối chiếu với mã nguồn.

Add to TypingMind

Tổng quan

Nhà phát hànhPiLastDigit
Kho mãTRIP-workflow
Tên kỹ năngTRIP-compact
Sao
636
Bản fork
91
Tệp đi kèm
1
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được PiLastDigit công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI TRIP Compact trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/PiLastDigit/TRIP-workflow/tree/master/skills/TRIP-compact
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PiLastDigit/TRIP-workflow.git /tmp/TRIP-workflow
mkdir -p .claude/skills
cp -r /tmp/TRIP-workflow/skills/TRIP-compact .claude/skills/TRIP-compact
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật TRIP Compact trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp TRIP Compact ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng TRIP Compact với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

ARCHI Compaction Mode

You are now in compaction mode - intelligently reducing ARCHI.md size while preserving its value.

Why Compact?

ARCHI.md should not exceed ~20k tokens. A bloated ARCHI:

  • Consumes tokens that could be used for actual work
  • Slows down every command that reads it
  • May contain redundant or outdated information
  • Defeats the purpose of "balanced detail vs token usage"

Your Task

Compact: @docs/ARCHI.md

If $ARGUMENTS contains --sync: run only the Sync Audit below, then stop. Otherwise run the Sync Audit first (a stale claim is bloat too), then Steps 1–6.


Sync Audit: ARCHI vs codebase

ARCHI.md is only useful while it is true. TRIP-3 verifies the sections each release touches; this audit covers the whole document and catches what accumulated in between.

Method — one section (##) at a time, cheapest check that settles each claim:

  1. List the section's concrete claims: paths, commands, routes, tables and columns, env vars, named flow steps. Skip prose about intent or rationale — it cannot drift.
  2. Verify each with ls, grep -n, or a manifest lookup (package.json scripts, Cargo.toml, CMake targets…). Read a source file only when a claim describes a flow and a grep cannot settle it. Never read a file to confirm something ls already answered.
  3. Record every mismatch as: section · claim · reality · proposed fix. Missing coverage counts too: a top-level directory or route module present in the tree but absent from ARCHI.

Report the table (or "no drift found"), then use the AskUserQuestion tool:

  • Question: "ARCHI drift audit: [N] claims checked, [M] stale, [K] gaps. Apply the proposed fixes?"
  • Options: "Apply all" (edit ARCHI.md, following docs/ARCHI-rules.md), "Let me pick" (user lists the rows to apply), "Report only" (stop here)

In --sync mode, stop after applying. Otherwise continue to Step 1 with the corrected file.


Step 1: Assess Current State

First, measure the actual token count using the bundled script:

bash
bash .claude/skills/TRIP-compact/count-tokens.sh docs/ARCHI.md

Then read the full ARCHI.md and evaluate:

  1. Identify bloat sources:
    • Verbose explanations where concise would suffice
    • Redundant information repeated across sections
    • Implementation details that belong in code comments, not architecture docs
    • Overly detailed file listings
    • Excessive examples

If token count > 20,000, report the assessment to the user, then use the AskUserQuestion tool:

  • Question: "ARCHI.md is at ~[X] tokens (target: ~10,000-15,000). Main bloat sources: [list top 3-5]. Proceed with compaction?"
  • Options: "Yes, compact" (proceed with compaction strategies), "No, leave as-is" (stop here)

If token count <= 20,000, report to the user, then use the AskUserQuestion tool:

  • Question: "ARCHI.md is at ~[X] tokens — within acceptable range. Would you still like to compact it further?"
  • Options: "Yes, compact anyway" (proceed with compaction), "No, it's fine" (stop here)

If "No" in either case, stop here.


Step 2: Compaction Strategies

Apply these strategies in order of priority:

2.1 Remove Redundancy (First Pass)

  • Eliminate repeated information across sections
  • Consolidate overlapping descriptions
  • Remove "see above" or "as mentioned" patterns - restructure instead

2.2 Increase Information Density

Transform verbose patterns into dense ones:

Before (verbose):

markdown
## Authentication System

The authentication system in this project uses Supabase for managing user
authentication. When a user logs in, the system calls the Supabase auth API
to verify their credentials. After successful authentication, a session is
created and stored. The session token is then used for subsequent API calls
to authenticate the user. We also support role-based access control where
users can have either an ADMIN role or a USER role, which determines what
actions they can perform in the application.

After (dense):

markdown
## Authentication

**Provider**: Supabase Auth
**Flow**: Login → Supabase API → Session created → Token for subsequent calls
**RBAC**: `ADMIN` (full access) | `USER` (read-only library, settings)

2.3 Convert Prose to Structured Formats

  • Use tables instead of paragraphs for comparisons
  • Use bullet points instead of sentences
  • Use code for paths, commands, types
  • Use diagrams (mermaid) to replace lengthy flow descriptions

2.4 Collapse Implementation Details

Keep: What and Why Remove: How (implementation specifics)

Before:

markdown
The useTranscription hook manages the transcription state by using useState
for the segments array, useEffect to fetch data when videoId changes, and
useCallback for memoized handlers. It also implements error boundaries...

After:

markdown
`useTranscription`: Orchestrates transcription data fetching and state management

2.5 Summarize File Listings

Before:

markdown
- `src/components/auth/LoginForm.tsx` - Login form component
- `src/components/auth/LogoutButton.tsx` - Logout button component
- `src/components/auth/RegisterForm.tsx` - Registration form component
- `src/components/auth/ForgotPassword.tsx` - Password reset component
- `src/components/auth/AuthProvider.tsx` - Auth context provider

After:

markdown
- `src/components/auth/` - Auth UI components (Login, Logout, Register, ForgotPassword, AuthProvider)

2.6 Use References Instead of Duplication

Instead of explaining the same pattern in multiple places:

markdown
See [Pattern Name](#pattern-name) for details.

Step 3: Preserve Critical Information

NEVER compress or remove:

  • Project overview and purpose
  • Technology stack with versions
  • Directory structure (can be summarized but not removed)
  • Core architectural principles
  • Key patterns and their locations
  • Data flow diagrams
  • API contracts/interfaces
  • Configuration requirements
  • Build/deployment commands

These are the backbone - compress everything else first.


Step 4: Validate Compression

After compaction, verify:

  • All major sections still present
  • Technology stack complete
  • Directory structure understandable
  • Key patterns still documented
  • No broken internal links
  • Mermaid diagrams still valid
  • New developer could still onboard with this doc

Step 5: Measure & Present Changes

Run the script again on the compacted file:

bash
bash .claude/skills/TRIP-compact/count-tokens.sh docs/ARCHI.md

Present the compaction results to the user, then use the AskUserQuestion tool:

  • Question: "Compaction complete: ~[X] → ~[Y] tokens ([Z]% reduction). Changes: [brief summary]. How does the compacted ARCHI.md look?"
  • Options: "Looks good" (compaction is complete), "Restore some detail" (specific sections need more detail), "Too aggressive" (undo and try lighter compaction)

Step 6: Iterate if Needed

If user identifies sections that need more detail:

  • Restore specific details for those sections
  • Compensate by further compressing less critical sections

If still over 15k tokens after smart compression:

  • Consider splitting into ARCHI.md (core) + ARCHI-detailed.md (deep dives)
  • Only the core file is read by default

Compaction Principles

  1. Density over length - Same information, fewer words
  2. Structure over prose - Tables, bullets, code blocks
  3. References over repetition - Link, don't duplicate
  4. What/Why over How - Architecture, not implementation
  5. Current over historical - Remove obsolete content
  6. Essential over comprehensive - 80/20 rule applies

When to Run This Skill

  • --sync every few months, or the first time the agent guesses a path that ARCHI.md describes wrongly
  • ARCHI.md feels sluggish to read
  • You notice redundant information
  • Periodically (every few months) as maintenance
  • When token usage becomes a concern

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI TRIP Compact làm được gì?

Rút gọn ARCHI.md khi tệp vượt quá dung lượng khuyến nghị: nén thông minh mà vẫn giữ nội dung liên quan. Dùng --sync để kiểm tra ARCHI.md đối chiếu với mã nguồn.

Vì sao nên dùng TRIP Compact trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. TRIP Compact là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài TRIP Compact trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/PiLastDigit/TRIP-workflow/tree/master/skills/TRIP-compact. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng TRIP Compact?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng TRIP Compact với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng TRIP Compact với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI TRIP Compact có miễn phí không?

Kỹ năng này được PiLastDigit phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇