# Jfail

> Fetch and analyze a failed CI job (GitLab) or workflow run (GitHub)

- **Type:** Skill
- **Install:** `agentstack add skill-wave-engineering-claudecode-workflow-jfail`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Wave-Engineering](https://agentstack.voostack.com/s/wave-engineering)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Wave-Engineering](https://github.com/Wave-Engineering)
- **Source:** https://github.com/Wave-Engineering/claudecode-workflow/tree/main/skills/jfail

## Install

```sh
agentstack add skill-wave-engineering-claudecode-workflow-jfail
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# CI Failure Analysis

Fetch and summarize a failed CI run without flooding the parent context. Works on GitHub Actions and GitLab CI — the tools normalize the platform.

## Tools Used

- `mcp__sdlc-server__ci_run_status` — resolve `latest` (optionally on a branch) to a run
- `mcp__sdlc-server__ci_failed_jobs` — list failing jobs for a run
- `mcp__sdlc-server__ci_run_logs` — fetch failed-only log content (truncated) for a job

## Arguments

{{#if args}}
`{{args}}` — numeric run ID, `latest`, or `latest `.
{{else}}
No argument → default to `latest` on the current branch.
{{/if}}

## Step 1: Parse arguments

Decide mode: numeric `run_id` vs. `latest` (with optional branch). For bare `latest`, use `git branch --show-current`.

## Step 2: Resolve run, find failed job, fetch logs

1. `latest` mode → `ci_run_status({ref: })`; if not a failure, stop and report. Numeric mode → use the given id.
2. `ci_failed_jobs({run_id})`. If empty, report "no failed jobs" and stop. Pick the first failed `job_id`.
3. `ci_run_logs({run_id, job_id, failed_only: true})` → returns normalized metadata (name, ref, url, conclusion, truncation) and log content as a string.

If any tool errors (invalid ID, wrong repo, 404), report and stop — no shell fallback, no guessing.

## Step 3: Analyze with sub-agent

Launch a sub-agent (`subagent_type: general-purpose`, `model: haiku`) with the log content appended to the prompt. If content is very large (>200 KB), spill to `/tmp/jfail--.out` and pass the path instead — agent's judgment. Prompt:

> Analyze the CI failure log (appended / at the given path). The parent agent will only see your summary.
>
> 1. Strip ANSI codes (`[0K`, `[36;1m`, etc.).
> 2. Classify as: `test-failure` / `lint-error` / `build-error` / `dependency-error` / `deploy-error` / `infrastructure` / `script-error` / `unknown`.
> 3. Extract error sections (contiguous blocks with context). ≤30 lines → full; >30 → first 15 + last 15 with `... [N lines omitted] ...`.
> 4. Extract actionable details — file:line, failing test names, exact failing command, exit codes.
> 5. Return exactly:
>    ```
>    CLASSIFICATION: 
>    SUMMARY: 
>    ERROR SECTIONS:
>    ---
>    
>    ---
>    ACTIONABLE:
>    - 
>    ```
>
> Skip setup/cache/install noise unless directly relevant.

## Step 4: Present results

Using the metadata from `ci_run_logs`, show `**Workflow/Job:**  — [link]()` and `**Ref:**  | **Conclusion:** `, then the sub-agent's CLASSIFICATION / SUMMARY / ERROR SECTIONS / ACTIONABLE. If `ci_run_logs` reports truncation, append `> Logs truncated by ci_run_logs.` If spilled to a file, append `> Full log: /tmp/jfail--.out`.

## Important

- Sub-agent does the heavy reading; parent stays clean. `model: haiku` — summarization, not reasoning.
- Tool failure → report and stop. No shell fallback.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Wave-Engineering](https://github.com/Wave-Engineering)
- **Source:** [Wave-Engineering/claudecode-workflow](https://github.com/Wave-Engineering/claudecode-workflow)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wave-engineering-claudecode-workflow-jfail
- Seller: https://agentstack.voostack.com/s/wave-engineering
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
