With the AI provider infrastructure from #889 and the --ai flag, we can leverage AI to generate rule documentation.
Behavior
--ai (combined with the normal generate flow) would use AI to generate or improve documentation for all rules:
- Rules without docs get a full draft generated from the rule's source code,
meta object, and schema/options.
- Rules with existing docs get improvements -- filling in missing sections, adding examples of correct/incorrect code, improving descriptions.
The tool writes the results like it normally does. Users review the diff and discard any changes they don't want via their normal git workflow.
What we'd reuse from #889
- Provider resolution (
resolveAiProviderConfig) and multi-provider support (OpenAI, Anthropic, Groq, etc.)
--ai, --ai-provider, and --ai-model CLI options
- Error handling, timeout logic
What we'd need to add
- A
requestAiText() function for free-form text/markdown responses (the current requestAiJsonObject is JSON-only)
- Parameterized
max_tokens and temperature in the request builders (currently hardcoded for short JSON responses)
- Conditional
response_format (skip json_object mode for text responses)
- Prompt engineering: passing rule source code, meta object, schema, existing doc content, and plugin context
Related
With the AI provider infrastructure from #889 and the
--aiflag, we can leverage AI to generate rule documentation.Behavior
--ai(combined with the normalgenerateflow) would use AI to generate or improve documentation for all rules:metaobject, and schema/options.The tool writes the results like it normally does. Users review the diff and discard any changes they don't want via their normal git workflow.
What we'd reuse from #889
resolveAiProviderConfig) and multi-provider support (OpenAI, Anthropic, Groq, etc.)--ai,--ai-provider, and--ai-modelCLI optionsWhat we'd need to add
requestAiText()function for free-form text/markdown responses (the currentrequestAiJsonObjectis JSON-only)max_tokensandtemperaturein the request builders (currently hardcoded for short JSON responses)response_format(skipjson_objectmode for text responses)Related
--suggest-emojisand--aifor AI-powered config emoji suggestions #889 (suggest-emojis AI infrastructure +--aiflag)