Skip to content

Add usethis-agents skill with auto-generated skills directory#1630

Merged
nathanjmcdougall merged 4 commits intomainfrom
copilot/add-usethis-agents-skill
Mar 29, 2026
Merged

Add usethis-agents skill with auto-generated skills directory#1630
nathanjmcdougall merged 4 commits intomainfrom
copilot/add-usethis-agents-skill

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 29, 2026

Agent reference material (function lists, module trees, skill directories) should be extracted from source via automation hooks, not maintained by hand. This PR codifies that principle as a skill and applies it to the skills directory itself.

New skill: usethis-agents

Documents the one-source-of-truth principle for agent configuration: use docstrings/frontmatter as the canonical source and prek hooks to extract them into docs/ files, synced into markdown via <!-- sync:path --> markers.

Covers:

  • When and how to apply the principle
  • AGENTS.md maintenance (sync blocks, skills registry, validation hooks)

The skill content is kept generic — it describes the principle and procedures without project-specific references, referring only to .agents/skills/ generically.

New hook: export-skills-directory

  • hooks/export-skills-directory.py scans .agents/skills/usethis-*/SKILL.md, extracts name and description from YAML frontmatter, writes a Markdown bullet list to docs/skills-directory.txt
  • Modeled after export-module-tree.py — same CLI pattern (--skills-dir, --output-file, --prefix)

Config changes

  • .pre-commit-config.yaml: added export-skills-directory hook
  • AGENTS.md: added usethis-agents to skills registry; usethis-specific skills section now uses <!-- sync:docs/skills-directory.txt --> markers to stay in sync with the generated file

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

- Create hooks/export-skills-directory.py to extract skill names and
  descriptions from SKILL.md frontmatter into docs/skills-directory.txt
- Create .agents/skills/usethis-agents/SKILL.md explaining the
  one-source-of-truth principle and AGENTS.md maintenance
- Add export-skills-directory hook to .pre-commit-config.yaml
- Add SKILL.md to check-doc-sync args for sync block validation
- Add usethis-agents to AGENTS.md skills registry table
- Generate initial docs/skills-directory.txt

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/d2aeb693-d94b-4c01-a3ba-b935ad3d85c0

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Copilot AI changed the title [WIP] Add usethis-agents skill for automated docstring reference Add usethis-agents skill with auto-generated skills directory Mar 29, 2026
Copilot AI requested a review from nathanjmcdougall March 29, 2026 21:56

The usethis-specific skills table in `AGENTS.md` must include every skill directory under `.agents/skills/` that starts with `usethis-`. The `check-skills-documented` hook enforces this. When creating a new skill, add it to the table (see the `usethis-skills-create` skill for the full procedure).

## Skills Directory
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot don't include the skills directory in this file. I don't want you to mention usethis in this file, just the .agent/skills dir more generically.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the skills directory table and made the content generic in cbce013. The SKILL.md now describes the one-source-of-truth principle and AGENTS.md maintenance without usethis-specific references — just .agents/skills/ generically. Also removed the SKILL.md from check-doc-sync args since it no longer has sync blocks.

…agents SKILL.md

Make the skill content generic: describe the one-source-of-truth
principle and AGENTS.md maintenance without usethis-specific examples
or embedding the skills directory table. Remove SKILL.md from
check-doc-sync args since it no longer has sync blocks.

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/302a3e52-f9ad-432d-be31-b887e9ccb2f1

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 29, 2026 22:25
Copilot AI requested a review from nathanjmcdougall March 29, 2026 22:25
@@ -0,0 +1,43 @@
---
name: usethis-agents
description: Maintain AGENTS.md and agent skill configuration following the one-source-of-truth principle
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep the description more general:

" Maintain AGENTS.md and agent skill configuration "

i.e. remove mention of the one-source-of-truth principle

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the description in 1eec8eb.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 29, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/add-usethis-agents-skill (1eec8eb) with main (6846354)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (6bf6d04) during the generation of this report, so 6846354 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

- Change SKILL.md description to "Maintain AGENTS.md and agent skill
  configuration" (remove one-source-of-truth mention)
- Convert skills directory from table to bullet-point format in both
  the export hook and generated docs/skills-directory.txt
- Wrap usethis-specific skills in AGENTS.md with sync markers for
  docs/skills-directory.txt

Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/771b656a-119e-447c-9562-00cb146df84d

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
@nathanjmcdougall nathanjmcdougall merged commit 6bada92 into main Mar 29, 2026
20 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/add-usethis-agents-skill 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 explain the principle of using docstring for reference material

2 participants