Skip to content

Refactors documentation structure and adds AGENTS.md context index#53

Open
mozammal-hossain wants to merge 3 commits into
momshaddinury:template/layered-clean-architecturefrom
mozammal-hossain:template/layered-clean-architecture
Open

Refactors documentation structure and adds AGENTS.md context index#53
mozammal-hossain wants to merge 3 commits into
momshaddinury:template/layered-clean-architecturefrom
mozammal-hossain:template/layered-clean-architecture

Conversation

@mozammal-hossain

@mozammal-hossain mozammal-hossain commented Jun 25, 2026

Copy link
Copy Markdown

Summary

Replaces monolithic documentation with a modular docs/context/ layout and introduces AGENTS.md as the single entry point for contributors and AI coding agents.

Related Issue

(none)

Changes

  • Adds AGENTS.md — a context index mapping 14 focused topics (architecture, state management, DI, routing, theming, error handling, networking, localization, and more) with repo-specific non-negotiables
  • Adds docs/context/ — 14 single-concern docs aligned with the actual codebase conventions (Riverpod, GoRouter, Result/Failure, theme extensions, etc.)
  • Adds AI tool entry pointsCLAUDE.md, CURSOR.md, GEMINI.md, and PUKU.md that redirect to AGENTS.md
  • Updates README.md — project tree and documentation links now point to AGENTS.md and docs/context/ instead of removed files
  • Removes outdated monolithic docs:
    • docs/architecture.md
    • docs/dependency_injection.md

New context docs (docs/context/)

File Topic
architecture.md Layers and dependency direction
project-structure.md Directory layout
codegen.md build_runner and gen-l10n
state-management.md Riverpod (not Bloc)
dependency-injection.md Riverpod providers (not get_it)
routing.md GoRouter, named routes
theming.md context.* theme extensions
error-handling.md Result/Failure via asyncGuard
networking.md Retrofit/Dio, dart_mappable
localization.md ARB (en/bn/ar)
naming-conventions.md Naming and lint conventions
adding-a-feature.md Feature addition recipe
dos-and-donts.md Quick reference table
gotchas.md Known pitfalls

Testing

  • Open AGENTS.md and verify all topic links resolve correctly
  • Confirm README.md documentation section links to AGENTS.md and docs/context/
  • Verify removed doc paths (docs/architecture.md, docs/dependency_injection.md) are no longer referenced anywhere in the repo
  • Spot-check context docs against current code conventions (Riverpod, GoRouter, theme extensions)

Summary by CodeRabbit

  • Documentation
    • Added/updated a central project guide (AGENTS.md) covering architecture, structure, state management, routing, theming, networking, localization, error handling, naming, code generation, and usage do’s/don’ts.
    • Introduced a feature checklist and a “known gotchas” page.
    • Added pointers from CLAUDE.md, CURSOR.md, GEMINI.md, and PUKU.md to the central guide.
  • Refactor
    • Consolidated the prior dependency injection and architecture docs into the new context-based documentation structure.
    • Removed outdated duplicate documentation pages.

- Added AGENTS.md as a context index for contributors and AI agents
- Replaced references to deleted architecture and dependency_injection documentation with a new context directory for focused topic docs
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mozammal-hossain, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 28 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a22ac34-5b94-4192-b43b-c1c9d867c746

📥 Commits

Reviewing files that changed from the base of the PR and between e968c3a and 3313657.

📒 Files selected for processing (1)
  • lib/src/presentation/features/authentication/login/view/login_page.dart
📝 Walkthrough

Walkthrough

This PR adds AGENTS.md as the central repository context index, updates root docs and README links to it, and adds docs/context/ pages covering architecture, structure, feature setup, code generation, Riverpod state management, data flow, UI conventions, localization, naming, and gotchas.

Changes

Repository documentation refresh

