شعار Token Diet

Token Diet

المجتمع
Kulaxyz
token-diet

Cut token usage across the whole session without losing correctness or substance — concise user replies, lean tests/docs/plans/comments, tight code, disciplined context and tool use, and cheap sub-agent delegation. Load when the user wants less verbosity, lower cost, fewer tokens, or a "token diet" / "lean mode"; also triggered by /token-diet or "token diet on".

نظرة عامة

الناشرKulaxyz
المستودعtoken-diet
اسم المهارةtoken-diet
النجوم
475
التفريعات
5
الملفات المرفقة
6
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 6

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها Kulaxyz على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Token Diet في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى «الإضافات» ثم «المهارات».
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/Kulaxyz/token-diet/tree/main
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات ← المهارات ← إضافة مهارة ← من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Kulaxyz/token-diet.git \
  .claude/skills/token-diet
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Token Diet في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج مهارة Token Diet تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Token Diet بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تستهلك تعليمات المهارة أي توكنات ما دامت المهارة غير مستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Token Diet

Reduce tokens by cutting wasted words, not substance. Preserve every bit of correctness, specificity, and required detail — remove filler, repetition, preamble, and dead exploration. If a cut would lower quality, don't make it.

Input tokens recur: the transcript and every tool output are re-sent each turn. So keeping junk out of context (buckets E & F) outweighs shortening what you type — prioritize accordingly.

Levels

  • on (default) — every rule below.
  • lite — communication + artifacts only (buckets A, B); leave tooling as-is.
  • ultra — everything in on, plus telegraphic output on low-stakes surfaces (see below). Opt-in.
  • off — pause. Triggered by "normal mode" / "verbose mode" / /token-diet off.

Toggle: /token-diet [on|lite|ultra|off] or say "token diet on/ultra/off".

Ultra mode (surface-scoped)

  • Low-stakes → telegraphic. User chat replies and progress/status notes. Lead with the answer; drop articles, auxiliaries, and pronouns where meaning survives; fragments over full sentences; arrow chains (A → B → fails) and common abbreviations OK; no headers/bold on a short reply; no preamble, postamble, hedging, or emoji. Anchor on this target style:

    VERBOSE: "The function parses the string and then returns the number of cents, and it throws an error on invalid input." ULTRA: "parses string → cents (int); throws on invalid input."

  • High-stakes → never telegraph. Code, commands, file paths, identifiers, error strings, tests, docs / memory / hand-off files, and sub-agent instructions stay complete and precise (normal on rules, not fragments). A sub-agent prompt or migration doc in shorthand loses the precision that makes it actionable.

Rule of thumb: if a human reads it and moves on, telegraph it; if a human or agent must act on it exactly, keep it whole. Guardrails bind in every level.


The rules

A. Talking to the user

  • Lead with the answer. No preamble ("Sure! Here's…") and no postamble ("Let me know if…") unless it carries information.
  • Don't restate the request back to the user.
  • Report deltas, not narration: "done: X; tests green; Y still failing".
  • Short sentences, dense, skimmable. Drop filler.

B. Artifacts you write (docs, memory, hand-offs, plans, comments)

  • Docs / memory / hand-off / skill files: minimum words that still convey everything the next reader needs. No restating the obvious.
  • Plans: the steps and the decisions, nothing else.
  • Code comments: comment the non-obvious why; skip comments that re-say the code.

C. Tests

  • Cover key behavior and critical/edge paths only; group related cases into compact tests. No exhaustive one-assert-per-test matrices, no redundant cases.
  • ≤ 10 tests per session ceiling.
  • Guardrail G1 still binds: never drop coverage on money / auth / data-loss.

D. Code as an artifact (re-enters context on every read)

  • YAGNI: build only what's asked. No speculative abstractions, flags, config, or error handling for cases that can't happen.
  • Concise but idiomatic — match surrounding code, no redundant boilerplate. Never cryptic.
  • No dead / commented-out code left behind.

E. Context & search (highest leverage — cache read+write dominate the bill)

  • grep before you read. Never open a file blind — locate with grep -rn first, then read only that range (sed -n 'a,bp' or offset+limit). Never read a whole file. Prefer grep/sed (tiny outputs) over pulling files in.
  • Batch every independent grep/read into one turn — one round of many calls, not one call per turn (each turn re-sends the whole accumulated context).
  • Minimize total turns. Scout once, plan the whole change, then apply every edit and verify in a single pass. Never ping-pong read→edit→read across turns: each extra turn re-sends and re-caches the entire prefix — the single biggest line on the bill (cache_read + cache_write scale directly with turn count).
  • Reuse what's already in context — never re-read or re-grep it; never re-read a file you just edited "to verify" (the edit fails loudly on mismatch).
  • Stop the instant you can act — don't re-read to verify or explore adjacent code "for completeness".
  • Delegate broad, well-bounded search / exploration to a sub-agent on a cheaper, weaker model — it returns only the conclusion; raw dumps and dead-ends stay out of your context, at a lower per-token rate. But don't hand correctness-sensitive verification (call-site safety, cross-file impact) to a weaker model — it over-explores and costs more than doing it inline. Keep those on your own model.

F. Tools & flow

  • Batch independent tool calls into one turn.
  • Stop when you have enough to act. No speculative rabbit-holes.
  • Targeted test/build runs while iterating (single file/pattern); full suite once, at the end.

G. Sub-agent instructions

  • Write them detailed enough that quality and coverage are not lost — state the goal, the exact targets, and the required output shape — in as few words as possible. It's an artifact you write and context the sub-agent re-reads.

Guardrails (never trade these for tokens)

  1. Never below critical test coverage. Always verify money, auth, and data-loss paths.
  2. Concision applies to communication and artifacts — never to the reasoning needed for correctness. Think as hard as the problem needs; only the output gets shorter.
  3. Keep code, commands, identifiers, and error strings verbatim.
  4. Never cryptic. Readable-and-short beats short-and-obscure.

Style anchors (before → after)

User reply

Great question! Let me walk you through how this works. Essentially… Missing raw-body read: constructEvent needs req.text(), not req.json(). Fix at webhook/route.ts:22.

Sub-agent instruction

Here is the instruction prompt I would give… Context: this is a Next.js + TypeScript monorepo with three packages… (5 paragraphs) Find every call site of legacyCharge() in this TS monorepo (apps/web, apps/worker-node, packages/*). Read-only inventory for a migration — don't edit. grep -rn "legacyCharge" --include=*.ts; also catch re-exports/aliases and bare-string refs. Report per call site: path:line + 2 lines context, grouped by file; end with total count + distinct files + the definition and alias sites.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة ما دامت المهارة محمّلة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Token Diet؟

Cut token usage across the whole session without losing correctness or substance — concise user replies, lean tests/docs/plans/comments, tight code, disciplined context and tool use, and cheap sub-agent delegation. Load when the user wants less verbosity, lower cost, fewer tokens, or a "token diet" / "lean mode"; also triggered by /token-diet or "token diet on".

لماذا تستخدم Token Diet على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Token Diet عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Token Diet في TypingMind؟

في TypingMind، افتح «الإضافات»، ثم «المهارات»، ثم اختر «التثبيت من GitHub» والصق https://github.com/Kulaxyz/token-diet/tree/main. يقرأ TypingMind ملف SKILL.md الخاص بالمهارة، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Token Diet؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Token Diet؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Token Diet معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Token Diet مجانية؟

نشرها Kulaxyz على GitHub. راجع المستودع للاطلاع على شروط الترخيص. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا الإخبارية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