Skip to content

feat: Add repo-local skill support + structure tests#31

Open
Jah-yee wants to merge 1 commit intoHKUDS:mainfrom
Jah-yee:fix/setup-py-urls
Open

feat: Add repo-local skill support + structure tests#31
Jah-yee wants to merge 1 commit intoHKUDS:mainfrom
Jah-yee:fix/setup-py-urls

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 11, 2026

Summary

  • Add repo-local .agents/skills/cli-anything/ skill for OpenClaw agents
  • Add tests/test_skill_layout.py for dual-entrypoint validation
  • Update README.md with repo-local skill documentation
  • Update .gitignore to include new directories

Changes

New Files

  • .agents/skills/cli-anything/SKILL.md - Skill definition
  • tests/test_skill_layout.py - Structure tests

Modified

  • .gitignore - Added new directories
  • README.md - Added dual-entrypoint documentation

Validation

python3 tests/test_skill_layout.py

All 5 tests pass.

- Add .agents/skills/cli-anything/ for OpenClaw agents
- Add tests/test_skill_layout.py for dual-entrypoint validation
- Update README.md with repo-local skill documentation
- Update .gitignore to include new directories

Implements issue HKUDS#30
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 support for a repo-local OpenClaw agent skill alongside the existing cli-anything-plugin/ workflow, with a small structure-validation test and supporting documentation/ignore rules.

Changes:

  • Added repo-local skill definition at .agents/skills/cli-anything/SKILL.md
  • Added tests/test_skill_layout.py to validate the dual-entrypoint layout and README claims
  • Updated README.md and .gitignore to document and include the new layout

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 10 comments.

File Description
tests/test_skill_layout.py Adds structure/documentation validation tests for plugin + repo-local skill layout
README.md Documents dual-entrypoint usage for OpenClaw agents
.gitignore Allows .agents/ and tests/ to be tracked under an “ignore everything else” policy
.agents/skills/cli-anything/SKILL.md Introduces the repo-local skill definition and references shared plugin specs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +8 to +9
import os
import re
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

os and re are imported but never used in this test module. Please remove the unused imports to avoid dead code and keep the test file minimal.

Suggested change
import os
import re

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
readme = REPO_ROOT / "README.md"
content = readme.read_text()
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Path.read_text() is called without an explicit encoding. To avoid platform-dependent decoding issues (especially on Windows), pass encoding="utf-8" (and optionally errors="strict") when reading README.md.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +32
skill_dir = REPO_ROOT / ".agents" / "skills" / "cli-anything"
assert skill_dir.exists(), f"Skill directory should exist at {skill_dir}"
assert (skill_dir / "SKILL.md").exists(), "Skill should have SKILL.md"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

These checks use .exists(), which would also pass if a file exists at this path. Since this test is validating repo structure, prefer .is_dir() for directories (and .is_file() for SKILL.md) so the assertions fail on the wrong filesystem type.

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +49
assert plugin_dir.exists(), "cli-anything-plugin directory should exist"
assert (plugin_dir / "HARNESS.md").exists(), "Plugin should have HARNESS.md"
assert (plugin_dir / "commands").exists(), "Plugin should have commands directory"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Similarly here, consider using .is_dir() for cli-anything-plugin/ and commands/ (and .is_file() for HARNESS.md) so the structure test catches incorrect file-vs-directory cases.

Suggested change
assert plugin_dir.exists(), "cli-anything-plugin directory should exist"
assert (plugin_dir / "HARNESS.md").exists(), "Plugin should have HARNESS.md"
assert (plugin_dir / "commands").exists(), "Plugin should have commands directory"
assert plugin_dir.is_dir(), "cli-anything-plugin directory should exist and be a directory"
assert (plugin_dir / "HARNESS.md").is_file(), "Plugin should have HARNESS.md as a file"
assert (plugin_dir / "commands").is_dir(), "Plugin should have commands directory"

Copilot uses AI. Check for mistakes.
assert (plugin_dir / "commands").exists(), "Plugin should have commands directory"


def test_example_appsocumented():
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Test function name has a typo: test_example_appsocumented reads like it’s missing a word (e.g., apps_documented). Renaming will make failures/searching clearer.

Copilot uses AI. Check for mistakes.

- Python 3.10+
- click >= 8.0
- pytest
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The prerequisites list omits pyyaml, but the install command below includes it (pip install ... pyyaml). Please make these consistent by either listing pyyaml as a prerequisite or removing it from the install command.

Suggested change
- pytest
- pytest
- pyyaml

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +38
skill_md = REPO_ROOT / ".agents" / "skills" / "cli-anything" / "SKILL.md"
content = skill_md.read_text()
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Path.read_text() is called without an explicit encoding. Consider using encoding="utf-8" here as well to make the test consistent and avoid locale-dependent failures.

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +55
readme = REPO_ROOT / "README.md"
content = readme.read_text()
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Path.read_text() is called without an explicit encoding. Please specify encoding="utf-8" when reading README.md to prevent failures on systems where the default encoding isn't UTF-8.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +85
- Plugin workflow: See `../cli-anything-plugin/` for Claude Code plugin
- Examples: See `../blender/`, `../gimp/`, `../audacity/` for implemented CLIs
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The relative paths in this section don’t resolve from .agents/skills/cli-anything/ (e.g., ../cli-anything-plugin/ points to .agents/skills/cli-anything-plugin). Use repo-root-relative paths (like cli-anything-plugin/, blender/, etc.) or correct the relative traversal (e.g., ../../../cli-anything-plugin/).

Suggested change
- Plugin workflow: See `../cli-anything-plugin/` for Claude Code plugin
- Examples: See `../blender/`, `../gimp/`, `../audacity/` for implemented CLIs
- Plugin workflow: See `cli-anything-plugin/` for Claude Code plugin
- Examples: See `blender/`, `gimp/`, `audacity/` for implemented CLIs

Copilot uses AI. Check for mistakes.
Comment on lines +69 to +73
| `HARNESS.md` | Complete methodology specification |
| `commands/cli-anything.md` | Main build command |
| `commands/validate.md` | Validation command |
| `commands/test.md` | Testing command |
| `commands/refine.md` | Refinement command |
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

In this context, HARNESS.md and commands/... look like they’re relative to the skill directory, but those files actually live under cli-anything-plugin/. Consider spelling the full repo paths (e.g., cli-anything-plugin/HARNESS.md, cli-anything-plugin/commands/...) or explicitly stating the base directory to avoid confusion.

Suggested change
| `HARNESS.md` | Complete methodology specification |
| `commands/cli-anything.md` | Main build command |
| `commands/validate.md` | Validation command |
| `commands/test.md` | Testing command |
| `commands/refine.md` | Refinement command |
| `cli-anything-plugin/HARNESS.md` | Complete methodology specification |
| `cli-anything-plugin/commands/cli-anything.md` | Main build command |
| `cli-anything-plugin/commands/validate.md` | Validation command |
| `cli-anything-plugin/commands/test.md` | Testing command |
| `cli-anything-plugin/commands/refine.md` | Refinement command |

Copilot uses AI. Check for mistakes.
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.

2 participants