شعار Verify Patterns

Verify Patterns

مؤسسة
Aurite-ai
verify-patterns

Verify AI agent patterns including loop safety, retry limits, tool consistency, context size, and graph cycle analysis. Use when asked to "verify agent patterns", "check loops", "verify tools", or "check retry limits".

نظرة عامة

الناشرAurite-ai
المستودعagent-verifier
اسم المهارةverify-patterns
النجوم
44
التفريعات
7
الملفات المرفقة
تعليمات فقط
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

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

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

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

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

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

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

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

التثبيت

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

1

التثبيت في TypingMind

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

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

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

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

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

استخدمها في TypingMind

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

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

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

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

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

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

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

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

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

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

Agent Pattern Verification

Purpose

Verify AI agent code for common anti-patterns that can cause infinite loops, runaway retries, tool mismatches, and context overflow. No telemetry or network calls of its own.

When to Use

Trigger this skill when the user asks to:

  • "verify agent patterns"
  • "check agent loops"
  • "verify tools"
  • "check retry limits"
  • "verify agent safety"

Note: For full verification including security, quality, and language-specific checks, tell the user to say "verify agent".

Process

Step 1: Detect Agent Framework

Identify the agent framework by checking imports in Python/TypeScript files:

Import PatternFramework
from langgraph or import langgraphLangGraph
from crewai or import crewaiCrewAI
from autogen or import autogenAutoGen
from langchain or import langchainLangChain
Direct openai/anthropic SDK onlyCustom

Also check for framework config files: langgraph.json, crew.yaml.

Step 2: Locate Agent Files

Find files to analyze:

