type-analyze
The user's request supplies the following values:
code_block(required) - Python code for typing analysis
Placeholders such as {code_block} below refer to these values.
Procedure
Analyze Python code in {code_block}:
- Add type annotations: • function/method parameters • return values
- Find untyped points: variables, parameters, results
- For dictionaries with fixed keys — suggest TypedDict
- For interface/structure abstraction — suggest Protocol (PEP 544)
- If a value accepts multiple types — suggest Union
- For containers: use Generic (
List[str],Dict[int, Any])
Output format:
- Code with added annotations (minimal, without logic)
- List of issues: missing annotations
- Recommendations: configure mypy/pyright for strict checking and Ignore‑flags
Logic in code doesn't change — only typing and advice.