Skip to content

Add usethis-python-code skill with duplication guidance#1509

Merged
nathanjmcdougall merged 2 commits intomainfrom
copilot/add-usethis-python-code-skill
Mar 25, 2026
Merged

Add usethis-python-code skill with duplication guidance#1509
nathanjmcdougall merged 2 commits intomainfrom
copilot/add-usethis-python-code-skill

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

PR #1437 revealed agents preemptively duplicate code (e.g. copying a helper into two modules) instead of creating a shared implementation. This adds a new skill to guide that decision.

Changes

  • New skill .agents/skills/usethis-python-code/SKILL.md: Covers when to share vs. duplicate code — procedure for checking existing code first, criteria for when duplication is acceptable (different purposes, concrete behavioral differences, fragile coupling), and common mistakes (duplicating when replacing a dependency, speculative divergence). References usethis-python-code-modify.
  • AGENTS.md: Added usethis-python-code to the important skills list so it's loaded alongside usethis-python-code-modify when modifying Python code.
Original prompt

This section details on the original issue you should resolve

<issue_title>Instruct agent on when to introduce duplications</issue_title>
<issue_description>This came up in #1437

It's a bit of an art to decide when to duplicate code, and its hard to give specific instructions, but it's worth trying to make a start. Can add this to a new usethis-python-code skill.

This new skill should reference the usethis-python-code-modify skill.</issue_description>

Comments on the Issue (you are @copilot in this section)


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/274a7107-acb2-4a6b-9371-c8ce45e3e7ea
Copilot AI changed the title [WIP] Add guidance on code duplication introduction Add usethis-python-code skill with duplication guidance Mar 25, 2026
Copilot AI requested a review from nathanjmcdougall March 25, 2026 01:46
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 25, 2026 02:02
@nathanjmcdougall nathanjmcdougall merged commit a2d34ac into main Mar 25, 2026
@nathanjmcdougall nathanjmcdougall deleted the copilot/add-usethis-python-code-skill branch March 25, 2026 02:02
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.

Instruct agent on when to introduce duplications

2 participants