群体编码技能:自主多智能体 AI 开发 - Openclaw Skills
作者:互联网
2026-03-28
什么是 群体编码技能?
群体编码技能是 Openclaw Skills 生态系统中的高级编排层,专为全自主软件开发而设计。通过利用分层的专业 AI 智能体,它能将高级提示词转化为生产就绪的代码库。该技能利用规划者智能体来构建项目架构,然后将特定任务委派给后端开发、前端开发和质量保证等专业角色,确保输出具有专业性和模块化。
这种 Openclaw Skills 的方法允许创建包含测试、Docker 配置和 CI/CD 流道的复杂应用,无需手动编码。它专注于通过记录每个架构决策并从执行错误中学习来交付高质量、可靠的结果,使其成为快速原型设计和自动脚手架生成的必备工具。
下载入口:https://github.com/openclaw/skills/tree/main/skills/arunnadarasa/swarm-coding-skill
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install swarm-coding-skill
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 swarm-coding-skill。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
群体编码技能 应用场景
- 使用 Openclaw Skills,结合 React、Node.js 和自动化测试套件快速搭建全栈 Web 应用脚手架。
- 开发带有集成 Docker 和 GitHub Actions 工作流的微服务,以便立即部署。
- 创建支持区块链的应用,集成自动化的 Privy 身份验证和 Web3 钱包基础设施。
- 生成需要高质量项目结构和技术文档的 CLI 工具和实用脚本。
- 编排器分析用户提示以确定技术栈和项目架构。
- 规划者智能体生成 swarm.yaml 清单,概述所有必需任务和角色依赖关系。
- 在子会话中初始化专业的工人智能体,为特定组件(如服务器、客户端或数据库)编写代码。
- 系统实施严格的协调和文件所有权,以防止不同智能体角色之间的冲突。
- 质量保证智能体执行自动化测试,在最终完成构建前验证所生成功能的完整性。
- 交付完整的项目,并附带综合摘要、决策日志和持续改进数据。
群体编码技能 配置指南
要开始使用 Openclaw Skills 的这一强大补充,请按照以下步骤操作:
- 确保安装了 Node.js v18+。
- 在工作区根目录的 .env 文件中添加您的 OpenRouter API 密钥:
OPENROUTER_API_KEY=sk-or-your-key-here
- (可选)配置特定模型或启用模拟模式:
OPENROUTER_MODEL=qwen/qwen3-coder
MOCK=1
- 在 OpenClaw 会话中调用该技能:
/trigger swarm-code "构建一个具有实时统计数据的现代仪表板"
群体编码技能 数据架构与分类体系
群体编码技能系统地组织其输出,以确保透明度和可维护性。数据存储在以下结构中:
| 文件/文件夹 | 描述 |
|---|---|
swarm-projects/{timestamp}/ |
包含完整生成的源代码的根目录。 |
DECISIONS.md |
架构选择和技术理由的详细日志,用于长期项目记忆。 |
.learnings/ |
包含 ERRORS.md、LEARNINGS.md 和 FEATURE_REQUESTS.md,用于迭代技能改进。 |
SWARM_SUMMARY.md |
执行统计、角色绩效和后续步骤建议的高层概述。 |
name: swarm-coding-skill
description: Autonomous multi-agent code generation. Planner creates manifest, specialized roles execute tasks. Generates complete projects with tests, Docker, CI, and decision logs.
requiredEnv:
- OPENROUTER_API_KEY
optionalEnv:
- OPENROUTER_MODEL
- MOCK
warnings:
- Writes to parent workspace (swarm-projects/, .learnings/). Run in isolated workspace.
- Stores prompts and agent reasoning in DECISIONS.md and .learnings/. Do not include sensitive data.
- Auto-includes Privy/web3 auth when prompts mention blockchain. Review generated code.
autonomy: orchestrator-driven-code-generation
outputPaths:
- swarm-projects/{timestamp}/
- .learnings/
- DECISIONS.md
- SWARM_SUMMARY.md
externalServices:
- name: OpenRouter
purpose: LLM inference for planning and code generation
scope: API key sent with requests
capabilities:
- code-generation
- multi-agent-orchestration
- project-scaffolding
- docker-ci
- testing
- knowledge-grounded-decisions
- continuous-improvement
Swarm Coding Skill
Fully autonomous multi-agent software development. Given a plain-English prompt, the swarm designs, implements, tests, and delivers a complete project end-to-end.
Core capability: Code generation via OpenRouter's qwen3-coder model. The orchestrator drives a Planner to create a manifest, then executes specialized worker roles (BackendDev, FrontendDev, QA, DevOps, etc.) in dependency order. All code is written to files; no interactive sessions.
Important: This skill generates code for review and deployment by the user. It does not make business decisions or operate autonomously in production. The user remains responsible for security, compliance, and operational decisions.
How It Works
- Orchestrator (
Plannerrole) analyzes your prompt, decides tech stack and architecture, and creates aswarm.yamlmanifest with tasks and dependencies. - Worker agents (
BackendDev,FrontendDev,QA,DevOps) are spawned as sub-sessions. Each has a clear persona and works on its assigned files in a shared workspace. - Coordination: The orchestrator tracks task completion and dependencies. When a task finishes, it marks it done and starts any unblocked downstream tasks.
- Conflict avoidance: Files are partitioned by role (Backend owns
server/, Frontend ownsclient/, etc.). If two roles need the same file, the manifest assigns an owner. - Quality gates: QA must pass tests before integration; DevOps ensures containerization; no merge without green tests.
- Deliverable: You get a complete project directory with README, tests, Dockerfile, and optionally a GitHub repo or zip.
Usage
# In your main OpenClaw session, invoke:
/trigger swarm-code "Build a dashboard that shows Moltbook stats and ClawCredit status"
The skill will:
- Spawn the orchestrator in an isolated session
- Orchestrator spawns workers sequentially or in parallel (based on dependencies)
- Output a final summary and path to the completed project
Requirements
- Node.js v18+
- Environment variables (in
.envat workspace root):- Required:
OPENROUTER_API_KEY— OpenRouter API key withqwen/qwen3-coderaccess - Optional:
OPENROUTER_MODEL(default:qwen/qwen3-coder),MOCK=1for dry-run
- Required:
- Internet access for OpenRouter API (and optionally GitHub/Docker if deployment requested)
Important: The orchestrator reads .env from the workspace root (parent directory of this skill) and writes project files to swarm-projects/ and logs to .learnings/ in that same workspace root. Run in an isolated workspace to avoid exposing unrelated secrets.
Configuration
Store your OpenRouter key in .env at the workspace root:
OPENROUTER_API_KEY=sk-or-...
Optional overrides:
OPENROUTER_MODEL=qwen/qwen3-coder
MOCK=1 # dry-run, no API calls
The skill uses qwen/qwen3-coder by default. Ensure your OpenRouter key has that model enabled.
Output
The created project lives in swarm-projects/ and includes:
README.mdwith run instructionspackage.json(or equivalent)- Source code organized by component
test/directory with automated testsDockerfileanddocker-compose.yml(if applicable)CI/with GitHub Actions workflow (optional)DECISIONS.md— Project memory documenting key architectural and technical decisions with rationale.learnings/— Learning logs capturing errors, insights, and feature requestsERRORS.md— Failures, exceptions, and recovery actionsLEARNINGS.md— Corrections, better approaches, knowledge gapsFEATURE_REQUESTS.md— Requested capabilities that don't exist yet
SWARM_SUMMARY.md— Execution summary with role performance, statistics, and next steps
Continuous Improvement
The swarm skill automatically captures learnings during execution to improve future runs:
What Gets Logged
- Worker failures →
.learnings/ERRORS.mdwith context and recovery suggestions - Better approaches discovered →
.learnings/LEARNINGS.md(e.g., "Simplified X by using Y") - User corrections →
.learnings/LEARNINGS.mdwhen you override a decision - Missing capabilities →
.learnings/FEATURE_REQUESTS.mdwhen you ask for something the skill can't do
After Each Run
A SWARM_SUMMARY.md is generated with:
- Role success/failure rates
- Total files generated
- References to learnings captured
- Recommendations for next steps
Promoting Learnings
Over time, review .learnings/ files:
- Recurring error patterns → update orchestrator prompts or add retry logic
- Better approaches → incorporate into the skill's default behavior
- Feature requests → consider for skill enhancements
This creates a feedback loop where each swarm run makes the skill smarter.
Example Prompts
- "Build a Node.js API with Express that serves Moltbook stats from JSON logs"
- "Create a React dashboard with dark theme and charts for ClawCredit status"
- "Make a CLI tool that checks ClawCredit pre-qualification and notifies via desktop alert"
- "Generate a smart contract that holds ClawCredit limits and allows x402 payments"
- "Build a hackathon app: a React dashboard that shows user's token balance using Privy auth" (includes Privy integration out of the box)
Notes
- The skill makes all decisions autonomously: tech stack, file structure, library choices.
- If a task fails, the orchestrator will retry once with adjusted instructions.
- You can monitor progress via the sub-agent logs in
.openclaw/agents/./sessions/ - To stop early, send
/stopto the orchestrator's session. - Privy Integration: When the prompt mentions blockchain, web3, tokens, NFTs, or Privy, the skill automatically includes Privy authentication and wallet infrastructure. Backend includes
/auth/callbackwith JWKS verification and a simulated fallback; frontend integrates@privy-io/react-authif React is used. For advanced agentic wallet controls, see the Privy Agentic Wallets skill. - Project Memory: Each swarm run creates a
DECISIONS.mdfile that documents significant decisions made by the planner and each agent. This serves as long-term knowledge grounding—future developers (or the same human weeks later) can understand why certain choices were made. Agents are prompted to explain their technical decisions (e.g., library selection, architecture patterns, security tradeoffs) as part of their output.
Enjoy your autonomous coding factory ??
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
信号管道:自动化营销情报工具 - Openclaw Skills
技能收益追踪器:监控 Openclaw 技能并实现变现
AI 合规准备就绪度:评估与治理工具 - Openclaw Skills
FOSMVVM ServerRequest 测试生成器:自动化 API 测试 - Openclaw Skills
酒店搜索器:AI 赋能的住宿与位置情报 - Openclaw Skills
Dub 链接 API:程序化链接管理 - Openclaw Skills
IntercomSwap:P2P BTC 与 USDT 跨链兑换 - Openclaw Skills
spotplay:macOS 原生 Spotify 播放控制 - Openclaw Skills
DeepSeek OCR:AI驱动的图像文本识别 - Openclaw Skills
Web Navigator:自动化网页研究与浏览 - Openclaw Skills
AI精选
