Logo Lean Out

Lean Out

Cộng đồng
namedtoaster
lean-out

Find the structural clutter in an app that is making every new change land wrong, and rank it by what it would have prevented rather than by taste. Produces a measured audit and a list that can be worked through in pieces, never a big bang refactor. Use when the codebase feels heavy, when the same kind of bug keeps coming back in a new place, when a file has grown past anyone's head, or when the app's size keeps climbing and nobody has looked at why.

Tổng quan

Nhà phát hànhnamedtoaster
Kho mãThe-Last-Mile
Tên kỹ nănglean-out
Sao
39
Bản fork
2
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
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ộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được namedtoaster 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 Lean Out 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/namedtoaster/The-Last-Mile/tree/main/skills/lean-out
  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/namedtoaster/The-Last-Mile.git /tmp/The-Last-Mile
mkdir -p .claude/skills
cp -r /tmp/The-Last-Mile/skills/lean-out .claude/skills/lean-out
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 Lean Out 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 Lean Out 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 Lean Out 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.

Lean out

The rule: clutter is only worth fixing where you can show what it cost. A file being long is not evidence. A bug that happened, in that file, because of how it is arranged, is evidence. Rank by that and the list sorts itself.

This produces an audit and a list. It does not refactor. Doing both at once is how a tidy up becomes a week and a regression.

When NOT to run this

  • Between cutting a build and shipping it. The whole point of a release checklist is that the thing you tested is the thing you upload. Do not move code underneath it.
  • When the real question is bytes. "Our download size keeps growing" is answered by diffing two builds, not by reading code. Do that first, it takes minutes, and come back if the answer is "our own code".
  • When nothing has gone wrong yet. Without a bug list you will rank by taste, and a refactor ranked by taste is a rewrite with extra steps.

1. Gather the evidence before looking at any code

You need two things. Collect both before forming an opinion.

The bug list. Every defect from the last few months that reached a person, from the project's own records: the rules file's gotchas, the release checklist's history, recent commit messages that say "fix". For each, note the file it lived in and, more importantly, what shape of mistake it was.

The mass. Cheap and factual:

# biggest files, tests excluded
find <source dirs> -name "*.<ext>" -not -path "*test*" | xargs wc -l | sort -rn | head -20

Now cross them. The files that appear in both lists are the audit. A long file nobody has had a bug in is not urgent, whatever it looks like.

2. The shapes worth looking for

These are the ones that keep producing bugs, in roughly the order they do damage. Each is a grep, not a judgement.

ShapeWhat it looks likeWhy it bites
One fact, many readingsThe same question answered several ways in one file, some of them combining sources and some notTwo of them eventually disagree, and the screen contradicts itself
A boolean meaning two thingsfalse means both "no" and "not asked yet"The unread state is rendered as a fact, and the UI corrects itself a beat later
A flag used as a proxyA one time key named for a state, read as though it meant "on screen now"It is true long after the thing is gone, and silently suppresses something else
A rule copied per surfaceEach card or screen carrying its own version of a shared policyThe next one is written without it, and the bug returns somewhere new
Documentation contradicted by callersA function documented one way and overridden at every call siteThe next person reads the doc and concludes the opposite of the truth
A guard that is defined but not appliedA validator that exists and is only enforced on the shape of your own codeIt never runs on the data that actually arrives

For each hit, write down the bug it caused or could cause. If you cannot name one, leave it out. That exclusion is the skill.

3. Rank by what it would have prevented

Order the list by the cost already paid, not by size or ugliness:

  1. It caused a bug that reached a person. Top, always.
  2. It caused a bug caught internally, or the same shape appears three or more times.
  3. It will cause one: a new surface will plausibly miss the rule.
  4. Everything else. This is where "long file" lives on its own.

4. Deliver a document and a list, not a branch

Write it where the project keeps its research or decisions, and link it from the backlog. For each item say: the shape, the evidence, the smallest change that removes it, and what would have to stay true afterwards (the test that pins it).

Then stop. The list is the deliverable.

5. The loop, and why green on its own proves nothing

The obvious method is: run everything, change things, run everything again, and call matching results a pass. That is the right floor and it is not the test.

A suite that was green while the bug existed will be green after you refactor the bug. Every defect worth fixing was, by definition, invisible to the tests you already had. So "the same results" tells you the tests ran, not that they were watching the thing you touched.

Three holes to expect, whatever the language:

  • Layout is usually invisible to the test runner. Component tests prove what renders, almost never where. A change that wrecks spacing or pushes a control off screen passes.
  • Mocks that list their exports go green for the wrong reason. Add a field to a store and every hand written mock returns undefined for it, quietly.
  • End to end runs are the noisiest thing you own. Comparing a flaky red before against a flaky red after is not a comparison.

So add one step, and it is the one that gets skipped under time pressure:

For every rule you extract, revert it and watch the test go red. A test that passes with and without your change has proven nothing about it. Put the change back and move on. It costs a minute and it is the whole difference between a suite that is green and a suite that is looking.

The loop that is worth trusting:

BeforeFull suite green, and note which tests actually cover what you are about to touch
DuringOne shape at a time, each with a test verified red by reverting
AfterFull suite green, plus a screenshot of any screen whose layout moved

6. When the work happens, one item at a time

  • One shape per change. Not "tidy the screen".
  • A test first that fails for the right reason, exactly as for a bug fix. A refactor with no failing test to start from cannot be shown to have preserved anything.
  • Prefer extracting a rule over moving code. The win is one definition in one named place, not a smaller file. A 3,000 line file with one copy of each rule is safer than three 1,000 line files with three copies.
  • Leave the behaviour alone. If you find a behaviour bug mid way, that is a separate change with its own test.

What good looks like

A rule that existed in five places now exists in one, has a name, has a test that walks every input, and the next surface gets it without being told. That is worth more than any number of lines removed.

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

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

Find the structural clutter in an app that is making every new change land wrong, and rank it by what it would have prevented rather than by taste. Produces a measured audit and a list that can be worked through in pieces, never a big bang refactor. Use when the codebase feels heavy, when the same kind of bug keeps coming back in a new place, when a file has grown past anyone's head, or when the app's size keeps climbing and nobody has looked at why.

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

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/namedtoaster/The-Last-Mile/tree/main/skills/lean-out. TypingMind đọc tệp SKILL.md 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 Lean Out?

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 Lean Out 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 Lean Out 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 Lean Out có miễn phí không?

Có. Kỹ năng này được namedtoaster phát hành trên GitHub theo giấy phép MIT. 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 👇