شعار Commit And Push Gate

Commit And Push Gate

المجتمع
Motaghi
commit-and-push-gate

Use when the user says "commit this", "stage and commit" or "let's commit". Builds the commit from the files this session changed, classifies them against the project's commit rules (safe in the session's own repository, explicit confirmation for sibling repositories and gated paths, blocked for .env, credential and key files and files over 10 MB (megabytes); file-name heuristics, not a secret scanner, unless the profile names a content scanner), proposes a message in the repository's style and commits exactly those paths. Commits only; push is a separate instruction.

نظرة عامة

الناشرMotaghi
المستودعmimir-skills
اسم المهارةcommit-and-push-gate
النجوم
51
التفريعات
0
الملفات المرفقة
5
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

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

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

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

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

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

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

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

التثبيت

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

1

التثبيت في TypingMind

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

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

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

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

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Motaghi/mimir-skills.git /tmp/mimir-skills
mkdir -p .claude/skills
cp -r /tmp/mimir-skills/skills/commit-and-push-gate .claude/skills/commit-and-push-gate
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

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

يُحمّل النموذج مهارة Commit And Push Gate تلقائيًا بمجرد ورود طلب ذي صلة بها.

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

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

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

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

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

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

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

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

commit-and-push-gate

Classifies a working tree and proposes a safe commit. The agent does the commit itself, but only after the classifier and the project's commit rules say the paths are fine to stage. Setup-specific values (the commit command, gated paths, sibling repositories, the push route) live in a profile; see profiles/example.md for the fields and a worked example. Your own profile is commit-and-push-gate.profile.md in the project root; if it is not there, ask the user where it is, or use the defaults in this file. Keep it in your project, not in this folder.

Inputs

One optional input: an explicit list of files to commit. Without it, the candidates are the files this session changed for the task. The skill runs in the session's repository and reads:

  • pwd and git rev-parse --show-toplevel to find the repository root.
  • git status --porcelain=v2 for the changed-file inventory.
  • The classifier's diff_stat for sizing, not plain git diff --stat. Plain git diff --stat compares the index with the working tree, leaves out untracked files and follows the repository's diff attributes; diff_stat compares HEAD with the content the commit will record, the same blobs the patch digest binds.
  • git log -n 10 --format='%s' for commit-message style.
  • The profile's commit policy: which paths are gated and which commit command to use.

What it needs

  • A shell and read access to git.
  • Python 3 for the bundled classifier.
  • A way to stage exact paths and commit them. The profile names the command; git --literal-pathspecs add -- <paths> followed by git --literal-pathspecs commit -m <message> -- <paths> works when the profile names nothing else.
  • A way to ask the user a question and wait for the answer.

Run the helper by its absolute path. <skill-dir> below means the folder that holds this SKILL.md, resolved to an absolute path from where the skill is installed (not a path relative to the project). Run the helper from the root of the repository whose changes you are committing; from anywhere else it stops with an error. If the commit command is unavailable, stop before staging anything. Do not fall back to staging the whole tree.

