Logo Programming

Programming

Cộng đồngPhổ biến
code-yeongyu
programming

Applies strict, modern language practice (typed errors, exhaustive match, TDD) for Python, Rust, TypeScript, and Go. Use for work on .py, .rs, .ts, or .go files.

Tổng quan

Nhà phát hànhcode-yeongyu
Kho mãoh-my-openagent
Tên kỹ năngprogramming
Sao
69.1K
Bản fork
5.7K
Tệp đi kèm
67
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 là Markdown thuần túy, không phải 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ộ.

  • 67 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 code-yeongyu công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Programming 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/code-yeongyu/oh-my-openagent/tree/dev/packages/shared-skills/skills/programming
  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/code-yeongyu/oh-my-openagent.git /tmp/oh-my-openagent
mkdir -p .claude/skills
cp -r /tmp/oh-my-openagent/packages/shared-skills/skills/programming .claude/skills/programming
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 Programming 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ự tải Programming 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 Programming không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

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.

  1. Identify the language from the file extension or the user's request.

  2. STOP and read the matching reference set:

    File / LanguageMANDATORY reading (load Read tool on every file below)
    .py, .pyi, "Python"references/python/README.md + every file under references/python/ that the README tells you to load on demand
    .rs, Cargo.toml, "Rust"references/rust/README.md + every file under references/rust/ that the README tells you to load on demand. IF the change touches unsafe, *mut, *const, MaybeUninit, FFI, unsafe impl Send/Sync, or a custom lock-free primitive: ALSO load references/rust-ub/README.md plus every file under references/rust-ub/.
    .ts, .tsx, .mts, .cts, "TypeScript"references/typescript/README.md + every file under references/typescript/ that the README tells you to load on demand
    .go, go.mod, go.sum, .golangci.yml, *.proto next to a Go module, "Go" / "Golang"references/go/README.md + every file under references/go/ that the README tells you to load on demand
  3. Only 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.

  1. 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.

  2. 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.

  3. 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.

  4. One name = one concept. A UserId is not a string. A Seconds is not a Milliseconds. Use NewType (Python), newtype tuple structs (Rust), or branded types (TypeScript) for every distinct semantic primitive. The compiler refuses to let two semantic units mix.

  5. 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/else is forbidden for discriminating on a tagged variant - it silently swallows new variants.

  6. Trust framework guarantees. Validate only at boundaries. No null checks for values the type system already proves non-null. No try/except around code that cannot raise. No unwrap/!/as to paper over a contract you should have encoded in types. No defensive layer for a scenario you cannot name.

  7. Test-driven, with the right shape of test. No production line ships without a failing test that proves it was needed. Behavior is locked by tests, not by hope. See the TDD discipline below.


TDD DISCIPLINE — NON-NEGOTIABLE

Every change follows the red → green → refactor loop. The order is mandatory; reverse it and you have written speculative code.

The order

  1. Red. Write a failing test that names the behavior in Given / When / Then. Run it. Confirm it fails for the right reason — not a typo, not an import error. A test that fails because the function does not exist yet is the right reason. A test that fails because of a missing import is not.
  2. Green. Write the minimum code to make the test pass. Resist adding the second case until the first passes. The second case is the next red.
  3. Refactor. With the test green, restructure ruthlessly. The test is your safety net. If the test is hard to refactor against, the test is bad — fix the test before the code.

The shape of the test pyramid

Every feature ships with all three rungs, sized in this proportion:

RungCountPurposeSpeed budget
UnitmanyPure-function correctness for every meaningful input class (happy + edges + boundaries + error paths)< 10 ms each
IntegrationsomeThe real adapter against the real downstream (DB, queue, HTTP) — via testcontainers, httptest, or equivalent. NEVER a unit test pretending to be integration.< 1 s each
E2E scenariofewOne narrative per user-visible outcome. Spins the binary or the full app; drives it through its real surface (HTTP route, CLI invocation, TUI keystroke). Asserts the observable outcome, not internal state.seconds, run on CI

