lat-md
Skill này làm gì
Skill giải thích cách viết các file tài liệu lat.md, mô tả thiết kế, quy tắc và kiểm thử của dự án theo một định dạng cố định. Skill dành cho người giữ ghi chú dự án có cấu trúc để code có thể trỏ ngược về.
Khi nào nên dùng
- ✓Khi bạn cần tạo một mục mới trong thư mục lat.md của dự án.
- ✓Khi bạn đang sửa các file lat.md có sẵn và cần cấu trúc đúng.
- ✓Khi bạn muốn kiểm tra xem ghi chú lat.md có tuân theo các quy tắc bắt buộc không.
Liên kết skill
https://github.com/fathah/hermes-desktop/blob/main/.agents/skills/lat-md/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Bạn có thể giúp tôi viết một mục lat.md giải thích các quy tắc đăng nhập của dự án không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent tuân theo một bộ quy tắc: mỗi mục bắt đầu bằng một đoạn mở đầu ngắn, và các ghi chú mô tả dự án làm gì và vì sao, thay vì lặp lại code. Văn bản được thiết kế để tìm kiếm và các công cụ khác có thể đọc được.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
lat.md Authoring Guide
This skill covers the syntax, structure rules, and conventions for writing lat.md/ files. Load it whenever you need to create or edit sections in the lat.md/ directory.
What belongs in lat.md
lat.md/ files describe what the project does and why — domain concepts, key design decisions, business logic, and test specifications. They do NOT duplicate source code. Think of each section as an anchor that source code references back to.
Good candidates for sections:
- Architecture decisions and their rationale
- Domain concepts and business rules
- API contracts and protocols
- Test specifications (what is tested and why)
- Non-obvious constraints or invariants
Bad candidates:
- Step-by-step code walkthroughs (the code itself is the walkthrough)
- Auto-generated API docs (use tools for that)
- Temporary notes or TODOs
Section structure
Every section must have a leading paragraph — at least one sentence immediately after the heading, before any child headings or other block content.
The first paragraph must be ≤250 characters (excluding [[wiki link]] content). This paragraph is the section's identity — it appears in search results, command output, and RAG context.
# Good Section
Brief overview of what this section documents and why it matters.
More detail can go in subsequent paragraphs, code blocks, or lists.
## Child heading
Details about this child topic.
# Bad Section
## Child heading
This is invalid — "Bad Section" has no leading paragraph.
lat check enforces this rule.
Section IDs
Sections are addressed by file path and heading chain:
- Full form:
lat.md/path/to/file#Heading#SubHeading - Short form:
file#Heading#SubHeading(when the file stem is unique)
Examples: lat.md/tests/search#RAG Replay Tests, cli#init, parser#Wiki Links.
Wiki links
Cross-reference other sections or source code with [[target]] or [[target|alias]].
Section links
See [[cli#init]] for setup details.
The parser validates [[parser#Wiki Links|wiki link syntax]].
Source code links
Reference functions, classes, constants, and methods in source files:
[[src/config.ts#getConfigDir]] — function
[[src/server.ts#App#listen]] — class method
[[lib/utils.py#parse_args]] — Python function
[[src/lib.rs#Greeter#greet]] — Rust impl method
[[src/app.go#Greeter#Greet]] — Go method
[[src/app.h#Greeter]] — C struct
lat check validates that all targets exist.
Code refs
Tie source code back to lat.md/ sections with @lat: comments:
// @lat: [[cli#init]]
export function init() { ... }
# @lat: [[cli#init]]
def init():
...
Supported comment styles: // (JS/TS/Rust/Go/C) and # (Python).
Place one @lat: comment per section, at the relevant code — not at the top of the file.
Test specs
Describe tests as sections in lat.md/ files. Add frontmatter to require that every leaf section has a matching @lat: comment in test code:
---
lat:
require-code-mention: true
---
# Tests
Authentication test specifications.
## User login
Verify credential validation and error handling.
### Rejects expired tokens
Tokens past their expiry timestamp are rejected with 401, even if otherwise valid.
### Handles missing password
Login request without a password field returns 400 with a descriptive error.
Each test references its spec:
# @lat: [[tests#User login#Rejects expired tokens]]
def test_rejects_expired_tokens():
...
Rules:
- Every leaf section under
require-code-mention: truemust be referenced by exactly one@lat:comment - Every section MUST have a description — at least one sentence explaining what the test verifies and why
lat checkflags unreferenced specs and dangling code refs
Frontmatter
Optional YAML frontmatter at the top of lat.md/ files:
---
lat:
require-code-mention: true
---
Currently the only supported field is require-code-mention for test spec enforcement.
Validation
Always run lat check after editing lat.md/ files. It validates:
- All wiki links point to existing sections or source code symbols
- All
@lat:code refs point to existing sections - Every section has a leading paragraph (≤250 chars)
- All
require-code-mentionleaf sections are referenced in code
Câu hỏi thường gặp
Ghi chú lat.md có nên chép lại mã nguồn không?
Không. Chúng mô tả cái gì và vì sao, còn chính code là phần đi qua chi tiết.
Đoạn mở đầu nên dài bao nhiêu?
Phải dưới 250 ký tự, không tính văn bản của liên kết wiki.
Những gì không nên đưa vào các file này?
Ghi chú tạm thời, việc cần làm và tài liệu API tự động sinh ra không phù hợp.
Chi tiết
Mô tả gốc của tác giả
Writing and maintaining lat.md documentation files — structured markdown that describes a project's architecture, design decisions, and test specs. Use when creating, editing, or reviewing files in the lat.md/ directory.
repo: fathah/hermes-desktop
Độ phổ biến
- Sao GitHub
- 15k
- Vị trí xếp hạng
- #11138
- Giấy phép
- MIT
- Cập nhật
- 13/10/2026
Bình luận
- …
Thêm skill từ kho mã này
Skill tương tự
technical-documentation
394kGiúp agent của bạn viết và rà soát tài liệu kỹ thuật cùng file hướng dẫn cho agent, rõ ràng để mọi người và công cụ AI đều dễ làm theo.
architecture-decision-records
280kGiúp agent của bạn ghi lại các quyết định quan trọng về cấu trúc dự án, giúp hiểu lý do đằng sau các lựa chọn và giữ lịch sử thay đổi rõ ràng.
code-tour
280kGiúp agent của bạn tạo các hướng dẫn đọc code từng bước, có tham chiếu chính xác đến file và dòng, hữu ích cho phần giới thiệu, giải thích và rà soát.