add-probe-script
Use when adding, modifying, or removing an embedded probe script in cmd/scripts/, or when a liveness/readiness probe needs a new health check shell script
Skill by konflux-ci
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/konflux-ci-add-probe-script
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/add-probe-script
What's inside
- Skill name
add-probe-script- Description
- Use when adding, modifying, or removing an embedded probe script in cmd/scripts/, or when a liveness/readiness probe needs a new health check shell script
- License
- Apache-2.0
- Instructions
- 118 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Adding or Modifying a Probe Script
## Overview
Probe scripts are shell scripts embedded into the Go binary via `//go:embed` and
written to the shared volume at startup. Kubernetes liveness and readiness probes
execute them. Changes touch multiple files — missing any step causes silent failures
in production.
## Checklist
```
- [ ] cmd/scripts/<name>.sh — the script itself
- [ ] cmd/main.go — //go:embed directive + writeScriptsToVolume map entry
- [ ] cmd/health_checker_test.go — Go unit tests for writeScriptsToVolume
- [ ] test/scripts/test-health-scripts.sh — shell-level tests (run from repo root)
- [ ] test/config/system-test-setup.yaml — wire as probe if applicable
- [ ] test/scripts/run-system-test.sh — verify_probe_scripts() if the script must exist in-cluster
- [ ] AGENTS.md / README.md — update if user-visible behavior or probe examples change
```
## Step 1: Write the script
Create `cmd/scripts/<name>.sh`. Follow existing patterns:
- `set -euo pipefail` and `#!/bin/bash` shebang
- Use `SCRIPT_DIR` for sibling scripts on the shared volume (e.g. `check-file-age.sh`)
- Exit 0 on success, exit 1 on failure — Kubernetes probes use exit codes
- Accept configurable thresholds as positional args with defaults
- Use `HEALTH_FILE_PATH` (default `/shared/health-status.txt`), not hardcoded paths
- Write diagnostic messages to stdout/stderr for `kubectl exec` debugging
**Existing probe roles** (pick the pattern that matches the container):
| Script | Container | Behavior |
|--------|-----------|----------|
| `check-smee-health.sh` | gosmee-client liveness | File age + requires `status=success` |
| `check-sidecar-health.sh` | sidecar liveness | File age only (ignores success/failure) |
| `check-file-age.sh` | utility | Age check only; called by the probes above |
## Step 2: Embed and register in main.go
Add the `//go:embed` directive alongside the existing ones in `cmd/main.go`:
```go
//go:embed scripts/<name>.sh
var myNewScript []byte
```
Add the script to the `writeScriptsToVolume` map:
```go
scripts := map[string][]byte{
"check-smee-health.sh": smeeHealthScript,
"check-sidecar-health.sh": sidecarHealthScript,
"check-file-age.sh": fileAgeScript,
"<name>.sh": myNewScript, // add here
}
```
Scripts are written with mode `0755`, then set to `0555` (read-only + executable).
The overwrite logic handles container restarts where read-only files persist.
## Step 3: Go unit tests
In `cmd/health_checker_test.go`, the `writeScriptsToVolume` tests verify:
- Script file exists after write
- Permissions are `0555`
- Content contains expected strings (e.g. `#!/bin/bash`)
- Overwriting read-only files on restart works
Add assertions for the new script in the existing test cases — check file existence,
permissions, and at least one content marker.
## Step 4: Shell tests
`test/scripts/test-health-scripts.sh` invokes scripts as `cmd/scripts/<name>.sh` from the
repo root (not from `/shared`). It sets `HEALTH_FILE_PATH` to a temp file. Add cases covering:
- Missing input files (should exit 1)
- Valid input (should exit 0)
- Invalid/edge-case input (empty file, malformed content)
- Custom threshold parameters if applicable
Run from the repo root: `test/scripts/test-health-scripts.sh`
## Step 5: Wire as Kubernetes probe (if applicable)
In `test/config/system-test-setup.yaml`, add to the **correct** container (`gosmee-client`
or `sidecar`). Match timings to the container you attach to:
```yaml
livenessProbe:
exec:
command: ["/bin/bash", "/shared/<name>.sh"]
initialDelaySeconds: 20 # gosmee-client (existing probe)
# initialDelaySeconds: 15 # sidecar (existing probe)
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 2
```
The shared volume is mounted at `/shared` on both `gosmee-client` and `sidecar`
containers. Scripts are available to either container.
## Common mistakes
| Mistake | Fix |
|---------|-----|
| Forgot `//go:embed` directive | Build succeeds but script is empty bytes; add directive directly above the var |
| Script not in `writeScriptsToVolume` map | Binary embeds it but never writes to disk; add map entry |
| Permissions not tested | Probe fails silently in K8s; assert `0555` in Go tests |
| Script uses `bash` features without `#!/bin/bash` | UBI minimal may default to `sh`; always use bash shebang |
| Only tested in Go, not shell | `go test` validates embedding; shell tests validate script logic |
| Hardcoded paths instead of env vars | Use `HEALTH_FILE_PATH` with a default of `/shared/health-status.txt` |
| Smee vs sidecar semantics | Smee probe fails on `status=failure`; sidecar probe only cares that the file is fresh |
| Forgot `verify_probe_scripts` | System test phase 0 fails even if unit/shell tests pass |From konflux-ci/smee-sidecar, Apache-2.0.
More from konflux-ci/smee-sidecar
- 0.474score
ci-quirks
konflux-ci
Documents merge-blocking CI pipelines and non-obvious constraints (AGENTS.md line limit, serial tests, multi-arch builds).
SkillCFreshness: CClaude Code +9 - 0.474score
kind-cluster
konflux-ci
Use when setting up, running, or tearing down a Kind cluster for smee-sidecar system tests, or when system tests fail in CI
SkillCFreshness: CClaude Code +9 - 0.473score
debug-instance
konflux-ci
Use when a running smee-sidecar pod is unhealthy, restarting, not relaying events, or showing unexpected metrics
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 10
- Open issues
- 0
- Last commit (this folder)
- Jun 2, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/konflux-ci/smee-sidecar
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from konflux-ci
- 0.797score
debug-e2e-tests
konflux-ci
Debug failed Konflux e2e test runs by downloading logs and artifacts from GitHub Actions or OpenShift CI (Prow), analyzing test failures, and suggesting fixes.
SkillAFreshness: A★ 215Claude Code +9 - 0.791score
pr-review
konflux-ci
Use when reviewing pull requests in konflux-ci/konflux-ci.
SkillAFreshness: A★ 215Claude Code +9 - 0.791score
companion-pr-review
konflux-ci
Use when reviewing, triaging, or retro-analyzing MintMaker/Renovate dependency PRs and their manifest companion PRs in konflux-ci/konflux-ci.
SkillAFreshness: A★ 215Claude Code +9 - 0.791score
update-upstream-deps
konflux-ci
Update upstream Konflux component versions.
SkillAFreshness: A★ 215Claude Code +9 - 0.784score
retro-filing-policy
konflux-ci
Filing rules for the fullsend retro agent.
SkillAFreshness: A★ 215Claude Code +9 - 0.751score
dev-verify-loop
konflux-ci
Use when iteratively verifying operator changes in development — code edit, stop operator, optionally regenerate manifests or CRDs, restart operator, verify.
SkillBFreshness: B★ 215Claude Code +9
Cite this page
add-probe-script skill. Agent Mart. https://agentmart.dev/skills/konflux-ci-add-probe-script (last updated 2026-10-24)