feat: add OpenClaw agent integration#1861
Conversation
This file outlines the Spec-Driven Development workflow using the speckit toolset, detailing the sequence of commands and core rules for implementation.
There was a problem hiding this comment.
Pull request overview
Adds OpenClaw as a first-class AI agent option in Specify CLI, updating agent configuration, release packaging, context update scripts, and user-facing docs so projects can be initialized with .openclaw/ structures.
Changes:
- Added
openclawto runtime agent configuration and documentation (README/AGENTS). - Extended release package generators (bash + PowerShell) to build OpenClaw skill-directory layouts.
- Updated agent-context update script to recognize
openclawand map it toAGENTS.md.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Registers openclaw in AGENT_CONFIG (folder + skills subdir + CLI requirement). |
templates/skill-file-template.md |
Adds a new SKILL.md template file (currently not referenced by code). |
templates/commands/skill.md |
Introduces a new template under templates/commands/ intended as a “Speckit skill” description. |
scripts/bash/update-agent-context.sh |
Adds openclaw option and maps it to AGENTS.md. |
.github/workflows/scripts/create-release-packages.sh |
Adds openclaw build variant and generates .openclaw/skills/<skill>/SKILL.md directories. |
.github/workflows/scripts/create-release-packages.ps1 |
PowerShell mirror of OpenClaw release packaging support. |
README.md |
Documents OpenClaw support, --ai openclaw, and tool checks. |
AGENTS.md |
Documents OpenClaw directory conventions and configuration fields. |
Comments suppressed due to low confidence (1)
templates/commands/skill.md:4
- PR description mentions a new
templates/SKILL.mdcopied to.openclaw/skills/speckit/SKILL.md, but the added file here istemplates/commands/skill.md(which will be packaged/installed as a normal command template). If the intent is a workspace-level OpenClaw skill manifest, it likely shouldn’t live undertemplates/commands/.
---
name: "speckit"
description: "Full Spec-Driven Development (SDD) workflow powered by github/spec-kit. Use speckit-specify to start a feature, then speckit-plan, speckit-tasks, and speckit-implement in sequence."
metadata:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds OpenClaw as a new supported agent in Specify CLI, including packaging support and documentation updates so users can initialize projects with OpenClaw-compatible skill layouts.
Changes:
- Added
openclawto runtime agent configuration (AGENT_CONFIG) and updated docs to list OpenClaw as supported. - Updated release packaging scripts (bash + PowerShell) to build
.openclaw/skills/<skill>/SKILL.mdartifacts and includeopenclawin agent build lists. - Extended the bash agent context updater to recognize
openclaw, and introduced new skill-related templates.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds openclaw agent metadata used by init/check and skills installation logic. |
.github/workflows/scripts/create-release-packages.sh |
Adds OpenClaw packaging path and skill generation function; updates agent list. |
.github/workflows/scripts/create-release-packages.ps1 |
Mirrors OpenClaw packaging/skill generation on Windows. |
scripts/bash/update-agent-context.sh |
Adds OpenClaw to supported agent list and update routing (bash version). |
README.md |
Documents OpenClaw in supported agents + --ai/check help text and examples. |
AGENTS.md |
Documents OpenClaw directory conventions and CLI requirements. |
templates/commands/skill.md |
Adds a “speckit” skill manifest-like template (currently placed under command templates). |
templates/skill-file-template.md |
Adds a new SKILL.md template file (no code references found). |
Comments suppressed due to low confidence (3)
src/specify_cli/init.py:281
- The post-init “Next Steps” messaging in this module is hard-coded to slash commands like
/speckit.specify, but OpenClaw skills are generated/invoked asspeckit-<command>(per this PR). Consider making the displayed invocation style conditional onselected_ai(e.g., OpenClaw should showspeckit-specify,speckit-plan, etc.) so users don’t get incorrect instructions after initializing with--ai openclaw.
"openclaw": {
"name": "OpenClaw",
"folder": ".openclaw/",
"commands_subdir": "skills", # OpenClaw reads skills from .openclaw/skills/<skill-name>/SKILL.md
"install_url": "https://openclaw.ai",
"requires_cli": True,
},
.github/workflows/scripts/create-release-packages.sh:248
- OpenClaw skills are named
speckit-<cmd>, but the underlying command templates contain many hard-coded references to/speckit.<cmd>(dot style) in the body text.create_openclaw_skills()currently does not rewrite these, so OpenClaw users will see incorrect invocation instructions inside the generated SKILL.md content. Consider adding a rewrite step for OpenClaw that converts/speckit.<cmd>/speckit.<cmd>references to the OpenClaw form (e.g.,speckit-<cmd>).
# Build body: replace placeholders, strip scripts sections, rewrite paths
local body
body=$(printf '%s\n' "$file_content" | sed "s|{SCRIPT}|${script_command}|g")
if [[ -n $agent_script_command ]]; then
body=$(printf '%s\n' "$body" | sed "s|{AGENT_SCRIPT}|${agent_script_command}|g")
fi
body=$(printf '%s\n' "$body" | awk '
/^---$/ { print; if (++dash_count == 1) in_frontmatter=1; else in_frontmatter=0; next }
in_frontmatter && /^scripts:$/ { skip_scripts=1; next }
in_frontmatter && /^agent_scripts:$/ { skip_scripts=1; next }
in_frontmatter && /^[a-zA-Z].*:/ && skip_scripts { skip_scripts=0 }
in_frontmatter && skip_scripts && /^[[:space:]]/ { next }
{ print }
')
body=$(printf '%s\n' "$body" | sed 's/{ARGS}/\$ARGUMENTS/g' | sed 's/__AGENT__/openclaw/g' | rewrite_paths)
.github/workflows/scripts/create-release-packages.ps1:359
New-OpenClawSkillsdoes not rewrite template body references like/speckit.plan/speckit.plan(dot style) to the OpenClaw invocation style (speckit-plan). Since OpenClaw skills are named with dashes, leaving dot-style references in the body will produce incorrect user instructions. Consider adding an OpenClaw-specific text rewrite step before writing SKILL.md.
# Replace {SCRIPT}, strip scripts sections, rewrite paths
$body = $fileContent -replace '\{SCRIPT\}', $scriptCommand
if (-not [string]::IsNullOrEmpty($agentScriptCommand)) {
$body = $body -replace '\{AGENT_SCRIPT\}', $agentScriptCommand
}
$lines = $body -split "`n"
$outputLines = @()
$inFrontmatter = $false
$skipScripts = $false
$dashCount = 0
foreach ($line in $lines) {
if ($line -match '^---$') {
$outputLines += $line
$dashCount++
$inFrontmatter = ($dashCount -eq 1)
continue
}
if ($inFrontmatter) {
if ($line -match '^(scripts|agent_scripts):$') { $skipScripts = $true; continue }
if ($line -match '^[a-zA-Z].*:' -and $skipScripts) { $skipScripts = $false }
if ($skipScripts -and $line -match '^\s+') { continue }
}
$outputLines += $line
}
$body = $outputLines -join "`n"
$body = $body -replace '\{ARGS\}', '$ARGUMENTS'
$body = $body -replace '__AGENT__', 'openclaw'
$body = Rewrite-Paths -Content $body
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable, please explain why. And resolve conflicts.
|
@copilot open a new pull request to apply changes based on the comments in this thread |
1 similar comment
|
@copilot open a new pull request to apply changes based on the comments in this thread |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Some more Copilot feedback. If not applicable, please explain why
|
@copilot open a new pull request to apply changes based on the comments in this thread |
|
@copilot open a new pull request to apply changes based on the comments in this thread |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot open a new pull request to apply changes based on the comments in this thread |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/specify_cli/init.py:282
openclawis added to runtimeAGENT_CONFIG, but the extension/preset command registration path usesCommandRegistrar.AGENT_CONFIGS(insrc/specify_cli/agents.py/extensions.py) and that config currently has noopenclawentry. As a result,specify extension/presetflows won’t be able to target OpenClaw directories. Add anopenclawconfig there (likely.openclaw/skillswith/SKILL.mdsemantics, similar tokimi) to make OpenClaw support complete.
"openclaw": {
"name": "OpenClaw",
"folder": ".openclaw/",
# Use a dedicated commands template directory; OpenClaw still reads live skills from .openclaw/skills/<skill-name>/SKILL.md
"commands_subdir": "commands",
"install_url": "https://openclaw.ai",
"requires_cli": True,
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| NOTE: This file is intentionally not used as a runtime template. | ||
|
|
||
| The SKILL.md content is generated inline by `install_ai_skills()`, which is | ||
| the single source of truth for the SKILL file format. | ||
|
|
||
| This placeholder file exists only to document that there is no standalone | ||
| SKILL.md template. If you need to change the generated output, update | ||
| `install_ai_skills()` instead. |
There was a problem hiding this comment.
The PR description says this file is a per-command SKILL.md template used by install_ai_skills(), but the file itself states it is intentionally not used at runtime and that install_ai_skills() generates content inline. Either wire a real template into the runtime flow or update the PR description/docs to avoid misleading future maintainers about the source of truth.
| - `commands_subdir`: Subdirectory name within the agent folder where command/prompt files are stored (default: `"commands"`) | ||
| - Most agents use `"commands"` (e.g., `.claude/commands/`) | ||
| - Some agents use alternative names: `"agents"` (copilot), `"workflows"` (windsurf, kilocode), `"prompts"` (codex, kiro-cli), `"command"` (opencode - singular) | ||
| - Some agents use alternative names: `"agents"` (copilot), `"workflows"` (windsurf, kilocode), `"prompts"` (codex, kiro-cli), `"command"` (opencode - singular), `"skills"` (kimi, openclaw) |
There was a problem hiding this comment.
AGENTS.md states commands_subdir uses "skills" for openclaw, but the runtime AGENT_CONFIG in src/specify_cli/__init__.py sets OpenClaw’s commands_subdir to "commands". Update this documentation to match the actual runtime config (or update the runtime config to match the documented layout).
| - Some agents use alternative names: `"agents"` (copilot), `"workflows"` (windsurf, kilocode), `"prompts"` (codex, kiro-cli), `"command"` (opencode - singular), `"skills"` (kimi, openclaw) | |
| - Some agents use alternative names: `"agents"` (copilot), `"workflows"` (windsurf, kilocode), `"prompts"` (codex, kiro-cli), `"command"` (opencode - singular), `"skills"` (kimi) |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback and make sure to resolve conflicts too. Getting closer!
Description
Adds full support for [OpenClaw](https://openclaw.ai) as a new AI agent in Specify CLI.
OpenClaw is a persistent AI agent daemon that connects to messaging platforms (Telegram, WhatsApp, Slack, etc.) and uses a skill-based architecture — skills are discovered as directories containing a
SKILL.mdfile under<workspace>/skills/, identical to the pattern used by Kimi Code.Files changed:
src/specify_cli/__init__.py— Added"openclaw"toAGENT_CONFIGwithfolder: ".openclaw/",commands_subdir: "skills",requires_cli: True,install_url: "https://openclaw.ai". Help text updates automatically via_build_ai_assistant_help()..github/workflows/scripts/create-release-packages.sh— AddedopenclawtoALL_AGENTSand newcreate_openclaw_skills()function that generates.openclaw/skills/speckit-<command>/SKILL.mdfiles with OpenClaw-compatible frontmatter..github/workflows/scripts/create-release-packages.ps1— Mirror of bash changes:New-OpenClawSkillsfunction,'openclaw'case inBuild-Variant,'openclaw'added to$AllAgents.scripts/bash/update-agent-context.sh— AddedOPENCLAW_FILE="$AGENTS_FILE"(OpenClaw readsAGENTS.mdfrom workspace root, same asamp,kiro-cli,bob), addedopenclaw)case inupdate_specific_agent()andupdate_if_newcall inupdate_all_existing_agents().AGENTS.md— Added OpenClaw to supported agents table, CLI-based agents list, Markdown format section, and directory conventions.README.md— Added OpenClaw to supported agents table,--aioption description,specify checktools list, and examples section.templates/SKILL.md— New workspace-level skill manifest copied to.openclaw/skills/speckit/SKILL.mdonspecify init --ai openclaw --ai-skills.templates/skill-file-template.md— New per-command SKILL.md template used byinstall_ai_skills(), following the existing*-template.mdnaming convention.Key design decisions:
--ai-skillsis the primary path for OpenClaw since it uses skill directories, not flat slash command filesspeckit-specify) vs Kimi Code's dot separator (speckit.specify)OPENCLAW_FILEpoints toAGENTS.md— the OpenClaw equivalent ofCLAUDE.mdfor Claude Codegenericremains last in all agent arraysTesting
uv run specify --helpuv sync && uv run pytestAI Disclosure
Implementation approach and file structure were developed with AI assistance (Claude). All code was manually reviewed, tested end-to-end, and verified against existing agent integration patterns before submission.