Agent trace

From majiayu000/claude-skill-registry-data · View interactive version

Agent trace is an AI agent skill from the GitHub repository majiayu000/claude-skill-registry-data. Agent Trace仕様に基づくAI生成コードの帰属追跡・統計・管理スキル。編集履歴の確認、AI/人間の貢献率分析、コンプライアンス対応レポート生成。

How to use this skill

Skill file

Agent Trace - AI生成コード帰属追跡スキル

Agent Trace仕様(v0.1.0)に基づくAI生成コードの帰属追跡・管理スキル。

自動記録されたトレースの確認、統計分析、レポート生成を支援。

トリガー

以下のキーワードで発動:

機能概要

┌─────────────────────────────────────────────────────────────┐
│  Agent Trace Management                                     │
├─────────────────────────────────────────────────────────────┤
│  📊 統計表示     - AI/人間の貢献率、モデル別統計            │
│  📋 一覧表示     - 最近のトレース一覧                       │
│  🔍 検索        - ファイル別、日付別のトレース検索          │
│  📄 レポート生成 - コンプライアンス用レポート               │
│  🗄️ アーカイブ   - 古いトレースの整理                      │
└─────────────────────────────────────────────────────────────┘

使用方法

統計を確認

# プロジェクトの統計を表示
node -e "
const { TraceStore } = require('./.claude/lib/trace-store.ts');
const store = new TraceStore(process.cwd());
const stats = store.getStatistics();
console.log(JSON.stringify(stats, null, 2));
"

最近のトレースを確認

# 最新10件のトレースを表示
node -e "
const { TraceStore } = require('./.claude/lib/trace-store.ts');
const store = new TraceStore(process.cwd());
const traces = store.list(10);
traces.forEach(t => {
  console.log(\`[\${t.timestamp}] \${t.files.map(f => f.path).join(', ')}\`);
});
"

特定ファイルのトレースを検索

# src/api/auth.ts のトレース履歴を表示
node -e "
const { TraceStore } = require('./.claude/lib/trace-store.ts');
const store = new TraceStore(process.cwd());
const traces = store.findByFile('src/api/auth.ts');
console.log(JSON.stringify(traces, null, 2));
"

自動記録の仕組み

┌─────────────────────────────────────────────────────────────┐
│  自動トレース記録フロー                                     │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  Claude Code (Edit/Write)                                   │
│       │                                                     │
│       ▼                                                     │
│  PostToolUse Hook                                           │
│  (.claude/hooks/agent-trace-capture.js)                     │
│       │                                                     │
│       ▼                                                     │
│  Trace Record 生成                                          │
│  - ファイルパス                                             │
│  - 貢献者タイプ(ai)                                       │
│  - モデル情報                                               │
│  - タイムスタンプ                                           │
│  - Git commit/branch                                        │
│       │                                                     │
│       ▼                                                     │
│  .agent-trace/traces/*.json に保存                          │
│                                                             │
└─────────────────────────────────────────────────────────────┘

トレースレコード構造

{
  "version": "0.1.0",
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "timestamp": "2026-02-04T12:00:00Z",
  "files": [
    {
      "path": "src/utils/helper.ts",
      "conversations": [
        {
          "contributor_type": "ai",
          "model": "anthropic/claude-opus-4-5-20251101",
          "ranges": [{ "start_line": 1, "end_line": -1 }],
          "description": "Edit: text replacement"
        }
      ]
    }
  ],
  "vcs": {
    "type": "git",
    "commit": "abc123...",
    "branch": "main"
  },
  "tool": {
    "name": "taisun-agent",
    "version": "2.10.1"
  },
  "metadata": {
    "dev.taisun": {
      "hook": "agent-trace-capture",
      "tool_used": "Edit"
    }
  }
}

貢献者タイプ

| タイプ | コード | 説明 |

|--------|--------|------|

| 人間 | human | 人間が直接記述したコード |

| AI | ai | AIが生成したコード |

| 混合 | mixed | 人間が編集したAIコード |

| 不明 | unknown | 起源が不明なコード |

除外パターン

以下のファイルはトレース対象外(機密保護):

コマンドリファレンス

/agent-trace stats

プロジェクト全体の統計を表示

/agent-trace list [count]

最近のトレースを一覧表示(デフォルト: 10件)

/agent-trace find <file-path>

特定ファイルのトレース履歴を検索

/agent-trace report

コンプライアンス用のレポートを生成

/agent-trace archive [days]

指定日数より古いトレースをアーカイブ(デフォルト: 30日)

ストレージ構造

.agent-trace/
├── traces/           # アクティブなトレースファイル
│   ├── 2026-02-04_abc123.json
│   ├── 2026-02-04_def456.json
│   └── ...
└── archive/          # アーカイブ済みトレース
    └── 2026-01-*.json

関連ドキュメント

技術仕様

将来の拡張予定

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.