用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tafreeman/executionkit --skill add-pattern命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | add-pattern |
| description | Add a public LLM call pattern to ExecutionKit, including tests and documentation. |
Use this procedure only for a reusable call algorithm. Application-specific branching belongs outside the package.
Write down:
LLMProvider or ToolCallingProvider;PatternResult type, and defaults;max_cost apply;Create executionkit/patterns/my_pattern.py. Use checked_complete() or
checked_stream() so retry, budget, usage, and tracing behavior stays
consistent.
"""Implementation of the my-pattern call flow."""
from __future__ import annotations
from types import MappingProxyType
from typing import TYPE_CHECKING, Any
from executionkit.cost import CostTracker
from executionkit.engine.messages import user_message
from executionkit.patterns.base import checked_complete
from executionkit.types import PatternResult, TokenUsage
if TYPE_CHECKING:
from executionkit.engine.retry import RetryConfig
from executionkit.observability import TraceCallback
from executionkit.provider import LLMProvider
async def my_pattern(
provider: LLMProvider,
prompt: str,
*,
max_tokens: int = 4096,
max_cost: TokenUsage | None = None,
retry: RetryConfig | None = None,
trace: TraceCallback | None = None,
) -> PatternResult[str]:
"""Return one checked completion."""
tracker = CostTracker()
messages: list[dict[str, Any]] = [user_message(prompt)]
response = await checked_complete(
provider,
messages,
tracker,
max_cost,
retry,
trace,
max_tokens=max_tokens,
)
return PatternResult(
value=response.content,
cost=tracker.to_usage(),
metadata=MappingProxyType({}),
)
Validate arguments before the first provider call. Document every public parameter, metadata key, and raised library error in the function docstring.
Update:
executionkit/patterns/__init__.py;executionkit/__init__.py and its alphabetical __all__; andexecutionkit/__init__.py.The sync wrapper must use _run_sync() and must not duplicate pattern logic.
Use MockProvider; normal tests must not call a network endpoint. Cover:
Add a named failure case to tests/eval_failure_cases.py only when the pattern
introduces a distinct model-output failure mode.
Create docs/patterns/my-pattern.md with:
Also update:
docs/index.md;docs/patterns/index.md;docs/api/index.md and docs/api/core.md;scripts/check_doc_facts.py PATTERN_SLUGS;docs/architecture.md; andCHANGELOG.md.Add or update an ADR if the pattern changes an architecture boundary.
Run the repository validation skill. At minimum, the doc-fact check, strict documentation build, lint, formatting, strict type checking, and full test suite must pass.