@kairyou/agent-tools 0.10.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Tools
2
2
 
3
- Reusable Agent Skills and installable integrations statusline, provider usage, and vision for Codex, Claude Code, and opencode.
3
+ Reusable Agent Skills, plus integrations (statusline, provider usage, vision) that install into Codex, Claude Code, and opencode.
4
4
 
5
5
  Requires Node.js >= 22.
6
6
 
@@ -77,6 +77,7 @@ Runtime capabilities, installed per agent:
77
77
 
78
78
  ```bash
79
79
  npx -y @kairyou/agent-tools@latest <capability> -a <agent...>
80
+ # npx -y github:kairyou/agent-tools <capability> -a <agent...> # Or the latest code from GitHub (needs Git)
80
81
  ```
81
82
 
82
83
  `--dry-run` previews, `--uninstall` unwires the integration from the agent, and
@@ -218,25 +219,30 @@ To diagnose the provider setup or test recognition quality manually:
218
219
  npx -y @kairyou/agent-tools@latest inspect-image <path|url> -q "What are the navbar background color and height?"
219
220
  ```
220
221
 
221
- ## Run from Git
222
+ ## Extras
222
223
 
223
- To run directly from the repository, replace the npm package name with
224
- `github:kairyou/agent-tools` (Git required):
225
-
226
- ```bash
227
- npx -y github:kairyou/agent-tools usage -a codex
228
- ```
229
-
230
- Contributors can see the [repository structure](docs/en/repository-structure.md).
224
+ See [extras](docs/en/extras.md) for situational content.
231
225
 
232
226
  ## FAQ
233
227
 
234
- ### Why does global installation fail for PromptScript?
228
+ ### Why does installing skills report PromptScript as unsupported?
235
229
 
236
230
  `PromptScript does not support global skill installation` means that the
237
231
  PromptScript agent does not support global installation. It does not affect
238
232
  other agents and can be ignored. See [`skills` issue #1352](https://github.com/vercel-labs/skills/issues/1352).
239
233
 
234
+ ### How do I install skills without GitHub access?
235
+
236
+ Install from the npm package instead (swap `at-commit` for the skills you want):
237
+
238
+ ```bash
239
+ cd "$(mktemp -d)" && tar -xf "$(npm pack @kairyou/agent-tools --silent)" && npx -y skills@latest add ./package --skill at-commit -g -y
240
+ ```
241
+
242
+ ### Want to contribute?
243
+
244
+ See the [repository structure](docs/en/repository-structure.md).
245
+
240
246
  ## Acknowledgements
241
247
 
242
248
  - `at-commit` draws on commit-message generation ideas from
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md)
4
4
 
5
- 可复用的 Agent Skills, 以及面向 Codex, Claude Code 与 opencode 的可安装 integrations: statusline, provider usage 与跨模型识图.
5
+ 可复用的 Agent Skills, 以及可装入 Codex, Claude Code 与 opencode integrations: statusline, provider usage 与跨模型识图.
6
6
 
7
7
  需要 Node.js >= 22.
8
8
 
@@ -77,6 +77,7 @@ Runtime capability, 按 agent 选装:
77
77
 
78
78
  ```bash
79
79
  npx -y @kairyou/agent-tools@latest <capability> -a <agent...>
80
+ # npx -y github:kairyou/agent-tools <capability> -a <agent...> # 或用 GitHub 上的最新代码(需 Git)
80
81
  ```
81
82
 
82
83
  `--dry-run` 预览, `--uninstall` 解除对应集成, 重新执行安装命令即为更新.
@@ -173,7 +174,7 @@ balance $362 | today $61.7 | 30d $566
173
174
 
174
175
  ### Vision(跨模型识图)
175
176
 
176
- 让不支持图片的主模型借助多模态模型识图, 适用于读取报错截图、按设计稿还原 UI、定位测试反馈截图里的界面问题.
177
+ 让不支持图片的主模型借助多模态模型识图, 适用于读取报错截图, 按设计稿还原 UI, 定位测试反馈截图里的界面问题.
177
178
 
178
179
  #### 安装
179
180
 
@@ -213,23 +214,29 @@ npx -y @kairyou/agent-tools@latest vision -a claude codex opencode
213
214
  npx -y @kairyou/agent-tools@latest inspect-image <path|url> -q "导航栏的背景色和高度是多少"
214
215
  ```
