Skip to content
Back to skills

2903 Pipeline Spec 60683b0e

ASecurity

Build middleware pipelines in Python with export to JSON/YAML. `PipelineSpec` provides a fluent API for constructing middleware pipelines that can be compiled into middleware instances or exported as configuration files. This is useful for configuration-driven deployments where pipeline definitions need to be portable.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
devopspythonnodeapi

Works with

  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2903-pipeline_spec_60683b0e --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2903 Pipeline Spec 60683b0e?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2903 Pipeline Spec 60683b0e
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2903-pipeline-spec-60683b0e/badge)](https://www.skillsdirectory.com/skills/tools-only-2903-pipeline-spec-60683b0e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# PipelineSpec

Build middleware pipelines in Python with export to JSON/YAML.

`PipelineSpec` provides a fluent API for constructing middleware pipelines that
can be compiled into middleware instances or exported as configuration files.
This is useful for configuration-driven deployments where pipeline definitions
need to be portable.

## Quick Example

```python
from pydantic_ai_middleware import PipelineSpec
from pydantic_ai_middleware.builder import MiddlewarePipelineCompiler

# Build a pipeline spec with fluent API
spec = (
    PipelineSpec()
    .add_type("logging", {"level": "DEBUG"})
    .add_type("rate_limit", {"max_requests": 100})
    .add_when(
        predicate="is_admin",
        then=[{"type": "admin_audit"}],
        else_=[{"type": "user_audit"}],
    )
)

# Export to YAML file
spec.save("middleware-pipeline.yaml")

# Or compile directly to middleware instances
compiler = MiddlewarePipelineCompiler(registry)
middleware_list = spec.compile(compiler)
```

## Supported Node Types

- **type**: A single middleware by registered name
- **chain**: Sequential execution of multiple nodes
- **parallel**: Concurrent execution with result aggregation
- **when**: Conditional branching based on predicates

## API Reference

::: pydantic_ai_middleware.pipeline_spec.PipelineSpec
    options:
      show_source: true
      members:
        - nodes
        - add
        - add_type
        - add_chain
        - add_parallel
        - add_when
        - to_config
        - dump
        - save
        - compile

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.