Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .cursorrules

This file was deleted.

18 changes: 0 additions & 18 deletions .gemini/context.md

This file was deleted.

18 changes: 0 additions & 18 deletions .github/copilot-instructions.md

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: architecture
description: Verify architectural consistency and dependency rules in EagleEye
trigger: when the user asks about architecture, rules, conventions, or what is/isn't allowed in the codebase
description: Verify architectural consistency and dependency rules in EagleEye. Use when the user asks about architecture, rules, conventions, or what is/isn't allowed in the codebase.
---

# EagleEye — Architectural Rules & Conventions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: documentation-review
description: Validate EagleEye documentation matches actual implementation
trigger: when the user asks to review documentation, check for outdated docs, or verify docs match code
description: Validate EagleEye documentation matches actual implementation. Use when the user asks to review documentation, check for outdated docs, or verify docs match code.
---

# Documentation Review for EagleEye
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: generate-tests
description: Generate tests following project conventions
trigger: when the user asks to write tests, review test files, or generate new test cases
description: Generate tests following project conventions. Use when the user asks to write tests, review test files, or generate new test cases.
---

# Generate Tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: minimum-requirements
description: Determine minimum requirements to consume the EagleEye library
trigger: when the user asks about minimum SDK version, requirements, or compatible Dart versions
description: Determine minimum requirements to consume the EagleEye library. Use when the user asks about minimum SDK version, requirements, or compatible Dart versions.
---

# Minimum Requirements for EagleEye
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: review-pr
description: Review an EagleEye pull request checking architecture, tests, docs, and completeness
trigger: when the user asks to review a PR, check a pull request, or validate changes
description: Review an EagleEye pull request checking architecture, tests, docs, and completeness. Use when the user asks to review a PR, check a pull request, or validate changes.
---

# EagleEye PR Review Checklist
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: run-build
description: Run the EagleEye build and tests
trigger: when the user asks to build, compile, run tests, or validate the project
description: Run the EagleEye build and tests. Use when the user asks to build, compile, run tests, or validate the project.
---

# Running the EagleEye Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: testing
description: Generate tests for EagleEye following project conventions
trigger: when the user asks to write tests, review test files, or generate new test cases
description: Generate tests for EagleEye following project conventions. Use when the user asks to write tests, review test files, or generate new test cases.
---

# Testing in EagleEye
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: trigger-release
description: Automate the EagleEye release process — update changelog, bump version, tag, and push
trigger: when the user asks to trigger a release, cut a release, or release a new version
description: Automate the EagleEye release process — update changelog, bump version, tag, and push. Use when the user asks to trigger a release, cut a release, or release a new version.
---

# Trigger Release
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: validate-architecture
description: Verify architectural consistency and dependency rules
trigger: when the user asks about architecture, rules, conventions, or dependency validation
description: Verify architectural consistency and dependency rules. Use when the user asks about architecture, rules, conventions, or dependency validation.
---

# Validate Architecture
Expand Down
120 changes: 54 additions & 66 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,73 @@
# EagleEye

## Project Overview
Dart CLI that detects architecture violations in Dart projects by scanning
`lib/` imports against rules in `eagle_eye_config.json`.
Docs: https://codandotv.github.io/eagle-eye/ · Package: `eagle_eye` on pub.dev.

EagleEye is a Dart CLI tool for detecting architecture violations in Dart projects. It analyzes Dart project files against configurable architectural rules to enforce dependency boundaries and layering.
## Commands

- **Library type:** Dart Package (CLI tool)
- **Primary language:** Dart ^3.8.0
- **Runtime/platform:** Dart CLI
- **Repository:** https://github.com/CodandoTV/eagle-eye
- **Documentation:** https://codandotv.github.io/eagle-eye/
Always run from the repo root.

## Build System
```bash
dart pub get # install deps
dart analyze # static analysis (fails build on lint errors)
dart test # run all tests
dart test test/model/eagle_eye_config_item_test.dart # single file
dart test -n "returns null" # single test by name
dart run eagle_eye:main # run the CLI against the current project
```

- **Dart SDK constraint:** ^3.8.0 (defined in `pubspec.yaml:7`)
- **Dependencies defined in:** `pubspec.yaml`
- **Build and release commands:**
- `dart pub get` — Install dependencies
- `dart analyze` — Static analysis
- `dart test` — Run tests
- `dart run eagle_eye:main` — Run the CLI tool locally
- `dart pub publish` — Publish to pub.dev
CI (`pr.yml`) runs `dart test` then `dart analyze` on PRs to `main`; both must
pass. Run `dart analyze && dart test` after any change before calling it done.

## Project Structure
## Linting is strict — most common agent mistake

```
bin/
main.dart — CLI entry point
lib/
analyzer/ — Core analysis engine
checker/ — Rule checkers
data/ — Data access layer
model/ — Domain models
exceptions/ — Custom exceptions
util/ — Utilities
test/
analyzer/ — Analyzer tests
checker/ — Rule checker tests
model/ — Model tests
doc/ — MkDocs documentation source
index.md — Documentation home
img/ — Documentation images
example/
README.md — Example usage guide
```
`analysis_options.yaml` includes `flutter_lints` and escalates the following to
**errors** (not warnings), so `dart analyze` fails on any of them:

## Version Management
- `public_member_api_docs` — every public member in `lib/` needs a `///` doc comment
- `lines_longer_than_80_chars`
- `prefer_single_quotes`
- `always_use_package_imports` — no relative imports inside `lib/`
- `directives_ordering`
- `always_declare_return_types`, `prefer_final_fields`, `prefer_const_constructors`
- `annotate_overrides`, `curly_braces_in_flow_control_structures`, `file_names`
- `avoid_print`, `avoid_relative_lib_imports`, `avoid_multiple_declarations_per_line`

