Agent skill

Flet Validation

by flet-dev in flet-dev/flet

A skill your agent uses whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, Raises: ValueError docstrings, beforeupdate() checks, raise…

Apache-2.0Auto-check passedDevelopment

Install Flet Validation

skills CLI
$ npx skills add flet-dev/flet --skill flet-validation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install flet-dev/flet flet-validation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/flet-dev/flet.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/flet-validation .claude/skills/flet-validation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
flet-validation
GitHub stars
17k
Token cost
~1.9k tokens
SKILL.md length
847 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, Raises: ValueError docstrings, beforeupdate() checks, raise…

  • Works in 3 steps: Annotated[..., V.*] field rules (default). → validation_rules: ValidationRules for… → before_update() only for…
  • Editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties
  • SKILL.md covers When To Use, Source Of Truth, Validation Decision Order and Validation Authoring Rules, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Flet Validation is an agent skill from flet-dev/flet. Use whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, Raises: ValueError docstrings, beforeupdate() checks, raise ValueError, Annotated/V rules, or validationrules.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Technical documentation. It works with Python. The repository describes itself as: Build realtime web, mobile and desktop apps in Python only. No frontend experience required. The licence is Apache-2.0.

When your agent uses it

  • Editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties
  • Raises: ValueError docstrings
  • Beforeupdate() checks
  • Raise ValueError

Example prompts

  • “/flet-validation”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Annotated[..., V.*] field rules (default).
  2. validation_rules: ValidationRules for cross-field invariants that do
  3. before_update() only for normalization/mutation, or for truly non-ruleable

What it can do on your machine

Read from SKILL.md and the folder at commit 9748de3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flet Validation loads about 1.9k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 847 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from flet-dev/flet at commit 9748de3, republished under its Apache-2.0 licence (© flet-dev). 847 words, ~1,934 tokens.

