reliable-mutations
ما الذي تفعله
تشرح هذه المهارة كيف يجب أن يجري الوكيل تغييرات قاعدة البيانات حتى تثبت فعلاً، باستخدام استدعاء دفعة واحد ثم التحقق من النتيجة. وهي مخصصة للمطورين ولكل من يتوقع حفظ عناصر كثيرة.
متى تستخدمها
- ✓عندما يجب على الوكيل حفظ عناصر كثيرة أو تحديثها دفعة واحدة.
- ✓عندما تغيّر مهمة طويلة بيانات التطبيق ويجب أن تنتهي بحفظ كل شيء.
- ✓عندما يبلّغ الوكيل عن النجاح وتحتاج إلى دليل أن البيانات خُزّنت فعلاً.
رابط المهارة
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/reliable-mutations/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“حدّث كل هذه العناصر دفعة واحدة، ثم أكّد أنها حُفظت فعلاً.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
بدلاً من حفظ صغير كثير قد يتوقف في منتصف الطريق، يرسل الوكيل المجموعة كاملة في إجراء واحد، ثم يتحقق من البيانات المخزّنة ويبلّغ بالأعداد أو المعرّفات كدليل.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Reliable Mutations
Rule
Make a change in one atomic call when the action supports it, then verify the persisted end state and report concrete proof (counts/ids). Never drive a multi-step change by looping many small writes, and never report success from a tool ✓ alone.
Why
Hosted foreground agent runs have a short soft budget so they can hand off cleanly under synchronous serverless walls. Durable background runs get a much longer budget, but they still should not rely on loops of many small writes: continuations can retry the same intent and leave partial state if each item is committed separately. One atomic call commits or fails as a unit; verification turns a hopeful ✓ into a fact.
How
- Prefer a single atomic call. If an action accepts the whole set (add many, set all, bulk update), pass the full batch in one call so it commits atomically. Check the action surface for a batch/plural form before reaching for a loop.
- Do not loop many small writes under any run budget. A sequence of N
per-item writes can still leave partial or no state when a foreground run
hands off, a background run continues, or an upstream provider fails. If no
batch action exists, that is a gap in the action layer — add or extend an
action that accepts the batch (see the
actionsskill) rather than papering over it with a loop. - Verify the end state after writing. Re-read the data (a list/read action,
a count query) and confirm the result matches intent — the right number of
rows, the expected ids/fields. Do this before you tell the user it worked,
and include the relevant verification expectation in the app's
AGENTS.md. - Report proof-of-done, not vibes. State concrete evidence: "saved 12 of 12 panels (ids …)" or "updated 5 rows". Do not infer success from the presence of a tool ✓ on an individual call.
- On a time-budget cutoff, fail loud. If the turn is cut before the change is fully committed and verified, say so explicitly and report what did persist (M of N) and what remains. Never round a partial or unverified write up to "done".
Don't
- Don't loop
for each item: write(item)for a large set in a single hosted turn. - Don't claim completion because every tool call returned ✓ — a ✓ on an aborted chunk does not mean the row was committed.
- Don't silently shrink the scope ("I added a few of them") and present it as the finished task.
- Don't try to "fix" this by asking for a longer run timeout — the budget is correct; restructure the write instead.
Related
actions— define or extend a batch/atomic action when only per-item writes exist.storing-data— where app data lives and how reads/writes are scoped.performance— avoid query waterfalls when verifying end state.- Design doc:
packages/core/docs/design/durable-agent-runs.md— the real ceiling fix (checkpointed and durable runs); this skill is the agent-facing mitigation that reduces how often the ceiling is hit.
الأسئلة الشائعة
ماذا لو لم يكن في التطبيق إجراء دفعة؟
تنص المهارة على إضافته بدلاً من تشغيل حلقة من عمليات كتابة صغيرة.
لماذا لا أثق برسالة النجاح؟
قد تظهر رسالة النجاح حتى لو فشل جزء من الكتابة، لذلك تطلب المهارة فحص البيانات المخزّنة.
هل ينطبق هذا على المهام في الخلفية؟
نعم. قد تعيد المهام في الخلفية المحاولة، لذلك يُفضَّل استدعاء واحد كل شيء أو لا شيء.
التفاصيل
الوصف الأصلي من المؤلف
How the agent must perform writes so they actually persist under the hosted foreground run budget and long-running background handoffs. Use whenever you create, update, delete, or batch-write app data — especially "do this for many items" loops, or any task where the user expects N things to end up saved.
repo: BuilderIO/agent-native
الشعبية
- نجوم GitHub
- 7.6k
- الترتيب
- #13177
- الترخيص
- MIT
- آخر تحديث
- 2/11/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
design-exploration
7.6kيساعد وكيلك على استكشاف عدة اتجاهات تصميم لواجهة المستخدم جنباً إلى جنب، ثم تختار أنت واحداً، ويحسّن الوكيل التصميم المختار.
visual-edit
7.6kيساعد وكيلك على فتح تطبيق محلي يعمل في محرر مرئي، لتراجع شاشاته الحقيقية وتحررها معاً.
turn-into-app
7.6kيحوّل سير عمل أو جدول بيانات أو مشروعاً إلى تطبيق مرئي مصقول، فيه شاشات مملوءة بالبيانات ووكيل يعمل خلف أدوات التحكم.
visual-plan
7.6kيحوّل خطة نصية عادية إلى خطة مرئية تفاعلية فيها مخططات وخرائط ملفات ومقتطفات كود وأسئلة مفتوحة.
مهارات مشابهة
api-connector-builder
280kيبني وكيلك اتصالات API جديدة على النمط الموجود، ويفيد عندما تحتاج إلى تكامل إضافي دون ابتكار طريقة جديدة للعمل.
api-design
280kيساعد وكيلك على تصميم واجهات REST API وفق أفضل الممارسات، ويوضح كيف تتواصل وكيف تُعرض الأخطاء وكيف تُنظَّم البيانات.
backend-patterns
280kيساعد وكيلك على أنماط بنية الخادم وتحسين قاعدة البيانات، ويفيد في بناء الشيفرة التي تعمل على الخادم أو مراجعتها.