Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ When `PREPUSH_CI=full` is set, a `commit-msg` hook writes the trailer `Prepush-C

### 1. Let an agent set it up

The quickest way is to hand the job to a coding agent such as Claude Code, with the skill this repository ships. Give it this prompt:
The quickest way is to hand the job to a coding agent such as Claude Code, with the skill this package ships. Give it this prompt:

```text
Follow the skill at https://github.com/CapeOfGoodCode/prepush-ci/blob/main/skills/prepush-ci-setup/SKILL.md to set this repository up with prepush-ci.
Run uvx prepush-ci skill and follow what it prints to set this repository up with prepush-ci.
```

To keep the skill with a project, copy the folder `skills/prepush-ci-setup/` into `.claude/skills/` of the repository; the agent then finds it by itself.
Until the first release is on PyPI, run the command from the repository instead: `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill`. In Claude Code you can add the skill as a plugin instead: `/plugin marketplace add CapeOfGoodCode/prepush-ci`, then `/plugin install prepush-ci@prepush-ci`.

To keep the skill with a project, run `prepush-ci skill --write`; it writes the skill to `.claude/skills/prepush-ci-setup/SKILL.md` of the repository, where the agent finds it by itself.

The agent needs a git repository with a remote it can push branches to, and a package index it can reach to install `prepush-ci`. It works on a branch and opens a pull request with the result; it does not push to the default branch.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-10-13
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Decisions

- **The prompt runs `uvx prepush-ci skill`.** The reader may have nothing installed yet, and `uvx` runs the command without installing; the skill it prints is the one of the version run (`skill-command`: no repository, no network). Rationale: it is the sentence #138 was built for.
- **The project-skill way is `prepush-ci skill --write`, not copying `skills/prepush-ci-setup/`.** A reader from PyPI has no checkout to copy from; `--write` puts the file where the folder copy did. Rationale: the folder copy cannot be followed by the reader this change is for.
- **The plugin commands are pinned by the manifests.** The README names the marketplace `prepush-ci` and the plugin `prepush-ci`, so a spec compares `prepush-ci@prepush-ci` with `.claude-plugin/marketplace.json`; a rename there fails the README spec. Rationale: AGENTS.md, "Docs say only what is pinned or run".
- **The slash commands are code spans, the prompt stays the only code block of the step.** The existing helper of the README spec reads the step's single block as the prompt. Rationale: no second block to reconcile.
- **A form that runs before the release.** PyPI has only 0.0.0 without the `skill` command, and the release waits for this change, so the step also gives `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill` under the words step 2 already uses, "until the first release is on PyPI". Rationale: blocking on the release would wait on itself; the form is pinned by `skill-command` and the command check.
- **A new requirement replaces the old.** The old one pinned the link; it is REMOVED and "The agent step hands the agent the skill command" is ADDED, so no scenario says the opposite of its name. The walk requirement drops the pointer "(previous requirement)", which no longer points at it.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Issue: #139

## Why

The README's agent setup step hands the agent a link to `SKILL.md` on `main`, which can name commands the installed version lacks and needs GitHub access. The tool now ships its skill as a command and as a Claude Code plugin (#138), so a reader who follows the README should be given those; otherwise they keep using the link that #138 exists to replace (#1, the skill that tells an agent to set the tool up).

## What Changes

- The prompt of usage step 1 tells the agent to run `uvx prepush-ci skill` and follow what it prints, instead of linking to `SKILL.md` on `main`. The absolute link is no longer required, and no longer the prompt.
- Because PyPI has no release with `skill` yet, the step also gives the form that runs from the repository, `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill`, "until the first release is on PyPI".
- The step names the Claude Code plugin as the other way: `/plugin marketplace add CapeOfGoodCode/prepush-ci`, then `/plugin install prepush-ci@prepush-ci`.
- The way to keep the skill with a project becomes `prepush-ci skill --write`, which writes `.claude/skills/prepush-ci-setup/SKILL.md`, instead of copying a folder of a checkout the reader may not have.
- The rest of the step (what the agent needs, delivers and asks; the manual core) is unchanged.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

- `readme`: the agent step requirement is replaced (prompt, pre-release form, plugin), the walk requirement loses a pointer and the requirement that names the other way and the manual path (`skill --write`).

## Impact

`README.md` usage step 1 and `tests/integration/readme_spec.py`. No code of the tool changes: `skill`, `--write` and the plugin exist (#138).
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## ADDED Requirements

### Requirement: The agent step hands the agent the skill command
The usage section SHALL open with a step before the install step that sets a repository up through an agent with the skill. The step SHALL give, in a code block, the prompt to hand the agent; the prompt SHALL ask the agent to run `uvx prepush-ci skill`, follow what it prints, and set prepush-ci up in the repository. The step SHALL NOT link to `skills/prepush-ci-setup/SKILL.md` on GitHub.

#### Scenario: The agent step comes first
- **WHEN** the headings of the usage section are read in order
- **THEN** the agent setup step is the first, before the install step

#### Scenario: A prompt to hand over
- **WHEN** a reader looks at the code block of the agent step
- **THEN** it contains `uvx prepush-ci skill` and asks the agent to follow it and to set prepush-ci up in the repository

#### Scenario: No link to the skill on GitHub
- **WHEN** the check takes the links of the agent step
- **THEN** none of them is a link to `skills/prepush-ci-setup/SKILL.md` on the default branch

#### Scenario: The prompt's command exists
- **WHEN** the check reads the code block of the agent step
- **THEN** it finds the invocation `prepush-ci skill` and reports no unknown command or option

### Requirement: The agent step has a form that runs before the first release
Because the first release is not on PyPI yet, the agent step SHALL also give, in a code span, the form that runs from the repository, `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill`, with the words "until the first release is on PyPI" as the install step has them.

#### Scenario: Before the first release
- **WHEN** a reader looks at the agent step
- **THEN** it has the code span `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill` next to the words "until the first release is on PyPI", and the check finds `prepush-ci skill` in it with no unknown command or option

### Requirement: The agent step names the Claude Code plugin
The agent step SHALL name the Claude Code plugin as the other way to give the agent the skill, with the commands `/plugin marketplace add CapeOfGoodCode/prepush-ci` and `/plugin install prepush-ci@prepush-ci`, in code spans.

#### Scenario: The plugin way
- **WHEN** a reader looks at the agent step
- **THEN** it has the code spans `/plugin marketplace add CapeOfGoodCode/prepush-ci` and `/plugin install prepush-ci@prepush-ci`

#### Scenario: The plugin commands match the manifests
- **WHEN** the check compares the `<plugin>@<marketplace>` of the install command with the plugin name and the marketplace name in `.claude-plugin/marketplace.json`
- **THEN** they are equal

## MODIFIED Requirements

### Requirement: The usage section walks from install to a push
The README SHALL have a usage section. After the agent setup step its steps, in this order, are: install the package; set a repository up with `init`; opt in with `PREPUSH_CI=full`; what a commit does (writes the trailer) and what a push does (refuses a tip with the trailer unless the check passes on it); and the CI gate that skips on the trailer, with a pointer to `docs/ci/` or `init --ci`.

#### Scenario: The steps in order
- **WHEN** the headings and code blocks of the usage section are read in order
- **THEN** the agent setup step comes before the install step, which comes before the `init` step, which comes before the `PREPUSH_CI=full` step, which comes before the step on what a commit and a push do, which comes before the CI gate step

#### Scenario: A step left out
- **WHEN** the check reads a usage section without the step on what a commit and a push do
- **THEN** it reports that step as missing

#### Scenario: The gate step names its source
- **WHEN** a reader looks at the CI gate step
- **THEN** it names `docs/ci/` or `init --ci` and says the default branch always runs CI in full

### Requirement: The agent step names the other way and the manual path
The agent step SHALL name the way to keep the skill with a project: `prepush-ci skill --write`, which writes it to `.claude/skills/` of the repository. It SHALL say that the steps after it are the manual core and name what the skill does on top: it finds or writes the command that runs the full check, sets up the services and the preflight so that a missing service fails the check, extends the SessionStart script with dependencies and services, and proves the setup with `doctor`.

#### Scenario: The skill as a project skill
- **WHEN** a reader looks at the agent step
- **THEN** it names `prepush-ci skill --write` and `.claude/skills/` as the way to keep the skill in a repository

#### Scenario: The manual steps are the core
- **WHEN** a reader looks at the end of the agent step
- **THEN** it says the steps that follow are the manual core, and names the check command, the services and preflight, the SessionStart script and the `doctor` proof as what the skill does on top

## REMOVED Requirements

### Requirement: The usage section starts with the agent setup
**Reason**: Replaced by "The agent step hands the agent the skill command": the prompt no longer carries a link to the skill on GitHub, so its scenarios on the link and the prompt change, and the replacement has a new name instead of a scenario that says the opposite of its name.
**Migration**: None; the new requirement keeps the scenario "The agent step comes first".
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tasks

## 1. The agent step

- [x] 1.1 Change usage step 1 of `README.md`: the prompt asks the agent to run `uvx prepush-ci skill` and follow it, the pre-release form and the plugin commands follow as code spans, and the project skill is kept with `prepush-ci skill --write`; verify with a test for every scenario of the two requirements
- [x] 1.2 Replace the tests of the link (`test_the_link_to_the_skill_is_absolute_…`, `test_the_agent_step_has_a_prompt_with_the_link_…`, `test_the_agent_step_names_the_skill_folder_…`) with tests named after the new scenarios
- [x] 1.3 Run `sh scripts/ci` and verify it passes

## Workflow follow-up

- Archive the change (`openspec archive 139-readme-skill-command`) before the pull request is marked ready.
58 changes: 40 additions & 18 deletions openspec/specs/readme/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,12 @@ Each default the README lists SHALL equal what the config loads when only `check
- **WHEN** the check reads a README text that gives `cache` the default `false`
- **THEN** it reports that the default of `cache` is `true`

