agentleFS
Sophon-KrSophon-Kr/thai-native/skills/thai-learn/SKILL.md

thai-learn

Skill0 starsChanged 22 days agoMITView on GitHub

Learn from the edits you make to Thai drafts Claude wrote, locally on your machine. Shows what is stored, records a draft together with the text you actually sent, picks up your edits to files Claude wrote, and proposes personal term overrides, lint rules or particle settings that you accept or reject one by one.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run L scan, then L status --json.

    line 20
  2. Very specific:

    If enabled is false, say what it stores in one Thai sentence and offer to turn it on, e.g.

    line 21
  3. Very specific:

    If enabled, summarize in 1–2 Thai lines (pairs, days, accepted/rejected).

    line 24
  4. Very specific:

    If proposals is empty, say so in one Thai line with the number of pairs, and that an edit is proposed only after it repeats in at least 3 …

    line 51
  5. Very specific:

    Run L stats and summarize in Thai: number of pairs, edit rate per genre (median of 1 − similarity.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

thai-learn

Arguments: $ARGUMENTS

Script: python3 "${CLAUDE_SKILL_DIR}/../thai-writing/scripts/thai_native.py" --project-dir "${CLAUDE_PROJECT_DIR}" (the thai-writing skill folder sits next to this one). Below, L <action> means <script> learn --data-dir "${CLAUDE_PLUGIN_DATA}" <action>. Always pass --data-dir like this: the file hook stores snapshots in the plugin data dir, and the Bash tool does not have that variable.

Everything stays on this machine. Never copy stored drafts anywhere else. Do not edit the learn files or patterns.local.json by hand; use the commands.

No arguments, or status

  1. Run L scan, then L status --json.
  2. If enabled is false, say what it stores in one Thai sentence and offer to turn it on, e.g. "ถ้าเปิด thai-learn จะเก็บสำเนาไฟล์ภาษาไทยที่ Claude เขียนและฉบับที่แก้แล้วไว้ในเครื่องนี้เท่านั้น (ลบเองใน 30–60 วัน) จากนั้นจะเสนอศัพท์หรือกฎ lint ให้เลือกรับทีละข้อ เปิดเลยไหม" On yes, run <script> config set learn on. If project_setting_ignored is true, add that a repo setting cannot turn it on; each person turns it on for themselves.
  3. If enabled, summarize in 1–2 Thai lines (pairs, days, accepted/rejected). With 3 or more edited pairs, offer mine.

on / off: run <script> config set learn on (or off) and confirm in one line.

add

The user pastes the text they actually sent (Slack, Jira, LINE, email). It works even when passive capture is off, because the user asked.

  • draft: the most recent Thai draft you wrote in this conversation for that message, copied exactly as you wrote it. If there is none, or it is unclear which draft it was, ask the user to paste the draft as well.
  • final: the pasted text, unchanged.
  • genre (optional): jira, code-review, chat, email, email-client, slides, docs, ux, official, … inferred from the conversation.

Pass both on stdin with a quoted heredoc so nothing gets expanded:

L add --genre chat <<'THAI_LEARN_EOF'
<draft>
<<<FINAL>>>
<final>
THAI_LEARN_EOF

Confirm in one Thai line, e.g. "บันทึกแล้ว แก้ 3 จุด".

mine

  1. Run L scan, then L mine --json.
  2. If proposals is empty, say so in one Thai line with the number of pairs, and that an edit is proposed only after it repeats in at least 3 documents on 2 different days, in most of the drafts where it appeared.
  3. Otherwise go through proposals in order, one per message:

    • summary_th: what would change
    • evidence_th verbatim, e.g. "แก้ 5 จาก 6 เอกสาร ใน 3 วัน"
    • example as ❌ bad / ✅ good, when present
    • ask: รับ / ไม่รับ / ข้าม

    kind: note has nothing to write: present it as an observation and suggest a setting only if one clearly fits.

  4. When every proposal has an answer, run L apply <id> … for the accepted ones and L reject <id> … for the rejected ones. Skipped ones come back next time. Report in 1–2 Thai lines what was written where: term overrides and particle go to the user config, lint rules to patterns.local.json (severity info).

stats

Run L stats and summarize in Thai: number of pairs, edit rate per genre (median of 1 − similarity; lower means fewer edits), and lint rules marked ทบทวน (flagged often, rarely changed by the user).

forget

Confirm first: it deletes every stored snapshot, pair and decision. Accepted rules and settings stay in the user's config. Then run L forget.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.