Skip to content

自我报告 JSON 生成 #61

Description

@MatthewYe

Parent

#60 — 插件安装自检命令 /toolbox-lint

What to build

在插件的 config hook 中写入自我报告 JSON 文件 .opencode/.toolbox-lint-report.json,记录插件实际注入的所有配置。

文件在每次 OpenCode 启动时覆盖写入,包含以下字段:

{
"version": "1.0.0",
"generated_at": "<ISO timestamp>",
"agents": {
"implementer": { "prompt_includes_principles": true },
"reviewer": { "prompt_includes_principles": true },
"argus": { "prompt_includes_principles": true }
},
"commands": {
"autopilot": {},
"audit-autopilot": {},
"git-guardrails": {},
"skill-creator": {},
"teach": {}
},
"upstream_skill_commands": ["caveman", "diagnose", ...],
"skill_paths": ["<abs>/skills", "<abs>/upstream/skills/engineering", "<abs>/upstream/skills/productivity"],
"principles_injected": true,
"instructions_injected": true
}
  • agents 记录所有已注册 agent,并标注其 prompt 是否包含 Karpathy principles
  • commands 记录所有本地命令
  • upstream_skill_commands 记录从上游 SKILL.md 生成的命令
  • skill_paths 记录已注册的 skill 目录绝对路径
  • principles_injected / instructions_injected 标记 principles 注入状态

Acceptance criteria

  • 插件 config hook 在完成注入后,将自我报告写入 .opencode/.toolbox-lint-report.json
  • 每次启动覆盖写入(不追加)
  • JSON schema 包含所有上述字段
  • agents 字段中的每个 agent 正确标注 prompt_includes_principles(implementer/reviewer/argus 为 true,其他如 general 不出现或为 false)
  • commands 字段包含所有 commands/*.md 中的命令
  • upstream_skill_commands 字段包含所有从 upstream/skills/ 子目录 SKILL.md 生成的命令
  • skill_paths 包含三个路径:本地 skills、upstream engineering、upstream productivity
  • 文件写入失败不阻塞插件加载(静默失败,仅 /toolbox-lint 会报告文件缺失)

Blocked by

None — can start immediately

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    resolvedAutopilot has resolved this issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions