agent-infra: Skill for Claude Code

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

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

A workflow for importing Code Scanning alerts, including CodeQL security findings, and turning them into tracked repair tasks.

In plain words
What is it for?
Use it to bring a selected Code Scanning alert into the project’s task tracking process and record its details for later repair.
Why use it?
It keeps security findings from being lost or handled informally. It creates the task structure without changing code or closing the alert.

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 →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .agents/scripts/task-short-id.js alloc "$task_id".

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/import-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 import-codescan

README.md
[![agentmods](https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/import-codescan/github.svg)](https://agentmods.dev/skills/fitlab-ai/agent-infra/import-codescan)
Your own site
<a href="https://agentmods.dev/skills/fitlab-ai/agent-infra/import-codescan"><img src="https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/import-codescan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for import-codescan

Your own site · 80×15
<a href="https://agentmods.dev/skills/fitlab-ai/agent-infra/import-codescan"><img src="https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/import-codescan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,439 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.00041 $0.01439
Opus 5 $0.00020 $0.00720
Sonnet 5 $0.00008 $0.00288
Haiku 4.5 $0.00004 $0.00144

Measured yesterday against content hash 936a52250e17, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

import-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 yesterday.

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/import-codescan/SKILL.md · 135 lines

How it starts

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

导入 Code Scanning 告警

导入指定的 Code Scanning(CodeQL)告警并创建修复任务。

行为边界 / 关键规则

  • 本技能仅负责导入告警并创建任务骨架 —— 不直接修改业务代码或关闭告警
  • 不要自动提交。绝不自动执行 git commitgit add
  • 执行本技能后,你必须立即更新 task.md 中的任务状态

任务入参短号别名

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

步骤开始:记录开始时间

本技能会创建 task.md,开始时尚无文件可写。先在内存记录开始时间 started_atdate "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/');在最后写活动日志时一次性补两条——started 行用 started_at、done 行用完成时间,二者同基名(started 行 action 加 [started] 后缀、note 用 started):

- {started_at} — **Import Codescan [started]** by {agent} — started
- {done_at} — **Import Codescan** by {agent} — {完成说明}

ai task log 会按基名把两条配对成一行(进行中 → 已完成)。约定见 .agents/rules/task-management.md 的「Activity Log started / done 双标记约定」。

执行流程

1. 获取告警信息

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

提取关键信息:

  • number:告警编号
  • state:状态(open/dismissed/fixed)
  • rule:规则信息(id、severity、description、security_severity_level)
  • tool:扫描工具信息(name、version)
  • most_recent_instance:位置(path、start_line、end_line)、消息
  • html_url:平台告警链接

2. 创建任务目录和文件

检查是否已存在该告警的任务。如果不存在,创建:

目录:.agents/workspace/active/TASK-{yyyyMMdd-HHmmss}/

任务元数据:

id: TASK-{yyyyMMdd-HHmmss}
codescan_alert_number: <alert-number>

3. 更新任务状态

获取当前时间:

date "+%Y-%m-%d %H:%M:%S%z" | sed 's/\([+-][0-9][0-9]\)\([0-9][0-9]\)$/\1:\2/'

更新 task.md:current_step -> requirement-analysis

  • 追加## Activity Log(不要覆盖之前的记录):
    - {YYYY-MM-DD HH:mm:ss±HH:MM} — **Import Codescan** by {agent} — Code Scanning alert #{alert-number} imported
    

4. 完成校验

先调用短号分配(保证注册表 entry 已分配;完成校验阶段会读取):

node .agents/scripts/task-short-id.js alloc "$task_id"

如失败(退出码非 0),按提示「归档若干任务」或「调高 task.shortIdLength」处理;不要继续执行后续步骤。

运行完成校验,确认任务产物和同步状态符合规范:

Read the full file on GitHub · 135 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday Changed 936a52250e17
  2. 5d ago Changed d67fd1e494c7
  3. 9d ago First seen · 135 lines · 41 tokens per session scan A 2a84e11fd99c

Subscribe to this mod's changes

import-codescan is a skill published in the GitHub repository fitlab-ai/agent-infra (83 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 1,439 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.

Related

Other skills, from other repositories

dream

Batch-execute SHIP-ready wishes overnight — pick wishes, orchestrate workers, review PRs, wake up to results.

automagik-dev/genie · 27 tokens

clickup

Use when managing ClickUp tasks, sprints, or comments via the cup CLI tool. Triggers: task queries, status updates, sprint tracking, creating subtasks, posting comments, threaded replies, standup summaries, searching tasks, checking overdue items, assigning tasks, listing spaces and lists, opening tasks in browser…

krodak/clickup-cli · 125 tokens

sw-do

Implement a SpecWeave increment task by task through the ledger, with evidence per task and a verified close. Use for "implement this", "start working", "continue the increment", "keep going".

anton-abyzov/specweave · 41 tokens

handoff

Write a portable, secret-scrubbed handoff doc so this work can continue in any AI tool or on any machine. Use when saying "handoff", "running out of tokens", or "continue elsewhere".

anton-abyzov/specweave · 44 tokens

linear-graphql-skill

Operate Linear workspace issues, projects, and teams through Linear GraphQL API using UXC. Use when tasks require querying or creating issues, managing projects, or interacting with Linear workflow. Supports both Personal API Key and OAuth authentication.

holon-run/uxc · 51 tokens

genie-orca-wish

Turn a brainstorm/design into an APPROVED-able wish whose Dispatch plan is the literal input to Orca tasks and Linear issues. High-reasoning pass: pre-decide everything so fast workers can execute without judgment calls.

automagik-dev/genie · 51 tokens