Skip to content

docs: add NPS Explorer example - #76

Merged
pavelanni merged 2 commits into
mainfrom
examples/nps-explorer
May 26, 2026
Merged

pavelanni merged 2 commits into
mainfrom
examples/nps-explorer

Conversation

@pavelanni

@pavelanni pavelanni commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a self-contained example under examples/nps-explorer/ showing how to deploy a DocsClaw agent that queries the National Park Service REST API
  • Demonstrates three common patterns: ConfigMap-driven personality, skills as separate ConfigMaps, and API key management via Kubernetes Secrets
  • Includes multi-provider LLM secret (Anthropic, OpenAI, LiteLLM) with placeholder keys

Files

File Purpose
README.md Overview, prerequisites, deploy/test steps
configmap.yaml System prompt, A2A agent card, tool config
skill-configmap.yaml NPS API skill (endpoints, auth, examples)
llm-secret.yaml LLM provider secret with three provider options
nps-secret.yaml NPS API key secret with registration link
deployment.yaml Deployment, Service, Route with hardened security

Test plan

  • Verify no real API keys in any file
  • yamllint passes on all YAML files (line-length warnings in literal blocks are expected)
  • README renders correctly on GitHub
  • kubectl apply --dry-run=client -f examples/nps-explorer/ succeeds
  • Deploy to OpenShift with real API keys and test with a2a CLI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added comprehensive example documentation with deployment instructions and testing guidance.
  • Chores

    • Added Kubernetes manifests (ConfigMaps, Secrets, Deployment) and configuration files for a new example agent.

Self-contained example showing how to deploy a DocsClaw agent that
queries the National Park Service REST API. Demonstrates ConfigMap-driven
personality, skills as separate ConfigMaps, and API key management via
Kubernetes Secrets.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented May 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@pavelanni, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 3 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 346f8466-eaaa-470a-9681-0c005a40b176

📥 Commits

Reviewing files that changed from the base of the PR and between 6b20db2 and d5967fd.

📒 Files selected for processing (2)
  • examples/nps-explorer/configmap.yaml
  • examples/nps-explorer/deployment.yaml
📝 Walkthrough

Walkthrough

This PR introduces the NPS Explorer, a complete example agent for DocsClaw that answers questions about U.S. national parks. It adds Kubernetes manifests (Deployment, Service, Route), ConfigMaps for agent configuration and NPS API skill definitions, Secrets for LLM and NPS credentials, and comprehensive documentation for deploying and testing the example.

Changes

NPS Explorer Example Deployment

Layer / File(s) Summary
Agent configuration and metadata
examples/nps-explorer/configmap.yaml
system-prompt.txt defines the assistant role and API check requirements; agent-card.json publishes A2A protocol metadata and NPS skill descriptors; agent-config.yaml specifies tool allowlist, exec limits, workspace path, and loop iterations.
NPS API skill definition and secrets
examples/nps-explorer/skill-configmap.yaml, examples/nps-explorer/llm-secret.yaml, examples/nps-explorer/nps-secret.yaml
SKILL.md documents NPS REST API endpoints (/parks, /activities, /alerts, /campgrounds, /events, /visitorcenters), parameters, authentication header format, curl request patterns, and example user-to-API mappings. llm-secret configures LLM provider, model, and API key (Anthropic default). nps-secret provides the NPS API key placeholder.
Kubernetes deployment infrastructure
examples/nps-explorer/deployment.yaml
Hardened Deployment running serve with in-memory session database, security context (non-root, no privilege escalation, read-only root filesystem, runtime-default seccomp, dropped capabilities), secret/ConfigMap volume mounts, emptyDir workspace, liveness/readiness probes. Includes ClusterIP Service on port 8000 and OpenShift Route with edge TLS termination and HTTPS redirect.
Deployment documentation and user guide
examples/nps-explorer/README.md
Describes agent purpose, configuration patterns, step-by-step deployment instructions (apply manifests, wait for readiness, retrieve route URL), testing via curl JSON-RPC and a2a CLI, runtime flow (agent exec/curl with NPS API skill guidance and jq parsing), and customization options for skills, LLM selection, and tool limits.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: add NPS Explorer example' clearly and concisely describes the main change: adding documentation and example files for an NPS Explorer DocsClaw agent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch examples/nps-explorer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@examples/nps-explorer/configmap.yaml`:
- Around line 73-83: The workspace key is placed at the root but the loader
expects agentCfg.Tools.Workspace; move the workspace entry into the tools
section (so it becomes tools.workspace) in the agent-config.yaml/ configmap so
the loader (referencing agentCfg.Tools.Workspace) reads the configured path
correctly.

