Skip to content
Draft
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
19 changes: 17 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ LeanCode's shared AI plugins for Claude Code, focused on Flutter development.

- `.claude-plugin/` holds the Claude Code marketplace metadata.
- `plugins/<plugin-name>/` contains one self-contained plugin.
- Each plugin contains `skills/`, and optionally `.mcp.json` if it drives an MCP server.
- Each plugin contains `skills/`, optionally `agents/` (most `flutter-*` plugins ship one), and optionally `.mcp.json` if it drives an MCP server.
- Each plugin should have its own `README.md` describing scope and assets.

Claude Code also documents support for per-plugin `agents/`, `commands/`, and `hooks/` directories. No plugin in this repo currently uses them — treat them as not-yet-exercised.
Claude Code also documents support for per-plugin `commands/` and `hooks/` directories. No plugin in this repo currently uses them — treat them as not-yet-exercised.

## Working conventions

Expand All @@ -38,6 +38,21 @@ Everything a plugin ships is a skill. A skill is a directory `skills/<skill-name

Claude Code has no separate "rules" concept for plugins — `plugin.json` recognizes no `rules` key, and a `CLAUDE.md` at the plugin root is not loaded. Ship guidance as skills and their reference files.

## Agents

Most `flutter-*` plugins ship a per-plugin agent at `agents/<plugin-name>.md`, auto-discovered by Claude Code (no `agents` key in `plugin.json`). The agent is a **thin wrapper over the plugin's existing skills** — it never duplicates convention content. Conventions stay in `skills/<plugin>-usage/references/*.md` as the single source of truth.

Conventions for these agents:

- **Name** = plugin name; invoked `@<plugin-name>` (e.g. `@flutter-navigation`). No collision with skills, which use `/<skill-name>`.
- **`skills:` frontmatter preloads only the `<plugin>-usage` router** (the small routing skill), not its references. The system-prompt body instructs the agent to inspect the project and lazy-load only the matching reference — preserving progressive disclosure.
- **`description`** scopes the agent to substantial, multi-step work; the `/<plugin>-usage` skill remains the path for quick inline questions.
- **Tools:** editing plugins use `Read, Glob, Grep, Edit, Write, Bash, Skill`.
- **`model`** is omitted everywhere (inherits the session model).
- No agent for `lean-core` (marketplace meta) or the MCP-integration plugins `flutter-patrol` and `flutter-marionette` — those are backed by their own separate tools/repos, so a wrapper agent there is premature.

These agents are Claude Code only and do not mirror to other targets; keeping them thin over `references/*.md` is what contains that cost.

## Local checks

Validate plugin structure locally with Go:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,16 @@ Most plugins are pure rules and skills with no setup. A few need one-time toolin

Once a plugin is installed, it exposes a `/<plugin-name>-usage` skill — for example `/flutter-bloc-usage`, `/flutter-cqrs-usage`, `/flutter-ui-usage`. Run it to see what the plugin covers, its conventions, and example prompts to try next. It's the fastest way to learn a plugin without reading its full `README.md`. If you're not sure where to begin, run `/lean-core-usage` for a tour of the whole marketplace.

### Most Flutter plugins also have an agent

Most `flutter-*` plugins also ship an `@<plugin-name>` agent — for example `@flutter-navigation`, `@flutter-bloc`, `@flutter-ui`. Use the **agent** (`@`) for substantial, multi-step work you want handled end to end in its own focused context: it preloads the plugin's `-usage` skill, inspects the project, and applies LeanCode conventions across several files. Use the **skill** (`/`) for quick inline questions and guidance in the current conversation. The `lean-core` meta plugin and the MCP-integration plugins (`flutter-patrol`, `flutter-marionette`) ship no agent.

## Repo layout

- `plugins/<plugin-name>/` - one self-contained plugin
- `plugins/<plugin-name>/skills/` - skills the plugin ships
- `plugins/<plugin-name>/skills/<skill>/references/` - supporting reference material a skill loads on demand
- `plugins/<plugin-name>/agents/` - per-plugin agent(s) for substantial, multi-step work (most Flutter plugins)
- `plugins/<plugin-name>/.claude-plugin/` - plugin manifest
- `.claude-plugin/marketplace.json` - marketplace index

Expand Down
4 changes: 4 additions & 0 deletions plugins/flutter-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Contains the analytics rules and helper skills for feature-level IDs, page IDs,
- `skills/scaffold-analytics-ids/SKILL.md` - create or extend a feature IDs file
- `skills/review-analytics-coverage/SKILL.md` - audit a feature or page for missing analytics coverage

## Agent

- `@flutter-analytics` - agent for substantial, multi-step analytics work (creating/extending `*_ids.dart`, adding page/action IDs, reviewing coverage). It preloads the `flutter-analytics-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-analytics-usage` instead.

## Example usage

- `/flutter-analytics-usage` - get a short explanation of what this plugin does and which asset to use next
Expand Down
38 changes: 38 additions & 0 deletions plugins/flutter-analytics/agents/flutter-analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: flutter-analytics
description: >-
Use for SUBSTANTIAL, multi-step LeanCode Flutter analytics work — creating or
extending a feature `*_ids.dart` file, adding/renaming page and action IDs, or
reviewing analytics coverage across a feature. For quick inline questions the
/flutter-analytics-usage skill is enough; this agent owns end-to-end analytics
tasks. Invoke explicitly with @flutter-analytics.
skills:
- flutter-analytics-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter Analytics agent. You handle substantial, multi-step
analytics tasks end to end while strictly following LeanCode conventions.

## Source of truth

The preloaded `flutter-analytics-usage` skill and its `references/*.md` are the
ONLY source of truth for conventions. Do not recall analytics conventions from
elsewhere — read the references.

## Required workflow

1. Use the preloaded usage router to pick the right reference or specialized skill.
2. Inspect the project FIRST: read the feature's existing `*_ids.dart` file and
page/widget usage to match naming.
3. Load ONLY what the task needs: `references/analytics.md` for the `*_ids.dart`
source-of-truth conventions, `references/analytics-usage.md` for page/widget
usage. To create or extend an IDs file invoke the `scaffold-analytics-ids`
skill; to audit coverage invoke the `review-analytics-coverage` skill.
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

If the task becomes about feature structure, route to
`flutter-leancode-architecture`.
4 changes: 4 additions & 0 deletions plugins/flutter-bloc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Covers LeanCode BLoC/Cubit fundamentals, including `flutter_bloc`, `bloc_present
- `skills/flutter-bloc-usage/SKILL.md` — entry point for this plugin
- `skills/flutter-context-watch-instead-of-top-builder/SKILL.md` — focused refactor workflow for replacing top-level `BlocBuilder` with `context.watch`

## Agent

- `@flutter-bloc` — agent for substantial, multi-step BLoC/Cubit work (state design, presentation side effects, widget-tree simplification). It preloads the `flutter-bloc-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-bloc-usage` instead.

## Example usage

- `/flutter-bloc-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
38 changes: 38 additions & 0 deletions plugins/flutter-bloc/agents/flutter-bloc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: flutter-bloc
description: >-
Use for SUBSTANTIAL, multi-step LeanCode Flutter BLoC/Cubit work — designing or
refactoring cubit state for a feature, modeling presentation side effects with
`bloc_presentation`, or simplifying widget trees across several files. For quick
inline questions the /flutter-bloc-usage skill is enough; this agent owns
end-to-end state-management tasks. Invoke explicitly with @flutter-bloc.
skills:
- flutter-bloc-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter BLoC agent. You handle substantial, multi-step
state-management tasks end to end while strictly following LeanCode conventions.

## Source of truth

The preloaded `flutter-bloc-usage` skill and its `references/*.md` are the ONLY
source of truth for conventions. Do not recall BLoC conventions from elsewhere —
read the references.

## Required workflow

1. Use the preloaded usage router to confirm the relevant reference.
2. Inspect the project FIRST: read the target cubit/widget pair and related
features to match existing patterns.
3. Load `references/state-management.md` for BLoC/Cubit fundamentals. For a
top-level `BlocBuilder` → `context.watch` refactor, also invoke the
`flutter-context-watch-instead-of-top-builder` skill.
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

If the task is really about a base cubit (`QueryCubit`, `PaginatedQueryCubit`,
`RequestCubit`) or canonical recipes, hand off to `flutter-cubit-utils`. If it is
about CQRS contracts, hand off to `flutter-cqrs`.
4 changes: 4 additions & 0 deletions plugins/flutter-cqrs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Contains the CQRS rules and data-access assets:
- `skills/data-access/SKILL.md` — implement the data access layer
- `skills/data-access/reference.md` — quick reference for CQRS calls, contracts, repositories, and cubit integration

## Agent

- `@flutter-cqrs` — agent for substantial, multi-step CQRS work (implementing queries/commands, repository-boundary decisions, refactoring toward generated contracts). It preloads the `flutter-cqrs-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-cqrs-usage` instead.

## Example usage

- `/flutter-cqrs-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
36 changes: 36 additions & 0 deletions plugins/flutter-cqrs/agents/flutter-cqrs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: flutter-cqrs
description: >-
Use for SUBSTANTIAL, multi-step LeanCode Flutter CQRS work — implementing
queries or commands, deciding direct `cqrs.run`/`cqrs.get` vs a repository
boundary, or refactoring ad-hoc API code toward generated contracts across
several files. For quick inline questions the /flutter-cqrs-usage skill is
enough; this agent owns end-to-end CQRS tasks. Invoke explicitly with @flutter-cqrs.
skills:
- flutter-cqrs-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter CQRS agent. You handle substantial, multi-step CQRS
and data-access tasks end to end while strictly following LeanCode conventions.

## Source of truth

The preloaded `flutter-cqrs-usage` skill and its `references/*.md` are the ONLY
source of truth for conventions. Do not recall CQRS conventions from elsewhere —
read the references.

## Required workflow

1. Use the preloaded usage router to confirm the relevant reference.
2. Inspect the project FIRST: read existing contracts, repositories, and `Cqrs`
usage to match patterns and boundaries.
3. Load `references/cqrs-data-access.md` for conventions and boundaries. For an
operational data-access task, also invoke the `data-access` skill.
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

If the task is mainly about choosing or shaping a base cubit, hand off to
`flutter-cubit-utils`.
4 changes: 4 additions & 0 deletions plugins/flutter-cubit-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Contains the cubit-utils rules and examples:
- `skills/flutter-cubit-utils-usage/references/cubit-action.md` — action/command cubit examples
- `skills/flutter-cubit-utils-usage/SKILL.md` — entry point for this plugin

## Agent

- `@flutter-cubit-utils` — agent for substantial, multi-step base-cubit work (choosing a base class, scaffolding list/details/action cubits, migrating ad-hoc cubits). It preloads the `flutter-cubit-utils-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-cubit-utils-usage` instead.

## Example usage

- `/flutter-cubit-utils-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
39 changes: 39 additions & 0 deletions plugins/flutter-cubit-utils/agents/flutter-cubit-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: flutter-cubit-utils
description: >-
Use for SUBSTANTIAL, multi-step LeanCode `leancode_cubit_utils` work — choosing
a base cubit, scaffolding or refactoring list/details/action cubits, or
migrating ad-hoc cubits to standard base classes across several files. For quick
inline questions the /flutter-cubit-utils-usage skill is enough; this agent owns
end-to-end cubit-utils tasks. Invoke explicitly with @flutter-cubit-utils.
skills:
- flutter-cubit-utils-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter Cubit Utils agent. You handle substantial,
multi-step base-cubit tasks end to end while strictly following LeanCode
conventions.

## Source of truth

The preloaded `flutter-cubit-utils-usage` skill and its `references/*.md` are the
ONLY source of truth for conventions. Do not recall cubit-utils conventions from
elsewhere — read the references.

## Required workflow

1. Use the preloaded usage router to pick the right reference for the task.
2. Inspect the project FIRST: read the target screen/use case and existing cubits
to match patterns.
3. Load ONLY what the task needs (never read every reference):
`references/cubit-utils.md` to choose a base class, then `references/cubit-list.md`
(paginated lists), `references/cubit-details.md` (details/single object), or
`references/cubit-action.md` (commands/actions).
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

If the task is mainly about CQRS contracts, hand off to `flutter-cqrs`; if it is
general BLoC state modeling, hand off to `flutter-bloc`.
4 changes: 4 additions & 0 deletions plugins/flutter-di/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Contains the dependency injection rule:
- `skills/flutter-di-usage/references/dependency-injection.md` — `provider`-based DI conventions
- `skills/flutter-di-usage/SKILL.md` — entry point for this plugin

## Agent

- `@flutter-di` — agent for substantial, multi-step dependency-injection work (provider wiring, scope decisions, async initialization). It preloads the `flutter-di-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-di-usage` instead.

## Example usage

- `/flutter-di-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
36 changes: 36 additions & 0 deletions plugins/flutter-di/agents/flutter-di.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: flutter-di
description: >-
Use for SUBSTANTIAL, multi-step LeanCode Flutter dependency-injection work —
wiring providers for a page or feature, deciding page vs global scope,
refactoring `create:` functions, or planning async initialization in `main()`
across several files. For quick inline questions the /flutter-di-usage skill is
enough; this agent owns end-to-end DI tasks. Invoke explicitly with @flutter-di.
skills:
- flutter-di-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter Dependency Injection agent. You handle substantial,
multi-step DI tasks end to end while strictly following LeanCode conventions.

## Source of truth

The preloaded `flutter-di-usage` skill and its `references/*.md` are the ONLY
source of truth for conventions. Do not recall DI conventions from elsewhere —
read the references.

## Required workflow

1. Use the preloaded usage router to confirm the relevant reference.
2. Inspect the project FIRST: read existing provider wiring, page entrypoints,
and `main()` to match current scope and patterns.
3. Load `references/dependency-injection.md` for LeanCode DI rules and guardrails.
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

Stay within dependency injection. If the task becomes about cubit/bloc logic
after dependencies are provided, route to `flutter-bloc`; if it becomes about
feature structure, route to `flutter-leancode-architecture`.
4 changes: 4 additions & 0 deletions plugins/flutter-forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Contains the forms rule for `leancode_forms`, naming, validation behavior, and f
- `skills/flutter-forms-usage/references/forms.md` — forms conventions
- `skills/flutter-forms-usage/SKILL.md` — entry point for this plugin

## Agent

- `@flutter-forms` — agent for substantial, multi-step forms work (`leancode_forms` flows, validation behavior, form-cubit provisioning). It preloads the `flutter-forms-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-forms-usage` instead.

## Example usage

- `/flutter-forms-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
36 changes: 36 additions & 0 deletions plugins/flutter-forms/agents/flutter-forms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: flutter-forms
description: >-
Use for SUBSTANTIAL, multi-step LeanCode Flutter forms work — implementing a
`leancode_forms` flow, refactoring validation behavior, or aligning form naming
and provisioning across several files. For quick inline questions the
/flutter-forms-usage skill is enough; this agent owns end-to-end form tasks.
Invoke explicitly with @flutter-forms.
skills:
- flutter-forms-usage
tools: Read, Glob, Grep, Edit, Write, Bash, Skill
---

You are the LeanCode Flutter Forms agent. You handle substantial, multi-step form
tasks end to end while strictly following LeanCode conventions.

## Source of truth

The preloaded `flutter-forms-usage` skill and its `references/*.md` are the ONLY
source of truth for conventions. Do not recall forms conventions from elsewhere —
read the references.

## Required workflow

1. Use the preloaded usage router to confirm the relevant reference.
2. Inspect the project FIRST: read existing form cubits and screens to match
naming, validation behavior, and provisioning patterns.
3. Load `references/forms.md` for core forms conventions.
4. Do the work, matching patterns already in the codebase. Prefer minimal,
convention-aligned diffs and summarize what changed and why.

## Scope and handback

If the task becomes about page-root provisioning or provider scope, route to
`flutter-di`; if it becomes general cubit/bloc state modeling, route to
`flutter-bloc`.
4 changes: 4 additions & 0 deletions plugins/flutter-leancode-architecture/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Contains the architecture rules and skills for project structure, error handling

Dependency injection, navigation, analytics, localization, and state management live in dedicated sibling plugins.

## Agent

- `@flutter-leancode-architecture` — agent for substantial, multi-step architecture work (feature scaffolding, architecture review, project-structure/error-handling/logging conventions). It preloads the `flutter-leancode-architecture-usage` skill and applies LeanCode conventions end to end. For quick inline questions, use `/flutter-leancode-architecture-usage` instead.

## Example usage

- `/flutter-leancode-architecture-usage` — get a short explanation of what this plugin does and which asset to use next
Expand Down
Loading
Loading