### Requirement: The usage section starts with the agent setup
The usage section SHALL open with a step before the install step that sets a repository up through an agent with the skill. The step SHALL give, in a code block, the prompt to hand the agent; the prompt SHALL name the skill with an absolute link to `skills/prepush-ci-setup/SKILL.md` on the default branch of the repository and SHALL ask the agent to set prepush-ci up in the repository.

#### Scenario: The agent step comes first
- **WHEN** the headings of the usage section are read in order
- **THEN** the agent setup step is the first, before the install step

#### Scenario: The link names a file of the repository
- **WHEN** the check takes the link to the skill from the agent step and resolves its path against the repository
- **THEN** the link is absolute and the path names an existing file, `skills/prepush-ci-setup/SKILL.md`

#### Scenario: A prompt to hand over
- **WHEN** a reader looks at the code block of the agent step
- **THEN** it contains the link to the skill and asks the agent to set prepush-ci up in the repository

### Requirement: The agent step names the other way and the manual path
The agent step SHALL name the other way to give an agent the skill: copy the folder `skills/prepush-ci-setup/` into `.claude/skills/` of the repository. It SHALL say that the steps after it are the manual core and name what the skill does on top: it finds or writes the command that runs the full check, sets up the services and the preflight so that a missing service fails the check, extends the SessionStart script with dependencies and services, and proves the setup with `doctor`.
The agent step SHALL name the way to keep the skill with a project: `prepush-ci skill --write`, which writes it to `.claude/skills/` of the repository. It SHALL say that the steps after it are the manual core and name what the skill does on top: it finds or writes the command that runs the full check, sets up the services and the preflight so that a missing service fails the check, extends the SessionStart script with dependencies and services, and proves the setup with `doctor`.

