Skip to content

Create ai file utils data model and helper script#7

Open
dawnkelly09 wants to merge 12 commits intostaging-ai-resources-pluginfrom
create-ai-file-utils
Open

Create ai file utils data model and helper script#7
dawnkelly09 wants to merge 12 commits intostaging-ai-resources-pluginfrom
create-ai-file-utils

Conversation

@dawnkelly09
Copy link
Contributor

This pull request introduces the new ai_file_utils plugin, which provides a standardized utility and schema for defining and resolving actions related to AI artifacts in MkDocs-based documentation sites. The plugin enables other plugins to generate consistent action lists (such as "View Markdown", "Open in ChatGPT", etc.) for documentation pages, separating action definition from UI implementation. The update includes plugin registration, documentation, schema definition, implementation, and tests.

Key changes:

Plugin Introduction and Integration

  • Added the new ai_file_utils plugin, registered it in pyproject.toml, and documented its usage and purpose in README.md. The plugin is now available for use in mkdocs.yml without additional configuration. [1] [2] [3]

Plugin Implementation

  • Implemented AIFileUtilsPlugin in plugins/ai_file_utils/plugin.py, which loads an actions schema from ai_file_actions.json and provides a resolve_actions API to interpolate context variables (such as page URL, filename, and content) into action definitions.

Action Schema Definition

  • Added plugins/ai_file_utils/ai_file_actions.json, defining a schema for available actions (e.g., "View Markdown", "Download Markdown", "Copy Markdown", "Open in ChatGPT", "Open in Claude"), including support for interpolation and prompt templates.

Documentation

  • Added comprehensive documentation for the plugin in docs/ai-file-utils.md, explaining its purpose, usage, schema fields, interpolation variables, and how to extend it with new actions.

Testing

  • Added tests in tests/ai_file_utils/test_plugin.py to demonstrate and verify the plugin's API, ensuring correct interpolation and action resolution for various action types.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the ai_file_utils plugin, a utility library for MkDocs that provides a standardized schema and API for defining and resolving actions related to AI artifacts in documentation sites. The plugin separates action definition from UI implementation, allowing other plugins to generate consistent action lists (e.g., "View Markdown", "Open in ChatGPT", etc.) for documentation pages.

Changes:

  • Added a new plugin with schema-based action resolution supporting links, downloads, clipboard, and LLM integrations
  • Implemented interpolation system for dynamic context variables (page URL, filename, content, prompts)
  • Included comprehensive documentation and demonstration tests

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
pyproject.toml Registered the new ai_file_utils plugin entry point
plugins/ai_file_utils/plugin.py Implemented plugin class with schema loading and action resolution logic
plugins/ai_file_utils/ai_file_actions.json Defined schema for available actions with interpolation templates
plugins/ai_file_utils/__init__.py Empty module initialization file (consistent with other plugins)
tests/ai_file_utils/test_plugin.py Added demonstration test for the plugin's API usage
docs/ai-file-utils.md Added comprehensive documentation explaining usage, schema, and extensibility
README.md Added reference to the new plugin in the main documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dawnkelly09 dawnkelly09 marked this pull request as draft February 4, 2026 21:57
@dawnkelly09 dawnkelly09 marked this pull request as ready for review February 5, 2026 19:16
@dawnkelly09 dawnkelly09 requested a review from eshaben February 5, 2026 19:16
Copy link
Collaborator

@eshaben eshaben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started to review this and then I realized what I thought was just going to be like a shared library is an actual plugin. Not sure it needs to be a plugin. Curious about what made you decide that it should be a plugin? And the factors that helped you make this decision

Copy link
Collaborator

@eshaben eshaben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Looking good!

@dawnkelly09 dawnkelly09 changed the base branch from main to staging-ai-resources-plugin February 5, 2026 22:05
@dawnkelly09 dawnkelly09 changed the title Create ai file utils plugin Create ai file utils data model and helper script Feb 5, 2026
@dawnkelly09 dawnkelly09 requested a review from eshaben February 5, 2026 22:06
@dawnkelly09 dawnkelly09 requested a review from eshaben February 6, 2026 21:28
Co-authored-by: Erin Shaben <eshaben@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants