Skip to content

Commit 7c7cd96

Browse files
Merge pull request #374 from rest-sh/docs/agents-skills-refresh
docs: refresh AGENTS.md and agent skills for accuracy and CI coverage
2 parents a43498f + 3bebd0c commit 7c7cd96

12 files changed

Lines changed: 155 additions & 90 deletions

File tree

.agents/skills/rsh-docs/SKILL.md

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,29 @@ Use examples that look like real work:
7777
- Explain intentional placeholders when they might look accidental.
7878
- Prefer JSONC for config examples when comments clarify fields.
7979

80+
### Command Example Style
81+
82+
These apply to every command example in docs, guides, recipes, and blog posts:
83+
84+
- Prefer shorthand in examples over `jq` or plain JSON when possible.
85+
- Do not use `get` or `post` in examples when the auto mode is clear (e.g.,
86+
`restish api.rest.sh/example` instead of `restish get api.rest.sh/example`).
87+
- Do not add options for no reason. E.g. `--rsh-no-paginate` when not talking
88+
explicitly about pagination, or `--rsh-columns` when the default output is
89+
fine. Extra flags complicate commands and make examples harder to read.
90+
Avoid `-o lines` unless it significantly improves output readability.
91+
8092
### Shorthand Examples
8193

94+
`restish-example` shortcode commands are extracted and validated by
95+
`scripts/check-doc-examples.rb`: CI enforces that each one is a single direct
96+
`restish` invocation (no pipes, redirects, `;`, `&&`, command substitution, or
97+
backticks) that parses cleanly with shell word-splitting, and a weekly job
98+
executes every one live against `api.rest.sh` and fails on non-zero exit.
99+
Write shortcode examples as commands that actually succeed against the public
100+
API; use plain fenced code blocks for pipelines, local-only setup, or
101+
illustrative failures.
102+
82103
Restish shorthand examples should be shell-safe and match how the docs display
83104
them:
84105

@@ -170,14 +191,11 @@ post reveals a gap.
170191

171192
### Blog Improvement
172193

173-
Whenever you write a new blog post or modify an existing one, spin off a sub-agent to do a review of the changes and suggest improvements, which you should then apply. The review should check for:
194+
Whenever you write a new blog post or modify an existing one, do a separate review pass of the changes (use a sub-agent if available) and apply the resulting improvements. The review should check for:
174195

175196
1. Clarity: Is the post easy to understand? Are there any ambiguous statements or jargon that could be clarified?
176197
2. Engagement: Does the post have a compelling hook? Does it maintain the reader's interest throughout?
177-
3. Accuracy: Are all technical details correct? Are there any factual errors or misleading statements?
178-
1. Commands should prefer shorthand in examples over jq or plain JSON when possible.
179-
2. Do not use `get` or `post` in examples when the auto mode is clear (e.g., `restish api.rest.sh/example` instead of `restish get api.rest.sh/example`).
180-
3. Do not add options for no reason. E.g. `--rsh-no-paginate` when not talking explicitly about pagination, or `--rsh-columns` when the default output is fine. This complicates commands and makes it harder for readers. Another good example is `-o lines` unless it significantly improves readability of the output.
198+
3. Accuracy: Are all technical details correct? Are there any factual errors or misleading statements? Do all examples follow the Command Example Style rules above?
181199
4. Structure: Is the post well-organized? Does it have a logical flow from introduction to conclusion? Do the headings make sense (and are they short enough to not wrap for common screen widths)?
182200
5. Do all the command examples actually make sense? Are they good examples, or could they be improved to better illustrate the point? Are the examples in the right place in the post or should they be moved?
183201

@@ -217,13 +235,21 @@ When migrating older docs, track whether material was retired, already migrated,
217235

218236
## Validation
219237

220-
After meaningful site changes, run:
238+
After meaningful site changes, run what CI runs:
221239

