شعار Structural Code Review

Structural Code Review

المجتمع
mstfash
structural-code-review

Review code changes, pull requests, branches, or implementation plans for structural maintainability. Use when the review should be strict about architecture, abstraction quality, module boundaries, repeated logic, large-file growth, special-case branching, type contracts, service/action ownership, spaghetti control flow, or code that works but makes the codebase harder to evolve.

نظرة عامة

الناشرmstfash
المستودعskills
اسم المهارةstructural-code-review
النجوم
25
التفريعات
4
الملفات المرفقة
تعليمات فقط
الروابط
  • تعليمات بصيغة Markdown

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

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

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

  • مكتفية بذاتها

    كل ما يحتاجه النموذج موجود في التعليمات — لا ملفات إضافية لمزامنتها.

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

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

التثبيت

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

1

التثبيت في TypingMind

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

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

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

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

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

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Structural Code Review

Purpose

Use this skill to review code for structural quality rather than cosmetic cleanup. The goal is to preserve intended behavior while pushing the implementation toward fewer concepts, clearer boundaries, simpler control flow, and better long-term maintainability.

Prefer a small number of high-conviction structural findings over a long list of style nits.

Review Workflow

  1. Identify the intent of the change and the main files, modules, services, actions, and data boundaries it touches.
  2. Compare the new shape against the surrounding architecture. Look for drift from existing ownership patterns and canonical helpers.
  3. Ask whether the same behavior can be expressed with fewer branches, modes, wrappers, flags, or layers.
  4. Separate true domain rules from reusable operational mechanics. Domain orchestration should stay near the product flow; shared mechanics should live behind explicit, composable helpers or services.
  5. Check whether the change increases coupling, statefulness, file size, or reader burden.
  6. Verify that proposed structural changes preserve behavior and can be migrated safely.

Standards

Simpler Model First

Look for a reframing that deletes complexity instead of merely relocating it. Favor designs that make the implementation feel obvious after the fact: fewer concepts, fewer exception paths, and fewer facts a reader must keep in mind.

Boundaries And Ownership

Flag logic in the wrong layer. Feature-specific rules should not leak into general-purpose utilities, provider adapters, shared services, or low-level helpers. Shared mechanics should not mutate domain state or secretly own product policy.

Branching And Special Cases

Treat scattered conditionals, ad-hoc flags, nullable modes, and repeated special cases as design signals. Prefer a clearer model, dispatcher, policy object, helper, or dedicated module when the current path is becoming harder to reason about.

Abstractions Must Earn Their Keep

Reject wrappers, pass-through helpers, generic engines, and configuration systems that add indirection without reducing meaningful complexity. Prefer direct code when the abstraction does not clarify ownership, remove duplication, or protect a real boundary.

Type And Contract Cleanliness

Question any, unknown, casts, unnecessary optional fields, silent fallbacks, and loosely shaped objects when they hide an invariant. Prefer explicit inputs, structured outputs, and typed boundaries that make invalid states harder to express.

File And Module Size

Flag large-file growth when it makes the code harder to scan or when a change pushes a file toward or beyond roughly 1000 lines without a strong structural reason. Prefer focused modules, subcomponents, helpers, or services when they create real ownership boundaries.

Orchestration And Atomicity

Flag sequential orchestration when independent work is serialized for no clear reason, especially if parallel structure would also be simpler. Flag partial-update flows when related state can be left half-applied and a more atomic structure is available.

What To Flag

Escalate these as structural findings:

  • A working implementation that makes the surrounding code more tangled.
  • Repeated operational blocks copied across workflows.
  • New conditionals inserted into unrelated or already busy flows.
  • Feature checks scattered across shared code.
  • A service or helper that reaches into database state it should not own.
  • Domain policy hidden inside generic operational mechanics.
  • A large function, file, component, or action that should be decomposed.
  • Refactors that move complexity around without reducing it.
  • Generic "magic" that obscures a simple data shape or lifecycle.
  • Thin wrappers that rename an operation without clarifying anything.
  • Cast-heavy or optionality-heavy code that masks a missing contract.
  • Duplicate helpers where a canonical utility already exists.
  • Edge-case handling embedded in the middle of a core flow.
  • Temporary branches likely to become permanent debt.

Preferred Remedies

When raising a finding, suggest a concrete cleaner direction:

  • Delete an unnecessary layer or wrapper.
  • Collapse duplicate branches into one clearer flow.
  • Reframe the state model so repeated conditionals disappear.
  • Move feature-specific logic behind a dedicated abstraction.
  • Move shared mechanics into a service/helper with explicit parameters and structured returns.
  • Keep auth, policy, status transitions, and user-facing failure classification in the orchestration layer.
  • Split a large file into focused modules only when the split clarifies ownership.
  • Replace condition chains with a typed model, explicit dispatcher, or policy map.
  • Separate orchestration from business logic when they are tangled.
  • Reuse the existing canonical helper instead of adding a near-duplicate.
  • Make the boundary explicit instead of relying on casts, nullable values, or silent fallback behavior.
  • Group related updates into an atomic operation when partial state would be hard to reason about.

Output Expectations

Lead with findings ordered by structural impact. For each finding, include:

  1. The affected file and line when available.
  2. The structural problem.
  3. Why it matters for maintainability.
  4. A specific direction for a cleaner implementation.

Do not spend review attention on formatting, naming, or tiny local cleanups unless they are symptoms of a larger structural issue.

If there are no high-confidence structural issues, say so directly and mention any residual test or review risk.

Approval Bar

Do not approve a change merely because it appears to work. Push back when there is a clear:

  • structural regression in the touched area
  • missed opportunity to dramatically simplify the implementation
  • unjustified large-file or large-function growth
  • spaghetti growth from special-case branching
  • abstraction that adds indirection without simplifying ownership
  • type boundary that hides the true invariant
  • architecture boundary leak
  • duplicate of an existing canonical helper
  • decomposition opportunity that would materially reduce maintenance cost

Be direct and respectful. Major maintainability problems should sound like review blockers, not optional polish.

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

ماذا تفعل مهارة الذكاء الاصطناعي Structural Code Review؟

Review code changes, pull requests, branches, or implementation plans for structural maintainability. Use when the review should be strict about architecture, abstraction quality, module boundaries, repeated logic, large-file growth, special-case branching, type contracts, service/action ownership, spaghetti control flow, or code that works but makes the codebase harder to evolve.

لماذا تستخدم Structural Code Review على TypingMind؟

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

كيف أثبّت Structural Code Review في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/mstfash/skills/tree/main/structural-code-review. يقرأ TypingMind ملف SKILL.md الخاص بها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Structural Code Review؟

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

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Structural Code Review؟

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

هل مهارة الذكاء الاصطناعي Structural Code Review مجانية؟

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

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

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

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

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

عرض الكل

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

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