Skip to content
Back to skills

Add Port Adapter

ASecurity

Add or extend a driven port and its adapter in agent-office's hexagonal core — storage/persistence, OS integration, clock/scheduling, external services, a new notification channel. Use whenever the core needs something new from the outside world.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 19, 2026
ai-agentsgoshellnodetesting

Security analysis

A100/100

Scanned October 19, 2026

npx -y skills add arxdsilva/agent-office --skill add-port-adapter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Port Adapter?

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

Security grade badge for Add Port Adapter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/arxdsilva-add-port-adapter/badge)](https://www.skillsdirectory.com/skills/arxdsilva-add-port-adapter)

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

Download with Pro
SKILL.md
---
name: add-port-adapter
description: Add or extend a driven port and its adapter in agent-office's hexagonal core — storage/persistence, OS integration, clock/scheduling, external services, a new notification channel. Use whenever the core needs something new from the outside world.
---

# Add a driven port and adapter

Rules: `ARCHITECTURE.md` (ports are additive; only the composition root knows concrete classes), `TESTING.md` (TDD; contract suites are mandatory).

1. **Can an existing port do it?** Check `packages/core/src/ports/driven.ts` first. Prefer a **new, narrow** port over growing an existing one, and never change an existing method's signature.
2. **Red: contract suite.** Add `xxxContract(name, make)` in `packages/core/test/contracts/`. It describes the behavior every implementation must have: round trips, errors as domain errors (`ValidationError`, …), idempotency and isolation.
3. **Fake.** Add a fake or recording implementation to `packages/core/test/fakes/index.ts` and run it through the contract in `packages/core/test/fakes.test.ts`.
4. **Use case.** Write a failing test in `core/src/application/*.test.ts` using the fake, then implement it so it depends on the port only. Wire it into `createOffice` (`OfficeDeps`) if it's office-wide.
5. **Real adapter.**
   - Node: `packages/adapters/src/<area>/`. Electron: `packages/desktop/src/main/adapters/electron-*.ts`.
   - Run the same contract suite against it, using temp dirs and never real user files.
6. **Wire it** in `packages/desktop/src/main/composition.ts` (Electron objects come in through `Shell`, built in `index.ts`). Extend `composition.test.ts`.
7. `make arch` (the dependency rule) and `make check`. For Electron adapters, also `make build test-ui`.

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.