name: code-review description: > Quality gate and checklist for reviewing changes in the Flutter-AdaptiveCards monorepo. Covers monorepo hygiene, AC spec compliance, theming, keys, accessibility, and testing. Use this for both manual and AI-assisted final reviews before proposing changes.
Code Review Protocol
Use this skill as a "Final Gate" for any PR or significant change. Cross-reference with specialized skills (adaptive-cards-spec-compliance, adaptive-cards-element-registry, dart-public-api-docs, flutter-adaptive-cards-testing) as needed.
1. Monorepo Hygiene & Consistency
- FVM usage: Are all commands (
flutter,dart) executed viafvm? - Analysis: Does the code pass
fvm flutter analyze? (Compliance withvery_good_analysis). - Changelog: Has
CHANGELOG.mdbeen updated in the affected packages following Keep a Changelog? - Release / post-publish (if applicable): Follow
release-engineer— all sixversion:fields match, six changelogs have matching top## [<version>]sections, andflutter_adaptive_charts_fsandflutter_adaptive_cards_host_fsuseflutter_adaptive_cards_fs: ^<version>. - Formatting: Has
dart_formatbeen run on all modified files? - Public
///docs: Do exported API changes in library packages explain why and how to use the API (not implementation steps)? Seedart-public-api-docs.
Documentation impact (canonical docs/)
Architecture docs drift silently. If this change touches any of the triggers below, git grep the affected symbols in docs/ and confirm the canonical docs were updated in this change (see the "Architecture documentation sync gate" in AGENTS.md).
- Providers / scopes: Did it add/remove/rename a Riverpod provider or
ProviderScope(including nested scopes), or move a provider between scopes? → Updatedocs/reactive-riverpod.md(provider scopes + diagram) anddocs/Architecture-Overview.md(scope diagram). - Mixin contracts: Did it change what a mixin watches or how effective state is computed (e.g.
AdaptiveVisibilityMixin.isVisible,AdaptiveInputMixin)? → Update the relevant section ofdocs/reactive-riverpod.md. - HostConfig / element contracts: Did it add/remove/rename a HostConfig section, element/action type, or overlay field, or change a component's implementation/tests status? → Update
docs/hostconfig.md, the owning package's README## Implementation statustable (packages/flutter_adaptive_cards_fs/README.mdfor core; charts/templating in their package READMEs), anddocs/overlay-properties-by-type.mdas applicable.docs/Implementation-Status.mdis an index — edit it only for the project-level roadmap/history or pointers, not per-component status or known gaps (those live in the package READMEs). - No stale references:
git grep -n '<removed-or-renamed-symbol>' docs/returns nothing pointing at deleted/renamed code (a stale doc reference is a blocker, not a nit).
2. flutter_adaptive_cards_fs Checklist
Registration & Pattern Compliance
- Registry: Is the new element/action added to
CardTypeRegistryorActionTypeRegistry? - Mixins: Does the element correctly implement
AdaptiveElementWidgetMixin(Widget) andAdaptiveElementMixin+AdaptiveVisibilityMixin(State)? - Inputs: Does the input use
AdaptiveInputMixin? On user change, does it callsetDocumentInputValue(...)? Does it sync controllers inonDocumentValueChangedwhen overlays change (reset)? - Visibility: If visibility can change at runtime, does the element use
AdaptiveVisibilityMixinand write viasetIsVisible/ document notifier (not local-onlysetState)? - TextBlock text: If runtime text can change, does
AdaptiveTextBlockread display copy fromresolvedElementProvider(id)(not only staleadaptiveMap['text'])? - Actions: Do action buttons respect
isEnabledviaAdaptiveActionStateMixin/resolvedActionProviderwhen host-driven enable/disable matters? - Overlays: Are host/runtime patches written through the document notifier (
setInputValue,setText,setInputError, …) rather than mutating the host JSON map? - Extension boundary: Does
flutter_adaptive_cards_fsavoid chart-specific (or other optional-package) types, imports, and overlay fields? Optional behavior belongs in extension packages viaaddedElements/overlayExtensions, not in core.
Theming & Styling
- ReferenceResolver: Does the element use
styleResolver(viaProviderScopeMixin) orProviderScope.containerOf(context).read(styleReferenceResolverProvider)for all colors, font sizes, and spacing? - Registries: Does the element use
cardTypeRegistry/actionTypeRegistryfromProviderScopeMixin(not fromReferenceResolver)? - Theme Awareness: Has it been verified in both Light and Dark modes?
- HostConfig: Does it respect spacing, separator, and padding properties from JSON via
SeparatorElement?
Keys & Identity
- Deterministic Keys: Is the outer widget key generated via
generateAdaptiveWidgetKey(adaptiveMap)? - Internal Keys: For inputs or sub-elements, are keys generated using the
id(e.g.,ValueKey(id)orValueKey('${id}_suffix'))? Crucial for testing stability.
Accessibility
- Semantics: Does the widget use
SemanticsorsemanticLabelwhere appropriate? - Alt-text: For images or icons, is the
altText(if provided in JSON) used as a semantic label?
Exports
- Public API: Is the new class/widget exported in
lib/flutter_adaptive_cards_fs.dart? - Extension API: Is it exported in
lib/flutter_adaptive_cards_extend.dartif intended for customization by consumers? - Public
///docs: Do new or changed exported members explain why the API exists and how callers use it — not implementation steps? Seedart-public-api-docs.
3. flutter_adaptive_template_fs Checklist
- Expression Evaluation: Are new AST nodes or functions implemented in both the parser and the evaluator?
- Reserved Keywords: Are
$data,$root,$index, and$whenhandled correctly during expansion? - Scope Integrity: Does nesting
$datacorrectly shift the resolution context?
4. flutter_adaptive_cards_host_fs Checklist
- Handlers:
AdaptiveCardBackendHandlersshares the sameGlobalKey<RawAdaptiveCardState>asRawAdaptiveCardwhenonSubmit/onExecute/onRefreshneed card state. - Adapters: PlainJson vs Teams invoke shapes match the backend contract; response effects applied via
AdaptiveCardInvokeResponse.applyTo. - Dependencies:
pubspec.yamldeclaresflutter_adaptive_cards_fs: ^<monorepo-version>(sync on release bump). - Tests: Unit tests under
packages/flutter_adaptive_cards_host_fs/test/(no goldens); runfvm flutter testfrom that package directory. - Docs: Public API changes reflected in
docs/backend-host-integration.mdand packageREADME.md; exported///comments followdart-public-api-docs.
See adaptive-cards-backend-host skill for file paths and invoke round-trip patterns.
5. Testing Protocol
- Key-First Searching: All
find.text()orfind.byType()calls in tests should be replaced withfind.byKey()whenever a key is available. - JSON Samples: Is there a new file in
test/samples/demonstrating the feature/fix? - Golden Tests:
- Have golden tests been added/updated for UI changes?
- New goldens: generate with
--update-goldenson macOS, then copy each new PNG fromtest/gold_files/macos/totest/gold_files/linux/so CI has a baseline (seeadaptive-cards-testingskill andtest/gold_files/README.md). - CI pixel failures: replace
linux/files from CI artifact zips for canonical Linux images.
- Coverage gate: New untested code lowers a package toward its floor in
tool/coverage_floors.yaml. The CI coverage gate (golden-excluded line coverage) must stay green — add tests rather than lowering a floor. Raising a floor after landing tests is fine; lowering one to pass is a red flag. Seedocs/testing-coverage.md.
widgetbook changes (sample app)
- Asset registration: New folders under
widgetbook/lib/samples/are listed inwidgetbook/pubspec.yamlunderflutter: assets:(required forAdaptiveCardsCanvas.asset). - Use case / codegen:
@widgetbook.UseCaseadded or updated inadaptive_cards_use_cases.dart;fvm dart run build_runner buildrun when use cases change. - Changelog:
widgetbook/CHANGELOG.mdupdated when the demo app changes. - Docs: Overlay knob pages → registry row in
docs/widgetbook-overlay-demos.md; package behavior docs tag widgetbook as Example (widgetbook sample) perdocumentation-scope.md.
Review Output Template
When performing a review, summarize findings using this format:
### Code Review Summary
- **Package**: [e.g. flutter_adaptive_cards_fs]
- **Hygiene**: [PASS/FAIL] (Analysis, Changelog, Formatting)
- **Docs impact**: [PASS/FAIL/N-A] (canonical `docs/` synced; no stale references)
- **Compliance**: [PASS/FAIL] (Registry, Spec, Theming)
- **Testing**: [PASS/FAIL] (Keys, Samples, Goldens)
#### Details
- [Specific feedback regarding keys, accessibility, etc.]