Skip to content

Fix stale/incorrect CLI claims in skills and AGENTS.md - #27

Open
ndenny wants to merge 12 commits into
developfrom
fix/skill-docs-live-cli-review
Open

ndenny wants to merge 12 commits into
developfrom
fix/skill-docs-live-cli-review

Conversation

@ndenny

@ndenny ndenny commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Live-tested all 8 claude-skills workflows, the 3 embedded setup skills (skills/embed/*.md), AGENTS.md, and the README examples against apimetrics-qc, and fixed every confirmed discrepancy between the docs and actual CLI/server behavior. Enum and command-availability claims were also cross-checked against the production spec, so the docs hold for both environments. One CLI behavior change: apimetrics onboard now prints the eight workflow skills as well as the setup guides.

Command-name / flag fixes

  • list-call-results doesn't exist → list-results-by-call. Its flags are --from/--time/--result-category/--cursor/--limit (default 100, one page per call), not --since/--before; list-results likewise takes --from/--time.
  • run-call doesn't exist → run-monitor <id> runs API, browser, and MCP monitors alike. It requires a body ({} minimum).
  • list-slos/get-slo/create-slo/update-slo/delete-slo don't exist. SLOs are one per project: get-project-slo / update-project-slo (creates one if none exists) / delete-project-slo, scoped via include_tags/exclude_tags. apimetrics-slo-review is rewritten around this.
  • list-schedules-for-call doesn't exist → list-schedules-by-call.
  • The root --help example used create-monitor, which doesn't exist in either environment → a working create-call shorthand example (cli/cli.go).
  • On QC, list-calls/create-call/get-call/update-call/delete-call are deprecated in favour of /api/3/monitors/ commands (list-api-monitors, create-api-monitor with a flat body, …). Production's spec still lists the v2 commands and has no v3 replacements, so the docs keep the v2 commands, explain the deprecation warning, name the replacements, and prefer list-monitors/get-monitor, which exist in both.

Result and query semantics

  • result_category is PASS/SLOW/WARNING/FAIL (HTTP 4xx lands in WARNING, connection errors in FAIL) and is empty while a run is queued; meta.result carries QUEUED, then COMPLETE/HTTP_CLIENT_ERROR/CONNECTION_ERROR/…. Polling now waits on meta.result. --result-category silently ignores any other value and returns every category — documented wherever the flag appears.
  • Result rows are {id, meta, timing} (meta.call_id, meta.start_time, timing.total ms); the response_time/test/created fields the docs named don't exist.
  • get-result for ANALYST+ callers returns the full object by default (response headers/body, request method/URL/headers, DNS/TLS detail, timing); --mode full adds the request body, messages, and certificate detail. Below-ANALYST callers get meta and timing only.
  • Query metric lists completed per monitor type (API/browser/MCP differ); omitting status includes failed runs; group_by: interval requires interval; project-wide DNS diagnostics ignore group_by: monitor.
  • SLO period is DAY/WEEK/MONTH; get-project-slo returns platform defaults (created: null) when none is stored; get-call-passfail-total's top-level stat.total counts only uncategorised results, so sum stat.<CATEGORY>.total for the run count. Daily buckets are UTC.

Output and input

  • -f paths are rooted at the response envelope, so they start with body., and must be single-quoted in zsh; a non-matching path prints nothing. The README's -f and -o table examples are fixed.
  • CLI Shorthand values containing // must be quoted (url: '"https://…"'), and shorthand also reads stdin, so non-interactive callers need </dev/null or the command blocks.
  • list-schedules/list-monitors return {data, meta}.
  • list-auth-settings and monitor configs return credentials in clear text, so the audit and investigation workflows now project them with -f.

Monitor setup

  • MCP monitors need a Streamable HTTP endpoint (usually /mcp); SSE-only /sse endpoints fail with 405. Every step needs timeout_ms and wait_ms — the old example returned 422.
  • 422 is body validation (detail[].loc names the field) and 400 is a rejected value; quota exhaustion is a separate Project is out of quota error, not 422.
  • create-call's meta accepts name/description/tags/workspace (domain is derived from the URL). set-call-conditions now has a working example and its source/operator vocabulary; projects carry default conditions (get-project-conditions).
  • Creating a project does not grant the creator access; a follow-up create-project-access is required. add-call-to-schedule rejects invalid or other-project IDs with 400.
  • Fixed the nonexistent --api-key flag and result.success/result.failure_reason shape in the embedded setup skills.

bulk (config-as-code)

  • apimetrics:/<collection> isn't a resolvable scheme; the skill uses a real host+path, and the bulk help examples are fixed (including a --match example that matched nothing).
  • bulk init/status/diff/pull work against /api/2/calls/, but bulk push of an unchanged checkout file fails — PUT rejects its read-only fields. The skill now reduces changed files to the writable fields (that PUT is a partial update), saves a baseline copy for rollback, and passes the same --project-id on every bulk command, because the checkout doesn't record its project.
  • Documented, not fixed: bulk push prints Push complete. and exits 0 when uploads fail, bulk init crashes on a one-resource list, and --match resolves top-level fields only.

onboard

  • AGENTS.md and the README said apimetrics onboard prints every workflow; it printed only the three setup guides. printSkills now also prints the eight SKILL.md files, and TestPrintSkillsIncludesEveryWorkflow checks every embedded file appears in its output.

Detail

How this was tested

Built apimetrics-qc from this branch and ran each workflow end to end in the contxt org's "Nick CLI test 1/2/3" projects: project creation and access grants, API/browser/MCP monitor creation (heredoc and shorthand), conditions, schedules, run-monitor on all three types, result polling and retrieval, SLO create/update/delete (restored afterwards), the query-* commands, and a full bulk init → edit → push → rollback cycle in an isolated project. Those test projects and monitors are kept for future testing. go test ./... passes.

Server-side behaviour found (not addressed here)

  • create-project-access sets the grantee only from account_id, which defaults to the caller; email is an informational label. A body with email alone therefore grants the caller while recording someone else's email — ported legacy behaviour, but a footgun. The bootstrap skill now says so.
  • get-result-content returned "Content not found" even for a result's own content_path.
  • get-call-passfail-total's top-level stat.total counts only uncategorised results (deliberate parity with the legacy aggregation), so the run count is the sum of the per-category totals. The skills and AGENTS.md say so.

🤖 Generated with Claude Code

Live-tested all 8 claude-skills workflows plus the three embedded
onboarding skills against a real apimetrics-qc account and org, and
fixed every confirmed discrepancy:

- list-call-results doesn't exist -> list-results-by-call, whose flags
  are --from/--result-category/--cursor/--limit, not --since/--before
  (also fixed on list-results itself).
- run-call doesn't exist -> run-monitor <id> runs API, browser, and MCP
  monitors alike.
- list-slos/get-slo/create-slo/update-slo/delete-slo don't exist. SLOs
  are one per project: get-project-slo/update-project-slo (creates if
  none exists)/delete-project-slo, scoped by include_tags/exclude_tags
  with no scope/scope_id field. Rewrote apimetrics-slo-review's model
  accordingly.
- list-schedules-for-call doesn't exist -> list-schedules-by-call.
- get-result's "always a summary" claim only holds for below-ANALYST
  callers; ANALYST+ (most project members) get the full
  request/response/timing/DNS/TLS object back by default.
- project-bootstrap's "the CLI cannot create a project" claim was
  wrong reasoning (create-project-in-org exists as a flat command
  outside the `project` noun-group) even though it happened to be
  right in effect for non-admin accounts. Documented the org-admin
  path, and the previously-undocumented gotcha that creating a project
  does not grant the creator access to it (needs a follow-up
  create-project-access call).
- bulk init's apimetrics:/<collection> scheme doesn't resolve -- it's
  a cosmetic example string in the CLI's own --help (bulk/commands.go)
  with no actual scheme-resolution logic behind it, and fails with a
  literal DNS lookup on host "apimetrics". Fixed the example in
  commands.go to a resolvable placeholder host, and pointed the skill
  at a real host+path instead.
- Three embedded onboarding skills (skills/embed/*.md) referenced a
  nonexistent --api-key flag in their error-recovery sections, and
  setup-api-monitor.md additionally had the run-call/list-call-results
  bugs above plus a result.success/failure_reason shape that doesn't
  exist (real field is result_category, PASS/FAIL/WARN/ERROR/TIMEOUT/
  QUEUED).

performance-analytics and the shared operating-rules boilerplate were
otherwise verified correct and left alone where no bug was found.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKRzfBhwWbRrARvJsbFnaY

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Several updated docs are internally inconsistent about result status field naming and one bulk init example contradicts its surrounding “URL/link” guidance, which could mislead users copying these workflows.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 Low severity

Open (4)
What changed in this PR

Updates the CLI’s agent-facing documentation (AGENTS.md, installable skills, and embedded onboarding skills) to remove stale command/flag/response-shape claims and align guidance with the current observed CLI surface, plus a small help-text tweak in the hidden bulk command group.

Changes:

  • Fixes multiple incorrect command names/flags across skills (e.g., run-monitor vs run-call, list-results-by-call, --from/--time, per-project SLO commands).
  • Updates embedded onboarding skills to remove the nonexistent --api-key recovery path and to use the correct result-status field naming.
  • Replaces the bulk help example that previously used an unsupported apimetrics:/...-style address with a standard host/path example.
File Description
skills/​embed/​setup-mcp-monitor.md Updates polling/validation field name and removes nonexistent --api-key guidance.
skills/​embed/​setup-browser-monitor.md Updates polling/validation field name and removes nonexistent --api-key guidance.
skills/​embed/​setup-api-monitor.md Replaces nonexistent run-call/list-call-results usage with run-monitor/list-results-by-call and updates polling guidance.
skills/​claude-skills/​apimetrics-weekly-health-review/​SKILL.md Aligns list/result commands and flags; updates SLO/list envelope guidance.
skills/​claude-skills/​apimetrics-slo-review/​SKILL.md Reworks SLO model and commands to “one SLO per project” semantics.
skills/​claude-skills/​apimetrics-project-bootstrap/​SKILL.md Updates project creation/access notes and run/result guidance.
skills/​claude-skills/​apimetrics-monitoring-estate-audit/​SKILL.md Updates SLO and schedule-by-call guidance plus list flag corrections.
skills/​claude-skills/​apimetrics-incident-triage/​SKILL.md Updates list-results flags and related guidance.
skills/​claude-skills/​apimetrics-failure-investigation/​SKILL.md Updates list/run commands and result-detail guidance.
skills/​claude-skills/​apimetrics-config-as-code/​SKILL.md Documents bulk init address behavior and updates recommended bulk init usage.
bulk/​commands.go Updates the bulk group example string to use a standard host/path address format.
AGENTS.md Updates command naming, list envelope notes, SLO model, and bulk-init guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread AGENTS.md Outdated
Comment thread skills/claude-skills/apimetrics-config-as-code/SKILL.md Outdated
Comment thread skills/claude-skills/apimetrics-incident-triage/SKILL.md Outdated
Comment thread skills/claude-skills/apimetrics-project-bootstrap/SKILL.md Outdated
…lk init example

- Standardize on result_category as the PASS/FAIL/WARN/ERROR/TIMEOUT/QUEUED
  field everywhere (AGENTS.md, failure-investigation, incident-triage,
  project-bootstrap), matching the embedded skills and the rest of this PR.
  A separate result field carries a transport-completion value (e.g.
  COMPLETE), which is now called out explicitly where the two could be
  confused.
- config-as-code: drop the redundant/inconsistent first bulk init example
  (it set url to a bare id without --url-template, contradicting the
  documented url/uri/self/link-or-url-template guidance) and keep the
  single --url-template form, which was confirmed working live.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKRzfBhwWbRrARvJsbFnaY
@ndenny
ndenny marked this pull request as draft September 19, 2026 03:44
@ndenny
ndenny requested a balanced review from Copilot September 19, 2026 03:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are documentation corrections plus one cosmetic example string; the verifiable claim (broken apimetrics:/ scheme) checks out against cli.FixAddress and the apimetrics config key, and the edits are internally consistent with prior feedback resolved.

Review effort: Balanced
Findings: None

Resolved since last review (4)

Several fixes from the previous commits were written as a diff against
the prior (incorrect) text -- "there is no list-call-results (use
list-results-by-call)", "the apimetrics:/<collection> scheme does not
work", "there is no run-call" -- which only makes sense to someone who
saw the old version. A fresh reader (a new agent invoking the skill,
someone who never saw the prior draft) has no context for what's being
negated. Rewrote all of these to state the current CLI surface
directly and positively, and swapped the placeholder `<call-or-monitor-id>`
positional argument name for `<monitor-id>`, matching this codebase's
convention of "monitor" as the umbrella term for an API call/browser
test/MCP test.

Left alone the handful of pre-existing "there is no --api-key flag" /
"there is no --body/--data/-d flag" warnings, which predate this PR,
don't reference anything removed from these docs, and read fine
standalone as guardrails against a very plausible wrong guess.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKRzfBhwWbRrARvJsbFnaY
@ndenny
ndenny requested a balanced review from Copilot September 21, 2026 14:31
@ndenny
ndenny marked this pull request as ready for review September 21, 2026 14:31
@ndenny
ndenny enabled auto-merge September 21, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The slo-review skill introduces an incorrect flag --apimetrics-project-id, whereas the CLI's actual global flag is --project-id, contradicting this PR's goal of removing inaccurate CLI claims.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread skills/claude-skills/apimetrics-slo-review/SKILL.md Outdated
--apimetrics-project-id does exist (confirmed live in get-project-slo
and update-project-slo's own generated option schema), but it isn't
the documented, general-purpose mechanism for targeting a different
project. That's the global --project-id flag (registered in
cli/cli.go, and what cli/config.go's "no active project" error tells
users to pass), so point at that instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKRzfBhwWbRrARvJsbFnaY

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The updated bulk top-level help example still uses a potentially stale /monitors path and should be aligned with the repo’s other bulk init examples to avoid reintroducing misleading CLI help output.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Low severity Top-level bulk help uses stale /monitors path

bulk/​commands.go:317

The top-level bulk command help example uses the path /monitors, but this endpoint/path isn't referenced anywhere else in the repo (and the bulk init subcommand examples use /users). Keeping /monitors here risks reintroducing a stale or misleading hint in CLI help text; consider aligning it with the bulk init examples.

commands.go:317's example used /monitors while the bulk init subcommand's
own examples (line 346, pre-existing) use /users -- inconsistent for no
reason. Match them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YKRzfBhwWbRrARvJsbFnaY

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The documentation's correctness depends on many command-name and behavioral claims that are generated at runtime from the live OpenAPI spec and cannot be independently verified from repository source, so a human familiar with the live CLI should confirm them.

Review effort: Balanced
Findings: None

Comment thread skills/claude-skills/apimetrics-slo-review/SKILL.md Outdated
Comment thread skills/embed/setup-mcp-monitor.md Outdated
Comment thread AGENTS.md Outdated
Comment thread skills/claude-skills/apimetrics-slo-review/SKILL.md Outdated
ndenny and others added 3 commits September 23, 2026 16:43
- State facts directly instead of contrasting with what earlier skill
  text claimed (one SLO per project, list-results flags, run-monitor,
  project creation).
- Remove the --api-key references from AGENTS.md and the embedded
  setup skills.
- Drop get-project-slo from the list-envelope summaries.
- slo-review: derive availability attainment from get-call-passfail-range/
  get-call-passfail-total and latency from query-*-performance, keeping
  list-results for drilling into violations; add the same guidance to
  AGENTS.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VcnM8iRzyY2ZEyNi6iyp28
- Drop the "not noun/verb groups" and "Do not invent --body" lines from
  the shared skill preamble, and the matching "There is no --body" line
  from the embedded setup skills.
- skills.go: generated agent guide states the flat-command and stdin
  facts directly, matching AGENTS.md.
- weekly-health-review: take pass/warning/failure counts from
  get-call-passfail-range instead of paging list-results and counting;
  keep list-results for failure detail. SLO attainment points at the
  slo-review method. AGENTS.md table row updated to match.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VcnM8iRzyY2ZEyNi6iyp28
…e-cli-review

# Conflicts:
#	skills/skills.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

One embedded-skill "hard rule" claims list-results-by-call works across API/browser/MCP monitors, contradicting the API-call-only scoping used everywhere else in this PR.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Low severity

Open (1)

Comment thread skills/embed/setup-api-monitor.md Outdated
… API-call only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The PR's core value is the factual accuracy of many CLI behavior, command-name, and flag claims that cannot be statically verified (the command tree is generated at runtime from a live OpenAPI spec and role-based server responses), so domain/human verification is warranted even though the two code edits are benign and internally consistent.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Comment thread skills/embed/setup-api-monitor.md Outdated
Comment thread skills/embed/setup-api-monitor.md Outdated
Comment thread skills/claude-skills/apimetrics-failure-investigation/SKILL.md Outdated
Comment thread skills/claude-skills/apimetrics-failure-investigation/SKILL.md Outdated
Describe it in the general case with <monitor-id> rather than as API-call only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ndenny
ndenny requested a review from rujames October 9, 2026 20:16
ndenny and others added 2 commits October 9, 2026 13:59
…lows

Verified every skill, AGENTS.md, and README example against apimetrics-qc
and fixed what the CLI and server actually do:

- result_category is PASS/SLOW/WARNING/FAIL (empty while queued; poll on
  meta.result); --result-category silently ignores other values. Result
  rows are {id, meta, timing}; there is no response_time/test/created.
- -f paths are rooted at the response envelope (body.), and must be quoted
  for zsh; shorthand needs URLs quoted and </dev/null when non-interactive.
- MCP monitors need a Streamable HTTP endpoint and steps need wait_ms.
- SLO period is DAY/WEEK/MONTH; get-project-slo returns defaults when none
  is stored; get-call-passfail-total's top-level stat.total is not a count.
- bulk: checkout does not record its project, push needs partial bodies,
  and push reports success on failed uploads.
- Note deprecated v2 call commands and their v3 replacements while keeping
  the commands production still lists.
- onboard now prints the eight workflow skills as well as the setup
  guides, with a test; fix the root --help example's nonexistent command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
account_id alone selects the grantee (defaulting to the caller) and email
is an informational label; the top-level stat.total counts only
uncategorised results, matching the legacy aggregation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It is a large documentation PR whose many live-tested CLI/server behavior claims cannot be independently verified here, and it still reasserts list-results-by-call as cross-type against the command's own --help, so a human with environment access should confirm the claims before approval.

1 open finding

🧠 Review effort: Balanced

Comment thread skills/embed/setup-api-monitor.md
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.

3 participants