xgo
CLAUDE.md9.5k starsChanged 4 months agoApache-2.0View on GitHub
When implementing new language syntax, follow this three-phase approach: IMPORTANT: Each phase must be implemented in a separate pull request. Do NOT mix phases in a single PR. This separation ensures: - Clear review focus (grammar vs semantics vs documentation) - Easier rollback if issues are found - Better git history and maintainability - Allows grammar to be reviewed independently from implementation details When submitting a new PR to the gogen repository for a change, also submit a PR to…
We split this CLAUDE.md into the rules it gives an agent
19 rules. About 0 are common, 13 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈13
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
When implementing new language syntax, follow this three-phase approach:
- Very specific: line 19
Printer: Add formatting support for new syntax (inverse of parsing) in printer/ directory
- Very specific: line 21
Testing: Add test cases in parser/_testdata/ for new syntax and focused unit tests for affected AST consumers
- Very specific: line 23
What NOT to include: Do NOT add any code generation or semantic logic in cl/ package - that belongs in Phase 2
- Very specific: line 29
Testing: Add comprehensive test cases in cl/_testxgo/ covering various usage scenarios
- Very specific: line 36
Quick Start Guide: Add feature documentation to doc/docs.md with practical examples
- Distinctive: line 37
Table of Contents: Update TOC in quick start to include new feature section
- Distinctive: line 38
Language Specification: Update specification documents (see Language Specification Structure below)
- Distinctive: line 43
When I request syntax additions, first confirm the exact grammar specification
- Distinctive: line 44
Always consider backward compatibility with existing Go code
- Distinctive: line 62
Ensure new syntax doesn't break existing XGo/Go code
- Distinctive: line 63
Follow Go idioms in generated code
- Very specific: line 65
Code Formatting: Run go fmt on any changed source files before committing
- Distinctive: line 69
Update language specification documents
- Distinctive: line 70
Add examples to Quick Start guide
- Distinctive: line 71
Document any limitations or special considerations
- Distinctive: line 81
Ensure all code examples in documentation are runnable and correct
- Distinctive: line 82
Verify documentation accurately reflects implemented behavior
- Distinctive: line 83
Check that TOC links work correctly
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md 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
XGo Project AI Assistant Guide
Workflow
Adding New Syntax Features
When implementing new language syntax, follow this three-phase approach:
IMPORTANT: Each phase must be implemented in a separate pull request. Do NOT mix phases in a single PR. This separation ensures:
- Clear review focus (grammar vs semantics vs documentation)
- Easier rollback if issues are found
- Better git history and maintainability
- Allows grammar to be reviewed independently from implementation details
Phase 1: Grammar Definition (First Pull Request)
Scope: AST, parser, printer, and required AST consumer modifications ONLY
- AST: Define new node types in
ast/directory (if needed - often existing nodes can be reused) - Parser: Implement parsing rules in
parser/directory to recognize the new syntax - Printer: Add formatting support for new syntax (inverse of parsing) in
printer/directory - AST Consumers: Audit manually maintained consumers such as
ast.Walk,ast/filter.go, parser expression validation, andx/format - Testing: Add test cases in
parser/_testdata/for new syntax and focused unit tests for affected AST consumers- Note: Printer reuses parser test cases and also has printer-specific cases in
printer/_testdata/
- Note: Printer reuses parser test cases and also has printer-specific cases in
- What NOT to include: Do NOT add any code generation or semantic logic in
cl/package - that belongs in Phase 2
Phase 2: Semantic Implementation (Second Pull Request)
Scope: Code generation via cl package and gogen module ONLY
- Code Generation: Implement semantics using
github.com/goplus/gogenpackage - Type Safety: Leverage gogen's type information maintenance for semantic correctness
- Testing: Add comprehensive test cases in
cl/_testxgo/covering various usage scenarios - Prerequisite: Phase 1 PR must be merged before starting Phase 2
When submitting a new PR to the gogen repository for a change, also submit a PR to the xgo repository that updates the gogen module to the latest code from the corresponding gogen branch. The xgo PR's go.mod/go.sum must pin the gogen dependency to the feature branch's commit (not to a released version), so the two PRs represent a coherent, reviewable change set.
Phase 3: Documentation (Third Pull Request)
Scope: User-facing documentation updates ONLY
- Quick Start Guide: Add feature documentation to
doc/docs.mdwith practical examples - Table of Contents: Update TOC in quick start to include new feature section
- Language Specification: Update specification documents (see Language Specification Structure below)
- Examples: Provide clear, runnable code examples demonstrating the feature
- Prerequisite: Phase 2 PR must be merged before starting Phase 3
Communication Protocol
- When I request syntax additions, first confirm the exact grammar specification
- Always consider backward compatibility with existing Go code
- For ambiguous requirements, ask clarifying questions about:
- Precedence and associativity rules
- Error handling expectations
- Integration with existing type system
Technical Specifications
Compiler Architecture
- Target: XGo compiles to Go code, not machine code
- Foundation: Built on
github.com/goplus/gogenfor robust Go AST generation - Key Benefit: gogen maintains type information, ensuring both syntactic and semantic correctness
Quality Standards
Code Requirements
- Maintain full compatibility with existing Go ecosystem
- Ensure new syntax doesn't break existing XGo/Go code
- Follow Go idioms in generated code
- Provide comprehensive error messages
- Code Formatting: Run
go fmton any changed source files before committing
Documentation Expectations
- Update language specification documents
- Add examples to Quick Start guide
- Document any limitations or special considerations
Testing Requirements
- Phase 1: 100% test coverage for new syntax parsing in
parser/_testdata/and focused tests for affected AST consumers - Phase 2: Comprehensive test coverage for semantic implementation in
cl/_testxgo/covering:- Common usage scenarios
- Edge cases and error conditions
- Integration with existing type system
- Phase 3: Documentation validation
- Ensure all code examples in documentation are runnable and correct
- Verify documentation accurately reflects implemented behavior
- Check that TOC links work correctly
- Coverage rule: Unit test coverage must not decrease across any PR. Run
go test ./... -coverbefore and after your changes and compare. If coverage drops for any package, add tests to compensate before submitting.
Trending
Less talk lately.about the whole repository
Who's talking about goplus/xgo
- A Hacker News story“The XGO Programming Language”Hacker News · May 21, 2026 · 8 points
- Homebrew/homebrew-core“go 1.27.0, go@1.26 1.26.7 (new formula)”GitHub · Jun 19, 2026 · 2 reactions
- goplus/llcppg“Proposal: support C/C++ Bit-fields”GitHub · Sep 21, 2026 · 1 reactions
- @golangoss.bsky.social“xgo by @xgodev (⭐️ 9439) XGo is a programming language that reads like plain English. But it's also …”Bluesky · Jul 3, 2026 · 1 likes
- goplus/spx“feat: expose warp function metadata”GitHub · Jun 23, 2026 · 1 reactions
The biggest 5 of 27 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 27
Talked about on GitHub, Hacker News, Bluesky and the web (27 times).
On GitHub · 24
- Jun 19, 2026go 1.27.0, go@1.26 1.26.7 (new formula) — Homebrew/homebrew-core2 reactions · 7 comments
- Sep 21, 2026Proposal: support C/C++ Bit-fields — goplus/llcppg1 reaction · 5 comments
- Jun 23, 2026feat: expose warp function metadata — goplus/spx1 reaction
- Jun 21, 2026matchFuncCall: fix bigint(uint64) to untyped int — goplus/gogen1 reaction · 1 comment
- Jun 18, 2026implement Type as Arguments for reflect.Type parameters — goplus/gogen1 reaction · 1 comment
19 more on GitHub
- Apr 17, 2026refactor(spx): remove ixgo-aware codegen path — goplus/spx1 reaction
- Apr 15, 2026chore(deps): upgrade xgo to 1.7.1 — goplus/spx1 reaction
- Apr 13, 2026chore(deps): bump xgo to 1.7.0 — goplus/spx1 reaction
- Mar 31, 2026chore(deps): bump github.com/goplus/xgo from 1.6.6 to 1.6.9 — goplus/ixgo1 reaction · 1 comment
- Mar 5, 2026func SetVarKind/VarKind — goplus/gogen1 reaction · 5 comments
- Mar 3, 2026refactor: upgrade to Go 1.25 and migrate type lookup APIs — goplus/xgolsw1 reaction · 3 comments
- Feb 6, 2026chore(deps): bump github.com/goplus/xgo to v1.6.3-0.20260206050105-ace8415bccc5 — goplus/xgolsw1 reaction · 2 comments
- Feb 4, 2026refactor(ispx): convert from nested module to sub-package — goplus/spx1 reaction · 1 comment
- Feb 4, 2026github.com/goplus/gop => github.com/goplus/xgo — goplus/mod1 reaction · 4 comments
- Oct 13, 2025Bump the "go-modules" group with 1 updates across multiple ecosystems — goplus/xgolsw1 reaction · 1 comment
- Oct 9, 2026Proposal: `llcppg -init` — Add Standard Badges to the `main` Branch README — goplus/llcppg0 reactions · 2 comments
- Sep 12, 2026Proposal: LLAR Formula Sandbox — xgo-dev/llar0 reactions · 1 comment
- Jun 1, 2026Improve editor support for kwargs beyond completion — goplus/builder0 reactions
- Apr 30, 2026Typescript + Go Discussion + Deving . . . — pieroproietti/penguins-eggs0 reactions
- Apr 8, 2026XGo classfile resources — goplus/xgolsw0 reactions · 3 comments
- Mar 13, 2026gogen panic when generating go code — goplus/gogen0 reactions · 2 comments
- Feb 10, 2026Accidental crash when trying to rerun project — goplus/spx0 reactions · 1 comment
- Jan 30, 2026update deps `github.com/goplus/xgo` to `v1.6.3-0.20260130002755-682f8779765e` — goplus/xgolsw0 reactions · 2 comments
- Oct 12, 2025Improve error message for shift operations with invalid operand types — goplus/gogen0 reactions · 2 comments
On Hacker News · 1
- May 21, 2026The XGO Programming Language8 points · 1 comment
On Bluesky · 1
- Jul 3, 2026xgo by @xgodev (⭐️ 9439) XGo is a programming language that reads like plain English. But it's also incredibly powerful — it lets you… — @golangoss.bsky.social1 likes and repost · 1 reply
On the web · 1
- Nov 11, 2023goplus/xgo v1.1.10 on GitHub — google.com
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

