本文へ移動
cccskills
無料GitHub で公開

StreamFlow Mypy no-untyped-def Fixer

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.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

StreamFlow Mypy Sub-Skill: no-untyped-def

Error: [no-untyped-def] — function or method missing type annotations.

Decision Process

For each function: can all parameters and the return type use concrete types?

  • YES → fix it
  • NO (any type needs Any, dict[str, Any], etc.) → skip the entire function

Workflow

  1. Identify errors:
    uv run mypy path/to/file.py | grep "no-untyped-def"
    
  2. Classify each function as FIXABLE or UNFIXABLE (see above)
  3. Add annotations to FIXABLE functions only
  4. Validate & commit: Load the StreamFlow Mypy Type Checking skill — General Workflow steps 3–5

Key Patterns

# Simple return types
async def close(self) -> None: ...
def is_ready(self) -> bool: ...

# Literal for fixed value sets (preferred over bare str/int)
def get_status(self) -> Literal["pending", "running", "completed", "failed"]: ...
def set_mode(self, mode: Literal["sync", "async"]) -> None: ...

# Broad arguments, narrow returns
from collections.abc import Iterable, Sequence, Mapping

def process(self, items: Iterable[Token]) -> list[str]: ...    # broad arg, narrow return
def validate(self, cfg: Mapping[str, str]) -> bool: ...        # read-only dict arg

# Optional
def get_connector(self, name: str) -> Connector | None: ...

# Self for classmethods
@classmethod
async def load(cls, persistent_id: int) -> Self: ...

# TypedDict for structured dicts (avoids dict[str, Any])
class ConnectorConfig(TypedDict):
    name: str
    enabled: bool

def get_config(self) -> ConnectorConfig: ...

SKIP these — require forbidden types:

def get_config(self): return {"key": self.value}      # needs dict[str, Any]
def get_items(self): return [self.id, self.cfg]        # needs list[Any]
def save(self): return self.config                     # MutableMapping[str, Any]

Common abstract argument types: Iterable[T] (iteration only) · Sequence[T] (indexing) · Mapping[K, V] (read-only dict)

If any return path needs a forbidden type, skip the whole function.

See Also

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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`.

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

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/`.

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

This skill should be used when the user asks to "fix mypy errors", "add type annotations", "fix type checking", "resolve no-untyped-def", "fix mypy type errors", or when working with type hints while respecting StreamFlow's forbidden type constraints (no Any, dict[str, Any], etc.).

日本語の概要は準備中です。原文の説明を表示しています。

alpha-unito/streamflow662026年10月13日 更新

alpha-unito のスキルをすべて見る

このスキルの問題を報告する