WorkBuddy Skill Factory
Create a native WorkBuddy Skill through sources, purpose, review,
tests, and publish, in that order. 不得跳过 stages or present a Skill as
ready for import until the preceding stage is complete. Persist the workflow in
factory-state.json: it records each stage's current_question and answers.
On every begin, resume, status check, or advance, validate the state and every
locked artifact; a changed locked artifact blocks continuation.
Commands
所有命令必须调用 scripts.orchestrator.SkillFactory(当前授权工作目录).command(...);
不得直接调用底层装配函数,也不得接受用户提供的输出目录、GateDecision 或发布证据对象。
开始打包→command("start"):创建或恢复状态,返回当前阶段。添加资料→command("add-source", source=...):只在 sources 阶段登记一份资料;可重复调用。定义用途→command("define-purpose", purpose=...):锁定资料台账与用途,进入审核。审核知识→command("review", sections=..., reviewer=..., reviewed_at=..., sensitive_clearance_approver=...):从工作区知识文件生成与锁定逐单元审批。运行测试→command("test", cases=..., template_path=...):每个 case 只提交实际模型回答、预期行为(回答或拒绝)及所需证据,不接受 passed 字段;在测试前选定模板,执行 20 项规定配额的语义验收,内部绑定资料、知识、审批、结构化冲突解决记录与模板,计算指标及质量门,失败时不得推进。生成技能包→command("publish", skill_name=..., target_audience=...):只从测试时锁定的工作区证据生成当前授权工作目录/packages/下的可上传版本。
查看状态不构成第七个变更命令:读取 factory-state.json 和锁定清单后,用自然语言
报告当前阶段、缺失输入及下一条允许执行的上述命令,不写入任何文件。
Stage 1: sources
Ask one source question at a time: path, owner, authorization basis, effective
date, then confidentiality. Record the source ledger and lock
sources/index.json before continuing. Stop and ask for clarification when a
required input is absent. Follow
the sources workflow.
Stage 2: purpose
Define one bounded Skill purpose. Ask one question at a time for its purpose,
trigger conditions, outputs, non-goals, and resource needs. Lock purpose.md
before continuing. Follow
the purpose workflow.
Stage 3: review
Create and review a source ledger before using knowledge. Every source must
record its owner, authorization basis, effective date, and
confidentiality. Review each source for correctness, provenance, sensitive
data, and contradictions. Block unsupported, conflicting, or outdated
knowledge from the generated Skill; do not resolve it by inference. Require
human confirmation before publishing any rules, prohibitions, or escalations.
Keep long material in references/ and keep only operational instructions in
SKILL.md. Do not copy unreviewed claims into the Skill. Generate and lock the
plain-language conflict, gap, rule, prohibition, and approval records before
continuing. Follow the review workflow.
Stage 4: tests
Run pytest tests/test_skill_structure.py -v. Confirm the entrypoint has the
required frontmatter and Markdown body, its commands retain the five-stage
route, and no unsupported packaged resource root exists. Before publishing,
generate and pass at least 20 generated acceptance test cases. The generated
acceptance suite must meet at least 90% factual accuracy, at least 95% citation
coverage, 100% sensitive/unauthorized refusal, and zero unsupported
hallucinations. Block publication when any threshold is not met. Return to the
owning earlier stage when validation fails. Lock tests/acceptance-report.md
before continuing. Follow the tests workflow.
Stage 5: publish
Create SKILL.md with YAML name and description frontmatter followed by
Markdown instructions. Add only these optional resource roots when needed:
scripts/ for executable code, references/ for on-demand documents, and
assets/ for output files. Keep the definition concise and use directive
language. Prepare the validated local Skill package source. Direct the user to
WorkBuddy's Skills UI to choose 上传技能 and select the local Skill package;
WorkBuddy automatically completes configuration after import. Do not claim a
required archive format, API call, or automatic publication: the official upload
guidance does not specify those details. Follow
the publish workflow.
WorkBuddy operating constraints
Treat the selected working directory as the file read/write boundary. Work in
the current task's independent workspace. Under default permission, request
user confirmation for sensitive actions such as file modifications or work
outside the workspace. Use full access only when the user has explicitly
enabled it for a trusted task.
Read the official WorkBuddy contract
when deciding how to structure, import, or operate the Skill.