swapnildahiphale/opensre/platform-jenkins
Claude Code and agent skill by swapnildahiphale/opensre
- community
Checking that the SKILL.md file is still in the repository.
Jenkins job discovery, build triggers, console reads, and chained workflows across named Jenkins controllers. Built-in controllers are legacy and aws. Use when investigating CI/CD failures, triggering deploys, or orchestrating build-then-deploy chains.
Install
npx vskill@latest install swapnildahiphale/opensre/platform-jenkinsSKILL.md
The same SKILL.md was published earlier as swapnildahiphale/opensre/platform-jenkins.
Jenkins Integration
Interact with existing Jenkins jobs across multiple named Jenkins instances using portable REST API scripts. This skill does not create or reconfigure Jenkins jobs.
Built-in controller examples (set real URLs in .env — no org defaults in code):
legacy:https://jenkins.example.com(override withJENKINS_LEGACY_BASE_URL)aws:https://jenkins-aws.example.com(override withJENKINS_AWS_BASE_URL)
Authentication
Credentials are read from the environment automatically — do not check, echo, or verify them before running a script. Every script calls os.environ directly for its Jenkins base URL, username, and API token; there is no secondary env file, no Keychain, and nothing you need to inspect first. Just run the script for the controller you need (--env legacy or --env aws).
If a variable is missing, the script itself raises a clear error naming the exact variable (e.g. Missing JENKINS_LEGACY_API_TOKEN. Set it in repo root .env (or export JENKINS_API_TOKEN).) — that error is your signal to check .env, not something to pre-empt by checking env vars or hunting for a .env file before running the script.
Credentials live in repo root .env (passed to sre-agent via docker-compose env_file). See .env.example and sre-agent/.claude/skills/platform-jenkins/.env.example.
Legacy controller (`--env legacy`):
JENKINS_LEGACY_BASE_URL(required)JENKINS_LEGACY_USERNAMEJENKINS_LEGACY_API_TOKEN
AWS controller (`--env aws`):
JENKINS_AWS_BASE_URL(required)JENKINS_AWS_USERNAMEJENKINS_AWS_API_TOKEN
Optional:
JENKINS_USERNAME,JENKINS_API_TOKEN— shared fallback when both controllers use the same accountJENKINS_HTTP_TIMEOUT(seconds; default20)
Setup
Safe workflow
- Confirm the target Jenkins instance first:
legacyoraws. - Read/list before write actions.
- Use exact slash-delimited job paths (e.g.
folder-a/subfolder-b/job-name). - For writes, confirm job path, parameters, and whether the action is trigger or stop.
- After triggering, capture the queue item URL/id and follow until a build number appears.
- On
401,403, or404, report the concrete error and stop — do not guess paths.
Available scripts
All scripts are in .claude/skills/platform-jenkins/scripts/. The exact flags below match each script's argparse definition — do not read script source to learn the CLI, and do not re-derive flags by trial and error.
Every script below except run_workflow.py requires --env legacy|aws.
Read commands
get_whoami.py — verify identity
Flags: --env (required).
list_jobs.py — list jobs, optionally recursive into folders
Flags: --env (required). --parent-path (optional, defaults to Jenkins root). --recursive (optional flag, walks into folders/multibranch containers). --max-depth (optional, default 5, only applies with --recursive). --name-contains (optional, case-insensitive substring filter on job path).
get_job.py — job details
Flags: --env, --job-path (both required). --tree (optional, overrides the default Jenkins tree selector).
get_job_parameters.py — parameter definitions for a job
Flags: --env, --job-path (both required). No --tree option on this script.
list_builds.py — recent builds for a job
Flags: --env, --job-path (both required). --limit (optional, default 20). --tree (optional).
get_build.py — single build details
Flags: --env, --job-path, --build-number (all required, --build-number is an int). --tree (optional).
get_console.py — console log text for a build
Flags: --env, --job-path, --build-number (all required). --tail-lines (optional int — if set, prints only the last N lines instead of the full console text). This is the only console-log script; there is no separate "get logs" script.
get_queue_item.py — queue item status
Flags: --env, --queue-id (both required, --queue-id is an int). No --job-path on this script.
wait_for_build.py — block until a queued/running build finishes
Flags: --env, --job-path (required). Exactly one of --queue-id or --build-number must be given (enforced at runtime, not by argparse — passing neither raises an error). --poll-interval-seconds, --queue-timeout-seconds, --build-timeout-seconds (all optional floats with built-in defaults).
Write commands
trigger_build.py — trigger a build, with or without parameters
Flags: --env, --job-path (required). --param KEY=VALUE (optional, repeatable).
stop_build.py — stop a running build
Flags: --env, --job-path, --build-number (all required).
run_workflow.py — chained build-then-deploy workflow from a JSON file
Flags: --workflow-file (required, path to the JSON workflow definition). --default-env (optional, legacy or aws — fallback env for steps that omit their own env). This script does not take `--env` — env is per-step inside the JSON file (or via --default-env), not a top-level CLI flag.
Example workflow file:
Best practices
- Prefer
list_jobs.pybefore assuming a folder path. - Prefer
get_job_parameters.pybefore triggering parameterized builds. - Use
get_queue_item.pyaftertrigger_build.pyuntil Jenkins assigns a build number. - Use
wait_for_build.pywhen a later step depends on an earlier job's result. - Use
run_workflow.pyfor reproducible build-to-deploy chains. - Use
--tail-lineson console reads to avoid dumping huge logs. - Treat trigger and stop as write actions even though they don't mutate job config.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsre-agent/.claude/skills/platform-jenkins/SKILL.md
Popularity
- Repository stars
- 108
- Repository forks
- 26
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/swapnildahiphale/opensre/platform-jenkins)