222240
```bash
223-
hugo --source site --quiet
241+
hugo --source site --quiet # site builds (quick check)
242+
npm --prefix site run build # CI parity: social images + Hugo (npm ci once first)
243+
scripts/check-doc-examples.rb # restish-example shortcodes are valid
244+
scripts/check-doc-links.rb # internal links resolve
245+
go run ./cmd/restish-docgen --check # generated regions are not stale
224246
```
225247

226-
For blog changes that affect social cards, run `npm run social-images` from
227-
`site/` or `npm run build` if dependencies are available.
248+
`npm run social-images` parses front matter across `content/en` and can fail
249+
independently of Hugo, so run the npm build for blog and front-matter changes
250+
even when the quick Hugo check passes.
251+
252+
When touching site JavaScript or interactive examples (playground, query
253+
runner, docs interactions), also run `npm --prefix site test`.
228254

229255
Also verify new links, check examples against current CLI behavior, grep touched docs for stale `api.example.com` placeholders and leftover `Source material:` sections, and prefer examples that can later be validated against `api.rest.sh` or promoted into tests.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Restish Docs"
3+
short_description: "Write and maintain Restish documentation"
4+
default_prompt: "Use $rsh-docs to write or update Restish documentation, blog posts, or design docs for a feature or change."

.agents/skills/rsh-product/SKILL.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,13 @@ For source-backed rationale and examples from product/UX references and popular
3737

3838
### 1. Frame The Opportunity
3939

40-
Write the smallest useful product frame before designing commands:
40+
Before designing commands, write the smallest useful product frame: who the user is (first-time user, daily CLI user, API integrator, plugin operator, plugin author, or maintainer), the job they are doing outside Restish, their current workaround, the pain, the intended outcome, and the evidence (issue text, failing example, repeated support question, code/test signal). If evidence is thin, propose the lightest validation instead of inventing a large feature.
4141

42-
- **User**: Who is this for? First-time user, daily CLI user, API integrator, plugin operator, plugin author, or maintainer?
43-
- **Job**: What is the user trying to get done outside Restish?
44-
- **Current workaround**: What command sequence, script, config edit, docs lookup, or mental model do they use today?
45-
- **Pain**: Is the problem failure, slowness, repeated typing, poor discoverability, unsafe behavior, bad output, weak automation, or missing capability?
46-
- **Outcome**: What should be easier, safer, faster, or more understandable after the change?
47-
- **Evidence**: Point to issue text, user report, failing example, design-doc gap, docs search, repeated support question, or code/test signal.
48-
49-
If evidence is thin, propose the lightest validation instead of inventing a large feature.
42+
Concrete evidence sources for Restish: the v1 issue tracker (`rest-sh/restish` on GitHub — dozens of open issues and PRs represent real user demand), `docs/design/000-restish-v1-baseline.md` for v1 behavior, `docs/design/031-compatibility-and-migration.md` for compatibility promises, and `docs/design/037-v2-command-surface-review.md` for prior command-surface decisions.
5043

5144
### 2. Classify The Investment
5245

53-
Classify the work so scope and validation match risk:
54-
55-
- **Reliability**: Makes existing behavior more correct, predictable, secure, or recoverable.
56-
- **Usability**: Makes existing behavior easier to discover, understand, compose, or debug.
57-
- **Feature**: Adds a new user-visible capability.
58-
- **Compatibility**: Preserves or improves v1, plugin, OpenAPI, shell, or documented behavior.
59-
- **Platform**: Improves internal architecture only when it unlocks user-facing reliability, velocity, or simplicity.
60-
61-
Favor reliability and usability improvements when a new feature would deepen existing confusion.
46+
Classify the work — reliability, usability, feature, compatibility, or platform — so scope and validation match risk. Favor reliability and usability improvements when a new feature would deepen existing confusion. Platform work counts only when it unlocks user-facing reliability, velocity, or simplicity.
6247

6348
### 3. Shape The Product Bet
6449

