Manage Skills
Manage skills as effect-bound releases: package correctness is necessary, but a production claim
is proven only when a realistic first-use task leaves inspectable artifacts. Use the official
skill-creator for package creation and official validation. Keep editable candidates,
evaluations, history, and feedback in an external SkillFactory; keep the global skills directory as
a deployment target.
Classify the lifecycle action
Choose one primary mode and add only required secondary modes:
- Create: decide whether the need should be a skill, capture its contract, and build a candidate.
- Audit: inspect quality without changing the target.
- Test: execute structural, script, behavioral, negative-trigger, and regression cases.
- Optimize: fix a reproduced behavioral failure with the smallest coherent patch.
- Refactor: reorganize a skill while preserving its observable contract.
- Release: version, promote, verify, or roll back a tested candidate.
- Observe: record version-linked feedback and convert confirmed failures into regressions.
- Orchestrate: select, order, and coordinate multiple skills for one outcome.
State the mode and target. Treat review, diagnose, and audit requests as read-only. Treat create, fix, optimize, and refactor as edit authority only for the named candidate. Treat install, update, promote, rollback, publish, and release as separate external-state actions requiring explicit user authorization.
Establish sources of truth
- Read the applicable official
skill-creator/SKILL.mdcompletely before creation or structural change. Follow its initializer, metadata, and validator requirements. - Inspect the target, its directly linked resources, installed version, registry record, and latest evidence before proposing edits.
- Inventory applicable Codex-native capabilities before accepting any external credential, connector, provider, or companion as required. Treat dependency necessity as a claim that needs evidence, not as a fact merely because the candidate declared it.
- Preserve unrelated changes. Never use a static score as permission to rewrite a skill.
- Use
MANAGE_SKILLS_FACTORY_ROOTwhen configured; otherwise use~/Documents/Codex/SkillFactory. Never store managed packages or lifecycle data inside this installed skill.
Initialize or inspect the factory with:
bashpython scripts/skill_factory.py --root /path/to/SkillFactory init python scripts/skill_factory.py --root /path/to/SkillFactory status
Execute the selected mode
Create
Read creation-protocol.md. Decide whether the request belongs in
a prompt, skill, workflow, automation, plugin, or agent. Before defining the contract, read
prior-art-protocol.md, search local and available open-source
prior art within its bounds, and recommend Reuse, Wrap, Compose, or Build. Do not create a
duplicate candidate when reuse already meets the need. Codex recommends the route; use
awaiting-user when product direction, dependency, license, cost, permission, credential, or
distribution choices materially change. If online search is unavailable, disclose the limitation
and do not invent results.
Capture concrete positive, boundary, and negative examples plus inputs, outputs, constraints, side effects, completion conditions, and failure policy. If later runs can reuse an IP, account, provider, template, project, factory, profile, or preset, classify the Skill as stateful and capture its zero-state entry, persistent state owner, single active context, version policy, upgrade behavior, and fallback policy. Ask only about unresolved choices that materially change the result.
Use the official initializer under SkillFactory/candidates; generate matching
agents/openai.yaml, required resources, and an evaluation suite. Do not install the candidate.
Audit
Run the deterministic audit, then apply quality-rubric.md. When the Skill may be copied, downloaded, or installed by another person, also read portability-protocol.md and audit its first-use contract:
bashpython scripts/audit_skill.py /path/to/skill --format markdown --strict python scripts/audit_portability.py /path/to/skill --format markdown --strict
Report findings by severity with file locations. Separate structure readiness, portability classification, executed evidence, and untested claims. Do not equate a 100-point structural result with “解压即用”.
For every unzip-and-use claim, require a declared standalone or Codex-native useful minimum path.
Reject a package that makes third-party credentials mandatory when an applicable Codex capability
can produce the minimum output. Optional external providers may improve quality or scale, but they
must remain a disclosed enhancement layer.
When the Skill is stateful, also read stateful-skill-protocol.md. Verify that a zero-state user can start, only one context is active per operation, user state is external and versioned, upgrades preserve it, execution records its secret-free context, and fallback is never silent.
Test
Read testing-protocol.md and
effect-evidence.md. For a distributable Skill also read
portability-protocol.md. Run official validation, changed
script tests, and the applicable normal, edge, stress, failure, negative, permission, portability,
and regression cases. For a skill that creates or changes an artifact, include a principal
first-use case that starts from a clean workspace, exercises preflight, initialization, and the
public workflow, preserves the result, and reaches at least end_to_end evidence.
For a stateful Skill, run the continuous state sequence in stateful-skill-protocol.md: zero state, reuse, import without implicit switch, explicit switch, new version, rollback, package upgrade, and state preservation. Isolated happy-path fixtures are insufficient.
bashpython scripts/skill_factory.py --root /path/to/SkillFactory evaluation-run skill-name \ --run-id 2026-08-08-regression python scripts/run_evals.py /path/to/skill --suite /path/to/test-prompts.json \ --factory-root /path/to/SkillFactory --run-id 2026-08-08-regression --require-all
Store mutable results and raw artifacts only under
evaluations/runs/<run-id>/<skill-name>/. Use independent-results.json, report.json, and
artifacts/ inside that directory; do not scatter temporary JSON or forward-test folders directly
under evaluations/. run_evals.py automatically discovers independent-results.json in the run
directory when --results is omitted. Keep explicit --results and --out only for compatibility
or deliberate external paths.
Use --allow-commands only after execution of declared command cases is authorized. Missing clean
context, tools, or credentials produce unexecuted, never passed.
Report four separate evidence levels instead of collapsing them into one score:
structural: package and declared contract are valid;executable: a deterministic component ran successfully;end_to_end: a realistic public workflow produced preserved artifacts;accepted: a user or independent reviewer accepted identified artifacts.
Do not treat configuration inspection, an existing example project, keyword presence, or a dry run as end-to-end proof.
For a one-folder distribution claim, require portability.json, run the portability audit against
both the candidate folder and its ZIP, and cover portable-first-use in the principal evaluation.
For unzip-and-use, also require codex-only-minimum-path: execute the public minimum task with
declared third-party credentials absent, author state absent, and only declared Codex-native or
standalone capabilities available; preserve the real output. A prompt asking for a key, a dry run,
or a prebuilt fixture is not a passing minimum path. Credentials may remain user-owned for optional
enhancements. Classify genuinely essential live connectors and separate factories honestly.
For a Skill that produces durable user artifacts, also read
runtime-output-protocol.md. Require a workspace outside the
installed Skill and SkillFactory, stable projects, unique dated runs, input/work/output/logs
separation, run.json, latest.json, runs.jsonl, output hashes, and resumable failure records.
Cover runtime-output-contract in the principal evaluation and prove that two runs on the same date
do not overwrite each other.
For stateful Skills, require persistent_state in portability.json, an active_context snapshot
with hashes in each relevant run.json, and coverage of stateful-skill-contract,
zero-state-first-use, single-active-context, and upgrade-preserves-user-state.
Optimize
Read evolution-protocol.md. Reproduce the smallest failure, patch the closest responsible instruction or resource, run the failing case plus normal and counterexamples, and keep the candidate only when evidence improves without material regression.
Refactor
Read refactoring-playbook.md. Capture the contract and public paths, reduce ambiguity or context cost, and re-run preserved cases. Treat changed triggers, outputs, side effects, or tool calls as behavioral changes rather than refactoring.
Release
Read release-protocol.md and, for a distributable package,
portability-protocol.md. Require clean structural and
portability audits plus fully passed, hash-matched evidence. A stateful release additionally needs
the state sequence, upgrade-preservation proof, and non-silent fallback regression. An
unzip-and-use release additionally needs a passed codex-only-minimum-path principal case; a
credential request cannot satisfy it. Stage and
promote only after the user
authorizes global installation:
bashpython scripts/skill_factory.py --root /path/to/SkillFactory stage /path/to/skill python scripts/skill_factory.py --root /path/to/SkillFactory promote skill-name \ --version 1.0.0 --evidence /path/to/report.json --skills-root /path/to/global/skills
Verify the installed package after promotion. Preserve release snapshots and use rollback with a
known version when recovery is required.
Reject legacy or effect-incomplete evidence. For artifact-producing skills, require a passed
principal path, the suite's minimum evidence level, preserved artifacts with hashes, and complete
coverage of declared release capabilities. Acceptance may remain a post-release checkpoint only
when the output contract explicitly allows it; otherwise require accepted evidence.
Keep publicity materials,公众号文章、飞书教程、封面、下载页和传播文案 outside the Skill release gate. They may be produced by another Skill after the executable package is accepted. Release metadata may report the package path, version, hash, portability class, and verified platforms, but must not generate or require a promotional kit.
Observe
Record feedback against the installed version. Remove secrets and unrelated context. Reproduce a reported failure before optimizing and turn confirmed failures into regression cases.
bashpython scripts/skill_factory.py --root /path/to/SkillFactory feedback skill-name \ --rating 2 --message "Output contract drifted" --task "Representative task" \ --correction "Preserve the documented output schema" python scripts/skill_factory.py --root /path/to/SkillFactory feedback-to-regression skill-name \ --feedback-id abc123def456
The regression command creates a reviewable draft; merge it into the candidate suite only after the failure is reproduced and its assertions can be made objective.
Orchestrate
Read orchestration.md. Select the minimum sufficient skill set from metadata, assign one owner per mutable artifact, define validated handoffs, and respect runtime and user limits on delegation or parallel execution.
Completion gates
- Run official validation against every created or structurally changed candidate.
- Run strict structural audit and every changed script's regression tests.
- Bind evaluation evidence and preserved artifact hashes to the exact candidate; invalidate it after any change.
- Require an executed principal first-use path plus edge or failure behavior before release.
- For artifact-producing skills, require end-to-end evidence, preserved non-empty artifacts, and complete declared capability coverage. Never substitute an existing demo or configuration check.
- For distributable skills, require a valid
portability.json, compatible folder and ZIP audits, and a clean first-use principal case coveringportable-first-use. - For
unzip-and-use, require a standalone or Codex-native minimum path, no mandatory third-party credentials for that path, and executed principal evidence coveringcodex-only-minimum-path. - For durable artifact-producing skills, require a valid runtime storage contract and principal
evidence covering
runtime-output-contract. - For stateful skills, require a valid persistent-state contract and executed evidence covering zero state, single activation, context disclosure and snapshot, immutable versions, upgrade preservation, and non-silent fallback.
- Re-audit the globally installed copy and verify its hash after promotion.
- Report structural, portability, stateful, runtime-output, executable, end-to-end, and accepted evidence separately, plus candidate, installed and evidence paths; version; rollback availability; and gaps.
Recovery and stop conditions
- If a failure cannot be reproduced, label it unverified and do not make a broad preventive edit.
- If evidence is mixed, contaminated, stale, dry-run, or incomplete, keep the prior release.
- If two skills claim one mutable artifact, assign one owner or stop for a material ownership choice.
- If a tool or delegation is disallowed, use an available sequential path and report untested claims.
- Stop before purpose, trigger, output-contract, dependency, credential, permission, or side-effect expansion unless the user authorizes it.
- Stop before destructive or external actions not already authorized by the requested lifecycle mode.
- Stop after two coherent revisions produce only stylistic or marginal gains.
Resource map
- creation-protocol.md: capability selection, contract, triggers, package design, and candidate gate.
- prior-art-protocol.md: bounded local and open-source research, evidence comparison, and Reuse, Wrap, Compose, or Build decisions.
- testing-protocol.md: test matrix, execution layers, and evidence.
- effect-evidence.md: evidence levels, first-use cases, artifact manifests, capability coverage, and release gates.
- portability-protocol.md: distribution classes, preflight, bootstrap, ZIP shape, clean first-use proof, and the “解压即用” claim.
- runtime-output-protocol.md: project workspaces, dated runs, manifests, indexes, output hashes, discovery, and resume behavior.
- stateful-skill-protocol.md: zero-state entry, single active context, external versioned user state, context snapshots, upgrade preservation, and fallback.
- release-protocol.md: factory layout, versions, promotion, feedback, and rollback.
- quality-rubric.md: qualitative review and evidence levels.
- evolution-protocol.md: bounded evidence-driven improvement.
- refactoring-playbook.md: behavior-preserving restructuring.
- orchestration.md: selection, ordering, conflicts, and handoffs.
scripts/audit_skill.py: deterministic package audit.scripts/audit_portability.py: deterministic portability contract and ZIP audit.scripts/runtime_runs.py: initialize workspaces and start, complete, or fail unique project runs.scripts/run_evals.py: command and imported-agent evaluation with structured run directories and objective assertions.scripts/skill_factory.py: candidate, evaluation-run, registry, release, feedback, and rollback operations.scripts/test_*.py: disposable-fixture regression suites for all deterministic tooling.test-prompts.json: representative lifecycle and orchestration behavior cases.


