44IoT/smart home Flutter project static analysis CLI plugin. NOT an observability SDK or APM tool.
55
66## Architecture
7- - ** Monorepo** : melos, 4 packages + 2 examples
7+ - ** Monorepo** : melos, 1 package + 1 example
88- ** Path A (ACTIVE)** : ` flutterguard_cli ` — all new features
9- - ** Path B (FROZEN )** : ` flutterguard_core ` , ` flutterguard_dio ` , ` flutterguard_flutter ` — bug fixes only
9+ - ** Path B (ARCHIVED )** : ` flutterguard_core ` , ` flutterguard_dio ` , ` flutterguard_flutter ` — in ` archive/ ` for future reference
1010
1111## Package Hierarchy
1212| Package | Status | Depends On | Depended By |
1313| ---------| --------| ------------| -------------|
14- | flutterguard_cli | ACTIVE | core, args, analyzer, glob, path, yaml | — |
15- | flutterguard_core | FROZEN | meta | cli, dio, flutter |
16- | flutterguard_dio | FROZEN | core, dio ^5.7.0 | — |
17- | flutterguard_flutter | FROZEN | core, flutter SDK | — |
14+ | flutterguard_cli | ACTIVE | args, analyzer, glob, path, yaml | — |
1815| scan_demo | — | (none, scan target) | — |
19- | usage_demo | — | core | — |
20-
21- ## Override Chain
22- 1 . ** pubspec_overrides.yaml** — melos auto-managed; 4 packages override ` flutterguard_core ` to local path
23- 2 . ** analysis_options.yaml** — root strict-casts/strict-inference → per-package overrides (cli: +lints/recommended + fixture exclude)
24- 3 . ** flutterguard.yaml** — root default config → user project overrides on scan
2516
2617## Key Commands
2718| Command | Purpose |
2819| ---------| ---------|
29- | ` melos bootstrap ` | Install + generate pubspec_overrides |
30- | ` melos run analyze ` | dart analyze on all packages |
31- | ` melos run format ` | dart format on all packages |
32- | ` melos run test ` | Test all flutterguard_ * packages |
33- | ` melos run test:cli ` | CLI tests only |
20+ | ` dart run melos bootstrap ` | Install workspace dependencies |
21+ | ` dart run melos run analyze ` | dart analyze on all packages |
22+ | ` dart run melos run test:cli ` | CLI tests only |
3423| ` dart run flutterguard scan -p <path> ` | Run scan on a project |
3524
3625## CLI Entry Point
3726` packages/flutterguard_cli/bin/flutterguard.dart `
3827
39- Wired rules (3 ): LargeUnitsRule, LifecycleResourceRule, BoundaryImportRule
28+ Wired rules (5 ): LargeUnitsRule, LifecycleResourceRule, LayerViolationRule, ModuleViolationRule, CircularDependencyRule
4029
4130## Source Layout
4231```
4332packages/flutterguard_cli/lib/src/
44- config_loader.dart # YAML → ScanConfig
33+ config_loader.dart # YAML → ScanConfig (incl architecture.layers/modules)
4534 file_collector.dart # Glob file discovery
46- static_issue.dart # StaticIssue + RiskLevel
47- report_generator.dart # JSON/MD output + score
35+ static_issue.dart # StaticIssue + RiskLevel + IssueDomain + Priority
36+ report_generator.dart # Table + JSON output + score
37+ domain.dart # IssueDomain enum (architecture/performance/standards)
38+ priority.dart # Priority enum (p0/p1/p2)
4839 rules/
4940 large_units.dart # large_file, large_class, large_build_method
5041 lifecycle_resource.dart # lifecycle_resource_not_disposed
51- boundary_import.dart # boundary_import_violation
42+ layer_violation.dart # layer_violation (architecture layer breaches)
43+ module_violation.dart # module_violation (cross-module breaches)
44+ circular_dependency.dart # circular_dependency (file-level cycles)
5245```
5346
5447## Spec
@@ -57,5 +50,7 @@ Single source of truth: `docs/FLUTTERGUARD_SPEC.md` — read before implementing
5750## Maintenance Rules
58511 . New rule: spec entry → config typedef → rule class → fixture → test → wire into bin/flutterguard.dart
59522 . Always run ` melos run analyze ` + ` melos run test:cli ` before committing
60- 3 . Do NOT modify frozen packages (core/dio/flutter) except for critical bug fixes
53+ 3 . Do NOT modify archived packages (core/dio/flutter) — they are frozen references
61544 . Do NOT add Flutter widgets, web/cloud infra, or SaaS SDKs
55+ 5 . Output format defaults to ` table ` . JSON available via ` --format=json `
56+ 6 . Architecture rules require explicit ` architecture.layers ` / ` architecture.modules ` in flutterguard.yaml
0 commit comments