Skip to content

feat: add openclaw as experimental skills target#1677

Open
sergio-sisternes-epam wants to merge 10 commits into
mainfrom
feat/openclaw-target
Open

feat: add openclaw as experimental skills target#1677
sergio-sisternes-epam wants to merge 10 commits into
mainfrom
feat/openclaw-target

Conversation

@sergio-sisternes-epam
Copy link
Copy Markdown
Collaborator

@sergio-sisternes-epam sergio-sisternes-epam commented Jun 5, 2026

Description

Adds openclaw as a new experimental consumer target for APM's skills compilation and deployment pipeline.

OpenClaw reads SKILL.md bundles from a well-defined search path. This PR wires it as a flag-gated target so users can opt in via apm experimental enable openclaw, then deploy skills with:

# Project scope -- deploys to .agents/skills/<name>/SKILL.md
apm install <package> --target openclaw

# User/global scope -- deploys to ~/.openclaw/skills/<name>/SKILL.md
apm install <package> --target openclaw --global

Design decisions

  • Project scope overlaps with agent-skills (both write to .agents/skills/). This is intentional and documented -- the net-new value is the user-scope path (~/.openclaw/skills/).
  • Experimental flag gate: target is invisible until apm experimental enable openclaw. An enable-hint UX block guides users when they try --target openclaw without the flag.
  • No compile_family: openclaw uses the same SKILL.md format, so no separate compilation step is needed.

Changes

Area File(s) What
Flag core/experimental.py Register ExperimentalFlag("openclaw")
Registry integration/targets.py Add KNOWN_TARGETS["openclaw"] TargetProfile
Detection core/target_detection.py Add to EXPERIMENTAL_TARGETS, get_target_description()
UX install/phases/targets.py Enable-hint block via _check_openclaw_flag_gate()
Lockfile bundle/lockfile_enrichment.py Add _CROSS_TARGET_MAPS["openclaw"]
Tests tests/integration/test_openclaw_target.py 25 tests: E2E flag-off hint, flag-ON deploy (global + project), constants, profile, description, cross-target-map
Tests tests/unit/core/test_scope.py, test_target_detection.py Update guardian exact-set assertions
Docs reference/targets-matrix.md, commands.md Document openclaw target + experimental usage

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (25 integration + unit tests)

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

Add OpenClaw (github.com/openclaw/openclaw) as an experimental
deployment target for skills.  Once enabled via
'apm experimental enable openclaw', users can deploy SKILL.md
bundles to:

  project scope: .agents/skills/<name>/SKILL.md
  user scope:    ~/.openclaw/skills/<name>/SKILL.md (--global)

At project scope the output is identical to agent-skills; the
--global user path (~/.openclaw/skills/) is the distinguishing
capability -- it maps to OpenClaw's priority-4 managed skill
loading directory.

Changes:
- Register ExperimentalFlag 'openclaw' in FLAGS
- Add KNOWN_TARGETS['openclaw'] TargetProfile
- Wire into EXPERIMENTAL_TARGETS, get_target_description(),
  _CROSS_TARGET_MAPS, and enable-hint UX block
- Update exact-set guardian tests
- Add 25 new tests (E2E, constants, flags, profile, description,
  cross-target-map)
- Update targets-matrix docs and apm-usage commands.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 5, 2026 11:02
The openclaw enable-hint block pushed the run() function past the
C901 complexity threshold (51 > 50).  Extract it into a standalone
_check_openclaw_flag_gate() helper so the function stays within the
allowed budget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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 experimental skills deployment target, enabling apm install --target openclaw (project scope) and --global installs to OpenClaw’s user directory, gated behind apm experimental enable openclaw.

Changes:

  • Registers the openclaw experimental flag and wires it into target detection/description.
  • Adds KNOWN_TARGETS["openclaw"] with project .agents/skills/ and user ~/.openclaw/skills/ routing, plus an enable-hint UX when the flag is off.
  • Updates lockfile pack enrichment cross-target mappings and refreshes docs/guide text; adds new OpenClaw-focused tests (with a coverage gap noted).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/apm_cli/core/experimental.py Adds the openclaw experimental flag definition and hint text.
src/apm_cli/integration/targets.py Registers openclaw as a skills-only target with .agents project root and .openclaw user root, flag-gated.
src/apm_cli/install/phases/targets.py Emits an enable-hint when --target openclaw is requested but the experimental flag is disabled.
src/apm_cli/core/target_detection.py Adds openclaw description and includes it in EXPERIMENTAL_TARGETS / VALID_TARGET_VALUES.
src/apm_cli/bundle/lockfile_enrichment.py Adds an openclaw entry to _CROSS_TARGET_MAPS for skills path remapping.
tests/integration/test_openclaw_target.py Introduces OpenClaw integration tests and constant guards (but currently lacks flag-ON deploy-path assertions).
tests/unit/core/test_target_detection.py Updates the exact-membership assertion for EXPERIMENTAL_TARGETS.
tests/unit/core/test_scope.py Updates the known-targets exact set to include openclaw.
docs/src/content/docs/reference/targets-matrix.md Documents openclaw as an experimental target and describes its deploy directories.
packages/apm-guide/.apm/skills/apm-usage/commands.md Adds user-facing guidance for enabling and using the openclaw target.

