Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow for AI documentation generation #384

Merged
merged 6 commits into from
Feb 24, 2025
Merged

Conversation

alecgeatches
Copy link
Contributor

@alecgeatches alecgeatches commented Feb 23, 2025

Use repomix to generate a markdown documentation file for AI consumption.

This PR currently uses the docs/ and examples/ folders for generation, for a total of 33,150 tokens. Here's a comparison of the options I tried:

  • repomix --style=markdown docs/: 19,032 tokens
  • repomix --style=markdown docs/ example/: 33,150 tokens
  • repomix --style=markdown docs/ src/: 104,933 tokens
  • repomix --style=markdown docs/ example/ src/: 119,051 tokens
  • repomix --style=markdown docs/ example/ src/ tests/: 170,777 tokens

I've tested locally that having docs/ai.md in the docs/ folder doesn't recurse and include itself, doubling the output tokens. The output file specified by -o is ignored from the input data.

Testing

You can also experiment with this locally to test other repomix options:

# In the remote-data-blocks/ directory

npm install -g repomix
repomix --style=markdown -o docs/ai.md <folder1> <folder2> <...>

@alecgeatches alecgeatches self-assigned this Feb 23, 2025
name: Generate AI Documentation

on:
pull_request:
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to run this post merge? So it seamlessly adds the necessary documentation? I could see some cases where a conflict arises but it would be a bit more efficient imo.

Copy link
Contributor Author

@alecgeatches alecgeatches Feb 23, 2025

Choose a reason for hiding this comment

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

Good thinking! It would require a lot of git pulls that we can avoid. Plus, the action already checks for changes prior to committing, so having it run on based on specific PR file changes is unnecessary.

@alecgeatches alecgeatches merged commit 32516b9 into trunk Feb 24, 2025
12 checks passed
@alecgeatches alecgeatches deleted the add/ai-docs branch February 24, 2025 00:00
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