kaji: Skill for Claude Code

.claude/skills/incident-cycle/SKILL.md

incident-cycle is a skill for Claude Code from apokamo/kaji. It costs 73 tokens per session (1,569 once invoked), scanned A, original, Apache-2.0.

A manual command that runs the second-level incident investigation workflow for a GitHub issue. An incident is a reported problem that needs cause analysis and proposed responses; people make the final decision afterward.

In plain words
What is it for?
Starting the investigation cycle for an incident issue created by the first-level workflow in a GitHub environment.
Why use it?
It avoids running several investigation steps by hand while keeping labels, closure, and merging under human control.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is apokamo/kaji's own configuration. It tells Claude Code how to work on kaji 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 kaji configures →

Reuse

Borrowing it

Nothing to install: this file belongs to apokamo/kaji. 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/apokamo/kaji/main/.claude/skills/incident-cycle/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/apokamo/kaji

Made for: Claude Code.

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 incident-cycle

README.md
[![agentmods](https://agentmods.dev/badge/skills/apokamo/kaji/incident-cycle/github.svg)](https://agentmods.dev/skills/apokamo/kaji/incident-cycle)
Your own site
<a href="https://agentmods.dev/skills/apokamo/kaji/incident-cycle"><img src="https://agentmods.dev/badge/skills/apokamo/kaji/incident-cycle/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 incident-cycle

Your own site · 80×15
<a href="https://agentmods.dev/skills/apokamo/kaji/incident-cycle"><img src="https://agentmods.dev/badge/skills/apokamo/kaji/incident-cycle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,569 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.00073 $0.01569
Opus 5 $0.00036 $0.00785
Sonnet 5 $0.00015 $0.00314
Haiku 4.5 $0.00007 $0.00157

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

Security

Grade A, and why

incident-cycle 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 10d 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.

.claude/skills/incident-cycle/SKILL.md · 139 lines

How it starts

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

Incident Cycle(slash wrapper)

kaji run .kaji/wf/official/incident.yaml <incident_issue_id> を Bash 経由で起動する slash command wrapper skill(/review-cycle 同型)。第2層(インシデント原因調査・対応策提案)の手動起動の入口

  • 起動は手動のみ(#303 決定 C)。自動起動・自動昇格は実装しない。
  • 全終端は「提案」であり、ラベル遷移・クローズ・統合の実行は人間が行う。close step は無いため --before は使わない。

いつ使うか

タイミング このスキル
第1層が起票したインシデントの調査サイクルを 1 コマンドで回したい ✅ 必須
provider.type='github' の環境 ✅ 前提(incident.yamlrequires_provider: github
provider.type='github' 以外(local 等) ❌ workflow が requires_provider: github で exit 2

ワークフロー内の位置: 第1層のインシデント起票 → /incident-cycle →(人間が処遇判断)

入力

/incident-cycle <incident_issue_id>
  • $ARGUMENTS = <incident_issue_id>(第1層が起票したインシデントイシューの番号)。
  • docs/dev/skill-authoring.md § 手動実行 の規約に従い、引数は $ARGUMENTS から取得する。
  • 未指定($ARGUMENTS が空)の場合は kaji run を実行せず、stderr に usage を出して ABORT verdict を返す。

実行手順

以下の擬似コードを Claude が Bash 経由で実行する。$ARGUMENTS は slash command の引数文字列。

set -u  # set -e は外す(exit code を明示的に拾う)

# Step 1: 引数チェック(引数欠落時の ABORT 経路)
read -r ISSUE_ID _REST <<<"${ARGUMENTS:-}"
if [ -z "${ISSUE_ID:-}" ]; then
    echo "usage: /incident-cycle <incident_issue_id>" >&2
    cat <<'VERDICT_EOF'
---VERDICT---
status: ABORT
reason: |
  Missing required argument: <incident_issue_id>.
evidence: |
  $ARGUMENTS was empty or did not contain an incident_issue_id token.
suggestion: |
  Re-invoke as /incident-cycle <incident_issue_id> (e.g. /incident-cycle 314).
---END_VERDICT---
VERDICT_EOF
    exit 2
fi

# Step 2: kaji run 起動
#   stderr のみ tee で capture し、^Workflow aborted: シグナルを後で grep する。
STDERR_LOG=$(mktemp)
trap 'rm -f "$STDERR_LOG"' EXIT

kaji run .kaji/wf/official/incident.yaml "$ISSUE_ID" \
    2> >(tee "$STDERR_LOG" >&2)
EXIT=$?

HAS_ABORT_MARKER=0
if grep -q '^Workflow aborted:' "$STDERR_LOG"; then
    HAS_ABORT_MARKER=1
fi

# Step 3: verdict ブロック出力(exit code → verdict の縮約契約: 0 → PASS / 非 0 → ABORT)
if [ "$EXIT" -eq 0 ]; then
    echo
    echo "incident-cycle 完了(workflow PASS)。最終提案コメントを確認し、ラベル遷移・クローズ・バグイシュー化・統合の処遇を人間が判断してください。"
    cat <<VERDICT_EOF
---VERDICT---
status: PASS
reason: |
  incident workflow completed successfully (exit 0).
evidence: |
  kaji run .kaji/wf/official/incident.yaml $ISSUE_ID exited with code 0.
suggestion: |
  Review the final proposal comment on the incident issue and decide label transition / close / bug-issue drafting / consolidation (human judgement).
---END_VERDICT---
VERDICT_EOF
else
    # exit != 0 はすべて ABORT に縮約する。
    case "$EXIT" in
        1)
            if [ "$HAS_ABORT_MARKER" -eq 1 ]; then
                REASON="workflow ABORT verdict (exit 1, 'Workflow aborted:' marker present in stderr)"
                SUGG="Inspect the incident issue comments for the aborting step's verdict. Re-run with --from review --reset-cycle after human review if the review cycle exhausted."
            else
                REASON="exit 1 without 'Workflow aborted:' marker — possibly an unexpected exception in cli_main.py"
                SUGG="Check stderr / traceback. Re-execute the failing step manually for diagnosis."
            fi
            ;;
        2)
            REASON="definition error / config error (exit 2)"
            SUGG="Run 'kaji validate .kaji/wf/official/incident.yaml'; verify .kaji/config.toml [provider] type is github."
            ;;
        3)
            REASON="runtime error in kaji run (exit 3)"
            SUGG="Inspect stderr traceback."
            ;;
        *)
            REASON="unknown exit code $EXIT"
            SUGG="Inspect kaji run stdout/stderr."
            ;;
    esac
    cat <<VERDICT_EOF
---VERDICT---
status: ABORT
reason: |
  $REASON
evidence: |
  kaji run .kaji/wf/official/incident.yaml $ISSUE_ID exited with code $EXIT.
  Workflow aborted marker in stderr: $HAS_ABORT_MARKER (1 = present, 0 = absent).
suggestion: |
  $SUGG
---END_VERDICT---
VERDICT_EOF
fi

Read the full file on GitHub · 139 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. 10d ago First seen · 139 lines · 73 tokens per session scan A d10886f03d7f

Subscribe to this mod's changes

incident-cycle is a skill published in the GitHub repository apokamo/kaji (12 stars, last pushed 2d ago), licensed Apache-2.0. It adds 73 tokens to every session and 1,569 once invoked, about $0.0004 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.