Comment thread tests/integration/test_openclaw_target.py
…mands, deps, marketplace, and policy modules

Extract helper functions, introduce dataclass param objects, and apply
guard-clause early-return consolidation to bring 59 functions below
Stage 2 Ruff complexity thresholds (max-statements 120, max-branches 40,
max-complexity 35, max-args 12, max-returns 8).

Behaviour-preserving refactor only -- no functional changes.

Part of: #1078

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergio-sisternes-epam sergio-sisternes-epam changed the title feat: add openclaw as experimental skills target feat: add openclaw target + refactor: Strangler Stage 2 complexity reduction Jun 5, 2026
Sergio Sisternes and others added 5 commits June 5, 2026 12:15
Add TestOpenclawDeployE2E class with two integration tests:

- test_global_deploys_to_openclaw_skills: exercises --target openclaw
  --global with flag ON, asserts SKILL.md lands at ~/.openclaw/skills/
  and NOT at ~/.agents/skills/ (negative assertion).

- test_project_scope_deploys_to_agents_skills: exercises --target
  openclaw (project scope) with flag ON, asserts SKILL.md lands at
  .agents/skills/.

Addresses copilot-pull-request-reviewer feedback requesting a flag-ON
deploy test that validates the actual install location.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	src/apm_cli/commands/compile/cli.py
#	src/apm_cli/commands/outdated.py
#	src/apm_cli/install/services.py
#	src/apm_cli/install/validation.py
#	src/apm_cli/integration/mcp_integrator.py
#	src/apm_cli/integration/mcp_integrator_install.py
#	src/apm_cli/marketplace/publisher.py
#	src/apm_cli/marketplace/semver.py
#	src/apm_cli/policy/policy_checks.py
Auto-fixed UP037 lint issue inherited from main merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts non-openclaw changes from an unrelated refactor commit that
was inadvertently included on this branch. Restores discovery.py,
pack.py, and other files to their main-branch state to fix 6 test
failures in policy discovery tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Force-restores publisher.py and other files that were corrupted
by the auto-merge of non-conflicting hunks from the stray refactor.
Only openclaw target changes remain in the diff.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergio-sisternes-epam sergio-sisternes-epam marked this pull request as draft June 5, 2026 11:45
@sergio-sisternes-epam sergio-sisternes-epam changed the title feat: add openclaw target + refactor: Strangler Stage 2 complexity reduction feat: add openclaw as experimental skills target Jun 5, 2026
Removes .agents/batch-bug-shepherd files (deleted on main) and
restores outdated.py to main state. Branch now contains only
openclaw target changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sergio-sisternes-epam sergio-sisternes-epam marked this pull request as ready for review June 5, 2026 12:03
@sergio-sisternes-epam sergio-sisternes-epam added the panel-review Trigger the apm-review-panel gh-aw workflow label Jun 5, 2026
Copy link
Copy Markdown
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 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread docs/src/content/docs/reference/targets-matrix.md Outdated
Experimental targets (openclaw, copilot-cowork, copilot-app) cannot be
listed in apm.yml because parse_targets_field() validates against
CANONICAL_TARGETS which does not include them. Separate the agent-skills
(canonical) guidance from the experimental targets guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 5, 2026
@sergio-sisternes-epam
Copy link
Copy Markdown
Collaborator Author

Manual E2E test — openclaw target (branch build 99d9a565)

Ran against editable install of feat/openclaw-target (apm-cli 0.18.0), test workspace in /tmp.

Step Command Result
Flag off apm install --target openclaw [!] "No active targets resolved" — correct
Enable apm experimental enable openclaw [+] Enabled with hint text
Project install apm install <local-bundle> --target openclaw .agents/skills/my-skill/SKILL.md deployed
Global install apm install <local-bundle> --target openclaw --global ~/.openclaw/skills/my-skill/SKILL.md deployed
Disable apm experimental disable openclaw [+] Disabled cleanly
Cleanup rm -rf ~/.openclaw Global dir fully removed

All paths verified. Both project (.agents/skills/) and global (~/.openclaw/skills/) deployments work as designed. Global artefacts cleaned up after test.

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

Labels

panel-review Trigger the apm-review-panel gh-aw workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants