docs(agents): fix factual errors, add mise tasks, improve agent efficiency - #259
Conversation
…UDE.md - AGENTS.md: playwright-setup → setup:playwright (correct task name) - AGENTS.md: fix 'mise run test <file>' → 'mise exec flutter -- flutter test <file>' - AGENTS.md: validate:festivals raw command → ./bin/mise run validate:festivals - AGENTS.md: DrinkSort location beer_provider.dart → lib/domain/models/drink_sort.dart - AGENTS.md: sort step 2 now points to DrinkSortService, not _applyFiltersAndSort - CLAUDE.md: build:web and serve:release in deep links section missing MISE_ENV=dev - CLAUDE.md: domain/ dir tree missing models/ and repositories/ subdirectories - CLAUDE.md: infrastructure services corrected (StorageService, TastingLogService, EnvironmentService) https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
Copilot coding agent now reads AGENTS.md directly, so the mise commands, common workflows, build steps, and raw Flutter command sections were pure duplication that was drifting out of sync. Kept: coding conventions, utils/widget catalogue, JSON parsing patterns, API reference, Playwright limitations, deployment topology, and security. Also fixed: domain/ layer added to project structure, API doc paths (docs/api/ → docs/code/api/), broken bottom doc links removed, GitHub Pages base-href artefact removed, install task reference removed. https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
…md import CLAUDE.md now imports AGENTS.md via @AGENTS.md rather than duplicating the mise commands, environments, task lists, deep links, and validation workflow sections. Retained: architecture, code style, accessibility, model patterns, provider usage, common modifications, API details, and release process. Also fixed during rewrite: domain/ structure complete, service list accurate, sort option instructions point to correct files. https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
… @AGENTS.md Architecture, directory structure, accessibility requirements, JSON parsing patterns, provider usage, and release process all moved from CLAUDE.md into AGENTS.md — useful to any coding agent, not Claude-specific. CLAUDE.md is now a single line: @AGENTS.md AGENTS.md additions: - Full directory structure with domain/ layer - Layered architecture description (domain, state, infrastructure, data) - Accessibility requirements with code examples - JSON parsing pattern for type-variant API fields - Provider usage examples and key methods - Release process (CalVer + tag workflow) - analysis_options.yaml added to Do Not Modify https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
- Move Project Context + Architecture + Directory Structure to the top - Collapse Quick Start + Task Discovery Guide into one Commands section - Remove duplicate ./bin/mise tasks ls commands - Remove "Helpful Tips" (all points covered in detail elsewhere) - Remove "Before Making Changes" as standalone section (folded into Making Changes) - Collapse "Adding a New Drink Category Filter" to a one-line note - Fix raw flutter test --update-goldens → ./bin/mise exec flutter -- flutter test - Consolidate Testing sections (Best Practices + Guidelines + Coverage) - Merge Definition of Done, Error Handling, Abstraction, Documentation into Engineering Standards - 927 lines → 496 lines https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
- check: pre-commit gate running generate → analyze + test in one command - goldens:update: wraps --update-goldens with optional file argument - test: 180s timeout to prevent hanging test suites - AGENTS.md: reference check as canonical pre-commit command, goldens:update replaces raw flutter test --update-goldens invocation https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
- test: output saved to $TEST_LOG (mktemp default, caller-injectable) - analyze: output saved to $ANALYZE_LOG (same pattern) - Path printed before the run so agents have it even if the run crashes - Grep hint printed after the run for convenience - Remove timeout=180 from test task - AGENTS.md: drop manual redirect instructions, note TEST_LOG session pinning https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
810c955 to
fd7d2ea
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to correct and streamline agent/developer documentation (AGENTS.md / Copilot instructions / Claude guidance) and update local task-running guidance around mise.
Changes:
- Reworks
AGENTS.mdinto a more structured, architecture-first guide and updates task references (including newcheck/goldens:updatetasks). - Updates
mise.tomltasks to capturetest/analyzeoutput to log files and adds new convenience tasks (check,goldens:update). - Simplifies
CLAUDE.mdand trims/updates.github/copilot-instructions.mdto reduce duplication and point to AGENTS.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| mise.toml | Updates task behavior (log capture) and adds new tasks (check, goldens:update). |
| AGENTS.md | Major rewrite: architecture overview, updated mise command guidance, testing/accessibility sections. |
| CLAUDE.md | Replaced full content with a single @AGENTS.md reference. |
| .github/copilot-instructions.md | Condensed Copilot guidance; updated project structure and references. |
| echo "TEST_LOG=$TEST_LOG" | ||
| flutter test 2>&1 | tee "$TEST_LOG" | ||
| echo "---" | ||
| echo "Grep with: grep -n 'FAILED\|ERROR' $TEST_LOG" |
| echo "ANALYZE_LOG=$ANALYZE_LOG" | ||
| flutter analyze --no-fatal-infos 2>&1 | tee "$ANALYZE_LOG" | ||
| echo "---" | ||
| echo "Grep with: grep -n 'error\|warning' $ANALYZE_LOG" |
| | **Pre-commit gate** | `./bin/mise run check` | **Run before every commit** | | ||
| | Generate code (mocks) | `./bin/mise run generate` | After model changes | | ||
| | Analyze code | `./bin/mise run analyze` | generate → analyze | | ||
| | Run tests | `./bin/mise run test` | generate → test | | ||
| | Run tests with coverage | `./bin/mise run coverage` | Includes code generation | | ||
| | Run dev server | `MISE_ENV=dev ./bin/mise run dev` | | |
| ```bash | ||
| # Run all tests (can be slow) | ||
| # Pin a path for the whole session so output accumulates in one known place | ||
| export TEST_LOG=/tmp/my-session-test.log | ||
| ./bin/mise run test | ||
|
|
||
| # Run specific test file | ||
| ./bin/mise run test test/style_screen_test.dart | ||
|
|
||
| # Run tests with output to file for analysis | ||
| ./bin/mise run test > /tmp/test_output.txt 2>&1 | ||
| cat /tmp/test_output.txt | grep -E "(passed|failed)" | tail -10 | ||
|
|
||
| # Run with timeout to prevent hanging | ||
| timeout 180 ./bin/mise run test | ||
| # Run a specific test file | ||
| ./bin/mise exec flutter -- flutter test test/my_test.dart |
| **Infrastructure** (`lib/services/`): | ||
| - `BeerApiService` — HTTP API calls | ||
| - `FestivalService` — festival metadata | ||
| - `StorageService` — SharedPreferences; contains `FavoritesService`, `RatingsService`, `FestivalStorageService` |
| - Cloudflare Worker (`cloudflare-worker/`) | ||
| - Package versions in `pubspec.yaml` | ||
| - Analysis rules in `analysis_options.yaml` | ||
| @AGENTS.md |
There was a problem hiding this comment.
This is intentional — @AGENTS.md is Claude Code's memory file import syntax (documented at https://code.claude.com/docs/en/memory). When Claude reads CLAUDE.md, it automatically loads the referenced file into context. It's not standard Markdown, but CLAUDE.md is a Claude Code config file, not a documentation file for human readers. The effect is that agents get the full AGENTS.md content without duplication.
Generated by Claude Code
| - Store error messages in provider state | ||
| - Display user-friendly error messages in UI | ||
| - Provide retry functionality for failed operations | ||
| Every interactive element needs a `Semantics` wrapper with a `label`. See [`docs/code/accessibility.md`](../docs/code/accessibility.md) and `CLAUDE.md` for full requirements and examples. |
| [tasks.test] | ||
| description = "Run all Flutter tests" | ||
| description = "Run all Flutter tests (output saved to $TEST_LOG, or set TEST_LOG to reuse a path)" | ||
| depends = ['generate'] | ||
| run = 'flutter test' | ||
| run = ''' | ||
| TEST_LOG="${TEST_LOG:-$(mktemp /tmp/test-XXXXXX.log)}" | ||
| echo "TEST_LOG=$TEST_LOG" | ||
| flutter test 2>&1 | tee "$TEST_LOG" | ||
| echo "---" | ||
| echo "Grep with: grep -n 'FAILED\|ERROR' $TEST_LOG" | ||
| ''' | ||
|
|
||
| [tasks.check] | ||
| description = "Pre-commit gate: generate → analyze + test (run before every commit)" | ||
| depends = ['analyze', 'test'] | ||
| run = 'echo "All checks passed"' | ||
|
|
||
| [tasks."goldens:update"] | ||
| description = "Regenerate golden screenshot files (omit file arg to update all)" | ||
| depends = ['generate'] | ||
| usage = 'arg "[file]" help="Specific test file to update"' | ||
| run = 'flutter test --update-goldens ${usage_file:-}' |
| - Search and filter by category, name, brewery, or style | ||
| - Save favorites and rate drinks | ||
| - View brewery details | ||
| **Linter rules enforced**: `prefer_const_constructors`, `prefer_final_locals`, `prefer_final_fields`, `avoid_print`, `prefer_single_quotes`, `sort_child_properties_last`, `use_key_in_widget_constructors`. |
- Add goldens:update to Common Tasks table - Move 'run check' note to top of Git Commit section (not after PR title examples) - Replace hardcoded /tmp/ example path with $TMPDIR/cbf-test.log https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Add set -o pipefail + exit code capture to test and analyze tasks so pipe through tee doesn't mask flutter test/analyze exit codes - Fix StorageService docs: there is no StorageService class; the actual classes are FavoritesService, RatingsService, FestivalStorageService - Add prefer_const_declarations to linter rules list (was missing) - Reword list as "among others" to avoid implying exhaustiveness - Fix copilot-instructions.md accessibility reference: CLAUDE.md → AGENTS.md (CLAUDE.md is now just an @AGENTS.md import) https://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://claude-review-agents-claude.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
Summary
mise tasks ls, Engineering Standards moved to end. Down from ~927 to ~510 lines.@AGENTS.md(Claude Code memory import syntax — loads AGENTS.md into context automatically).github/copilot-instructions.mdtrimmed: removed duplicated mise commands/workflows (Copilot now reads AGENTS.md directly per Aug 2025 changelog); kept coding conventions, utils/widget catalogue, JSON patternsmise.toml changes (behaviour)
checktask: pre-commit gate running generate → analyze + testgoldens:updatetask: regenerate golden screenshots (optional file arg)testandanalyzetasks: save output to temp file viatee, print path before run and grep hint after, preserve exit codes viaset -o pipefail+ explicitexit $EXIT_CODEFactual fixes
StorageService→ actual class names (FavoritesService,RatingsService,FestivalStorageService)prefer_const_declarations, reword as "among others"CLAUDE.md→AGENTS.mdhttps://claude.ai/code/session_015rZFtTwYwLn5Z8zQrk4sgM