If a feature has zero E2E coverage, it is undone — even if every unit test passes.

Given / When / Then is mandatory

Every test — unit, integration, E2E — is structured by these three blocks. Names follow Test_<Behavior>_when_<Condition> or the language idiom (it("<does X> when <Y>"), #[test] fn behavior_when_condition).

Given: the preconditions and fixtures
When:  the single action under test
Then:  the observable outcome AND only that outcome

One When per test. Multiple Whens = multiple tests. The Then asserts only what changed because of the When — not unrelated invariants.

Less mock, the better

Mocks are a last resort, not a default. The priority order:

  1. Real object. Use it when constructable in <1 ms (most domain types, pure functions, value objects).
  2. In-memory fake. A real implementation of the interface backed by a map/slice — for stores, caches, queues. The fake has its OWN test that proves it behaves like the real one.
  3. Testcontainer / sandbox. Real Postgres, real Redis, real S3-compatible (MinIO), via testcontainers. Slow but truthful.
  4. HTTP-level fake. httptest.Server (Go), respx (Python), msw (TS) — fake at the wire, not at the SDK.
  5. Mock. Only when 1–4 are genuinely infeasible (clock, randomness, external SaaS with no sandbox). Then mock the narrowest seam — never an entire service. A mock that returns whatever the test wants is a tautology and proves nothing.

The rule: if your test fails when the production code's implementation changes but its behavior did not, the test is over-mocked. Delete the mock; assert on observable outputs.

Efficient AND accurate — both, not either

  • Accurate: the test fails for the bug it names, and only that bug. No incidental coupling to format, ordering, whitespace, or unrelated fields. Assert on the contract, not on the dump.
  • Efficient: the whole unit suite runs in < 30 seconds on a developer laptop. The whole integration suite in < 5 minutes. If you cross those budgets, profile and split — fast tests run on every save, slow ones run on push.
  • Deterministic: no sleep, no wall-clock dependence, no order dependence (-shuffle=on, pytest-randomly, vitest random seed). Inject a Clock. Subscribe to the event, do not poll for it. Time-based flake is a bug, not a test issue.
  • Isolated: every test starts from a known fixture and tears down. t.TempDir(), t.Setenv(), transactional rollback for DB tests. Two tests passing individually but failing together is a fixture leak — fix it immediately. Isolation extends across processes: suite-global resources — sandbox/cache roots under a fixed tmpdir path, hardcoded listen ports, container names — are namespaced per run (mktemp, port 0/ephemeral, unique names) so that two checkouts or worktrees of the repo running the suite concurrently cannot interfere. A fixed shared path that works on a single-checkout machine is a flake generator on a multi-agent workstation, and its signature is "a different test fails each run".

Prompt tests: NEVER assert prose

FORBIDDEN — NO EXCEPTIONS: a test MUST NOT assert natural-language prompt text. expect(prompt).toContain("based on GPT-5.6"), not.toContain("old wording"), toMatchSnapshot() on prose, grepping a sentence fragment — every one of these is pretend-coverage. It stays green while the behavior it claims to guard breaks, then blocks every legitimate rewording until someone bumps the pinned string. A reviewer MUST block it as HIGH; deleting such a test is a fix, not a coverage loss. "A nearby test already does it" is not a defense — that test is the disease, not the convention.

Assert ONLY what a machine consumes:

  • the builder's routing decision — expect(getPromptSource(model)).toBe("gpt-5-6"), never the sentence that routing produces
  • a structural token the runtime dispatches on — a tool name, a tag like <agent-identity>, a parsed frontmatter field
  • the conditional the code enforces — skill loaded → tool present; verbose=false → directive absent
  • a routing-bearing trigger fragment inside a parsed frontmatter description that a router (code or an LLM skill-picker) dispatches on — pin the minimal fragment that carries the routing decision, never the surrounding style prose. Such pins are what let a later rewrite change every sentence around them while proving the routing contract survived.

If no machine consumes the text, there is no seam: write NO test and say so in the PR; review guards prose. When you DELEGATE test-writing, hand the child the behavior the test must distinguish ("fails if override precedence breaks"), never a ready-made assertion string, prompt fragment, or marker to copy — a prescribed mechanism that is wrong gets implemented faithfully, and the error ships with a green suite.

Anti-patterns the skill rejects

Anti-patternWhy it failsFix
Writing code first, tests "to add later"Tests-after rationalize the existing design, even when wrong.Red first. Always.
One mega-test asserting 12 thingsFirst failure hides the next 11.Split by Then clause — one assertion class per test.
Mocking every collaboratorTest passes regardless of real behavior.Use a fake or the real thing. Mock only true unmockables.
time.sleep(0.1) to "let it finish"Flake guaranteed.Subscribe to the completion signal; bounded await.
Snapshot tests for everythingLocks formatting, not behavior.Snapshots for structure (CLI help, JSON shape). Assertions for behavior.
Removing a failing test to "unblock CI"You just deleted a bug report.Fix the code or fix the test — never delete to silence.
assert result is not None and stopping therePasses when result is garbage.Assert the value, not its existence.
Expected value derived from the output under test (expect(config.prompt).toBe(getPrompt(config.model)) when the criterion is about config.prompt)Recomputes a projection of the output and compares it to itself — passes even when the artifact is built from the wrong input.Derive the expected value from the test's input: expect(config.prompt).toBe(getPrompt(inputModel)) (independent known-good builder fed the fixture's input), or a stable builder routing decision.
Override/precedence fixture equal to its fallback (override == system default)The assertion passes whether or not the code honored the override — precedence is never exercised.Make every value the code must select, preserve, or override differ from its fallback. Prove it: temporarily force the regression the test names, watch it fail, revert.
Single happy-path E2E, no edgesMost bugs live on edges.Edges are unit-test territory — but include at least one E2E that exercises an error path.

