Skip to content

feat: add OpenClaw agent integration#1861

Open
AIstar007 wants to merge 13 commits intogithub:mainfrom
AIstar007:main
Open

feat: add OpenClaw agent integration#1861
AIstar007 wants to merge 13 commits intogithub:mainfrom
AIstar007:main

Conversation

@AIstar007
Copy link

@AIstar007 AIstar007 commented Mar 15, 2026

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.md file under <workspace>/skills/, identical to the pattern used by Kimi Code.

Files changed:

  • src/specify_cli/__init__.py — Added "openclaw" to AGENT_CONFIG with folder: ".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 — Added openclaw to ALL_AGENTS and new create_openclaw_skills() function that generates .openclaw/skills/speckit-<command>/SKILL.md files with OpenClaw-compatible frontmatter.
  • .github/workflows/scripts/create-release-packages.ps1 — Mirror of bash changes: New-OpenClawSkills function, 'openclaw' case in Build-Variant, 'openclaw' added to $AllAgents.
  • scripts/bash/update-agent-context.sh — Added OPENCLAW_FILE="$AGENTS_FILE" (OpenClaw reads AGENTS.md from workspace root, same as amp, kiro-cli, bob), added openclaw) case in update_specific_agent() and update_if_new call in update_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, --ai option description, specify check tools list, and examples section.
  • templates/SKILL.md — New workspace-level skill manifest copied to .openclaw/skills/speckit/SKILL.md on specify init --ai openclaw --ai-skills.
  • templates/skill-file-template.md — New per-command SKILL.md template used by install_ai_skills(), following the existing *-template.md naming convention.

Key design decisions:

  • --ai-skills is the primary path for OpenClaw since it uses skill directories, not flat slash command files
  • Skill naming uses dash separator (speckit-specify) vs Kimi Code's dot separator (speckit.specify)
  • OPENCLAW_FILE points to AGENTS.md — the OpenClaw equivalent of CLAUDE.md for Claude Code
  • generic remains last in all agent arrays

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)
# openclaw appears in --ai help text
uv run specify init --help

# correct .openclaw/skills/ structure is generated
uv run specify init /tmp/test-openclaw --ai openclaw --ai-skills

# openclaw shows in tool check
uv run specify check

# release package builds correctly
AGENTS=openclaw SCRIPTS=sh .github/workflows/scripts/create-release-packages.sh v0.0.0-test

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 openclaw to 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 openclaw and map it to AGENTS.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.md copied to .openclaw/skills/speckit/SKILL.md, but the added file here is templates/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 under templates/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.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 openclaw to 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.md artifacts and include openclaw in 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 as speckit-<command> (per this PR). Consider making the displayed invocation style conditional on selected_ai (e.g., OpenClaw should show speckit-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-OpenClawSkills does 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.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why. And resolve conflicts.

@AIstar007
Copy link
Author

@copilot open a new pull request to apply changes based on the comments in this thread

1 similar comment
@AIstar007
Copy link
Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more Copilot feedback. If not applicable, please explain why

@AIstar007
Copy link
Author

@copilot open a new pull request to apply changes based on the comments in this thread

@AIstar007
Copy link
Author

@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>
AIstar007 and others added 2 commits March 22, 2026 11:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AIstar007
Copy link
Author

@copilot open a new pull request to apply changes based on the comments in this thread

@AIstar007 AIstar007 requested a review from mnriem March 22, 2026 05:36
Copy link
Author

@AIstar007 AIstar007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • openclaw is added to runtime AGENT_CONFIG, but the extension/preset command registration path uses CommandRegistrar.AGENT_CONFIGS (in src/specify_cli/agents.py / extensions.py) and that config currently has no openclaw entry. As a result, specify extension/preset flows won’t be able to target OpenClaw directories. Add an openclaw config there (likely .openclaw/skills with /SKILL.md semantics, similar to kimi) 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.

Comment on lines +2 to +9
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.
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
- `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)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
- 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)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback and make sure to resolve conflicts too. Getting closer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants