{"id":"f83b38c3-27a7-49bf-8282-5a4dedef20e2","entityType":"agent","slug":"clawhub-leeshunee-git-log-tracker","name":"Git Log Tracker (Commit Index & Query CLI)","canonicalUrl":"https://www.xpersona.co/agent/clawhub-leeshunee-git-log-tracker","canonicalPath":"/agent/clawhub-leeshunee-git-log-tracker","generatedAt":"2026-10-11T17:41:19.396Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":null},"description":"Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite data...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1782xm9gtwjg6m1vnxsad9zc583qs9v:git-log-tracker","sourceUrl":"https://clawhub.ai/leeshunee/git-log-tracker","homepage":"https://clawhub.ai/leeshunee/skills/git-log-tracker","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/leeshunee/git-log-tracker","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/leeshunee/skills/git-log-tracker","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Git Log Tracker (Commit Index & Query CLI) technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":null},"stars":null,"forks":null,"downloads":1045,"packageName":null,"latestVersion":"0.7.0","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:58:41.032Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T14:58:41.045Z","lastCrawledAt":"2026-10-11T14:58:41.032Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T14:58:41.032Z","lastVerifiedAt":null,"highlights":[{"version":"0.7.0","createdAt":"2026-07-16T08:57:27.498Z","changelog":"新增 Codex 插件适配并完善跨平台安装与运行说明。","fileCount":29,"zipByteSize":63776},{"version":"0.6.0","createdAt":"2026-06-04T10:07:04.152Z","changelog":"新增 scan 命令批量扫描已有仓库并安装 hook","fileCount":26,"zipByteSize":50847},{"version":"0.5.0","createdAt":"2026-06-01T06:07:06.465Z","changelog":"迁移到 Alembic + SQLAlchemy schema 管理：引入 Alembic 迁移框架与 SQLAlchemy 模型、新增 migrate CLI 命令、db.py 改用 Alembic upgrade 替换硬编码 SCHEMA、修复 env.py sys.path 使迁移在任意 cwd 可用。新增依赖 sqlalchemy>=2.0、alembic>=1.13。","fileCount":15,"zipByteSize":32632},{"version":"0.4.0","createdAt":"2026-05-29T09:45:08.373Z","changelog":"新增仓库级 label 标签过滤功能：label add/rm/list 子命令；list/stats 支持 --label 过滤；标签存储于 labels.json，兼容正反斜杠路径","fileCount":12,"zipByteSize":30573},{"version":"0.3.0","createdAt":"2026-05-29T08:01:19.188Z","changelog":"新增 reinstall 命令，支持重置数据目录；新增 --keep-config 参数保留配置","fileCount":12,"zipByteSize":27996}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1782xm9gtwjg6m1vnxsad9zc583qs9v:git-log-tracker","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s1782xm9gtwjg6m1vnxsad9zc583qs9v:git-log-tracker` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/leeshunee/git-log-tracker before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T17:41:19.391Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-leeshunee-git-log-tracker/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":null},"readme":"Skill: Git Log Tracker (Commit Index & Query CLI)\n\nOwner: leeshunee\n\nSummary: Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite data...\n\nTags: latest:0.7.0\n\nVersion history:\n\nv0.7.0 | 2026-07-16T08:57:27.498Z | user\n\n新增 Codex 插件适配并完善跨平台安装与运行说明。\n\nv0.6.0 | 2026-06-04T10:07:04.152Z | user\n\n新增 scan 命令批量扫描已有仓库并安装 hook\n\nv0.5.0 | 2026-06-01T06:07:06.465Z | user\n\n迁移到 Alembic + SQLAlchemy schema 管理：引入 Alembic 迁移框架与 SQLAlchemy 模型、新增 migrate CLI 命令、db.py 改用 Alembic upgrade 替换硬编码 SCHEMA、修复 env.py sys.path 使迁移在任意 cwd 可用。新增依赖 sqlalchemy>=2.0、alembic>=1.13。\n\nv0.4.0 | 2026-05-29T09:45:08.373Z | user\n\n新增仓库级 label 标签过滤功能：label add/rm/list 子命令；list/stats 支持 --label 过滤；标签存储于 labels.json，兼容正反斜杠路径\n\nv0.3.0 | 2026-05-29T08:01:19.188Z | user\n\n新增 reinstall 命令，支持重置数据目录；新增 --keep-config 参数保留配置\n\nArchive index:\n\nArchive v0.7.0: 29 files, 63776 bytes\n\nFiles: AGENTS.md (12253b), CLAUDE.md (12253b), LICENSE (35823b), README.md (4279b), references/ONBOARDING.md (7386b), scripts/version-check.sh (1955b), skill-card.md (2609b), SKILL.md (7394b), src/__init__.py (98b), src/cli.py (31571b), src/config.py (3975b), src/db.py (1395b), src/hook.py (4201b), src/migrations/env.py (1362b), src/migrations/versions/001_initial_schema.py (1779b), src/models.py (906b), src/pyproject.toml (1300b), tests/conftest.py (2054b), tests/dev-integration/src/conftest.py (3212b), tests/dev-integration/src/test_cli.py (15089b), tests/dev-integration/src/test_hook.py (2054b), tests/unit/src/conftest.py (821b), tests/unit/src/test___init__.py (274b), tests/unit/src/test_cli.py (2472b), tests/unit/src/test_config.py (5119b), tests/unit/src/test_db.py (2366b), tests/unit/src/test_hook.py (4868b), tests/unit/src/test_models.py (968b), _meta.json (134b)\n\nFile v0.7.0:SKILL.md\n\n---\r\nname: git-log-tracker\r\ndisplayName: \"Git Log Tracker (Commit Index & Query CLI)\"\r\nversion: 0.7.0\r\ndescription: |\r\n  Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite database, then provides a CLI to query, list, stats, delete, and update records.\r\n  Trigger: managing git hooks, querying commit history across repos, finding which repo a commit belongs to, viewing commit statistics, recording commits to a local index.\r\n  Use this skill whenever the user mentions commit logging, commit indexing, finding commits across repos, git hook management, or wants to query their commit history in a structured way — even if they don't explicitly name the tool.\r\n---\r\n\r\n# Git Log Tracker\r\n\r\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\r\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\r\n- **GitHub**: https://github.com/KinemaClawWorkspace/git-log-tracker\r\n\r\n## ⚠️ Before First Use | 首次使用必读\r\n\r\n**首次使用此 skill 前，必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**\r\n\r\nreferences/ONBOARDING.md 采用**交互式流程**：\r\n- **Agent 必须先询问用户使用意图**（仅当前 repo / 多个 repo / 全局模式）\r\n- **根据用户选择执行相应步骤**，切勿自动执行全部命令\r\n\r\n- **首次配置** → 读取 references/ONBOARDING.md，按 Step 0 询问用户后执行\r\n- **环境不可用**（命令不存在、依赖缺失、连接失败）→ 读取 references/ONBOARDING.md Troubleshooting 排查修复\r\n- **配置完成后** → 直接使用下方 Run Commands\r\n\r\n## Overview\r\n\r\nGit Log Tracker 在每次 `git commit` 后自动将 commit 元数据写入本地 SQLite 数据库。通过 CLI 可以跨仓库查询、统计、修改和删除 commit 记录。\r\n\r\n数据存储在 `~/.commit-logs/index.db`，配置文件在 `~/.commit-logs/config.toml`。\r\n\r\n## Run Commands\r\n\r\n所有命令通过 `git-log-tracker <subcommand>` 运行。\r\n\r\n### 初始化\r\n\r\n首次安装后初始化配置和数据库：\r\n\r\n```bash\r\ngit-log-tracker setup\r\n```\r\n\r\n### Hook 管理\r\n\r\n安装 hook 到指定 repo（之后每次 commit 自动记录）：\r\n\r\n```bash\r\ngit-log-tracker install /path/to/repo\r\ngit-log-tracker install .                              # 当前 repo\r\n```\r\n\r\n检查 hook 状态：\r\n\r\n```bash\r\ngit-log-tracker status /path/to/repo\r\ngit-log-tracker status .\r\n```\r\n\r\n移除 hook：\r\n\r\n```bash\r\ngit-log-tracker uninstall /path/to/repo\r\n```\r\n\r\n扫描目录中的 git 仓库：\r\n\r\n```bash\r\ngit-log-tracker scan /path/to/directory                     # 扫描并列出仓库\r\ngit-log-tracker scan /path/to/directory --depth 3           # 控制扫描深度\r\ngit-log-tracker scan /path/to/directory --install-missing   # 自动安装缺失 hook 的仓库\r\ngit-log-tracker scan /path/to/directory --interactive       # 交互式选择安装\r\ngit-log-tracker scan /path/to/directory --exclude \"*/temp/*\" --exclude \"*/.cache/*\"  # 排除路径\r\n```\r\n\r\n`scan` 输出示例：\r\n```\r\nScanning D:\\modular_dev for git repositories (depth=5)...\r\n\r\nFound 15 repositories:\r\n+----------------------------------------------------+--------------+--------------------+\r\n| Repo Path                                          | Hook Status  | Branches           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n| D:\\modular_dev\\kinema_skills                       | [OK]         | main (3)           |\r\n| D:\\modular_dev\\other_project                       | [--]         | master (1)         |\r\n| D:\\modular_dev\\legacy_app                          | [--]         | develop (5)        |\r\n+----------------------------------------------------+--------------+--------------------+\r\n\r\nSummary: 1 installed, 2 missing\r\n```\r\n\r\n全局模式（新 repo 自动带 hook）：\r\n\r\n```bash\r\ngit-log-tracker global          # 启用\r\ngit-log-tracker global --off    # 关闭\r\n```\r\n\r\n### 数据查询\r\n\r\n按 hash 查找（支持前缀匹配）：\r\n\r\n```bash\r\ngit-log-tracker find abc1234\r\n```\r\n\r\n`find` 输出示例：\r\n```\r\ncommit  abc1234def5678901234567890123456789012\r\nauthor  Lee <lee@example.com>\r\ndate    2025-05-29T14:30:00+08:00\r\nrepo    D:/modular_dev/task-tracker\r\nbranch  master\r\nsubject test(frontend): Phase 4 完成\r\n```\r\n\r\n列出最近 commit：\r\n\r\n```bash\r\ngit-log-tracker list                     # 最近 20 条\r\ngit-log-tracker list -n 50               # 最近 50 条\r\ngit-log-tracker list --repo task-tracker  # 按仓库名筛选\r\ngit-log-tracker list --author lee@example.com  # 按作者筛选\r\ngit-log-tracker list --since 2025-01-01   # 按日期筛选\r\ngit-log-tracker list --branch main        # 按分支筛选\r\ngit-log-tracker list --label work         # 按仓库标签筛选\r\n```\r\n\r\n`list` 输出为表格格式：`HASH | DATE | AUTHOR | REPO | SUBJECT`\r\n\r\n统计信息：\r\n\r\n```bash\r\ngit-log-tracker stats\r\ngit-log-tracker stats --label work        # 只统计带该标签的仓库\r\n```\r\n\r\n### 标签管理\r\n\r\n给仓库打**仓库级标签**（label），用于按\"组\"过滤查询（如 work / personal）。标签是 `repo_path` 的属性，改标签立即对该仓库全部历史 commit 生效。\r\n\r\n```bash\r\ngit-log-tracker label add . work               # 给当前仓库加 work 标签\r\ngit-log-tracker label add /path/to/repo work personal  # 一次加多个标签\r\ngit-log-tracker label rm . work                # 移除标签\r\ngit-log-tracker label list .                   # 查看某仓库的标签\r\ngit-log-tracker label list                     # 列出所有标签映射\r\n```\r\n\r\n标签存储在 `~/.commit-logs/labels.json`，结构为 `{ \"归一化repo_path\": [\"label1\", ...] }`。\r\n\r\n### 数据修改\r\n\r\n手动记录某个 repo 的最新 commit：\r\n\r\n```bash\r\ngit-log-tracker record .           # 当前 repo\r\ngit-log-tracker record /path/to/repo\r\n```\r\n\r\n删除记录：\r\n\r\n```bash\r\ngit-log-tracker delete abc1234\r\n```\r\n\r\n更新记录字段（可编辑字段：branch, commit_subject, commit_body, repo_path, repo_name）：\r\n\r\n```bash\r\ngit-log-tracker update abc1234 branch main\r\n```\r\n\r\n重置数据目录：\r\n\r\n```bash\r\ngit-log-tracker reinstall              # 删除数据目录并重新初始化\r\ngit-log-tracker reinstall --keep-config  # 只重置数据库，保留配置\r\n```\r\n\r\n### 配置\r\n\r\n编辑 `~/.commit-logs/config.toml` 管理排除列表：\r\n\r\n```toml\r\n[hooks]\r\nexclude = [\r\n    \"/tmp/*\",\r\n    # \"/path/to/specific/repo\",\r\n]\r\n\r\n[database]\r\npath = \"index.db\"\r\n```\r\n\r\n## Architecture\r\n\r\n安装后的系统结构：\r\n\r\n```\r\n~/.commit-logs/          # 数据目录（不含代码）\r\n├── config.toml          # 排除列表和数据库路径配置\r\n├── labels.json          # 仓库级标签映射（repo_path -> [labels]）\r\n├── index.db             # SQLite 数据库\r\n\r\n.git/hooks/post-commit   # Hook 文件，调用 git-log-tracker hook\r\n```\r\n\r\nCLI 工具通过 `uv tool install` 安装到系统，不在 ~/.commit-logs 中存放代码。\r\n\r\n## SQLite Schema\r\n\r\n```sql\r\ncommits(\r\n    id, commit_hash, short_hash, author_name, author_email, author_ts,\r\n    committer_name, committer_email, commit_subject, commit_body,\r\n    branch, repo_path, repo_name, parent_hashes, recorded_at\r\n)\r\n```\r\n\r\n索引：`commit_hash`(UNIQUE), `repo_path`, `author_email`, `recorded_at`\n\nFile v0.7.0:README.md\n\n# Git Log Tracker\r\n\r\nGit post-commit hook + SQLite 索引工具。自动记录每次 commit 的元数据，支持跨仓库查询、统计和管理。\r\n\r\n## 核心特性\r\n\r\n> **一句话**：安装 hook → 每次 commit 自动入库 → 跨仓库查询 / 统计 / 管理\r\n\r\n### 自动记录\r\n\r\nGit post-commit hook 自动写入 commit 元数据（hash、author、branch、repo、subject）到本地 SQLite 数据库。\r\n\r\n### 跨仓库查询\r\n\r\n- 按 hash、仓库、作者、日期、分支、标签筛选\r\n- 支持前缀匹配查找 commit\r\n- 查找某个 commit 属于哪个仓库\r\n\r\n### 仓库标签\r\n\r\n- 给仓库打**仓库级标签**（label），按\"组\"过滤（如 work / personal）\r\n- `list --label` / `stats --label` 只显示带该标签的仓库\r\n- 标签即时对该仓库全部历史 commit 生效\r\n\r\n### 统计与管理\r\n\r\n- 按仓库 / 作者聚合统计\r\n- CRUD 操作：record / delete / update\r\n- 全局模式：新 repo 自动安装 hook\r\n- 排除规则：fnmatch 通配符排除指定路径\r\n\r\n## 安装\r\n\r\n### 方法一：通过 Codex Marketplace\r\n\r\n```powershell\r\ncodex plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace.git\r\ncodex plugin add git-log-tracker@kinema-skills-marketplace\r\n```\r\n\r\n安装后新开一个 Codex 对话。\r\n\r\n### 方法二：通过 Claude Code Marketplace\r\n\r\n1. 添加 Marketplace：\r\n\r\n```\r\n/plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace\r\n```\r\n\r\n2. 安装 Skill：\r\n\r\n```\r\n/plugin install git-log-tracker@kinema-skills-marketplace\r\n```\r\n\r\n3. 查看已安装的 Skill：\r\n\r\n```\r\n/plugin list\r\n```\r\n\r\n### 方法三：通过 ClawHub OpenClaw\r\n\r\n```bash\r\nopenclaw skills install git-log-tracker\r\n```\r\n\r\n## 适用场景\r\n\r\n| 场景 | 说明 |\r\n|------|------|\r\n| 查找跨仓库 commit | \"abc123 这个 commit 在哪个仓库？\" |\r\n| 查看 commit 历史 | \"列出最近 50 条 commit\" |\r\n| 统计工作量 | \"统计各仓库 / 作者的 commit 数量\" |\r\n| 管理 git hooks | \"给这个仓库安装 hook\" |\r\n| 全局 hook 管理 | \"新仓库自动带 hook\" |\r\n\r\n## 触发方式\r\n\r\n本 skill 支持 Codex、Claude Code 和 OpenClaw，安装后可通过对话触发：\r\n\r\n```\r\n安装 git hook 到这个仓库\r\n查找 abc123 这个 commit\r\n列出最近的 commit\r\n统计 commit 数量\r\ngit-log-tracker setup\r\n```\r\n\r\n首次使用需完成 [references/ONBOARDING.md](references/ONBOARDING.md) 环境配置（安装 CLI 工具）。\r\n\r\n## 命令列表\r\n\r\n| 命令 | 说明 |\r\n|------|------|\r\n| `setup` | 初始化配置和数据库 |\r\n| `install <repo>` | 安装 hook 到指定仓库 |\r\n| `uninstall <repo>` | 从指定仓库移除 hook |\r\n| `status <repo>` | 检查仓库 hook 状态 |\r\n| `scan <path> [--depth] [--install-missing] [--interactive] [--exclude]` | 扫描目录中的 git 仓库，批量管理 hook |\r\n| `global [--off]` | 配置全局 git 模板 |\r\n| `find <hash>` | 按 hash 查找 commit |\r\n| `list` | 列出最近的 commits（支持 `--label` 过滤） |\r\n| `stats` | 显示统计信息（支持 `--label` 过滤） |\r\n| `label add/rm/list [repo] [labels...]` | 管理仓库级标签 |\r\n| `record [repo]` | 手动记录最新 commit |\r\n| `delete <hash>` | 删除 commit 记录 |\r\n| `update <hash> <field> <value>` | 更新 commit 字段 |\r\n| `reinstall [--keep-config]` | 重置数据目录并重新初始化 |\r\n\r\n## 文件结构\r\n\r\n```\r\ngit-log-tracker/\r\n├── .claude-plugin/plugin.json\r\n├── .codex-plugin/plugin.json\r\n├── skills/git-log-tracker/SKILL.md\r\n├── SKILL.md              # Skill 定义文件\r\n├── references/ONBOARDING.md\r\n├── README.md             # 本文档\r\n├── src/\r\n│   ├── cli.py            # CLI 入口\r\n│   ├── config.py         # 配置管理\r\n│   ├── db.py             # SQLite 数据库操作\r\n│   ├── hook.py           # Hook 脚本\r\n│   └── pyproject.toml    # Python 项目配置\r\n│                         # 标签存储于 ~/.commit-logs/labels.json\r\n└── LICENSE               # GPLv3 许可证\r\n```\r\n\r\n## 作者\r\n\r\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\r\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\r\n\r\n## 许可证\r\n\r\n[GNU General Public License v3.0](LICENSE)\n\nFile v0.7.0:_meta.json\n\n{\n  \"ownerId\": \"kn7cjsf9pc9x1tmreq1dahs90s83p9y0\",\n  \"slug\": \"git-log-tracker\",\n  \"version\": \"0.7.0\",\n  \"publishedAt\": 1784192247498\n}\n\nFile v0.7.0:references/ONBOARDING.md\n\n# Git Log Tracker Onboarding\r\n\r\n> 本文档指导 AI Agent 以**交互式方式**完成首次环境配置。\r\n> Agent 应按顺序向用户提问，根据用户选择执行相应步骤。\r\n\r\n## Prerequisites | 前置条件\r\n\r\n- Python 3.11+\r\n- `uv` 包管理器\r\n- Git\r\n\r\n## 交互流程\r\n\r\n### Step 0: 询问用户使用意图\r\n\r\n**必须先询问用户，不要自动执行！**\r\n\r\nAgent 应使用 `AskUserQuestion` 工具询问用户的使用场景：\r\n\r\n```\r\n您打算如何使用 Git Log Tracker？\r\n- 仅当前 repo\r\n- 多个 repo（手动安装到每个）\r\n- 全局模式（新 repo 自动带 hook）\r\n- 批量扫描已有仓库并安装\r\n```\r\n\r\n根据用户选择，执行不同的步骤：\r\n\r\n| 用户选择 | 执行步骤 |\r\n|----------|----------|\r\n| 仅当前 repo | Step 1-4 |\r\n| 多个 repo | Step 1-3（完成后询问具体 repo 列表） |\r\n| 全局模式 | Step 1-3 + Step 5 |\r\n| 批量扫描已有仓库 | Step 1-3 + Step 6 |\r\n\r\n---\r\n\r\n### Step 1: 安装 CLI 工具\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n#### 安装方式\r\n\r\n从本地路径安装（作为 kinema_skills 组件的一部分）：\r\n```bash\r\nuv tool install \"<plugin_root>/src\"\r\n```\r\n\r\n或使用相对路径（如果在 kinema_skills 目录下）：\r\n```bash\r\nuv tool install \"./git-log-tracker/src\"\r\n```\r\n\r\n#### 验证安装\r\n\r\n```bash\r\ngit-log-tracker --help\r\n# 期望: 显示帮助信息\r\ngit-log-tracker --version\r\n# 期望: 与 SKILL.md 和 plugin manifest 相同的当前版本\r\n```\r\n\r\n---\r\n\r\n### Step 2: 初始化配置和数据库\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n```bash\r\ngit-log-tracker setup\r\n```\r\n\r\n此命令会：\r\n- 创建 `~/.commit-logs/` 目录\r\n- 创建默认 `config.toml` 配置文件\r\n- 初始化 SQLite 数据库\r\n\r\n#### 验证\r\n\r\n```bash\r\nls ~/.commit-logs/\r\n# 期望: config.toml, index.db\r\ngit-log-tracker stats\r\n# 期望: Total commits: 0\r\n```\r\n\r\n---\r\n\r\n### Step 3: 验证环境\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n```bash\r\ngit-log-tracker stats\r\n# 期望: 显示统计信息（初始为 0 commits）\r\n```\r\n\r\n---\r\n\r\n### Step 4: 安装 Hook 到当前 Repo\r\n\r\n**仅当用户选择\"仅当前 repo\"时执行此步骤。**\r\n\r\n#### 检测\r\n\r\n```bash\r\ngit-log-tracker status .\r\n```\r\n\r\n#### 安装\r\n\r\n```bash\r\ngit-log-tracker install .\r\n```\r\n\r\n#### 验证\r\n\r\n```bash\r\ngit-log-tracker status .\r\n# 期望: Status: installed [<repo_path>]\r\n```\r\n\r\n---\r\n\r\n### Step 5: 全局模式配置\r\n\r\n**仅当用户选择\"全局模式\"时执行此步骤。**\r\n\r\n配置 Git template 目录，使新 clone 的 repo 自动带上 hook：\r\n\r\n#### 检测\r\n\r\n```bash\r\ngit config --global --get init.templateDir\r\n```\r\n\r\n#### 安装\r\n\r\n```bash\r\ngit-log-tracker global\r\n```\r\n\r\n#### 验证\r\n\r\n```bash\r\ngit-log-tracker global --off  # 如需关闭\r\ngit config --global --get init.templateDir\r\n# 期望: ~/.git-templates\r\n```\r\n\r\n---\r\n\r\n### Step 6: 批量扫描已有仓库\r\n\r\n**仅当用户选择\"批量扫描已有仓库\"时执行此步骤。**\r\n\r\n> ⚠️ **重要提示**：全局模式（Step 5）只会影响**后续创建或 clone 的仓库**，已有仓库不会自动注入 hook。\r\n> 使用 `scan` 命令可以批量扫描并安装已有仓库的 hook。\r\n\r\n#### 扫描目录\r\n\r\n```bash\r\n# 扫描指定目录（默认深度 5）\r\ngit-log-tracker scan D:/modular_dev\r\n\r\n# 控制扫描深度\r\ngit-log-tracker scan D:/modular_dev --depth 3\r\n```\r\n\r\n输出示例：\r\n```\r\nScanning D:\\modular_dev for git repositories (depth=3)...\r\n\r\nFound 8 repositories:\r\n+----------------------------------------------------+--------------+--------------------+\r\n| Repo Path                                          | Hook Status  | Branches           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n| D:\\modular_dev\\kinema_skills\\git-log-tracker       | [OK]         | master (1)         |\r\n| D:\\modular_dev\\other_project                       | [--]         | main (1)           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n\r\nSummary: 1 installed, 1 missing\r\n```\r\n\r\n#### 批量安装\r\n\r\n扫描后可选择批量安装：\r\n\r\n```bash\r\n# 自动安装所有缺失 hook（需确认）\r\ngit-log-tracker scan D:/modular_dev --install-missing\r\n\r\n# 交互式选择安装（选择具体仓库）\r\ngit-log-tracker scan D:/modular_dev --interactive\r\n\r\n# 排除特定路径\r\ngit-log-tracker scan D:/modular_dev --exclude \"*/temp/*\" --exclude \"*/.cache/*\"\r\n```\r\n\r\n#### 常见场景\r\n\r\n| 场景 | 命令 |\r\n|------|------|\r\n| 扫描工作目录下所有仓库 | `git-log-tracker scan ~/work --depth 4` |\r\n| 扫描并安装所有缺失 hook | `git-log-tracker scan ~/work --install-missing` |\r\n| 排除临时目录后扫描 | `git-log-tracker scan ~/work --exclude \"*/tmp/*\"` |\r\n| 交互式选择安装 | `git-log-tracker scan ~/work --interactive` |\r\n\r\n#### 验证\r\n\r\n```bash\r\n# 重新扫描验证安装状态\r\ngit-log-tracker scan D:/modular_dev\r\n# 期望: Summary 显示全部 installed\r\n```\r\n\r\n---\r\n\r\n## 数据存储位置\r\n\r\n安装后的数据存储结构：\r\n\r\n```\r\n~/.commit-logs/\r\n├── config.toml     # 配置文件（排除列表等）\r\n├── index.db        # SQLite 数据库\r\n```\r\n\r\n**代码不再存储在 ~/.commit-logs/，而是通过 uv tool install 安装为系统命令。**\r\n\r\n---\r\n\r\n## Troubleshooting | 故障排除\r\n\r\n| 错误 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| `git-log-tracker: command not found` | 未安装工具 | `uv tool install D:/modular_dev/kinema_skills/git-log-tracker` |\r\n| `No module named 'tomllib'` | Python < 3.11 | 安装 Python 3.11+ |\r\n| `uv: command not found` | uv 未安装 | `curl -LsSf https://astral.sh/uv/install.sh \\| sh` |\r\n| `Hook not triggering` | hook 文件无执行权限 | `chmod +x .git/hooks/post-commit` |\r\n| `database is locked` | 多进程并发写入 | 等待其他操作完成，SQLite 自动处理 |\r\n| `No commits found` | 数据库为空或排除规则过滤了 repo | 检查 `~/.commit-logs/config.toml` 中的 exclude 列表 |\r\n| `Multiple commits match prefix` | hash 前缀太短 | 使用更长的 hash 前缀或完整 hash |\r\n| `scan: No git repositories found` | 目录下无 git 仓库或深度不足 | 增加 `--depth` 或检查路径是否正确 |\r\n| `scan: Permission denied` | 目录权限不足 | 检查目录访问权限 |\r\n\r\n---\r\n\r\n## 升级方式\r\n\r\n从旧版本升级：\r\n\r\n1. **卸载旧 hook**（如果之前已安装）：\r\n   ```bash\r\n   # 如果之前使用 scripts/ 方式安装\r\n   rm ~/.commit-logs/hook.py ~/.commit-logs/db.py ~/.commit-logs/install.py ~/.commit-logs/query.py ~/.commit-logs/setup_global.py\r\n   rm -rf ~/.commit-logs/__pycache__\r\n   ```\r\n\r\n2. **重新安装 hook**（使用新 CLI）：\r\n   ```bash\r\n   git-log-tracker install .\r\n   ```\r\n\r\n3. **数据保留**：\r\n   - `~/.commit-logs/index.db` 和 `config.toml` 无需迁移，保持原样\r\n\r\n---\r\n\r\n## 版本管理\r\n\r\n**Skill 版本与 CLI 版本绑定，更新时需同步修改以下文件：**\r\n\r\n| 文件 | 版本位置 |\r\n|------|----------|\r\n| `pyproject.toml` | `version = \"x.y.z\"` |\r\n| `src/__init__.py` | `__version__ = \"x.y.z\"` |\r\n| `SKILL.md` | `version: x.y.z` (frontmatter) |\r\n| `.claude-plugin/plugin.json` | `\"version\": \"x.y.z\"` |\r\n| `.codex-plugin/plugin.json` | `\"version\": \"x.y.z\"` |\r\n\r\n更新版本后需要重新安装 CLI：\r\n```bash\r\nuv tool install \"<plugin_root>/src\" --force\r\n```\n\nFile v0.7.0:AGENTS.md\n\n<!-- kinema-tdd-injector: injected -->\r\n<!-- generated at: 2026-06-01 | packages: src (Python) -->\r\n\r\n# 研发自动化测试规范 (CLAUDE.md)\r\n\r\n> 适用对象：Claude Code 编码代理 + 前后端研发团队\r\n> 由 `kinema-tdd-injector` skill 生成\r\n\r\n---\r\n\r\n## 1. 核心原则\r\n\r\n本项目采用 **三阶测试体系**，按运行环境隔离：\r\n\r\n| 阶段       | src 目录                            | 执行者          | 外部依赖          |\r\n| -------- | ------------------ | ------------ | ------------- |\r\n| 单元测试     | `tests/unit/src/`            | Agent 自动 / 本地 | ❌ 无           |\r\n| 开发环境集成测试 | `tests/dev-integration/src/` | Agent 自动 / 本地 | ❌ 无（Mock / MSW） |\r\n| 测试环境集成测试 | `tests/testenv-integration/src/` | **用户手动**     | ✅ 真实数据库       |\r\n\r\n\r\n---\r\n\r\n## 2. 测试路径三层命名规则\r\n\r\n测试路径由三层组合而成，**逐层强制**：\r\n\r\n| 层 | 规则 |\r\n| - | - |\r\n| **阶段层** | 测试根必为 `tests/unit/`、`tests/dev-integration/`、`tests/testenv-integration/` |\r\n| **包层** | 阶段根的下一级必为仓库顶层应用包名（本项目：`src/`）。新增顶层应用包时**必须**在所有阶段根下同步建立同名目录 |\r\n| **模块层** | 包名目录下的子目录与该包源码内部结构 **1:1 对齐**，不得压缩或省略中间目录 |\r\n\r\n### 2.1 源码根直接镜像\r\n\r\n本项目为 **flat src 布局**：源码模块平铺在 `src/` 下（无内层应用包目录），测试树直接镜像 `src/` 内的结构，**不再多套一层目录**：\r\n\r\n```\r\nsrc/db.py      → tests/unit/src/test_db.py        ✅\r\nsrc/models.py  → tests/unit/src/test_models.py    ✅\r\nsrc/cli.py     → tests/unit/src/test_cli.py       ✅\r\n```\r\n\r\n若将来 `src/` 下出现子包（如 `src/service/`），按 §2.2 规则继续镜像：`src/service/task_service.py → tests/unit/src/service/test_task_service.py`。`src/migrations/` 下的迁移脚本按 §7.3 排除，不强制测试。\r\n\r\n### 2.2 文件命名规则\r\n\r\n| 语言 | 源 | 测试 |\r\n| - | - | - |\r\n| **Python** | `<pkg-source-root>/<path>/<module>.py` | `tests/<阶段>/<pkg>/<path>/test_<module>.py` |\r\n| **TS/TSX** | `<pkg-source-root>/<path>/<Name>.ts(x)` | `tests/<阶段>/<pkg>/<path>/<Name>.test.ts(x)` |\r\n\r\n**强制约束**：\r\n- Python 测试名 = `test_` + **完整**源文件名（包括 `_router` / `_service` / `_dao` 等后缀），不许缩写、不许用功能名替代\r\n- TS 测试名 = **原始大小写**源文件名 + `.test`（PascalCase 组件保持 PascalCase，camelCase hook 保持 camelCase）\r\n- Python 与 TS 命名规范不同，是为了贴合各自社区工具链（pytest 默认匹配 `test_*`、vitest 默认匹配 `*.test.*`）\r\n\r\n### 2.3 归属判定原则\r\n\r\n测试归到哪个子目录，**只看源文件物理位置**，与功能语义、模块名含义无关：\r\n\r\n- `models/fts.py`（FTS 是搜索功能） → `models/`，**不归** `service/` 或 `search/`\r\n- 包根 `main.py`（FastAPI 入口等） → 包根 `tests/<阶段>/<pkg>/test_main.py`\r\n- `core/lifespan.py`（启动钩子） → `core/`\r\n\r\n### 2.4 测试文件拆分规则（C+D 组合）\r\n\r\n测试**原则上单文件**，用 `class`（Python）/ `describe`（TS）分组：\r\n\r\n```python\r\n# tests/unit/src/service/test_task_service.py\r\nclass TestCreate: ...\r\nclass TestQuery: ...\r\nclass TestDelete: ...\r\n```\r\n\r\n若单测试文件超过 **800 行**仍难维护，**先考虑拆源码**（源文件已职责过载），源码拆完测试自动 1:1 跟随。**禁止单独拆测试文件而源码不动**。\r\n\r\n### 2.5 测试数据文件\r\n\r\n非测试代码的辅助数据（JSON / CSV / SQL dump / 图片）一律放 `tests/data/`，按所属测试路径再镜像：\r\n\r\n```\r\ntests/data/src/service/task_service/large_input.json\r\n```\r\n\r\n- `tests/data/` 不放任何 `*.py` / `*.ts` 测试代码\r\n- 超大 fixture（GB 级 sample）走 LFS 或外部存储，**不进 git**\r\n\r\n---\r\n\r\n## 3. Agent 自动行为规范\r\n\r\n### 3.1 完成以下任务后，必须自动运行测试\r\n\r\n- bug 修复后\r\n- 新功能开发完成\r\n- 重构导致接口变更\r\n\r\n### 3.2 自动运行的命令序列\r\n\r\n**后端**（工作目录：`src/`）：\r\n\r\n```bash\r\ncd src\r\nuv run pytest ../tests/unit/src/ -v\r\nuv run pytest ../tests/dev-integration/src/ -v\r\n```\r\n\r\n\r\n**激活规则**：一律使用 `uv run`（自动管理 venv），**禁止**在命令前添加 `source .venv/bin/activate` 或 `.venv\\Scripts\\Activate.ps1`。\r\n\r\n**准入规则**：自动触发的阶段必须 **100% 通过** + 覆盖率达标，否则不得提交代码。\r\n\r\n### 3.3 测试环境集成测试（不自动运行）\r\n\r\n代码提交并部署到测试服务器后，Agent 应**生成以下指令并提示用户手动执行**：\r\n\r\n```\r\n✅ 代码已推送。请在测试服务器上手动执行后端冒烟测试：\r\n\r\n  cd src && uv run pytest ../tests/testenv-integration/src/ -v\r\n```\r\n\r\nAgent **不得**自行执行 `tests/testenv-integration/` 下的任何测试（本地无数据库连接权限，必然报错）。\r\n\r\n---\r\n\r\n## 4. 网络边界规则\r\n\r\n**原则**：**进程内（in-process）随便用，进程外（out-of-process）一律禁。**\r\n\r\n**磁盘写入不计入\"进程外 I/O\"** —— 文件读写、本地 SQLite 文件、临时目录都属于进程内允许范围。\r\n\r\n### 4.1 允禁对照表\r\n\r\n| 行为 | unit | dev-integration | testenv-integration |\r\n| - | - | - | - |\r\n| `fastapi.TestClient` / `httpx.ASGITransport` | ✅ | ✅ | ✅ |\r\n| `unittest.mock` / `pytest-mock` | ✅ | ✅ | ✅ |\r\n| MSW（前端进程内拦截） | ✅ | ✅ | — |\r\n| 文件读写 / 临时目录 | ✅ | ✅ | ✅ |\r\n| SQLite `:memory:` | ✅ | ✅ | ✅ |\r\n| SQLite 本地文件 | ✅ | ✅ | ✅ |\r\n| 连真实数据库（MySQL/PG 等远程） | ❌ | ❌ | ✅ |\r\n| 真实 HTTP 出栈（requests/urllib/未 mock httpx） | ❌ | ❌ | ✅ |\r\n| DNS 解析非 localhost | ❌ | ❌ | ✅ |\r\n| subprocess 启动网络服务 | ❌ | ❌ | ✅ |\r\n\r\n---\r\n\r\n## 5. 依赖声明\r\n\r\n### 5.1 声明源（唯一手改入口）\r\n\r\n- **后端**：`src/pyproject.toml` 的 `[project.dependencies]` 与 `[project.optional-dependencies]`\r\n\r\n### 5.2 派生锁定文件（命令生成，禁止手改）\r\n\r\n| 文件 | 用途 |\r\n| - | - |\r\n| `src/requirements.txt` | 主依赖 pin 版本（pip 兼容兜底） |\r\n| `src/requirements-test.txt` | test+dev 组 pin 版本 |\r\n| `src/uv.lock` | uv 完整解析锁 |\r\n\r\n**全部 lockfile 必须 commit 进 git。**\r\n\r\n### 5.3 改后端依赖的流程\r\n\r\n1. 编辑 `src/pyproject.toml`\r\n2. 在 `src/` 下重生派生文件：\r\n   ```bash\r\n   uv pip compile pyproject.toml -o requirements.txt\r\n   uv pip compile pyproject.toml --extra test --extra dev -o requirements-test.txt\r\n   uv lock\r\n   ```\r\n3. 将 `pyproject.toml` + 两份 `requirements*.txt` + `uv.lock` 一并 commit\r\n\r\n**禁止**：跳过 step 2、单独手改 `requirements*.txt`、用 `pip freeze` 凑 requirements。\r\n\r\n### 5.4 环境初始化\r\n\r\n```bash\r\ncd src && uv pip install -e \".[test,dev]\"\r\n```\r\n\r\n---\r\n\r\n## 6. Conftest / Fixture 治理（方案 B）\r\n\r\n### 6.1 Fixture 分层\r\n\r\n| 文件 | 职责 |\r\n| - | - |\r\n| `tests/conftest.py` | **跨阶段通用数据 fixture**：`mock_<entity>` 系列（ORM-shape MagicMock，字段统一） |\r\n| `tests/unit/src/conftest.py` | unit 特化：`mock_session`（基础 AsyncMock） |\r\n| `tests/dev-integration/src/conftest.py` | dev-integration 特化：`mock_db_session`、`client_with_mock_db`（TestClient + dependency override） |\r\n| `tests/testenv-integration/src/conftest.py` | testenv-integration 特化：`real_db_session` 等真库 fixture |\r\n\r\n### 6.2 Fixture 命名约定\r\n\r\n- **跨阶段同语义 fixture 必须同名**（如 `mock_task` 不再有 `mock_task_row` 双胞胎）\r\n- 阶段特化的会话/客户端 fixture 可以分别命名（`mock_session` vs `mock_db_session` 反映了不同上下文的真实差异）\r\n\r\n### 6.3 Fixture 定义位置\r\n\r\n- **默认**：所有 fixture 定义在对应层的 `conftest.py`\r\n- **例外**：仅当某 fixture **只服务一个测试文件**时，允许在该测试文件内 inline `@pytest.fixture`\r\n- **禁止**：在测试文件内定义需跨文件共享的 fixture（应上提到 conftest）\r\n\r\n---\r\n\r\n## 7. 覆盖率门槛\r\n\r\n### 7.1 阈值\r\n\r\n| 范围 | 总覆盖率 | 每文件兜底 |\r\n| - | - | - |\r\n| 后端 | ≥ 80% | ≥ 50% |\r\n\r\n### 7.2 计入测试阶段\r\n\r\n- **计入**：`unit/` + `dev-integration/`\r\n- **不计入**：`testenv-integration/`（本地跑不了，CI 也未必连得上真库）\r\n\r\n### 7.3 排除文件\r\n\r\n- 后端：`src/__init__.py` 及各子包 `__init__.py`、未来的 alembic 迁移脚本\r\n\r\n### 7.4 强制点：本地 git hook（双触发）\r\n\r\n| Hook | 触发 | 跑什么 |\r\n| - | - | - |\r\n| `pre-commit` | 每次 `git commit` | 快速通道：lint + 单元测试（≤ 10s） |\r\n| `pre-push` | 每次 `git push` | 全套：单元 + 集成 + 覆盖率校验 |\r\n\r\n**禁止**用 `git commit --no-verify` / `git push --no-verify` 绕过，除非已修复底层问题。\r\n\r\nhook 脚本镜像位于 `scripts/git-hooks/`，由 `init_env` 软链到 `.git/hooks/`，否则新 clone 的同事不会自动获得 hook。\r\n\r\n---\r\n\r\n## 8. 各阶段测试编写规范\r\n\r\n### 8.1 单元测试（阶段一）\r\n\r\n- **时机**：编码前或编码中（TDD 优先）\r\n- **工具**：`pytest` + `unittest.mock` / `pytest-mock`；前端 `vitest` + `@testing-library/react`\r\n- **禁止**：任何进程外 I/O（详见 §4）\r\n\r\n按以下三层从底向上验证：\r\n\r\n#### 8.1.1 模型 / 函数层\r\n\r\n```python\r\n# tests/unit/src/models/test_task.py\r\nfrom src.models import Task\r\n\r\nclass TestTaskModel:\r\n    def test_table_name(self):\r\n        assert Task.__tablename__ == \"tasks\"\r\n```\r\n\r\n#### 8.1.2 服务层逻辑\r\n\r\n```python\r\n# tests/unit/src/service/test_task_service.py\r\nfrom unittest.mock import MagicMock\r\nfrom src.service.task_service import TaskService\r\n\r\nclass TestCreate:\r\n    def test_create_returns_task(self):\r\n        service = TaskService(dao=MagicMock())\r\n        ...\r\n```\r\n\r\n#### 8.1.3 接口层契约（TestClient + 全 mock Service）\r\n\r\n```python\r\n# tests/unit/src/api/test_task_router.py\r\nfrom unittest.mock import patch\r\nfrom fastapi.testclient import TestClient\r\nfrom src.main import app\r\n\r\nclient = TestClient(app)\r\n\r\n@patch(\"src.service.task_service.TaskService.get_task\")\r\ndef test_get_task_endpoint(mock_service):\r\n    mock_service.return_value = {\"id\": \"t001\", \"title\": \"X\"}\r\n    response = client.get(\"/tasks/t001\")\r\n    assert response.status_code == 200\r\n```\r\n\r\n### 8.2 开发环境集成测试（阶段二）\r\n\r\n- **时机**：模块开发完成、提交前\r\n- **工具**：`pytest` + `unittest.mock.patch` 拦截 DAO 层；或 TestClient + dependency override\r\n- **测什么**：Controller → Service → DAO 完整调用链路\r\n\r\n### 8.3 测试环境集成测试（阶段三）\r\n\r\n- **时机**：代码部署到测试服务器后\r\n- **工具**：`pytest`，直连测试数据库（无 Mock）\r\n- **测什么**：真实 SQL、ORM 映射、事务回滚、唯一索引约束\r\n- **运行方式**：用户在测试服务器手动执行\r\n\r\n---\r\n\r\n## 9. 快速参考\r\n\r\n```bash\r\n# 后端开发中（Agent 自动触发）\r\ncd src\r\nuv run pytest ../tests/unit/src/ -v\r\nuv run pytest ../tests/dev-integration/src/ -v\r\n\r\n\r\n# 部署后冒烟（用户手动，在测试服务器）\r\ncd src && uv run pytest ../tests/testenv-integration/src/ -v\r\n```\r\n\r\n---\r\n\r\n## 10. Commit Message 规范\r\n\r\n### 10.1 标题格式\r\n\r\n格式：`<type>(<scope>): <subject>`\r\n\r\n**type**：`feat`（新功能）/ `fix`（修补 bug）/ `docs`（文档）/ `style`（格式）/ `refactor`（重构）/ `test`（测试）/ `chore`（构建/工具）\r\n\r\n**scope**：模块级（如 `api`、`dao`、`service`、`models`、`schemas`、`core`、`utils`）或跨模块（用逗号，如 `api, service`）\r\n\r\n**subject**：\r\n- 使用**中文**\r\n- 结尾不加句号\r\n- 简洁明确\r\n\r\n### 10.2 正文\r\n\r\n- 与标题空一行\r\n- **中文**详述，列表用 `-` 或 `*`\r\n- 复杂提交分小标题：主要改进 / 影响范围 / 变更细节\r\n\r\n### 10.3 脚注\r\n\r\nAI 辅助完成需署名：\r\n\r\n```\r\nCo-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>\r\n```\n\nFile v0.7.0:CLAUDE.md\n\n<!-- kinema-tdd-injector: injected -->\r\n<!-- generated at: 2026-06-01 | packages: src (Python) -->\r\n\r\n# 研发自动化测试规范 (CLAUDE.md)\r\n\r\n> 适用对象：Claude Code 编码代理 + 前后端研发团队\r\n> 由 `kinema-tdd-injector` skill 生成\r\n\r\n---\r\n\r\n## 1. 核心原则\r\n\r\n本项目采用 **三阶测试体系**，按运行环境隔离：\r\n\r\n| 阶段       | src 目录                            | 执行者          | 外部依赖          |\r\n| -------- | ------------------ | ------------ | ------------- |\r\n| 单元测试     | `tests/unit/src/`            | Agent 自动 / 本地 | ❌ 无           |\r\n| 开发环境集成测试 | `tests/dev-integration/src/` | Agent 自动 / 本地 | ❌ 无（Mock / MSW） |\r\n| 测试环境集成测试 | `tests/testenv-integration/src/` | **用户手动**     | ✅ 真实数据库       |\r\n\r\n\r\n---\r\n\r\n## 2. 测试路径三层命名规则\r\n\r\n测试路径由三层组合而成，**逐层强制**：\r\n\r\n| 层 | 规则 |\r\n| - | - |\r\n| **阶段层** | 测试根必为 `tests/unit/`、`tests/dev-integration/`、`tests/testenv-integration/` |\r\n| **包层** | 阶段根的下一级必为仓库顶层应用包名（本项目：`src/`）。新增顶层应用包时**必须**在所有阶段根下同步建立同名目录 |\r\n| **模块层** | 包名目录下的子目录与该包源码内部结构 **1:1 对齐**，不得压缩或省略中间目录 |\r\n\r\n### 2.1 源码根直接镜像\r\n\r\n本项目为 **flat src 布局**：源码模块平铺在 `src/` 下（无内层应用包目录），测试树直接镜像 `src/` 内的结构，**不再多套一层目录**：\r\n\r\n```\r\nsrc/db.py      → tests/unit/src/test_db.py        ✅\r\nsrc/models.py  → tests/unit/src/test_models.py    ✅\r\nsrc/cli.py     → tests/unit/src/test_cli.py       ✅\r\n```\r\n\r\n若将来 `src/` 下出现子包（如 `src/service/`），按 §2.2 规则继续镜像：`src/service/task_service.py → tests/unit/src/service/test_task_service.py`。`src/migrations/` 下的迁移脚本按 §7.3 排除，不强制测试。\r\n\r\n### 2.2 文件命名规则\r\n\r\n| 语言 | 源 | 测试 |\r\n| - | - | - |\r\n| **Python** | `<pkg-source-root>/<path>/<module>.py` | `tests/<阶段>/<pkg>/<path>/test_<module>.py` |\r\n| **TS/TSX** | `<pkg-source-root>/<path>/<Name>.ts(x)` | `tests/<阶段>/<pkg>/<path>/<Name>.test.ts(x)` |\r\n\r\n**强制约束**：\r\n- Python 测试名 = `test_` + **完整**源文件名（包括 `_router` / `_service` / `_dao` 等后缀），不许缩写、不许用功能名替代\r\n- TS 测试名 = **原始大小写**源文件名 + `.test`（PascalCase 组件保持 PascalCase，camelCase hook 保持 camelCase）\r\n- Python 与 TS 命名规范不同，是为了贴合各自社区工具链（pytest 默认匹配 `test_*`、vitest 默认匹配 `*.test.*`）\r\n\r\n### 2.3 归属判定原则\r\n\r\n测试归到哪个子目录，**只看源文件物理位置**，与功能语义、模块名含义无关：\r\n\r\n- `models/fts.py`（FTS 是搜索功能） → `models/`，**不归** `service/` 或 `search/`\r\n- 包根 `main.py`（FastAPI 入口等） → 包根 `tests/<阶段>/<pkg>/test_main.py`\r\n- `core/lifespan.py`（启动钩子） → `core/`\r\n\r\n### 2.4 测试文件拆分规则（C+D 组合）\r\n\r\n测试**原则上单文件**，用 `class`（Python）/ `describe`（TS）分组：\r\n\r\n```python\r\n# tests/unit/src/service/test_task_service.py\r\nclass TestCreate: ...\r\nclass TestQuery: ...\r\nclass TestDelete: ...\r\n```\r\n\r\n若单测试文件超过 **800 行**仍难维护，**先考虑拆源码**（源文件已职责过载），源码拆完测试自动 1:1 跟随。**禁止单独拆测试文件而源码不动**。\r\n\r\n### 2.5 测试数据文件\r\n\r\n非测试代码的辅助数据（JSON / CSV / SQL dump / 图片）一律放 `tests/data/`，按所属测试路径再镜像：\r\n\r\n```\r\ntests/data/src/service/task_service/large_input.json\r\n```\r\n\r\n- `tests/data/` 不放任何 `*.py` / `*.ts` 测试代码\r\n- 超大 fixture（GB 级 sample）走 LFS 或外部存储，**不进 git**\r\n\r\n---\r\n\r\n## 3. Agent 自动行为规范\r\n\r\n### 3.1 完成以下任务后，必须自动运行测试\r\n\r\n- bug 修复后\r\n- 新功能开发完成\r\n- 重构导致接口变更\r\n\r\n### 3.2 自动运行的命令序列\r\n\r\n**后端**（工作目录：`src/`）：\r\n\r\n```bash\r\ncd src\r\nuv run pytest ../tests/unit/src/ -v\r\nuv run pytest ../tests/dev-integration/src/ -v\r\n```\r\n\r\n\r\n**激活规则**：一律使用 `uv run`（自动管理 venv），**禁止**在命令前添加 `source .venv/bin/activate` 或 `.venv\\Scripts\\Activate.ps1`。\r\n\r\n**准入规则**：自动触发的阶段必须 **100% 通过** + 覆盖率达标，否则不得提交代码。\r\n\r\n### 3.3 测试环境集成测试（不自动运行）\r\n\r\n代码提交并部署到测试服务器后，Agent 应**生成以下指令并提示用户手动执行**：\r\n\r\n```\r\n✅ 代码已推送。请在测试服务器上手动执行后端冒烟测试：\r\n\r\n  cd src && uv run pytest ../tests/testenv-integration/src/ -v\r\n```\r\n\r\nAgent **不得**自行执行 `tests/testenv-integration/` 下的任何测试（本地无数据库连接权限，必然报错）。\r\n\r\n---\r\n\r\n## 4. 网络边界规则\r\n\r\n**原则**：**进程内（in-process）随便用，进程外（out-of-process）一律禁。**\r\n\r\n**磁盘写入不计入\"进程外 I/O\"** —— 文件读写、本地 SQLite 文件、临时目录都属于进程内允许范围。\r\n\r\n### 4.1 允禁对照表\r\n\r\n| 行为 | unit | dev-integration | testenv-integration |\r\n| - | - | - | - |\r\n| `fastapi.TestClient` / `httpx.ASGITransport` | ✅ | ✅ | ✅ |\r\n| `unittest.mock` / `pytest-mock` | ✅ | ✅ | ✅ |\r\n| MSW（前端进程内拦截） | ✅ | ✅ | — |\r\n| 文件读写 / 临时目录 | ✅ | ✅ | ✅ |\r\n| SQLite `:memory:` | ✅ | ✅ | ✅ |\r\n| SQLite 本地文件 | ✅ | ✅ | ✅ |\r\n| 连真实数据库（MySQL/PG 等远程） | ❌ | ❌ | ✅ |\r\n| 真实 HTTP 出栈（requests/urllib/未 mock httpx） | ❌ | ❌ | ✅ |\r\n| DNS 解析非 localhost | ❌ | ❌ | ✅ |\r\n| subprocess 启动网络服务 | ❌ | ❌ | ✅ |\r\n\r\n---\r\n\r\n## 5. 依赖声明\r\n\r\n### 5.1 声明源（唯一手改入口）\r\n\r\n- **后端**：`src/pyproject.toml` 的 `[project.dependencies]` 与 `[project.optional-dependencies]`\r\n\r\n### 5.2 派生锁定文件（命令生成，禁止手改）\r\n\r\n| 文件 | 用途 |\r\n| - | - |\r\n| `src/requirements.txt` | 主依赖 pin 版本（pip 兼容兜底） |\r\n| `src/requirements-test.txt` | test+dev 组 pin 版本 |\r\n| `src/uv.lock` | uv 完整解析锁 |\r\n\r\n**全部 lockfile 必须 commit 进 git。**\r\n\r\n### 5.3 改后端依赖的流程\r\n\r\n1. 编辑 `src/pyproject.toml`\r\n2. 在 `src/` 下重生派生文件：\r\n   ```bash\r\n   uv pip compile pyproject.toml -o requirements.txt\r\n   uv pip compile pyproject.toml --extra test --extra dev -o requirements-test.txt\r\n   uv lock\r\n   ```\r\n3. 将 `pyproject.toml` + 两份 `requirements*.txt` + `uv.lock` 一并 commit\r\n\r\n**禁止**：跳过 step 2、单独手改 `requirements*.txt`、用 `pip freeze` 凑 requirements。\r\n\r\n### 5.4 环境初始化\r\n\r\n```bash\r\ncd src && uv pip install -e \".[test,dev]\"\r\n```\r\n\r\n---\r\n\r\n## 6. Conftest / Fixture 治理（方案 B）\r\n\r\n### 6.1 Fixture 分层\r\n\r\n| 文件 | 职责 |\r\n| - | - |\r\n| `tests/conftest.py` | **跨阶段通用数据 fixture**：`mock_<entity>` 系列（ORM-shape MagicMock，字段统一） |\r\n| `tests/unit/src/conftest.py` | unit 特化：`mock_session`（基础 AsyncMock） |\r\n| `tests/dev-integration/src/conftest.py` | dev-integration 特化：`mock_db_session`、`client_with_mock_db`（TestClient + dependency override） |\r\n| `tests/testenv-integration/src/conftest.py` | testenv-integration 特化：`real_db_session` 等真库 fixture |\r\n\r\n### 6.2 Fixture 命名约定\r\n\r\n- **跨阶段同语义 fixture 必须同名**（如 `mock_task` 不再有 `mock_task_row` 双胞胎）\r\n- 阶段特化的会话/客户端 fixture 可以分别命名（`mock_session` vs `mock_db_session` 反映了不同上下文的真实差异）\r\n\r\n### 6.3 Fixture 定义位置\r\n\r\n- **默认**：所有 fixture 定义在对应层的 `conftest.py`\r\n- **例外**：仅当某 fixture **只服务一个测试文件**时，允许在该测试文件内 inline `@pytest.fixture`\r\n- **禁止**：在测试文件内定义需跨文件共享的 fixture（应上提到 conftest）\r\n\r\n---\r\n\r\n## 7. 覆盖率门槛\r\n\r\n### 7.1 阈值\r\n\r\n| 范围 | 总覆盖率 | 每文件兜底 |\r\n| - | - | - |\r\n| 后端 | ≥ 80% | ≥ 50% |\r\n\r\n### 7.2 计入测试阶段\r\n\r\n- **计入**：`unit/` + `dev-integration/`\r\n- **不计入**：`testenv-integration/`（本地跑不了，CI 也未必连得上真库）\r\n\r\n### 7.3 排除文件\r\n\r\n- 后端：`src/__init__.py` 及各子包 `__init__.py`、未来的 alembic 迁移脚本\r\n\r\n### 7.4 强制点：本地 git hook（双触发）\r\n\r\n| Hook | 触发 | 跑什么 |\r\n| - | - | - |\r\n| `pre-commit` | 每次 `git commit` | 快速通道：lint + 单元测试（≤ 10s） |\r\n| `pre-push` | 每次 `git push` | 全套：单元 + 集成 + 覆盖率校验 |\r\n\r\n**禁止**用 `git commit --no-verify` / `git push --no-verify` 绕过，除非已修复底层问题。\r\n\r\nhook 脚本镜像位于 `scripts/git-hooks/`，由 `init_env` 软链到 `.git/hooks/`，否则新 clone 的同事不会自动获得 hook。\r\n\r\n---\r\n\r\n## 8. 各阶段测试编写规范\r\n\r\n### 8.1 单元测试（阶段一）\r\n\r\n- **时机**：编码前或编码中（TDD 优先）\r\n- **工具**：`pytest` + `unittest.mock` / `pytest-mock`；前端 `vitest` + `@testing-library/react`\r\n- **禁止**：任何进程外 I/O（详见 §4）\r\n\r\n按以下三层从底向上验证：\r\n\r\n#### 8.1.1 模型 / 函数层\r\n\r\n```python\r\n# tests/unit/src/models/test_task.py\r\nfrom src.models import Task\r\n\r\nclass TestTaskModel:\r\n    def test_table_name(self):\r\n        assert Task.__tablename__ == \"tasks\"\r\n```\r\n\r\n#### 8.1.2 服务层逻辑\r\n\r\n```python\r\n# tests/unit/src/service/test_task_service.py\r\nfrom unittest.mock import MagicMock\r\nfrom src.service.task_service import TaskService\r\n\r\nclass TestCreate:\r\n    def test_create_returns_task(self):\r\n        service = TaskService(dao=MagicMock())\r\n        ...\r\n```\r\n\r\n#### 8.1.3 接口层契约（TestClient + 全 mock Service）\r\n\r\n```python\r\n# tests/unit/src/api/test_task_router.py\r\nfrom unittest.mock import patch\r\nfrom fastapi.testclient import TestClient\r\nfrom src.main import app\r\n\r\nclient = TestClient(app)\r\n\r\n@patch(\"src.service.task_service.TaskService.get_task\")\r\ndef test_get_task_endpoint(mock_service):\r\n    mock_service.return_value = {\"id\": \"t001\", \"title\": \"X\"}\r\n    response = client.get(\"/tasks/t001\")\r\n    assert response.status_code == 200\r\n```\r\n\r\n### 8.2 开发环境集成测试（阶段二）\r\n\r\n- **时机**：模块开发完成、提交前\r\n- **工具**：`pytest` + `unittest.mock.patch` 拦截 DAO 层；或 TestClient + dependency override\r\n- **测什么**：Controller → Service → DAO 完整调用链路\r\n\r\n### 8.3 测试环境集成测试（阶段三）\r\n\r\n- **时机**：代码部署到测试服务器后\r\n- **工具**：`pytest`，直连测试数据库（无 Mock）\r\n- **测什么**：真实 SQL、ORM 映射、事务回滚、唯一索引约束\r\n- **运行方式**：用户在测试服务器手动执行\r\n\r\n---\r\n\r\n## 9. 快速参考\r\n\r\n```bash\r\n# 后端开发中（Agent 自动触发）\r\ncd src\r\nuv run pytest ../tests/unit/src/ -v\r\nuv run pytest ../tests/dev-integration/src/ -v\r\n\r\n\r\n# 部署后冒烟（用户手动，在测试服务器）\r\ncd src && uv run pytest ../tests/testenv-integration/src/ -v\r\n```\r\n\r\n---\r\n\r\n## 10. Commit Message 规范\r\n\r\n### 10.1 标题格式\r\n\r\n格式：`<type>(<scope>): <subject>`\r\n\r\n**type**：`feat`（新功能）/ `fix`（修补 bug）/ `docs`（文档）/ `style`（格式）/ `refactor`（重构）/ `test`（测试）/ `chore`（构建/工具）\r\n\r\n**scope**：模块级（如 `api`、`dao`、`service`、`models`、`schemas`、`core`、`utils`）或跨模块（用逗号，如 `api, service`）\r\n\r\n**subject**：\r\n- 使用**中文**\r\n- 结尾不加句号\r\n- 简洁明确\r\n\r\n### 10.2 正文\r\n\r\n- 与标题空一行\r\n- **中文**详述，列表用 `-` 或 `*`\r\n- 复杂提交分小标题：主要改进 / 影响范围 / 变更细节\r\n\r\n### 10.3 脚注\r\n\r\nAI 辅助完成需署名：\r\n\r\n```\r\nCo-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>\r\n```\n\nFile v0.7.0:skill-card.md\n\n## Description:\n\nGit Log Tracker records Git commit metadata to a local SQLite index through post-commit hooks and provides CLI commands to query, list, summarize, label, update, and delete records.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[leeshunee](https://clawhub.ai/user/leeshunee)\n\n### License/Terms of Use:\n\nGNU General Public License v3.0\n\n## Use Case:\n\nDevelopers and engineers use this skill to install and manage a Git post-commit tracking CLI, persist commit metadata locally, and query commit history across repositories.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Persistent Git hooks and global mode can affect future commits across repositories.\n\nMitigation: Ask for explicit scope before setup, prefer current-repository installation when appropriate, and verify or remove hooks with status and uninstall commands.\n\nRisk: The local index stores commit metadata such as author emails, branch names, repository paths, and commit subjects under ~/.commit-logs.\n\nMitigation: Restrict permissions on ~/.commit-logs, avoid recording sensitive repositories, and use delete or reinstall controls deliberately.\n\nRisk: Bulk scan installation, delete or update operations, reinstall actions, and remote installer commands can change many repositories or remove stored data.\n\nMitigation: Require explicit confirmation before broad or destructive commands, avoid curl-to-shell installation when a local or package-manager install is available, and back up important records before reset operations.\n\nRisk: The artifact includes unrelated AGENTS.md and CLAUDE.md policy files.\n\nMitigation: Review and remove unrelated policy files before deploying the skill package.\n\n## Reference(s):\n\n- [Git Log Tracker Onboarding](references/ONBOARDING.md)\n- [ClawHub Skill Page](https://clawhub.ai/leeshunee/skills/git-log-tracker)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and CLI output summaries]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include local file paths, repository names, commit hashes, and SQLite-backed query results.]\n\n## Skill Version(s):\n\n0.7.0 (source: SKILL.md frontmatter, pyproject.toml, server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.7.0:src/pyproject.toml\n\n[project]\r\nname = \"git-log-tracker\"\r\nversion = \"0.7.0\"\r\ndescription = \"Git post-commit hook + SQLite commit index CLI\"\r\nrequires-python = \">=3.11\"\r\ndependencies = [\"sqlalchemy>=2.0\", \"alembic>=1.13\"]\r\n\r\n[project.optional-dependencies]\r\ntest = [\"pytest>=8\", \"pytest-cov>=5\", \"pytest-mock>=3\"]\r\ndev = [\"pytest>=8\", \"pytest-cov>=5\", \"pytest-mock>=3\"]\r\n\r\n[project.scripts]\r\ngit-log-tracker = \"cli:main\"\r\n\r\n[tool.pytest.ini_options]\r\n# pyproject 位于 src/，pytest 以 src/ 为 rootdir；pythonpath=\".\" 即把 src/ 注入\r\n# 使 flat 模块（cli/db/config/hook/models）可直接 import\r\npythonpath = [\".\"]\r\ntestpaths = [\"../tests/unit\", \"../tests/dev-integration\"]\r\n# importlib 模式：各阶段存在同名 test 文件（test_cli.py / test_hook.py），\r\n# 必须用 importlib 导入模式避免 basename 冲突\r\naddopts = \"-q --import-mode=importlib\"\r\n\r\n[tool.coverage.run]\r\n# 覆盖率统计 src/ 下源码；按 CLAUDE.md §7.3 排除 __init__.py 与迁移脚本\r\nsource = [\".\"]\r\nomit = [\"__init__.py\", \"migrations/*\", \"*/migrations/*\"]\r\n\r\n[tool.coverage.report]\r\nfail_under = 80\r\nexclude_lines = [\r\n    \"pragma: no cover\",\r\n    \"if __name__ == .__main__.:\",\r\n]\r\n\r\n[build-system]\r\nrequires = [\"hatchling\"]\r\nbuild-backend = \"hatchling.build\"\r\n\r\n[tool.hatch.build.targets.wheel]\r\npackages = [\".\"]\n\nFile v0.7.0:LICENSE\n\nGNU GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n                            Preamble\r\n\r\n  The GNU General Public License is a free, copyleft license for\r\nsoftware and other kinds of works.\r\n\r\n  The licenses for most software and other practical works are designed\r\nto take away your freedom to share and change the works.  By contrast,\r\nthe GNU General Public License is intended to guarantee your freedom to\r\nshare and change all versions of a program--to make sure it remains free\r\nsoftware for all its users.  We, the Free Software Foundation, use the\r\nGNU General Public License for most of our software; it applies also to\r\nany other work released this way by its authors.  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthem if you wish), that you receive source code or can get it if you\r\nwant it, that you can change the software or use pieces of it in new\r\nfree programs, and that you know you can do these things.\r\n\r\n  To protect your rights, we need to prevent others from denying you\r\nthese rights or asking you to surrender the rights.  Therefore, you have\r\ncertain responsibilities if you distribute copies of the software, or if\r\nyou modify it: responsibilities to respect the freedom of others.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must pass on to the recipients the same\r\nfreedoms that you received.  You must make sure that they, too, receive\r\nor can get the source code.  And you must show them these terms so they\r\nknow their rights.\r\n\r\n  Developers that use the GNU GPL protect your rights with two steps:\r\n(1) assert copyright on the software, and (2) offer you this License\r\ngiving you legal permission to copy, distribute and/or modify it.\r\n\r\n  For the developers' and authors' protection, the GPL clearly explains\r\nthat there is no warranty for this free software.  For both users' and\r\nauthors' sake, the GPL requires that modified versions be marked as\r\nchanged, so that their problems will not be attributed erroneously to\r\nauthors of previous versions.\r\n\r\n  Some devices are designed to deny users access to install or run\r\nmodified versions of the software inside them, although the manufacturer\r\ncan do so.  This is fundamentally incompatible with the aim of\r\nprotecting users' freedom to change the software.  The systematic\r\npattern of such abuse occurs in the area of products for individuals to\r\nuse, which is precisely where it is most unacceptable.  Therefore, we\r\nhave designed this version of the GPL to prohibit the practice for those\r\nproducts.  If such problems arise substantially in other domains, we\r\nstand ready to extend this provision to those domains in future versions\r\nof the GPL, as needed to protect the freedom of users.\r\n\r\n  Finally, every program is threatened constantly by software patents.\r\nStates should not allow patents to restrict development and use of\r\nsoftware on general-purpose computers, but in those that do, we wish to\r\navoid the special danger that patents applied to a free program could\r\nmake it effectively proprietary.  To prevent this, the GPL assures that\r\npatents cannot be used to render the program non-free.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\r\n                       TERMS AND CONDITIONS\r\n\r\n  0. Definitions.\r\n\r\n  \"This License\" refers to version 3 of the GNU General Public License.\r\n\r\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\r\nworks, such as semiconductor masks.\r\n\r\n  \"The Program\" refers to any copyrightable work licensed under this\r\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\r\n\"recipients\" may be individuals or organizations.\r\n\r\n  To \"modify\" a work means to copy from or adapt all or part of the work\r\nin a fashion requiring copyright permission, other than the making of an\r\nexact copy.  The resulting work is called a \"modified version\" of the\r\nearlier work or a work \"based on\" the earlier work.\r\n\r\n  A \"covered work\" means either the unmodified Program or a work based\r\non the Program.\r\n\r\n  To \"propagate\" a work means to do anything with it that, without\r\npermission, would make you directly or secondarily liable for\r\ninfringement under applicable copyright law, except executing it on a\r\ncomputer or modifying a private copy.  Propagation includes copying,\r\ndistribution (with or without modification), making available to the\r\npublic, and in some countries other activities as well.\r\n\r\n  To \"convey\" a work means any kind of propagation that enables other\r\nparties to make or receive copies.  Mere interaction with a user through\r\na computer network, with no transfer of a copy, is not conveying.\r\n\r\n  An interactive user interface displays \"Appropriate Legal Notices\"\r\nto the extent that it includes a convenient and prominently visible\r\nfeature that (1) displays an appropriate copyright notice, and (2)\r\ntells the user that there is no warranty for the work (except to the\r\nextent that warranties are provided), that licensees may convey the\r\nwork under this License, and how to view a copy of this License.  If\r\nthe interface presents a list of user commands or options, such as a\r\nmenu, a prominent item in the list meets this criterion.\r\n\r\n  1. Source Code.\r\n\r\n  The \"source code\" for a work means the preferred form of the work\r\nfor making modifications to it.  \"Object code\" means any non-source\r\nform of a work.\r\n\r\n  A \"Standard Interface\" means an interface that either is an official\r\nstandard defined by a recognized standards body, or, in the case of\r\ninterfaces specified for a particular programming language, one that\r\nis widely used among developers working in that language.\r\n\r\n  The \"System Libraries\" of an executable work include anything, other\r\nthan the work as a whole, that (a) is included in the normal form of\r\npackaging a Major Component, but which is not part of that Major\r\nComponent, and (b) serves only to enable use of the work with that\r\nMajor Component, or to implement a Standard Interface for which an\r\nimplementation is available to the public in source code form.  A\r\n\"Major Component\", in this context, means a major essential component\r\n(kernel, window system, and so on) of the specific operating system\r\n(if any) on which the executable work runs, or a compiler used to\r\nproduce the work, or an object code interpreter used to run it.\r\n\r\n  The \"Corresponding Source\" for a work in object code form means all\r\nthe source code needed to generate, install, and (for an executable\r\nwork) run the object code and to modify the work, including scripts to\r\ncontrol those activities.  However, it does not include the work's\r\nSystem Libraries, or general-purpose tools or generally available free\r\nprograms which are used unmodified in performing those activities but\r\nwhich are not part of the work.  For example, Corresponding Source\r\nincludes interface definition files associated with source files for\r\nthe work, and the source code for shared libraries and dynamically\r\nlinked subprograms that the work is specifically designed to require,\r\nsuch as by intimate data communication or control flow between those\r\nsubprograms and other parts of the work.\r\n\r\n  The Corresponding Source need not include anything that users\r\ncan regenerate automatically from other parts of the Corresponding\r\nSource.\r\n\r\n  The Corresponding Source for a work in source code form is that\r\nsame work.\r\n\r\n  2. Basic Permissions.\r\n\r\n  All rights granted under this License are granted for the term of\r\ncopyright on the Program, and are irrevocable provided the stated\r\nconditions are met.  This License explicitly affirms your unlimited\r\npermission to run the unmodified Program.  The output from running a\r\ncovered work is covered by this License only if the output, given its\r\ncontent, constitutes a covered work.  This License acknowledges your\r\nrights of fair use or other equivalent, as provided by copyright law.\r\n\r\n  You may make, run and propagate covered works that you do not\r\nconvey, without conditions so long as your license otherwise remains\r\nin force.  You may convey covered works to others for the sole purpose\r\nof having them make modifications exclusively for you, or provide you\r\nwith facilities for running those works, provided that you comply with\r\nthe terms of this License in conveying all material for which you do\r\nnot control copyright.  Those thus making or running the covered works\r\nfor you must do so exclusively on your behalf, under your direction\r\nand control, on terms that prohibit them from making any copies of\r\nyour copyrighted material outside their relationship with you.\r\n\r\n  Conveying under any other circumstances is permitted solely under\r\nthe conditions stated below.  Sublicensing is not allowed; section 10\r\nmakes it unnecessary.\r\n\r\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r\n\r\n  No covered work shall be deemed part of an effective technological\r\nmeasure under any applicable law fulfilling obligations under article\r\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\r\nsimilar laws prohibiting or restricting circumvention of such\r\nmeasures.\r\n\r\n  When you convey a covered work, you waive any legal power to forbid\r\ncircumvention of technological measures to the extent such circumvention\r\nis effected by exercising rights under this License with respect to\r\nthe covered work, and you disclaim any intention to limit operation or\r\nmodification of the work as a means of enforcing, against the work's\r\nusers, your or third parties' legal rights to forbid circumvention of\r\ntechnological measures.\r\n\r\n  4. Conveying Verbatim Copies.\r\n\r\n  You may convey verbatim copies of the Program's source code as you\r\nreceive it, in any medium, provided that you conspicuously and\r\nappropriately publish on each copy an appropriate copyright notice;\r\nkeep intact all notices stating that this License and any\r\nnon-permissive terms added in accord with section 7 apply to the code;\r\nkeep intact all notices of the absence of any warranty; and give all\r\nrecipients a copy of this License along with the Program.\r\n\r\n  You may charge any price or no price for each copy that you convey,\r\nand you may offer support or warranty protection for a fee.\r\n\r\n  5. Conveying Modified Source Versions.\r\n\r\n  You may convey a work based on the Program, or the modifications to\r\nproduce it from the Program, in the form of source code under the\r\nterms of section 4, provided that you also meet all of these conditions:\r\n\r\n    a) The work must carry prominent notices stating that you modified\r\n    it, and giving a relevant date.\r\n\r\n    b) The work must carry prominent notices stating that it is\r\n    released under this License and any conditions added under section\r\n    7.  This requirement modifies the requirement in section 4 to\r\n    \"keep intact all notices\".\r\n\r\n    c) You must license the entire work, as a whole, under this\r\n    License to anyone who comes into possession of a copy.  This\r\n    License will therefore apply, along with any applicable section 7\r\n    additional terms, to the whole of the work, and all its parts,\r\n    regardless of how they are packaged.  This License gives no\r\n    permission to license the work in any other way, but it does not\r\n    invalidate such permission if you have separately received it.\r\n\r\n    d) If the work has interactive user interfaces, each must display\r\n    Appropriate Legal Notices; however, if the Program has interactive\r\n    interfaces that do not display Appropriate Legal Notices, your\r\n    work need not make them do so.\r\n\r\n  A compilation of a covered work with other separate and independent\r\nworks, which are not by their nature extensions of the covered work,\r\nand which are not combined with it such as to form a larger program,\r\nin or on a volume of a storage or distribution medium, is called an\r\n\"aggregate\" if the compilation and its resulting copyright are not\r\nused to limit the access or legal rights of the compilation's users\r\nbeyond what the individual works permit.  Inclusion of a covered work\r\nin an aggregate does not cause this License to apply to the other\r\nparts of the aggregate.\r\n\r\n  6. Conveying Non-Source Forms.\r\n\r\n  You may convey a covered work in object code form under the terms\r\nof sections 4 and 5, provided that you also convey the\r\nmachine-readable Corresponding Source under the terms of this License,\r\nin one of these ways:\r\n\r\n    a) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by the\r\n    Corresponding Source fixed on a durable physical medium\r\n    customarily used for software interchange.\r\n\r\n    b) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by a\r\n    written offer, valid for at least three years and valid for as\r\n    long as you offer spare parts or customer support for that product\r\n    model, to give anyone who possesses the object code either (1) a\r\n    copy of the Corresponding Source for all the software in the\r\n    product that is covered by this License, on a durable physical\r\n    medium customarily used for software interchange, for a price no\r\n    more than your reasonable cost of physically performing this\r\n    conveying of source, or (2) access to copy the\r\n    Corresponding Source from a network server at no charge.\r\n\r\n    c) Convey individual copies of the object code with a copy of the\r\n    written offer to provide the Corresponding Source.  This\r\n    alternative is allowed only occasionally and noncommercially, and\r\n    only if you received the object code with such an offer, in accord\r\n    with subsection 6b.\r\n\r\n    d) Convey the object code by offering access from a designated\r\n    place (gratis or for a charge), and offer equivalent access to the\r\n    Corresponding Source in the same way through the same place at no\r\n    further charge.  You need not require recipients to copy the\r\n    Corresponding Source along with the object code.  If the place to\r\n    copy the object code is a network server, the Corresponding Source\r\n    may be on a different server (operated by you or a third party)\r\n    that supports equivalent copying facilities, provided you maintain\r\n    clear directions next to the object code saying where to find the\r\n    Corresponding Source.  Regardless of what server hosts the\r\n    Corresponding Source, you remain obligated to ensure that it is\r\n    available for as long as needed to satisfy these requirements.\r\n\r\n    e) Convey the object code using peer-to-peer transmission, provided\r\n    you inform other peers where the object code and Corresponding\r\n    Source of the work are being offered to the general public at no\r\n    charge under subsection 6d.\r\n\r\n  A separable portion of the object code, whose source code is excluded\r\nfrom the Corresponding Source as a System Library, need not be\r\nincluded in conveying the object code work.\r\n\r\n  A \"User Product\" is either (1) a \"consumer product\", which means any\r\ntangible personal property which is normally used for personal, family,\r\nor household purposes, or (2) anything designed or sold for incorporation\r\ninto a dwelling.  In determining whether a product is a consumer product,\r\ndoubtful cases shall be resolved in favor of coverage.  For a particular\r\nproduct received by a particular user, \"normally used\" refers to a\r\ntypical or common use of that class of product, regardless of the status\r\nof the particular user or of the way in which the particular user\r\nactually uses, or expects or is expected to use, the product.  A product\r\nis a consumer product regardless of whether the product has substantial\r\ncommercial, industrial or non-consumer uses, unless such uses represent\r\nthe only significant mode of use of the product.\r\n\r\n  \"Installation Information\" for a User Product means any methods,\r\nprocedures, authorization keys, or other information required to install\r\nand execute modified versions of a covered work in that User Product from\r\na modified version of its Corresponding Source.  The information must\r\nsuffice to ensure that the continued functioning of the modified object\r\ncode is in no case prevented or interfered with solely because\r\nmodification has been made.\r\n\r\n  If you convey an object code work under this section in, or with, or\r\nspecifically for use in, a User Product, and the conveying occurs as\r\npart of a transaction in which the right of possession and use of the\r\nUser Product is transferred to the recipient in perpetuity or for a\r\nfixed term (regardless of how the transaction is characterized), the\r\nCorresponding Source conveyed under this section must be accompanied\r\nby the Installation Information.  But this requirement does not apply\r\nif neither you nor any third party retains the ability to install\r\nmodified object code on the User Product (for example, the work has\r\nbeen installed in ROM).\r\n\r\n  The requirement to provide Installation Information does not include a\r\nrequirement to continue to provide support service, warranty, or updates\r\nfor a work that has been modified or installed by the recipient, or for\r\nthe User Product in which it has been modified or installed.  Access to a\r\nnetwork may be denied when the modification itself materially and\r\nadversely affects the operation of the network or violates the rules and\r\nprotocols for communication across the network.\r\n\r\n  Corresponding Source conveyed, and Installation Information provided,\r\nin accord with this section must be in a format that is publicly\r\ndocumented (and with an implementation available to the public in\r\nsource code form), and must require no special password or key for\r\nunpacking, reading or copying.\r\n\r\n  7. Additional Terms.\r\n\r\n  \"Additional permissions\" are terms that supplement the terms of this\r\nLicense by making exceptions from one or more of its conditions.\r\nAdditional permissions that are applicable to the entire Program shall\r\nbe treated as though they were included in this License, to the extent\r\nthat they are valid under applicable law.  If additional permissions\r\napply only to part of the Program, that part may be used separately\r\nunder those permissions, but the entire Program remains governed by\r\nthis License without regard to the additional permissions.\r\n\r\n  When you convey a copy of a covered work, you may at your option\r\nremove any additional permissions from that copy, or from any part of\r\nit.  (Additional permissions may be written to require their own\r\nremoval in certain cases when you modify the work.)  You may place\r\nadditional permissions on material, added by you to a covered work,\r\nfor which you have or can give appropriate copyright permission.\r\n\r\n  Notwithstanding any other provision of this License, for material you\r\nadd to a covered work, you may (if authorized by the copyright holders of\r\nthat material) supplement the terms of this License with terms:\r\n\r\n    a) Disclaiming warranty or limiting liability differently from the\r\n    terms of sections 15 and 16 of this License; or\r\n\r\n    b) Requiring preservation of specified reasonable legal notices or\r\n    author attributions in that material or in the Appropriate Legal\r\n    Notices displayed by works containing it; or\r\n\r\n    c) Prohibiting misrepresentation of the origin of that material, or\r\n    requiring that modified versions of such material be marked in\r\n    reasonable ways as different from the original version; or\r\n\r\n    d) Limiting the use for publicity purposes of names of licensors or\r\n    authors of the material; or\r\n\r\n    e) Declining to grant rights under trademark law for use of some\r\n    trade names, trademarks, or service marks; or\r\n\r\n    f) Requiring indemnification of licensors and authors of that\r\n    material by anyone who conveys the material (or modified versions of\r\n    it) with contractual assumptions of liability to the recipient, for\r\n    any liability that these contractual assumptions directly impose on\r\n    those licensors and authors.\r\n\r\n  All other non-permissive additional terms are considered \"further\r\nrestrictions\" within the meaning of section 10.  If the Program as you\r\nreceived it, or any part of it, contains a notice stating that it is\r\ngoverned by this License along with a term that is a further\r\nrestriction, you may remove that term.  If a license document contains\r\na further restriction but permits relicensing or conveying under this\r\nLicense, you may add to a covered work material governed by the terms\r\nof that license document, provided that the further restriction does\r\nnot survive such relicensing or conveying.\r\n\r\n  If you add terms to a covered work in accord with this section, you\r\nmust place, in the relevant source files, a statement of the\r\nadditional terms that apply to those files, or a notice indicating\r\nwhere to find the applicable terms.\r\n\r\n  Additional terms, permissive or non-permissive, may be stated in the\r\nform of a separately written license, or stated as exceptions;\r\nthe above requirements apply either way.\r\n\r\n  8. Termination.\r\n\r\n  You may not propagate or modify a covered work except as expressly\r\nprovided under this License.  Any attempt otherwise to propagate or\r\nmodify it is void, and will automatically terminate your rights under\r\nthis License (including any patent licenses granted under the third\r\nparagraph of section 11).\r\n\r\n  However, if you cease all violation of this License, then your\r\nlicense from a particular copyright holder is reinstated (a)\r\nprovisionally, unless and until the copyright holder explicitly and\r\nfinally terminates your license, and (b) permanently, if the copyright\r\nholder fails to notify you of the violation by some reasonable means\r\nprior to 60 days after the cessation.\r\n\r\n  Moreover, your license from a particular copyright holder is\r\nreinstated permanently if the copyright holder notifies you of the\r\nviolation by some reasonable means, this is the first time you have\r\nreceived notice of violation of this License (for any work) from that\r\ncopyright holder, and you cure the violation prior to 30 days after\r\nyour receipt of the notice.\r\n\r\n  Termination of your rights under this section does not terminate the\r\nlicenses of parties who have received copies or rights from you under\r\nthis License.  If your rights have been terminated and not permanently\r\nreinstated, you do not qualify to receive new licenses for the same\r\nmaterial under section 10.\r\n\r\n  9. Acceptance Not Required for Having Copies.\r\n\r\n  You are not required to accept this License in order to receive or\r\nrun a copy of the Program.  Ancillary propagation of a covered work\r\noccurring solely as a consequence of using peer-to-peer transmission\r\nto receive a copy likewise does not require acceptance.  However,\r\nnothing other than this License grants you permission to propagate or\r\nmodify any covered work.  These actions infringe copyright if you do\r\nnot accept this License.  Therefore, by modifying or propagating a\r\ncovered work, you indicate your acceptance of this License to do so.\r\n\r\n  10. Automatic Licensing of Downstream Recipients.\r\n\r\n  Each time you convey a covered work, the recipient automatically\r\nreceives a license from the original licensors, to run, modify and\r\npropagate that work, subject to this License.  You are not responsible\r\nfor enforcing compliance by third parties with this License.\r\n\r\n  An \"entity transaction\" is a transaction transferring control of an\r\norganization, or substantially all assets of one, or subdividing an\r\norganization, or merging organizations.  If propagation of a covered\r\nwork results from an entity transaction, each party to that\r\ntransaction who receives a copy of the work also receives whatever\r\nlicenses to the work the party's predecessor in interest had or could\r\ngive under the previous paragraph, plus a right to possession of the\r\nCorresponding Source of the work from the predecessor in interest, if\r\nthe predecessor has it or can get it with reasonable efforts.\r\n\r\n  You may not impose any further restrictions on the exercise of the\r\nrights granted or affirmed under this License.  For example, you may\r\nnot impose a license fee, royalty, or other charge for exercise of\r\nrights granted under this License, and you may not initiate litigation\r\n(including a cross-claim or counterclaim in a lawsuit) alleging that\r\nany patent claim is infringed by making, using, selling, offering for\r\nsale, or importing the Program or any portion of it.\r\n\r\n  11. Patents.\r\n\r\n  A \"contributor\" is a copyright holder who authorizes use under this\r\nLicense of the Program or a work on which the Program is based.  The\r\nwork thus licensed is called the contributor's \"contributor version\".\r\n\r\n  A contributor's \"essential patent claims\" are all patent claims\r\nowned or controlled by the contributor, whether already acquired or\r\nhereafter acquired, that would be infringed by some manner, permitted\r\nby this License, of making, using, or selling its contributor version,\r\nbut do not include claims that would be infringed only as a\r\nconsequence of further modification of the contributor version.  For\r\npurposes of this definition, \"control\" includes the right to grant\r\npatent sublicenses in a manner consistent with the requirements of\r\nthis License.\r\n\r\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\r\npatent license under the contributor's essential patent claims, to\r\nmake, use, sell, offer for sale, import and otherwise run, modify and\r\npropagate the contents of its contributor version.\r\n\r\n  In the following three paragraphs, a \"patent license\" is any express\r\nagreement or commitment, however denominated, not to enforce a patent\r\n(such as an express permission to practice a patent or covenant not to\r\nsue for patent infringement).  To \"grant\" such a patent license to a\r\nparty means to make such an agreement or commitment not to enforce a\r\npatent against the party.\r\n\r\n  If you convey a covered work, knowingly relying on a patent license,\r\nand the Corresponding Source of the work is not available for anyone\r\nto copy, free of charge and under the terms of this License, through a\r\npublicly available network server or other readily accessible means,\r\nthen you must either (1) cause the Corresponding Source to be so\r\navailable, or (2) arrange to deprive yourself of the benefit of the\r\npatent license for this particular work, or (3) arrange, in a manner\r\nconsistent with the requirements of this License, to extend the patent\r\nlicense to downstream recipients.  \"Knowingly relying\" means you have\r\nactual knowledge that, but for the patent license, your conveying the\r\ncovered work in a country, or your recipient's use of the covered work\r\nin a country, would infringe one or more identifiable patents in that\r\ncountry that you have reason to believe are valid.\r\n\r\n  If, pursuant to or in connection with a single transaction or\r\narrangement, you convey, or propagate by procuring conveyance of, a\r\ncovered work, and grant a patent license to some of the parties\r\nreceiving the covered work authorizing them to use, propagate, modify\r\nor convey a specific copy of the covered work, then the patent license\r\nyou grant is automatically extended to all recipients of the covered\r\nwork and works based on it.\r\n\r\n  A patent license is \"discriminatory\" if it does not include within\r\nthe scope of its coverage, prohibits the exercise of, or is\r\nconditioned on the non-exercise of one or more of the rights that are\r\nspecifically granted under this License.  You may not convey a covered\r\nwork if you are a party to an arrangement with a third party that is\r\nin the business of distributing software, under which you make payment\r\nto the third party based on the extent of your activity of conveying\r\nthe work, and under which the third party grants, to any of the\r\nparties who would receive the covered work from you, a discriminatory\r\npatent license (a) in connection with copies of the covered work\r\nconveyed by you (or copies made from those copies), or (b) primarily\r\nfor and in connection with specific products or compilations that\r\ncontain the covered work, unless you entered into that arrangement,\r\nor that patent license was granted, prior to 28 March 2007.\r\n\r\n  Nothing in this License shall be construed as excluding or limiting\r\nany implied license or other defenses to infringement that may\r\notherwise be available to you under applicable patent law.\r\n\r\n  12. No Surrender of Others' Freedom.\r\n\r\n  If conditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot convey a\r\ncovered work so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you may\r\nnot convey it at all.  For example, if you agree to terms that obligate you\r\nto collect a royalty for further conveying from those to whom you convey\r\nthe Program, the only way you could satisfy both those terms and this\r\nLicense would be to refrain entirely from conveying the Program.\r\n\r\n  13. Use with the GNU Affero General Public License.\r\n\r\n  Notwithstanding any other provision of this License, you have\r\npermission to link or combine any covered work with a work licensed\r\nunder version 3 of the GNU Affero General Public License into a single\r\ncombined work, and to convey the resulting work.  The terms of this\r\nLicense will continue to apply to the part which is the covered work,\r\nbut the special requirements of the GNU Affero General Public License,\r\nsection 13, concerning interaction through a network will apply to the\r\ncombination as such.\r\n\r\n  14. Revised Versions of this License.\r\n\r\n  The Free Software Foundation may publish revised and/or new versions of\r\nthe GNU General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\n  Each version is given a distinguishing version number.  If the\r\nProgram specifies that a certain numbered version of the GNU General\r\nPublic License \"or any later version\" applies to it, you have the\r\noption of following the terms and conditions either of that numbered\r\nversion or of any later version published by the Free Software\r\nFoundation.  If the Program does not specify a version number of the\r\nGNU General Public License, you may choose any version ever published\r\nby the Free Software Foundation.\r\n\r\n  If the Program specifies that a proxy can decide which future\r\nversions of the GNU General Public License can be used, that proxy's\r\npublic statement of acceptance of a version permanently authorizes you\r\nto choose that version for the Program.\r\n\r\n  Later license versions may give you additional or different\r\npermissions.  However, no additional obligations are imposed on any\r\nauthor or copyright holder as a result of your choosing to follow a\r\nlater version.\r\n\r\n  15. Disclaimer of Warranty.\r\n\r\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\r\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. Limitation of Liability.\r\n\r\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r\nSUCH DAMAGES.\r\n\r\n  17. Interpretation of Sections 15 and 16.\r\n\r\n  If the disclaimer of warranty and limitation of liability provided\r\nabove cannot be given local legal effect according to their terms,\r\nreviewing courts shall apply local law that most closely approximates\r\nan absolute waiver of all civil liability in connection with the\r\nProgram, unless a warranty or assumption of liability accompanies a\r\ncopy of the Program in return for a fee.\r\n\r\n                     END OF TERMS AND CONDITIONS\r\n\r\n            How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nstate the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This program is free software: you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation, either version 3 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\n  If the program does terminal interaction, make it output a short\r\nnotice like this when it starts in an interactive mode:\r\n\r\n    <program>  Copyright (C) <year>  <name of author>\r\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, your program's commands\r\nmight be different; for a GUI interface, you would use an \"about box\".\r\n\r\n  You should also get your employer (if you work as a programmer) or school,\r\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\r\nFor more information on this, and how to apply and follow the GNU GPL, see\r\n<https://www.gnu.org/licenses/>.\r\n\r\n  The GNU General Public License does not permit incorporating your program\r\ninto proprietary programs.  If your program is a subroutine library, you\r\nmay consider it more useful to permit linking proprietary applications with\r\nthe library.  If this is what you want to do, use the GNU Lesser General\r\nPublic License instead of this License.  But first, please read\r\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n\nArchive v0.6.0: 26 files, 50847 bytes\n\nFiles: LICENSE (35823b), README.md (3755b), references/ONBOARDING.md (7015b), skill-card.md (2296b), SKILL.md (7170b), src/__init__.py (94b), src/cli.py (30660b), src/config.py (3847b), src/db.py (1349b), src/hook.py (4077b), src/migrations/env.py (1312b), src/migrations/versions/001_initial_schema.py (1728b), src/models.py (881b), src/pyproject.toml (1258b), tests/conftest.py (1998b), tests/dev-integration/src/conftest.py (3124b), tests/dev-integration/src/test_cli.py (14738b), tests/dev-integration/src/test_hook.py (2002b), tests/unit/src/conftest.py (798b), tests/unit/src/test___init__.py (264b), tests/unit/src/test_cli.py (2396b), tests/unit/src/test_config.py (4987b), tests/unit/src/test_db.py (2300b), tests/unit/src/test_hook.py (4756b), tests/unit/src/test_models.py (942b), _meta.json (134b)\n\nFile v0.6.0:SKILL.md\n\n---\nname: git-log-tracker\ndisplayName: \"Git Log Tracker (Commit Index & Query CLI)\"\nversion: 0.6.0\ndescription: |\n  Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite database, then provides a CLI to query, list, stats, delete, and update records.\n  Trigger: managing git hooks, querying commit history across repos, finding which repo a commit belongs to, viewing commit statistics, recording commits to a local index.\n  Use this skill whenever the user mentions commit logging, commit indexing, finding commits across repos, git hook management, or wants to query their commit history in a structured way — even if they don't explicitly name the tool.\n---\n\n# Git Log Tracker\n\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\n- **GitHub**: https://github.com/KinemaClawWorkspace/git-log-tracker\n\n## ⚠️ Before First Use | 首次使用必读\n\n**首次使用此 skill 前，必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**\n\nreferences/ONBOARDING.md 采用**交互式流程**：\n- **Agent 必须先询问用户使用意图**（仅当前 repo / 多个 repo / 全局模式）\n- **根据用户选择执行相应步骤**，切勿自动执行全部命令\n\n- **首次配置** → 读取 references/ONBOARDING.md，按 Step 0 询问用户后执行\n- **环境不可用**（命令不存在、依赖缺失、连接失败）→ 读取 references/ONBOARDING.md Troubleshooting 排查修复\n- **配置完成后** → 直接使用下方 Run Commands\n\n## Overview\n\nGit Log Tracker 在每次 `git commit` 后自动将 commit 元数据写入本地 SQLite 数据库。通过 CLI 可以跨仓库查询、统计、修改和删除 commit 记录。\n\n数据存储在 `~/.commit-logs/index.db`，配置文件在 `~/.commit-logs/config.toml`。\n\n## Run Commands\n\n所有命令通过 `git-log-tracker <subcommand>` 运行。\n\n### 初始化\n\n首次安装后初始化配置和数据库：\n\n```bash\ngit-log-tracker setup\n```\n\n### Hook 管理\n\n安装 hook 到指定 repo（之后每次 commit 自动记录）：\n\n```bash\ngit-log-tracker install /path/to/repo\ngit-log-tracker install .                              # 当前 repo\n```\n\n检查 hook 状态：\n\n```bash\ngit-log-tracker status /path/to/repo\ngit-log-tracker status .\n```\n\n移除 hook：\n\n```bash\ngit-log-tracker uninstall /path/to/repo\n```\n\n扫描目录中的 git 仓库：\n\n```bash\ngit-log-tracker scan /path/to/directory                     # 扫描并列出仓库\ngit-log-tracker scan /path/to/directory --depth 3           # 控制扫描深度\ngit-log-tracker scan /path/to/directory --install-missing   # 自动安装缺失 hook 的仓库\ngit-log-tracker scan /path/to/directory --interactive       # 交互式选择安装\ngit-log-tracker scan /path/to/directory --exclude \"*/temp/*\" --exclude \"*/.cache/*\"  # 排除路径\n```\n\n`scan` 输出示例：\n```\nScanning D:\\modular_dev for git repositories (depth=5)...\n\nFound 15 repositories:\n+----------------------------------------------------+--------------+--------------------+\n| Repo Path                                          | Hook Status  | Branches           |\n+----------------------------------------------------+--------------+--------------------+\n| D:\\modular_dev\\kinema_skills                       | [OK]         | main (3)           |\n| D:\\modular_dev\\other_project                       | [--]         | master (1)         |\n| D:\\modular_dev\\legacy_app                          | [--]         | develop (5)        |\n+----------------------------------------------------+--------------+--------------------+\n\nSummary: 1 installed, 2 missing\n```\n\n全局模式（新 repo 自动带 hook）：\n\n```bash\ngit-log-tracker global          # 启用\ngit-log-tracker global --off    # 关闭\n```\n\n### 数据查询\n\n按 hash 查找（支持前缀匹配）：\n\n```bash\ngit-log-tracker find abc1234\n```\n\n`find` 输出示例：\n```\ncommit  abc1234def5678901234567890123456789012\nauthor  Lee <lee@example.com>\ndate    2025-05-29T14:30:00+08:00\nrepo    D:/modular_dev/task-tracker\nbranch  master\nsubject test(frontend): Phase 4 完成\n```\n\n列出最近 commit：\n\n```bash\ngit-log-tracker list                     # 最近 20 条\ngit-log-tracker list -n 50               # 最近 50 条\ngit-log-tracker list --repo task-tracker  # 按仓库名筛选\ngit-log-tracker list --author lee@example.com  # 按作者筛选\ngit-log-tracker list --since 2025-01-01   # 按日期筛选\ngit-log-tracker list --branch main        # 按分支筛选\ngit-log-tracker list --label work         # 按仓库标签筛选\n```\n\n`list` 输出为表格格式：`HASH | DATE | AUTHOR | REPO | SUBJECT`\n\n统计信息：\n\n```bash\ngit-log-tracker stats\ngit-log-tracker stats --label work        # 只统计带该标签的仓库\n```\n\n### 标签管理\n\n给仓库打**仓库级标签**（label），用于按\"组\"过滤查询（如 work / personal）。标签是 `repo_path` 的属性，改标签立即对该仓库全部历史 commit 生效。\n\n```bash\ngit-log-tracker label add . work               # 给当前仓库加 work 标签\ngit-log-tracker label add /path/to/repo work personal  # 一次加多个标签\ngit-log-tracker label rm . work                # 移除标签\ngit-log-tracker label list .                   # 查看某仓库的标签\ngit-log-tracker label list                     # 列出所有标签映射\n```\n\n标签存储在 `~/.commit-logs/labels.json`，结构为 `{ \"归一化repo_path\": [\"label1\", ...] }`。\n\n### 数据修改\n\n手动记录某个 repo 的最新 commit：\n\n```bash\ngit-log-tracker record .           # 当前 repo\ngit-log-tracker record /path/to/repo\n```\n\n删除记录：\n\n```bash\ngit-log-tracker delete abc1234\n```\n\n更新记录字段（可编辑字段：branch, commit_subject, commit_body, repo_path, repo_name）：\n\n```bash\ngit-log-tracker update abc1234 branch main\n```\n\n重置数据目录：\n\n```bash\ngit-log-tracker reinstall              # 删除数据目录并重新初始化\ngit-log-tracker reinstall --keep-config  # 只重置数据库，保留配置\n```\n\n### 配置\n\n编辑 `~/.commit-logs/config.toml` 管理排除列表：\n\n```toml\n[hooks]\nexclude = [\n    \"/tmp/*\",\n    # \"/path/to/specific/repo\",\n]\n\n[database]\npath = \"index.db\"\n```\n\n## Architecture\n\n安装后的系统结构：\n\n```\n~/.commit-logs/          # 数据目录（不含代码）\n├── config.toml          # 排除列表和数据库路径配置\n├── labels.json          # 仓库级标签映射（repo_path -> [labels]）\n├── index.db             # SQLite 数据库\n\n.git/hooks/post-commit   # Hook 文件，调用 git-log-tracker hook\n```\n\nCLI 工具通过 `uv tool install` 安装到系统，不在 ~/.commit-logs 中存放代码。\n\n## SQLite Schema\n\n```sql\ncommits(\n    id, commit_hash, short_hash, author_name, author_email, author_ts,\n    committer_name, committer_email, commit_subject, commit_body,\n    branch, repo_path, repo_name, parent_hashes, recorded_at\n)\n```\n\n索引：`commit_hash`(UNIQUE), `repo_path`, `author_email`, `recorded_at`\n\nFile v0.6.0:README.md\n\n# Git Log Tracker\n\nGit post-commit hook + SQLite 索引工具。自动记录每次 commit 的元数据，支持跨仓库查询、统计和管理。\n\n## 核心特性\n\n> **一句话**：安装 hook → 每次 commit 自动入库 → 跨仓库查询 / 统计 / 管理\n\n### 自动记录\n\nGit post-commit hook 自动写入 commit 元数据（hash、author、branch、repo、subject）到本地 SQLite 数据库。\n\n### 跨仓库查询\n\n- 按 hash、仓库、作者、日期、分支、标签筛选\n- 支持前缀匹配查找 commit\n- 查找某个 commit 属于哪个仓库\n\n### 仓库标签\n\n- 给仓库打**仓库级标签**（label），按\"组\"过滤（如 work / personal）\n- `list --label` / `stats --label` 只显示带该标签的仓库\n- 标签即时对该仓库全部历史 commit 生效\n\n### 统计与管理\n\n- 按仓库 / 作者聚合统计\n- CRUD 操作：record / delete / update\n- 全局模式：新 repo 自动安装 hook\n- 排除规则：fnmatch 通配符排除指定路径\n\n## 安装\n\n### 方法一：通过 Claude Code Marketplace\n\n1. 添加 Marketplace：\n\n```\n/plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace\n```\n\n2. 安装 Skill：\n\n```\n/plugin install git-log-tracker@kinema-skills-marketplace\n```\n\n3. 查看已安装的 Skill：\n\n```\n/plugin list\n```\n\n### 方法二：通过 ClawHub OpenClaw\n\n```bash\nopenclaw skills install git-log-tracker\n```\n\n## 适用场景\n\n| 场景 | 说明 |\n|------|------|\n| 查找跨仓库 commit | \"abc123 这个 commit 在哪个仓库？\" |\n| 查看 commit 历史 | \"列出最近 50 条 commit\" |\n| 统计工作量 | \"统计各仓库 / 作者的 commit 数量\" |\n| 管理 git hooks | \"给这个仓库安装 hook\" |\n| 全局 hook 管理 | \"新仓库自动带 hook\" |\n\n## 触发方式\n\n本 skill 为 OpenClaw/Claude Code 技能，安装后可通过对话触发：\n\n```\n安装 git hook 到这个仓库\n查找 abc123 这个 commit\n列出最近的 commit\n统计 commit 数量\ngit-log-tracker setup\n```\n\n首次使用需完成 [ONBOARDING.md](ONBOARDING.md) 环境配置（安装 CLI 工具）。\n\n## 命令列表\n\n| 命令 | 说明 |\n|------|------|\n| `setup` | 初始化配置和数据库 |\n| `install <repo>` | 安装 hook 到指定仓库 |\n| `uninstall <repo>` | 从指定仓库移除 hook |\n| `status <repo>` | 检查仓库 hook 状态 |\n| `scan <path> [--depth] [--install-missing] [--interactive] [--exclude]` | 扫描目录中的 git 仓库，批量管理 hook |\n| `global [--off]` | 配置全局 git 模板 |\n| `find <hash>` | 按 hash 查找 commit |\n| `list` | 列出最近的 commits（支持 `--label` 过滤） |\n| `stats` | 显示统计信息（支持 `--label` 过滤） |\n| `label add/rm/list [repo] [labels...]` | 管理仓库级标签 |\n| `record [repo]` | 手动记录最新 commit |\n| `delete <hash>` | 删除 commit 记录 |\n| `update <hash> <field> <value>` | 更新 commit 字段 |\n| `reinstall [--keep-config]` | 重置数据目录并重新初始化 |\n\n## 文件结构\n\n```\ngit-log-tracker/\n├── SKILL.md              # Skill 定义文件\n├── ONBOARDING.md         # 首次配置引导\n├── README.md             # 本文档\n├── src/\n│   ├── cli.py            # CLI 入口\n│   ├── config.py         # 配置管理\n│   ├── db.py             # SQLite 数据库操作\n│   ├── hook.py           # Hook 脚本\n│   └── pyproject.toml    # Python 项目配置\n│                         # 标签存储于 ~/.commit-logs/labels.json\n└── LICENSE               # GPLv3 许可证\n```\n\n## 作者\n\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\n\n## 许可证\n\n[GNU General Public License v3.0](LICENSE)\n\nFile v0.6.0:_meta.json\n\n{\n  \"ownerId\": \"kn7cjsf9pc9x1tmreq1dahs90s83p9y0\",\n  \"slug\": \"git-log-tracker\",\n  \"version\": \"0.6.0\",\n  \"publishedAt\": 1780567624152\n}\n\nFile v0.6.0:references/ONBOARDING.md\n\n# Git Log Tracker Onboarding\n\n> 本文档指导 AI Agent 以**交互式方式**完成首次环境配置。\n> Agent 应按顺序向用户提问，根据用户选择执行相应步骤。\n\n## Prerequisites | 前置条件\n\n- Python 3.11+\n- `uv` 包管理器\n- Git\n\n## 交互流程\n\n### Step 0: 询问用户使用意图\n\n**必须先询问用户，不要自动执行！**\n\nAgent 应使用 `AskUserQuestion` 工具询问用户的使用场景：\n\n```\n您打算如何使用 Git Log Tracker？\n- 仅当前 repo\n- 多个 repo（手动安装到每个）\n- 全局模式（新 repo 自动带 hook）\n- 批量扫描已有仓库并安装\n```\n\n根据用户选择，执行不同的步骤：\n\n| 用户选择 | 执行步骤 |\n|----------|----------|\n| 仅当前 repo | Step 1-4 |\n| 多个 repo | Step 1-3（完成后询问具体 repo 列表） |\n| 全局模式 | Step 1-3 + Step 5 |\n| 批量扫描已有仓库 | Step 1-3 + Step 6 |\n\n---\n\n### Step 1: 安装 CLI 工具\n\n**所有场景都需要执行此步骤。**\n\n#### 安装方式\n\n从本地路径安装（作为 kinema_skills 组件的一部分）：\n```bash\nuv tool install D:/modular_dev/kinema_skills/git-log-tracker\n```\n\n或使用相对路径（如果在 kinema_skills 目录下）：\n```bash\nuv tool install ./git-log-tracker\n```\n\n#### 验证安装\n\n```bash\ngit-log-tracker --help\n# 期望: 显示帮助信息\ngit-log-tracker --version\n# 期望: git-log-tracker 0.2.0\n```\n\n---\n\n### Step 2: 初始化配置和数据库\n\n**所有场景都需要执行此步骤。**\n\n```bash\ngit-log-tracker setup\n```\n\n此命令会：\n- 创建 `~/.commit-logs/` 目录\n- 创建默认 `config.toml` 配置文件\n- 初始化 SQLite 数据库\n\n#### 验证\n\n```bash\nls ~/.commit-logs/\n# 期望: config.toml, index.db\ngit-log-tracker stats\n# 期望: Total commits: 0\n```\n\n---\n\n### Step 3: 验证环境\n\n**所有场景都需要执行此步骤。**\n\n```bash\ngit-log-tracker stats\n# 期望: 显示统计信息（初始为 0 commits）\n```\n\n---\n\n### Step 4: 安装 Hook 到当前 Repo\n\n**仅当用户选择\"仅当前 repo\"时执行此步骤。**\n\n#### 检测\n\n```bash\ngit-log-tracker status .\n```\n\n#### 安装\n\n```bash\ngit-log-tracker install .\n```\n\n#### 验证\n\n```bash\ngit-log-tracker status .\n# 期望: Status: installed [<repo_path>]\n```\n\n---\n\n### Step 5: 全局模式配置\n\n**仅当用户选择\"全局模式\"时执行此步骤。**\n\n配置 Git template 目录，使新 clone 的 repo 自动带上 hook：\n\n#### 检测\n\n```bash\ngit config --global --get init.templateDir\n```\n\n#### 安装\n\n```bash\ngit-log-tracker global\n```\n\n#### 验证\n\n```bash\ngit-log-tracker global --off  # 如需关闭\ngit config --global --get init.templateDir\n# 期望: ~/.git-templates\n```\n\n---\n\n### Step 6: 批量扫描已有仓库\n\n**仅当用户选择\"批量扫描已有仓库\"时执行此步骤。**\n\n> ⚠️ **重要提示**：全局模式（Step 5）只会影响**后续创建或 clone 的仓库**，已有仓库不会自动注入 hook。\n> 使用 `scan` 命令可以批量扫描并安装已有仓库的 hook。\n\n#### 扫描目录\n\n```bash\n# 扫描指定目录（默认深度 5）\ngit-log-tracker scan D:/modular_dev\n\n# 控制扫描深度\ngit-log-tracker scan D:/modular_dev --depth 3\n```\n\n输出示例：\n```\nScanning D:\\modular_dev for git repositories (depth=3)...\n\nFound 8 repositories:\n+----------------------------------------------------+--------------+--------------------+\n| Repo Path                                          | Hook Status  | Branches           |\n+----------------------------------------------------+--------------+--------------------+\n| D:\\modular_dev\\kinema_skills\\git-log-tracker       | [OK]         | master (1)         |\n| D:\\modular_dev\\other_project                       | [--]         | main (1)           |\n+----------------------------------------------------+--------------+--------------------+\n\nSummary: 1 installed, 1 missing\n```\n\n#### 批量安装\n\n扫描后可选择批量安装：\n\n```bash\n# 自动安装所有缺失 hook（需确认）\ngit-log-tracker scan D:/modular_dev --install-missing\n\n# 交互式选择安装（选择具体仓库）\ngit-log-tracker scan D:/modular_dev --interactive\n\n# 排除特定路径\ngit-log-tracker scan D:/modular_dev --exclude \"*/temp/*\" --exclude \"*/.cache/*\"\n```\n\n#### 常见场景\n\n| 场景 | 命令 |\n|------|------|\n| 扫描工作目录下所有仓库 | `git-log-tracker scan ~/work --depth 4` |\n| 扫描并安装所有缺失 hook | `git-log-tracker scan ~/work --install-missing` |\n| 排除临时目录后扫描 | `git-log-tracker scan ~/work --exclude \"*/tmp/*\"` |\n| 交互式选择安装 | `git-log-tracker scan ~/work --interactive` |\n\n#### 验证\n\n```bash\n# 重新扫描验证安装状态\ngit-log-tracker scan D:/modular_dev\n# 期望: Summary 显示全部 installed\n```\n\n---\n\n## 数据存储位置\n\n安装后的数据存储结构：\n\n```\n~/.commit-logs/\n├── config.toml     # 配置文件（排除列表等）\n├── index.db        # SQLite 数据库\n```\n\n**代码不再存储在 ~/.commit-logs/，而是通过 uv tool install 安装为系统命令。**\n\n---\n\n## Troubleshooting | 故障排除\n\n| 错误 | 原因 | 解决方案 |\n|------|------|----------|\n| `git-log-tracker: command not found` | 未安装工具 | `uv tool install D:/modular_dev/kinema_skills/git-log-tracker` |\n| `No module named 'tomllib'` | Python < 3.11 | 安装 Python 3.11+ |\n| `uv: command not found` | uv 未安装 | `curl -LsSf https://astral.sh/uv/install.sh \\| sh` |\n| `Hook not triggering` | hook 文件无执行权限 | `chmod +x .git/hooks/post-commit` |\n| `database is locked` | 多进程并发写入 | 等待其他操作完成，SQLite 自动处理 |\n| `No commits found` | 数据库为空或排除规则过滤了 repo | 检查 `~/.commit-logs/config.toml` 中的 exclude 列表 |\n| `Multiple commits match prefix` | hash 前缀太短 | 使用更长的 hash 前缀或完整 hash |\n| `scan: No git repositories found` | 目录下无 git 仓库或深度不足 | 增加 `--depth` 或检查路径是否正确 |\n| `scan: Permission denied` | 目录权限不足 | 检查目录访问权限 |\n\n---\n\n## 升级方式\n\n从旧版本升级：\n\n1. **卸载旧 hook**（如果之前已安装）：\n   ```bash\n   # 如果之前使用 scripts/ 方式安装\n   rm ~/.commit-logs/hook.py ~/.commit-logs/db.py ~/.commit-logs/install.py ~/.commit-logs/query.py ~/.commit-logs/setup_global.py\n   rm -rf ~/.commit-logs/__pycache__\n   ```\n\n2. **重新安装 hook**（使用新 CLI）：\n   ```bash\n   git-log-tracker install .\n   ```\n\n3. **数据保留**：\n   - `~/.commit-logs/index.db` 和 `config.toml` 无需迁移，保持原样\n\n---\n\n## 版本管理\n\n**Skill 版本与 CLI 版本绑定，更新时需同步修改以下文件：**\n\n| 文件 | 版本位置 |\n|------|----------|\n| `pyproject.toml` | `version = \"x.y.z\"` |\n| `src/git_log_tracker/__init__.py` | `__version__ = \"x.y.z\"` |\n| `SKILL.md` | `version: x.y.z` (frontmatter) |\n\n更新版本后需要重新安装 CLI：\n```bash\nuv tool install D:/modular_dev/kinema_skills/git-log-tracker --force\n```\n\nFile v0.6.0:skill-card.md\n\n## Description: <br>\nGit Log Tracker records Git commit metadata into a local SQLite index through a post-commit hook and provides CLI commands to query, list, summarize, update, and delete records. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[leeshunee](https://clawhub.ai/user/leeshunee) <br>\n\n### License/Terms of Use: <br>\nGNU General Public License v3.0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to install and manage Git post-commit hooks, maintain a local commit-history index across repositories, and query commit records by hash, repository, author, date, branch, or label. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can make persistent Git hook and global Git configuration changes. <br>\nMitigation: Confirm the exact repositories before using scan, batch install, or global mode, and review hook status after installation. <br>\nRisk: The local SQLite index can contain sensitive repository paths, author emails, commit subjects, and commit bodies. <br>\nMitigation: Avoid indexing sensitive repositories and use exclude rules before enabling hooks broadly. <br>\nRisk: Reset and delete operations can remove local commit-index data. <br>\nMitigation: Back up ~/.commit-logs before using reinstall or destructive record-management commands. <br>\n\n\n## Reference(s): <br>\n- [Git Log Tracker Onboarding](references/ONBOARDING.md) <br>\n- [ClawHub skill page](https://clawhub.ai/leeshunee/git-log-tracker) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown with inline shell commands and configuration snippets] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May guide creation of local Git hooks, Git global template settings, and files under ~/.commit-logs.] <br>\n\n## Skill Version(s): <br>\n0.6.0 (source: SKILL.md frontmatter and server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.6.0:src/pyproject.toml\n\n[project]\nname = \"git-log-tracker\"\nversion = \"0.5.0\"\ndescription = \"Git post-commit hook + SQLite commit index CLI\"\nrequires-python = \">=3.11\"\ndependencies = [\"sqlalchemy>=2.0\", \"alembic>=1.13\"]\n\n[project.optional-dependencies]\ntest = [\"pytest>=8\", \"pytest-cov>=5\", \"pytest-mock>=3\"]\ndev = [\"pytest>=8\", \"pytest-cov>=5\", \"pytest-mock>=3\"]\n\n[project.scripts]\ngit-log-tracker = \"cli:main\"\n\n[tool.pytest.ini_options]\n# pyproject 位于 src/，pytest 以 src/ 为 rootdir；pythonpath=\".\" 即把 src/ 注入\n# 使 flat 模块（cli/db/config/hook/models）可直接 import\npythonpath = [\".\"]\ntestpaths = [\"../tests/unit\", \"../tests/dev-integration\"]\n# importlib 模式：各阶段存在同名 test 文件（test_cli.py / test_hook.py），\n# 必须用 importlib 导入模式避免 basename 冲突\naddopts = \"-q --import-mode=importlib\"\n\n[tool.coverage.run]\n# 覆盖率统计 src/ 下源码；按 CLAUDE.md §7.3 排除 __init__.py 与迁移脚本\nsource = [\".\"]\nomit = [\"__init__.py\", \"migrations/*\", \"*/migrations/*\"]\n\n[tool.coverage.report]\nfail_under = 80\nexclude_lines = [\n    \"pragma: no cover\",\n    \"if __name__ == .__main__.:\",\n]\n\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[tool.hatch.build.targets.wheel]\npackages = [\".\"]\n\nFile v0.6.0:LICENSE\n\nGNU GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n                            Preamble\r\n\r\n  The GNU General Public License is a free, copyleft license for\r\nsoftware and other kinds of works.\r\n\r\n  The licenses for most software and other practical works are designed\r\nto take away your freedom to share and change the works.  By contrast,\r\nthe GNU General Public License is intended to guarantee your freedom to\r\nshare and change all versions of a program--to make sure it remains free\r\nsoftware for all its users.  We, the Free Software Foundation, use the\r\nGNU General Public License for most of our software; it applies also to\r\nany other work released this way by its authors.  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthem if you wish), that you receive source code or can get it if you\r\nwant it, that you can change the software or use pieces of it in new\r\nfree programs, and that you know you can do these things.\r\n\r\n  To protect your rights, we need to prevent others from denying you\r\nthese rights or asking you to surrender the rights.  Therefore, you have\r\ncertain responsibilities if you distribute copies of the software, or if\r\nyou modify it: responsibilities to respect the freedom of others.\r\n\r\n  For example, if you distribute copies of such a program, whether\r\ngratis or for a fee, you must pass on to the recipients the same\r\nfreedoms that you received.  You must make sure that they, too, receive\r\nor can get the source code.  And you must show them these terms so they\r\nknow their rights.\r\n\r\n  Developers that use the GNU GPL protect your rights with two steps:\r\n(1) assert copyright on the software, and (2) offer you this License\r\ngiving you legal permission to copy, distribute and/or modify it.\r\n\r\n  For the developers' and authors' protection, the GPL clearly explains\r\nthat there is no warranty for this free software.  For both users' and\r\nauthors' sake, the GPL requires that modified versions be marked as\r\nchanged, so that their problems will not be attributed erroneously to\r\nauthors of previous versions.\r\n\r\n  Some devices are designed to deny users access to install or run\r\nmodified versions of the software inside them, although the manufacturer\r\ncan do so.  This is fundamentally incompatible with the aim of\r\nprotecting users' freedom to change the software.  The systematic\r\npattern of such abuse occurs in the area of products for individuals to\r\nuse, which is precisely where it is most unacceptable.  Therefore, we\r\nhave designed this version of the GPL to prohibit the practice for those\r\nproducts.  If such problems arise substantially in other domains, we\r\nstand ready to extend this provision to those domains in future versions\r\nof the GPL, as needed to protect the freedom of users.\r\n\r\n  Finally, every program is threatened constantly by software patents.\r\nStates should not allow patents to restrict development and use of\r\nsoftware on general-purpose computers, but in those that do, we wish to\r\navoid the special danger that patents applied to a free program could\r\nmake it effectively proprietary.  To prevent this, the GPL assures that\r\npatents cannot be used to render the program non-free.\r\n\r\n  The precise terms and conditions for copying, distribution and\r\nmodification follow.\r\n\r\n                       TERMS AND CONDITIONS\r\n\r\n  0. Definitions.\r\n\r\n  \"This License\" refers to version 3 of the GNU General Public License.\r\n\r\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\r\nworks, such as semiconductor masks.\r\n\r\n  \"The Program\" refers to any copyrightable work licensed under this\r\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\r\n\"recipients\" may be individuals or organizations.\r\n\r\n  To \"modify\" a work means to copy from or adapt all or part of the work\r\nin a fashion requiring copyright permission, other than the making of an\r\nexact copy.  The resulting work is called a \"modified version\" of the\r\nearlier work or a work \"based on\" the earlier work.\r\n\r\n  A \"covered work\" means either the unmodified Program or a work based\r\non the Program.\r\n\r\n  To \"propagate\" a work means to do anything with it that, without\r\npermission, would make you directly or secondarily liable for\r\ninfringement under applicable copyright law, except executing it on a\r\ncomputer or modifying a private copy.  Propagation includes copying,\r\ndistribution (with or without modification), making available to the\r\npublic, and in some countries other activities as well.\r\n\r\n  To \"convey\" a work means any kind of propagation that enables other\r\nparties to make or receive copies.  Mere interaction with a user through\r\na computer network, with no transfer of a copy, is not conveying.\r\n\r\n  An interactive user interface displays \"Appropriate Legal Notices\"\r\nto the extent that it includes a convenient and prominently visible\r\nfeature that (1) displays an appropriate copyright notice, and (2)\r\ntells the user that there is no warranty for the work (except to the\r\nextent that warranties are provided), that licensees may convey the\r\nwork under this License, and how to view a copy of this License.  If\r\nthe interface presents a list of user commands or options, such as a\r\nmenu, a prominent item in the list meets this criterion.\r\n\r\n  1. Source Code.\r\n\r\n  The \"source code\" for a work means the preferred form of the work\r\nfor making modifications to it.  \"Object code\" means any non-source\r\nform of a work.\r\n\r\n  A \"Standard Interface\" means an interface that either is an official\r\nstandard defined by a recognized standards body, or, in the case of\r\ninterfaces specified for a particular programming language, one that\r\nis widely used among developers working in that language.\r\n\r\n  The \"System Libraries\" of an executable work include anything, other\r\nthan the work as a whole, that (a) is included in the normal form of\r\npackaging a Major Component, but which is not part of that Major\r\nComponent, and (b) serves only to enable use of the work with that\r\nMajor Component, or to implement a Standard Interface for which an\r\nimplementation is available to the public in source code form.  A\r\n\"Major Component\", in this context, means a major essential component\r\n(kernel, window system, and so on) of the specific operating system\r\n(if any) on which the executable work runs, or a compiler used to\r\nproduce the work, or an object code interpreter used to run it.\r\n\r\n  The \"Corresponding Source\" for a work in object code form means all\r\nthe source code needed to generate, install, and (for an executable\r\nwork) run the object code and to modify the work, including scripts to\r\ncontrol those activities.  However, it does not include the work's\r\nSystem Libraries, or general-purpose tools or generally available free\r\nprograms which are used unmodified in performing those activities but\r\nwhich are not part of the work.  For example, Corresponding Source\r\nincludes interface definition files associated with source files for\r\nthe work, and the source code for shared libraries and dynamically\r\nlinked subprograms that the work is specifically designed to require,\r\nsuch as by intimate data communication or control flow between those\r\nsubprograms and other parts of the work.\r\n\r\n  The Corresponding Source need not include anything that users\r\ncan regenerate automatically from other parts of the Corresponding\r\nSource.\r\n\r\n  The Corresponding Source for a work in source code form is that\r\nsame work.\r\n\r\n  2. Basic Permissions.\r\n\r\n  All rights granted under this License are granted for the term of\r\ncopyright on the Program, and are irrevocable provided the stated\r\nconditions are met.  This License explicitly affirms your unlimited\r\npermission to run the unmodified Program.  The output from running a\r\ncovered work is covered by this License only if the output, given its\r\ncontent, constitutes a covered work.  This License acknowledges your\r\nrights of fair use or other equivalent, as provided by copyright law.\r\n\r\n  You may make, run and propagate covered works that you do not\r\nconvey, without conditions so long as your license otherwise remains\r\nin force.  You may convey covered works to others for the sole purpose\r\nof having them make modifications exclusively for you, or provide you\r\nwith facilities for running those works, provided that you comply with\r\nthe terms of this License in conveying all material for which you do\r\nnot control copyright.  Those thus making or running the covered works\r\nfor you must do so exclusively on your behalf, under your direction\r\nand control, on terms that prohibit them from making any copies of\r\nyour copyrighted material outside their relationship with you.\r\n\r\n  Conveying under any other circumstances is permitted solely under\r\nthe conditions stated below.  Sublicensing is not allowed; section 10\r\nmakes it unnecessary.\r\n\r\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\r\n\r\n  No covered work shall be deemed part of an effective technological\r\nmeasure under any applicable law fulfilling obligations under article\r\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\r\nsimilar laws prohibiting or restricting circumvention of such\r\nmeasures.\r\n\r\n  When you convey a covered work, you waive any legal power to forbid\r\ncircumvention of technological measures to the extent such circumvention\r\nis effected by exercising rights under this License with respect to\r\nthe covered work, and you disclaim any intention to limit operation or\r\nmodification of the work as a means of enforcing, against the work's\r\nusers, your or third parties' legal rights to forbid circumvention of\r\ntechnological measures.\r\n\r\n  4. Conveying Verbatim Copies.\r\n\r\n  You may convey verbatim copies of the Program's source code as you\r\nreceive it, in any medium, provided that you conspicuously and\r\nappropriately publish on each copy an appropriate copyright notice;\r\nkeep intact all notices stating that this License and any\r\nnon-permissive terms added in accord with section 7 apply to the code;\r\nkeep intact all notices of the absence of any warranty; and give all\r\nrecipients a copy of this License along with the Program.\r\n\r\n  You may charge any price or no price for each copy that you convey,\r\nand you may offer support or warranty protection for a fee.\r\n\r\n  5. Conveying Modified Source Versions.\r\n\r\n  You may convey a work based on the Program, or the modifications to\r\nproduce it from the Program, in the form of source code under the\r\nterms of section 4, provided that you also meet all of these conditions:\r\n\r\n    a) The work must carry prominent notices stating that you modified\r\n    it, and giving a relevant date.\r\n\r\n    b) The work must carry prominent notices stating that it is\r\n    released under this License and any conditions added under section\r\n    7.  This requirement modifies the requirement in section 4 to\r\n    \"keep intact all notices\".\r\n\r\n    c) You must license the entire work, as a whole, under this\r\n    License to anyone who comes into possession of a copy.  This\r\n    License will therefore apply, along with any applicable section 7\r\n    additional terms, to the whole of the work, and all its parts,\r\n    regardless of how they are packaged.  This License gives no\r\n    permission to license the work in any other way, but it does not\r\n    invalidate such permission if you have separately received it.\r\n\r\n    d) If the work has interactive user interfaces, each must display\r\n    Appropriate Legal Notices; however, if the Program has interactive\r\n    interfaces that do not display Appropriate Legal Notices, your\r\n    work need not make them do so.\r\n\r\n  A compilation of a covered work with other separate and independent\r\nworks, which are not by their nature extensions of the covered work,\r\nand which are not combined with it such as to form a larger program,\r\nin or on a volume of a storage or distribution medium, is called an\r\n\"aggregate\" if the compilation and its resulting copyright are not\r\nused to limit the access or legal rights of the compilation's users\r\nbeyond what the individual works permit.  Inclusion of a covered work\r\nin an aggregate does not cause this License to apply to the other\r\nparts of the aggregate.\r\n\r\n  6. Conveying Non-Source Forms.\r\n\r\n  You may convey a covered work in object code form under the terms\r\nof sections 4 and 5, provided that you also convey the\r\nmachine-readable Corresponding Source under the terms of this License,\r\nin one of these ways:\r\n\r\n    a) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by the\r\n    Corresponding Source fixed on a durable physical medium\r\n    customarily used for software interchange.\r\n\r\n    b) Convey the object code in, or embodied in, a physical product\r\n    (including a physical distribution medium), accompanied by a\r\n    written offer, valid for at least three years and valid for as\r\n    long as you offer spare parts or customer support for that product\r\n    model, to give anyone who possesses the object code either (1) a\r\n    copy of the Corresponding Source for all the software in the\r\n    product that is covered by this License, on a durable physical\r\n    medium customarily used for software interchange, for a price no\r\n    more than your reasonable cost of physically performing this\r\n    conveying of source, or (2) access to copy the\r\n    Corresponding Source from a network server at no charge.\r\n\r\n    c) Convey individual copies of the object code with a copy of the\r\n    written offer to provide the Corresponding Source.  This\r\n    alternative is allowed only occasionally and noncommercially, and\r\n    only if you received the object code with such an offer, in accord\r\n    with subsection 6b.\r\n\r\n    d) Convey the object code by offering access from a designated\r\n    place (gratis or for a charge), and offer equivalent access to the\r\n    Corresponding Source in the same way through the same place at no\r\n    further charge.  You need not require recipients to copy the\r\n    Corresponding Source along with the object code.  If the place to\r\n    copy the object code is a network server, the Corresponding Source\r\n    may be on a different server (operated by you or a third party)\r\n    that supports equivalent copying facilities, provided you maintain\r\n    clear directions next to the object code saying where to find the\r\n    Corresponding Source.  Regardless of what server hosts the\r\n    Corresponding Source, you remain obligated to ensure that it is\r\n    available for as long as needed to satisfy these requirements.\r\n\r\n    e) Convey the object code using peer-to-peer transmission, provided\r\n    you inform other peers where the object code and Corresponding\r\n    Source of the work are being offered to the general public at no\r\n    charge under subsection 6d.\r\n\r\n  A separable portion of the object code, whose source code is excluded\r\nfrom the Corresponding Source as a System Library, need not be\r\nincluded in conveying the object code work.\r\n\r\n  A \"User Product\" is either (1) a \"consumer product\", which means any\r\ntangible personal property which is normally used for personal, family,\r\nor household purposes, or (2) anything designed or sold for incorporation\r\ninto a dwelling.  In determining whether a product is a consumer product,\r\ndoubtful cases shall be resolved in favor of coverage.  For a particular\r\nproduct received by a particular user, \"normally used\" refers to a\r\ntypical or common use of that class of product, regardless of the status\r\nof the particular user or of the way in which the particular user\r\nactually uses, or expects or is expected to use, the product.  A product\r\nis a consumer product regardless of whether the product has substantial\r\ncommercial, industrial or non-consumer uses, unless such uses represent\r\nthe only significant mode of use of the product.\r\n\r\n  \"Installation Information\" for a User Product means any methods,\r\nprocedures, authorization keys, or other information required to install\r\nand execute modified versions of a covered work in that User Product from\r\na modified version of its Corresponding Source.  The information must\r\nsuffice to ensure that the continued functioning of the modified object\r\ncode is in no case prevented or interfered with solely because\r\nmodification has been made.\r\n\r\n  If you convey an object code work under this section in, or with, or\r\nspecifically for use in, a User Product, and the conveying occurs as\r\npart of a transaction in which the right of possession and use of the\r\nUser Product is transferred to the recipient in perpetuity or for a\r\nfixed term (regardless of how the transaction is characterized), the\r\nCorresponding Source conveyed under this section must be accompanied\r\nby the Installation Information.  But this requirement does not apply\r\nif neither you nor any third party retains the ability to install\r\nmodified object code on the User Product (for example, the work has\r\nbeen installed in ROM).\r\n\r\n  The requirement to provide Installation Information does not include a\r\nrequirement to continue to provide support service, warranty, or updates\r\nfor a work that has been modified or installed by the recipient, or for\r\nthe User Product in which it has been modified or installed.  Access to a\r\nnetwork may be denied when the modification itself materially and\r\nadversely affects the operation of the network or violates the rules and\r\nprotocols for communication across the network.\r\n\r\n  Corresponding Source conveyed, and Installation Information provided,\r\nin accord with this section must be in a format that is publicly\r\ndocumented (and with an implementation available to the public in\r\nsource code form), and must require no special password or key for\r\nunpacking, reading or copying.\r\n\r\n  7. Additional Terms.\r\n\r\n  \"Additional permissions\" are terms that supplement the terms of this\r\nLicense by making exceptions from one or more of its conditions.\r\nAdditional permissions that are applicable to the entire Program shall\r\nbe treated as though they were included in this License, to the extent\r\nthat they are valid under applicable law.  If additional permissions\r\napply only to part of the Program, that part may be used separately\r\nunder those permissions, but the entire Program remains governed by\r\nthis License without regard to the additional permissions.\r\n\r\n  When you convey a copy of a covered work, you may at your option\r\nremove any additional permissions from that copy, or from any part of\r\nit.  (Additional permissions may be written to require their own\r\nremoval in certain cases when you modify the work.)  You may place\r\nadditional permissions on material, added by you to a covered work,\r\nfor which you have or can give appropriate copyright permission.\r\n\r\n  Notwithstanding any other provision of this License, for material you\r\nadd to a covered work, you may (if authorized by the copyright holders of\r\nthat material) supplement the terms of this License with terms:\r\n\r\n    a) Disclaiming warranty or limiting liability differently from the\r\n    terms of sections 15 and 16 of this License; or\r\n\r\n    b) Requiring preservation of specified reasonable legal notices or\r\n    author attributions in that material or in the Appropriate Legal\r\n    Notices displayed by works containing it; or\r\n\r\n    c) Prohibiting misrepresentation of the origin of that material, or\r\n    requiring that modified versions of such material be marked in\r\n    reasonable ways as different from the original version; or\r\n\r\n    d) Limiting the use for publicity purposes of names of licensors or\r\n    authors of the material; or\r\n\r\n    e) Declining to grant rights under trademark law for use of some\r\n    trade names, trademarks, or service marks; or\r\n\r\n    f) Requiring indemnification of licensors and authors of that\r\n    material by anyone who conveys the material (or modified versions of\r\n    it) with contractual assumptions of liability to the recipient, for\r\n    any liability that these contractual assumptions directly impose on\r\n    those licensors and authors.\r\n\r\n  All other non-permissive additional terms are considered \"further\r\nrestrictions\" within the meaning of section 10.  If the Program as you\r\nreceived it, or any part of it, contains a notice stating that it is\r\ngoverned by this License along with a term that is a further\r\nrestriction, you may remove that term.  If a license document contains\r\na further restriction but permits relicensing or conveying under this\r\nLicense, you may add to a covered work material governed by the terms\r\nof that license document, provided that the further restriction does\r\nnot survive such relicensing or conveying.\r\n\r\n  If you add terms to a covered work in accord with this section, you\r\nmust place, in the relevant source files, a statement of the\r\nadditional terms that apply to those files, or a notice indicating\r\nwhere to find the applicable terms.\r\n\r\n  Additional terms, permissive or non-permissive, may be stated in the\r\nform of a separately written license, or stated as exceptions;\r\nthe above requirements apply either way.\r\n\r\n  8. Termination.\r\n\r\n  You may not propagate or modify a covered work except as expressly\r\nprovided under this License.  Any attempt otherwise to propagate or\r\nmodify it is void, and will automatically terminate your rights under\r\nthis License (including any patent licenses granted under the third\r\nparagraph of section 11).\r\n\r\n  However, if you cease all violation of this License, then your\r\nlicense from a particular copyright holder is reinstated (a)\r\nprovisionally, unless and until the copyright holder explicitly and\r\nfinally terminates your license, and (b) permanently, if the copyright\r\nholder fails to notify you of the violation by some reasonable means\r\nprior to 60 days after the cessation.\r\n\r\n  Moreover, your license from a particular copyright holder is\r\nreinstated permanently if the copyright holder notifies you of the\r\nviolation by some reasonable means, this is the first time you have\r\nreceived notice of violation of this License (for any work) from that\r\ncopyright holder, and you cure the violation prior to 30 days after\r\nyour receipt of the notice.\r\n\r\n  Termination of your rights under this section does not terminate the\r\nlicenses of parties who have received copies or rights from you under\r\nthis License.  If your rights have been terminated and not permanently\r\nreinstated, you do not qualify to receive new licenses for the same\r\nmaterial under section 10.\r\n\r\n  9. Acceptance Not Required for Having Copies.\r\n\r\n  You are not required to accept this License in order to receive or\r\nrun a copy of the Program.  Ancillary propagation of a covered work\r\noccurring solely as a consequence of using peer-to-peer transmission\r\nto receive a copy likewise does not require acceptance.  However,\r\nnothing other than this License grants you permission to propagate or\r\nmodify any covered work.  These actions infringe copyright if you do\r\nnot accept this License.  Therefore, by modifying or propagating a\r\ncovered work, you indicate your acceptance of this License to do so.\r\n\r\n  10. Automatic Licensing of Downstream Recipients.\r\n\r\n  Each time you convey a covered work, the recipient automatically\r\nreceives a license from the original licensors, to run, modify and\r\npropagate that work, subject to this License.  You are not responsible\r\nfor enforcing compliance by third parties with this License.\r\n\r\n  An \"entity transaction\" is a transaction transferring control of an\r\norganization, or substantially all assets of one, or subdividing an\r\norganization, or merging organizations.  If propagation of a covered\r\nwork results from an entity transaction, each party to that\r\ntransaction who receives a copy of the work also receives whatever\r\nlicenses to the work the party's predecessor in interest had or could\r\ngive under the previous paragraph, plus a right to possession of the\r\nCorresponding Source of the work from the predecessor in interest, if\r\nthe predecessor has it or can get it with reasonable efforts.\r\n\r\n  You may not impose any further restrictions on the exercise of the\r\nrights granted or affirmed under this License.  For example, you may\r\nnot impose a license fee, royalty, or other charge for exercise of\r\nrights granted under this License, and you may not initiate litigation\r\n(including a cross-claim or counterclaim in a lawsuit) alleging that\r\nany patent claim is infringed by making, using, selling, offering for\r\nsale, or importing the Program or any portion of it.\r\n\r\n  11. Patents.\r\n\r\n  A \"contributor\" is a copyright holder who authorizes use under this\r\nLicense of the Program or a work on which the Program is based.  The\r\nwork thus licensed is called the contributor's \"contributor version\".\r\n\r\n  A contributor's \"essential patent claims\" are all patent claims\r\nowned or controlled by the contributor, whether already acquired or\r\nhereafter acquired, that would be infringed by some manner, permitted\r\nby this License, of making, using, or selling its contributor version,\r\nbut do not include claims that would be infringed only as a\r\nconsequence of further modification of the contributor version.  For\r\npurposes of this definition, \"control\" includes the right to grant\r\npatent sublicenses in a manner consistent with the requirements of\r\nthis License.\r\n\r\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\r\npatent license under the contributor's essential patent claims, to\r\nmake, use, sell, offer for sale, import and otherwise run, modify and\r\npropagate the contents of its contributor version.\r\n\r\n  In the following three paragraphs, a \"patent license\" is any express\r\nagreement or commitment, however denominated, not to enforce a patent\r\n(such as an express permission to practice a patent or covenant not to\r\nsue for patent infringement).  To \"grant\" such a patent license to a\r\nparty means to make such an agreement or commitment not to enforce a\r\npatent against the party.\r\n\r\n  If you convey a covered work, knowingly relying on a patent license,\r\nand the Corresponding Source of the work is not available for anyone\r\nto copy, free of charge and under the terms of this License, through a\r\npublicly available network server or other readily accessible means,\r\nthen you must either (1) cause the Corresponding Source to be so\r\navailable, or (2) arrange to deprive yourself of the benefit of the\r\npatent license for this particular work, or (3) arrange, in a manner\r\nconsistent with the requirements of this License, to extend the patent\r\nlicense to downstream recipients.  \"Knowingly relying\" means you have\r\nactual knowledge that, but for the patent license, your conveying the\r\ncovered work in a country, or your recipient's use of the covered work\r\nin a country, would infringe one or more identifiable patents in that\r\ncountry that you have reason to believe are valid.\r\n\r\n  If, pursuant to or in connection with a single transaction or\r\narrangement, you convey, or propagate by procuring conveyance of, a\r\ncovered work, and grant a patent license to some of the parties\r\nreceiving the covered work authorizing them to use, propagate, modify\r\nor convey a specific copy of the covered work, then the patent license\r\nyou grant is automatically extended to all recipients of the covered\r\nwork and works based on it.\r\n\r\n  A patent license is \"discriminatory\" if it does not include within\r\nthe scope of its coverage, prohibits the exercise of, or is\r\nconditioned on the non-exercise of one or more of the rights that are\r\nspecifically granted under this License.  You may not convey a covered\r\nwork if you are a party to an arrangement with a third party that is\r\nin the business of distributing software, under which you make payment\r\nto the third party based on the extent of your activity of conveying\r\nthe work, and under which the third party grants, to any of the\r\nparties who would receive the covered work from you, a discriminatory\r\npatent license (a) in connection with copies of the covered work\r\nconveyed by you (or copies made from those copies), or (b) primarily\r\nfor and in connection with specific products or compilations that\r\ncontain the covered work, unless you entered into that arrangement,\r\nor that patent license was granted, prior to 28 March 2007.\r\n\r\n  Nothing in this License shall be construed as excluding or limiting\r\nany implied license or other defenses to infringement that may\r\notherwise be available to you under applicable patent law.\r\n\r\n  12. No Surrender of Others' Freedom.\r\n\r\n  If conditions are imposed on you (whether by court order, agreement or\r\notherwise) that contradict the conditions of this License, they do not\r\nexcuse you from the conditions of this License.  If you cannot convey a\r\ncovered work so as to satisfy simultaneously your obligations under this\r\nLicense and any other pertinent obligations, then as a consequence you may\r\nnot convey it at all.  For example, if you agree to terms that obligate you\r\nto collect a royalty for further conveying from those to whom you convey\r\nthe Program, the only way you could satisfy both those terms and this\r\nLicense would be to refrain entirely from conveying the Program.\r\n\r\n  13. Use with the GNU Affero General Public License.\r\n\r\n  Notwithstanding any other provision of this License, you have\r\npermission to link or combine any covered work with a work licensed\r\nunder version 3 of the GNU Affero General Public License into a single\r\ncombined work, and to convey the resulting work.  The terms of this\r\nLicense will continue to apply to the part which is the covered work,\r\nbut the special requirements of the GNU Affero General Public License,\r\nsection 13, concerning interaction through a network will apply to the\r\ncombination as such.\r\n\r\n  14. Revised Versions of this License.\r\n\r\n  The Free Software Foundation may publish revised and/or new versions of\r\nthe GNU General Public License from time to time.  Such new versions will\r\nbe similar in spirit to the present version, but may differ in detail to\r\naddress new problems or concerns.\r\n\r\n  Each version is given a distinguishing version number.  If the\r\nProgram specifies that a certain numbered version of the GNU General\r\nPublic License \"or any later version\" applies to it, you have the\r\noption of following the terms and conditions either of that numbered\r\nversion or of any later version published by the Free Software\r\nFoundation.  If the Program does not specify a version number of the\r\nGNU General Public License, you may choose any version ever published\r\nby the Free Software Foundation.\r\n\r\n  If the Program specifies that a proxy can decide which future\r\nversions of the GNU General Public License can be used, that proxy's\r\npublic statement of acceptance of a version permanently authorizes you\r\nto choose that version for the Program.\r\n\r\n  Later license versions may give you additional or different\r\npermissions.  However, no additional obligations are imposed on any\r\nauthor or copyright holder as a result of your choosing to follow a\r\nlater version.\r\n\r\n  15. Disclaimer of Warranty.\r\n\r\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\r\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\r\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\r\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\r\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\r\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\r\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\r\n\r\n  16. Limitation of Liability.\r\n\r\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\r\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\r\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\r\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\r\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\r\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\r\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\r\nSUCH DAMAGES.\r\n\r\n  17. Interpretation of Sections 15 and 16.\r\n\r\n  If the disclaimer of warranty and limitation of liability provided\r\nabove cannot be given local legal effect according to their terms,\r\nreviewing courts shall apply local law that most closely approximates\r\nan absolute waiver of all civil liability in connection with the\r\nProgram, unless a warranty or assumption of liability accompanies a\r\ncopy of the Program in return for a fee.\r\n\r\n                     END OF TERMS AND CONDITIONS\r\n\r\n            How to Apply These Terms to Your New Programs\r\n\r\n  If you develop a new program, and you want it to be of the greatest\r\npossible use to the public, the best way to achieve this is to make it\r\nfree software which everyone can redistribute and change under these terms.\r\n\r\n  To do so, attach the following notices to the program.  It is safest\r\nto attach them to the start of each source file to most effectively\r\nstate the exclusion of warranty; and each file should have at least\r\nthe \"copyright\" line and a pointer to where the full notice is found.\r\n\r\n    <one line to give the program's name and a brief idea of what it does.>\r\n    Copyright (C) <year>  <name of author>\r\n\r\n    This program is free software: you can redistribute it and/or modify\r\n    it under the terms of the GNU General Public License as published by\r\n    the Free Software Foundation, either version 3 of the License, or\r\n    (at your option) any later version.\r\n\r\n    This program is distributed in the hope that it will be useful,\r\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n    GNU General Public License for more details.\r\n\r\n    You should have received a copy of the GNU General Public License\r\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\r\n\r\nAlso add information on how to contact you by electronic and paper mail.\r\n\r\n  If the program does terminal interaction, make it output a short\r\nnotice like this when it starts in an interactive mode:\r\n\r\n    <program>  Copyright (C) <year>  <name of author>\r\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\r\n    This is free software, and you are welcome to redistribute it\r\n    under certain conditions; type `show c' for details.\r\n\r\nThe hypothetical commands `show w' and `show c' should show the appropriate\r\nparts of the General Public License.  Of course, your program's commands\r\nmight be different; for a GUI interface, you would use an \"about box\".\r\n\r\n  You should also get your employer (if you work as a programmer) or school,\r\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\r\nFor more information on this, and how to apply and follow the GNU GPL, see\r\n<https://www.gnu.org/licenses/>.\r\n\r\n  The GNU General Public License does not permit incorporating your program\r\ninto proprietary programs.  If your program is a subroutine library, you\r\nmay consider it more useful to permit linking proprietary applications with\r\nthe library.  If this is what you want to do, use the GNU Lesser General\r\nPublic License instead of this License.  But first, please read\r\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n\nArchive v0.5.0: 15 files, 32632 bytes\n\nFiles: LICENSE (35823b), ONBOARDING.md (4651b), README.md (3627b), skill-card.md (2745b), SKILL.md (5839b), src/__init__.py (94b), src/cli.py (21158b), src/config.py (3847b), src/db.py (1349b), src/hook.py (3913b), src/migrations/env.py (1312b), src/migrations/versions/001_initial_schema.py (1728b), src/models.py (881b), src/pyproject.toml (368b), _meta.json (134b)\n\nFile v0.5.0:SKILL.md\n\n---\nname: git-log-tracker\ndisplayName: \"Git Log Tracker (Commit Index & Query CLI)\"\nversion: 0.5.0\ndescription: |\n  Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite database, then provides a CLI to query, list, stats, delete, and update records.\n  Trigger: managing git hooks, querying commit history across repos, finding which repo a commit belongs to, viewing commit statistics, recording commits to a local index.\n  Use this skill whenever the user mentions commit logging, commit indexing, finding commits across repos, git hook management, or wants to query their commit history in a structured way — even if they don't explicitly name the tool.\n---\n\n# Git Log Tracker\n\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\n- **GitHub**: https://github.com/KinemaClawWorkspace/git-log-tracker\n\n## ⚠️ Before First Use | 首次使用必读\n\n**首次使用此 skill 前，必须先读取 [ONBOARDING.md](ONBOARDING.md) 完成环境配置。**\n\nONBOARDING.md 采用**交互式流程**：\n- **Agent 必须先询问用户使用意图**（仅当前 repo / 多个 repo / 全局模式）\n- **根据用户选择执行相应步骤**，切勿自动执行全部命令\n\n- **首次配置** → 读取 ONBOARDING.md，按 Step 0 询问用户后执行\n- **环境不可用**（命令不存在、依赖缺失、连接失败）→ 读取 ONBOARDING.md Troubleshooting 排查修复\n- **配置完成后** → 直接使用下方 Run Commands\n\n## Overview\n\nGit Log Tracker 在每次 `git commit` 后自动将 commit 元数据写入本地 SQLite 数据库。通过 CLI 可以跨仓库查询、统计、修改和删除 commit 记录。\n\n数据存储在 `~/.commit-logs/index.db`，配置文件在 `~/.commit-logs/config.toml`。\n\n## Run Commands\n\n所有命令通过 `git-log-tracker <subcommand>` 运行。\n\n### 初始化\n\n首次安装后初始化配置和数据库：\n\n```bash\ngit-log-tracker setup\n```\n\n### Hook 管理\n\n安装 hook 到指定 repo（之后每次 commit 自动记录）：\n\n```bash\ngit-log-tracker install /path/to/repo\ngit-log-tracker install .                              # 当前 repo\n```\n\n检查 hook 状态：\n\n```bash\ngit-log-tracker status /path/to/repo\ngit-log-tracker status .\n```\n\n移除 hook：\n\n```bash\ngit-log-tracker uninstall /path/to/repo\n```\n\n全局模式（新 repo 自动带 hook）：\n\n```bash\ngit-log-tracker global          # 启用\ngit-log-tracker global --off    # 关闭\n```\n\n### 数据查询\n\n按 hash 查找（支持前缀匹配）：\n\n```bash\ngit-log-tracker find abc1234\n```\n\n`find` 输出示例：\n```\ncommit  abc1234def5678901234567890123456789012\nauthor  Lee <lee@example.com>\ndate    2025-05-29T14:30:00+08:00\nrepo    D:/modular_dev/task-tracker\nbranch  master\nsubject test(frontend): Phase 4 完成\n```\n\n列出最近 commit：\n\n```bash\ngit-log-tracker list                     # 最近 20 条\ngit-log-tracker list -n 50               # 最近 50 条\ngit-log-tracker list --repo task-tracker  # 按仓库名筛选\ngit-log-tracker list --author lee@example.com  # 按作者筛选\ngit-log-tracker list --since 2025-01-01   # 按日期筛选\ngit-log-tracker list --branch main        # 按分支筛选\ngit-log-tracker list --label work         # 按仓库标签筛选\n```\n\n`list` 输出为表格格式：`HASH | DATE | AUTHOR | REPO | SUBJECT`\n\n统计信息：\n\n```bash\ngit-log-tracker stats\ngit-log-tracker stats --label work        # 只统计带该标签的仓库\n```\n\n### 标签管理\n\n给仓库打**仓库级标签**（label），用于按\"组\"过滤查询（如 work / personal）。标签是 `repo_path` 的属性，改标签立即对该仓库全部历史 commit 生效。\n\n```bash\ngit-log-tracker label add . work               # 给当前仓库加 work 标签\ngit-log-tracker label add /path/to/repo work personal  # 一次加多个标签\ngit-log-tracker label rm . work                # 移除标签\ngit-log-tracker label list .                   # 查看某仓库的标签\ngit-log-tracker label list                     # 列出所有标签映射\n```\n\n标签存储在 `~/.commit-logs/labels.json`，结构为 `{ \"归一化repo_path\": [\"label1\", ...] }`。\n\n### 数据修改\n\n手动记录某个 repo 的最新 commit：\n\n```bash\ngit-log-tracker record .           # 当前 repo\ngit-log-tracker record /path/to/repo\n```\n\n删除记录：\n\n```bash\ngit-log-tracker delete abc1234\n```\n\n更新记录字段（可编辑字段：branch, commit_subject, commit_body, repo_path, repo_name）：\n\n```bash\ngit-log-tracker update abc1234 branch main\n```\n\n重置数据目录：\n\n```bash\ngit-log-tracker reinstall              # 删除数据目录并重新初始化\ngit-log-tracker reinstall --keep-config  # 只重置数据库，保留配置\n```\n\n### 配置\n\n编辑 `~/.commit-logs/config.toml` 管理排除列表：\n\n```toml\n[hooks]\nexclude = [\n    \"/tmp/*\",\n    # \"/path/to/specific/repo\",\n]\n\n[database]\npath = \"index.db\"\n```\n\n## Architecture\n\n安装后的系统结构：\n\n```\n~/.commit-logs/          # 数据目录（不含代码）\n├── config.toml          # 排除列表和数据库路径配置\n├── labels.json          # 仓库级标签映射（repo_path -> [labels]）\n├── index.db             # SQLite 数据库\n\n.git/hooks/post-commit   # Hook 文件，调用 git-log-tracker hook\n```\n\nCLI 工具通过 `uv tool install` 安装到系统，不在 ~/.commit-logs 中存放代码。\n\n## SQLite Schema\n\n```sql\ncommits(\n    id, commit_hash, short_hash, author_name, author_email, author_ts,\n    committer_name, committer_email, commit_subject, commit_body,\n    branch, repo_path, repo_name, parent_hashes, recorded_at\n)\n```\n\n索引：`commit_hash`(UNIQUE), `repo_path`, `author_email`, `recorded_at`\n\nFile v0.5.0:README.md\n\n# Git Log Tracker\n\nGit post-commit hook + SQLite 索引工具。自动记录每次 commit 的元数据，支持跨仓库查询、统计和管理。\n\n## 核心特性\n\n> **一句话**：安装 hook → 每次 commit 自动入库 → 跨仓库查询 / 统计 / 管理\n\n### 自动记录\n\nGit post-commit hook 自动写入 commit 元数据（hash、author、branch、repo、subject）到本地 SQLite 数据库。\n\n### 跨仓库查询\n\n- 按 hash、仓库、作者、日期、分支、标签筛选\n- 支持前缀匹配查找 commit\n- 查找某个 commit 属于哪个仓库\n\n### 仓库标签\n\n- 给仓库打**仓库级标签**（label），按\"组\"过滤（如 work / personal）\n- `list --label` / `stats --label` 只显示带该标签的仓库\n- 标签即时对该仓库全部历史 commit 生效\n\n### 统计与管理\n\n- 按仓库 / 作者聚合统计\n- CRUD 操作：record / delete / update\n- 全局模式：新 repo 自动安装 hook\n- 排除规则：fnmatch 通配符排除指定路径\n\n## 安装\n\n### 方法一：通过 Claude Code Marketplace\n\n1. 添加 Marketplace：\n\n```\n/plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace\n```\n\n2. 安装 Skill：\n\n```\n/plugin install git-log-tracker@kinema-skills-marketplace\n```\n\n3. 查看已安装的 Skill：\n\n```\n/plugin list\n```\n\n### 方法二：通过 ClawHub OpenClaw\n\n```bash\nopenclaw skills install git-log-tracker\n```\n\n## 适用场景\n\n| 场景 | 说明 |\n|------|------|\n| 查找跨仓库 commit | \"abc123 这个 commit 在哪个仓库？\" |\n| 查看 commit 历史 | \"列出最近 50 条 commit\" |\n| 统计工作量 | \"统计各仓库 / 作者的 commit 数量\" |\n| 管理 git hooks | \"给这个仓库安装 hook\" |\n| 全局 hook 管理 | \"新仓库自动带 hook\" |\n\n## 触发方式\n\n本 skill 为 OpenClaw/Claude Code 技能，安装后可通过对话触发：\n\n```\n安装 git hook 到这个仓库\n查找 abc123 这个 commit\n列出最近的 commit\n统计 commit 数量\ngit-log-tracker setup\n```\n\n首次使用需完成 [ONBOARDING.md](ONBOARDING.md) 环境配置（安装 CLI 工具）。\n\n## 命令列表\n\n| 命令 | 说明 |\n|------|------|\n| `setup` | 初始化配置和数据库 |\n| `install <repo>` | 安装 hook 到指定仓库 |\n| `uninstall <repo>` | 从指定仓库移除 hook |\n| `status <repo>` | 检查仓库 hook 状态 |\n| `global [--off]` | 配置全局 git 模板 |\n| `find <hash>` | 按 hash 查找 commit |\n| `list` | 列出最近的 commits（支持 `--label` 过滤） |\n| `stats` | 显示统计信息（支持 `--label` 过滤） |\n| `label add/rm/list [repo] [labels...]` | 管理仓库级标签 |\n| `record [repo]` | 手动记录最新 commit |\n| `delete <hash>` | 删除 commit 记录 |\n| `update <hash> <field> <value>` | 更新 commit 字段 |\n| `reinstall [--keep-config]` | 重置数据目录并重新初始化 |\n\n## 文件结构\n\n```\ngit-log-tracker/\n├── SKILL.md              # Skill 定义文件\n├── ONBOARDING.md         # 首次配置引导\n├── README.md             # 本文档\n├── src/\n│   ├── cli.py            # CLI 入口\n│   ├── config.py         # 配置管理\n│   ├── db.py             # SQLite 数据库操作\n│   ├── hook.py           # Hook 脚本\n│   └── pyproject.toml    # Python 项目配置\n│                         # 标签存储于 ~/.commit-logs/labels.json\n└── LICENSE               # GPLv3 许可证\n```\n\n## 作者\n\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\n\n## 许可证\n\n[GNU General Public License v3.0](LICENSE)\n\nFile v0.5.0:_meta.json\n\n{\n  \"ownerId\": \"kn7cjsf9pc9x1tmreq1dahs90s83p9y0\",\n  \"slug\": \"git-log-tracker\",\n  \"version\": \"0.5.0\",\n  \"publishedAt\": 1780294026465\n}\n\nFile v0.5.0:ONBOARDING.md\n\n# Git Log Tracker Onboarding\n\n> 本文档指导 AI Agent 以**交互式方式**完成首次环境配置。\n> Agent 应按顺序向用户提问，根据用户选择执行相应步骤。\n\n## Prerequisites | 前置条件\n\n- Python 3.11+\n- `uv` 包管理器\n- Git\n\n## 交互流程\n\n### Step 0: 询问用户使用意图\n\n**必须先询问用户，不要自动执行！**\n\nAgent 应使用 `AskUserQuestion` 工具询问用户的使用场景：\n\n```\n您打算如何使用 Git Log Tracker？\n- 仅当前 repo\n- 多个 repo（手动安装到每个）\n- 全局模式（新 repo 自动带 hook）\n```\n\n根据用户选择，执行不同的步骤：\n\n| 用户选择 | 执行步骤 |\n|----------|----------|\n| 仅当前 repo | Step 1-4 |\n| 多个 repo | Step 1-3（完成后询问具体 repo 列表） |\n| 全局模式 | Step 1-3 + Step 5 |\n\n---\n\n### Step 1: 安装 CLI 工具\n\n**所有场景都需要执行此步骤。**\n\n#### 安装方式\n\n从本地路径安装（作为 kinema_skills 组件的一部分）：\n```bash\nuv tool install D:/modular_dev/kinema_skills/git-log-tracker\n```\n\n或使用相对路径（如果在 kinema_skills 目录下）：\n```bash\nuv tool install ./git-log-tracker\n```\n\n#### 验证安装\n\n```bash\ngit-log-tracker --help\n# 期望: 显示帮助信息\ngit-log-tracker --version\n# 期望: git-log-tracker 0.2.0\n```\n\n---\n\n### Step 2: 初始化配置和数据库\n\n**所有场景都需要执行此步骤。**\n\n```bash\ngit-log-tracker setup\n```\n\n此命令会：\n- 创建 `~/.commit-logs/` 目录\n- 创建默认 `config.toml` 配置文件\n- 初始化 SQLite 数据库\n\n#### 验证\n\n```bash\nls ~/.commit-logs/\n# 期望: config.toml, index.db\ngit-log-tracker stats\n# 期望: Total commits: 0\n```\n\n---\n\n### Step 3: 验证环境\n\n**所有场景都需要执行此步骤。**\n\n```bash\ngit-log-tracker stats\n# 期望: 显示统计信息（初始为 0 commits）\n```\n\n---\n\n### Step 4: 安装 Hook 到当前 Repo\n\n**仅当用户选择\"仅当前 repo\"时执行此步骤。**\n\n#### 检测\n\n```bash\ngit-log-tracker status .\n```\n\n#### 安装\n\n```bash\ngit-log-tracker install .\n```\n\n#### 验证\n\n```bash\ngit-log-tracker status .\n# 期望: Status: installed [<repo_path>]\n```\n\n---\n\n### Step 5: 全局模式配置\n\n**仅当用户选择\"全局模式\"时执行此步骤。**\n\n配置 Git template 目录，使新 clone 的 repo 自动带上 hook：\n\n#### 检测\n\n```bash\ngit config --global --get init.templateDir\n```\n\n#### 安装\n\n```bash\ngit-log-tracker global\n```\n\n#### 验证\n\n```bash\ngit-log-tracker global --off  # 如需关闭\ngit config --global --get init.templateDir\n# 期望: ~/.git-templates\n```\n\n---\n\n## 数据存储位置\n\n安装后的数据存储结构：\n\n```\n~/.commit-logs/\n├── config.toml     # 配置文件（排除列表等）\n├── index.db        # SQLite 数据库\n```\n\n**代码不再存储在 ~/.commit-logs/，而是通过 uv tool install 安装为系统命令。**\n\n---\n\n## Troubleshooting | 故障排除\n\n| 错误 | 原因 | 解决方案 |\n|------|------|----------|\n| `git-log-tracker: command not found` | 未安装工具 | `uv tool install D:/modular_dev/kinema_skills/git-log-tracker` |\n| `No module named 'tomllib'` | Python < 3.11 | 安装 Python 3.11+ |\n| `uv: command not found` | uv 未安装 | `curl -LsSf https://astral.sh/uv/install.sh \\| sh` |\n| `Hook not triggering` | hook 文件无执行权限 | `chmod +x .git/hooks/post-commit` |\n| `database is locked` | 多进程并发写入 | 等待其他操作完成，SQLite 自动处理 |\n| `No commits found` | 数据库为空或排除规则过滤了 repo | 检查 `~/.commit-logs/config.toml` 中的 exclude 列表 |\n| `Multiple commits match prefix` | hash 前缀太短 | 使用更长的 hash 前缀或完整 hash |\n\n---\n\n## 升级方式\n\n从旧版本升级：\n\n1. **卸载旧 hook**（如果之前已安装）：\n   ```bash\n   # 如果之前使用 scripts/ 方式安装\n   rm ~/.commit-logs/hook.py ~/.commit-logs/db.py ~/.commit-logs/install.py ~/.commit-logs/query.py ~/.commit-logs/setup_global.py\n   rm -rf ~/.commit-logs/__pycache__\n   ```\n\n2. **重新安装 hook**（使用新 CLI）：\n   ```bash\n   git-log-tracker install .\n   ```\n\n3. **数据保留**：\n   - `~/.commit-logs/index.db` 和 `config.toml` 无需迁移，保持原样\n\n---\n\n## 版本管理\n\n**Skill 版本与 CLI 版本绑定，更新时需同步修改以下文件：**\n\n| 文件 | 版本位置 |\n|------|----------|\n| `pyproject.toml` | `version = \"x.y.z\"` |\n| `src/git_log_tracker/__init__.py` | `__version__ = \"x.y.z\"` |\n| `SKILL.md` | `version: x.y.z` (frontmatter) |\n\n更新版本后需要重新安装 CLI：\n```bash\nuv tool install D:/modular_dev/kinema_skills/git-log-tracker --force\n```\n\nFile v0.5.0:skill-card.md\n\n## Description: <br>\nGit Log Tracker installs Git post-commit hooks that record commit metadata into a local SQLite index and provides CLI commands to query, list, summarize, update, and delete records. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[leeshunee](https://clawhub.ai/user/leeshunee) <br>\n\n### License/Terms of Use: <br>\nGNU General Public License v3.0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to configure Git commit logging, manage post-commit hooks, and query commit activity across local repositories. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The release declares unrelated financial and purchase capability tags. <br>\nMitigation: Do not grant financial or purchase authority to this skill; the publisher should remove those tags or document why they apply. <br>\nRisk: Git hooks persistently record commit metadata, including repository paths, author information, subjects, and commit bodies, in ~/.commit-logs. <br>\nMitigation: Use per-repository hooks for intentional repositories, configure excludes, avoid sensitive repositories or commit messages, and periodically review ~/.commit-logs. <br>\nRisk: Global mode changes Git template configuration so future repositories can receive the hook automatically. <br>\nMitigation: Prefer per-repository installation unless global behavior is intentional, verify git config before enabling it, and disable global mode when no longer needed. <br>\nRisk: Delete and reinstall commands can remove or reset local commit records. <br>\nMitigation: Back up ~/.commit-logs/index.db before destructive operations and confirm the target hash or reset mode before running the command. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/leeshunee/git-log-tracker) <br>\n- [README](README.md) <br>\n- [Onboarding Guide](ONBOARDING.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and CLI output examples] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May propose commands that install Git hooks, change global Git template configuration, and manage a local SQLite commit index.] <br>\n\n## Skill Version(s): <br>\n0.5.0 (source: SKILL.md frontmatter, src/pyproject.toml, src/__init__.py, server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v0.5.0:src/pyproject.toml\n\n[project]\nname = \"git-log-tracker\"\nversion = \"0.5.0\"\ndescription = \"Git post-commit hook + SQLite commit index CLI\"\nrequires-python = \">=3.11\"\ndependencies = [\"sqlalchemy>=2.0\", \"alembic>=1.13\"]\n\n[project.scripts]\ngit-log-tracker = \"cli:main\"\n\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[tool.hatch.build.targets.wheel]\npackages = [\".\"]\n\nFile v0.5.0:LICENSE\n\nGNU GENERAL PUBLIC LICENSE\r\n                       Version 3, 29 June 2007\r\n\r\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\r\n Everyone is permitted to copy and distribute verbatim copies\r\n of this license document, but changing it is not allowed.\r\n\r\n                            Preamble\r\n\r\n  The GNU General Public License is a free, copyleft license for\r\nsoftware and other kinds of works.\r\n\r\n  The licenses for most software and other practical works are designed\r\nto take away your freedom to share and change the works.  By contrast,\r\nthe GNU General Public License is intended to guarantee your freedom to\r\nshare and change all versions of a program--to make sure it remains free\r\nsoftware for all its users.  We, the Free Software Foundation, use the\r\nGNU General Public License for most of our software; it applies also to\r\nany other work released this way by its authors.  You can apply it to\r\nyour programs, too.\r\n\r\n  When we speak of free software, we are referring to freedom, not\r\nprice.  Our General Public Licenses are designed to make sure that you\r\nhave the freedom to distribute copies of free software (and charge for\r\nthem if you wish), that you receive source code or can get it if you\r\nwant it, that you can change the software or use pieces of it in new\r\nfree programs, and that you know you can do these things.\r\n\r\n  To protect your rights, we need to \n\nArchive v0.4.0: 12 files, 30573 bytes\n\nFiles: LICENSE (35823b), ONBOARDING.md (4651b), README.md (3627b), skill-card.md (2696b), SKILL.md (5839b), src/__init__.py (94b), src/cli.py (20552b), src/config.py (3847b), src/db.py (1362b), src/hook.py (3913b), src/pyproject.toml (334b), _meta.json (134b)\n\nArchive v0.3.0: 12 files, 27996 bytes\n\nFiles: LICENSE (35823b), ONBOARDING.md (4651b), README.md (2005b), skill-card.md (2791b), SKILL.md (4920b), src/__init__.py (94b), src/cli.py (16725b), src/config.py (1621b), src/db.py (1362b), src/hook.py (3913b), src/pyproject.toml (334b), _meta.json (134b)","readmeExcerpt":"Skill: Git Log Tracker (Commit Index & Query CLI) Owner: leeshunee Summary: Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite data... Tags: latest:0.7.0 Version history: v0.7.0 | 2026-07-16T08:57:27.498Z | user 新增 Codex 插件适配并完善跨平台安装与运行说明。 v0.6.0 | 2026-06-04T10:07:04.152Z | user 新增 scan 命令批量扫描已有仓库并安装 hook v0.5.0 | 2","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"File v0.7.0:AGENTS.md\n\n<!-- kinema-tdd-injector: injected -->\r\n<!-- generated at: 2026-06-01 | packages: src (Python) -->\r\n\r\n# 研发自动化测试规范 (CLAUDE.md)\r\n\r\n> 适用对象：Claude Code 编码代理 + 前后端研发团队\r\n> 由 `kinema-tdd-injector` skill 生成\r\n\r\n---\r\n\r\n## 1. 核心原则\r\n\r\n本项目采用 **三阶测试体系**，按运行环境隔离：\r\n\r\n| 阶段       | src 目录                            | 执行者          | 外部依赖          |\r\n| -------- | ------------------ | ------------ | ------------- |\r\n| 单元测试     | `tests/unit/src/`            | Agent 自动 / 本地 | ❌ 无           |\r\n| 开发环境集成测试 | `tests/dev-integration/src/` | Agent 自动 / 本地 | ❌ 无（Mock / MSW） |\r\n| 测试环境集成测试 | `tests/testenv-integration/src/` | **用户手动**     | ✅ 真实数据库       |\r\n\r\n\r\n---\r\n\r\n## 2. 测试路径三层命名规则\r\n\r\n测试路径由三层组合而成，**逐层强制**：\r\n\r\n| 层 | 规则 |\r\n| - | - |\r\n| **阶段层** | 测试根必为 `tests/unit/`、`tests/dev-integration/`、`tests/testenv-integration/` |\r\n| **包层** | 阶段根的下一级必为仓库顶层应用包名（本项目：`src/`）。新增顶层应用包时**必须**在所有阶段根下同步建立同名目录 |\r\n| **模块层** | 包名目录下的子目录与该包源码内部结构 **1:1 对齐**，不得压缩或省略中间目录 |\r\n\r\n### 2.1 源码根直接镜像\r\n\r\n本项目为 **flat src 布局**：源码模块平铺在 `src/` 下（无内层应用包目录），测试树直接镜像 `src/` 内的结构，**不再多套一层目录**："},{"language":"text","snippet":"File v0.7.0:CLAUDE.md\n\n<!-- kinema-tdd-injector: injected -->\r\n<!-- generated at: 2026-06-01 | packages: src (Python) -->\r\n\r\n# 研发自动化测试规范 (CLAUDE.md)\r\n\r\n> 适用对象：Claude Code 编码代理 + 前后端研发团队\r\n> 由 `kinema-tdd-injector` skill 生成\r\n\r\n---\r\n\r\n## 1. 核心原则\r\n\r\n本项目采用 **三阶测试体系**，按运行环境隔离：\r\n\r\n| 阶段       | src 目录                            | 执行者          | 外部依赖          |\r\n| -------- | ------------------ | ------------ | ------------- |\r\n| 单元测试     | `tests/unit/src/`            | Agent 自动 / 本地 | ❌ 无           |\r\n| 开发环境集成测试 | `tests/dev-integration/src/` | Agent 自动 / 本地 | ❌ 无（Mock / MSW） |\r\n| 测试环境集成测试 | `tests/testenv-integration/src/` | **用户手动**     | ✅ 真实数据库       |\r\n\r\n\r\n---\r\n\r\n## 2. 测试路径三层命名规则\r\n\r\n测试路径由三层组合而成，**逐层强制**：\r\n\r\n| 层 | 规则 |\r\n| - | - |\r\n| **阶段层** | 测试根必为 `tests/unit/`、`tests/dev-integration/`、`tests/testenv-integration/` |\r\n| **包层** | 阶段根的下一级必为仓库顶层应用包名（本项目：`src/`）。新增顶层应用包时**必须**在所有阶段根下同步建立同名目录 |\r\n| **模块层** | 包名目录下的子目录与该包源码内部结构 **1:1 对齐**，不得压缩或省略中间目录 |\r\n\r\n### 2.1 源码根直接镜像\r\n\r\n本项目为 **flat src 布局**：源码模块平铺在 `src/` 下（无内层应用包目录），测试树直接镜像 `src/` 内的结构，**不再多套一层目录**："},{"language":"text","snippet":"File v0.7.0:skill-card.md\n\n## Description:\n\nGit Log Tracker records Git commit metadata to a local SQLite index through post-commit hooks and provides CLI commands to query, list, summarize, label, update, and delete records.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[leeshunee](https://clawhub.ai/user/leeshunee)\n\n### License/Terms of Use:\n\nGNU General Public License v3.0\n\n## Use Case:\n\nDevelopers and engineers use this skill to install and manage a Git post-commit tracking CLI, persist commit metadata locally, and query commit history across repositories.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Persistent Git hooks and global mode can affect future commits across repositories.\n\nMitigation: Ask for explicit scope before setup, prefer current-repository installation when appropriate, and verify or remove hooks with status and uninstall commands.\n\nRisk: The local index stores commit metadata such as author emails, branch names, repository paths, and commit subjects under ~/.commit-logs.\n\nMitigation: Restrict permissions on ~/.commit-logs, avoid recording sensitive repositories, and use delete or reinstall controls deliberately.\n\nRisk: Bulk scan installation, delete or update operations, reinstall actions, and remote installer commands can change many repositories or remove stored data.\n\nMitigation: Require explicit confirmation before broad or destructive commands, avoid curl-to-shell installation when a local or package-manager install is available, and back up important records before reset operations.\n\nRisk: The artifact includes unrelated AGENTS.md and CLAUDE.md policy files.\n\nMitigation: Review and remove unrelated policy files before deploying the skill package.\n\n## Reference(s):\n\n- [Git Log Tracker Onboarding](references/ONBOARDING.md)\n- [ClawHub Skill Page](https://clawhub.ai/leeshunee/skills/git-log-tracker)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configur"},{"language":"text","snippet":"### Hook 管理\n\n安装 hook 到指定 repo（之后每次 commit 自动记录）："},{"language":"text","snippet":"检查 hook 状态："},{"language":"text","snippet":"移除 hook："}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\nname: git-log-tracker\r\ndisplayName: \"Git Log Tracker (Commit Index & Query CLI)\"\r\nversion: 0.7.0\r\ndescription: |\r\n  Git post-commit hook + SQLite commit index tool. Automatically records every commit's metadata (hash, author, branch, repo, subject) into a local SQLite database, then provides a CLI to query, list, stats, delete, and update records.\r\n  Trigger: managing git hooks, querying commit history across repos, finding which repo a commit belongs to, viewing commit statistics, recording commits to a local index.\r\n  Use this skill whenever the user mentions commit logging, commit indexing, finding commits across repos, git hook management, or wants to query their commit history in a structured way — even if they don't explicitly name the tool.\r\n---\r\n\r\n# Git Log Tracker\r\n\r\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\r\n- **Organization**: [KinemaClawWorkspace](https://github.com/KinemaClawWorkspace)\r\n- **GitHub**: https://github.com/KinemaClawWorkspace/git-log-tracker\r\n\r\n## ⚠️ Before First Use | 首次使用必读\r\n\r\n**首次使用此 skill 前，必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**\r\n\r\nreferences/ONBOARDING.md 采用**交互式流程**：\r\n- **Agent 必须先询问用户使用意图**（仅当前 repo / 多个 repo / 全局模式）\r\n- **根据用户选择执行相应步骤**，切勿自动执行全部命令\r\n\r\n- **首次配置** → 读取 references/ONBOARDING.md，按 Step 0 询问用户后执行\r\n- **环境不可用**（命令不存在、依赖缺失、连接失败）→ 读取 references/ONBOARDING.md Troubleshooting 排查修复\r\n- **配置完成后** → 直接使用下方 Run Commands\r\n\r\n## Overview\r\n\r\nGit Log Tracker 在每次 `git commit` 后自动将 commit 元数据写入本地 SQLite 数据库。通过 CLI 可以跨仓库查询、统计、修改和删除 commit 记录。\r\n\r\n数据存储在 `~/.commit-logs/index.db`，配置文件在 `~/.commit-logs/config.toml`。\r\n\r\n## Run Commands\r\n\r\n所有命令通过 `git-log-tracker <subcommand>` 运行。\r\n\r\n### 初始化\r\n\r\n首次安装后初始化配置和数据库：\r\n\r\n```bash\r\ngit-log-tracker setup\r\n```\r\n\r\n### Hook 管理\r\n\r\n安装 hook 到指定 repo（之后每次 commit 自动记录）：\r\n\r\n```bash\r\ngit-log-tracker install /path/to/repo\r\ngit-log-tracker install .                              # 当前 repo\r\n```\r\n\r\n检查 hook 状态：\r\n\r\n```bash\r\ngit-log-tracker status /path/to/repo\r\ngit-log-tracker status .\r\n```\r\n\r\n移除 hook：\r\n\r\n```bash\r\ngit-log-tracker uninstall /path/to/repo\r\n```\r\n\r\n扫描目录中的 git 仓库：\r\n\r\n```bash\r\ngit-log-tracker scan /path/to/directory                     # 扫描并列出仓库\r\ngit-log-tracker scan /path/to/directory --depth 3           # 控制扫描深度\r\ngit-log-tracker scan /path/to/directory --install-missing   # 自动安装缺失 hook 的仓库\r\ngit-log-tracker scan /path/to/directory --interactive       # 交互式选择安装\r\ngit-log-tracker scan /path/to/directory --exclude \"*/temp/*\" --exclude \"*/.cache/*\"  # 排除路径\r\n```\r\n\r\n`scan` 输出示例：\r\n```\r\nScanning D:\\modular_dev for git repositories (depth=5)...\r\n\r\nFound 15 repositories:\r\n+----------------------------------------------------+--------------+--------------------+\r\n| Repo Path                                          | Hook Status  | Branches           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n| D:\\modular_dev\\kinema_skills                       | [OK]         | main (3)           |\r\n| D:\\modular_dev\\other_"},{"path":"README.md","content":"# Git Log Tracker\r\n\r\nGit post-commit hook + SQLite 索引工具。自动记录每次 commit 的元数据，支持跨仓库查询、统计和管理。\r\n\r\n## 核心特性\r\n\r\n> **一句话**：安装 hook → 每次 commit 自动入库 → 跨仓库查询 / 统计 / 管理\r\n\r\n### 自动记录\r\n\r\nGit post-commit hook 自动写入 commit 元数据（hash、author、branch、repo、subject）到本地 SQLite 数据库。\r\n\r\n### 跨仓库查询\r\n\r\n- 按 hash、仓库、作者、日期、分支、标签筛选\r\n- 支持前缀匹配查找 commit\r\n- 查找某个 commit 属于哪个仓库\r\n\r\n### 仓库标签\r\n\r\n- 给仓库打**仓库级标签**（label），按\"组\"过滤（如 work / personal）\r\n- `list --label` / `stats --label` 只显示带该标签的仓库\r\n- 标签即时对该仓库全部历史 commit 生效\r\n\r\n### 统计与管理\r\n\r\n- 按仓库 / 作者聚合统计\r\n- CRUD 操作：record / delete / update\r\n- 全局模式：新 repo 自动安装 hook\r\n- 排除规则：fnmatch 通配符排除指定路径\r\n\r\n## 安装\r\n\r\n### 方法一：通过 Codex Marketplace\r\n\r\n```powershell\r\ncodex plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace.git\r\ncodex plugin add git-log-tracker@kinema-skills-marketplace\r\n```\r\n\r\n安装后新开一个 Codex 对话。\r\n\r\n### 方法二：通过 Claude Code Marketplace\r\n\r\n1. 添加 Marketplace：\r\n\r\n```\r\n/plugin marketplace add https://github.com/KinemaClawWorkspace/kinema-skills-marketplace\r\n```\r\n\r\n2. 安装 Skill：\r\n\r\n```\r\n/plugin install git-log-tracker@kinema-skills-marketplace\r\n```\r\n\r\n3. 查看已安装的 Skill：\r\n\r\n```\r\n/plugin list\r\n```\r\n\r\n### 方法三：通过 ClawHub OpenClaw\r\n\r\n```bash\r\nopenclaw skills install git-log-tracker\r\n```\r\n\r\n## 适用场景\r\n\r\n| 场景 | 说明 |\r\n|------|------|\r\n| 查找跨仓库 commit | \"abc123 这个 commit 在哪个仓库？\" |\r\n| 查看 commit 历史 | \"列出最近 50 条 commit\" |\r\n| 统计工作量 | \"统计各仓库 / 作者的 commit 数量\" |\r\n| 管理 git hooks | \"给这个仓库安装 hook\" |\r\n| 全局 hook 管理 | \"新仓库自动带 hook\" |\r\n\r\n## 触发方式\r\n\r\n本 skill 支持 Codex、Claude Code 和 OpenClaw，安装后可通过对话触发：\r\n\r\n```\r\n安装 git hook 到这个仓库\r\n查找 abc123 这个 commit\r\n列出最近的 commit\r\n统计 commit 数量\r\ngit-log-tracker setup\r\n```\r\n\r\n首次使用需完成 [references/ONBOARDING.md](references/ONBOARDING.md) 环境配置（安装 CLI 工具）。\r\n\r\n## 命令列表\r\n\r\n| 命令 | 说明 |\r\n|------|------|\r\n| `setup` | 初始化配置和数据库 |\r\n| `install <repo>` | 安装 hook 到指定仓库 |\r\n| `uninstall <repo>` | 从指定仓库移除 hook |\r\n| `status <repo>` | 检查仓库 hook 状态 |\r\n| `scan <path> [--depth] [--install-missing] [--interactive] [--exclude]` | 扫描目录中的 git 仓库，批量管理 hook |\r\n| `global [--off]` | 配置全局 git 模板 |\r\n| `find <hash>` | 按 hash 查找 commit |\r\n| `list` | 列出最近的 commits（支持 `--label` 过滤） |\r\n| `stats` | 显示统计信息（支持 `--label` 过滤） |\r\n| `label add/rm/list [repo] [labels...]` | 管理仓库级标签 |\r\n| `record [repo]` | 手动记录最新 commit |\r\n| `delete <hash>` | 删除 commit 记录 |\r\n| `update <hash> <field> <value>` | 更新 commit 字段 |\r\n| `reinstall [--keep-config]` | 重置数据目录并重新初始化 |\r\n\r\n## 文件结构\r\n\r\n```\r\ngit-log-tracker/\r\n├── .claude-plugin/plugin.json\r\n├── .codex-plugin/plugin.json\r\n├── skills/git-log-tracker/SKILL.md\r\n├── SKILL.md              # Skill 定义文件\r\n├── references/ONBOARDING.md\r\n├── README.md             # 本文档\r\n├── src/\r\n│   ├── cli.py            # CLI 入口\r\n│   ├── config.py         # 配置管理\r\n│   ├── db.py             # SQLite 数据库操作\r\n│   ├── hook.py           # Hook 脚本\r\n│   └── pyproject.toml    # Python 项目配置\r\n│                         # 标签存储于 ~/.commit-logs/labels.json\r\n└── LICENSE               # GPLv3 许可证\r\n```\r\n\r\n## 作者\r\n\r\n- **Author**: [LeeShunEE](https://github.com/LeeShunEE)\r\n- **Organizati"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cjsf9pc9x1tmreq1dahs90s83p9y0\",\n  \"slug\": \"git-log-tracker\",\n  \"version\": \"0.7.0\",\n  \"publishedAt\": 1784192247498\n}"},{"path":"references/ONBOARDING.md","content":"# Git Log Tracker Onboarding\r\n\r\n> 本文档指导 AI Agent 以**交互式方式**完成首次环境配置。\r\n> Agent 应按顺序向用户提问，根据用户选择执行相应步骤。\r\n\r\n## Prerequisites | 前置条件\r\n\r\n- Python 3.11+\r\n- `uv` 包管理器\r\n- Git\r\n\r\n## 交互流程\r\n\r\n### Step 0: 询问用户使用意图\r\n\r\n**必须先询问用户，不要自动执行！**\r\n\r\nAgent 应使用 `AskUserQuestion` 工具询问用户的使用场景：\r\n\r\n```\r\n您打算如何使用 Git Log Tracker？\r\n- 仅当前 repo\r\n- 多个 repo（手动安装到每个）\r\n- 全局模式（新 repo 自动带 hook）\r\n- 批量扫描已有仓库并安装\r\n```\r\n\r\n根据用户选择，执行不同的步骤：\r\n\r\n| 用户选择 | 执行步骤 |\r\n|----------|----------|\r\n| 仅当前 repo | Step 1-4 |\r\n| 多个 repo | Step 1-3（完成后询问具体 repo 列表） |\r\n| 全局模式 | Step 1-3 + Step 5 |\r\n| 批量扫描已有仓库 | Step 1-3 + Step 6 |\r\n\r\n---\r\n\r\n### Step 1: 安装 CLI 工具\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n#### 安装方式\r\n\r\n从本地路径安装（作为 kinema_skills 组件的一部分）：\r\n```bash\r\nuv tool install \"<plugin_root>/src\"\r\n```\r\n\r\n或使用相对路径（如果在 kinema_skills 目录下）：\r\n```bash\r\nuv tool install \"./git-log-tracker/src\"\r\n```\r\n\r\n#### 验证安装\r\n\r\n```bash\r\ngit-log-tracker --help\r\n# 期望: 显示帮助信息\r\ngit-log-tracker --version\r\n# 期望: 与 SKILL.md 和 plugin manifest 相同的当前版本\r\n```\r\n\r\n---\r\n\r\n### Step 2: 初始化配置和数据库\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n```bash\r\ngit-log-tracker setup\r\n```\r\n\r\n此命令会：\r\n- 创建 `~/.commit-logs/` 目录\r\n- 创建默认 `config.toml` 配置文件\r\n- 初始化 SQLite 数据库\r\n\r\n#### 验证\r\n\r\n```bash\r\nls ~/.commit-logs/\r\n# 期望: config.toml, index.db\r\ngit-log-tracker stats\r\n# 期望: Total commits: 0\r\n```\r\n\r\n---\r\n\r\n### Step 3: 验证环境\r\n\r\n**所有场景都需要执行此步骤。**\r\n\r\n```bash\r\ngit-log-tracker stats\r\n# 期望: 显示统计信息（初始为 0 commits）\r\n```\r\n\r\n---\r\n\r\n### Step 4: 安装 Hook 到当前 Repo\r\n\r\n**仅当用户选择\"仅当前 repo\"时执行此步骤。**\r\n\r\n#### 检测\r\n\r\n```bash\r\ngit-log-tracker status .\r\n```\r\n\r\n#### 安装\r\n\r\n```bash\r\ngit-log-tracker install .\r\n```\r\n\r\n#### 验证\r\n\r\n```bash\r\ngit-log-tracker status .\r\n# 期望: Status: installed [<repo_path>]\r\n```\r\n\r\n---\r\n\r\n### Step 5: 全局模式配置\r\n\r\n**仅当用户选择\"全局模式\"时执行此步骤。**\r\n\r\n配置 Git template 目录，使新 clone 的 repo 自动带上 hook：\r\n\r\n#### 检测\r\n\r\n```bash\r\ngit config --global --get init.templateDir\r\n```\r\n\r\n#### 安装\r\n\r\n```bash\r\ngit-log-tracker global\r\n```\r\n\r\n#### 验证\r\n\r\n```bash\r\ngit-log-tracker global --off  # 如需关闭\r\ngit config --global --get init.templateDir\r\n# 期望: ~/.git-templates\r\n```\r\n\r\n---\r\n\r\n### Step 6: 批量扫描已有仓库\r\n\r\n**仅当用户选择\"批量扫描已有仓库\"时执行此步骤。**\r\n\r\n> ⚠️ **重要提示**：全局模式（Step 5）只会影响**后续创建或 clone 的仓库**，已有仓库不会自动注入 hook。\r\n> 使用 `scan` 命令可以批量扫描并安装已有仓库的 hook。\r\n\r\n#### 扫描目录\r\n\r\n```bash\r\n# 扫描指定目录（默认深度 5）\r\ngit-log-tracker scan D:/modular_dev\r\n\r\n# 控制扫描深度\r\ngit-log-tracker scan D:/modular_dev --depth 3\r\n```\r\n\r\n输出示例：\r\n```\r\nScanning D:\\modular_dev for git repositories (depth=3)...\r\n\r\nFound 8 repositories:\r\n+----------------------------------------------------+--------------+--------------------+\r\n| Repo Path                                          | Hook Status  | Branches           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n| D:\\modular_dev\\kinema_skills\\git-log-tracker       | [OK]         | master (1)         |\r\n| D:\\modular_dev\\other_project                       | [--]         | main (1)           |\r\n+----------------------------------------------------+--------------+--------------------+\r\n\r\nSummary: 1 installed, 1 missing\r\n```\r\n\r\n#"},{"path":"AGENTS.md","content":"<!-- kinema-tdd-injector: injected -->\r\n<!-- generated at: 2026-06-01 | packages: src (Python) -->\r\n\r\n# 研发自动化测试规范 (CLAUDE.md)\r\n\r\n> 适用对象：Claude Code 编码代理 + 前后端研发团队\r\n> 由 `kinema-tdd-injector` skill 生成\r\n\r\n---\r\n\r\n## 1. 核心原则\r\n\r\n本项目采用 **三阶测试体系**，按运行环境隔离：\r\n\r\n| 阶段       | src 目录                            | 执行者          | 外部依赖          |\r\n| -------- | ------------------ | ------------ | ------------- |\r\n| 单元测试     | `tests/unit/src/`            | Agent 自动 / 本地 | ❌ 无           |\r\n| 开发环境集成测试 | `tests/dev-integration/src/` | Agent 自动 / 本地 | ❌ 无（Mock / MSW） |\r\n| 测试环境集成测试 | `tests/testenv-integration/src/` | **用户手动**     | ✅ 真实数据库       |\r\n\r\n\r\n---\r\n\r\n## 2. 测试路径三层命名规则\r\n\r\n测试路径由三层组合而成，**逐层强制**：\r\n\r\n| 层 | 规则 |\r\n| - | - |\r\n| **阶段层** | 测试根必为 `tests/unit/`、`tests/dev-integration/`、`tests/testenv-integration/` |\r\n| **包层** | 阶段根的下一级必为仓库顶层应用包名（本项目：`src/`）。新增顶层应用包时**必须**在所有阶段根下同步建立同名目录 |\r\n| **模块层** | 包名目录下的子目录与该包源码内部结构 **1:1 对齐**，不得压缩或省略中间目录 |\r\n\r\n### 2.1 源码根直接镜像\r\n\r\n本项目为 **flat src 布局**：源码模块平铺在 `src/` 下（无内层应用包目录），测试树直接镜像 `src/` 内的结构，**不再多套一层目录**：\r\n\r\n```\r\nsrc/db.py      → tests/unit/src/test_db.py        ✅\r\nsrc/models.py  → tests/unit/src/test_models.py    ✅\r\nsrc/cli.py     → tests/unit/src/test_cli.py       ✅\r\n```\r\n\r\n若将来 `src/` 下出现子包（如 `src/service/`），按 §2.2 规则继续镜像：`src/service/task_service.py → tests/unit/src/service/test_task_service.py`。`src/migrations/` 下的迁移脚本按 §7.3 排除，不强制测试。\r\n\r\n### 2.2 文件命名规则\r\n\r\n| 语言 | 源 | 测试 |\r\n| - | - | - |\r\n| **Python** | `<pkg-source-root>/<path>/<module>.py` | `tests/<阶段>/<pkg>/<path>/test_<module>.py` |\r\n| **TS/TSX** | `<pkg-source-root>/<path>/<Name>.ts(x)` | `tests/<阶段>/<pkg>/<path>/<Name>.test.ts(x)` |\r\n\r\n**强制约束**：\r\n- Python 测试名 = `test_` + **完整**源文件名（包括 `_router` / `_service` / `_dao` 等后缀），不许缩写、不许用功能名替代\r\n- TS 测试名 = **原始大小写**源文件名 + `.test`（PascalCase 组件保持 PascalCase，camelCase hook 保持 camelCase）\r\n- Python 与 TS 命名规范不同，是为了贴合各自社区工具链（pytest 默认匹配 `test_*`、vitest 默认匹配 `*.test.*`）\r\n\r\n### 2.3 归属判定原则\r\n\r\n测试归到哪个子目录，**只看源文件物理位置**，与功能语义、模块名含义无关：\r\n\r\n- `models/fts.py`（FTS 是搜索功能） → `models/`，**不归** `service/` 或 `search/`\r\n- 包根 `main.py`（FastAPI 入口等） → 包根 `tests/<阶段>/<pkg>/test_main.py`\r\n- `core/lifespan.py`（启动钩子） → `core/`\r\n\r\n### 2.4 测试文件拆分规则（C+D 组合）\r\n\r\n测试**原则上单文件**，用 `class`（Python）/ `describe`（TS）分组：\r\n\r\n```python\r\n# tests/unit/src/service/test_task_service.py\r\nclass TestCreate: ...\r\nclass TestQuery: ...\r\nclass TestDelete: ...\r\n```\r\n\r\n若单测试文件超过 **800 行**仍难维护，**先考虑拆源码**（源文件已职责过载），源码拆完测试自动 1:1 跟随。**禁止单独拆测试文件而源码不动**。\r\n\r\n### 2.5 测试数据文件\r\n\r\n非测试代码的辅助数据（JSON / CSV / SQL dump / 图片）一律放 `tests/data/`，按所属测试路径再镜像：\r\n\r\n```\r\ntests/data/src/service/task_service/large_input.json\r\n```\r\n\r\n- `tests/data/` 不放任何 `*.py` / `*.ts` 测试代码\r\n- 超大 fixture（GB 级 sample）走 LFS 或外部存储，**不进 git**\r\n\r\n---\r\n\r\n## 3. Agent 自动行为规范\r\n\r\n### 3.1 完成以下任务后，必须自动运行测试\r\n\r\n- bug 修复后\r\n- 新功能开发完成\r\n- 重构导致接口变更\r\n\r\n### 3.2 自动运行的命令序列\r\n\r\n**后端**（工作目录：`src/`）：\r\n\r\n```bash\r\ncd src\r\nuv run pytest ../tests/unit/src/ -v\r\nuv run pytest ../tests/dev-integration/src/ -v\r\n```\r\n\r\n\r\n**激活规则**：一律使用 `uv run`（自动管理 venv），**禁止**在命令前添加 `sourc"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":976,"uniquenessScore":41,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T14:58:41.045Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:41:19.396Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}