Add function reference to AGENTS.md with auto-generated docs/functions.txt#1624
Merged
nathanjmcdougall merged 7 commits intomainfrom Mar 29, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/f28bf4d2-0a29-421e-9322-10081aeec8af Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Configure agents to be aware of utility functions for dependency management
Add function reference to AGENTS.md to prevent agents reinventing existing utilities
Mar 28, 2026
Collaborator
|
@copilot wrong way of generating functions.txt. should use a hook similar to how we generate module-tree.txt |
…e docstrings Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/2927dcf9-6699-49b6-8758-fd7ac587c972 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Contributor
Author
Done in 22c36f5. Created |
Copilot
AI
changed the title
Add function reference to AGENTS.md to prevent agents reinventing existing utilities
Add function reference to AGENTS.md with auto-generated docs/functions.txt
Mar 28, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nathanjmcdougall
requested changes
Mar 29, 2026
Copilot AI
added a commit
that referenced
this pull request
Mar 29, 2026
…unctions.txt) Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/1278bd90-4e21-4e17-b2f0-56a8afee10b7 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
nathanjmcdougall
requested changes
Mar 29, 2026
Copilot AI
added a commit
that referenced
this pull request
Mar 29, 2026
…reference Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Add one-line docstrings to all public module-level functions that were previously missing them, as required by the export-functions strict check. Also fix export-functions.py to normalize RST double backticks to markdown single backticks so the output is compatible with prettier's formatting. This keeps docs/functions.txt and AGENTS.md in sync after prettier runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
- Move docstrings before comments (not after) in lint.py and hooks.py - Add blank line after sync marker in AGENTS.md to match prettier's formatting so prek passes cleanly without file modifications on each run Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
…rings Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/18fc9b90-3ca4-4cb0-87fd-885ed6de891c Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
nathanjmcdougall
approved these changes
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agents were reimplementing logic (especially dependency reads) that already exists as mature, tested functions—e.g. hand-rolling pyproject.toml parsing instead of calling
get_dep_groups().Changes
hooks/export-functions.py— New generic hook (modelled afterhooks/export-module-tree.py) that accepts--output-file,--source-root, and--strict. It recursively discovers all.pyfiles under the source root, scans module-level public functions (not class methods), and writes a flat bullet list in source order with no hardcoded sections or headers. With--strict, it exits non-zero if any public function lacks a docstring..pre-commit-config.yaml— Adds theexport-functionshook alongsideexport-module-treewith--source-root=src/usethis --strict, sodocs/functions.txtis kept up to date automatically on every prek run.docs/functions.txt— Auto-generated (not hand-written) comprehensive flat reference of all 191 public module-level functions across theusethispackage, with full dotted module names (e.g.usethis._deps).AGENTS.md— Embedsdocs/functions.txtvia the existing<!-- sync:... -->pattern (enforced by thecheck-doc-synchook), and adds an explicit "ALWAYS check the Function Reference" instruction to the general guidelines.Docstrings added to all 112 previously undocumented public module-level functions across 50+ source files so the package complies with
--strictmode and every public function appears in the generated reference.📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.