@uicontract/skill
v0.3.0
Published
Agent skill files for UI Contracts - makes web app UIs machine-readable for AI coding agents
Downloads
464
Maintainers
Readme
@uicontract/skill
Agent skill files for UI Contracts.
Gives AI coding agents a structured way to discover, target, and interact with UI elements using stable data-agent-id selectors instead of fragile CSS classes or text matches.
What's Included
| File | Purpose |
|------|---------|
| SKILL.md | Full skill definition - commands, patterns, rules |
| references/manifest-schema.md | manifest.json structure and field reference |
| references/browser-tool-bridge.md | Targeting syntax for Playwright, Cypress, agent-browser, Chrome MCP |
| references/workflow-patterns.md | Multi-step automation recipes |
Installation by Agent Type
Claude (claude.ai / Claude Code)
Add to your project's CLAUDE.md or global agent instructions:
@uicontract/skillOr copy SKILL.md into your project root and reference it:
npx --yes @uicontract/skill installFor Claude Code, add to .claude/skills/:
npm install -g @uicontract/skill
# Then in your project:
cp $(npm root -g)/@uicontract/skill/SKILL.md .claude/skills/uic.mdCursor
Add to .cursor/rules/uic.mdc:
npm install @uicontract/skill
cp node_modules/@uicontract/skill/SKILL.md .cursor/rules/uic.mdcGitHub Copilot / VS Code
Add to .github/copilot-instructions.md:
npm install @uicontract/skill
cat node_modules/@uicontract/skill/SKILL.md >> .github/copilot-instructions.mdAny AI coding tool
The skill is plain Markdown. Copy SKILL.md wherever your tool reads agent instructions:
npm install @uicontract/skill
cat node_modules/@uicontract/skill/SKILL.mdHow It Works
Once loaded, the skill teaches the agent to:
- Check for an existing
manifest.jsonbefore scanning - Use
npx uicontract findto locate elements by label or purpose - Target elements by
data-agent-idinstead of CSS selectors or text - Run
npx uicontract diffto detect breaking UI changes
# Agent finds the element:
npx uicontract find "pause subscription" --json
# => { "agentId": "settings.billing.pause-subscription.button", ... }
# Agent targets it:
[data-agent-id="settings.billing.pause-subscription.button"]See SKILL.md for the full command reference and workflow patterns.
