Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ce8cf07
fix: hide prompt from link share previews
claude Jan 28, 2026
1153bcc
Merge pull request #77 from tacticalnoot/claude/hide-prompt-link-shar…
tacticalnoot Jan 28, 2026
83442b6
fix(auth): add rpId to login payload for subdomain verification
Jan 29, 2026
2bda30c
fix(rpc): replace broken mainnet.stellar.org:443 with gateway.fm soro…
Jan 29, 2026
db52418
retry deploy
Jan 29, 2026
fcfa424
feat: upgrade Kale or Fail - balance display, visualizer, improved UX
Jan 29, 2026
d7842b2
fix: prevent self-tipping in Kale or Fail
Jan 29, 2026
936ed41
fix: remove crossOrigin to fix audio playback in Kale or Fail
Jan 29, 2026
0bb9497
debug: add audio playback logging to Kale or Fail
Jan 29, 2026
3d52687
fix: construct proper audio URL from Song_1 GUID in Kale or Fail
Jan 29, 2026
2bfaf63
fix: add Start button for audio (autoplay policy) + unique artist filter
Jan 29, 2026
1eb1fdf
fix: show truncated address for unknown artists in Kale or Fail
Jan 29, 2026
d0c3c20
fix: remove AudioContext visualizer that was blocking audio playback
Jan 29, 2026
c8066dc
Fix social card audio defaults
tacticalnoot Jan 29, 2026
2dd770d
Merge pull request #78 from tacticalnoot/codex/fix-hyperlink-redirect…
tacticalnoot Jan 29, 2026
4216804
fix: robust tip settlement - prevent double-tipping on retry, continu…
Jan 30, 2026
cc155ab
ui: update Kale or Fail browser tab title
Jan 30, 2026
3b408d0
feat: batch tip transactions - one signature for all tips
Jan 30, 2026
06599f5
feat: integrated batch transfer contract - one signature for all tips
Jan 30, 2026
c73df9c
fix: use RPC_URL constant instead of non-existent getRpcUrl function
Jan 30, 2026
aeb0eed
fix: filter out invalid artist addresses (null account) before batch …
Jan 30, 2026
a206d21
feat: improve batch transfer diagnostics and error handling
Jan 30, 2026
36729fb
fix: use NULL_ACCOUNT for batch tx building to resolve invalid accoun…
Jan 30, 2026
5a474b3
fix: chunk batch transfers to 5 to avoid relayer timeout
Jan 30, 2026
91975a3
feat: add kale or fail stats and achievements system
Jan 30, 2026
6190090
feat: kale or fail enhancements - audio conflict fix, hd images, 15 s…
Jan 30, 2026
25e2aba
fix: optimize rpc event scanner to cache safe start ledger and avoid …
Jan 30, 2026
9593048
fix: remove stray closing style tag in KaleOrFailCore.svelte breaking…
Jan 30, 2026
203c820
chore: add deployment watcher script
Jan 30, 2026
7dfe435
fix: resolve nested function declaration in event-scanner.ts
Jan 30, 2026
cc57185
chore: force rebuild
Jan 30, 2026
3107a4c
fix: use dynamic import for canvas-confetti to prevent SSR 500 error
Jan 30, 2026
f5f25d9
fix: restore missing script tag in KaleOrFailCore.svelte
Jan 30, 2026
44d2da8
chore: add KV session binding to wrangler.toml for local preview
Jan 30, 2026
55f5f9e
chore: revert local KV binding to fix production deployment
Jan 30, 2026
d446ffa
chore: remove watcher script
Jan 30, 2026
1e6bcc0
fix: prerender kale-or-fail page to bypass SSR session requirement
Jan 30, 2026
c2129a8
fix: polyfill self to globalThis in vite config for SSG compatibility
Jan 30, 2026
24cef07
fix: reduce batch size to 2 to prevent relayer timeouts
Jan 30, 2026
e7343a4
fix: adjust batch size to 3
Jan 30, 2026
b8bb3c2
fix: revert batch size back to 5
Jan 30, 2026
0c76fb0
feat: implement intelligent retry logic for batch tipping
Jan 30, 2026
b532ddd
fix: cleanup duplicate comment and add retry flavor text
Jan 30, 2026
5ceb738
fix: update retry flavor text to be more abundant
Jan 30, 2026
cfa50b6
feat: auto-tip (swipe right) when song finishes playing
Jan 30, 2026
ec24d9d
fix: use HD album art (scale=800) in Kale or Fail
Jan 30, 2026
7d2da03
fix: refactor findTokenTransfers signature to resolve build error
Jan 30, 2026
7c34ea5
feat: update game over screen with Thank You message and Play Again b…
Jan 30, 2026
9cc5019
fix: downgrade album art scale from 800 to 32 to fix loading error
Jan 30, 2026
49e62de
feat: add labs-game-mechanics skill and secure deployer credentials
Jan 30, 2026
457f758
chore: hygiene pass, secure credentials, and type fixes
Jan 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
71 changes: 71 additions & 0 deletions .agent/skills/labs-game-mechanics/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: labs-game-mechanics
description: Architecture, resilience, and deployment standards for Smol Labs experiments. Enforces local-first state loops, batched blockchain settlement, and robust asset/retry patterns.
---

