agent-infra: Skill for Claude Code

.agents/skills/restore-task/SKILL.md

restore-task is a skill for Claude Code, Codex from fitlab-ai/agent-infra. It costs 32 tokens per session (1,317 once invoked), scanned A, original, MIT.

A procedure for rebuilding a missing local task file from synchronized comments on a platform issue. The instructions are in Chinese and cover validation, staging, conflict checks, and task metadata.

In plain words
What is it for?
Use it to restore a task from an issue's comments, resolve a short issue number into a full task identifier, and place the recovered files into the managed workspace.
Why use it?
It can recover task information when the local file is missing while limiting recovery to comments with the expected synchronization markers. It also avoids overwriting an existing task directory.

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/restore-task/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 restore-task

README.md
[![agentmods](https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/restore-task.svg)](https://agentmods.dev/skills/fitlab-ai/agent-infra/restore-task)
Your own site
<a href="https://agentmods.dev/skills/fitlab-ai/agent-infra/restore-task"><img src="https://agentmods.dev/badge/skills/fitlab-ai/agent-infra/restore-task.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,317 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.00032 $0.01317
Opus 5 $0.00016 $0.00659
Sonnet 5 $0.00006 $0.00263
Haiku 4.5 $0.00003 $0.00132

Measured 8d ago against content hash eb641bef9283, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

restore-task 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 8d 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.

.agents/skills/restore-task/SKILL.md · 115 lines

How it starts

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

还原任务

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

从带有 sync 标记的平台 Issue 评论中恢复本地任务工作区文件。

行为边界 / 关键规则

  • 只从匹配 .agents/rules/issue-sync.md 标记注册表的评论恢复文件
  • 先恢复到 .agents/workspace/ 内的受控 staging,校验后由 lifecycle 原子落位到 active/{task-id}/
  • 如果目标目录已存在,立即停止并提示用户先处理目录冲突
  • 执行本技能后,你必须立即更新恢复出的 task.md

版本戳规则:创建或更新 task.md frontmatter 时,先读取 .agents/rules/version-stamp.md,并写入或刷新 agent_infra_version

任务入参短号别名

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

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

评论解析阶段不写正式 active 目录。步骤 6 的单次 restore intent 统一校验 staging,并原子完成基础元数据、started/done 日志、正式落位和短号分配。

执行步骤

1. 验证输入与环境

检查:

  • 必填参数 {issue-number}
  • 可选参数 {task-id}
  • 执行前先读取 .agents/rules/issue-pr-commands.md,并按其中的认证命令验证当前平台访问能力

如果用户传入了 {task-id},校验其格式为 TASK-{yyyyMMdd-HHmmss}

2. 获取 Issue 评论

调用 agent-infra-internal platform-comment list --issue {issue-number} 读取全部分页评论,保留原始顺序和评论 ID;平台上下文、认证和 upstream 由 internal intent 处理。

3. 确定 task-id 与待恢复文件

.agents/rules/issue-sync.md 中定义的 task、artifact 和分片 artifact 标记筛选评论。

处理规则:

  • 用户提供了 {task-id} 时,仅匹配该任务
  • 未提供时,优先从 task 评论标记推断
  • 若找不到唯一 task-id,立即停止并告知用户
  • 忽略 summary 标记评论;它是 complete-task 的聚合产物,不对应本地任务文件
  • {file-stem} 映射回文件名:
    • task -> task.md
    • analysis / analysis-r{N} -> 对应 .md
    • review-analysis / review-analysis-r{N} -> 对应 .md
    • plan / plan-r{N} -> 对应 .md
    • review-plan / review-plan-r{N} -> 对应 .md
    • code / code-r{N} -> 对应 .md
    • review-code / review-code-r{N} -> 对应 .md
    • pr-review / pr-review-r{N} -> 对应 .md

4. 处理分片并检查本地目录

执行本步骤前先读取 .agents/rules/issue-sync.md

对每个文件执行:

  • 收集单条评论或分片评论
  • task.md 评论按 issue-sync.md 中的 <details> frontmatter 格式反向拆解,提取 frontmatter 后再与正文拼合
  • 如分片标记中存在 part 和 total 序号,按 part 升序排序并校验分片完整
  • 从评论正文中提取文件内容,去掉隐藏标记、标题和页脚
  • 拼接得到最终文件内容

在写文件前检查:

  • .agents/workspace/active/{task-id}/blocked/{task-id}/completed/{task-id}/ 均不存在
  • 创建唯一 .agents/workspace/.restore-staging-* 路径,且与 active 位于同一文件系统

Read the full file on GitHub · 115 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. 8d ago First seen · 115 lines · 32 tokens per session scan A eb641bef9283

Subscribe to this mod's changes

restore-task is a skill published in the GitHub repository fitlab-ai/agent-infra (83 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 1,317 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