Priority files:

  • graph.py, graph.ts - Agent workflow definitions
  • tools.py, tools.ts, tools/*.py, tools/*.ts - Tool implementations
  • state.py, state.ts - State schemas
  • prompts.py, prompts/*.md, system.md - Prompt templates
  • agent.py, agent.ts - Main agent logic

Directories to check:

  • src/agent/, agent/, src/, project root
  • lib/, app/, packages/

Exclude from analysis:

  • skills/ directory — these are skill definitions, not agent system prompts

Step 3: Run Pattern Checks

Check Tiers
  • [PATTERN] — Mechanical check. Apply exactly as written.
  • [HEURISTIC] — Judgment required. Mark findings clearly.

Tag every finding with [P] for pattern or [H] for heuristic.


3.1 [PATTERN] Loop Safety

Apply mechanically. Do not pass a loop because it "looks like it might terminate."

Pattern to findPass conditionSeverity
while True: in PythonA break statement exists within the same block scope⚠️ Warning if absent
for { } in GoA break or return exists within the block⚠️ Warning if absent
while (true) in TS/JSA break or return exists within the block⚠️ Warning if absent
Function calls itself recursivelyA non-recursive return path exists (base case), OR a depth/counter parameter is present⚠️ Warning if absent

[HEURISTIC] Fallback: Unrecognized Loop Patterns

After applying the pattern table, also scan for:

  • Loops where termination depends entirely on external/runtime state with no timeout
  • Generator functions that yield indefinitely without documented exit
  • Event/polling loops without timeout parameters
  • Recursive call chains across multiple functions without depth tracking

Flag as ⚠️ Warning: "Potential unbounded loop not matching known patterns — verify termination condition manually"


3.2 [PATTERN] Retry Limit Enforcement

Apply mechanically. If required parameter is absent, flag as ❌ Issue.

Python — Decorator-based:

Library/PatternRequired parameterFail condition
@retry (tenacity)stop=stop_after_attempt(n) or stop=stop_after_delay(n)stop= absent
@backoff.on_exceptionmax_tries=nmax_tries= absent

Python — HTTP client retry:

Library/PatternRequired parameterFail condition
urllib3.Retry(...)total=n where n > 0total= absent or total=0
HTTPAdapter(max_retries=Retry(...))Retry object must have total=ntotal= absent
httpx.HTTPTransport(retries=n)retries=n where n > 0retries= absent or retries=0

Python — AWS SDK (boto3):

Library/PatternRequired parameterFail condition
Config(retries={...})max_attempts > 1max_attempts absent or ≤ 1

Note: boto3 without explicit retry config uses SDK defaults (3 attempts) — do not flag absence.

JavaScript/TypeScript:

Library/PatternRequired parameterFail condition
retry(...) (async-retry)retries: n in optionsretries: absent
pRetry(...) (p-retry)retries: n in optionsretries: absent

Custom retry loops (all languages):

Pattern to findPass conditionFail condition
Loop + try/except + continueInteger counter with max checkNo counter → ❌ Issue

[HEURISTIC] Fallback: Unrecognized Retry Patterns

After applying pattern tables, scan for:

  • Functions/decorators with "retry" in name not in tables above
  • Imported modules with "retry" in package name (e.g. stamina, aiohttp_retry)
  • Loops with sleep + exception handling + re-invocation without visible counter
  • Config keys like max_retries, retry_count, attempts

Flag as ⚠️ Warning: "Potential retry pattern not matching known libraries — verify retry bounds manually"


3.3 [PATTERN] Tool Registry Consistency

Step 1: Collect defined tools

Scan tool definition files. A name found by any pattern counts as registered.

Python — decorator patterns:

PatternHow to extract name
@tool (LangChain) on defFunction name below decorator
@function_tool (OpenAI Agents SDK) on defFunction name below decorator
@tool(name="...")Use name= argument value

Python — dict/list patterns:

PatternHow to extract name
{"type": "function", "function": {"name": "..."}} (OpenAI)Value of "name" inside "function"
{"name": "...", "input_schema": {...}} (Anthropic)Top-level "name"
{"name": "...", "description": "...", "parameters": {...}}Top-level "name"
ToolNode([func1, func2, ...]) (LangGraph)Each function name in list
tools = [func1, func2] / TOOLS = [...]Each identifier in list

TypeScript/JavaScript:

PatternHow to extract name
{ type: "function", function: { name: "..." } } (OpenAI)name: inside function:
tool({ description: "...", parameters: z.object({...}) })The const variable name
new DynamicTool({ name: "...", ... }) (LangChain.js)Value of name:
zodFunction({ name: "...", ... })Value of name:

Step 2: Collect tool references from prompts

Scan .md, .txt, prompts.py for backtick-quoted identifiers naming capabilities.

Step 3: Cross-reference

FindingSeverity
Reference not in definition list❌ Issue (hallucinated tool)
Defined tool not in any prompt⚠️ Warning (undocumented tool)

[HEURISTIC] Tools never bound to LLM

Find where tools are defined and where LLM is invoked. If tools exist but are never connected to the LLM call, flag as ❌ Issue: "Tools defined but never connected to LLM invocation"

[HEURISTIC] Fallback: Unrecognized Tool Definitions

Scan for tool-like structures:

  • Dicts with both "description" and "parameters" keys
  • Functions with structured docstrings (name, params, return)
  • Variables named tools, tool_list, available_tools, functions
  • Classes with run(), execute(), or __call__() methods

Include in count and note: "Tool detected via heuristic — verify this is an intended agent tool."


3.4 [PATTERN] Context Size Awareness

Formula: token_estimate = len(file_content_chars) / 4

Content⚠️ Warning threshold❌ Issue threshold
System prompt file> 4,000 tokens> 8,000 tokens
Single tool description> 500 tokens> 1,000 tokens
All tool descriptions combined> 2,000 tokens> 4,000 tokens

Exclude: skills/ directories (loaded on demand, not embedded)

[HEURISTIC] Fallback: Borderline and Non-Standard

  • Estimates within 20% of threshold → flag with tokenizer recommendation
  • Dynamic prompts (f-strings, .format()) → flag if template alone is large
  • Multiple concatenated prompts → estimate combined size
  • Prompts with includes → note effective size may be larger

3.5 [HEURISTIC] Explicit Tool Listing

Check system prompts for:

  • Headers like "Available Tools", "You have access to"
  • Tool capability descriptions

Flag if tools are defined but not documented in system prompt.


3.6 [PATTERN] LangGraph Graph Cycle Analysis

(Only when LangGraph is detected)

Detection steps:

a. Find graph file (graph.py, graph.ts, or file with StateGraph/MessageGraph)

b. Build edge map:

  • workflow.add_edge(source, dest) — unconditional edge
  • workflow.add_conditional_edges(source, fn, mapping) — extract destinations from mapping

c. Identify cycles: nodes reachable from themselves

d. For each cycle, check if END (or "__end__") is reachable via conditional edge

ConditionSeverity
Cycle exists, END reachable via conditional✅ Pass
Cycle exists, no path to END❌ Issue
Graph has no END node❌ Issue
Node has no outgoing edges and is not END⚠️ Warning (dead-end)

Example — infinite cycle (❌ Issue):

python
workflow.add_edge("agent", "tools")
workflow.add_edge("tools", "agent")  # no path to END

Example — cycle with exit (✅ Pass):

python
workflow.add_conditional_edges("agent", should_continue, {
    "continue": "tools",
    "end": END
})
workflow.add_edge("tools", "agent")

[HEURISTIC] Fallback: Non-LangGraph Graphs

Scan for graph-like control flow:

  • State machines with transition tables
  • Custom routing with implicit cycles
  • LangGraph.js (camelCase methods)
  • CrewAI/AutoGen agent handoffs
  • Adjacency lists without termination path

Flag as ⚠️ Warning: "Potential cyclic control flow — verify termination condition exists"


Step 4: Generate Report

markdown
# Agent Pattern Verification Report

**Project:** [name or path]
**Date:** [current date]
**Framework detected:** [LangGraph | CrewAI | AutoGen | LangChain | Custom | None]
**Files analyzed:** [count]

## Summary

✅ X checks passed | ⚠️ Y warnings | ❌ Z issues

## Loop Safety

- [x] All loops have termination conditions
- [ ] ⚠️ Potential unbounded loop at `[file:line]`

## Retry Limits

- [x] All retry mechanisms have explicit limits
- [ ] ❌ Missing retry limit at `[file:line]`

## Tool Consistency

- [x] Tool registry found: X tools defined
- [ ] ❌ Y hallucinated tool references
- [ ] ⚠️ Z undocumented tools

## Context Size

- [x] System prompt within limits (~X tokens)
- [ ] ⚠️ System prompt exceeds recommended size

## Findings

> `[P]` = pattern-matched · `[H]` = heuristic

### ✅ Passing
- `[P]` [Check]: [confirmation]

### ⚠️ Warnings
- `[P|H]` [Check]: [description]
  - **Location:** [file:line]
  - **Suggestion:** [how to fix]

### ❌ Issues
- `[P|H]` [Check]: [description]
  - **Location:** [file:line]
  - **Rule:** [which rule violated]
  - **Fix:** [specific remediation]

## Recommendations

1. [Priority recommendation]
2. [Additional improvements]

For full verification including security, quality, and language-specific checks, say "verify agent".

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

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

Verify AI agent patterns including loop safety, retry limits, tool consistency, context size, and graph cycle analysis. Use when asked to "verify agent patterns", "check loops", "verify tools", or "check retry limits".

لماذا تستخدم Verify Patterns على TypingMind؟

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

كيف أثبّت Verify Patterns في TypingMind؟

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

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

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

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

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

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

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

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

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

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

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

عرض الكل

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

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