go-codemod
Skill5.3k starsChanged 6 months agoMITView on GitHub
Implement and test Go codemods for the gh aw fix command.
Trending
Quiet since March.thin dataabout the whole repository
Who's talking about github/gh-aw
- A Hacker News story“GitHub Agentic Workflows”Hacker News · Feb 11, 2026 · 2 points
- @kcieslak.io“We see that a lot in our OSSed AW repository which uses fully agentic development - github.com/github/gh-aw …”Bluesky · Mar 24, 2026 · 1 likes
- @github-trending.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 github / gh-aw ⭐ 2,482 (+213) 🗒 Go GitHub Agentic Workflows”Bluesky · Feb 15, 2026
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository108 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/src/content/docs/engines/claude.mdCLAUDE.md
- pkg/workflow/data/engines/claude.mdCLAUDE.md
- .squad/templates/copilot-instructions.mdCopilot instructions
- playwright-cliSkill
- agentic-workflowsSkill
- awf-release-integratorSkill
- checkout-credential-reviewSkill
- console-renderingSkill
- copilot-reviewSkill
- create-canvasSkill
- custom-agentsSkill
- custom-engine-implementationSkill
- debugging-workflowsSkill
- developer-code-organizationSkill
- developer-internalsSkill
- developer-releaseSkill
- developer-securitySkill
- developerSkill
- documentationSkill
- error-messagesSkill
- error-pattern-safetySkill
- error-recovery-patternsSkill
- gh-agent-sessionSkill
- gh-agent-taskSkill
- github-copilot-agent-tips-and-tricksSkill
- github-discussion-querySkill
- github-issue-querySkill
- github-labels-querySkill
- github-mcp-serverSkill
- github-pr-querySkill
- github-scriptSkill
- github-workflows-querySkill
- go-lintersSkill
- http-mcp-headersSkill
- javascript-refactoringSkill
- jqschemaSkill
- messagesSkill
- npmSkill
- open-pull-requestSkill
- operational-value-designerSkill
- optimize-agentic-workflowSkill
- otel-queriesSkill
- pr-finisherSkill
- prompt-token-efficiencySkill
- pr-to-go-linterSkill
- reportingSkill
- resolve-merge-conflictsSkill
- restricted-tool-triageSkill
- review-agentic-workflowsSkill
- security-advisory-compat-enforcerSkill
- sergo-examplesSkill
- skillz-integrationSkill
- ssl-skill-normalizerSkill
- temporary-id-safe-outputSkill
- workflow-step-summariesSkill
- GitHub Agentic WorkflowsSkill
- {skill-name}Skill
- agent-collaborationSkill
- agent-conductSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when adding or updating codemods used by gh aw fix.
- Very specific: line 22
Create a new codemod file in pkg/cli/ named codemod_<feature>.go.
- Very specific: line 23
Add a package logger with logger.New("cli:codemod_<feature>").
- Distinctive: line 30
check frontmatter preconditions first
- Distinctive: line 34
avoid lossy rewrites and avoid touching unrelated keys
- Distinctive: line 35
Prefer existing helpers before writing custom parsing logic:
- Very specific: line 41
If the codemod depends on external data or side effects, inject dependencies through a ...WithDeps constructor so tests can mock behavior.
- Very specific: line 46
Create pkg/cli/codemod_<feature>_test.go and cover:
- Very specific: line 59
When complexity is high (expression rewriting, parser-like behavior), add fuzz tests in codemod_<feature>_fuzz_test.go using the pattern in …
- Very specific: line 63
After adding a codemod, update pkg/cli/fix_codemods_test.go:
- Distinctive: line 72
Run targeted checks first:
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Go Codemod Implementation Guide
Use this skill when adding or updating codemods used by gh aw fix.
Understand the fix pipeline first
- Review
pkg/cli/fix_command.goto understand execution flow:- codemods are loaded once via
GetAllCodemods() - each codemod is applied in registry order
- frontmatter is re-parsed before each codemod
- codemods must return
(newContent, applied, error)and be safe for no-op input
- codemods are loaded once via
- Review the codemod registry in
pkg/cli/fix_codemods.go. - Review helper utilities in
pkg/cli/yaml_frontmatter_utils.goand reusable codemod helper constructors inpkg/cli/codemod_factory.go.
Implementation steps
- Create a new codemod file in
pkg/cli/namedcodemod_<feature>.go. - Add a package logger with
logger.New("cli:codemod_<feature>"). - Implement
get<Feature>Codemod() Codemodand populate all metadata fields:ID(stable, unique)Name(human-readable)Description(clear migration behavior)IntroducedIn(release version)
- In
Apply:- check frontmatter preconditions first
- return unchanged content and
applied=falsewhen migration is not needed - transform only frontmatter using
applyFrontmatterLineTransformfrompkg/cli/yaml_frontmatter_utils.go - preserve comments/formatting/markdown body
- avoid lossy rewrites and avoid touching unrelated keys
- Prefer existing helpers before writing custom parsing logic:
findAndReplaceInLineremoveFieldFromBlockremoveParentBlockIfTrulyEmptynewFieldRemovalCodemodnewMoveTopLevelKeyToOnBlockCodemod
- If the codemod depends on external data or side effects, inject dependencies through a
...WithDepsconstructor so tests can mock behavior. - Register the codemod in
pkg/cli/fix_codemods.gowithinGetAllCodemods().
Testing requirements
Create pkg/cli/codemod_<feature>_test.go and cover:
- Metadata correctness (
ID,Name,Description,IntroducedIn,Apply != nil). - Happy path migration with expected output.
- No-op behavior when deprecated input is absent.
- Idempotence behavior (already-migrated input remains unchanged).
- Preservation guarantees:
- inline comments
- indentation
- markdown body after frontmatter
- Edge cases specific to the codemod (nested fields, mixed forms, ordering constraints, strict-mode checks, etc.).
- Dependency-injection behavior if
...WithDepsexists (success and fallback/error paths).
When complexity is high (expression rewriting, parser-like behavior), add fuzz tests in codemod_<feature>_fuzz_test.go using the pattern in pkg/cli/codemod_steps_run_secrets_env_fuzz_test.go.
Registry/order tests
After adding a codemod, update pkg/cli/fix_codemods_test.go:
- Expected codemod IDs list.
- Expected codemod order list.
Order matters because codemods run sequentially and later codemods observe prior transformations.
Validation commands
Run targeted checks first:
go test -v ./pkg/cli -run Codemod -count=1go test -v ./pkg/cli -run Fix -count=1
Then run repository standards:
make buildmake test-unitmake lint
Quality bar
A codemod is ready only when it is:
- deterministic
- safe on repeated runs
- conservative (no unrelated rewrites)
- fully covered by tests for migration and no-op paths
- registered and order-verified in fix codemod registry tests
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

