Skip to content

Latest commit

 

History

History
118 lines (90 loc) · 4.71 KB

File metadata and controls

118 lines (90 loc) · 4.71 KB

Skill: Gamma-Napp Operator

This repository holds the agent skill and operational documentation for Gamma-Napp. The application code stays in https://github.com/OpenMarketsFoundation/Store-Front-Nsite.

Read First

Before execution, read these sources in this order:

  1. skill.md
  2. https://github.com/OpenMarketsFoundation/Gamma-Napp/blob/main/AGENTS.md
  3. https://github.com/OpenMarketsFoundation/Gamma-Napp/blob/main/IMPLEMENTATION_PLAN.md
  4. https://github.com/OpenMarketsFoundation/Gamma-Napp/blob/main/NSITE%20APP%20INTEGRATION.md
  5. https://github.com/OpenMarketsFoundation/Gamma-Napp/blob/main/NSITE_DEPLOYMENT_VERIFICATION.md

If instructions conflict, prefer skill.md for execution flow and deployment gates.

Mandatory First Step: Mode Selection

Before doing anything else, the agent must ask:

"Choose one mode: 1) clone/edit/deploy, 2) rebuild from scratch, 3) clone/deploy existing nsite."

Then run only the selected workflow.

Mode 1: Clone Gamma-Napp, Edit, Deploy

Use this when code already exists and you want changes shipped quickly.

  1. Clone and install:
    • git clone https://github.com/OpenMarketsFoundation/Store-Front-Nsite.git
    • cd Gamma-Napp
    • npm install
  2. Apply requested edits in existing architecture:
    • Identity/relay: composables/useShopIdentity.js, composables/useRelayLists.js
    • Market/order: composables/useMarketplace.js, composables/useNostrOrders.js, composables/useLightningInvoice.js, composables/useFiatToSats.js
    • Clone/deploy UX: composables/useNsiteClone.js, components/shop/NsiteCloneFab.vue
  3. Validate app build and clone logic:
    • npm run generate
    • npm run test:nsite-clone
  4. Deploy:
    • nsyte deploy ./.output/public --fallback /index.html --sec <NSEC_FROM_RUNTIME>
  5. Verify deployment:
    • nsyte status --sec <NSEC_FROM_RUNTIME>
    • Open https://<npub>.nsite.lol/

Mode 2: Rebuild From Scratch

Use this when you want a clean reimplementation with the same behavior.

  1. Create a fresh Nuxt app structure compatible with Gamma-Napp.
  2. Rebuild required capabilities from the referenced project docs:
    • Merchant resolution: local config in dev, hostname npub in nsite production
    • Discovery relay bootstrap: relay.ditto.pub, relay.damus.io, relay.primal.net
    • Relay model: kind:10002 inbox/outbox separation
    • Catalog: kind:30402 product parsing and safe d route encoding
    • Checkout: 4-step flow with Gamma order event kind:16 type:1
    • Payment path: kind:16 type:2 invoice plus lud16 fallback
    • Clone paths: newcomer and existing-user flows
  3. Add nsite deploy support:
    • static output build
    • .nsite/config.json
    • deploy/status command compatibility
  4. Validate:
    • npm run generate
    • npm run test:nsite-clone or equivalent clone manifest test
  5. Deploy and verify exactly like Mode 1.

Mode 3: Clone/Deploy Existing Nsite

Use this when the goal is to fork an existing nsite deployment.

  1. Resolve the source nsite identity and manifest.
  2. Trigger clone flow using the @nsite/stealthis integration path.
  3. If the source is a named site (kind:35128), publish the newcomer clone as a root manifest (kind:15128) and strip d and name tags.
  4. Publish the clone for the target identity.
  5. Verify target deployment:
    • nsyte status --sec <NSEC_FROM_RUNTIME>
    • Open https://<target-npub>.nsite.lol/

Shared Technical Rules

  • Local/dev merchant source: public/shop-config.json
  • Production merchant source: hostname subdomain (npub1... or npubs1... normalized to npub1...)
  • Catalog reads use merchant outbox relays, not fixed operational relays
  • Order events follow Gamma format (kind:16, type:1) and include item tags in 30402:<pubkey>:<d-tag> format
  • Always URL-encode and decode product d values
  • Keep the fallback invoice path via merchant lud16

Security Rules

  • Never hardcode or commit nsec values
  • Never print secrets into docs, logs, commit messages, or screenshots
  • Runtime secret input only: use <NSEC_FROM_RUNTIME> placeholders
  • Redact any discovered secrets before handoff

Deployment Verification Is The Success Gate

A run is complete only when all checks pass:

  1. npm run generate succeeds
  2. npm run test:nsite-clone succeeds or equivalent passes in Mode 2
  3. nsyte deploy ./.output/public --fallback /index.html --sec <NSEC_FROM_RUNTIME> succeeds
  4. nsyte status --sec <NSEC_FROM_RUNTIME> confirms healthy publish
  5. https://<npub>.nsite.lol/ is reachable and serves the expected app

Required Handoff Output

At completion, return:

  • selected mode (1, 2, or 3)
  • repo and git revision used
  • build result
  • test result
  • deploy command used without secrets
  • nsite status summary
  • live URL
  • known issues or none