Logo Verify Patterns

Verify Patterns

Tổ chức
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".

Tổng quan

Nhà phát hànhAurite-ai
Kho mãagent-verifier
Tên kỹ năngverify-patterns
Sao
44
Bản fork
7
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Đầy đủ trong hướng dẫn

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Aurite-ai công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Verify Patterns trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/Aurite-ai/agent-verifier/tree/main/skills/verify-patterns
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Verify Patterns trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Verify Patterns ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Verify Patterns không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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".

Câu hỏi thường gặp

Kỹ năng AI Verify Patterns làm được gì?

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".

Vì sao nên dùng Verify Patterns trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Verify Patterns là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Verify Patterns trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Aurite-ai/agent-verifier/tree/main/skills/verify-patterns. TypingMind đọc tệp SKILL.md và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Verify Patterns?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Verify Patterns với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Verify Patterns với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Verify Patterns có miễn phí không?

Có. Kỹ năng này được Aurite-ai phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