Skip to content

Conversation

@npaun
Copy link
Member

@npaun npaun commented Jan 6, 2026

I asked Claude to vibe code a script to generate stub documentation for compatibility flags. It looks through compatibility-date.capnp and automatically makes a markdown file in cloudflare-docs for each flag it finds that meets the criteria. You'll still need to tweak the output before committing to remove any 'inside baseball' details about the implementation that aren't interesting for users, but this will get you started.

Currently it'll document flags that:

  • Have a default enable date or are implied by another flag after a date
  • Aren't experimental

Let me know if you'd find this script useful too.

See here for the output it produces (after my manual editing): cloudflare/cloudflare-docs#27450

@npaun npaun requested a review from a team January 6, 2026 21:55
@npaun npaun requested review from a team as code owners January 6, 2026 21:55

# Find all field definitions
# Pattern: field_name @number :Bool followed by annotations and comments
pattern = r"(\w+)\s+@\d+\s*:Bool\s*([^;]*);"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use pycapnp here instead to parse the capnp file and avoid using regex?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it preserves comments?

@npaun npaun requested review from anonrig and jasnell January 9, 2026 00:07
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