Process

  1. Build the candidate list from the files this session changed, or the list the user gave. Show other changed paths as "not part of this commit" and never stage them. If a candidate file holds changes this session did not make, show those hunks and ask before including the file; literal paths commit whole files.

  2. Run the classifier from the root of the repository you are about to commit in, and tell it which directory the session was opened in, so it can tell a sibling repository from the session's own:

    bash
    python3 "<skill-dir>/scripts/classify_changes.py" --session-repo "<directory the session was opened in>" -- <candidate paths>

    When the profile's content scanner field names a command rather than none, add --content-scanner "<command>", with the whole command quoted as one shell word.

    The helper returns JSON (JavaScript Object Notation): {tree_status, candidates, changed_candidates, unchanged_candidates, other_changed_paths, blocked_files, block_reasons, unmerged_files, warnings, sibling_repo, session_repo, repo_root, working_dir, content_scan, patch_digest, sample_messages, suggested_message, diff_stat, reason}.

  3. Interpret the result:

    • tree_status == "error": show reason and stop.
    • tree_status == "clean": nothing to commit. Tell the user and stop.
    • tree_status == "unmerged": the tree has unresolved merge conflicts (unmerged_files). Show them and stop; the user resolves and stages them first. Never commit a conflicted file.
    • tree_status == "blocked": if a blocked file is among the candidates, show it and refuse to commit. The user must remove the sensitive or oversized file from the candidates before retrying.
    • tree_status == "changed_since_review": show what changed since the user saw it and ask again.
    • tree_status == "sibling_confirm": the changed files live under a repository other than the one the session was opened in. Tell the user plainly ("the session was opened at <session_repo> but the changes are under <repo_root>") and go to step 3.
    • tree_status == "safe": go to step 3.
  4. Approval rule: the user's request to commit is the approval only when every candidate is in the session's own repository, none is gated, the classifier returned safe with no warning other than the file-name heuristics notice, and the candidate list, diff stat and message were shown. In every other case the commit waits for an explicit yes. Any change to the candidates, the patch digest or the message after they were shown needs the approval again.

    • The diff stat shown is the classifier's diff_stat, named as such, never the output of plain git diff --stat.
    • When the request to commit is the approval, show the patch digest together with the diff stat, because step 4 compares against the digest that was shown.
    • When the commit waits for an explicit yes, make one proposal: the candidate list, the classifier's diff_stat, message and patch digest, with every warning other than the file-name heuristics notice (such as a symbolic link that was not content-scanned, or an ignored file that is staged); for a candidate the profile marks as gated (for example deployment configuration, or shared tooling whose design notes must be updated in the same change), also its diff and any note update; for sibling_confirm, also the session's repository and the one the changes are under. Ask once. One explicit yes or "go" to that proposal covers every reason it was needed.
  5. Stage exactly the candidates and create the commit with the message, using the profile's commit command. Pass the paths literally: git --literal-pathspecs add -- <paths> and git --literal-pathspecs commit -m "<message>" -- <paths> (or write each path as :(literal)<path>), so a file name containing *, ?, [ or a leading : is never read as a pattern. The commit uses git's default exact-path form, git commit -- <paths>, which records only those paths; never add --include. Leave out of the add a candidate whose deletion is already staged (missing on disk, and git --literal-pathspecs ls-files -- <path> prints nothing), because git add refuses a path it cannot find; it stays in the commit paths, which commit the deletion. A candidate that git marks skip-worktree, as a sparse checkout does, is refused by the classifier with an error that names it, because git add refuses it and a commit by that path records the index version, not the file on disk; leave it out, or bring it back into the checkout first. Never stage the whole tree and never commit without exact paths. Exact paths matter because parallel sessions often share one working tree: a commit without paths sweeps another session's staged or half-finished files into yours. If the candidate set changed after approval, show it and ask again. Immediately before staging, run the classifier again with the same candidates and --expect-digest set to the patch digest that was shown, and with the same --content-scanner setting as the first run. Stage only when it returns the verdict the user approved, its patch_digest equals the digest that was shown, and no new warning appears. On any other result, such as changed_since_review, blocked, unmerged, error, a different digest or a new warning, do not stage: show what changed and ask again. After the commit, run it with --verify-commit set to the same digest, --expect-message set to a file holding the message that was shown, and the same candidates. The commit counts as verified only when commit_check is match. On mismatch, tell the user that the commit does not hold the approved content, name the commit, and do not push; whether to undo the commit is the user's decision. If the check returns tree_status error instead, show reason, tell the user the commit is unverified, and do not push until a check returns match.

  6. Never push as part of this commit gate. A push needs a separate, explicit instruction from the user, through the route the profile names. Do not infer push authority from "go".

Sensitivity heuristics

The classifier blocks files matching:

  • .env, .env.* (any extension).
  • *credentials*, *secret* (any candidate path containing those substrings, case-insensitive; the match covers the whole path, directory names included).
  • id_rsa, id_ed25519, id_ecdsa (Secure Shell (SSH) private keys).
  • *.pem, *.key, *.p12, *.pfx (certificate and key files).
  • Any file over 10 MB.

Candidate paths containing token, directory names included, get a warning, not a block. Show the warning and check the file's content before committing it.

Ignore rules, such as those in .gitignore, apply only to files git does not track. git add refuses an untracked ignored file unless it is forced with -f, but a file git already tracks is staged and committed as usual even when it matches an ignore rule, for example one added after the file was first committed. The classifier checks git check-ignore for every candidate, against the ignore rules alone, without the index. A candidate that matches a rule and is in the index, whether it was force-added or is a tracked file that matches a newer rule, gets the warning <path> (matches .gitignore but is staged); show it, because the commit records the file despite the rule. An ignored candidate that exists, is not in the index and is not already blocked by a rule above is an error, because git add would refuse it; an ignored .env, for example, is reported as blocked instead. A failed git check-ignore is an error of its own.

Commit-message style sampling

The classifier samples the last 10 commit subjects (git log -n 10 --format='%s') and detects:

  • Conventional-commit prefix usage (feat:, fix:, and so on). If 7 or more of 10 use prefixes, the suggestion uses one.
  • Subject length distribution. The suggestion aims at the median length.
  • Whether subjects start with an imperative verb.

The message text is templated from the diff stat. The user sees it before the commit; the approval rule in step 3 decides whether it also needs an explicit yes.

Out of scope

  • Pushing, force-pushing, tagging and branching. The skill is local only.
  • Pre-commit hook integration. Existing hooks fire normally when the commit runs.
  • Coordinated commits across several repositories. One repository at a time.

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

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

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

ماذا تفعل مهارة الذكاء الاصطناعي Commit And Push Gate؟

Use when the user says "commit this", "stage and commit" or "let's commit". Builds the commit from the files this session changed, classifies them against the project's commit rules (safe in the session's own repository, explicit confirmation for sibling repositories and gated paths, blocked for .env, credential and key files and files over 10 MB (megabytes); file-name heuristics, not a secret scanner, unless the profile names a content scanner), proposes a message in the repository's style and commits exactly those paths. Commits only; push is a separate instruction.

لماذا تستخدم Commit And Push Gate على TypingMind؟

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

كيف أثبّت Commit And Push Gate في TypingMind؟

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

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Commit And Push Gate؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Commit And Push Gate؟

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

هل مهارة الذكاء الاصطناعي Commit And Push Gate مجانية؟

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

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

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

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

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

عرض الكل

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

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