Cross-language iron list

Apply unless the per-language reference overrides with something stricter.

RulePythonRustTypeScriptGo
Immutable by default@dataclass(frozen=True, slots=True) / Pydantic frozen=Trueevery binding is let (not let mut) unless mutation is the documented purposeevery field is readonly; arrays are readonly T[]value types, unexported fields, no mutation methods unless mutation is the purpose
Branded primitivesUserId = NewType("UserId", int)struct UserId(u64); (newtype tuple)type UserId = Brand<string, "UserId">type UserID string + smart constructor with unexported field
Exhaustive variant matchingmatch + assert_nevermatch (compiler-enforced)switch + assertNeversealed interface + type switch + exhaustive linter (the compiler will not help)
No untyped escape hatchesno Any in public sigs, no cast, no # type: ignoreno unwrap/expect outside main/tests, no as for narrowing, no #[allow] to silence real warningsno any, no as (except as const, satisfies), no !, no @ts-ignore, no @ts-expect-errorno interface{} / bare any in domain sigs; no _ = err; no //nolint without reason
No bare error stringstyped exception dataclass with __str__thiserror enum (lib) or anyhow with .context(...) (app)Error subclass with typed fieldssentinel errors.New + typed *XError struct; wrap with %w; check via errors.Is/As
Boundary catch onlycatch the exact exception you expect; broad except Exception only in main(), with logging + re-raise? everywhere; never panic! in library codecatch must narrow with instanceof and re-throw or convert; no empty catchevery (T, error) checked; panic only in main/tests; one httperr.Write funnel in handlers
Resources via RAIIwith (sync) / async with (async)Drop impl or RAII guardusing/await using (TC39 explicit resource management)defer x.Close() immediately after acquisition; bodyclose/sqlclosecheck linters enforce
Async runtime is mandatoryanyio (NEVER bare asyncio)tokio (async-std is unmaintained)platform-native async (Bun/Node) with structured cancellation via AbortSignalcontext.Context as first param + errgroup for structured concurrency; -race on every test
Modern HTTP clienthttpx2 with HTTP/2 + brotli + zstdreqwest with rustlsky (default) / undici direct API (Node perf) - NEVER bare fetch in prodstdlib net/http.Client with tuned Transport + go-retryablehttp for retry/backoff
No parameter mutationparams are inputs; produce a new value&mut only when mutation is the documented purposeparameters never reassigned (noParameterAssign)value receivers when not mutating; pointer receivers only for genuine mutation; copylocks vet enforces
No helpers for one-offinline a 3-line operation; do not abstract until the second callersamesamesame