@@ -141,7 +126,7 @@ Use validation proportional to risk:
141126
- **Product validation**: Compare against user jobs, known feedback, current docs, and one or two realistic command transcripts.
142127
- **Usability review**: Run a heuristic pass for status visibility, vocabulary, control/escape, consistency, error prevention, recognition over recall, efficiency, minimal output, error recovery, and help.
143128
- **CLI contract tests**: Cover TTY vs non-TTY when behavior differs, `stdout`/`stderr`, exit codes, help text, output formats, malformed input, cancellation, auth/config precedence, and shell composition.
144-
- **Golden output tests**: Use for intentional formatter/help changes; do not accept drift casually.
129+
- **Output regression tests**: Use for intentional formatter/help changes; do not accept drift casually.
145130
- **Docs checks**: Update `site/` for user behavior and `docs/design/` for significant subsystem behavior; link guides and reference pages both ways.
146131
- **Compatibility checks**: Test v1-style workflows, generated OpenAPI command shape, plugin boundaries, and scripting behavior when touched.
147132

.agents/skills/rsh-release-qa/references/release-gates.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ chmod 600 "$RUN_DIR/empty.json"
9191

9292
```bash
9393
env GOCACHE="$RUN_DIR/go-cache" GOPATH="$RUN_DIR/go-path" go run ./cmd/restish-docgen --check
94+
scripts/check-doc-links.rb
95+
scripts/check-doc-examples.rb
9496
```
9597

98+
The example check's `--mode live` variant executes every docs `restish-example`
99+
against `api.rest.sh`; include it when the release touches command surface or
100+
docs examples and the network allows it.
101+
96102
For the docs site, use a disposable npm cache if the user cache is not writable
97103
or contains permission problems. These commands must run against `site/`, which
98104
contains the docs site's `package.json` and lockfile.

.agents/skills/rsh-release-qa/references/release-risk-map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ checks after reading recent commits.
1515
- Pagination and hypermedia: page params, Link headers, item extraction,
1616
limits, metadata filters, and streaming output.
1717
- Output formatting: terminal color, JSON/table stability, scalar utility
18-
output, plugin formatter behavior, and golden/reference drift.
18+
output, plugin formatter behavior, and fixture/reference drift.
1919
- Plugin lifecycle: command plugins, formatter plugins, hook plugins,
2020
`restish-mcp`, subprocess cleanup, and protocol compatibility.
2121
- User-facing docs and generated command reference.

.agents/skills/rsh-review/SKILL.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ Review code changes with a bug-finding mindset. Prioritize correctness, regressi
6060

6161
## Restish-Specific Watchlist
6262

63-
These are high-value repo-specific checks, not an exhaustive checklist. Use them when relevant; do not force them into unrelated reviews.
63+
These are high-value repo-specific checks, not an exhaustive checklist. Use them when relevant; do not force them into unrelated reviews. For the full catalog of historical bug classes found in past releases, see `../rsh-release-qa/references/findings-mining.md`. When a changed subsystem has a design doc (`docs/design/README.md`), check the diff against its stated invariants.
6464

6565
### Path-specific cues
6666

6767
- `internal/cli/`: flags, exit codes, stdin/stdout/stderr, config precedence, generated commands
6868
- `internal/request/`: content negotiation, auth headers, redirects, pagination, retries, streaming, cancellation
69-
- `internal/output/`: formatter drift, golden tests, terminal width behavior, stable ordering
69+
- `internal/output/`: formatter drift, regression fixtures, terminal width behavior, stable ordering
7070
- `internal/config/`: defaults, file permissions, migrations, backward compatibility
7171
- `internal/plugin/` and `cmd/restish-*`: plugin protocol, subprocess lifecycle, wire compatibility
7272
- `cmd/restish` and `site/`: user-facing CLI behavior, examples, docs impact
@@ -99,27 +99,42 @@ Config fields should not be added unless their behavior is implemented. Otherwis
9999

