Skip to content
This repository was archived by the owner on Apr 9, 2026. It is now read-only.

feat: add /logs Claude Code skill for auth-provider#47

Closed
pstaylor-patrick wants to merge 7 commits into
mainfrom
feat/staging-logs-skill
Closed

feat: add /logs Claude Code skill for auth-provider#47
pstaylor-patrick wants to merge 7 commits into
mainfrom
feat/staging-logs-skill

Conversation

@pstaylor-patrick

@pstaylor-patrick pstaylor-patrick commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a /logs Claude Code skill to auth-provider using the .claude/skills/logs/SKILL.md convention with YAML frontmatter
  • Implements deterministic shell scripts (fetch-logs.sh, format-logs.sh) for reliable Cloud Run log querying
  • Queries Cloud Run logs for the f3-auth service across staging (f3-authentication-staging) and prod (f3-authentication) GCP projects
  • Supports flexible argument parsing: environment selector, severity filters (errors, warnings), time ranges (30m, 2h, 1d), entry count limits, and custom gcloud filters
  • Presents results as a summary table with timestamp, severity, HTTP method/URL, status, latency, and remote IP

Usage

/logs                          → 20 most recent staging entries
/logs prod                     → 20 most recent prod entries
/logs errors 1h                → staging errors from the last hour
/logs prod errors 50 30m       → 50 prod errors from the last 30 minutes
/logs httpRequest.status>=500  → staging 5xx errors

Test plan

  • Build passes
  • Lint clean
  • Format check passes
  • Types check
  • auth-provider/.claude/skills/logs/SKILL.md exists with valid YAML frontmatter
  • scripts/fetch-logs.sh exists and is executable
  • scripts/format-logs.sh exists and is executable
  • Run /logs from the auth-provider directory — should show 20 recent staging log entries
  • Run /logs prod — should query the f3-authentication project instead
  • Run /logs errors — should filter to ERROR severity

🤖 Generated with Claude Code

pstaylor-patrick and others added 2 commits April 8, 2026 14:05
Adds a /staging-logs slash command that queries Cloud Run logs for the
f3-auth staging deployment. Supports filtering by severity, time range,
and custom gcloud filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Renamed from staging-logs.md to logs.md. The skill now accepts `staging`
or `prod` as an environment selector (defaults to staging). Adds support
for day-range filtering (e.g. `1d`) and maps both GCP projects:
- staging → f3-authentication-staging
- prod → f3-authentication

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pstaylor-patrick pstaylor-patrick changed the title feat: add staging-logs Claude Code skill feat: add /logs Claude Code skill for auth-provider Apr 8, 2026
@pstaylor-patrick pstaylor-patrick marked this pull request as draft April 8, 2026 19:12
pstaylor-patrick and others added 5 commits April 8, 2026 14:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follows the .claude/skills/<name>/SKILL.md convention with proper
YAML frontmatter, matching the pattern used across other F3 repos.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Extract gcloud command construction into fetch-logs.sh and JSON
formatting into format-logs.sh so the skill produces predictable
results regardless of LLM interpretation.

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace greedy glob patterns (*[0-9]m, *[0-9]h, etc.) with anchored
  regex guards (^[0-9]+m$) so custom filters like httpRequest.status>=500
  are not misinterpreted as time ranges
- Guard all jq count outputs with fallback defaults in format-logs.sh
- Fix usage comment in format-logs.sh

Co-Authored-By: Claude <noreply@anthropic.com>
@pstaylor-patrick

Copy link
Copy Markdown
Collaborator Author

Closing in favor of F3-Nation/f3-nation#223 — the auth app has been integrated into the f3-nation monorepo, so this skill now lives at apps/auth/.claude/skills/logs/ in the monorepo instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant