Skip to content
Back to skills

Workflows

ASecurity

根据精确证据生成托管 Skill 候选,审核批准后将指定版本导出给 Codex。

  • 2,038 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 21, 2026
ai-agentsbashbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add oceanbase/powercontext --skill workflows --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Workflows?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Workflows
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oceanbase-workflows-powercontext/badge)](https://www.skillsdirectory.com/skills/oceanbase-workflows-powercontext)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
title: 创建与导出 Skill
description: 根据精确证据生成托管 Skill 候选,审核批准后将指定版本导出给 Codex。
---

# 创建与导出 Skill

当经过审核的证据能够支撑可复用 instructions 和 validation checks 时,可以生成 managed Skill。批准会创建不可变的
Skill Revision;另一次显式导出才会让 Codex 使用某个精确 Revision。

## 开始之前

配置 generation model 并启动 Server,然后确认 managed Skill generation 已启用:

```bash
export POWERCONTEXT_SERVER_INFERENCE_GENERATION_MODEL=provider:model-name
powercontext server run
```

在另一个终端中运行:

```bash
powercontext capabilities
```

输出应包含 `Managed Skill generation: enabled`。将 `POWERCONTEXT_SCOPE_ID` 设置为 `create_scope` 返回的已有
ID,然后选择一种 provenance origin:

| Origin | 适用情况 |
| --- | --- |
| `experience` | 一个或多个 approved Experience Revision 能够支撑新 Skill |
| `source` | 精确的官方或人工 Source 能够直接支撑新 Skill |
| `usage` | Usage Source 能够支撑对某个精确现有 Skill Revision 的更新 |

## 1. 生成 Candidate

根据 approved Experience 生成:

```bash
powercontext skill generate \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --origin experience \
  --artifact-ref experience/EXPERIENCE_ID@REVISION \
  --reason "把经过审核的经验转为可复用指令。"
```

也可以直接根据精确 Source 生成:

```bash
powercontext skill generate \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --origin source \
  --source-ref content/SOURCE_ID \
  --reason "根据已批准的操作规程创建 Skill。"
```

响应可为 `pending`、`no_op` 或 `approved`。在 Scope 开启自动审批时,由已批准 Experience 生成的新 Skill 可以直接进入导出步骤。

## 2. 检查并批准 Candidate

检查返回的 Candidate:

```bash
powercontext candidate show --scope-id "$POWERCONTEXT_SCOPE_ID" CANDIDATE_ID
```

检查名称、用于发现的描述、完整 instructions、validation checks 和精确 lineage。然后批准你检查过的 version:

```bash
powercontext candidate approve \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --expected-version 1 \
  CANDIDATE_ID
```

响应应包含 `status: approved` 和精确的 Skill `result_artifact`。批准不会安装 Skill,也不会授予执行权限。需要修订或
拒绝 proposal 时,按照[审核 Candidate](review-candidates.md) 操作。

## 3. 读取精确 Skill Revision

使用 `result_artifact` 中的 Artifact ID 和 Revision:

```bash
powercontext skill show \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --revision 1 \
  SKILL_ID
```

响应包含 approved content 及其精确 Source、Artifact lineage。Managed Skill 不会进入 `PreparedContext`,只能通过
exact read 和显式导出使用。

## 4. 将 Revision 导出给 Codex

导出给 Codex 时,Skill name 最多包含 64 个小写字母、数字和单连字符;description 最多包含 1,024 个字符,并且不能有
尖括号。目标目录名必须与 Skill `name` 一致。导出为代码库级 Codex Skill:

```bash
powercontext skill export \
  --target codex \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --revision 1 \
  --destination .agents/skills/backend-validation \
  SKILL_ID
```

该命令创建一个新目录:

```text
.agents/skills/backend-validation/
└── SKILL.md
```

如果 Revision 包含标准包中的 `scripts/`、`references/` 等文件,它们也会按包内路径导出;不要依赖额外的
`powercontext.json` sidecar。请保存命令输出中的精确 Artifact ID 和 Revision,并在需要审计时重新执行 `skill show`
核对 package digest。目标目录已存在时,命令会拒绝覆盖。Managed Skill Revision 始终是内容权威,目录只是 host-local
projection。

Codex 会自动检测导出的代码库级 Skill。如果没有出现,再重启 Codex。

## 根据 usage 演进 Skill

使用 `usage` origin,并提供精确 current Skill Revision 和记录实际使用结果的 Source:

```bash
powercontext skill generate \
  --scope-id "$POWERCONTEXT_SCOPE_ID" \
  --origin usage \
  --target skill/SKILL_ID@REVISION \
  --source-ref content/USAGE_SOURCE_ID \
  --reason "根据实际使用结果更新验证步骤。"
```

CLI 会自动把 target 加入 Artifact 证据。审核并批准 replacement Candidate 后,才能导出新 Revision。如果导出目录已经
存在,应先明确检查和处理该 projection,再重新导出;命令不会覆盖已有目录。

外部 Agent-native Skill 的发现和导入契约见[接口](../develop/interfaces.md)。

Files in this skill

  • architecture.md7.2 KB
  • artifacts.md3.3 KB
  • codex-workflow.md14.7 KB
  • configure-agent-skill-targets.md2.6 KB
  • configure-vector-search.md2.1 KB
  • create-and-export-skill.md4.6 KB
  • create-and-review-experience.md4.3 KB
  • experience-and-skill-lifecycle.md3.4 KB
  • handoff-with-codex.md4.3 KB
  • index.md3.2 KB
  • ingest-text-files-with-opendal.md5.3 KB
  • manage-artifact-tags.md7.4 KB
  • manage-prompts.md4.4 KB
  • memory-and-context.md2.9 KB
  • memory-and-handoff.md1.8 KB
  • meta.json888 B
  • prepare-context-text.md10.3 KB
  • review-candidates.md9.4 KB
  • scopes-and-access.md2.2 KB
  • sources.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.