100100
Spec-loading or command-generation changes can break existing workflows indirectly. Check for backward compatibility in generated command shape, naming, argument expectations, and operation discovery.
101101

102-
### Output formatting and golden tests
102+
### Spec and operation cache invalidation
103103

104-
Intentional formatter changes should usually come with targeted regression coverage or golden updates. Unintentional output drift is a common source of user-visible regressions.
104+
A recurring source of fixes: stale generated commands after config or spec changes. Caches are keyed by base URL, operation base, server variables, and raw spec hash. Changes to `api edit`/`api connect`, profiles, base URLs, or spec loading must invalidate or refresh the relevant caches, and concurrent `api connect` runs must not clobber each other's entries.
105+
106+
### OAuth and auth concurrency
107+
108+
Token refreshes must stay serialized; discovery transports and OAuth state are shared across generated commands. Changes to `internal/auth` should be checked for refresh races, cache-key reuse across profiles/issuers, and browser-launch behavior (`$BROWSER` handling, Linux flows).
109+
110+
### v1 → v2 migration of persisted state
111+
112+
Changing config schema, cache key formats, or credential storage breaks existing user state unless migrated. Past fixes migrated legacy token cache keys, legacy `tls.cert`/`tls.key` fields, and added migration warnings. New formats need a mapping from the old one or an explicit, tested migration error.
113+
114+
### Command surface and help contracts
115+
116+
`internal/cli/command_surface_test.go` locks the built-in command tree, help grouping, error-message UX, and removed pre-release names. Adding, renaming, or regrouping commands should update it deliberately — treat unexplained churn there as a regression signal.
117+
118+
### Output formatting
119+
120+
Intentional formatter changes should usually come with targeted regression coverage. Unintentional output drift is a common source of user-visible regressions.
105121

106122
### Auth, pagination, filtering, and caching flows
107123

108124
Changes in these areas often regress behavior only in realistic end-to-end paths. Review interactions, not just isolated helpers.
109125

110126
For auth, redaction, and cache metadata changes, check both positive behavior and negative leakage boundaries: where credentials are applied, where they must not be applied, what gets persisted, and what appears in errors or traces. Keep findings tied to the PR's changed paths.
111127

128+
`internal/secrets` holds the central allow-lists for recognizing credential-like fields; new secret-ish field names belong there, not in ad-hoc checks. Past fixes covered suffixed fields (`confirm_password`), URL userinfo and query credentials in network errors, and avoiding false positives on ordinary fields like `max_tokens`.
129+
112130
### Test buffer races
113131

114132
Tests that share a `bytes.Buffer` across concurrent writers can hide data races, especially when subprocess stderr/stdout is wired into test buffers.
115133

116134
## Verification Hints
117135

118-
- Prefer the narrowest meaningful test first: `go test ./internal/cli/...`, `go test ./internal/request/...`, `go test ./internal/output/...`, or another touched package.
119-
- Run `go test ./...` for broad or shared changes.
120-
- Run `go test -tags=integration ./...` before approving CLI or plugin behavior changes with integration risk.
121-
- Update golden files only when behavior intentionally changed.
122-
- Consider `go test -race ./...` when concurrency, subprocess handling, or shared buffers are touched.
136+
- Run the AGENTS.md verification ladder: narrowest touched package first, then `go test ./...`, then `-tags=integration` for CLI/plugin behavior changes, and `-race` when concurrency, subprocess handling, or shared buffers are touched.
137+
- Run `go run ./cmd/restish-docgen --check` when CLI surface or help text changed; CI fails on stale generated docs regions.
123138

124139
## Example Findings
125140

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Restish Review"
3+
short_description: "Find bugs and risks in Restish changes"
4+
default_prompt: "Use $rsh-review to review the current Restish code changes for bugs, regressions, missing tests, and repo-specific risks."

0 commit comments

Comments
 (0)