@kairyou/agent-tools 0.10.1 → 0.10.2

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
 
@@ -218,6 +218,10 @@ To diagnose the provider setup or test recognition quality manually:
218
218
  npx -y @kairyou/agent-tools@latest inspect-image <path|url> -q "What are the navbar background color and height?"
219
219
  ```
220
220
 
221
+ ## Extras
222
+
223
+ See [extras](docs/en/extras.md) for situational content.
224
+
221
225
  ## Run from Git
222
226
 
223
227
  To run directly from the repository, replace the npm package name with
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
 
@@ -173,7 +173,7 @@ balance $362 | today $61.7 | 30d $566
173
173
 
174
174
  ### Vision(跨模型识图)
175
175
 
176
- 让不支持图片的主模型借助多模态模型识图, 适用于读取报错截图、按设计稿还原 UI、定位测试反馈截图里的界面问题.
176
+ 让不支持图片的主模型借助多模态模型识图, 适用于读取报错截图, 按设计稿还原 UI, 定位测试反馈截图里的界面问题.
177
177
 
178
178
  #### 安装
179
179
 
@@ -213,6 +213,10 @@ npx -y @kairyou/agent-tools@latest vision -a claude codex opencode
213
213
  npx -y @kairyou/agent-tools@latest inspect-image <path|url> -q "导航栏的背景色和高度是多少"
214
214
  ```
215
215
 
216
+ ## Extras
217
+
218
+ [extras](docs/zh-CN/extras.md) 收录场景较窄的内容.
219
+
216
220
  ## 从 Git 运行
217
221
 
218
222
  如需直接使用仓库版本, 可将 npm 包名替换为 `github:kairyou/agent-tools` (本机需已安装 Git):
