Skip to content

generate CLAUDE.md file from contibution guidelines #2198

@stalniy

Description

@stalniy

Why

CLAUDE.md is a file which gives context to different coding agents like copilot, cursor and some others. This file helps them to understand the project better and create PRs/generate code of better quality.

What

Generate CLAUDE.md from https://github.com/akash-network/console/discussions/categories/contribution-rfc?discussions_q=is%3Aopen+category%3A%22Contribution+RFC%22 using GHA.

For every discussion, we will use a separate file and will link it into root CLAUDE.md with a reference to that file. All sub-files will live in .contribution-guidelines folder. Every file has the same title as RFC discussion (lowercased with spaces replaced by dashes).

Implementation Details

AI Instructions Section in RFCs

Each RFC discussion must include a dedicated section called ## AI Instructions. The author of the RFC needs to add this section before changing the label to RFC:Landed. This section will contain instructions that will be extracted and included in the CLAUDE.md file.

Note: Currently, RFCs don't have this section. It needs to be added manually to existing RFC:Landed discussions.

GitHub Actions Automation

The automation script should be implemented in bash using gh cli and will:

  1. Trigger on these discussion events:

    • labeled - when RFC:Landed label is added, create new file
    • unlabeled - when RFC:Landed label is removed, delete the file
    • edited - when discussion is edited, recreate (update) the file
  2. Process:

    • Regenerate the entire CLAUDE.md structure on every event
    • Only update files that were actually modified
    • Create a PR with the changes for review (don't commit directly)

Root CLAUDE.md Structure

The root CLAUDE.md file should have the following structure:

## <RFC title>

@.contribution-guidelines/rfc-title.md  # lowercased, dashed

File Naming Convention

RFC discussion titles should be converted to filenames using this rule:

  • Convert to lowercase
  • Replace spaces with hyphens
  • Remove special characters

Example: "Testing Strategy" → testing-strategy.md

Workflow

  1. GHA monitors discussions in the "Contribution RFC" category
  2. When a discussion receives/loses the RFC:Landed label or is edited, the workflow triggers
  3. Script extracts the ## AI Instructions section from all RFC:Landed discussions
  4. Generates/updates files in .contribution-guidelines/ directory
  5. Generates root CLAUDE.md with links to all sub-files
  6. Creates a PR with changes for human review

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions