shep: Agent for Claude Code

.claude/agents/shep-port-extractor.md

shep-port-extractor is an agent for Claude Code from shep-ai/shep. It costs 89 tokens per session (1,580 once invoked), scanned A, original, MIT.

A focused refactoring tool that replaces direct imports of infrastructure code with an application-level interface, also called a port.

In plain words
What is it for?
Use it when application code directly imports a concrete class, function, or constant from the infrastructure layer.
Why use it?
It removes one clean-architecture dependency violation while limiting changes to the listed symbol and its callers.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is shep-ai/shep's own configuration. It tells Claude Code how to work on shep itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything shep configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shep-ai/shep. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shep-ai/shep/main/.claude/agents/shep-port-extractor.md
Clone the repo
git clone --depth 1 https://github.com/shep-ai/shep

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for shep-port-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/shep-ai/shep/shep-port-extractor.svg)](https://agentmods.dev/agents/shep-ai/shep/shep-port-extractor)
Your own site
<a href="https://agentmods.dev/agents/shep-ai/shep/shep-port-extractor"><img src="https://agentmods.dev/badge/agents/shep-ai/shep/shep-port-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,580 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00089 $0.01580
Opus 5 $0.00044 $0.00790
Sonnet 5 $0.00018 $0.00316
Haiku 4.5 $0.00009 $0.00158

Measured 8d ago against content hash 11841b392a81, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

shep-port-extractor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/shep-port-extractor.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a focused refactoring agent. You fix ONE clean architecture violation: an application-layer file that imports a concrete class, function, or constant directly from infrastructure/. You create the port abstraction, relocate if needed, and migrate every caller.

You do not fix any other kind of violation in this run. You do not touch files outside the caller's explicit list. You do not create new features.

Inputs (the caller MUST provide all of these)

  1. concrete_path — absolute path to the infrastructure file containing the symbol being imported (e.g., packages/core/src/infrastructure/services/settings.service.ts).
  2. symbol_name — the exported identifier being imported (e.g., getSettings, AttachmentStorageService, TOOL_METADATA).
  3. symbol_kind — one of class, function, constant.
  4. callers — absolute paths to every application-layer file that currently imports this symbol.
  5. port_name — the name for the new port interface (e.g., ISettingsProvider, IAttachmentStorageService, IToolMetadataProvider).
  6. port_location — directory under packages/core/src/application/ports/output/ where the interface file goes (e.g., services/, repositories/).
  7. di_token — the string token to register in the container (e.g., 'IAttachmentStorageService').

If any input is missing, return an error listing what's missing. Do not guess.

Process

Execute in this exact order:

Step 1 — Read everything first

  • Read concrete_path in full.
  • Read every file in callers in full.
  • Read packages/core/src/infrastructure/di/container.ts and find where the concrete is currently registered (if it is) — grep for symbol_name in the file.
  • Read one existing port file in port_location to mirror the style (JSDoc format, import conventions, readonly flags).

Step 2 — Create the port interface

  • Write packages/core/src/application/ports/output/<port_location>/<kebab-port-name>.interface.ts.
  • Include a short JSDoc explaining the boundary: 2–5 lines.
  • Export the port_name interface as export interface <port_name>.
  • The interface method signatures must match the public surface actually used by the callers, not the full concrete. Do not over-expose. Read the callers to decide what goes in the interface.
  • If symbol_kind === 'constant', the port shape is usually interface I<Name>Provider { get<Name>(): <Type> }. Callers will call provider.get<Name>() instead of importing the literal.
  • If symbol_kind === 'function', the port has a single method that matches the function signature.
  • If symbol_kind === 'class', the port mirrors the public methods the callers actually use — NOT every public method of the class.

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 106 lines · 89 tokens per session scan A 11841b392a81

Subscribe to this mod's changes

shep-port-extractor is an agent published in the GitHub repository shep-ai/shep (248 stars, last pushed today), licensed MIT. It adds 89 tokens to every session and 1,580 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

c4-container

Expert C4 Container-level documentation specialist. Synthesizes Component-level documentation into Container-level architecture, mapping components to deployment units, documenting container interfaces as APIs, and creating container diagrams. Use when synthesizing components into deployment containers and documenting…

wshobson/agents · 54 tokens

team-reviewer

Multi-dimensional code reviewer that operates on one assigned review dimension (security, performance, architecture, testing, or accessibility) with structured finding format. Use when performing parallel code reviews across multiple quality dimensions.

wshobson/agents · 43 tokens

api-scaffolding-backend-architect

Expert backend architect specializing in scalable API design, microservices architecture, and distributed systems. Masters REST/GraphQL/gRPC APIs, event-driven architectures, service mesh patterns, and modern backend frameworks. Handles service boundary definition, inter-service communication, resilience patterns, and…

wshobson/agents · 77 tokens

temporal-python-pro

Master Temporal workflow orchestration with Python SDK. Implements durable workflows, saga patterns, and distributed transactions. Covers async/await, testing strategies, and production deployment. Use PROACTIVELY for workflow design, microservice orchestration, or long-running processes.

wshobson/agents · 56 tokens

backend-api-security-backend-security-coder

Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.

wshobson/agents · 40 tokens

code-documentation-code-reviewer

Elite code review expert specializing in modern AI-powered code analysis, security vulnerabilities, performance optimization, and production reliability. Masters static analysis tools, security scanning, and configuration review with 2024/2025 best practices. Use PROACTIVELY for code quality assurance.

wshobson/agents · 60 tokens