Download SKILL.mdSave it as .claude/skills/flet-validation/SKILL.md (or your agent's skills folder).
name
flet-validation
description
Use whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, `Raises: ValueError` docstrings, `before_update()` checks, `raise ValueError`, Annotated/V rules, or __validation_rules__.

When To Use

Use this skill when you:

  • add validation to a control property,
  • migrate manual before_update() checks to V rules,
  • update Raises sections tied to validation,
  • align Python validation with Dart-side control behavior.

Do not use this skill for unrelated doc-only edits outside control validation. Do not use this skill for deprecation authoring conventions; use flet-deprecation.

Source Of Truth

  • Validation runtime API lives in: sdk/python/packages/flet/src/flet/utils/validation.py
  • The same runtime can validate regular dataclass models via validate(instance); this skill focuses on the control-specific authoring conventions.
  • Import from public path only: from flet.utils.validation import V and when needed from flet.utils.validation import ValidationRules

Validation Decision Order

Use this order and stop at the first option that keeps logic clear:

  1. Annotated[..., V.*] field rules (default).
  2. __validation_rules__: ValidationRules for cross-field invariants that do not map cleanly to one field.
  3. before_update() only for normalization/mutation, or for truly non-ruleable invariants.

Never duplicate the same invariant in more than one layer.

Validation Authoring Rules

  1. Prefer field-level validation with Annotated[...] metadata.

    • Example (close to current slider controls):
      @dataclass
      class Sample:
          opacity: Annotated[
                 Optional[Number],
                 V.between(0.0, 1.0),
             ] = None
      
          value: Annotated[
              Optional[Number],
              V.ge_field("min"),
              V.le_field("max"),
          ] = None
      
          min: Annotated[
              Number,
              V.le_field("max"),
              V.le_field("value"),
          ] = 0.0
      
          max: Annotated[
              Number,
              V.ge_field("min"),
              V.ge_field("value"),
          ] = 1.0
  2. Use class-level __validation_rules__ only for invariants that cannot be expressed cleanly with field rules.

    • Type: __validation_rules__: ValidationRules = (...)
    • Use V.ensure(...) with an explicit message only when the predicate is short and readable.
    • If V.ensure(lambda ...) becomes hard to read, prefer either:
      1. a named predicate function passed to V.ensure(...), or
      2. a clear before_update() check when it cannot be represented well with existing V.* rules.
  3. Keep the before_update() override for normalization/mutation first.

    • Remove validation checks duplicated by V rules.
    • Prefer raising validation errors from rule evaluation (validate()), not from ad-hoc before_update() checks, unless the invariant is genuinely non-ruleable with current validation primitives.
  4. Cross-field comparisons use field rules only.

    • Use: V.gt_field, V.ge_field, V.lt_field, V.le_field
  5. None handling is inferred from type hints.

    • If a field is annotated as optional (for example Optional[T]), None is allowed.
    • If a field is not optional, None fails validation.
    • For *_field comparisons, if either side is optional and currently None, the comparison is skipped; if a non-optional side is None, validation fails.
  6. Match Dart effective behavior.

    • Review both:
      1. Flet Dart wrapper (packages/flet/lib/src/controls/<control>.dart or extension wrapper),
      2. wrapped Flutter widget source assertions/invariants.
    • Mirror those constraints in Python so invalid payloads fail before crossing to Dart.
    • Validate against effective defaults applied on Dart side (for example min/max).
    • Include wrapper-imposed constraints when relevant (for example bounds/rounding/division logic in wrapper formatting code).
  7. For new properties, validate against base widget assertions before wiring.

    • When adding a Python property to a Flet control, confirm whether the mapped Dart wrapper and underlying widget both enforce constraints for that property.
    • Add equivalent Python-side validation (Annotated[...], __validation_rules__, or readable before_update()) to prevent Dart assertions from being the first failure point.
  8. Keep error ownership clear.

    • Runtime outbound value failures should raise ValueError.
    • Validation declaration/build errors (invalid V.* arguments) should raise ValidationDeclarationError.

Typing Style

  • Follow the codebase typing style:
    • prefer Optional[T] over T | None,
    • use Union[...] when needed.
Show full SKILL.md (332 more words)Show less

Property Docstring Style

When a property has validation, document it in that property’s docstring (google style).

  1. Add a Raises: block under the property docstring.

  2. Use one ValueError entry per logical rule, except between(...).

    • For V.between(a, b), use one entry: ValueError: If it is not between \a` and `b`, inclusive.`
  3. Start each entry with If it ..., where 'it' refers to the property name.

  4. Use canonical wording from validation helper docstrings.

    • The source of truth is sdk/python/packages/flet/src/flet/utils/validation.py.
    • Each V.* helper includes Property docstring Raises wording.
    • Keep property Raises entries as negations of the annotation rule.
    • For strict inequalities, say "strictly". For example: V.gt(x) -> ValueError: If it is not strictly greater than \x`.`
    • For sign-neutral divisibility helpers (factor_of, multiple_of), add explicit sign rules (V.gt(0) or V.lt(0)) when direction matters, and include separate Raises entries for those sign rules.
  5. Mention conditional applicability when needed.

    • Example (for min/max checks against optional value):
      Raises:
          ValueError: If it is not less than or equal to [`value`][(c).],
              when [`value`][(c).] is set.
  6. Keep examples and wording aligned with real control files.

    • Prefer concrete property names such as min, max, value, start_value, end_value, min_lines, max_lines.
    • For cross-field rules, use same-class links: [min][(c).], [max][(c).].

Cross-Referencing Conventions

Follow the cross-reference guidance in: docs-conventions.

Most common pattern to use in control property docstrings:

  • same-class properties: [\prop`][(c).]`

Keep symbol labels wrapped in backticks.

Required Test Matrix

When adding/changing validation, include tests that cover:

  • one valid case and one invalid case per new logical rule;
  • boundary values (==, min/max edges) where applicable;
  • cross-field set/unset combinations when optional values are involved;
  • effective-default behavior when Dart applies defaults but Python value is omitted.

Prefer placing tests in:

  • sdk/python/packages/flet/tests/test_validation.py for validation runtime;
  • control-specific tests when behavior is tied to one control.

Common Pitfalls

  • Keeping stale manual before_update() validations after migration.
  • Missing Raises entries on validated properties.
  • Combining multiple non-between rules into one ambiguous ValueError sentence.
  • Forgetting Dart defaults that still apply when Python property is omitted.
  • Forcing complex V.ensure(lambda ...) expressions when before_update() would be cleaner.

© flet-dev, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/flet-validation of flet-dev/flet.

Open the folder on GitHubat commit 9748de3

Compare with similar skills

Flet Validation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Flet Validation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flet Validation this skillflet-dev/flet17k—~1.9kAutomated safety check: PassApache-2.0
Adk Sample Creatorgoogle/adk-python22k—~1.3kAutomated safety check: PassApache-2.0
Crafting Effective Readmescumbucadev/cinemaempoa1465 repos~669Automated safety check: PassGPL-3.0
Acquire Codebase Knowledgegithub/awesome-copilot40k1 repos~2.3kAutomated safety check: PassMIT
DDNS Provider DevelopmentNewFuture/DDNS4.7k—~558Automated safety check: PassMIT
Mkdocsjeka-dev/jeka176—~2kAutomated safety check: PassApache-2.0

Similar skills

  • Adk Sample Creator

    google/adk-python

    Official

    Creates a new sample agent in the ADK Python repository — the sample directory, its agent.py, and its README.md — following the conventions the existing samples already use.

    22k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Crafting Effective Readmes

    cumbucadev/cinemaempoa

    A skill your agent uses when writing or improving README files.

    146 GitHub starsUsed in 5 repos~669 tokens
    DevelopmentAuto-check passed
  • Acquire Codebase Knowledge

    github/awesome-copilot

    Official

    Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.

    40k GitHub starsUsed in 1 repo~2.3k tokens
    DevelopmentAuto-check passed
  • Adds or changes a DNS provider in the DDNS project while keeping its code, schemas, tests and Chinese and English docs consistent.

    4.7k GitHub stars~558 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Mkdocs

    jeka-dev/jeka

    MkDocs documentation project reference covering CLI commands, mkdocs.yml configuration, Material theme setup, and plugin integration.

    176 GitHub stars~2k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Draw.io Diagram Generator

    github/awesome-copilot

    Official

    Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.

    40k GitHub starsUsed in 1 repo~4.9k tokens
    DevelopmentAuto-check passed

More from flet-dev/flet

All 14 skills in this repo
  • A skill your agent uses when asked to create or update integration tests for any Flet control in sdk/python/packages/flet/integrationtests, including visual goldens and interactive behavior tests.

    17k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when asked to create Flet example projects from flat .py files with main.py and pyproject.toml metadata for Gallery/MCP indexing.

    17k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when asked to build, preview, or verify the Flet documentation website, including checking for broken links, broken images, and unresolved reST cross-references.

    17k GitHub stars~557 tokensUpdated today
    Auto-check passed
  • Docs Conventions

    flet-dev/flet

    A skill your agent uses when writing or reviewing Flet documentation, including Python docstrings (Google style, reST roles, admonitions), Markdown docs (cross-references, images, code examples)…

    17k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Flet Deprecation

    flet-dev/flet

    A skill your agent uses when adding or changing deprecations for Python controls/APIs in sdk/python/packages/, including V.deprecated fields, deprecated decorators, version lifecycle, and docs…

    17k GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Create or update a Flet release announcement blog post from changelog notes, matching existing /blog style.

    17k GitHub stars~950 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Flet Validation

What does Flet Validation do?

A skill your agent uses whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, Raises: ValueError docstrings, beforeupdate() checks, raise…. Flet Validation is an agent skill from flet-dev/flet. Use whenever editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties, Raises: ValueError docstrings, beforeupdate() checks, raise ValueError, Annotated/V rules, or validationrules.

When should I use Flet Validation?

Flet Validation fits situations like: editing validation for Python controls in sdk/python/packages/: adding/changing constrained properties; raises: ValueError docstrings; beforeupdate() checks; raise ValueError.

How do I install Flet Validation in Claude Code?

Run `npx skills add flet-dev/flet --skill flet-validation -a claude-code`. Or copy the skill folder (.agents/skills/flet-validation in flet-dev/flet) into .claude/skills/flet-validation in your project. Claude Code loads it when a task matches its description.

How do I install Flet Validation in Codex?

Run `npx skills add flet-dev/flet --skill flet-validation -a codex`. Or copy the skill folder (.agents/skills/flet-validation in flet-dev/flet) into .agents/skills/flet-validation in your project. Codex loads it when a task matches its description.

Can I use Flet Validation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add flet-dev/flet --skill flet-validation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flet-validation, .gemini/skills/flet-validation, .github/skills/flet-validation and .opencode/skills/flet-validation in your project.

What does Flet Validation need to run?

SKILL.md names no scripts, command-line tools or credentials: Flet Validation is instructions for the agent only. Our summary lists: Python 3.

Does Flet Validation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Flet Validation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Flet Validation use?

Flet Validation is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flet Validation use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Flet Validation?

Skills that share tags, products or a category with Flet Validation: Adk Sample Creator (google/adk-python, 22k stars), Crafting Effective Readmes (cumbucadev/cinemaempoa, 146 stars), Acquire Codebase Knowledge (github/awesome-copilot, 40k stars) and DDNS Provider Development (NewFuture/DDNS, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flet Validation?

flet-dev (a GitHub organization) maintains it in flet-dev/flet, which has 17,265 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 2026.

Source: flet-dev/flet on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.