In `@examples/nps-explorer/deployment.yaml`:
- Line 40: Replace the mutable image tag "ghcr.io/redhat-et/docsclaw:latest"
with an immutable reference: either a fixed version tag (e.g., :vX.Y.Z) or an
image digest (sha256:...), and optionally add imagePullPolicy: IfNotPresent when
using a fixed tag (or Always when using digest) to make deployments
reproducible; update the image field in the Deployment spec (the line containing
image:) accordingly so the manifest references a specific version rather than
:latest.
- Around line 127-131: The manifest includes an OpenShift-only resource
(apiVersion: route.openshift.io/v1, kind: Route) in a file users are instructed
to kubectl apply on standard Kubernetes clusters; remove or isolate this Route
resource so applying the manifest doesn't fail: either move the Route block out
into a separate OpenShift-only file (or a kustomize/overlay) or guard it with
tooling-specific conditionals, and ensure only Kubernetes-native resources
remain in the shared deployment.yaml (locate the block by the apiVersion:
route.openshift.io/v1 / kind: Route markers).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 469545a8-1ff0-4a22-9e28-5d79e3c30de2

📥 Commits

Reviewing files that changed from the base of the PR and between 0211e82 and 6b20db2.

📒 Files selected for processing (6)
  • examples/nps-explorer/README.md
  • examples/nps-explorer/configmap.yaml
  • examples/nps-explorer/deployment.yaml
  • examples/nps-explorer/llm-secret.yaml
  • examples/nps-explorer/nps-secret.yaml
  • examples/nps-explorer/skill-configmap.yaml

Comment thread examples/nps-explorer/configmap.yaml Resolved
runAsNonRoot: true
containers:
- name: docsclaw
image: ghcr.io/redhat-et/docsclaw:latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid :latest for deployment images

Line 40 uses a mutable tag, which hurts reproducibility and can silently change runtime behavior.

Proposed fix
-          image: ghcr.io/redhat-et/docsclaw:latest
+          image: ghcr.io/redhat-et/docsclaw:<pinned-version-or-digest>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/nps-explorer/deployment.yaml` at line 40, Replace the mutable image
tag "ghcr.io/redhat-et/docsclaw:latest" with an immutable reference: either a
fixed version tag (e.g., :vX.Y.Z) or an image digest (sha256:...), and
optionally add imagePullPolicy: IfNotPresent when using a fixed tag (or Always
when using digest) to make deployments reproducible; update the image field in
the Deployment spec (the line containing image:) accordingly so the manifest
references a specific version rather than :latest.

Comment on lines +127 to +131
---
# Route (OpenShift) — exposes the agent externally with TLS
# On plain Kubernetes, replace with an Ingress resource.
apiVersion: route.openshift.io/v1
kind: Route

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

OpenShift Route in a shared manifest breaks Kubernetes apply

Lines 127-131 add route.openshift.io/v1 in the same file users are told to apply with kubectl; this fails on standard Kubernetes clusters.

Proposed fix
-# NPS Explorer Agent — Deployment, Service, and Route
+# NPS Explorer Agent — Deployment and Service
...
----
-# Route (OpenShift) — exposes the agent externally with TLS
-# On plain Kubernetes, replace with an Ingress resource.
-apiVersion: route.openshift.io/v1
-kind: Route
-...
+# Move Route to a separate `route.yaml` and apply it only on OpenShift.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/nps-explorer/deployment.yaml` around lines 127 - 131, The manifest
includes an OpenShift-only resource (apiVersion: route.openshift.io/v1, kind:
Route) in a file users are instructed to kubectl apply on standard Kubernetes
clusters; remove or isolate this Route resource so applying the manifest doesn't
fail: either move the Route block out into a separate OpenShift-only file (or a
kustomize/overlay) or guard it with tooling-specific conditionals, and ensure
only Kubernetes-native resources remain in the shared deployment.yaml (locate
the block by the apiVersion: route.openshift.io/v1 / kind: Route markers).

Address CodeRabbit review findings:
- workspace was at YAML root but the Go loader reads it from
  agentCfg.Tools.Workspace — moved under tools: to match
- Added comment suggesting version pinning for production

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@pavelanni
pavelanni merged commit f9aaf61 into main May 26, 2026
4 checks passed
@pavelanni
pavelanni deleted the examples/nps-explorer branch May 26, 2026 16:54
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.

1 participant