mirror of
https://github.com/AventurasTeam/Aventuras.git
synced 2026-12-04 04:03:32 +00:00
This swaps CLAUDE.md and the hand-written docs index for a small decision-record setup, and adds a script that checks the docs so they stop drifting from the code. ## What changes CLAUDE.md is gone. AGENTS.md replaces it as the one instruction file for people and coding agents alike. It has the commands, the rules for every change, the area-doc table, and how to record a decision. (Claude Code only reads AGENTS.md when there's no CLAUDE.md, so it's deleted rather than kept around as an import.) If you use Claude Code, check one thing. It only reads AGENTS.md on version 2.1.277 or later, and only when there's no `CLAUDE.md`, `.claude/CLAUDE.md` or `CLAUDE.local.md` in the repo or any directory above it. If you keep one of those, set **Project instructions** to `claude-md-and-agents-md` in `/config` to load both. Your `~/.claude/CLAUDE.md` doesn't count, so it's fine. Decisions now live in `docs/decisions/`, one file each, named `YYYY-MM-DD-slug.md`. There's one so far, the record system itself. It sets the bar for when a choice gets an ADR at all: intent the code can't express that spans more than one site or won't fit in a short comment. Anything smaller stays a comment, and refining a decision amends its ADR instead of adding a new one. Only tagged decisions are listed in `docs/README.md`, so the index grows with the decisions that span areas, not with every local choice. The code leads to the local ones, either through an `ADR(slug)` comment at a single site or through `scope`, which lists the directories an ADR governs. For each scoped directory, `npm run docs:gen` writes the ADRs' summaries into a generated block in that directory's `AGENTS.md`, which Claude Code loads when it reads a file there or below. Any hand-written text in that file is left alone. `docs/README.md`, the cross-cutting block in AGENTS.md and the scoped blocks are all generated, so don't edit those by hand. Once an ADR merges, its summary is the ruling and can't change. The rest of the record can still be refined while the summary holds. Changing the ruling means superseding the ADR. Raw material (logs, benchmarks, probe output) goes in `docs/evidence/`, and an ADR has to link it. A new `.ignore` lists the folder so a keyword search over the whole repository skips it, while a search aimed at the folder still finds it. Agents reach evidence through the ADR's link. Two evidence docs record how that was tested: which tools load a nested AGENTS.md (only the Read tool does), and why no hook or instruction file guards the folder. `npm run docs:check` (`scripts/docs-check.ts`) checks: - the decision files and the generated output - `ADR(slug)` comments and scopes - `docs/` paths named in source - relative links in Markdown - that evidence files are linked from a decision It also fails if a merged ADR's summary changed or its slug disappeared, comparing against the merge-base with `origin/master`. `--base <ref>` picks another ref, and a ref git can't resolve is an error. The default `origin/master` only warns when it's missing, so a clone without that remote can still run the check. (`master` has no decisions yet, so there's nothing to compare until this merges.) An active ADR with no tag, no scope and no anchor draws a warning, since nothing would lead a reader to it. Cross-cutting ADRs are exempt because AGENTS.md lists them. `npm run docs:gen` writes nothing while an ADR or the tag list is invalid. Otherwise a broken record would quietly drop out of the index and the AGENTS.md blocks. The check runs in pre-push on every push, and with `--strict` in a new Docs check workflow on PRs to master. That workflow fetches the full history so the merge-base exists. The rules that were in CLAUDE.md now have their own files under `docs/development/`, indexed by `docs/development/README.md`. `release.md` and `platform-support.md` are each split into the rules and a separate evidence file. `docs/ARCHITECTURE.md` is a starting map of the code, and `docs/architecture/network-transport.md` is new. Every doc under `docs/architecture/` and `docs/development/` was also checked against the current code and corrected where it had drifted. ## Smaller changes - Markdown under `docs/` is forced to LF (`.gitattributes` and `docs/.editorconfig`). - Git no longer ignores AGENTS.md or `docs/evidence/`, and the ignores for the old root-level doc files now match only at the repo root. - tsconfig and vitest now pick up TypeScript under `scripts/`. - The README points contributors at AGENTS.md and drops the link to the iOS build doc. ## Needs a follow-up `.github/CODEOWNERS` puts `docs/decisions/` under a placeholder team (`@AventurasTeam/TODO-owning-team`). GitHub ignores an owner it can't resolve, so it does nothing until someone fills in the real team. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EzTd9Y26s2eHcacyqFi1QK <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added repository guidance for development rules, required checks, and decision records; updated the README to direct contributors to the relevant guides. * Added checks and generated documentation for decision records, links, evidence references, and summaries. * Added ownership guidance for decision records and standardized Markdown line endings in the documentation directory. * Replaced the previous repository guide with the new contributor guidance. * **Chores** * Documentation checks now run on pull requests and before pushing changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Code style
How new and edited code reads. Which idiom each layer uses is in modern-code.md; comments are in comments.md.
Match the surrounding code
Match its naming, file layout, and how much it explains itself. Where matching it would mean a dated idiom, modern-code.md wins.
Svelte
- Svelte 5 runes only (
$state,$derived,$props), no legacy store syntax in new code. - Logic that needs a test goes in a plain
.tsmodule: a*.svelte.tsmodule cannot be imported by a test (testing.md).
Imports
- Import from
src/libas#lib/…with the real extension:#lib/services/database.ts,#lib/stores/settings.svelte.ts,#lib/components/ui/button/index.ts. Omitting it does not resolve, and there is no$lib.local/lib-import-existsenforces this wherecheckcannot; what TypeScript lets through is in overview.md → Importingsrc/lib. - Import a service through its
index.ts, not its internals.
Defaults
Never write ?? <default> for a value that has a default in ai/core/defaults.ts. The settings
store merges every system-services block over its defaults on load, so the key is always
present, and a fallback at the call site is a second copy of the number that nothing keeps in step
(ai-services.md).