self-improve

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Self-improve skill

Self-improve 技能

Activated by
blazor-architect
when
--self-improve
is set. Runs after all specialist work and the review loop have completed.
当设置
--self-improve
参数时,由
blazor-architect
激活。在所有专项工作和审核循环完成后运行。

Step 1 — Create the run directory

步骤1 — 创建运行目录

Create
~/.self-improve-reports/blazor-architect/runs/<run_id>/
if it does not exist.
Done when: the run directory exists on disk.
如果
~/.self-improve-reports/blazor-architect/runs/<run_id>/
目录不存在,则创建该目录。
完成标志: 运行目录已在磁盘上存在。

Step 2 — Generate the improvement report

步骤2 — 生成改进报告

Consult
references/self-improve-generation.md
for the complete algorithm. The ordered steps:
  1. Collect all
    self_diagnosis.issues
    entries from specialist reports in the run.
  2. Map each to a raw finding (title, summary, category, severity, expected_impact, prompt_fragment, evidence).
  3. Derive
    suggestion_key
    for each finding (
    <category>:<target_surface>:<normalized_intent>
    ).
  4. Load
    ~/.self-improve-reports/blazor-architect/suggestion-history.json
    if present.
  5. Hard-exclude findings with
    never_again
    history entries.
  6. Group by
    suggestion_key
    , fold using merge rules (max severity, evidence union, recurrence count).
  7. Apply
    history_weight
    from most recent decision per key.
  8. Compute
    ranking_score
    (base_severity_weight + recurrence_boost + history_weight).
  9. Sort by severity group, then ranking_score descending, then first_seen ascending.
  10. Assign sequential ids (f-001, f-002, ...).
  11. Build the origin block from current run context.
  12. Write
    improvement-report-data.json
    to the run directory.
The file must conform to
references/improvement-report-data-schema.json
(schema version 1.1). A valid example is at
references/improvement-report-data-example.json
.
Initial file shape:
json
{
  "schema_version": "1.1",
  "generated_at": "<ISO timestamp>",
  "origin": {
    "skill_id": "<active skill id>",
    "skill_scope": "repo | user",
    "skill_path": "<absolute path to skill directory>",
    "repo_root": "<absolute git repository root>",
    "run_id": "<run_id>"
  },
  "findings": [ ... ],
  "decisions": {},
  "shipped_prompt": null
}
decisions
and
shipped_prompt
are always empty/null at generation time — the C# server writes them after user actions.
Done when:
improvement-report-data.json
is written to the run directory with valid findings (or an empty findings array if no self-diagnosis issues were collected).
完整算法请参考
references/self-improve-generation.md
。有序步骤如下:
  1. 收集本次运行中所有专项报告里的
    self_diagnosis.issues
    条目。
  2. 将每个条目映射为原始发现项(包含标题、摘要、分类、严重程度、预期影响、提示片段、证据)。
  3. 为每个发现项生成
    suggestion_key
    (格式为
    <category>:<target_surface>:<normalized_intent>
    )。
  4. 如果存在
    ~/.self-improve-reports/blazor-architect/suggestion-history.json
    文件,则加载该文件。
  5. 硬排除包含
    never_again
    历史记录的发现项。
  6. suggestion_key
    分组,使用合并规则合并(取最高严重程度、合并证据、统计重复次数)。
  7. 应用每个键对应最近决策的
    history_weight
  8. 计算
    ranking_score
    (基础严重程度权重 + 重复次数增益 + 历史权重)。
  9. 先按严重程度分组排序,再按
    ranking_score
    降序排序,最后按首次出现时间升序排序。
  10. 分配连续ID(f-001、f-002……)。
  11. 根据当前运行上下文构建来源块。
  12. improvement-report-data.json
    写入运行目录。
该文件必须符合
references/improvement-report-data-schema.json
(schema版本1.1)。有效示例可查看
references/improvement-report-data-example.json
初始文件结构:
json
{
  "schema_version": "1.1",
  "generated_at": "<ISO timestamp>",
  "origin": {
    "skill_id": "<active skill id>",
    "skill_scope": "repo | user",
    "skill_path": "<absolute path to skill directory>",
    "repo_root": "<absolute git repository root>",
    "run_id": "<run_id>"
  },
  "findings": [ ... ],
  "decisions": {},
  "shipped_prompt": null
}
decisions
shipped_prompt
在生成时始终为空/Null——用户操作后由C#服务器写入内容。
完成标志:
improvement-report-data.json
已写入运行目录,且包含有效发现项(如果未收集到任何自我诊断问题,则为空发现项数组)。

