Skip to content

feat: add OpenClaw agent integration#1861

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

feat: add OpenClaw agent integration#1861
AIstar007 wants to merge 16 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.

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!

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AIstar007 AIstar007 requested a review from mnriem March 25, 2026 16:46
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 5 out of 5 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (2)

.github/workflows/scripts/create-release-packages.sh:276

  • The OpenClaw skill generator hardcodes __AGENT__ to openclaw, which makes the generated speckit-plan skill instruct users to run scripts/bash/update-agent-context.sh openclaw. The current scripts/bash/update-agent-context.sh does not recognize openclaw and exits with "Unknown agent type", so the OpenClaw plan workflow will fail. Either add openclaw support to the context updater (mapping it to the intended context file), or strip/override the {AGENT_SCRIPT} section for OpenClaw until the updater supports it.
      { 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:573

  • The new openclaw branch in Build-Variant is unreachable via the normal -Agents flow because $AllAgents (used for validation and default selection) does not include openclaw. This causes -Agents openclaw to be rejected as an unknown agent and prevents OpenClaw packages from being built in PowerShell. Add openclaw to $AllAgents (keeping generic last).
        'openclaw' {
            $skillsDir = Join-Path $baseDir ".openclaw/skills"
            New-Item -ItemType Directory -Force -Path $skillsDir | Out-Null
            New-OpenClawSkills -SkillsDir $skillsDir -ScriptVariant $Script
        }

💡 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 and also fix test & lint errors

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
Copy link
Author

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

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