- **Version:** Defined in `pubspec.yaml` under the `version` field
- Current version: `2.0.2`
## Architecture

## Documentation
Public entry point is `lib/eagle_eye_launcher.dart`
(`EagleEyeLauncher().launchEagleEye()`); `bin/main.dart` only calls it.

- **Generator:** Zensical
- **Configuration:** `mkdocs.yml`
- **Source directory:** `doc/`
- **Theme:** Material for MkDocs (via Zensical)
- **Live site:** https://codandotv.github.io/eagle-eye/
Layer rules (enforced by convention, checked in `.opencode/module-graph.md`):

## Distribution
- `lib/model/` — zero internal deps
- `lib/util/` — zero internal deps
- `lib/data/` — may depend on `model/`
- `lib/analyzer/` + `lib/analyzer/checker/` — may depend on `model/`, `data/`, `util/`
- no cycles; `bin/` must only touch the public entry point

- **pub.dev package URL:** https://pub.dev/packages/eagle_eye
- **Package name:** `eagle_eye`
## Runtime behavior

## Git Workflow
`launchEagleEye()` reads `eagle_eye_config.json` from the project root, gets the
app name from `pubspec.yaml`, scans `lib/`, and `exit(1)` on violations or
missing config/app name. Config is a JSON array of items with keys:
`filePattern`, `name`, `dependenciesAllowed`, `forbiddenDependencies`,
`exclusiveDependencies` (these were renamed in 2.0.0).

- **Default branch:** `main`
- **Release process:**
1. Update version in `pubspec.yaml`
2. Update `CHANGELOG.md`
3. Commit changes
4. Tag with `vX.Y.Z`
5. Push commits and tags
6. Publish to pub.dev (`dart pub publish`)
- **Git tag strategy:** `vX.Y.Z` (e.g., `v2.0.2`)
- **Versioning strategy:** Semantic Versioning (SemVer)
## Version & release

## Available Skills
- Version lives in `pubspec.yaml` (currently `2.0.4`) and `CHANGELOG.md`.
- Release = bump version + changelog, commit, tag `vX.Y.Z`, push. The tag
triggers `publish.yml` (pub.dev via OIDC). Use the `trigger-release` skill.

Before starting any task:
1. List all directories in `ai/skills/`
2. Identify which one covers the current task
3. Read that file in full before proceeding
## AI context

Each skill file is a self-contained guide. Never skip this step — the skill may contain patterns, checklists, or constraints that are not obvious from the code alone.
- `AGENTS.md` is the single source of truth; opencode loads it via
`opencode.json`.
- Skills live in `.opencode/skills/` and are auto-loaded by opencode's native
skill scan. Before a task, check for a matching skill (e.g. `testing`,
`review-pr`, `trigger-release`, `architecture`) and read it in full.
- Warning: `.opencode/instructions/dart.md` references class/file paths that no
longer exist (e.g. `lib/analyzer/analyzer.dart`, `checker/checker.dart`).
Trust the actual `lib/` tree over it.
5 changes: 0 additions & 5 deletions CLAUDE.md

This file was deleted.

69 changes: 0 additions & 69 deletions README-AI-CONTEXT.md

This file was deleted.

2 changes: 1 addition & 1 deletion SETUP_PROMPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Create the file at the **project root** (same directory as `pubspec.yaml`). The
| `filePattern` | string | Wildcard pattern matching file paths. `*` becomes `.*` regex. |
| `dependenciesAllowed` | boolean | If `false`, matched files must have **zero** internal imports. |
| `forbiddenDependencies` | string[] | Matched files **must not** import anything matching these patterns. |
| `exclusiveDependencies` | string[] | Matched files can **only** import things matching these patterns. |
| `exclusiveDependencies` | string[] | Matched files can **only** import things matching **any** of these patterns (or nothing at all). |
| `name` | string | Optional human-readable name (shown in violation output). |

### Architecture-specific rule templates
Expand Down
2 changes: 1 addition & 1 deletion doc/1-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Create this file at the **project root** (same directory as `pubspec.yaml`). It
| `filePattern` | string | Wildcard pattern matching file paths. `*` becomes `.*` regex. |
| `dependenciesAllowed` | boolean | If `false`, matched files must have **zero** internal imports. |
| `forbiddenDependencies` | string[] | Matched files **must not** import anything matching these patterns. |
| `exclusiveDependencies` | string[] | Matched files can **only** import things matching these patterns. |
| `exclusiveDependencies` | string[] | Matched files can **only** import things matching **any** of these patterns (or nothing at all). |
| `name` | string | Optional human-readable name (shown in violation output). |

### Architecture-specific templates
Expand Down
14 changes: 13 additions & 1 deletion doc/2-existing-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In this case, all files that has the suffix `viewmodel.dart` should not depend o
},
```

The `Exclusive Dependencies Rule` specifies that some files should depend only on certain files. For example:
The `Exclusive Dependencies Rule` specifies that some files should depend only on certain files. An import is allowed when it matches **any** of the listed patterns, and a file that imports nothing is also allowed. For example:

```json
// your-project-root/eagle_eye_config.json
Expand All @@ -54,6 +54,18 @@ The `Exclusive Dependencies Rule` specifies that some files should depend only o

In this case, the our repositories should depend only on data sources.

You can also list several allowed patterns:

```json
// your-project-root/eagle_eye_config.json
{
"filePattern": "*screen.dart",
"exclusiveDependencies": ["*_viewmodel.dart", "*_widget.dart"]
},
```

In this case, screens may depend on view models, on widgets, on both, or on nothing — but never on anything else.

## Dependencies Allowed Rule

!!! warning "Deprecated - Only available before v2.0.0"
Expand Down
Loading
Loading