215
216
 
216
- ## 从 Git 运行
217
+ ## Extras
217
218
 
218
- 如需直接使用仓库版本, 可将 npm 包名替换为 `github:kairyou/agent-tools` (本机需已安装 Git):
219
-
220
- ```bash
221
- npx -y github:kairyou/agent-tools usage -a codex
222
- ```
223
-
224
- 贡献者可参考[仓库结构](docs/zh-CN/repository-structure.md).
219
+ [extras](docs/zh-CN/extras.md) 收录场景较窄的内容.
225
220
 
226
221
  ## FAQ
227
222
 
228
- ### 为什么全局安装提示 PromptScript 不支持?
223
+ ### 为什么安装 skills 时提示 PromptScript 不支持?
229
224
 
230
225
  `PromptScript does not support global skill installation` 表示 PromptScript Agent 不支持全局
231
226
  安装, 不影响其他 Agent, 可忽略. 参见 [`skills` issue #1352](https://github.com/vercel-labs/skills/issues/1352).
232
227
 
228
+ ### 无法访问 GitHub 时如何安装 skills?
229
+
230
+ 直接从 npm 包安装(`at-commit` 换成你要装的 skill):
231
+
232
+ ```bash
233
+ cd "$(mktemp -d)" && tar -xf "$(npm pack @kairyou/agent-tools --silent)" && npx -y skills@latest add ./package --skill at-commit -g -y
234
+ ```
235
+
236
+ ### 想参与开发?
237
+
238
+ 参见[仓库结构](docs/zh-CN/repository-structure.md).
239
+
233
240
  ## 参考与致谢
234
241
 
235
242
  - `at-commit` 借鉴了 [OpenCommit](https://github.com/di-sukharev/opencommit) 和
@@ -1,10 +1,6 @@
1
- // agent-tools config.
2
- // statusline.fields controls both visibility and order.
3
- // Remove a field to hide it; move a field to reorder it.
4
- // Available statusline fields: branch, model, fiveHour, week, context, directory.
5
- // providerUsage is used by the shared usage runtime.
6
1
  {
7
2
  "statusline": {
3
+ // Shown in this order; available: branch, model, fiveHour, week, context, directory
8
4
  "fields": ["branch", "model", "fiveHour", "week"],
9
5
  "separator": " | ",
10
6
  "symbols": {
@@ -17,7 +13,20 @@
17
13
  }
18
14
  },
19
15
  "providerUsage": {
20
- "days": 30,
21
- "debug": false
16
+ "days": 30, // recent days of spend to count
17
+ "debug": false // true: log probes to ~/.agent-tools/logs/usage-debug.log
22
18
  }
19
+
20
+ // Optional blocks below: uncomment every line of a block, including its leading comma.
21
+
22
+ // at-self-eval, at-daily-log: default projects (otherwise just the current repo)
23
+ // , "workProjects": [
24
+ // "C:\\projects\\project-a",
25
+ // "C:\\projects\\project-b"
26
+ // ]
27
+
28
+ // at-daily-log: default file when asked to record; at-self-eval reads it as fallback
29
+ // , "dailyLog": {
30
+ // "output": "C:\\projects\\todo.md"
31
+ // }
23
32
  }
@@ -0,0 +1,63 @@
1
+ # Extras
2
+
3
+ Fully usable, just situational. Install each on demand.
4
+
5
+ ## at-self-eval
6
+
7
+ Summarize git history, a work log you provide, or both into a self-evaluation
8
+ for performance cycles (quarterly, semi-annual, promotion).
9
+
10
+ ```bash
11
+ npx -y skills@latest add kairyou/agent-tools --skill at-self-eval -g -y
12
+ ```
13
+
14
+ Usage:
15
+
16
+ - `/at-self-eval` — the current Git user's work this quarter
17
+ - `/at-self-eval [<author>] [--from yyyy-mm-dd] [--to yyyy-mm-dd]` — pick author and range
18
+ - Plain language works too: say "summarize the first half of the year" instead of writing flags
19
+ - `/at-self-eval summarize July for C:\projects\project-a and C:\projects\project-b` — only those projects
20
+ - `/at-self-eval also include C:\projects\project-c` — add to the default scope
21
+ - Paste a daily/weekly log, or give a file path, to add business context
22
+ - `/at-self-eval summarize from C:\projects\todo.md only` — log only, Git is not read
23
+
24
+ Review the generated result before use.
25
+
26
+ ## at-daily-log
27
+
28
+ Summarize the day's Git activity across projects into a daily work log.
29
+
30
+ ```bash
31
+ npx -y skills@latest add kairyou/agent-tools --skill at-daily-log -g -y
32
+ ```
33
+
34
+ Usage:
35
+
36
+ - `/at-daily-log` — print today's log
37
+ - `/at-daily-log 2026-07-31` — pick the date
38
+ - `/at-daily-log summarize today for C:\projects\project-a` — only that project
39
+ - `/at-daily-log also include C:\projects\project-c` — add to the default scope
40
+ - `/at-daily-log record the log` — record to the configured file; rerunning a day only refreshes the generated part
41
+ - `/at-daily-log record it to C:\projects\todo.md` — record to that file
42
+ - `/at-daily-log record every workday at 18:00` — guides you through an OS scheduled task
43
+
44
+ Review the generated result before use.
45
+
46
+ ## Optional configuration
47
+
48
+ All in `~/.agent-tools/config.jsonc`:
49
+
50
+ ```jsonc
51
+ {
52
+ // at-self-eval, at-daily-log: default projects (otherwise just the current repo)
53
+ "workProjects": [
54
+ "C:\\projects\\project-a",
55
+ "C:\\projects\\project-b"
56
+ // "C:\\projects\\temporarily-disabled"
57
+ ],
58
+ // at-daily-log: default file when asked to record; at-self-eval also reads it as fallback
59
+ "dailyLog": {
60
+ "output": "C:\\projects\\todo.md"
61
+ }
62
+ }
63
+ ```
@@ -36,7 +36,7 @@ export async function run(context, { requestJson, agentConfig }) {
36
36
  const session = await login.json();
37
37
 
38
38
  // requestJson 会解析 JSON, 并在非 2xx 响应时抛错; 需要时可在这里传入
39
- // authorizationcookie 等自定义认证 header.
39
+ // authorization, cookie 等自定义认证 header.
40
40
  const me = await requestJson(`${context.baseUrl}/api/user/self`, {
41
41
  headers: { authorization: `Bearer ${session?.data?.accessToken}` },
42
42
  });
@@ -0,0 +1,62 @@
1
+ # Extras
2
+
3
+ 完整可用, 只是场景较窄. 按需单独安装.
4
+
5
+ ## at-self-eval
6
+
7
+ 把 git 历史或你提供的工作日志归纳成自评产出清单, 用于季度/半年/晋升等绩效周期.
8
+
9
+ ```bash
10
+ npx -y skills@latest add kairyou/agent-tools --skill at-self-eval -g -y
11
+ ```
12
+
13
+ 用法:
14
+
15
+ - `/at-self-eval` — 默认统计当前 Git 用户本季度的工作
16
+ - `/at-self-eval [<作者>] [--from yyyy-mm-dd] [--to yyyy-mm-dd]` — 指定作者与日期范围
17
+ - 在对话里直接说 `统计上半年的工作` / `统计1-3月的产出` 即可, 无需手写参数
18
+ - `/at-self-eval 统计 C:\projects\project-a 和 C:\projects\project-b 的 7 月工作` — 只统计指定项目
19
+ - `/at-self-eval 另外包含 C:\projects\project-c` — 在默认范围上追加
20
+ - 可粘贴日报或周报文本, 也可提供文件路径补充业务背景
21
+ - `/at-self-eval 只根据 C:\projects\todo.md 总结` — 只凭日志生成, 不读 Git
22
+
23
+ 生成的结果请人工核对.
24
+
25
+ ## at-daily-log
26
+
27
+ 汇总一天内各项目的 Git 活动, 生成工作日报.
28
+
29
+ ```bash
30
+ npx -y skills@latest add kairyou/agent-tools --skill at-daily-log -g -y
31
+ ```
32
+
33
+ 用法:
34
+
35
+ - `/at-daily-log` — 输出今天的日报
36
+ - `/at-daily-log 2026-07-31` — 指定日期
37
+ - `/at-daily-log 统计 C:\projects\project-a 今天的工作` — 只统计指定项目
38
+ - `/at-daily-log 另外包含 C:\projects\project-c` — 在默认范围上追加
39
+ - `/at-daily-log 记录日报` — 记录到配置的文件; 同一天重复执行只更新生成的部分
40
+ - `/at-daily-log 记录到 C:\projects\todo.md` — 记录到指定文件
41
+ - `/at-daily-log 每个工作日 18:00 自动记录` — 引导搭建系统定时任务
42
+
43
+ 生成的结果请人工核对.
44
+
45
+ ## 可选配置
46
+
47
+ 都在 `~/.agent-tools/config.jsonc`:
48
+
49
+ ```jsonc
50
+ {
51
+ // at-self-eval, at-daily-log: 默认统计的项目(不配则只统计当前项目)
52
+ "workProjects": [
53
+ "C:\\projects\\project-a",
54
+ "C:\\projects\\project-b"
55
+ // "C:\\projects\\temporarily-disabled"
56
+ ],
57
+ // at-daily-log: 记录日报的默认文件; 未提供日志时 at-self-eval 也读它作补充
58
+ "dailyLog": {
59
+ "output": "C:\\projects\\todo.md"
60
+ }
61
+ }
62
+ ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kairyou/agent-tools",
3
- "version": "0.10.1",
4
- "description": "Reusable Agent Skills and installable integrations (statusline, provider usage, vision) for Codex, Claude Code, and opencode.",
3
+ "version": "0.11.0",
4
+ "description": "Reusable Agent Skills, plus integrations (statusline, provider usage, vision) that install into Codex, Claude Code, and opencode.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: at-daily-log
3
+ description: "Summarize one day's Git activity into a concise daily work log. Uses the current repository, optional configured work projects, or paths named in conversation; configuration is never required."
4
+ argument-hint: "[<date>]"
5
+ ---
6
+
7
+ # Daily Work Log
8
+
9
+ `resolve evidence -> group related commits -> draft or record`
10
+
11
+ ## Date and evidence scope
12
+
13
+ Default to today. Accept plain-language dates or `YYYY-MM-DD`; query through the next
14
+ day because Git's `--until` boundary is exclusive. State the resolved date.
15
+
16
+ Read optional `workProjects` from `~/.agent-tools/config.jsonc`.
17
+
18
+ - No project named: current Git repository plus configured projects.
19
+ - Projects named directly: only those projects.
20
+ - "Also include" / `另外包含`: add them to the default scope.
21
+
22
+ Resolve paths to Git roots and deduplicate them. Report invalid paths; a non-Git current
23
+ directory does not block other valid projects. Do not clone remote URLs without consent.
24
+
25
+ For each repository, resolve the author with `git -C <root> config user.name`; never
26
+ infer aliases or use the remote login as the author. Filter commits by comparing `%an`
27
+ literally, not via an `--author` regex. Inspect all local branches, current
28
+ HEAD, user-named branches, and configured upstreams. Unless the user requests local-only
29
+ data, refresh only the configured upstream branches, grouped into one best-effort
30
+ `git fetch --no-tags <remote> <branch...>` per involved remote. Fetch failure is
31
+ non-fatal. Do not change the working tree or local branch history. Deduplicate commits
32
+ by hash.
33
+
34
+ ## Build work items
35
+
36
+ Collect non-merge commits for the resolved author and day. Use subjects and changed
37
+ paths to turn related commits into concrete completed work items. Fold formatting,
38
+ version bumps, and follow-up fixes into the outcome they supported; do not inflate one
39
+ change into several deliverables.
40
+
41
+ Use file counts and added/deleted lines only when they meaningfully support the work
42
+ item. Generated files, lockfile churn, renames, and bulk formatting often make those
43
+ numbers misleading. Metrics are evidence, never hours, difficulty, impact, or a
44
+ productivity score.
45
+
46
+ Current uncommitted changes may be shown separately as **in progress**, but never as
47
+ proof of work on a past date. User-provided non-code work must remain clearly identified
48
+ as user context.
49
+
50
+ ## Output
51
+
52
+ Match the user's language and omit empty sections:
53
+
54
+ ```markdown
55
+ + 2026-07-31
56
+ 完成 2 项:
57
+ 1. agent-tools: 完成多项目日报规则和 skill 落地.
58
+ 2. vscode-plugin: 修复 Webview 刷新后状态丢失问题, 补充回归验证.
59
+
60
+ 进行中 1 项:
61
+ - iunit-web: 推进导入流程重构, 已完成数据解析.
62
+
63
+ 汇总: 3 个项目, 2 项完成, 1 项进行中.
64
+ ```
65
+
66
+ Prefer outcomes over raw Git metrics. If no verified activity exists, say so rather
67
+ than fabricate an entry.
68
+
69
+ ## Draft or record
70
+
71
+ "Generate" / `生成日报` returns a draft. "Record" / `记录日报`, or an explicit
72
+ write request, writes after previewing the entry. Resolve the destination in order:
73
+
74
+ 1. a path supplied in conversation;
75
+ 2. optional `dailyLog.output` in `~/.agent-tools/config.jsonc`;
76
+ 3. no destination: return the draft without writing.
77
+
78
+ Read the destination before editing. Wrap each date's generated content in that date's
79
+ own markers, `<!-- log:2026-07-31:start -->` / `<!-- log:2026-07-31:end -->`; the date
80
+ line and every line outside the markers belong to the user. For an existing date, show
81
+ the current block and the regenerated one before writing, then replace only that
82
+ date's block. If the date exists without markers, append a marked block below the
83
+ user's lines instead of editing them. Do not duplicate the date. On duplicate or
84
+ unpaired markers, stop and propose the edit instead of writing. When Git shows no
85
+ activity, leave the file unchanged and say so; the user can add a manual entry
86
+ themselves.
87
+
88
+ Scheduling is separate; set it up only when the user asks. Prefer the OS scheduler
89
+ (Task Scheduler, cron, launchd) over agent-internal timers, which stop with the agent:
90
+ schedule a headless run of the CLI this skill is executing in, invoking the skill with
91
+ a recording request (in Claude Code, `claude -p "/at-daily-log record the log"`; other
92
+ CLIs have their own headless form). Keep projects and output in config so the command
93
+ stays stable. Before registering, confirm the schedule (suggest workdays),
94
+ make sure the output file is resolvable, and run the exact command once; register only
95
+ after that test run records correctly, and show how to remove the task. Headless auth
96
+ differs from the interactive session, so a failed test run means stop instead of
97
+ registering, and show the exact command, its error output, and the likely fix (log in
98
+ for headless use, adjust the output path). An unattended run has nobody to confirm with, so it must follow the
99
+ marker rules exactly and skip any file it cannot edit that way.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: at-self-eval
3
+ description: "Summarize a contributor's Git history, a provided work log, or both into a concise, review-friendly self-evaluation for quarterly, semi-annual, or promotion cycles."
4
+ argument-hint: "[<author>] [--from yyyy-mm-dd] [--to yyyy-mm-dd]"
5
+ ---
6
+
7
+ # Self-Evaluation Summary
8
+
9
+ `resolve evidence -> group by business line -> deduplicate -> <=8 outcomes -> review`
10
+
11
+ ## Author and date window
12
+
13
+ Normalize flags or plain language such as `统计1-3月的产出` and `统计上半年的工作`
14
+ into `(author, from, to)`. Explicit input wins; fill only missing values:
15
+
16
+ | User gave | Resolve to |
17
+ | --- | --- |
18
+ | `from` and `to` | use both |
19
+ | only `from` | `to` = today |
20
+ | only `to` | `from` = Jan 1 of that year |
21
+ | no range | current quarter |
22
+
23
+ Parse half-years, calendar quarters, month ranges, and rolling periods. A spoken
24
+ period without a year means the current year, except months still ahead of today,
25
+ which mean the previous year. Query through `<to + 1 day>` because Git's `--until` is exclusive.
26
+ Always exclude merge commits.
27
+
28
+ Use an explicit author when supplied; otherwise resolve it independently per repository
29
+ with `git -C <root> config user.name`. Never infer aliases or use the remote login as
30
+ the author. Filter commits by comparing `%an` literally, not via an `--author` regex. If no commits match, report that and suggest listing known commit authors;
31
+ do not try spelling or language variants. When results exist, mention once that the
32
+ user can provide other author names if needed.
33
+
34
+ ## Project evidence
35
+
36
+ Read optional `workProjects` from `~/.agent-tools/config.jsonc`.
37
+
38
+ - No project named: current Git repository plus configured projects.
39
+ - Projects named directly: only those projects.
40
+ - "Also include" / `另外包含`: add them to the default scope.
41
+
42
+ Resolve paths to Git roots and deduplicate them. Report invalid paths; a non-Git current
43
+ directory does not block other valid projects. Do not clone remote URLs without consent.
44
+
45
+ Inspect all local branches, current HEAD, user-named branches, and configured upstreams.
46
+ Unless the user requests local-only data, refresh only the configured upstream
47
+ branches, grouped into one best-effort `git fetch --no-tags <remote> <branch...>` per
48
+ involved remote. Fetch failure is non-fatal. Do not change the working tree or local
49
+ branch history. Deduplicate commits by hash.
50
+
51
+ Begin the result with the resolved author/window and, for multiple repositories, a
52
+ plain-language list of the repositories checked. Mention remote-update failures without
53
+ Git jargon. Do not show commit counts or a generic source line.
54
+
55
+ ## Optional logs
56
+
57
+ A pasted daily/weekly log or explicit file path provides business context. If neither is
58
+ supplied, optionally read `dailyLog.output` from config. Explicit conversation input
59
+ always wins; a missing log is non-fatal.
60
+
61
+ Commit-backed items may be summarized directly. Keep log-only work separate for user
62
+ confirmation; include it only after confirmation, using only dates stated in the log or
63
+ by the user. Never turn undated log text into work inside the selected window.
64
+
65
+ When the user asks for a summary from a log alone, skip project scanning; when the
66
+ window has no Git evidence, fall back to the log. Either way the log becomes the
67
+ primary source: say so in the result and skip per-item confirmation, as the whole
68
+ draft is the user's own account.
69
+
70
+ If the user supplies a remote repository URL, ask before cloning it to a temporary
71
+ directory and remove it afterward unless asked to keep it. Confirm before scanning every
72
+ remote branch.
73
+
74
+ ## Group the work
75
+
76
+ Group related commits into business-line or module outcomes. Fold lint, formatting,
77
+ version bumps, repeated syncs, and follow-up fixes into the outcome they supported.
78
+ Drop isolated trivial housekeeping. Similar subjects alone are not duplicates; use the
79
+ repository, changed paths, and intent, and surface uncertain attribution for review.
80
+
81
+ ## Write the summary
82
+
83
+ Output a numbered list with no more than 8 top-level outcomes. Each item starts with the
84
+ business line/module and states a concrete result with 2-4 key points or one concise
85
+ sentence. Prefer high-impact delivery, architecture, and key fixes; condense or omit
86
+ routine work. Do not distribute the quota evenly if that hides standout results.
87
+
88
+ Mention a concentrated month only when it adds useful distribution context, never as a
89
+ productivity score. Match the user's language. Every confirmed outcome must trace to a
90
+ commit or a user-confirmed log item.
91
+
92
+ ```text
93
+ > 作者: <author> · 窗口: 2026-01-01 ~ 2026-06-30 · (自动推断, 如不对请指正)
94
+ > 项目: <repo1> · <repo2>
95
+
96
+ 1. <业务线A>: <结果>; <关键点>
97
+ 2. <业务线B>: <结果>
98
+ ```
99
+
100
+ End with one reminder that this is a draft requiring review. Do not write it to a file
101
+ unless asked. Add at most one extra hint, and only when evidence is likely incomplete:
102
+
103
+ - unconfirmed log-only work exists;
104
+ - terse commits lack business context and no log was available;
105
+ - the conversation or log provides concrete evidence of unscanned projects/branches.