Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add zakariaf/Flutter-Skills --skill project-structure-and-packagesgit clone --depth 1 https://github.com/zakariaf/Flutter-SkillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/zakariaf/flutter-skills/project-structure-and-packages)<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/project-structure-and-packages"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/project-structure-and-packages/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/project-structure-and-packages"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/project-structure-and-packages.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00203 | $0.04104 |
| Opus 5 | $0.00102 | $0.02052 |
| Sonnet 5 | $0.00041 | $0.00821 |
| Haiku 4.5 | $0.00020 | $0.00410 |
Grade A, and why
project-structure-and-packages scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Project structure & packages
The layout is a feedback loop, not decoration: structure exists so that "what imports Flutter?", "what has no test?", and "does this feature reach into another?" are answerable by grep and ls, not by trust. Default to one Flutter package (the app), organised feature-first under lib/features/ over a shared foundation. Reach for a second, pure-Dart package only when a body of logic earns the isolation. A pubspec.yaml is the audit artifact — a package cannot import what it does not declare, so the dependency list is the layer boundary.
This skill OWNS the physical directory tree (D1). Other skills reference it rather than drawing their own.
Read the reference for the task at hand:
references/single-package-layout.md— the default one-package feature-first tree, the shared-foundation folders, placement-by-failure, the deliberately-absent list.references/layering-and-dependencies.md— the downward-only DAG, feature isolation, pubspec-as-audit, the compile-firewall insight.references/workspace-and-packages.md— when (and how) to extract a pure-Dart package: barrel-over-src,resolution: workspace, naming the core generically.
Run scripts/check_structure.sh and scripts/check_import_boundaries.sh before a PR. The purity check auto-detects only pure roots named *_core; a pure package with a plain generic name (money, scheduling) must be passed explicitly, e.g. PURE_DIR=packages/money scripts/check_import_boundaries.sh.
Non-negotiable rules
- Single package by default. A small-to-medium app is one Flutter package; its
pubspec.lockis committed (it is an app, not a library). Do not addpackages/, Melos, or a Dart workspace until a body of pure logic genuinely earns isolation (seereferences/workspace-and-packages.md). Multiplying packages before there is anything to multiply buys nothing and costs days. - Feature-first inside
lib/features/, over a shared foundation. Each screen/surface is a folder underlib/features/<feature>/(presentation/+<feature>_notifier.dart; optionalapplication/,domain/, rarelydata/). The cross-cutting foundation splits by technical role at the top level —core/(pure),data/(repositories + DB),services/(side-effect ports),routing/,theme/,l10n/— because those files serve every feature.main.dartis a thin entry that callsbootstrap();bootstrap.dartis the composition root;app.dartbuildsMaterialApp.router. - No grab-bags, no unnamed nesting. There is no hard depth cap — feature-first naturally nests (
features/orders/presentation/). The rule is that every folder has a named responsibility: noutils//helpers//common//misc/, no grab-bagshared/.core/is the SANCTIONED pure-foundation home, not a junk drawer. - Place a class in the layer whose failure it owns. Talks to the DB →
data/. Talks to a platform channel →services/native/. A pure value type / calculator / the Clock seam →core/(or a feature'sdomain/if truly feature-local). Everything else → the feature that renders it. This is a deterministic rule, not taste. pubspec.yamlis the audit artifact — declare the audit-minimal dependency set. An unused dependency is a review reject: it muddies the claim the manifest makes. The narrowest dep list keeps each layer boundary provable by reading one file.- Dependencies point one way, downward only; features never import features.
features → services/data → core. No lower layer imports an upper one; no shared code imports the composition root. A feature folder NEVER imports another feature folder — share viacore/data/servicesor navigate by route (seenavigation-and-routing). A cycle is a design defect: the analyzer resolves the whole graph in one context, so an upward or cross-feature import is an error, not a runtime surprise. - A pure-Dart core depends on
metaonly — the missing Flutter import is a compile firewall. In-app,lib/core/holds only pure foundation (value objects,Result/Failure, the Clock seam, calculators) and reads no wall clock. Time comes frompackage:clock'sClock(ambientclock, or aClockparam), neverDateTime.now(), never a bespokeClockService— seeservice-boundary-and-native. When such logic is extracted to a package, the empty-of-Flutter manifest makes a strayWidgetorDateTime.now()a build error. - One public barrel over a private
lib/src/— for PACKAGES only. A shared package exposes exactly one librarylib/<package>.dartthat exports the stable surface; everything else lives underlib/src/, which no other package may import. The app package uses neither barrels norlib/src/: it has no external importers, and barrels add analyzer cost plus circular-import risk for zero benefit. - No junk-drawer folders. No
utils/,helpers/,common/,misc/, or a grab-bagshared/. A helper either lives beside the type it serves (a same-file extension) or is a named service/value type with a real home.core/is explicitly NOT a junk drawer — it is the named pure-foundation layer. - Tests mirror
lib/1:1.test/data/order_repository_test.dartforlib/data/order_repository.dart. "What has no test?" then reduces to a diff of twolsoutputs. Cross-cutting assertions that belong to no single file get their own folder (test/policy/); shared fakes go intest/support/. - One primary declaration per file; filename = that declaration in
snake_case.order_repository.dartholdsOrderRepository. The one exception: asealedhierarchy lives in a single file, because that file is the closed set the compiler enforces. - Package imports everywhere; never mix with relative.
always_use_package_imports. Mixingpackage:and relative paths lets the same member resolve two ways, producing two distinct runtime types. Package imports also survive file moves and are greppable.
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/placement_by_failure.dart 2.4 KB
- examples/public_api_surface.dart 2.5 KB
- references/layering-and-dependencies.md 5.7 KB
- references/single-package-layout.md 9.9 KB
- references/workspace-and-packages.md 5.5 KB
- scripts/check_import_boundaries.sh 2.8 KB runs code
- scripts/check_structure.sh 2.3 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 162 lines · 203 tokens per session scan A 18809bb70714
project-structure-and-packages is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 11d ago), licensed MIT. It adds 203 tokens to every session and 4,104 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
android-navigation-3
Install and migrate to Jetpack Navigation 3. Use when implementing Navigation 3 patterns including NavDisplay, NavKey routes, deep links, multiple backstacks, scenes (dialogs, bottom sheets), or migrating from Navigation 2.
swiftui-whats-new-27
New SwiftUI APIs, behaviors, and deprecations introduced in the 2027 OS releases (iOS 27, macOS 27, watchOS 27, tvOS 27, visionOS 27). Use when a SwiftUI view using @State fails to compile with "used before being initialized", "invalid redeclaration of synthesized property", or "extraneous argument label" errors after…
write-swift
How to write modern Swift well — modeling with value types, Swift 6 data-race safety and approachable concurrency (@concurrent, main-actor-by-default, actors, task groups), protocols and generics (some vs any), API design, performance and ARC, Swift Testing, macros, and the modern language features agents don't know…
wear-compose-m3
Expert guidance for working with Wear OS Compose Material3. Use this skill when creating, updating, or migrating Wear OS projects. This includes the androidx.wear.compose.material3, androidx.wear.compose.foundation, and androidx.wear.compose.navigation3 libraries. Also working with core components such as AppScaffold…
kotlin-specialist
Provides idiomatic Kotlin implementation patterns including coroutine concurrency, Flow stream handling, multiplatform architecture, Compose UI construction, Ktor server setup, and type-safe DSL design. Use when building Kotlin applications requiring coroutines, multiplatform development, or Android with Compose.…
swiftui-dev
Use this skill for SwiftUI development, architecture, structure, performance, and Apple native app profiling. It combines.