feat(skill): add agent skills loader

Implemented AgentSkillSpec loader that parses SKILL.md frontmatter and
progressive disclosure sections (discover/activate/deactivate) into
structured SkillStep objects with stable 1-based ordering.

Mapped Agent Skills to AgentSkillToolDescriptor with namespaced naming
(namespace/short_name), source="agent_skill", read-only defaults, and
AgentSkillResourceSlot bindings for scripts/, references/, and assets/
directories. All resource slots are unconditionally read_only.

Added explicit validation for missing frontmatter fields (name,
description) and invalid namespace format with actionable error messages.

Added docs/reference/agent_skills.md covering folder layout, SKILL.md
parsing rules, progressive disclosure model, and tool mapping.

Added Behave scenarios covering valid/invalid SKILL.md parsing,
namespaced naming, step ordering, missing frontmatter errors, progressive
disclosure lifecycle, tool mapping, and resource binding slots.

Added Robot Framework integration tests using the deploy-to-staging
example skill folder (robot/agent_skills_loader.robot).

Added ASV benchmarks for parsing throughput, folder load, progressive
disclosure lifecycle, and resource listing
(benchmarks/agent_skills_loader_bench.py).

ISSUES CLOSED: #160
This commit is contained in:
2026-02-26 09:10:35 +00:00
parent e3fcce413b
commit cb82fc51df
11 changed files with 3143 additions and 0 deletions
@@ -0,0 +1,40 @@
---
name: local/deploy-to-staging
description: Deploy the current branch to the staging environment.
version: 1.0.0
steps:
- Verify all tests pass locally
- Confirm the branch is up to date with the remote
- Push the branch to the remote repository
- Trigger the CI pipeline and wait for it to pass
- Run the deployment script from scripts/deploy.py
- Verify the deployment using the health check in references/runbook.md
- Notify the team via the configured notification channel
- Monitor logs for the first 5 minutes after deployment
metadata:
author: example
environment: staging
allowed-tools:
- builtin/shell
- builtin/git-status
---
# Deploy to Staging
Follow these steps to deploy the current branch to staging.
## Pre-flight Checks
1. Verify all tests pass locally using `builtin/shell`.
2. Confirm the branch is up to date with `builtin/git-status`.
## Deployment Steps
3. Push the branch to the remote repository.
4. Trigger the CI pipeline and wait for it to pass.
5. Run the deployment script from `scripts/deploy.py`.
6. Verify the deployment using the health check reference in `references/runbook.md`.
## Post-deployment
7. Notify the team via the configured notification channel.
8. Monitor logs for the first 5 minutes after deployment.
@@ -0,0 +1,14 @@
# Deployment Runbook
## Health Check Endpoints
- `/health` — Returns 200 OK if the service is healthy.
- `/ready` — Returns 200 OK if the service is ready to accept traffic.
## Rollback Procedure
If deployment fails, run the rollback script from the scripts/ directory.
## Contact
Alert the on-call engineer if health checks fail after 3 retries.
@@ -0,0 +1,20 @@
"""Deployment helper script for the deploy-to-staging Agent Skill.
This script is invoked by the LLM agent following the SKILL.md instructions.
It runs the deployment pipeline and returns a structured result.
"""
from __future__ import annotations
import sys
def main() -> int:
"""Execute the deployment pipeline."""
print("deploy-to-staging: starting deployment")
print("deploy-to-staging: deployment complete")
return 0
if __name__ == "__main__":
sys.exit(main())