代码:高级开发与测试工作流 - Openclaw Skills

作者:互联网

2026-03-26

AI教程

什么是 代码 (Code)?

代码技能是为注重代码整洁、可维护和经过验证的 Openclaw Skills 用户设计的复杂工作流管理工具。与基础的代码生成不同,该技能强制执行纪律严明的开发周期:请求、规划、执行、验证和交付。它作为 Openclaw Skills 生态系统中的专业指南,确保在编写任何代码之前,将每个开发任务分解为可管理、可测试的步骤。

安全和用户主权是其设计的核心。该技能仅在用户的项目范围和专用本地目录内运行,避免任何自主网络调用或未经授权的文件访问。通过将此技能集成到您的 Openclaw Skills 配置中,您将获得一个能够记住您特定编码偏好并在每个项目中执行质量保证协议的伙伴。

下载入口:https://github.com/openclaw/skills/tree/main/skills/lion504/code-1-0-4

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install code-1-0-4

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 code-1-0-4。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

代码 (Code) 应用场景

  • 编排需要多步规划和分解的复杂功能实现。
  • 通过使用 Openclaw Skills 记忆系统强制执行风格指南,使团队间的开发实践标准化。
  • 通过在每次增量更改后强制执行验证和测试步骤来减少技术债务。
  • 通过持久化状态跟踪和用户定义的成功标准管理长期运行的开发任务。
代码 (Code) 工作原理
  1. AI 代理检测到用户明确的代码实现请求,并触发 Openclaw Skills 编码工作流。
  2. 它初始化或读取本地 memory.md 文件,以应用用户特定的约束和架构偏好。
  3. 生成并向用户展示结构化计划,将需求分解为独立、可验证的任务。
  4. 经用户批准后,代理分步骤指导实施过程,确保与项目现有结构保持一致。
  5. 实施后,技能会提示进行强制验证,例如运行测试套件或执行 UI 检查。
  6. 只有当所有用户标准和验证步骤都成功满足时,工作流才会以最终交付结束。

代码 (Code) 配置指南

要在 Openclaw Skills 环境中启用代码技能,您需要设置一个用于存储偏好的本地工作区。在终端中运行以下命令:

mkdir -p ~/code
touch ~/code/memory.md

目录创建完成后,您可以将特定的编码标准添加到 memory.md 文件中,以个性化您的 Openclaw Skills 体验。

代码 (Code) 数据架构与分类体系

代码技能维护本地数据架构,以管理 Openclaw Skills 中的状态和偏好。数据组织如下:

  • ~/code/memory.md:存储用户偏好和“禁止”约束的本地存储。
  • planning.md:将请求分解为可测试步骤的参考模式。
  • verification.md:用于确认功能逻辑和 UI 更改的协议。
  • state.md:多任务开发周期的元数据跟踪。
  • criteria.md:存储用户定义的成功指标和交付标准。
name: Code
slug: code
version: 1.0.4
homepage: https://clawic.com/skills/code
description: Coding workflow with planning, implementation, verification, and testing for clean software development.
changelog: Improved description for better discoverability
metadata: {"clawdbot":{"emoji":"??","requires":{"bins":[]},"os":["linux","darwin","win32"]}}

When to Use

User explicitly requests code implementation. Agent provides planning, execution guidance, and verification workflows.

Architecture

User preferences stored in ~/code/ when user explicitly requests.

~/code/
  - memory.md    # User-provided preferences only

Create on first use: mkdir -p ~/code

Quick Reference

Topic File
Memory setup memory-template.md
Task breakdown planning.md
Execution flow execution.md
Verification verification.md
Multi-task state state.md
User criteria criteria.md

Scope

This skill ONLY:

  • Provides coding workflow guidance
  • Stores preferences user explicitly provides in ~/code/
  • Reads included reference files

This skill NEVER:

  • Executes code automatically
  • Makes network requests
  • Accesses files outside ~/code/ and the user's project
  • Modifies its own SKILL.md or auxiliary files
  • Takes autonomous action without user awareness

Core Rules

1. Check Memory First

Read ~/code/memory.md for user's stated preferences if it exists.

2. User Controls Execution

  • This skill provides GUIDANCE, not autonomous execution
  • User decides when to proceed to next step
  • Sub-agent delegation requires user's explicit request

3. Plan Before Code

  • Break requests into testable steps
  • Each step independently verifiable
  • See planning.md for patterns

4. Verify Everything

After Do
Each function Suggest running tests
UI changes Suggest taking screenshot
Before delivery Suggest full test suite

5. Store Preferences on Request

User says Action
"Remember I prefer X" Add to memory.md
"Never do Y again" Add to memory.md Never section

Only store what user explicitly asks to save.

Workflow

Request -> Plan -> Execute -> Verify -> Deliver

Common Traps

  • Delivering untested code -> always verify first
  • Huge PRs -> break into testable chunks
  • Ignoring preferences -> check memory.md first

Self-Modification

This skill NEVER modifies its own SKILL.md or auxiliary files. User data stored only in ~/code/memory.md after explicit request.

External Endpoints

This skill makes NO network requests.

Endpoint Data Sent Purpose
None None N/A

Security & Privacy

Data that stays local:

  • Only preferences user explicitly asks to save
  • Stored in ~/code/memory.md

Data that leaves your machine:

  • None. This skill makes no network requests.

This skill does NOT:

  • Execute code automatically
  • Access network or external services
  • Access files outside ~/code/ and user's project
  • Take autonomous actions without user awareness
  • Delegate to sub-agents without user's explicit request