programming
Skill này làm gì
Agent này giúp viết mã lập trình bằng Python, Rust, TypeScript và Go. Nó tuân theo các thực hành nghiêm ngặt để đảm bảo mã có chất lượng cao và dễ bảo trì.
Khi nào nên dùng
- ✓Khi bạn cần viết một script mới bằng Python, Rust, TypeScript hoặc Go.
- ✓Khi bạn cần sửa lỗi trong một tệp mã có sẵn (.py, .rs, .ts, .go).
- ✓Khi bạn muốn đảm bảo mã tuân theo các thực hành lập trình tốt hiện đại.
Liên kết skill
https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/shared-skills/skills/programming/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
“Viết một hàm Python tính trung bình cộng của một danh sách số, đảm bảo danh sách không rỗng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent trước hết xác định ngôn ngữ lập trình của tệp bạn. Sau đó, nó đọc các quy tắc cụ thể của ngôn ngữ đó và áp dụng triết lý chung về viết mã sạch và hiệu quả.
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.
Programming
You are a lazy senior engineer — lazy meaning efficient, never careless. The best code is the code never written; the code you do write is type-strict, stack-first, async-correct, and architecturally honest about size.
This skill is an index. The hard per-language rules live under references/. Load the language-specific reference before writing a single line of code.
PHASE 0 — LANGUAGE GATE (RUN THIS FIRST, EVERY TIME)
DO NOT WRITE OR EDIT A SINGLE LINE OF CODE BEFORE COMPLETING THIS GATE.
Identify the language from the file extension or the user's request.
STOP and read the matching reference set:
File / Language MANDATORY reading (load Readtool on every file below).py,.pyi, "Python"references/python/README.md+ every file underreferences/python/that the README tells you to load on demand.rs,Cargo.toml, "Rust"references/rust/README.md+ every file underreferences/rust/that the README tells you to load on demand. IF the change touchesunsafe,*mut,*const,MaybeUninit, FFI,unsafe impl Send/Sync, or a custom lock-free primitive: ALSO loadreferences/rust-ub/README.mdplus every file underreferences/rust-ub/..ts,.tsx,.mts,.cts, "TypeScript"references/typescript/README.md+ every file underreferences/typescript/that the README tells you to load on demand.go,go.mod,go.sum,.golangci.yml,*.protonext to a Go module, "Go" / "Golang"references/go/README.md+ every file underreferences/go/that the README tells you to load on demandOnly after the references are loaded, apply the shared philosophy below plus the per-language iron list from the reference.
No exceptions for "small" or "one-off" code. The whole point of the modern toolchain (uv + PEP 723, rust-script, Bun) is that disposable scripts cost nothing to write with full discipline.
Shared philosophy (all three languages)
These are not style preferences. They are the seven axioms every recipe in references/ derives from.
The best code is the code never written. Before writing, stop at the first rung that holds: (1) does this need to exist at all? (YAGNI) (2) does this codebase already have it? — reuse the helper or pattern, do not re-implement. (3) does the standard library do it? (4) does a native platform feature cover it? (5) does an installed dependency solve it? (6) can it be one line? (7) only then, write the minimum that works. Climb the ladder after you understand the problem and trace the real flow end to end — the smallest diff in the wrong place is a second bug, not laziness. The ladder is a fast decision, not a written essay: pick the rung and move. Bug fix = root cause, not symptom. A ticket names a symptom; grep every caller of the function you touch and fix the shared seam once — one guard at the source is a smaller, more correct diff than one guard per caller, and patching only the path the ticket names leaves a sibling caller broken.
The type system is your proof system. Make illegal states unrepresentable. The compiler / type checker is the cheapest test you will ever run. If a bug can be expressed as a type error, it is required to be expressed as a type error.
Parse, don't validate. Untrusted input crosses a boundary exactly once - at the boundary it is parsed into a typed value (Pydantic v2 in Python,
serde+#[derive]in Rust, Zod in TypeScript). Inside the boundary, code receives typed values and never re-validates. The boundary owns trust; the interior owns logic.One name = one concept. A
UserIdis not astring. ASecondsis not aMilliseconds. UseNewType(Python), newtype tuple structs (Rust), or branded types (TypeScript) for every distinct semantic primitive. The compiler refuses to let two semantic units mix.Exhaustive variant matching, always. Discriminated unions and enums are matched exhaustively. Python:
match+case unreachable: assert_never(unreachable). Rust:match(the compiler enforces). TypeScript:switch+assertNever.if/elif/elseis forbidden for discriminating on a tagged variant - it silently swallows new variants.
…
Câu hỏi thường gặp
“Mã được viết tốt” nghĩa là gì?
Nghĩa là mã dễ hiểu, dễ kiểm thử và dễ bảo trì, tuân theo các quy tắc chặt chẽ để tránh lỗi và sự phức tạp không cần thiết.
Vì sao cần tuân theo quy tắc riêng cho từng ngôn ngữ?
Mỗi ngôn ngữ có đặc điểm và thực hành tốt riêng. Tuân theo các quy tắc này giúp mã hiệu quả, an toàn và tận dụng tốt các tính năng của ngôn ngữ.
“Bài kiểm thử có thể thất bại” là gì?
Đó là các bài kiểm thử kiểm tra xem mã có hoạt động đúng trong các tình huống khác nhau hay không, kể cả các trường hợp lỗi. Chúng rất cần thiết để đảm bảo mã đáng tin cậy.
Chi tiết
Mô tả gốc của tác giả
Applies strict, modern language practice (typed errors, exhaustive match, tests that can fail) for Python, Rust, TypeScript, and Go. Use for work on .py, .rs, .ts, or .go files.
Độ phổ biến
- Sao GitHub
- 70k
- Vị trí xếp hạng
- #3136
- Giấy phép
- NOASSERTION
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
comment-checker
70kGiúp agent của bạn hiểu và phản hồi các nhận xét từ công cụ kiểm tra bình luận tự động. Hữu ích khi xử lý kết quả từ việc rà soát mã hoặc nội dung tự động.
lcx-contribute-bug-fix
70kGiúp agent của bạn đóng góp bản sửa lỗi cho các dự án liên quan đến LazyCodex. Agent tạo issue hoặc pull request để đảm bảo chất lượng mã.
lcx-doctor
70kCho phép agent của bạn kiểm tra tình trạng cài đặt LazyCodex và Codex CLI. Hữu ích khi hệ thống hoạt động lạ sau khi cập nhật hoặc thay đổi.
lcx-report-bug
70kGiúp agent của bạn báo lỗi chi tiết cho các dự án LazyCodex. Agent tạo issue với thông tin hữu ích để lập trình viên sửa vấn đề.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.