AI-friendly component docs: export structured “agent context” (props/slots/events/examples)
Hi @TheJaredWilcurt 👋
It’s been a long time, I hope you’re all doing well.
With the rise of AI coding tools / agents, I think documentation generators can unlock a huge new use-case:
🔥 Proposal: AI/Agent-friendly documentation output
Instead of docs being mainly “human-readable pages”, it would be extremely useful if VueDoxen could optionally output a structured, machine-readable “component contract” that AI agents can consume reliably.
Why this matters
AI tools can “vibe code” quickly, but without accurate contracts they often:
• hallucinate props / emit events / slot names
• miss defaults and invariants
• introduce inconsistent patterns across pages
• misuse CRUD patterns or permission rules
A structured output would act as a single source of truth for agents.
What an “Agent Docs” output could include
Per component (SFC):
• component description / purpose
• props (type + required + default + jsdoc)
• emits (event name + payload type + docs)
• slots (name + slot props type + docs)
• exposed methods (defineExpose)
• examples (inline snippets, or paths to demo examples)
• tags/metadata (e.g., category: table, workflow: crud)
• notes/invariants (“pagination is server-side”, “sort keys must match backend columns”, etc.)
Possible output formats
• JSON (for agents)
• JSON schema for validation
• Optional “index file” listing all components + summaries
• Output target could be something like:
• /docs/agent/*.json
• /docs/agent/index.json
Suggested feature shape
This can coexist with the normal docs output (site/markdown).
Happy to discuss
If this aligns with the roadmap, I’d be happy to help refine the spec or contribute implementation ideas.
Thanks! 🙏
关闭于 2026-03-10 7 条评论