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 commands/blueeventhorizon/swift-selena/create-code-headersgit clone --depth 1 https://github.com/BlueEventHorizon/Swift-SelenaWhat 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 | $0.00000 | $0.01050 |
| Opus 5 | $0.00000 | $0.00525 |
| Sonnet 5 | $0.00000 | $0.00210 |
| Haiku 4.5 | $0.00000 | $0.00105 |
Grade A, and why
create-code-headers 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 2d 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 — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
全SwiftファイルにAI検索可能なコードヘッダーコメントを生成・追加する
使用方法
/create-code-headers # 全ファイル対象
/create-code-headers --update # 全ファイル上書き
/create-code-headers --changed # git変更ファイルのみ
/create-code-headers DI/* # DIディレクトリ配下のみ
/create-code-headers Tools/Core/*.swift # 特定パターン
/create-code-headers StreamManager.swift MockAssertion.swift # 個別ファイル指定
モード:
- デフォルト:
[Code Header Format]マーカーがあるファイルはスキップ - --update: すべてのファイルで生成・上書き
- --changed: git変更ファイルのみ対象
ファイル指定:
- ワイルドカード対応(
*,**) - 拡張子省略時は自動的に
.swiftを追加 - 相対パス/絶対パス両対応
- 複数ファイル/パターン指定可能(スペース区切り)
実行フロー
Step 1: ファイルスキャン
スキャン方法の判定:
ファイル/パターン指定あり
実行:
引数からファイルパターンを取得
→ ワイルドカード展開(Glob)
→ 拡張子省略時は自動的に.swift追加
→ 除外パターンでフィルタリング
例:
DI/* → Glob("DI/*.swift")
Tools/Core/StreamManager → Tools/Core/StreamManager.swift
Tools/**/*.swift → そのままGlob実行
--changed の場合
実行:
git status --porcelain
処理:
- 変更ファイルリストから
.swiftファイルのみ抽出 - 除外パターンでフィルタリング
- ファイル数を表示
デフォルト・--update(引数なし)
対象ディレクトリ:
Tools/**/*.swift
Library/**/*.swift
Domain/**/*.swift
App/**/*.swift
Infrastructure/**/*.swift
DI/**/*.swift
実行:
- Glob()で対象ファイルをスキャン
- 除外パターンでフィルタリング
- ファイル数を表示
除外パターン(共通):
- ファイル名に
TestまたはTestsを含む - ファイル名が
Mockで始まる Preview Content/ディレクトリ配下
出力例:
対象ファイルをスキャン中...
✅ 対象: 166ファイル
✅ 対象: 5ファイル(--changedモード)
✅ 対象: 2ファイル(DI/*)
Step 2: 並行処理でヘッダー生成
複数Agentを並行起動:
code-header-generatorAgentを並行起動- 各Agentが1ファイルずつ処理
- 同時実行数: 5-10 Agent(システム負荷に応じて調整)
重要: 複数のTask toolを1つのメッセージで同時に呼び出す
Agent起動:
- デフォルトモード:
Task(prompt="対象ファイル: AppVersion.swift")(モード指定なし) - 更新モード:
Task(prompt="対象ファイル: AppVersion.swift, モード: update")
進捗表示:
コードヘッダー生成中...
[=========> ] 50/166 (30%)
- 生成: 30件
- スキップ: 20件
Step 3: 完了報告
出力例:
✅ コードヘッダー生成完了
処理結果:
- 対象ファイル: 166件
- 新規生成: 50件
- 更新: 0件(--updateモード時のみ)
- スキップ: 116件(既存ヘッダーあり)
- エラー: 0件
次のステップ:
- Swift-Selena MCPでDB構築(将来実装)
- search_code()で検索可能
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.
- 2d ago First seen · 134 lines · 0 tokens per session scan A d76e8e5b2c46
create-code-headers is a command published in the GitHub repository BlueEventHorizon/Swift-Selena (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,050 tokens. 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-31.
Other commands, from other repositories
kpi
PUA KPI 报告卡 — 生成段位和绩效报告。/pua:kpi。Triggers on: '/pua:kpi', 'pua kpi', 'kpi报告', '段位报告', 'performance report', 'generate kpi'.
test
Run the Kotlin unit test suite (optionally filtered to a class or method).
implement
Implement iOS features using $ARGUMENTS as the feature description.
swift6-fix
Diagnose and fix Swift 6 strict concurrency, Sendable, or MainActor isolation errors.
initialize-ios
Manual override: initialize ast-index for iOS/Swift/ObjC project.
kotlin-review
Comprehensive Kotlin code review for idiomatic patterns, null safety, coroutine safety, and security. Invokes the kotlin-reviewer agent.