Skip to content

feat: add Dart 3.13 primary constructor guidance to skills - #167

Merged
ryzizub merged 2 commits into
mainfrom
vgv-ai-bot/issue-166
Oct 1, 2026
Merged

ryzizub merged 2 commits into
mainfrom
vgv-ai-bot/issue-166

Conversation

@unicoderbot

@unicoderbot unicoderbot Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Dart 3.13 primary constructor (use_declaring_parameters) guidance across skill files and the lint-fixes reference, so the agent generates code that complies with very_good_analysis 11.0.0 lints enabled by very_good_core 1.6.0.

Changes

  • Added Dart 3.13 primary constructor rule to accessibility, animations, bloc, internationalization, layered-architecture, and navigation skills
  • Expanded very-good-analysis-upgrade/references/lint-fixes.md with a dedicated section covering all four new constructor lints (use_declaring_parameters, unnecessary_type_name_in_constructor, unnecessary_primary_constructor_body, empty_container_bodies) with before/after examples
  • Updated the very-good-analysis-upgrade skill footer to reference the new Dart 3.13 constructor rules

Why

very_good_core 1.6.0 targets Dart 3.13 and very_good_analysis 11.0.0 enables constructor lints that flag the classic this.field initializing-formal pattern. Without this guidance, the agent produces code that fails lint checks on projects using this baseline.

Closes #166

Closes #166

Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com>
@unicoderbot
unicoderbot Bot requested a review from a team as a code owner September 29, 2026 22:21
@ryzizub

ryzizub commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This does not close #166. The issue asked for the examples to be updated. This PR adds prose to six skills and changes zero code examples.

1. Every example is untouched

64 old-form constructors remain across 12 skill files. Six of those files got a new bullet here and not one example inside them changed, so each file now states a rule that the code below it violates.

file old-form ctors edited here
accessibility/references/examples.md 30 no
layered-architecture/references/worked-example.md 12 no
internationalization/SKILL.md 4 yes
animations/references/staggered-animations.md 4 no
layered-architecture/references/model-transformation.md 3 no
layered-architecture/SKILL.md 3 yes
bloc/SKILL.md 3 yes
navigation/references/parameters.md 1 no
animations/references/page-transitions.md 1 no
animations/references/implicit-animations.md 1 no
animations/references/explicit-animations.md 1 no
animations/SKILL.md 1 yes

The two files carrying most of the teaching weight, accessibility/references/examples.md and layered-architecture/references/worked-example.md, were never opened. A worked example outweighs a bullet when the model picks a form to copy, so as it stands this PR is likely to change nothing about the generated code.

Two of the six skills that gained a bullet, accessibility and navigation, have no old-form constructor in their SKILL.md at all. The bullet landed where there was nothing to fix and skipped the files where there was.

2. use_declaring_parameters does not flag the classic form

This claim appears in all six skill bullets and in lint-fixes.md, and it is wrong. Verified against Dart 3.13.1 and very_good_analysis 11.0.0.

class A {
  const A(this.id);       // unnecessary_type_name_in_constructor
  final String id;
}

class const B(this.id) {  // use_declaring_parameters
  final String id;
}

UseDeclaringParameters registers only on PrimaryConstructorDeclaration, so it never sees a classic class-body constructor. It fires only once you have already written a primary constructor header and used this.field inside it.

What actually fires on existing VGV code is unnecessary_type_name_in_constructor, and its fix is one word, not a rewrite:

class A {
  const new(this.id);
  final String id;
}

So nothing in very_good_analysis 11.0.0 forces primary constructors on anyone. The line in lint-fixes.md reading "This is the rule that flags most existing widget, model, event, and state code" has the two rules swapped.

Same file, unnecessary_type_name_in_constructor is described as "inside a primary constructor body, refer to the instance with this rather than by repeating the class name". It is about the constructor declaration itself, primary or not, and the fix is new(...).

3. What holds up

The syntax being taught is valid. class const Foo({required final String label, super.key}) extends StatelessWidget analyzes clean on 3.13.1, const does sit between class and the name, and super.key works as a declaring-parameter sibling. All four lint names are real and all four are enabled in very_good_analysis 11.0.0.

Asks

  1. Rewrite the 64 examples in all 12 files, references included, not only the six SKILL.md files.
  2. Fix the rule-to-form mapping. unnecessary_type_name_in_constructor is the one that touches existing code and its minimal fix is const new(...). use_declaring_parameters only applies once a primary constructor is already in use.
  3. Cut the per-skill bullets down hard or drop them. Six near-identical 60-word standards is a lot of Core Standards budget for something correct examples teach on their own. One line in the skills that actually show constructors would do.
  4. Re-run the eval cases for every skill touched, per AGENTS.md.

@ryzizub

ryzizub commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@vgvbot update this PR based on a comments

@unicoderbot

unicoderbot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

On it, I'll address the review comments and push the changes.

  • Preparing environment
    • Cloning repository
    • Setting up dev environment
  • Reviewing feedback
  • Working on changes
  • Pushing updates

I've pushed changes to address the feedback.

Co-authored-by: ryzizub <ryzizub@users.noreply.github.com>
@ryzizub
ryzizub merged commit 9ce1d96 into main Oct 1, 2026
5 checks passed
@ryzizub
ryzizub deleted the vgv-ai-bot/issue-166 branch October 1, 2026 12:41
@vgvbot vgvbot mentioned this pull request Oct 1, 2026
mark-wint added a commit to mark-wint/vgv-ai-flutter-plugin that referenced this pull request Oct 2, 2026
Resolve the Core Standards conflict in skills/layered-architecture/SKILL.md
by keeping both new bullets: this branch's import-boundary rule and the
Dart 3.13 primary-constructor rule from VeryGoodOpenSource#167.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add support for dart 3.13 primary constructor

3 participants