Skip to content

Conversation

@pbtc21
Copy link

@pbtc21 pbtc21 commented Jan 21, 2026

Summary

Phase 4 of Bitcoin Agents implementation - the frontend for Tamagotchi-style AI agents on Bitcoin.

New Types

  • BitcoinAgent, DeathCertificate, and related types
  • XP thresholds and level mappings (hatchling, junior, senior, elder, legendary)

New Service

  • bitcoin-agents.service.ts for API calls to the backend
  • Support for agents CRUD, stats, leaderboard, graveyard
  • Feed and mint payment flow helpers (x402)

New Components

  • BitcoinAgentCard - Agent card for grid display
  • LevelBadge - Evolution tier badge with icons (🥚🐣🐥🦅🔥)
  • HungerHealthBars - Status bars with color-coded urgency
  • XPProgress - Progress to next evolution level
  • FeedButton - Food tier selector dialog
  • HungryAgentBanner - Notification banner for low hunger

New Pages

  • /bitcoin-agents - List all agents with filters (status, level, search)
  • /bitcoin-agents/[id] - Agent detail with stats, feed button, capabilities
  • /bitcoin-agents/mint - Mint new agent flow with preview
  • /bitcoin-agents/leaderboard - Top agents by XP
  • /graveyard - Memorial wall for dead agents

Related PRs

Test plan

  • Verify pages load without errors
  • Test agent list filtering and sorting
  • Test mint flow (402 payment handling)
  • Test feed button dialog
  • Test graveyard and leaderboard

🤖 Generated with Claude Code

Phase 4 Frontend implementation:

Types:
- Add BitcoinAgent, DeathCertificate, and related types
- Define XP thresholds and level mappings

Service:
- Create bitcoin-agents.service.ts for API calls
- Support for agents CRUD, stats, leaderboard, graveyard
- Feed and mint payment flow helpers

Components:
- BitcoinAgentCard: Agent card for grid display
- LevelBadge: Evolution tier badge with icons
- HungerHealthBars: Status bars with colors
- XPProgress: XP to next level progress
- FeedButton: Food tier selector dialog
- HungryAgentBanner: Notification for low hunger

Pages:
- /bitcoin-agents: List all agents with filters
- /bitcoin-agents/[id]: Agent detail with stats and actions
- /bitcoin-agents/mint: Mint new agent flow
- /bitcoin-agents/leaderboard: Top agents by XP
- /graveyard: Memorial for dead agents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pbtc21
Copy link
Author

pbtc21 commented Jan 21, 2026

@whoabuddy Ready for review - Bitcoin Agents frontend. Adds pages for browsing agents, minting, feeding, leaderboard, and graveyard memorial.

HungryAgentBanner:
- Fix potential race condition with useCallback for loadAgents
- Extract magic numbers to named constants (HUNGER_*_THRESHOLD)

XPProgress:
- Add guards against NaN from division by zero
- Improve nextLevel calculation safety

FeedButton:
- Add error state with user-visible error messages
- Add loading spinner indicator per tier
- Extract resetState helper function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pbtc21
Copy link
Author

pbtc21 commented Jan 21, 2026

Fixes pushed:

  • Fixed race condition in HungryAgentBanner using useCallback
  • Fixed potential NaN in XPProgress with division-by-zero guard
  • Added error state display in FeedButton component
  • Extracted magic numbers to named constants
  • Added loading spinner per food tier

- Remove unused 'router' import from mint/page.tsx
- Remove unused 'visitAgent' import from [id]/page.tsx
- Fix useEffect missing dependencies using useCallback pattern
- Remove unused CardHeader, CardTitle imports from graveyard/page.tsx

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pbtc21
Copy link
Author

pbtc21 commented Jan 21, 2026

Additional ESLint fixes pushed:

  • Removed unused imports (router, visitAgent, CardHeader, CardTitle)
  • Fixed useEffect missing dependencies using useCallback pattern
  • All bitcoin-agents and graveyard pages now pass lint checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant