Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/mindspore-ai/akg/error-handlingnpx skills add mindspore-ai/akg --skill error-handlinggit clone --depth 1 https://github.com/mindspore-ai/akgWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/mindspore-ai/akg/error-handling)<a href="https://agentmods.dev/skills/mindspore-ai/akg/error-handling"><img src="https://agentmods.dev/badge/skills/mindspore-ai/akg/error-handling.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00014 | $0.02661 |
| Opus 5 | $0.00007 | $0.01331 |
| Sonnet 5 | $0.00003 | $0.00532 |
| Haiku 4.5 | $0.00001 | $0.00266 |
Grade A, and why
error-handling scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 420 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GPU代码错误处理
概述
良好的错误处理是生产级GPU代码的关键,包括编译时检查、运行时检查和调试支持。
CUDA错误检查
基础宏定义
#define CUDA_CHECK(call) \
do { \
cudaError_t error = call; \
if (error != cudaSuccess) { \
fprintf(stderr, "CUDA Error: %s:%d, ", __FILE__, __LINE__); \
fprintf(stderr, "code: %d, reason: %s\n", error, \
cudaGetErrorString(error)); \
exit(1); \
} \
} while(0)
// 使用示例
CUDA_CHECK(cudaMalloc(&d_data, size));
CUDA_CHECK(cudaMemcpy(d_data, h_data, size, cudaMemcpyHostToDevice));
Kernel启动错误检查
// Kernel启动
my_kernel<<<grid, block>>>(args);
// 检查启动错误
CUDA_CHECK(cudaGetLastError());
// 检查执行错误
CUDA_CHECK(cudaDeviceSynchronize());
C++异常封装
class CUDAException : public std::runtime_exception {
public:
CUDAException(cudaError_t error, const char* file, int line)
: std::runtime_error(
std::string("CUDA Error: ") +
cudaGetErrorString(error) +
" at " + file + ":" + std::to_string(line)
) {}
};
#define CUDA_THROW(call) \
do { \
cudaError_t error = call; \
if (error != cudaSuccess) { \
throw CUDAException(error, __FILE__, __LINE__); \
} \
} while(0)
// 使用示例
try {
CUDA_THROW(cudaMalloc(&d_data, size));
my_kernel<<<grid, block>>>(d_data);
CUDA_THROW(cudaDeviceSynchronize());
} catch (const CUDAException& e) {
std::cerr << e.what() << std::endl;
// 清理资源...
}
Kernel内边界检查
基本边界检查
__global__ void safe_kernel(float* data, int N) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
// ✅ 边界检查
if (idx < N) {
data[idx] = process(data[idx]);
}
}
2D边界检查
__global__ void safe_2d_kernel(float* data, int M, int N) {
int row = blockIdx.y * blockDim.y + threadIdx.y;
int col = blockIdx.x * blockDim.x + threadIdx.x;
// ✅ 2D边界检查
if (row < M && col < N) {
int idx = row * N + col;
data[idx] = process(data[idx]);
}
}
断言检查
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 420 lines · 14 tokens per session scan A 02cd95b8f5ee
error-handling is a skill published in the GitHub repository mindspore-ai/akg (259 stars, last pushed 26d ago), licensed Apache-2.0. It adds 14 tokens to every session and 2,661 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
military-technician
专业技术支持,精准排障.
hatch3r-bug-fix
Step-by-step bug fix workflow. Diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs, working on bug report issues, or when the user mentions a bug.
hatch3r-logical-refactor
Workflow for changing behavior or logic flow without adding new features or overhauling UI. Use when modifying business logic, data flows, behavioral rules, or working on logical refactor issues.
triton-cuda-debugging
Triton CUDA 调试排查清单和常见错误速查表,包括编译错误、运行时错误、精度问题和性能问题的诊断方法。适用于 CUDA 内核代码出现错误需要定位原因、或需要验证代码正确性的调试场景.
semhood
Use semantic code search before reading files. Find relevant chunks by intent (e.g. "where is auth handled?") via the semhood MCP server, then read only what's needed.
debug-optimize-lcp
Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…