this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

CLAUDE.md: use cueckoo guidance as a base

Project-specific guidance is then spelt out in the rest of the file.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I53b611399d8fe1b5e58c5ef438f8164fe962e7a7
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1235759
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+31 -48
+31 -48
CLAUDE.md
··· 1 - # CLAUDE.md 1 + # CUE 2 2 3 - This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. 3 + ## Common guidance 4 4 5 - ## Project Overview 5 + Use the cueckoo MCP server's `guidance` tool to get the latest common 6 + guidance for CUE project repos. The server is registered as the 7 + `cueckoo` MCP server (via `cueckoo mcp`). Follow all instructions 8 + returned by the `guidance` tool. See https://github.com/cue-lang/contrib-tools 9 + for more information on `cueckoo` and related tooling. 6 10 7 - This is the CUE language repository. CUE (Configure, Unify, Execute) is a general-purpose, strongly typed constraint-based language for data templating, validation, code generation, and scripting. 11 + ## Project-specific instructions 8 12 9 - ## Common Development Commands 13 + This is the CUE language repository. CUE (Configure, Unify, Execute) is a 14 + general-purpose, strongly typed constraint-based language for data 15 + templating, validation, code generation, and scripting. 16 + 17 + Module: `cuelang.org/go`. Requires Go 1.25 or later. 10 18 11 - ### Running the "cue" command 19 + ### Common development commands 20 + 21 + #### Running the "cue" command 12 22 13 23 ```bash 14 24 # Build and run ./cmd/cue via a cached binary 15 25 go tool cue 16 26 17 - # Or build and install it in $PATH. 27 + # Or build and install it in $PATH 18 28 go install ./cmd/cue 19 29 ``` 20 30 21 - ### Testing 31 + #### Testing 22 32 23 33 ```bash 24 - # Run all tests 25 - # Any change to the repo should run all tests to ensure correctness. 34 + # Run all tests. Any change to the repo should run all tests to ensure correctness. 26 35 go test ./... 27 36 28 37 # Run tests for a specific package ··· 41 50 go test -race ./... 42 51 ``` 43 52 44 - ### Code Quality 53 + #### Code quality 45 54 46 55 ```bash 47 - # Run go vet (catches common mistakes) 48 56 go vet ./... 49 - 50 - # Run staticcheck (more comprehensive static analysis) 51 57 go tool -modfile=internal/tools.mod staticcheck ./... 52 - 53 - # Format code (CUE uses standard Go formatting) 54 58 go fmt ./... 55 59 ``` 56 60 57 - ## Code Architecture 61 + ### Code architecture 58 62 59 - ### Core Language Implementation 63 + #### Core language implementation 60 64 - `/cue/` - Core CUE language implementation 61 65 - `ast/` - Abstract Syntax Tree 62 66 - `parser/` - Language parser ··· 68 72 - `dep/` - Dependency analysis 69 73 - `export/` - Export functionality 70 74 71 - ### Command-Line Tool 75 + #### Command-line tool 72 76 - `/cmd/cue/` - CLI implementation for all CUE commands (eval, export, import, fmt, vet, mod, etc.) 73 77 74 - ### Standard Library 78 + #### Standard library 75 79 - `/pkg/` - Built-in packages (crypto, encoding, math, net, path, strings, etc.) 76 80 77 - ### Format Support 81 + #### Format support 78 82 - `/encoding/` - Encoders/decoders for JSON, YAML, TOML, Protobuf, OpenAPI, JSON Schema 79 83 80 - ### Testing Infrastructure 81 - - **Test Format**: Uses `.txtar` (text archive) files containing input files and expected outputs 82 - - **Test Organization**: Unit tests alongside code (`*_test.go`), integration tests in `testdata/` directories 83 - - **Testscript Framework**: Command-line integration tests in `/cmd/cue/cmd/testdata/script/` 84 + #### Testing infrastructure 85 + - **Test format**: Uses `.txtar` (text archive) files containing input files and expected outputs 86 + - **Test organization**: Unit tests alongside code (`*_test.go`), integration tests in `testdata/` directories 87 + - **Testscript framework**: Command-line integration tests in `/cmd/cue/cmd/testdata/script/` 84 88 85 - ## Key Development Patterns 86 - 87 - ### Working with Tests 89 + ### Working with tests 88 90 - Tests use the `.txtar` format which contains both input and expected output in a single file 89 91 - Use `TestX` functions in test files for debugging individual test cases 90 92 - The `CUE_UPDATE=1` environment variable updates golden files with actual output ··· 186 188 y: x @test(eq, {a: 1, b: 1}) @test(shareID=xy) 187 189 ``` 188 190 189 - ### Contribution Model 190 - - Single commit per PR/CL model 191 - - Uses `git codereview` workflow for managing changes 192 - - Runs `cueckoo runtrybot [CL|commit]` to kick off CI testing. 193 - - Requires DCO (Developer Certificate of Origin) sign-off 194 - - Both GitHub PRs and GerritHub CLs are supported 195 - - Changes should be linked to a GitHub issue (except trivial changes) 196 - 197 - ### Module Information 198 - - Module: `cuelang.org/go` 199 - - Requires Go 1.25 or later 200 - - Uses Go modules for dependency management 201 - 202 - ### Important Conventions 203 - - Don't update copyright years in existing files 204 - - Follow existing code style and patterns in the package you're modifying 205 - - Check neighboring files for framework choices and conventions 206 - - Use existing libraries and utilities rather than assuming new dependencies 207 - 208 - ## Rules to follow 191 + ### Rules to follow 209 192 210 193 These rules MUST be followed at all times: 211 194 - Do not use commands like `cat` to read or write files; read and write files directly