Step 3 — Launch the report-server

步骤3 — 启动报告服务器

The report-server binary lives at
~/.copilot/gman-skills/bin/report-server.exe
(Windows) or
~/.copilot/gman-skills/bin/report-server
(Linux/macOS). Launch it with the report file path:
Windows:
~/.copilot/gman-skills/bin/report-server.exe --report-path ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
Linux / macOS:
~/.copilot/gman-skills/bin/report-server --report-path ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
The server listens on
127.0.0.1:5173
by default. If the port is already bound, assume the server is already running — log a warning and continue (do not launch a second instance).
After launching, open the browser to
http://127.0.0.1:5173
so the user can see the report. Announce the URL clearly:
[blazor-architect] Self-improvement report ready at http://127.0.0.1:5173
  report file: ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
  server PID: <pid>
The server stays alive until
GET /shutdown
is called, an idle timeout elapses after the browser connects, or the terminal session ends. API surface:
GET /api/report
,
GET /ping
,
POST /api/ship-prompt
,
POST /api/dismissals
,
GET /shutdown
.
If the binary is missing, print a warning telling the user to run
/setup-gman-skills
and continue without the server — the report file is still useful on its own.
Done when: the server is running and responding on port 5173, or the binary is missing and a warning has been printed.
报告服务器二进制文件位于
~/.copilot/gman-skills/bin/report-server.exe
(Windows系统)或
~/.copilot/gman-skills/bin/report-server
(Linux/macOS系统)。使用报告文件路径启动服务器:
Windows系统:
~/.copilot/gman-skills/bin/report-server.exe --report-path ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
Linux / macOS系统:
~/.copilot/gman-skills/bin/report-server --report-path ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
服务器默认监听
127.0.0.1:5173
。如果该端口已被占用,则假定服务器已在运行——记录警告并继续(不要启动第二个实例)。
启动后,打开浏览器访问
http://127.0.0.1:5173
,以便用户查看报告。清晰告知URL:
[blazor-architect] 自我改进报告已就绪,访问地址:http://127.0.0.1:5173
  报告文件:~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
  服务器PID:<pid>
服务器会保持运行,直到调用
GET /shutdown
、浏览器连接后触发空闲超时,或终端会话结束。API接口包括:
GET /api/report
GET /ping
POST /api/ship-prompt
POST /api/dismissals
GET /shutdown
如果二进制文件缺失,打印警告告知用户运行
/setup-gman-skills
,然后不启动服务器继续执行——报告文件本身仍有使用价值。
完成标志: 服务器已在5173端口运行并响应,或二进制文件缺失且已打印警告。

Step 4 — Staging readiness (after server session ends)

步骤4 — 暂存就绪检查(服务器会话结束后)

After the server shuts down (user calls
GET /shutdown
, idle timeout, or terminal end), check the report file for staging readiness:
  • Ready when
    decisions
    is non-empty OR
    shipped_prompt
    is non-null.
  • When ready, stage:
    git add ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
If the file is already git-tracked and has local modifications, present the conflict flow (continue / stash / discard) from
references/self-improve-generation.md § Conflict flow
. Default to "Continue" after 30 seconds of no response.
Done when: staging is complete or the file is not ready to stage.
服务器关闭后(用户调用
GET /shutdown
、触发空闲超时,或终端结束),检查报告文件是否具备暂存条件:
  • 就绪条件
    decisions
    非空 或
    shipped_prompt
    非Null。
  • 就绪时,执行暂存:
    git add ~/.self-improve-reports/blazor-architect/runs/<run_id>/improvement-report-data.json
如果文件已被Git追踪且存在本地修改,执行
references/self-improve-generation.md § Conflict flow
中的冲突处理流程(继续/暂存/丢弃)。如果30秒内无响应,默认选择“继续”。
完成标志: 暂存已完成,或文件暂未达到就绪条件。

Suggestion history

建议历史记录

The cross-run suggestion history store lives at
~/.self-improve-reports/blazor-architect/suggestion-history.json
. It records user decisions (
accepted
,
dismissed
,
never_again
) per
suggestion_key
across runs. It is never committed to source control. See
references/suggestion-history-schema.json
for the schema.
跨运行的建议历史记录存储在
~/.self-improve-reports/blazor-architect/suggestion-history.json
。它记录了不同运行中每个
suggestion_key
对应的用户决策(
accepted
dismissed
never_again
)。该文件不会提交到源代码控制。schema详情请查看
references/suggestion-history-schema.json