Skip to content
cccskills
FreePublished on GitHub

StreamFlow Mypy var-annotated Fixer

This skill should be used when the user encounters "var-annotated" mypy errors, asks to "fix var-annotated errors", "add type annotations to variables", or mentions "Need type annotation for" errors. Provides workflow for fixing missing variable type annotations while respecting forbidden type constraints (no Any, dict[str, Any], list[Any], etc.).

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

StreamFlow Mypy Sub-Skill: var-annotated

Error: [var-annotated] — mypy cannot infer a variable's type. Fix: add an explicit annotation (variable: Type = value). If the correct type requires forbidden types, skip the error.

Workflow

  1. Read surrounding code — what gets stored/retrieved from the variable?
  2. Determine the concrete type from usage, signatures, or similar patterns nearby
  3. Check: does the type need Any or other forbidden types? If YES → skip
  4. Apply: variable: ConcreteType = value
  5. Validate & commit: Load the StreamFlow Mypy Type Checking skill — General Workflow steps 3–5

Fix Patterns

Empty collections — examine what gets stored:

cache: dict[str, Port] = {}
items: list[Token] = []
ports: dict[str, list[str]] = {}

Generic types — specify type parameters:

future: asyncio.Future[str] = asyncio.Future()
cache: LRUCache[int, int] = LRUCache(maxsize=5)

For generic type parameters, prefer covariant alternatives when you only need read access: use Sequence[T] over MutableSequence[T], Mapping[K, V] over MutableMapping[K, V]. Check typeshed for variance of standard library types.

StreamFlow objects — import the concrete type:

from streamflow.core.workflow import Port, Token
from streamflow.core.deployment import ExecutionLocation

storage: dict[str, Token] = {}

Common StreamFlow types: Port, Token (streamflow.core.workflow) · Storage (streamflow.data.utils) · ExecutionLocation (streamflow.core.deployment)

Nested dicts with known keys — prefer TypedDict:

from typing import TypedDict

class Config(TypedDict):
    name: str
    count: int

config: Config = {"name": "test", "count": 42}

# Only use generic dict when keys are truly dynamic:
extensions: dict[str, dict[str, str]] = {}

Don't guess types — always verify by reading code. Don't use bare generics (list instead of list[str]).

See Also

  • StreamFlow Mypy Type Checking skill — General workflow, allowed types reference
  • AGENTS.md — Forbidden types list, commit approval rule

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

This skill should be used when the user asks to "update the changelog", "add a changelog entry", "write a CHANGELOG entry", or when preparing a git commit in StreamFlow that requires updating the `## [Unreleased]` section of `CHANGELOG.md`.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

This skill should be used when the user asks to "add docstrings", "write error handling", "use naming conventions", "handle exceptions", or when writing new Python code for StreamFlow that requires docstring format, naming conventions, exception handling, or async cleanup patterns.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

This skill should be used when the user asks to "write documentation", "add a doc page", "update RST files", "add a tutorial", or when writing or editing Sphinx RST documentation for StreamFlow.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

This skill should be used when the user asks to "add an example", "write a tutorial", "document a new workflow example", or when creating a new worked example under `docs/source/examples/`.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

This skill should be used when the user asks to "write a commit message", "create a commit", "format a commit", "what commit type to use", or when preparing changes for a git commit in StreamFlow. Provides commit message format, type conventions, and examples.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

This skill should be used when the user encounters "no-untyped-def" mypy errors, asks to "fix no-untyped-def errors", "add type annotations to functions", or mentions "Function is missing a type annotation". Provides specific workflow for fixing missing type annotations while respecting forbidden type constraints.

The English summary is being prepared. Showing the original description.

alpha-unito/streamflow67Updated Oct 19, 2026

See all skills by alpha-unito

Report a problem with this skill