Skip to content
Open
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
17 changes: 10 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
globs: |
**/*.md
!CHANGELOG.md
!references/ffca/**
!plugin/references/ffca/**
config: 'config/custom.markdownlint.jsonc'

spelling:
Expand Down Expand Up @@ -50,9 +50,12 @@ jobs:
- name: Install dependencies
run: dart pub get
- name: Analyze
run: dart analyze --fatal-infos
run: dart analyze --fatal-infos . ../plugin/scripts
- name: Format
run: dart format --output=none --set-exit-if-changed .
# plugin/scripts has no pubspec, so pin the language version from scripts/pubspec.yaml.
- name: Format the shipped validator
run: dart format --output=none --set-exit-if-changed --language-version=3.6 ../plugin/scripts
- name: Test
run: dart test

Expand All @@ -63,15 +66,15 @@ jobs:
- uses: actions/checkout@v7
- uses: dart-lang/setup-dart@v1
- name: Check VGV CLI hook tests
run: bash hooks/check_vgv_cli_test.sh
run: bash plugin/hooks/check_vgv_cli_test.sh
- name: Validate layers hook tests
run: bash hooks/validate_layers_test.sh
run: bash plugin/hooks/validate_layers_test.sh

skills-lint:
name: 🔍 Skills Lint
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/skills_lint.yml@v2.1.0
with:
skills_directories: 'skills'
skills_directories: 'plugin/skills'

plugin-paths:
name: 📂 Plugin Paths
Expand All @@ -80,7 +83,7 @@ jobs:
- uses: actions/checkout@v7
- name: Check for bare plugin paths
run: |
if grep -rnP '(?<![\w}/.-])(references|scripts)/' skills agents; then
if grep -rnP '(?<![\w}/.-])(references|scripts)/' plugin/skills plugin/agents; then
echo "::error::Prefix plugin file paths in skills/ and agents/ with \${CLAUDE_PLUGIN_ROOT}/"
exit 1
fi
Expand All @@ -93,4 +96,4 @@ jobs:
- name: Install Claude Code
run: npm install -g "@anthropic-ai/claude-code@${CLAUDE_CODE_VERSION}"
- name: Validate Plugin
run: claude plugin validate .
run: claude plugin validate plugin
2 changes: 1 addition & 1 deletion .github/workflows/reference_drift.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: reference drift

# The FFCA reference under references/ffca/ is a byte mirror of the canonical
# The FFCA reference under plugin/references/ffca/ is a byte mirror of the canonical
# docs on engineering.verygood.ventures. This job re-fetches them and fails when
# the committed mirror has fallen behind.
#
Expand Down
2 changes: 1 addition & 1 deletion .release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"extra-files": [
{
"type": "json",
"path": ".claude-plugin/plugin.json",
"path": "plugin/.claude-plugin/plugin.json",
"jsonpath": "$.version"
}
]
Expand Down
112 changes: 59 additions & 53 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,68 @@

VGV FFCA Plugin teaches Claude Code the Feature-First Clean Architecture (FFCA) for Flutter monorepos. It ships skills, one read-only auditor agent, and a PostToolUse hook that blocks pubspec edits breaking the layer rules.

The skills and the agent carry workflows only. The architecture itself lives in `references/ffca/`, which is the single source of truth. It is a byte mirror of the FFCA section of VGV Engineering, one file per page, regenerated by `scripts/sync_reference.dart`. Never edit its content to match a skill. Change the upstream page, re-sync, then fix the skills that drifted.
The skills and the agent carry workflows only. The architecture itself lives in `plugin/references/ffca/`, which is the single source of truth. It is a byte mirror of the FFCA section of VGV Engineering, one file per page, regenerated by `scripts/sync_reference.dart`. Never edit its content to match a skill. Change the upstream page, re-sync, then fix the skills that drifted.

The only code is the Dart layer validator under `scripts/` and the bash hook wrapper that calls it.
Everything the plugin loads lives in `plugin/`. Repo tooling stays outside it: `scripts/` holds the validator tests, their fixtures, and `sync_reference.dart`.

The only code is the Dart layer validator in `plugin/scripts/` and the bash hook wrapper that calls it.

## Repository Structure

```text
.mcp.json # MCP server configuration (Very Good CLI)
.claude-plugin/
plugin.json # Plugin manifest (name, version, description, keywords)
agents/
ffca-layer-auditor.md # Read-only architecture auditor subagent
assets/
icon.png # Plugin directory listing icon, set as `icon` in plugin.json
readme-header.png # README banner
config/
cspell.json # Spell check dictionary
custom.markdownlint.jsonc # markdownlint rules
hooks/
hooks.json # Hook definitions (PreToolUse, PostToolUse)
check_vgv_cli.sh # Checks the Very Good CLI version and auto-approves its MCP tools
check_vgv_cli_test.sh # Tests for check_vgv_cli.sh
validate_layers.sh # Runs the validator on edited pubspec.yaml files
validate_layers_test.sh # Tests for validate_layers.sh
references/
ffca/ # Byte mirror of the VGV Engineering FFCA pages, single source of truth
README.md # Manifest: which upstream page each file mirrors
overview.md # Goals, three-part structure, feature archetypes, layer model
domain.md # Models, Commands and Queries, repository interfaces, Summary pattern
data.md # Data sources, DTOs, converters and mappers
presentation.md # Modules, localizations, widget slots, subfeature barrels
navigation.md # Callback injection, typed routes, splitting the routing table
project_structure.md # Dependency rules, naming, folder layout, tooling
faq.md # Frequently asked questions
code_templates/
data_templates.md # DTO, data source, mapper, repository implementation shapes
domain_templates.md # Model, repository interface, Command and Query shapes
presentation_templates.md # Cubit, Module, route shapes
scripts/
plugin/ # Everything the plugin loads. This is the folder users install.
.mcp.json # MCP server configuration (Very Good CLI)
.claude-plugin/
plugin.json # Plugin manifest (name, version, description, keywords)
README.md # Plugin docs: installation, skills, agent, hooks, MCP
LICENSE # Copy of the root LICENSE
agents/
ffca-layer-auditor.md # Read-only architecture auditor subagent
assets/
icon.png # Plugin directory listing icon, set as `icon` in plugin.json
readme-header.png # README banner
hooks/
hooks.json # Hook definitions (PreToolUse, PostToolUse)
check_vgv_cli.sh # Checks the Very Good CLI version and auto-approves its MCP tools
check_vgv_cli_test.sh # Tests for check_vgv_cli.sh
validate_layers.sh # Runs the validator on edited pubspec.yaml files
validate_layers_test.sh # Tests for validate_layers.sh
references/
ffca/ # Byte mirror of the VGV Engineering FFCA pages, single source of truth
README.md # Manifest: which upstream page each file mirrors
overview.md # Goals, three-part structure, feature archetypes, layer model
domain.md # Models, Commands and Queries, repository interfaces, Summary pattern
data.md # Data sources, DTOs, converters and mappers
presentation.md # Modules, localizations, widget slots, subfeature barrels
navigation.md # Callback injection, typed routes, splitting the routing table
project_structure.md # Dependency rules, naming, folder layout, tooling
faq.md # Frequently asked questions
code_templates/
data_templates.md # DTO, data source, mapper, repository implementation shapes
domain_templates.md # Model, repository interface, Command and Query shapes
presentation_templates.md # Cubit, Module, route shapes
scripts/
validate_layers.dart # FFCA layer, naming, cycle, import, and barrel validator
skills/
ffca-architecture/SKILL.md # Orientation, layer rules, naming
ffca-audit/SKILL.md # Dispatches ffca-layer-auditor
ffca-cross-feature/SKILL.md # Summary pattern, Queries, widget slots, composing features
ffca-feature/SKILL.md # Scaffold and extend a feature
ffca-routing/SKILL.md # Callback injection, typed routes
scripts/ # Repo tooling, not part of the installed plugin
analysis_options.yaml # Excludes the test fixtures from analysis
pubspec.yaml # Dev dependency on package:test for the validator tests
sync_reference.dart # Regenerates references/ffca/ from VGV Engineering, --check for drift
validate_layers.dart # FFCA layer, naming, cycle, import, and barrel validator
sync_reference.dart # Regenerates plugin/references/ffca/ from VGV Engineering, --check for drift
test/
validate_layers_test.dart # Validator tests
validate_layers_test.dart # Tests for plugin/scripts/validate_layers.dart
fixtures/
valid_workspace/ # FFCA repo that must pass
invalid_workspace/ # One package per violation the validator must catch
warning_workspace/ # Warnings and suppressed errors only, must exit 0
not_ffca/ # Non-FFCA repo the validator must skip
skills/
ffca-architecture/SKILL.md # Orientation, layer rules, naming
ffca-audit/SKILL.md # Dispatches ffca-layer-auditor
ffca-cross-feature/SKILL.md # Summary pattern, Queries, widget slots, composing features
ffca-feature/SKILL.md # Scaffold and extend a feature
ffca-routing/SKILL.md # Callback injection, typed routes
```

## Skill File Format
Expand All @@ -85,39 +91,39 @@ Every `SKILL.md` follows this structure:

## Adding a New Skill

1. Create `skills/ffca-<name>/SKILL.md` following the format above.
2. Update `keywords` in `.claude-plugin/plugin.json` if the skill adds a new topic.
3. Add a row to the **Skills** table in `README.md`, linking the skill name to its `SKILL.md`.
4. Add the slash command to the list under the Skills table in `README.md`.
1. Create `plugin/skills/ffca-<name>/SKILL.md` following the format above.
2. Update `keywords` in `plugin/.claude-plugin/plugin.json` if the skill adds a new topic.
3. Add a row to the **Skills** table in `plugin/README.md`, linking the skill name to its `SKILL.md`.
4. Add the slash command to the list under the Skills table in `plugin/README.md`.
5. Add any new domain terms to the `words` list in `config/cspell.json`.
6. Update the repository structure in `AGENTS.md`.

## Adding a New Agent

Agents live in `agents/<name>.md` and are auto-discovered. No `plugin.json` change is needed. A file registers as `vgv-ffca-plugin:<name>`.
Agents live in `plugin/agents/<name>.md` and are auto-discovered. No `plugin.json` change is needed. A file registers as `vgv-ffca-plugin:<name>`.

1. Create `agents/<name>.md` with YAML frontmatter:
1. Create `plugin/agents/<name>.md` with YAML frontmatter:
- `name`: required. Must match the file name.
- `description`: required. When Claude should dispatch the agent, with `<examples>` blocks as in `ffca-layer-auditor.md`.
- `tools`: comma-separated bare tool names. A read-only agent omits `Edit` and `Write`.
- `model`: `inherit` to use the session model.
2. Add a row to the **Agent** table in `README.md`, linking the agent name to its file.
2. Add a row to the **Agent** table in `plugin/README.md`, linking the agent name to its file.
3. Add any new domain terms to the `words` list in `config/cspell.json`.
4. Update the repository structure in `AGENTS.md`.

## Maintaining Existing Skills, Hooks, and MCP Tools

Documentation drifts when an asset changes and the docs describing it do not. Update the matching docs in the same change:

- **The FFCA architecture changes.** Update the VGV Engineering page first, then run `dart run scripts/sync_reference.dart` to re-sync `references/ffca/`. Check every skill, the agent, and the code templates for section names that moved or rules that changed. If a dependency rule changed, update the rules table at the top of `scripts/validate_layers.dart` and its tests.
- **A skill's scope or triggers change.** Update `description` and the matching row in the `README.md` Skills table.
- **The validator's rules or flags change.** Update `scripts/test/validate_layers_test.dart` and its fixtures, the **Hooks** section of `README.md`, and the `## Hooks` section of `CLAUDE.md` if the hook's behavior changes.
- **A hook changes in `hooks/hooks.json`.** Update the **Hooks** section of `README.md` and the `## Hooks` section of `CLAUDE.md`. If it is `check_vgv_cli.sh` or `validate_layers.sh`, update its `_test.sh` file.
- **An MCP tool is added, renamed, or removed.** Check every skill's `allowed-tools` and the **MCP Integration** section of `README.md`. Nothing validates those names.
- **The FFCA architecture changes.** Update the VGV Engineering page first, then run `dart run scripts/sync_reference.dart` to re-sync `plugin/references/ffca/`. Check every skill, the agent, and the code templates for section names that moved or rules that changed. If a dependency rule changed, update the rules table at the top of `plugin/scripts/validate_layers.dart` and its tests.
- **A skill's scope or triggers change.** Update `description` and the matching row in the `plugin/README.md` Skills table.
- **The validator's rules or flags change.** Update `scripts/test/validate_layers_test.dart` and its fixtures, the **Hooks** section of `plugin/README.md`, and the `## Hooks` section of `CLAUDE.md` if the hook's behavior changes.
- **A hook changes in `plugin/hooks/hooks.json`.** Update the **Hooks** section of `plugin/README.md` and the `## Hooks` section of `CLAUDE.md`. If it is `check_vgv_cli.sh` or `validate_layers.sh`, update its `_test.sh` file.
- **An MCP tool is added, renamed, or removed.** Check every skill's `allowed-tools` and the **MCP Integration** section of `plugin/README.md`. Nothing validates those names.

## Checks

CI runs markdownlint with `config/custom.markdownlint.jsonc`, cspell with `config/cspell.json`, the validator's analyze, format, and tests from `scripts/`, skills lint on `skills/`, a check that every plugin file path in `skills/` and `agents/` starts with `${CLAUDE_PLUGIN_ROOT}/`, and `claude plugin validate .`. `CHANGELOG.md` and `references/ffca/` are excluded from markdownlint. A weekly `reference_drift` workflow runs `sync_reference.dart --check` and fails when the mirror is stale.
CI runs markdownlint with `config/custom.markdownlint.jsonc`, cspell with `config/cspell.json`, the validator's analyze, format, and tests from `scripts/` and `plugin/scripts/`, skills lint on `plugin/skills/`, a check that every plugin file path in `plugin/skills/` and `plugin/agents/` starts with `${CLAUDE_PLUGIN_ROOT}/`, and `claude plugin validate plugin`. `CHANGELOG.md` and `plugin/references/ffca/` are excluded from markdownlint. A weekly `reference_drift` workflow runs `sync_reference.dart --check` and fails when the mirror is stale.

## Commits

Expand Down
Loading