Skip to content

feat(openab-agent): add skill support#955

Merged
thepagent merged 3 commits into
mainfrom
feat/openab-agent-skills
May 31, 2026
Merged

feat(openab-agent): add skill support#955
thepagent merged 3 commits into
mainfrom
feat/openab-agent-skills

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

@chaodu-agent chaodu-agent commented May 31, 2026

Summary

Add on-demand skill loading to openab-agent, following the Agent Skills standard (compatible with Pi and Claude Code skill format).

How It Works

  1. At session start, scans .openab/skills/ (project-local) and ~/.openab/agent/skills/ (global)
  2. Parses SKILL.md YAML frontmatter (name, description)
  3. Injects skill names + descriptions into the system prompt
  4. Agent uses read tool to load full SKILL.md content on-demand when a task matches

Project-local skills take precedence over global (deduplication by name).

Example

.openab/skills/brave-search/SKILL.md
---
name: brave-search
description: Web search via Brave Search API
---

# Usage
\`\`\`bash
./search.sh "query"
\`\`\`

Testing

6 unit tests in skills.rs covering frontmatter parsing, discovery, deduplication, and prompt formatting. Filesystem I/O tests marked with #[ignore] per ADR.

What's NOT included (v0.3)

  • Dynamic tool registration from skills
  • MCP server integration

Ref: discussed in thread https://discord.com/channels/1490282656913559673/1510476394201612510

@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 31, 2026 11:06
@shaun-agent
Copy link
Copy Markdown
Contributor

shaun-agent commented May 31, 2026

OpenAB PR Screening

This is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Click 👍 if you find this useful. Human review will be done within 24 hours. We appreciate your support and contribution 🙏

Screening report screening pass complete for `#955`.

GitHub comment: #955 (comment)
Project action: moved item PVTI_lADOEFbZWM4BUUALzguSn4M from Incoming to PR-Screening on openabdev/1.

Intent

Add first-class skill discovery to openab-agent so operators can keep reusable task instructions in project-local or global SKILL.md files and expose only lightweight skill metadata in the session prompt.

Feat

Feature work. Adds skill scanning from .openab/skills/ and ~/.openab/skills/, parses name and description, deduplicates project-local skills ahead of global skills, injects the available skill list into the system prompt, and documents the workflow.

Who It Serves

Agent runtime operators and maintainers.

Rewritten Prompt

Implement on-demand skill awareness for openab-agent. Discover SKILL.md files from local and global skill directories, parse required frontmatter, deduplicate by name with local precedence, append a concise available-skills list to the system prompt, and cover parsing, invalid files, ordering, deduplication, and prompt formatting with tests. Defer dynamic tools and MCP.

Merge Pitch

Low-risk prompt-layer feature with moderate blast radius. Main reviewer concerns: deterministic discovery, prompt-size growth, malformed skill handling, and visible operator diagnostics.

Best-Practice Comparison

OpenClaw mostly does not apply; this is not scheduling, delivery, retries, or durable jobs. The useful lesson is isolation: do not silently turn skills into executable tools yet.

Hermes Agent partially applies: discovery should be deterministic per session and avoid hidden mutable runtime state.

Implementation Options

Conservative: metadata discovery and prompt injection only.

Balanced: metadata discovery plus logs/guardrails for skipped, shadowed, or malformed skills.

Ambitious: full skill runtime with dynamic tools, MCP declarations, permissions, isolation, and run logs.

Comparison Table

Option Speed Complexity Reliability Maintainability User Impact Fit for OpenAB now
Conservative High Low Medium High Medium Good
Balanced Medium Medium High High High Best fit
Ambitious Low High Medium Medium Very high Too broad

Recommendation

Proceed with the balanced path. Before merge, Masami or Pahud should check prompt-size limits, invalid SKILL.md behavior, local-over-global shadowing, and operator visibility. Keep dynamic tools and MCP as follow-up PRs.

Implement on-demand skill loading following the Agent Skills standard
(compatible with Pi and Claude Code skill format).

- Scan .openab/skills/ (project-local) and ~/.openab/skills/ (global)
- Parse SKILL.md YAML frontmatter (name, description)
- Inject skill descriptions into system prompt
- Agent loads full SKILL.md on-demand via read tool
- Project-local skills take precedence over global (deduplication by name)
- 6 unit tests covering parsing, discovery, and formatting

Skills guide the LLM to use existing tools (bash/read/write/edit).
Dynamic tool registration deferred to v0.3.
@chaodu-agent chaodu-agent force-pushed the feat/openab-agent-skills branch from 76493dd to 1d777f4 Compare May 31, 2026 12:08
- F1: use entry.path().is_dir() to follow symlinks during skill discovery
- F2: mark filesystem I/O tests with #[ignore] per ADR
@chaodu-agent
Copy link
Copy Markdown
Collaborator Author

LGTM ✅ — the filesystem I/O tests are now properly ignored, and the previous blockers are addressed.

What This PR Does

Adds skill discovery for SKILL.md files and injects a concise skills summary into the agent system prompt so the model can load full instructions on demand.

How It Works

It scans project-local and global skill directories, parses YAML frontmatter for name and description, deduplicates by skill name with project-local precedence, and formats the discovered skills into a prompt section that points to the full file path.

Findings

# Severity Finding Location
1 🟢 entry.path().is_dir() now follows symlinks as requested. openab-agent/src/skills.rs
2 🟢 Filesystem I/O tests are marked #[ignore], avoiding flaky default unit runs. openab-agent/src/skills.rs
3 🟢 The naming convention concern is no longer blocking given PR #954.
4 🟢 Global path already points to ~/.openab/agent/skills/.
What's Good (🟢)
  • Clean separation between discovery, parsing, and prompt formatting.
  • Project-local skills correctly take precedence over global skills.
  • Tests cover parsing and formatting logic well.

@thepagent thepagent merged commit ca3f6ee into main May 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants