馃敶 Required Information
Is your feature request related to a specific problem?
Yes. For code-based agents, adk create currently generates the following __init__.py:
Linters such as Ruff can report this as an unused import (F401) in downstream projects. The import is intentional because it exposes and loads the agent module, but the generated code does not express that intent explicitly.
Describe the Solution You'd Like
Generate an explicit re-export by using a redundant alias:
from . import agent as agent
This preserves the existing runtime behavior while making the public re-export explicit to linters.
Impact on your work
Newly generated agents would pass common lint configurations without requiring users to modify generated code or add project-specific suppressions. It would also make the intent of the package initializer clearer.
There is no specific deadline.
Willingness to contribute
Yes. I am interested in submitting a PR.
馃煛 Recommended Information
Describe Alternatives You've Considered
- Add
agent to __all__.
- Add a
# noqa: F401 suppression.
- Configure linters to ignore
F401 in every __init__.py.
These alternatives work, but from . import agent as agent is a concise explicit re-export and is recommended by Ruff for intentional imports in package initializers.
https://docs.astral.sh/ruff/rules/unused-import/#why-is-this-bad
Proposed API / Implementation
Update the code scaffold template from:
to:
from . import agent as agent
A unit test should assert the generated __init__.py content.
Additional Context
The ADK repository currently ignores F401 for its own __init__.py files, but generated agent projects do not necessarily inherit that configuration. The scaffold should be lint-friendly independently of the ADK repository's lint settings.
馃敶 Required Information
Is your feature request related to a specific problem?
Yes. For code-based agents,
adk createcurrently generates the following__init__.py:Linters such as Ruff can report this as an unused import (
F401) in downstream projects. The import is intentional because it exposes and loads the agent module, but the generated code does not express that intent explicitly.Describe the Solution You'd Like
Generate an explicit re-export by using a redundant alias:
This preserves the existing runtime behavior while making the public re-export explicit to linters.
Impact on your work
Newly generated agents would pass common lint configurations without requiring users to modify generated code or add project-specific suppressions. It would also make the intent of the package initializer clearer.
There is no specific deadline.
Willingness to contribute
Yes. I am interested in submitting a PR.
馃煛 Recommended Information
Describe Alternatives You've Considered
agentto__all__.# noqa: F401suppression.F401in every__init__.py.These alternatives work, but
from . import agent as agentis a concise explicit re-export and is recommended by Ruff for intentional imports in package initializers.https://docs.astral.sh/ruff/rules/unused-import/#why-is-this-bad
Proposed API / Implementation
Update the code scaffold template from:
to:
A unit test should assert the generated
__init__.pycontent.Additional Context
The ADK repository currently ignores
F401for its own__init__.pyfiles, but generated agent projects do not necessarily inherit that configuration. The scaffold should be lint-friendly independently of the ADK repository's lint settings.