Skip to content

docs: rewrite AGENTS.md with <important if> blocks#165

Merged
tomasz-tomczyk merged 1 commit intomainfrom
improve-claude-md
May 2, 2026
Merged

docs: rewrite AGENTS.md with <important if> blocks#165
tomasz-tomczyk merged 1 commit intomainfrom
improve-claude-md

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Wraps domain-specific guidance (HEEx, LiveView/streams/hooks, Ecto, CSS rules, Req HTTP) in <important if="..."> blocks so each section only competes for attention when its trigger condition matches the current task. Foundational context (project map, key architecture) stays bare. Pattern from the improve-claude-md skill.
  • Reconciled the file with current code while rewriting:
    • Document size limit corrected: 5 MB → 10 MB (@max_total_size in reviews.ex)
    • Identity model: Plugs.Identity no longer exists; identity now flows through Phoenix 1.8 Crit.Accounts.Scope + CritWeb.UserAuth. Updated bullet + plug list, added pointer to lib/crit_web/CLAUDE.md for the scope contract
    • Schemas: corrected Review (review_round, cli_args, dropped non-existent document field) and Comment (scope, author_identity, author_display_name, file_path, quote, external_id)
    • Modules: review_file.exreview_round_snapshot.ex
    • mix precommit: actually runs deps.unlock --unused + sobelow --skip — spelled out
    • Limits: removed fictional 500-comments-per-review limit (no such constant); added real ones (40-char display name, 500-char file path, 64×256-byte CLI args)
    • Routes added: /auth/cli/*, /api/device/*, /api/auth/*, PUT /api/reviews/:token, OPTIONS /api/reviews, /dashboard, /settings, /overview, /health, /integrations/:tool
    • Controllers/LiveViews/modules added: device, device_api, auth_api, oauth controllers; dashboard, settings, overview, tokens LiveViews; accounts/, user.ex, user_api_token.ex, device_code*, statistics, config.ex, sentry_*
    • Stack updated: Phoenix 1.8.5 / LiveView 1.1 / Bandit / Elixir 1.19.5 / OTP 28.1
  • Note about DB_PORT=5433 for local Postgres; CI uses mix coveralls.json.

Review

  • Code review: docs-only change, /crit-review not applicable
  • Independent validator pass: spawned a subagent to verify every claim against the codebase; corrections folded in before commit

Test plan

  • Doc-only change — no test surface
  • Validator confirmed: route table matches router.ex, schemas match comment.ex/review.ex, limits match reviews.ex, CI step list matches .github/workflows/ci.yml, mix precommit alias matches mix.exs

See also: tomasz-tomczyk/crit#431 (sibling rewrite)

🤖 Generated with Claude Code

Use targeted relevance conditions per the improve-claude-md pattern so
domain-specific guidance (HEEx, LiveView, Ecto, CSS rules) only competes
for attention when it actually applies. Foundational context (project
map, key architecture) stays bare.

Also reconciled the file with current code:
- Document size limit corrected: 5 MB → 10 MB (@max_total_size in
  reviews.ex)
- Identity now flows through Phoenix 1.8 Crit.Accounts.Scope +
  CritWeb.UserAuth (Plugs.Identity no longer exists)
- Review/Comment schemas updated to actual fields (review_round,
  cli_args, scope, author_identity, file_path, quote, external_id)
- review_file.ex → review_round_snapshot.ex
- mix precommit actually runs deps.unlock --unused + sobelow --skip
- Removed fictional 500-comments-per-review limit; added real ones
  (40-char display name, 500-char file path, 64x256-byte CLI args)
- Added missing routes (/auth/cli/*, /api/device/*, /api/auth/*,
  PUT /api/reviews/:token, /dashboard, /settings, /overview, /health),
  controllers, LiveViews, and OAuth/device-flow modules
- Stack updated to Phoenix 1.8.5 / LiveView 1.1 / Bandit /
  Elixir 1.19.5 / OTP 28.1

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.28%. Comparing base (d9f0b2c) to head (afcfdda).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   77.28%   77.28%           
=======================================
  Files          55       55           
  Lines        1651     1651           
=======================================
  Hits         1276     1276           
  Misses        375      375           
Flag Coverage Δ
unit 77.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit 0b9495f into main May 2, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the improve-claude-md branch May 2, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant