Skip to content

Commit 84126ce

Browse files
Merge branch 'main' into 1556-add-config-for-external-agent-skills
2 parents a232c01 + 7ef283a commit 84126ce

4 files changed

Lines changed: 77 additions & 8 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: usethis-cli-modify
3+
description: Modify the usethis CLI layer (commands, options, help text) and keep documentation in sync
4+
compatibility: usethis, Python, typer, markdown
5+
license: MIT
6+
metadata:
7+
version: "1.0"
8+
---
9+
10+
# Modifying the CLI
11+
12+
## Procedure
13+
14+
1. Make your changes to the CLI layer (command functions, options, help text, or app registration).
15+
2. Update the CLI documentation to reflect every user-facing change.
16+
3. Run the affected interface-level tests.
17+
18+
## When this skill applies
19+
20+
Use this skill whenever you modify anything under the `_ui` package, including:
21+
22+
- Adding, removing, or renaming a command
23+
- Changing a command's options, arguments, or defaults
24+
- Changing help text or command descriptions
25+
- Modifying how commands are registered on the app
26+
27+
## Update the CLI documentation
28+
29+
**Every user-facing CLI change requires a documentation update.** The documentation is manually written and is not auto-generated from the code, so it will not update itself.
30+
31+
After making CLI changes, review and update each of the following as needed:
32+
33+
### Command reference
34+
35+
The command reference page documents every command with its full description, supported options, and behavior. Update it to match any changes you made to commands, options, defaults, or descriptions.
36+
37+
### Command overview
38+
39+
The command overview page lists all commands organized by category with brief descriptions. Update it if you added, removed, renamed, or recategorized a command.
40+
41+
### Example usage and getting-started pages
42+
43+
The getting-started pages show practical CLI usage examples. If your change affects the commands or output shown in these examples, update them so the examples remain accurate and runnable.
44+
45+
### README
46+
47+
If your change adds, removes, or renames a CLI command or tool integration, update the README to reflect this.
48+
49+
### CONTRIBUTING.md
50+
51+
If your change affects the step-by-step guides in CONTRIBUTING.md (e.g. the "Adding a new tool" or "Adding a new badge" guides), update those guides to remain accurate.
52+
53+
## CLI architecture
54+
55+
### Separation of interface and core logic
56+
57+
Command functions in the `_ui` layer are thin wrappers. They parse CLI arguments, set up configuration and file management context, then delegate to functions in the `_core` package. Keep this separation: do not put business logic in command functions.
58+
59+
### Command registration pattern
60+
61+
Each command is defined in its own file under `_ui/interface/`. The main app object in `_ui/app.py` registers commands using `app.command()` or `app.add_typer()` for sub-apps. Shared CLI options are defined as module-level constants in `_ui/options.py`.
62+
63+
When adding a new command:
64+
65+
1. Create a new file in `_ui/interface/` following the pattern of existing commands.
66+
2. Register it in `_ui/app.py`.
67+
3. If the command uses shared options, import them from `_ui/options.py`. If it needs new options, add them there.
68+
4. Create the corresponding core logic function in `_core/`.

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ The `.agents/skills` directory contains agent skills.
1818

1919
| Skill | Description |
2020
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
21+
| `usethis-cli-modify` | Update GitHub Actions workflows |
22+
| `usethis-file-remove` | Modify the usethis CLI layer (commands, options, help text) and keep documentation in sync |
2123
| `usethis-github-actions-update` | Update GitHub Actions workflows |
22-
| `usethis-file-remove` | Remove files from the project |
2324
| `usethis-pre-commit` | Guidance on pre-commit hooks — this project uses prek, not pre-commit directly |
2425
| `usethis-prek-add-hook` | Add a prek hook for dev |
2526
| `usethis-prek-hook-bespoke-create` | Write bespoke prek hooks as Python scripts for custom project-specific checks |
@@ -48,7 +49,7 @@ External skills can be installed via `npx skills experimental_install` if they a
4849

4950
### Important Instructions about Skills usage
5051

51-
- ALWAYS use relevant agent skills when they are available. Eagerly use skills, if in doubt, assume a skill is relevant.
52+
- ALWAYS use possibly relevant agent skills when they are available. Eagerly use skills, if in doubt, assume a skill is relevant.
5253
- ALWAYS consider the `usethis-qa-static-checks` to be relevant: if you think your task
5354
is complete, always run this skill to check for any issues before finishing.
5455
- ALWAYS mention which skills you've used after completing any task, in PR descriptions, and comments.

docs/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ pyyaml-env-tag==0.1 \
255255
--hash=sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb \
256256
--hash=sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069
257257
# via mkdocs
258-
requests==2.32.4 \
259-
--hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \
260-
--hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422
258+
requests==2.33.0 \
259+
--hash=sha256:3324635456fa185245e24865e810cecec7b4caf933d7eb133dcde67d48cee69b \
260+
--hash=sha256:c7ebc5e8b0f21837386ad0e1c8fe8b829fa5f544d8df3b2253bff14ef29d7652
261261
# via mkdocs-material
262262
six==1.17.0 \
263263
--hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)