Skip to content

Add global config pass-through avoidance guidance to function design skill#1638

Merged
nathanjmcdougall merged 2 commits into
mainfrom
copilot/update-agent-config-to-use-global
Mar 29, 2026
Merged

Add global config pass-through avoidance guidance to function design skill#1638
nathanjmcdougall merged 2 commits into
mainfrom
copilot/update-agent-config-to-use-global

Conversation

Copilot AI commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Non-CLI functions were accepting usethis_config attributes (e.g. backend, offline) as parameters and threading them through call chains. This should be documented as an anti-pattern in agent skills so future code generation avoids it.

  • Added a new section to usethis-python-functions/SKILL.md documenting that non-CLI functions must access usethis_config directly rather than accepting its attributes as parameters
  • Only CLI interface functions (_ui/interface/) should accept these parameters, to bridge the CLI framework into usethis_config.set()
# Bad: pass-through pattern
def register_group(name: str, *, backend: BackendEnum) -> None:
    if backend is BackendEnum.uv:
        ...

# Good: access global config directly
def register_group(name: str) -> None:
    if get_backend() is BackendEnum.uv:
        ...

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

…skill

Add a new section to usethis-python-functions/SKILL.md explaining
that non-CLI functions must not accept usethis_config attributes
(backend, offline, frozen, etc.) as parameters. Instead, they should
access the global usethis_config object directly or use helpers like
get_backend(). Includes a concrete code example showing the bad
(pass-through) and good (direct access) patterns.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/1b089757-c6c2-4aae-8a05-0108c7d528a5

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor agent config to avoid pass-through variables Add global config pass-through avoidance guidance to function design skill Mar 29, 2026
Copilot AI requested a review from nathanjmcdougall March 29, 2026 23:13
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 29, 2026 23:22
@nathanjmcdougall nathanjmcdougall merged commit 2d42bf3 into main Mar 29, 2026
1 check passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/update-agent-config-to-use-global branch March 29, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent config to avoid pass-through variables relating to global config

2 participants