Modern ecosystem - canonical libraries (2026)

Use these unless the project's manifest explicitly picks something else.

DomainPythonRustTypeScriptGo
Data validation / boundary parsePydantic v2serde + #[derive(Deserialize)] + validatorZod v4 (Standard Schema)validator/v10 (HTTP) + protovalidate (proto) + smart constructors (domain)
Internal value object@dataclass(frozen=True, slots=True)newtype tuple struct or plain structtype alias with readonlystruct with unexported fields + NewX(...) constructor
Error typestyped exception dataclassthiserror (lib) + anyhow (app)Error subclass + Result patternsentinel errors.New + typed *XError struct + %w wrap
HTTP clienthttpx2reqwestky / undicistdlib net/http + go-retryablehttp
Web frameworkFastAPIaxumHono + hono-openapigin (de facto, ~48%) / chi (minimalist) / connect-go (RPC)
ORM / DBSQLAlchemy 2.x async + asyncpgsqlx (compile-time checked)Drizzlesqlc (codegen from .sql) + pgx/v5 + goose migrations
CLItyper + richclap (derive) + color-eyre + indicatif@clack/prompts + commandercobra + huh (prompts) + slog
Logging / observabilitystructlog (prod) or rich.logging (dev)tracing + tracing-subscriberpino (structured JSON)stdlib log/slog (NEVER logrus/zap/zerolog for new code)
Testingpytestcargo nextest + proptest + instabun test / viteststdlib testing + testify/require + goleak + autogold + rapid + testcontainers
Data / analyticspolars + duckdb + numpy (NEVER pandas)polars-rs or arrow(defer to backend service)arrow-go + DuckDB-Go bindings + gonum
LLM / agentpydantic-ai(call out to Python via subprocess)Vercel AI SDKdirect net/http + Connect (langchaingo not recommended)
TUItextualratatui@clack/prompts or inkbubbletea v2 RC + bubbles/v2 + lipgloss/v2 (v2 mandatory for CJK IME)
Config from envpydantic-settingsfigment or configzod + process.envcaarlos0/env/v11 (struct-tag env)

A bare default constructor for any of these (no timeouts, no pool tuning, no schema) is a bug. See the per-language reference for the canonical production defaults.


Modern toolchain - the only acceptable setup

Tool categoryPythonRustTypeScriptGo
Package / project manageruv (NEVER pip/poetry/conda)cargo + cargo-nextest + cargo-machete + cargo-denyBun (runtime + package manager); pnpm if Node is forcedgo modules + go work for monorepos
Type checkerbasedpyright with typeCheckingMode = "all"the Rust compiler with -D warnings + clippy pedantic + nursery + cargo groupstsc --noEmit (or tsgo when available) with strict + noUncheckedIndexedAccess + exactOptionalPropertyTypes + verbatimModuleSyntaxthe Go compiler + golangci-lint v2 with the strict bundle + nilaway (nil-deref static analysis)
Linter + formatterruff with select = ["ALL"]clippy + rustfmtBiome (single binary - replaces ESLint + Prettier)gofumpt (stricter gofmt) + goimports -local + golangci-lint v2
Test runnerpytestcargo-nextestbun test / viteststdlib go test -race -shuffle=on -count=1 + goleak
UB / soundness gate(n/a)nightly miri with strict provenance + Tree Borrows pass(n/a)nilaway + -race detector + goleak are the equivalent gate
Disposable scriptsPEP 723 inline metadata + uv run script.pyrust-script with inline Cargo.toml blockbun run script.ts//go:build ignore + go run script.go
Bootstrap a new projectscripts/python/new-project.pyscripts/rust/new-project.pyscripts/typescript/new-project.tsscripts/go/new-project.py
Pre-commit / CI gateruff check . && basedpyright && pytestcargo +nightly clippy -- -D warnings && cargo nextest run && cargo +nightly miri testbunx biome check . && bunx tsc --noEmit && bun testgofumpt -l . && golangci-lint run ./... && nilaway ./... && go test -race -shuffle=on -count=1 ./...

