SuperAPI AI 工具集

create-artifact

智能体与模型

查看项目

更新于 10-15 22:40

技能介绍

用途:把交付物(文档、报告)通过配置的内容提供方注册,供下游智能体或 worktree 隔离环境按逻辑 ID 读取,避免在完成消息中重复整篇文档。

主要能力:提供 mcp__plugin_dh_backlog__artifact_register 注册接口,以及脚本场景下的 artifact register CLI 子命令;artifact_read(item_id, artifact_type) 通过同一存储边界读取当前产物。注册返回 dict,含 registered、artifact_count、action(added 或 updated)、content_stored、messages、warnings。

使用方式:MCP 调用需传 item_id、artifact_type、artifact_id、content(非空完整 markdown),status 默认 current,agent 默认空字符串。CLI 等价形式为 <sam_cli/> artifact register --item-id <identifier> --artifact-type <str> --artifact-id <str> --status "current" --agent <str> --content <str>。使用前需先加载 dh:dh-cli-usage。artifact_id 建议用稳定逻辑标识,如 feature-context-{slug}、architect-{slug}、codebase-patterns-{slug}、T0-baseline-{slug}、TN-verification-{slug}。

适用场景:feature-context、codebase-analysis(每个关注点一次调用)、architect、research 等类型产物注册。task-plan 是 ArtifactType 成员但注册表无对应行,须用 sam_plan 创建和读取,不能经 artifact_register 或 artifact_read。

限制:artifact_type 的合法字符串、允许注册的智能体及门禁读取关系由 dh_core/artifact_registry.py 定义,命名未声明的 (type, agent) 组合会导致测试失败;智能体不选择也不访问存储层。STATUS: DONE 报告只写 ARTIFACT 行,不粘贴完整内容。