refactor: remove duplicate prompt file, read document_command.md at runtime#43
Merged
oaustegard merged 2 commits intomainfrom Mar 2, 2026
Merged
Conversation
Adds a three-job GitHub Actions workflow that uses the official
actions/ai-inference@v1 action (backed by GitHub Models / GPT-4o)
to automatically create or update a *_README.md file whenever a
bookmarklet .js file is added or modified on the main branch.
Workflow (.github/workflows/auto_readme.yml):
- detect-changes: diffs HEAD vs HEAD~1, finds root-level .js
changes, and emits a JSON matrix of {js_file, basename,
readme_file} entries
- generate-readme: matrix job (max-parallel 3); uses
actions/ai-inference with file-input to inject the bookmarklet
source into the prompt template, then uploads the result as a
GitHub artifact
- commit-readmes: collects artifacts, rebases, and commits all
generated READMEs in a single push back to main using the
github-actions[bot] identity
Prompt template (.github/prompts/readme.prompt.yml):
- Encodes the full project README structure (Purpose, Features,
Installation w/ Easy/Manual mode, Usage, How It Works, Source
Code, MIT footer) as a system prompt
- Uses {{filename}}, {{basename}}, {{readme_filename}}, and
{{bookmarklet_code}} template variables
- Sets temperature=0.3 and maxCompletionTokens=2000 for
consistent, focused output
No external secrets needed — workflow uses the built-in GITHUB_TOKEN
with the new models: read permission scope (GA since April 2025).
…untime The separate .github/prompts/readme.prompt.yml duplicated instructions already maintained in .claude/commands/document_command.md. Now the workflow reads document_command.md directly at runtime, keeping a single source of truth for README structure and style guidelines. The prompt is constructed inline in a Python step and sent to the GitHub Models API via GITHUB_TOKEN (models: read permission).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.