Reusable, Flutter-first guidance for AI-assisted work across apps. This repo keeps the shared source of truth as plain Markdown so Cursor, Claude Code, Codex, and other tools can all read the same rules, patterns, and workflows.
Per-app files such as CLAUDE.md, AGENTS.md, and .cursor/rules should stay thin. They should point agents to this toolkit, usually starting with ai_toolkit/INDEX.md and the session bootstrap workflow at ai_toolkit/workflows/session/bootstrap-session.md.
INDEX.md: the AI entrypoint. Read this first in every session.bin/toolkit: repo-local CLI to add/sync/pull/push the toolkit submodule in each app.alias/: shell aliases and command shortcuts — overviewalias/_index.md.setup/: project setup checklists and bootstrapping — overviewsetup/_index.md.rules/: short must / must-not guidance — overviewrules/_index.md.patterns/: implementation examples and conventions — overviewpatterns/_index.md.workflows/: ordered playbooks — layoutworkflows/README.md.templates/: reusable spec and documentation skeletons — overviewtemplates/_index.md. Includestemplates/app-seed/for per-app bootstrap files.reference/: supporting checklists and notes — overviewreference/_index.md.
This toolkit uses workflows/, not commands/. The intent is the same as command-style playbooks in some AI tools, but "workflow" better matches phased, multi-step work and keeps the naming tool-neutral.
Use the smallest mode that gives enough context.
- Lite bootstrap: read
INDEX.md, then the task-relevant rule or pattern files. Use for small edits, reviews, and focused fixes. - Full bootstrap: read
INDEX.md,workflows/session/bootstrap-session.md, relevant aliases, app-specificai_docs/, and the active spec inai_specs/when present. Use for new features, multi-file work, refactors, debugging, or anything that changes architecture.
If a referenced file does not exist yet, continue with the closest available file and preserve the stable path in new docs.
Section overviews: setup/_index.md, workflows/README.md, rules/_index.md, patterns/_index.md, templates/_index.md.
- New Flutter app or repository setup: start in
setup/, then load relevantrules/before creating code. - Feature implementation from a spec: use
workflows/feature-delivery/make-plan.md, then load matching rules and patterns (see indexes above). - Bug fix: use
workflows/maintenance/bugfix.md, then load rules for the touched domain. - Refactor: use
workflows/maintenance/refactor.md, then load the current app architecture docs before editing. - Dependency upgrade: use
workflows/maintenance/dependency-upgrade.mdand relevant setup notes. - BRD or product-source analysis: use
workflows/product-analysis/brd-analysis.mdand thetemplates/brd/skeletons. - Figma / design analysis (screens, flows, nav graph): use
workflows/product-analysis/figma-analysis.mdand thetemplates/design/skeletons. - API collection analysis (Postman / Apidog / OpenAPI) and collection handoff: use
workflows/api-analysis/_index.mdandtemplates/api/. - Commit or PR prep: use
workflows/git/commit-after-phase.mdandworkflows/feature-delivery/verify-and-pr.md. - Dart import cleanup: use
patterns/dart/absolute-imports.md. - Build runner, generated files, or json_serializable: load
rules/tooling/build-runner.mdandpatterns/data/json-models-json-serializable.mdwhen available. - Core architecture changes: load
rules/core/_index.mdand the specificrules/core/*file for the area being touched.
These defaults guide future rules and patterns unless an app-specific ai_docs/ file says otherwise.
- Mobile targets: iOS and Android.
- State management: Bloc / Cubit.
- Dependency injection:
get_itwithinjectable. - Network: Dio.
- Serialization:
json_serializablegenerated*.g.dartfiles. Do not use Freezed for these models unless a documented exception exists. - Repository results:
dartzEither<Failure, T>. - Common supporting packages: firebase, flutter_gen, responsive_framework, path_provider, and intl.
Full guide: setup/per-app-integration.md. Playbook: workflows/integration/link-ai-toolkit.md.
Add once (from the app repo root — Mac, Linux, or Git Bash / WSL on Windows):
git submodule add -b main https://github.com/Mega-Org/ai_toolkit.git ai_toolkit
cp ai_toolkit/templates/app-seed/CLAUDE.md .
cp ai_toolkit/templates/app-seed/AGENTS.md .
mkdir -p .cursor/rules && cp ai_toolkit/templates/app-seed/cursor-rules/ai-toolkit-seed.mdc .cursor/rules/
# Merge Makefile targets from ai_toolkit/templates/app-seed/Makefile.snippet
git add .gitmodules ai_toolkit CLAUDE.md AGENTS.md .cursor/rules
git commit -m "Add ai_toolkit submodule and AI seed files"Daily (repo-local CLI — no global install):
| Goal | Command |
|---|---|
After app git pull |
./ai_toolkit/bin/toolkit sync or make toolkit-sync |
| Upgrade toolkit | ./ai_toolkit/bin/toolkit pull then commit the app pointer |
| Push toolkit edits | ./ai_toolkit/bin/toolkit push "message" then bump the app |
| Status | ./ai_toolkit/bin/toolkit status |
Clone for teammates: git clone --recurse-submodules <app-url> (or git submodule update --init --recursive after clone).
Apps pin a commit SHA. Other apps do not auto-update when you push toolkit changes — run toolkit pull in each app when you want the newer pin.
Each app should keep its own product-specific docs outside this toolkit:
ai_docs/architecture.md: app-specific core and feature boundaries.ai_docs/conventions.md: naming, folders, and app-level exceptions.ai_specs/: app-specific spec workspace. Preferai_specs/README.md(layer map) andai_specs/INDEX.md(feature matrix + load order). Per feature build specs:ai_specs/features/<feature>/README.md(requirements) andplan.md(phased plan + progress). Analysis truth: BRD inai_specs/brd/; design/Figma inai_specs/design/; API collection KB inai_specs/api/(sendCOLLECTION_HANDOFF.mdto collection owners). Same feature slug may appear underbrd/features/,design/features/,api/features/, and rootfeatures/— different ownership, not duplicates. Plan withworkflows/feature-delivery/make-plan.md; implement withimplement-phase.md. Optional per app:fixes/,integrations/,archive/. Refactors/tooling:workflows/maintenance/refactor.md+ai_docs/.- Cursor Agent Skills (optional): portable templates under
reference/agent-skills/— copy into.agents/skills/<name>/in each app repo so Cursor can discover them. Keep long-form guidance inai_toolkit/patterns/andai_toolkit/rules/; skills should stay short and link there.
The toolkit should not contain secrets, environment URLs, client IDs, or product-only architecture prose.