docs: add CLAUDE.md and Agents.md for AI coding assistant guidance#5437
docs: add CLAUDE.md and Agents.md for AI coding assistant guidance#5437akrem-chabchoub wants to merge 8 commits intomasterfrom
Conversation
Made-with: Cursor
| - `bee start` — full or light node (`cmd/bee/cmd/start.go`) | ||
| - `bee init` — initialize data directory | ||
| - `bee deploy` — deploy smart contracts | ||
| - `bee db` — database management |
There was a problem hiding this comment.
Should we go even deeper with db repair and db nuke?
There was a problem hiding this comment.
gacevicljubisa
left a comment
There was a problem hiding this comment.
Claude Code should read AGENTS.md as fallback. So, no need to have both.
I would focsu on the code Guidelines like:
- adding refs to CODING.md, CODINGSTYLE.md, CONTRIBUTING.md
- minimal, focused changes
- do not add, remove, or update dependencies
- error handling
- testing
- loging
Regarding make targets, I would include only necesary during dev proces.
There is no need to start actual bee node using agents.
Additionally commit msg format can be included.
Maybe this can serve as example https://github.com/ethereum/go-ethereum/blob/master/AGENTS.md wit
It is already there
I will add it
Maybe we can say unless I explicitly mention ?
I will remove unnecessary ones and add commits msg format. Thanks ! |
gacevicljubisa
left a comment
There was a problem hiding this comment.
Also, maybe it would be good to add CLAUDE.md with short disclosure that instructions are in AGENT.md?
| ## Directory structure (high level) | ||
|
|
||
| ``` | ||
| cmd/bee/ CLI and Cobra commands | ||
| openapi/ OpenAPI specs (Swarm.yaml, SwarmCommon.yaml) | ||
| packaging/ deb, rpm, homebrew, scoop, docker, systemd | ||
| pkg/ | ||
| api/ HTTP API | ||
| node/ composition root | ||
| swarm/ Address, Chunk, core constants | ||
| p2p/ libp2p transport | ||
| topology/ Kademlia | ||
| storage/ storage interfaces | ||
| storer/ local storer implementation | ||
| sharky/ blob slots | ||
| postage/ stamps and batches | ||
| storageincentives/ redistribution | ||
| pushsync/ pullsync/ retrieval/ pingpong/ hive/ pricing/ # protocols | ||
| feeds/ pss/ soc/ cac/ bmt/ manifest/ accesscontrol/ redundancy/ replicas/ | ||
| settlement/ accounting/ crypto/ keystore/ log/ metrics/ tracing/ | ||
| ... ~60 packages total | ||
| ``` |
There was a problem hiding this comment.
There is no actual value from this incompleted list. I would remove ti
| - Goroutines must be stoppable (context cancel, quit channel, etc.). | ||
| - Full node vs light node: reserve and storage incentives are full-node concerns. | ||
| - Postage batches can be unusable (expired, depleted, unsynced); check before relying on stamps. | ||
| - `*.pb.go` files are committed; regenerate with `make protobuf` after `.proto` changes. |
There was a problem hiding this comment.
*.pb.gois generated; do not edit by hand. Regenerate withmake protobufafter.protochanges.
| ### Linting | ||
|
|
||
| `golangci-lint` v2 per `.golangci.yml`. Notable: `goheader`, `paralleltest`, `misspell`, `errorlint`, `gochecknoinits`, `prealloc`, `forbidigo` (no `fmt.Print` except under `cmd/bee/cmd/`), `govet` with `enable-all` (minus `fieldalignment`, `shadow`). Run `make lint` and `make format`. | ||
|
|
There was a problem hiding this comment.
For lint section it is enough to have:
- Linting: `golangci-lint` v2 per `.golangci.yml`. Run `make lint`.
|
|
||
| Codex users: see [Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md/) for how global and project instructions merge and for the default combined size limit (`project_doc_max_bytes`, often 32 KiB). | ||
|
|
||
| This repo also has **`CLAUDE.md`**, tuned for **Claude Code** (shorter session prompt, `@` imports, `.claude/rules/`). Keep factual content aligned when you change workflows or versions. |
|
|
||
| 1. **Formatting** — `make format` (gofumpt + gci; see `CODING.md`). | ||
| 2. **Compile** — `make build` (all packages) and, when you need the binary artifact, `make binary` (`dist/bee`, `CGO_ENABLED=0`). | ||
| 3. **Tests** — `make test` (unit tests, `-failfast`). Use `make test-race` when concurrency is central to the change. Use `make test-integration` only when you touch integration-tagged code. |
There was a problem hiding this comment.
Maybe to add here single package testing to not test everytime all of the unit tests. Something like:
3. **Tests** — `make test` (unit tests, `-failfast`). For a single package use `go test ./pkg/<name>/...`. Use `make test-race` when concurrency is central to the change. Use `make test-integration` only when you touch integration-tagged code.

Checklist
Description
Add
Agents.mdandCLAUDE.mdto help ai agents understood better the codeOpen API Spec Version Changes (if applicable)
Motivation and Context (Optional)
Related Issue (Optional)
#5407
Screenshots (if appropriate):
AI Disclosure