# Designing Mas Plugins

> Design evaluation plugins following 12-Factor + MAESTRO principles

- **Type:** Skill
- **Install:** `agentstack add skill-qte77-claude-code-plugins-designing-mas-plugins`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [qte77](https://agentstack.voostack.com/s/qte77)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [qte77](https://github.com/qte77)
- **Source:** https://github.com/qte77/claude-code-plugins/tree/main/plugins/mas-design/skills/designing-mas-plugins
- **Website:** https://qte77.github.io/claude-code-plugins/

## Install

```sh
agentstack add skill-qte77-claude-code-plugins-designing-mas-plugins
```

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

## About

# Designing MAS Plugins

**Target**: $ARGUMENTS

## When to Use

Trigger this skill when:

- Designing agent plugins or evaluation components
- Planning pipeline architecture
- Architecting new metrics or evaluation tiers
- Refactoring engines into plugin patterns

## Core Principles

Plugins follow six principles. For worked code examples of each, see
`references/core-principles-with-examples.md`.

1. **Stateless Reducer** — `evaluate(context) -> result` as a pure function; no side effects, no shared state
2. **Own Context Window** — plugin manages its own context; no global state access
3. **Structured Outputs** — all data uses validated models, no raw dicts
4. **Own Control Flow** — plugin handles its own errors and timeouts
5. **Compact Errors** — structured partial results, not exceptions
6. **Single Responsibility** — one metric or tier per plugin

## Plugin Design Checklist

Before implementing a plugin, verify:

- [ ] **Stateless**: No class attributes, no global state
- [ ] **Own Context**: All inputs via `evaluate()` parameter
- [ ] **Typed I/O**: Validated models for inputs and outputs
- [ ] **Own Errors**: Returns error results, doesn't raise
- [ ] **Own Timeout**: Respects configured timeout
- [ ] **Single Responsibility**: One metric or tier
- [ ] **Explicit Context**: Filters output for next stage
- [ ] **Env Config**: All config via env vars / settings
- [ ] **Observable**: Emits structured logs for debugging
- [ ] **Graceful Degradation**: Partial results on failures

## Anti-Patterns

- Shared State: `self.cache = {}` (breaks stateless)
- Raw Dicts: `return {"score": 0.5}` (use models)
- Raising Exceptions: `raise ValueError()` (return error)
- Global Access: `config.get_global()` (use settings)
- Implicit Context: Passing entire result to next tier
- Multiple Responsibilities: One plugin, 3 metrics

## Implementation Template

See `references/plugin-implementation-template.md` for the full `EvaluatorPlugin` abstract base class and a worked `MyPlugin` example with typed context/result models, error handling, and next-tier context filtering.

## Testing Strategy

See `references/plugin-testing-strategy.md` for isolation test patterns — happy path and structured-error-handling tests using mocked context.

## References

- `references/mas-design-principles.md` — foundational design principles (existing)
- `references/core-principles-with-examples.md` — code examples for each of the six core principles
- `references/plugin-implementation-template.md` — full `EvaluatorPlugin` + `MyPlugin` template
- `references/plugin-testing-strategy.md` — isolation test patterns

## Further Reading

- [12-Factor Agents](https://github.com/humanlayer/12-factor-agents)
- [Anthropic Harnesses](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
- [PydanticAI Patterns](https://pydantic.dev/articles/building-agentic-application)
- [NIST AI RMF 1.0](https://www.nist.gov/artificial-intelligence/executive-order-safe-secure-and-trustworthy-artificial-intelligence)
- [ISO/IEC 42001:2023 — AI Management System](https://www.iso.org/standard/81230.html)

## Source & license

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

- **Author:** [qte77](https://github.com/qte77)
- **Source:** [qte77/claude-code-plugins](https://github.com/qte77/claude-code-plugins)
- **License:** Apache-2.0
- **Homepage:** https://qte77.github.io/claude-code-plugins/

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-qte77-claude-code-plugins-designing-mas-plugins
- Seller: https://agentstack.voostack.com/s/qte77
- 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%.
