feat: add openclaw as experimental skills target#1677
Open
sergio-sisternes-epam wants to merge 10 commits into
Open
feat: add openclaw as experimental skills target#1677sergio-sisternes-epam wants to merge 10 commits into
sergio-sisternes-epam wants to merge 10 commits into
Conversation
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>
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>
Contributor
There was a problem hiding this comment.
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
openclawexperimental 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. |
…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>
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>
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>
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>
Collaborator
Author
Manual E2E test — openclaw target (branch build
|
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
openclawas 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:Design decisions
.agents/skills/). This is intentional and documented -- the net-new value is the user-scope path (~/.openclaw/skills/).apm experimental enable openclaw. An enable-hint UX block guides users when they try--target openclawwithout the flag.compile_family: openclaw uses the same SKILL.md format, so no separate compilation step is needed.Changes
core/experimental.pyExperimentalFlag("openclaw")integration/targets.pyKNOWN_TARGETS["openclaw"]TargetProfilecore/target_detection.pyEXPERIMENTAL_TARGETS,get_target_description()install/phases/targets.py_check_openclaw_flag_gate()bundle/lockfile_enrichment.py_CROSS_TARGET_MAPS["openclaw"]tests/integration/test_openclaw_target.pytests/unit/core/test_scope.py,test_target_detection.pyreference/targets-matrix.md,commands.mdType of change
Testing
Spec conformance (OpenAPM v0.1)