# Smol Labs — Game Mechanics & Resilience Protocol

## 1. TL;DR
This skill encapsulates the learnings from the **Kale or Fail** experiment. It defines the standard for building interactive, blockchain-integrated games in the Smol ecosystem.
- **Loop**: Optimistic Local State → Batched Blockchain Settlement.
- **Resilience**: Never trust the Relay/RPC. wrap *everything* in `withRetry`.
- **Assets**: Strict scaling standards (`scale=32` vs `scale=800`).
- **Security**: Identity management via `.env` only.

## 2. The Architecture: Optimistic Game Loop

### Local-First State
Users demand instant feedback. Do not await blockchain confirmations for game actions.
- **Swipe/Action**: Update local variable immediately (e.g., `currentIndex++`).
- **Visuals**: Trigger confetti/animations immediately.
- **Store**: Push the action to a queue (e.g., `batchQueue.push(action)`).

### Batched Settlement
Never send 1 transaction per action. It is slow, expensive, and annoying.
- **Threshold**: Settle when queue hits `N` (e.g., 5 items) or on Game Over.
- **Contract**: Use a **Batch Smart Contract** that takes arrays (`[to]`, `[amount]`) and requires only **ONE** user signature.
- **UX**: Show "Polishing Kale..." or flavor text while settling.

## 3. Resilience Protocol (The "Retry" Rule)

The network (Relayer, RPC) is hostile and intermittent. Failures are normal.
- **Rule**: `src/utils/retry.ts` is mandatory for all chain interactions.
- **Pattern**:
```typescript
await withRetry(async () => {
return await aggregator.send(batchedTx);
});
```
- **Backoff**: Use exponential backoff (1s, 2s, 4s) to survive temporary congestion.

## 4. Asset Standards (The "Scale" Rule)

Backend image generation is expensive. requesting huge images crashes servers.
- **Pixel Art**: Use `?scale=32` (scales 1px → 32px). This creates crisp, large-enough assets.
- **High-Def**: Use `?scale=32` as "HD".
- **Forbidden**: `?scale=800` (Requesting 800x magnification). This causes 500/503 errors.

## 5. Audio/Visual Coherence

Visuals and Audio must sync, but not collide.
- **Global Player**: If the game has music, **PAUSE** the global `GlobalPlayer` explicitly on mount.
- **Ambient**: Use blurred, desaturated copies of album art for background ambiance (`opacity-30`, `blur-3xl`).
- **Particles**: `canvas-confetti` must be dynamically imported (client-side only).

## 6. Deployment & Security

### Identity Management
- **Never** commit `secret_key` or `mnemonic` to git.
- **Deployer Identity**: Store in `.config/stellar/identity` AND backup to `.env` (`BATCH_DEPLOYER_MNEMONIC`).
- **Env Validation**: Use `astro.config.mjs` to polyfill `self: 'globalThis'` for Stellar SDK compatibility.

### Watcher Pattern
- Use `scripts/watch-deploy.js` to auto-deploy to Cloudflare Pages on git commit.
- If it hangs or fails, kill the process and check `wrangler` output manually.

## 7. Checklist for New Games
1. [ ] **Contract**: Does it support batching?
2. [ ] **Retry**: Is `withRetry` wrapping the send?
3. [ ] **Assets**: Are images using `scale=32`?
4. [ ] **Audio**: Does it handle `GlobalPlayer` conflict?
5. [ ] **Keys**: Is the deployer secure in `.env`?
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ The dev server runs on `http://localhost:4321`.

### Local Authentication
Passkeys are domain-bound. To test authentication:
- **Default**: Use `http://localhost:4321` for general development.
- **Recommended**: Deploy your fork to **Cloudflare Pages**. This is the easiest way to test Passkeys/Stellar on a `*.pages.dev` domain.
- **Advanced**: For local authentication workflows, see the **[Cookie Transfer](docs/DEVELOPER_SETUP.md#-localhost-authentication-the-cookie-transfer)** method in the developer setup guide.
- **Default**: Use `http://localhost:4321` for general development (auth features will be limited).
- **Recommended**: Deploy your fork to **Cloudflare Pages**. This gives you a `*.pages.dev` domain with HTTPS, the easiest way to test Passkeys/Stellar accurately.

### Type Checking

Expand Down
3 changes: 3 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ export default defineConfig({
// mkcert(),
tailwindcss()
],
define: {
self: 'globalThis'
}
},
});// touch
977 changes: 977 additions & 0 deletions commits_ahead.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions commits_behind.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
4331f1e Update passkey-kit.ts (kalepail)
a36be34 migrate to turnstile and relayers (kalepail)
1c296bc Update SmolDisplay.svelte (kalepail)
3758b18 fix some image gen stuff (kalepail)
16e0d30 don't use base64 (kalepail)
842bb43 Create _headers (kalepail)
8c8de7f Create apple-app-site-association (kalepail)
Loading