A tsconfig.json with "strict": true alone is not strict. The reference enumerates the additional flags. Same for pyproject.toml and Cargo.toml - the references contain the canonical full configuration.


CODE SMELLS — AUTOMATIC REVIEW TRIGGERS

Most smells below are design review triggers: STOP, re-examine the code, and either fix the smell or justify carrying it with a SPECIFIC reason. The 250 pure LOC ceiling is stricter: >250 is a DEFECT. Refactor before adding lines except for rare SIZE_OK or pure-data-table exceptions.

Full rationale, measurement methods, workaround detection, and split examples: references/code-smells.md.

Smell 1 — File exceeds 250 pure LOC

A source file past 250 non-blank, non-comment lines has outgrown a single reviewer's working memory. The module is almost certainly doing more than one thing. Measure: awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(\/\/|#|--)/' <file> | wc -l.

When detected: Name what the file owns in one short noun phrase. If the answer needs "and", the file needs splitting. Load /refactor and split by responsibility. If the file genuinely cannot be split (generated parser, indivisible state machine), mark with // allow: SIZE_OK — <reason>.

Smell 2 — Function with more than 3 parameters

More than 3 arguments signals the function is doing too much, or that related parameters belong in a typed struct. Workarounds count as the same smell — passing dict/Record<string, unknown>/map[string]any/**kwargs/...args to smuggle parameters through one argument, or a throwaway "config" object with 6+ fields that exists solely to wrap what would otherwise be positional args (genuine reusable domain types like HttpClientConfig are fine).

When detected: Group related parameters into a typed value object with a domain name. If 4+ independent inputs are genuinely required, the justification must be SPECIFIC. See references/code-smells.md Smell 2 for examples in every language.

Smell 3 — Redundant verification after a destructive action

Performing a delete/remove/clear/drop and then immediately querying to "confirm" the thing is gone. The operation's contract IS the verification. Re-checking is AI-generated defensive bloat that wastes cycles and teaches the reader the operation is unreliable — which it is not. Same smell: calling a setter then getting to "confirm", writing a file then reading it back, inserting a row then SELECT-ing it, pushing to an array then checking .length.

When detected: Delete the verification code. Trust the operation's contract. If the operation can genuinely fail silently, fix the operation — do not paper over it with a post-check. See references/code-smells.md Smell 3 for examples.

Smell 4 — Negative-form names and conditions

Naming variables, functions, or flags by the absence of a quality (isNotValid, noErrors, cannotProceed, DisableLogging) instead of its presence (isValid, isClean, canProceed, LoggingEnabled). Every negation forces the reader to invert mentally; two negations (if !isNotReady) become a logic puzzle nobody reviews confidently.

When detected: Rename to the positive form and invert the branch logic. Negation IS appropriate in guard clauses (if !authorized { return }) and filters (items.filter(|x| !x.is_expired())) — the negative form is the intent there. See references/code-smells.md Smell 4 for the full naming table and examples.


LOGGING — CROSS-CUTTING RULES

Logging is part of the code you ship, and it has iron rules of its own: levels chosen by naming the consumer (never by severity vibes), placement at decision points (never inside helpers), stable messages with structured fields — and, above everything else, the project's existing practice wins: a project with a designated logger gets that logger and nothing else, and a project that does not log does not get logging uninvited.

Read references/logging.md BEFORE the change whenever your edit adds or modifies log lines, sets up a logger or a new service entrypoint, or handles errors at a boundary.


DEPENDENCY UPGRADES — CROSS-CUTTING RULES

  • 0.x minor = major. Semver promises nothing below 1.0: treat 0.N → 0.N+1 as a breaking upgrade — read the changelog, build, and run the full suite before trusting it. A required field appearing in a public options type is a routine 0.x "minor".
  • Version literals live outside the manifest. Before committing a bump, grep the repo for the old version string: Dockerfiles pinning a global CLI, CI workflows, and docs all carry copies. A bump that updates only the package manifest ships a split-brain deploy.
  • Never hand-merge a lockfile. On conflict, take either side whole and regenerate with the package manager — the resolver owns that file, not you.

MANDATORY POST-WRITE REVIEW LOOP

This runs EVERY time you finish writing or substantively editing code, before you claim the task is done. No exceptions.

Step 1 — measure

For every file you created or modified:

bash
awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(\/\/|#|--)/' <file> | wc -l

Or run the per-language checker the skill ships:

bash
# Python
uv run scripts/python/check-no-excuse-rules.py <changed paths>
# Rust
bash scripts/rust/check-no-excuse-rules.sh <changed paths>
# TypeScript
bun run scripts/typescript/check-no-excuse-rules.ts <changed paths>

Step 2 — interpret

Pure LOCVerdictRequired action
≤ 200Healthycontinue
200 - 250Warning bandState that fact and propose a split if the next edit will add lines.
> 250DEFECTDo NOT commit new lines to this file. Refactor now: split the touched unit before adding lines, except for rare SIZE_OK or pure-data-table exceptions.

Step 3 — architectural self-review (always, even at 80 LOC)

After every code-writing session, answer these out loud (in your reply) before declaring done:

  1. Single responsibility? Can I name what this file owns in one short noun phrase? If the answer needs the word "and", split.
  2. Boundary purity? Did I parse untrusted input into a typed value at the boundary, or did I pass dict[str, Any] / serde_json::Value / unknown past the boundary? If the latter, fix it.
  3. Variant discrimination? Did I use if/elif/else (or switch without assertNever, or match without assert_never) anywhere to discriminate on a tagged type or enum? If yes, rewrite as exhaustive match.
  4. Escape hatches? Any Any, # type: ignore, unwrap, expect outside main/tests, as numeric cast, !, @ts-ignore, @ts-expect-error, #[allow] on a real warning? If yes, fix the type or document why with a comment.
  5. Defensive layer? Any null check, try/except, or isinstance guarding a value the type system already proves? If yes, delete.
  6. Helpers for one-off? Any function, class, or trait introduced for a single caller that will never get a second caller? If yes, inline — axiom 0 should have caught it pre-write; this is the backstop.
  7. Tests? Is the behavior I just introduced locked by a test that would fail if I revert this commit?
  8. Parameter bloat? Any function I wrote or modified that takes more than 3 parameters — or smuggles them through a dict/kwargs/...args/throwaway options object? If yes, group related params into a typed value object. See Smell 2.
  9. Redundant verification? Did I perform a destructive action (delete, remove, clear) and then immediately re-query to "confirm" it worked? Did I call a setter then a getter to "verify"? If yes, delete the verification — the operation's contract IS the proof. See Smell 3.
  10. Negative naming? Any variable, function, or flag named by the absence of a quality (isNotValid, noErrors, DisableX) when a positive name (isValid, isClean, EnableX) would work? If yes, rename to positive form and invert the branch. See Smell 4.
  11. Logging? If I touched log lines, logger setup, or error boundaries: did I follow the project's existing practice (including its absence)? Is every new line leveled by its consumer, placed at a decision point, and message-stable with data in fields? See references/logging.md.

If any answer fails, fix it before declaring done. This loop is the difference between "the code compiles" and "the code is correct."

Step 4 — if you need to refactor right now, invoke the right skill

  • Any code smell from the CODE SMELLS section fired (250+ LOC, >3 params, redundant verification, negative naming), or step 3 surfaced more than two issues: load the refactor skill and execute its safe-refactor protocol (codemap, plan, LSP-driven edits, test after each step). Do not improvise a refactor under time pressure — the refactor skill exists precisely so you do not corrupt behavior while reshaping structure.
  • You inherited a branch with AI-generated patterns (broad except, redundant null checks, vague TODOs, oversized modules, dead helpers, redundant post-action verification): load the remove-ai-slops skill to do a categorized branch-scope cleanup with regression tests pinned first.

These two skills are not optional cosmetics. They are the recovery path for the smells this loop is designed to catch.


Companion skills - explicit invocation triggers

TriggerSkill to loadWhy
Any code smell fires (250+ LOC, >3 params, redundant verification), OR the post-write loop surfaces 2+ issues, OR the user says "reshape this", "extract this", "clean this up"refactorSafe codemap-driven multi-step refactor with LSP + tests after each step. Never improvise a structural change.
Recent branch contains AI-authored patterns (broad except, dead helpers, vague comments, oversized files, redundant post-action verification), OR the user says "remove slop", "clean AI code", "deslop"remove-ai-slopsTests pinned FIRST, then categorized parallel cleanup, then quality gates. Behavior-preserving.
Rust code touches unsafe, *mut, *const, MaybeUninit, FFI, unsafe impl Send/Sync, or a custom lock-free primitivereferences/rust-ub/Full UB taxonomy + Miri strictness escalation. Every unsafe block must survive Miri Level 3 (strict provenance + symbolic alignment + preemption) before it ships.

Per-language jump table

Stop. Read the matching reference fully before writing code.

Python (.py, .pyi)

READ references/python/README.md FIRST. Then load on demand:

NeedLoad
Strict pyproject.toml / basedpyright / ruff configreferences/python/pyproject-strict.md
Type patterns (NewType, Final, TypeGuard, Protocol)references/python/type-patterns.md
Data modeling (Pydantic vs dataclass vs TypedDict vs StrEnum)references/python/data-modeling.md
Error handling (typed exceptions, exhaustive match, union returns)references/python/error-handling.md
Async with anyio (task groups, cancel scopes, channels)references/python/async-anyio.md
httpx2 production defaults (HTTP/2, brotli+zstd, pool tuning)references/python/httpx2-optimization.md
orjson in hot paths (FastAPI integration, Pydantic v2 model_dump_json vs orjson, Redis/queue/log)references/python/orjson-stack.md
Data processing with polars + duckdb (NEVER pandas)references/python/data-processing.md
FastAPI + SQLAlchemy 2.x async stackreferences/python/fastapi-stack.md
pydantic-ai agentsreferences/python/pydantic-ai.md
Textual TUIreferences/python/textual-tui.md
Disposable PEP 723 scriptsreferences/python/one-liners.md
Canonical library defaultsreferences/python/libraries.md

Rust (.rs, Cargo.toml)

READ references/rust/README.md FIRST. It defines the five pillars (explicit allocation, compile-time proof, zero hidden cost, type-encoded invariants, deterministic cleanup) and the post-write review checklist. Then load on demand:

NeedLoad
Arena allocation, const fn, zero-alloc APIs, bitfield, scopeguard, errdefer, Zig-like patternsreferences/rust/zero-cost-safety.md
Strict Cargo.toml lints + profile + workspace configreferences/rust/cargo-strict.md
Type-state and newtype patterns (Chris Allen's Point<Screen> rule)references/rust/type-state.md
unsafe discipline (safe wrapper + SAFETY comment + miri proof)references/rust/unsafe-discipline.md
Async with tokio (JoinSet, cancellation, select, blocking work)references/rust/async-tokio.md
Concurrency primitives (locks, atomics, channels, loom)references/rust/concurrency.md
axum + sqlx + tracing + tower HTTP stackreferences/rust/axum-stack.md
clap + color-eyre + tracing + indicatif CLI stackreferences/rust/clap-stack.md
Property tests (proptest) + snapshot tests (insta)references/rust/proptest-insta.md
Disposable rust-script scriptsreferences/rust/one-liners.md
Canonical library defaultsreferences/rust/libraries.md
ANY unsafe / FFI / MaybeUninit / lock-free workreferences/rust-ub/ (full directory)

TypeScript (.ts, .tsx, .mts, .cts)

READ references/typescript/README.md FIRST. Then load on demand:

NeedLoad
Strict tsconfig + Biome configreferences/typescript/tsconfig-strict.md
Type patterns (branded types, as const, satisfies, narrowing, assertNever)references/typescript/type-patterns.md
Data modeling (type vs interface vs Zod, readonly, parse-don't-validate)references/typescript/data-modeling.md
Error handling (Result, typed errors, union vs throw, AbortSignal timeouts)references/typescript/error-handling.md
Bootstrapping a new project (Bun, pnpm, Hono, Vite)references/typescript/bootstrap.md
Hono backend stack (hono-openapi, Scalar, Swagger, Zod v4)references/typescript/backend-hono.md

Go (.go, go.mod, go.sum, .golangci.yml, *.proto)

READ references/go/README.md FIRST. Then load on demand:

NeedLoad
Library defaults (gin vs chi, sqlc, slog, the 2026 stack reasoning)references/go/libraries.md
Canonical strict .golangci.yml (v2) with per-linter rationalereferences/go/golangci-strict.md
Project layout, Taskfile, CI, go.mod templatereferences/go/bootstrap.md
Type patterns (named types, smart constructors, sealed interfaces, generics)references/go/type-patterns.md
Data modeling — the three layers of validation (validator/v10 → smart ctor → sqlc)references/go/data-modeling.md
Error handling (errors.Is/As, typed errors, %w wrapping, no panic)references/go/error-handling.md
Concurrency (context.Context, errgroup, channels, locks, -race, goleak)references/go/concurrency.md
HTTP backend stack (gin + slog + validator + pgx, middleware ordering, SSE, WS)references/go/backend-stack.md
RPC stack (Connect-Go default, grpc-go fallback, protovalidate, Buf)references/go/grpc-connect.md
CLI stack (cobra + slog + huh)references/go/cobra-stack.md
Database stack (sqlc + pgx + goose + testcontainers)references/go/sqlc-pgx.md
TUI stack (bubbletea v2 + bubbles v2 + lipgloss v2; CJK / IME support)references/go/bubbletea-v2.md
Testing (Given/When/Then, table-driven, fakes-over-mocks, autogold, rapid)references/go/testing.md
Disposable go run scriptsreferences/go/one-liners.md

Activation

This skill activates whenever you are writing or modifying any .py, .pyi, .rs, .ts, .tsx, .mts, .cts, .go file, or any project manifest (pyproject.toml, Cargo.toml, package.json, tsconfig.json, biome.json, go.mod, go.sum, .golangci.yml, Taskfile.yml, buf.yaml, sqlc.yaml). Even one-off scripts get the full treatment - that is the whole point of uv run + PEP 723, rust-script, bun run, and go run + //go:build ignore: production hygiene with throwaway ergonomics.

The references contain the recipes. Read them before writing code. Re-read them when the model drifts. The post-write review loop is non-negotiable.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

và 7 tệp khác.

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

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

Applies strict, modern language practice (typed errors, exhaustive match, TDD) for Python, Rust, TypeScript, and Go. Use for work on .py, .rs, .ts, or .go files.

Vì sao nên dùng Programming 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. Programming 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 Programming trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/code-yeongyu/oh-my-openagent/tree/dev/packages/shared-skills/skills/programming. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành 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 Programming?

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.

Bạn có thể dùng Programming 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 Programming 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 Programming có miễn phí không?

Kỹ năng này được code-yeongyu 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