#### Scenario: The skill as a project skill
- **WHEN** a reader looks at the agent step
- **THEN** it names `skills/prepush-ci-setup/` and `.claude/skills/` as the way to install the skill in a repository
- **THEN** it names `prepush-ci skill --write` and `.claude/skills/` as the way to keep the skill in a repository

#### Scenario: The manual steps are the core
- **WHEN** a reader looks at the end of the agent step
Expand Down Expand Up @@ -148,7 +133,7 @@ The agent step SHALL say that the agent always stops to ask the user to confirm
- **THEN** it says the agent also asks which hook manager to use when there are two, for the default branch when `origin` is missing, cannot be reached, has no default branch, or the clone does not fetch it (a single-branch clone of another branch), and for a yes before it removes a hook, and not otherwise

### Requirement: The usage section walks from install to a push
The README SHALL have a usage section. After the agent setup step (previous requirement) its steps, in this order, are: install the package; set a repository up with `init`; opt in with `PREPUSH_CI=full`; what a commit does (writes the trailer) and what a push does (refuses a tip with the trailer unless the check passes on it); and the CI gate that skips on the trailer, with a pointer to `docs/ci/` or `init --ci`.
The README SHALL have a usage section. After the agent setup step its steps, in this order, are: install the package; set a repository up with `init`; opt in with `PREPUSH_CI=full`; what a commit does (writes the trailer) and what a push does (refuses a tip with the trailer unless the check passes on it); and the CI gate that skips on the trailer, with a pointer to `docs/ci/` or `init --ci`.

