Pirate ship for developers. Plunder APIs, raid databases, cannon broadsides are DDoS, treasure maps are architecture docs.
  • JavaScript 100%
Find a file
2026-06-30 11:13:36 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 test: add e2e tests 2026-06-28 11:08:48 +00:00
src feat(#1): pirate ship engine — crew, cannons, raids, treasure, ASCII ship 2026-06-15 07:09:23 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:13:33 +00:00
package.json feat(#1): pirate ship engine — crew, cannons, raids, treasure, ASCII ship 2026-06-15 07:09:23 +00:00
README.md feat(#1): pirate ship engine — crew, cannons, raids, treasure, ASCII ship 2026-06-15 07:09:23 +00:00

code-pirate-ship

Pirate ship for developers. Plunder APIs, raid databases, cannon broadsides are DDoS, treasure maps are architecture docs.

Usage

const { PirateShip, SHIP_TYPES, CANNON_TYPES, CREW_ROLES } = require('./src/pirate-ship');
const { Raid, RAID_TARGETS } = require('./src/raid');

const ship = new PirateShip('The Refactor', SHIP_TYPES.FRIGATE);
ship.recruit('Alice', CREW_ROLES.CAPTAIN);
ship.recruit('Bob', CREW_ROLES.GUNNER);
ship.recruit('Carol', CREW_ROLES.NAVIGATOR);
ship.setCannons(CANNON_TYPES.SECURITY_BOMBARD);

// Raid an API
const raid = new Raid(RAID_TARGETS.API_ENDPOINT, ship);
raid.bombard();
raid.board();
const loot = raid.plunder();
raid.retreat();

console.log(ship.shipView());
console.log(ship.report());

Ship Types

  • Frigate (speed 7, armor 60, 10 cannons) — Balanced warship
  • Galleon (speed 4, armor 90, 16 cannons) — Heavy treasure ship
  • Sloop (speed 10, armor 30, 4 cannons) — Fast and nimble
  • Man-o-War (speed 5, armor 100, 20 cannons) — Floating fortress

Crew Roles

  • Captain (Tech Lead) — Steers the ship, makes the calls
  • Quartermaster (PM) — Manages loot, tracks resources
  • Master Gunner (QA) — Aims cannons, finds weak spots
  • Navigator (SRE) — Charts the course, avoids rocks
  • Ship Surgeon (DevOps) — Patches holes, keeps things afloat
  • Boatswain (Senior Dev) — Runs the deck, does everything

Raid Targets

API Endpoint, Database, S3 Bucket, Auth Server, CDN Cache, Secrets Vault

Components

  • PirateShip — HP/armor, cannons, crew, cargo, treasure, heat/bounty system
  • CrewMember — 6 roles, combat/navigation/leadership, morale/energy, ranks
  • Raid — Multi-phase: bombard -> board -> plunder -> retreat