Skip to content

arxdsilva/agent-office / .claude/skills/add-port-adapter

add-port-adapter

Verified

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.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall