Defining Capabilities
Define capabilities around bounded task domains.
Why this exists
Good capability design prevents abstraction leakage.
Good:
automation.extract_invoiceautomation.capture_sessionbrowser.extract_hacker_news_top_story
Bad:
browser.clickbrowser.gotoruntime.page.locator
How it works
When defining a capability:
- name the task domain
- define the output shape
- add default verification for structural validity
Example
defineCapability<ExtractHackerNewsTopStoryResult>({
name: "browser.extract_hacker_news_top_story",
defaultVerify(result) {
const violations: string[] = [];
if (typeof result.title !== "string" || result.title.length === 0) {
violations.push("Missing title");
}
return {
passed: violations.length === 0,
violations,
};
},
});
Notes
Common confusion
Capabilities are operator-level bounded task domains. They are not runtime or browser methods.