Layer / File(s) Summary
Central index and pointers
AGENTS.md, README.md, CLAUDE.md, CURSOR.md, GEMINI.md, PUKU.md
AGENTS.md adds the repository map and non-negotiable rules; the root docs and README point readers to it and to docs/context/.
Structure and workflow docs
docs/context/architecture.md, docs/context/project-structure.md, docs/context/adding-a-feature.md, docs/context/codegen.md, docs/context/naming-conventions.md
Architecture, project structure, feature setup, code generation, and naming docs describe the repository layout and authoring workflow.
State, DI, and data flow
docs/context/state-management.md, docs/context/dependency-injection.md, docs/context/error-handling.md, docs/context/networking.md, docs/context/routing.md, docs/context/dos-and-donts.md
State management, dependency injection, error handling, networking, routing, and the quick-reference rules page describe the Riverpod setup and data-handling conventions.
UI tokens and reference notes
docs/context/theming.md, docs/context/localization.md, docs/context/gotchas.md
Theming and localization docs define BuildContext-based UI tokens and localization generation, and the gotchas page lists current repository mismatches.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested reviewers

  • dinurymomshad
  • muhitmahmudbs23

Poem

A bunny hopped through docs at dawn,
With AGENTS leading neatly on.
Riverpod, tokens, and routes in sight,
The little notes all line up right,
🐇📚 and every path feels light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: reorganizing docs and adding AGENTS.md as the context index.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/context/architecture.md`:
- Around line 6-11: The fenced diagram blocks in the architecture docs are
missing a language tag, which triggers markdownlint. Update the relevant fenced
code blocks around the architecture diagram so they use the text language tag,
and apply the same change to the other diagram block referenced in the review;
keep the diagram content unchanged while fixing the fences.
- Around line 3-18: The architecture diagram in the context doc reads in the
wrong direction relative to the inward-dependency rule. Update the diagram near
the Clean Architecture summary so the layer order/arrows in the `Presentation`,
`Domain`, `Data`, and `External` diagram match the textual rules below it,
making it visually clear that dependencies point inward.

In `@docs/context/codegen.md`:
- Around line 24-25: The generated-file list in the codegen workflow docs is
missing the `*.gen.dart` pattern. Update the generated-files section to include
`*.gen.dart` alongside the existing `*.g.dart`, `*.freezed.dart`, and
`*.mapper.dart` entries so the documentation matches the repository’s ignored
generated artifacts.

In `@docs/context/error-handling.md`:
- Around line 33-37: Make the UI-layer projection explicit in the switch that
handles result conversion so it is clear that `Error(:final error)` is being
mapped from a domain failure to a user-facing string, not changing the `Result`
contract. Update the example around the `switch (result)` expression to name
that this is a UI-facing conversion, and keep the mapping logic in the same
`Success`/`Error` handling path so readers can locate the intent immediately.

In `@docs/context/project-structure.md`:
- Around line 3-39: Add a language tag to the fenced tree block in
project-structure.md so markdownlint no longer flags it; update the existing
code fence around the directory tree to use a text fence, keeping the content
unchanged. Locate the fenced block in the project structure doc and adjust only
the fence syntax.

In `@docs/context/state-management.md`:
- Around line 53-55: The snackbar in the AsyncError handling path is displaying
`error.toString()` instead of the user-facing failure text. Update the `case
AsyncError(:final error)` branch to render the `Failure.message` when the error
is a `Failure`, and preserve a sensible fallback for non-Failure errors. Use the
existing `AsyncError` and `Failure` handling in this block to keep the UI
aligned with the error-handling contract.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5b311764-819e-49b8-b335-b4b8e101b7f7

📥 Commits

Reviewing files that changed from the base of the PR and between ce6c92b and f2d23f9.

📒 Files selected for processing (22)
  • AGENTS.md
  • CLAUDE.md
  • CURSOR.md
  • GEMINI.md
  • PUKU.md
  • README.md
  • docs/architecture.md
  • docs/context/adding-a-feature.md
  • docs/context/architecture.md
  • docs/context/codegen.md
  • docs/context/dependency-injection.md
  • docs/context/dos-and-donts.md
  • docs/context/error-handling.md
  • docs/context/gotchas.md
  • docs/context/localization.md
  • docs/context/naming-conventions.md
  • docs/context/networking.md
  • docs/context/project-structure.md
  • docs/context/routing.md
  • docs/context/state-management.md
  • docs/context/theming.md
  • docs/dependency_injection.md
💤 Files with no reviewable changes (2)
  • docs/dependency_injection.md
  • docs/architecture.md

Comment thread docs/context/architecture.md
Comment thread docs/context/architecture.md Outdated
Comment thread docs/context/codegen.md Outdated
Comment thread docs/context/error-handling.md
Comment thread docs/context/project-structure.md Outdated
Comment thread docs/context/state-management.md Outdated
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