@@ -0,0 +1,24 @@
1
+ # Extras
2
+
3
+ Fully usable, just situational. Install each on demand.
4
+
5
+ ## at-self-eval
6
+
7
+ Summarize a contributor's git history into a review-friendly self-evaluation for
8
+ 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` — current git identity, current 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
+ - Paste a daily/weekly log, or give a file path, to add business context (optional)
20
+ - Mention other repositories or branches to aggregate across projects; a remote
21
+ URL prompts before cloning anything
22
+
23
+ Output is a draft: it never invents deliverables, and every line traces back to a
24
+ commit or to a log entry you confirmed. Review it before submitting.
@@ -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,21 @@
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
+ - 可粘贴日报/周报文本或提供文件路径, 补充业务背景(可选)
19
+ - 可提及其他仓库或分支以跨项目聚合; 远程地址会先询问是否 clone 到临时目录
20
+
21
+ 输出是草稿: 不编造产出, 每条都能追溯到 commit 或你确认过的日志条目. 提交前请人工核对.
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.10.2",
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,186 @@
1
+ ---
2
+ name: at-self-eval
3
+ description: "Summarize a contributor's git history into a concise, review-friendly self-evaluation for performance cycles (quarterly / semi-annual / promotion). Use when the user asks for a PBC, self-review, or work summary. A daily/weekly log may be pasted or a path provided to enrich the result; other repos or branches may be mentioned to aggregate across projects (all optional)."
4
+ argument-hint: "[<author>] [--from yyyy-mm-dd] [--to yyyy-mm-dd]"
5
+ ---
6
+
7
+ # Self-Evaluation Summary
8
+
9
+ `git log → group by business line → dedupe → ≤8 concise output points → human review`
10
+
11
+ ## Phase 0 — Gather the evidence
12
+
13
+ Normalize every input form — flags, partial flags, or plain language like
14
+ `统计 1-3月的产出` / `统计上半年的工作` — into a **determined** `(author, from,
15
+ to)` triple, then query. The user's explicit date range always wins; defaults
16
+ only fill what the user did not say. Re-state the resolved window in the output
17
+ header so the user can catch a wrong inference at a glance.
18
+
19
+ ```bash
20
+ # author — default to the current git identity, do NOT guess variants
21
+ AUTHOR=$(git config user.name)
22
+ # --until is EXCLUSIVE of its date, so push it +1 day to include the last day
23
+ git log --author="$AUTHOR" --since="<from>" --until="<to + 1 day>" --no-merges --format="%ad %s" --date=short
24
+ ```
25
+
26
+ **Author — do not guess:**
27
+
28
+ 1. Default `<author>` to `git config user.name`. Query only with that name; do
29
+ not infer or try variants. Note that `git log --author` uses regex matching,
30
+ so this rule limits identity guessing rather than promising strict equality.
31
+ 2. If 0 commits come back, do NOT auto-try pinyin/Chinese variants (risk of
32
+ mismatching a different person or inflating counts). Tell the user nothing
33
+ was found and show how to self-identify:
34
+ ```bash
35
+ git log --format='%an' | sort -u
36
+ ```
37
+ 3. If results come back, end the output with a one-line hint: the user may have
38
+ commits under other names and can rerun with `--author "name1\|name2"`.
39
+
40
+ **Date range — `--until` is exclusive, `--since` is inclusive:**
41
+
42
+ `git log --until=2026-06-30` means *before 2026-06-30 00:00:00* — it silently
43
+ drops every commit on June 30. Always pass `<to + 1 day>` as `--until`.
44
+
45
+ Fill missing dimensions (user's explicit range always wins):
46
+
47
+ | User gave | resolved to |
48
+ | --- | --- |
49
+ | Both `--from` and `--to` | use as-is (apply the `--until +1 day` fix) |
50
+ | Only `--from` | `to` = today |
51
+ | Only `--to` | `from` = Jan 1 of `to`'s year |
52
+ | Neither / plain-language time | **current quarter** |
53
+
54
+ Plain-language time (`上半年` / `1-3月` / `近三个月` / `Q1` etc.) → parse to dates,
55
+ defaulting to the current year; if the current month is earlier than the spoken
56
+ months (e.g. it's Feb and the user says `统计 11-12 月`), use the previous
57
+ calendar year. `上半年/下半年` → Jan–Jun / Jul–Dec; `Q1…/一季度…` → calendar
58
+ quarter; `近三个月/最近一个月` → rolling window ending today. No time given →
59
+ current quarter.
60
+
61
+ `--no-merges` always — merge commits are not deliverables.
62
+
63
+ **Re-state the window (required):** the output MUST begin with a one-line header
64
+ so the user can verify or correct an auto-inferred window:
65
+
66
+ ```
67
+ > 作者: <author> · 窗口: 2026-01-01 ~ 2026-03-31 · (时间窗口为自动推断, 如不对请指正后重跑)
68
+ ```
69
+
70
+ When aggregating multiple repos, append a second line listing each repo and the
71
+ branch used. Use plain words, never git jargon like "HEAD":
72
+
73
+ ```
74
+ > 仓库: <repo1> (分支 next) · <repo2> (分支 main) · (未指定的均用各仓库当前分支, 如不对请指正)
75
+ ```
76
+
77
+ No commit count, no "source" line — they add noise without review value.
78
+
79
+ ### Supplementary context (optional, conversation-driven)
80
+
81
+ Daily/weekly logs, other repos, and other branches are all **optional
82
+ supplementary context**, handled the same way — never via flags. The user offers
83
+ them in conversation; the skill asks to clarify only when the user has already
84
+ expressed intent. Do not prompt for these at the start.
85
+
86
+ **Daily/weekly log** (pasted text or a provided file path) is background context:
87
+ 1. Format-agnostic — do not assume any date sectioning or schema; read as
88
+ continuous text to pick up business-line attribution and intent that commit
89
+ messages lack.
90
+ 2. No fabrication — commit-backed items may be summarized directly. Log-only
91
+ items must not be mixed into confirmed deliverables; if one appears to be a
92
+ real non-code outcome (design, research, review, training, delivery support,
93
+ coordination), list it separately for user confirmation. Include it in the
94
+ final summary only after the user confirms it.
95
+ 3. No time re-attribution — dates come from git log only; for a confirmed
96
+ log-only outcome, use only a date explicitly present in the log or provided
97
+ by the user.
98
+
99
+ **Other repos** (user pastes a path or a remote URL):
100
+ - **Local path** → query with `git -C <path> log ...`; resolve that repo's author
101
+ independently (same no-guessing rule as the primary repo). Default to that
102
+ repo's current branch, surfaced in the header for correction.
103
+ - **Remote URL** → do NOT auto-clone. Ask the user whether to clone into a temp
104
+ dir for this run; only clone on explicit yes. On yes, clone to a temp dir,
105
+ query it, then delete the temp dir when done (keep it only if the user asks).
106
+ On no, ask for a local path or have them clone it themselves. Never clone
107
+ silently — clone has side effects (disk, auth, slow, may fail).
108
+ - Path does not exist / not a git repo → ask, do not guess.
109
+
110
+ **Other branches** (user names them, e.g. "也包含 dev 分支"):
111
+ - Query those branches explicitly. Never run `git log --all` unprompted — on
112
+ large repos it pulls tens of thousands of commits and overruns context.
113
+ - Confirm scope with the user before scanning all branches.
114
+
115
+ **Dedup across repos/branches:** identical commit hashes count once. Do not
116
+ mechanically delete commits by date/subject — separate work can share a generic
117
+ message, while cherry-picked work can have different dates. During grouping,
118
+ merge likely duplicates only when repository, subject, files, and change intent
119
+ show they represent the same work; surface uncertain cases for user confirmation.
120
+
121
+ ### Language for user-facing text
122
+
123
+ All output and prompts to the user use plain words. Avoid git jargon ("HEAD",
124
+ "ref", "upstream", "cherry-pick") — users who say "I also worked on the dev
125
+ branch" may not know what HEAD means. Keep "commit" and branch names (with
126
+ context) as those are widely understood.
127
+
128
+ ## Phase 1 — Group and dedupe
129
+
130
+ Group commits into **business lines / modules** and merge related commits into
131
+ one deliverable. Collapse many commits into the 1–3 outcomes they achieved —
132
+ `fix: lint`, `chore: fmt`, repeated `feat: sync` fold into the larger deliverable
133
+ they supported. If a group has only trivial housekeeping, merge it into a
134
+ related group or drop it. Do not inflate a single commit into a "deliverable."
135
+
136
+ ## Phase 2 — Write the summary
137
+
138
+ Output a **numbered list**, one deliverable per line, grouped by business line.
139
+ Each line:
140
+
141
+ - starts with the business line / module, a colon, then 2–4 sub-points or a
142
+ one-sentence outcome;
143
+ - is verb-led and outcome-oriented (built / shipped / refactored / migrated),
144
+ not a feature-name dump;
145
+ - is concrete enough to be credible but concise enough to scan.
146
+
147
+ - **≤8 top-level items — prioritize impact.** When work exceeds 8 lines, keep
148
+ the high-impact deliverables (built from scratch, major customer delivery,
149
+ architectural refactor, key fix) and merge or drop routine housekeeping
150
+ (lint, format, version bumps, repeated sync). Do not split 8 evenly across
151
+ business lines if that dilutes the standout work.
152
+ - A volume/peak note is worth citing inline **only when a business line clearly
153
+ concentrated in one month** (e.g. "5月密集完成 <业务线>"), as a distribution
154
+ cue — not as a self-justifying metric.
155
+ - Match the user's language (Chinese request → Chinese output). Identifiers and
156
+ product names stay as-is.
157
+ - Do NOT fabricate. Every confirmed deliverable must trace back to a commit or
158
+ to a user-confirmed log entry. Surface uncertain or log-only outcomes as
159
+ candidates for confirmation rather than stating it as fact.
160
+
161
+ Example shape (header + numbered list, placeholders only):
162
+
163
+ ```
164
+ > 作者: <author> · 窗口: 2026-01-01 ~ 2026-06-30 · (时间窗口为自动推断, 如不对请指正后重跑)
165
+
166
+ 1. <业务线A>: <动词开头的产出>; <2–4 个关键点或一句成果>
167
+ 2. <业务线B>: ...
168
+ ```
169
+
170
+ End with a one-line reminder: this is a draft — verify before submitting, since
171
+ AI may merge or misattribute work. Do not write the summary to any file unless
172
+ the user asks.
173
+
174
+ **Conditional hints — only when this run likely under-represents the work.**
175
+ Do NOT prompt every time; a clean, complete result ends with just the draft
176
+ reminder above. Append ONE short line only in these cases:
177
+
178
+ - A log-only item looks like real work but lacks user confirmation → "日志中还有未对应到 commit 的工作; 如属有效产出, 确认后可纳入总结."
179
+ - No daily/weekly log was given AND commit messages are terse / hard to
180
+ attribute → "本次仅基于 commit 归纳; 若有日报/周报可粘贴文本或提供路径, 能补充业务背景使产出更准."
181
+ - There is concrete evidence that other repos/branches may contain relevant
182
+ work (the user mentioned them, or the supplied log names work absent from the
183
+ scanned repo) → "可能还有其他仓库或分支的工作未覆盖; 告知路径/分支后可继续聚合统计."
184
+
185
+ One line, never a follow-up question. Accept pasted text or a path equally —
186
+ log formats vary widely, never assume a schema.