#### Scenario: The steps in order
- **WHEN** the headings and code blocks of the usage section are read in order
Expand All @@ -168,3 +153,40 @@ After the CI gate step the usage section SHALL say what to do when the full chec
#### Scenario: A refused push
- **WHEN** a reader looks at the step after the CI gate step
- **THEN** it names `prepush-ci run`, `prepush-ci doctor` and `prepush-ci strip` with one sentence each

### Requirement: The agent step hands the agent the skill command
The usage section SHALL open with a step before the install step that sets a repository up through an agent with the skill. The step SHALL give, in a code block, the prompt to hand the agent; the prompt SHALL ask the agent to run `uvx prepush-ci skill`, follow what it prints, and set prepush-ci up in the repository. The step SHALL NOT link to `skills/prepush-ci-setup/SKILL.md` on GitHub.

#### Scenario: The agent step comes first
- **WHEN** the headings of the usage section are read in order
- **THEN** the agent setup step is the first, before the install step

#### Scenario: A prompt to hand over
- **WHEN** a reader looks at the code block of the agent step
- **THEN** it contains `uvx prepush-ci skill` and asks the agent to follow it and to set prepush-ci up in the repository

#### Scenario: No link to the skill on GitHub
- **WHEN** the check takes the links of the agent step
- **THEN** none of them is a link to `skills/prepush-ci-setup/SKILL.md` on the default branch

#### Scenario: The prompt's command exists
- **WHEN** the check reads the code block of the agent step
- **THEN** it finds the invocation `prepush-ci skill` and reports no unknown command or option

### Requirement: The agent step has a form that runs before the first release
Because the first release is not on PyPI yet, the agent step SHALL also give, in a code span, the form that runs from the repository, `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill`, with the words "until the first release is on PyPI" as the install step has them.

#### Scenario: Before the first release
- **WHEN** a reader looks at the agent step
- **THEN** it has the code span `uvx --from git+https://github.com/CapeOfGoodCode/prepush-ci prepush-ci skill` next to the words "until the first release is on PyPI", and the check finds `prepush-ci skill` in it with no unknown command or option

### Requirement: The agent step names the Claude Code plugin
The agent step SHALL name the Claude Code plugin as the other way to give the agent the skill, with the commands `/plugin marketplace add CapeOfGoodCode/prepush-ci` and `/plugin install prepush-ci@prepush-ci`, in code spans.

#### Scenario: The plugin way
- **WHEN** a reader looks at the agent step
- **THEN** it has the code spans `/plugin marketplace add CapeOfGoodCode/prepush-ci` and `/plugin install prepush-ci@prepush-ci`

#### Scenario: The plugin commands match the manifests
- **WHEN** the check compares the `<plugin>@<marketplace>` of the install command with the plugin name and the marketplace name in `.claude-plugin/marketplace.json`
- **THEN** they are equal
Loading
Loading