capability-authoring

Author new Tokenspace workspace capabilities with action-based APIs, strict domain and input guardrails, and autonomy-first approval policies. Use when creating or revising files in src/capabilities/*, src/credentials.ts, and CAPABILITY.md to ensure capabilities stay safely in-scope.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "capability-authoring" with this command: npx skills add tokenspace-ai/skills/tokenspace-ai-skills-capability-authoring

Capability Authoring

Author capabilities for maximum safe autonomy. Keep clear domain boundaries and strong input gating so actions stay aligned with the intended workspace domain.

Prefer creation workflows over maintenance workflows. Use maintenance guidance only when modifying existing capabilities.

Creation Workflow

  1. Define the capability domain contract before writing code.
  • Record allowed tenants, repos/projects, environments, object ID formats, and prohibited targets.
  • Record explicit examples of allowed and disallowed requests.
  • If scope is unclear, default to narrower boundaries.
  • Use references/domain-gating-checklist.md as the capture template.
  1. Design the action surface.
  • Define read and write actions from user requirements.
  • Keep actions small and composable; avoid broad "do anything" actions.
  • Assign each action an autonomy mode:
    • Autonomous by default.
    • Approval-required for selected operations.
    • Rejected when outside defined boundaries.
  • Use references/approval-policy-matrix.md to choose policy per action.
  1. Scaffold capability files.
  • Create src/capabilities/<name>/capability.ts.
  • Create src/capabilities/<name>/CAPABILITY.md.
  • If credentials are needed, add definitions in src/credentials.ts and import them.
  • If OAuth is needed, define it with credentials.oauth(...) in src/credentials.ts, and prefer credentials.ref(...) for client secret linkage. See references/oauth-credentials.md for more details on OAuth credential authoring.
  • Use references/capability-template.md for the structure.
  1. Implement guarded actions.
  • Export callable APIs with export const <actionName> = action(z.object({...}), async (args) => ...).
  • Do not export raw export function actions from capability entrypoints.
  • Keep action input/output JSON-serializable.
  • Enforce domain boundaries at runtime before external calls.
  • Validate and normalize user-provided identifiers before use.
  • Handle ambiguous or unsupported input with specific errors.
  • Use least-privilege credentials for each operation.
  1. Add approval gating where needed.
  • Start from user policy: maximize safe autonomous execution.
  • Require approval only for operations that are destructive, high-impact, cost-sensitive, or explicitly policy-gated.
  • Use namespaced approval actions (<capability>:<operation>).
  • Include data fields that uniquely scope the approval target.
  • Write precise descriptions that reviewers can approve safely.
  1. Author CAPABILITY.md for reliable agent behavior.
  • Include frontmatter with concise name and description.
  • Add Guidelines that reinforce scope boundaries and safety constraints.
  • Add Data Overview with concrete resources and identifiers.
  • Add runnable examples that show correct in-domain usage.
  • Include at least one example showing expected rejection behavior for unsupported targets.
  1. Verify.
  • Run bun typecheck.
  • Run targeted tests if present.
  • Confirm compile-time and runtime behavior:
    • Expected read paths run autonomously.
    • Writes follow the intended approval policy.
    • Unsupported targets are rejected before side effects.

Domain and Input Gating Rules

  • Treat user-provided IDs, names, and scopes as untrusted input.
  • Validate shape, format, and allowlist membership.
  • Normalize before comparison (case sensitivity, prefixes, canonical names).
  • Check scope at every mutating boundary, not only at request entry.
  • Reject unknown environments, repos, orgs, or resource classes.
  • Never let credential breadth replace explicit domain checks.

Multi-Capability Composition

When workflows span capabilities, preserve boundaries per capability:

  • Validate scope in each capability independently.
  • Pass only minimal structured data between capabilities.
  • Do not assume one capability's scope check covers another.
  • If capabilities disagree on scope, stop and surface the conflict.

Maintenance Guidance (Secondary)

When updating existing capabilities:

  • Preserve domain contract unless requirements explicitly expand it.
  • Re-evaluate approval and autonomy policy for new operations.
  • Keep CAPABILITY.md aligned with actual exported actions.
  • Add regression tests for previously rejected unsupported-target cases.

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

OpenClaw Skill Growth

Make OpenClaw Skills observable, diagnosable, and safely improvable over time. Use this when the user wants to maintain many SKILL.md files, inspect repeated...

Registry SourceRecently Updated
141Profile unavailable
General

Find Skills for ClawHub

Search for and discover OpenClaw skills from ClawHub (the official skill registry). Activate when user asks about finding skills, installing skills, or wants...

Registry SourceRecently Updated
2851Profile unavailable
General

Skill Listing Polisher

Improve a skill's public listing before publish. Use when tightening title, description, tags, changelog, and scan-friendly packaging so the listing looks cl...

Registry SourceRecently Updated
1130Profile unavailable
General

Skill Priority Setup

Scans installed skills, suggests L0-L3 priority tiers, and auto-configures skill injection policy. Use when: setting up skill priorities, optimizing token bu...

Registry SourceRecently Updated
2510Profile unavailable