agent-infra: Skill for Claude Code

.agents/skills/close-codescan/SKILL.md

close-codescan is a skill for Claude Code, Codex from fitlab-ai/agent-infra. It costs 35 tokens per session (1,524 once invoked), scanned A, original, MIT.

A workflow for closing Code Scanning alerts, which are automated warnings about possible security problems in code, and recording the reason. It supports GitHub CodeQL alerts and requires an explanation before closure.

In plain words
What is it for?
Use it to inspect an open CodeQL alert, choose a closure reason, collect a sufficiently detailed explanation, confirm it, and close it.
Why use it?
It provides a documented process for deciding whether a security warning is a false alarm, intentionally unfixed, or limited to tests. This keeps closures reviewable instead of unexplained.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is fitlab-ai/agent-infra's own configuration. It tells Claude Code and Codex how to work on agent-infra itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-infra configures →

Reuse

Borrowing it

Nothing to install: this file belongs to fitlab-ai/agent-infra. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fitlab-ai/agent-infra/main/.agents/skills/close-codescan/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/fitlab-ai/agent-infra

Made for: Claude Code, Codex.

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

agentmods badge for close-codescan

README.md
[![agentmods](https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/close-codescan.svg)](https://agentmods.dev/skills/fitlab-ai/agent-infra/close-codescan)
Your own site
<a href="https://agentmods.dev/skills/fitlab-ai/agent-infra/close-codescan"><img src="https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/close-codescan.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,524 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.01524
Opus 5 $0.00017 $0.00762
Sonnet 5 $0.00007 $0.00305
Haiku 4.5 $0.00003 $0.00152

Measured today against content hash 0e0c5a3736d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

close-codescan 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 today.

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.

.agents/skills/close-codescan/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

关闭 Code Scanning 告警

--agent 取值见 .agents/rules/task-management.md「合作者 token 规范」。

关闭指定的 Code Scanning(CodeQL)告警并记录合理的关闭理由。

任务入参短号别名

如果 {task-id} 入参匹配 ^[#]?[0-9]+$(裸数字或带 # 前缀),先读取 .agents/rules/task-short-id.md 的「SKILL 入参解析」段执行解析;后续命令视 {task-id} 为解析后的全长 TASK-YYYYMMDD-HHMMSS 形式。

步骤开始:本地生命周期边界

安全告警 API 仍由本技能处理;若存在关联任务,步骤 7 只声明一个本地 lifecycle intent,由核心统一提交基础元数据、日志、归档目录和短号。

执行流程

1. 获取告警信息

执行前先读取 .agents/rules/security-alerts.md,然后运行 agent-infra-internal platform-security read --kind code-scanning --number {alert-number},解析其 JSON 结果获取告警详情。

验证告警处于 open 状态。如果已被关闭/修复,告知用户并退出。

2. 展示告警详情

Code Scanning 告警 #{alert-number}

严重程度:{security_severity_level}
规则:{rule.id} - {rule.description}
扫描工具:{tool.name}
位置:{location.path}:{location.start_line}
消息:{message}

3. 询问关闭理由

提示用户选择理由:

  1. 误报 (False Positive) - CodeQL 规则误判;代码不存在此安全问题
  2. 不会修复 (Won't Fix) - 已知问题但基于架构或业务原因不予修复
  3. 测试代码 (Used in Tests) - 仅在测试代码中出现,不影响生产环境安全
  4. 取消 - 不关闭告警

4. 要求详细说明

如果用户选择关闭(非取消),要求提供详细说明:

  • 最少 20 个字符
  • 必须清楚说明为什么可以安全关闭该告警
  • 如果是误报,说明为什么代码不存在该安全问题
  • 如果是不修复,说明技术或业务原因

5. 最终确认

即将关闭 Code Scanning 告警 #{alert-number}:

规则:{rule.id}
位置:{location.path}:{location.start_line}
原因:{选择的理由}
说明:{用户的说明}

确认?(y/N)

6. 执行关闭

将用户说明写入 {comment-file},然后运行 agent-infra-internal platform-security dismiss --kind code-scanning --number {alert-number} --reason {api-reason} --comment-file {comment-file}。解析 JSON 结果,仅当关闭状态为 appliedno-op 时继续。

API reason 映射(按 Code Scanning API):

  • 误报 -> false positive
  • 不会修复 -> won't fix
  • 测试代码 -> used in tests

7. 记录到任务(如存在)

如果有关联任务(搜索 codescan_alert_number: <alert-number>):

agent-infra-internal task-lifecycle {task-id} close-codescan --agent {standard-agent-token} \
  --alert-number {alert-number} --reason "{reason}"

status=applied|no-op 视为本地归档完成。若 API 已关闭但 lifecycle 返回 failed,必须明确报告“远端已关闭、本地待恢复”,展示 recovery steps,并以同一 intent 重试;不得手工更新 task.md、移动目录或释放短号。

Read the full file on GitHub · 138 lines

Changes

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.

  1. today Changed 0e0c5a3736d4
  2. 4d ago Changed 18065a0bec9e
  3. 8d ago First seen · 138 lines · 35 tokens per session scan A a07c24ce292a

Subscribe to this mod's changes

close-codescan is a skill published in the GitHub repository fitlab-ai/agent-infra (83 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 1,524 once invoked, about $0.0002 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.