AgentSkillsCN

superteam-academy-dev

超级团队学院——基于Solana的去中心化学习平台,采用游戏化进阶机制、灵魂绑定XP代币、ZK压缩凭证、连胜奖励体系,以及创作者激励机制。涵盖Anchor程序开发、Token-2022、Light Protocol,以及使用LiteSVM/Mollusk/Trident进行测试。

SKILL.md
--- frontmatter
name: superteam-academy-dev
description: Superteam Academy — decentralized learning platform on Solana with gamified progression, soulbound XP tokens, ZK compressed credentials, streak systems, and creator incentives. Covers Anchor program development, Token-2022, Light Protocol, and testing with LiteSVM/Mollusk/Trident.
user-invocable: true

Superteam Academy Skill

What this Skill is for

Use this Skill when the user asks for:

  • On-chain program development for the Academy platform
  • XP token minting (soulbound Token-2022)
  • Season lifecycle management (create/close seasons, new mints)
  • Course registry and enrollment logic
  • Lesson completion, bitmap tracking, streak systems
  • Finalize course / award XP flows
  • ZK Compressed credential issuance (Light Protocol)
  • Achievement and gamification features
  • Referral system implementation
  • Anchor program development, testing, security
  • Deployment workflows (devnet → mainnet)

Core Concepts

Account Structure (4 PDAs + 1 Compressed)

AccountSeedsPurpose
Config["config"]Singleton: authority, backend signer, season, rate limits
Course["course", course_id.as_bytes()]Course metadata, creator, track, XP amounts
LearnerProfile["learner", user.key()]Streaks, achievements (bitmap), rate limiting, referrals
Enrollment["enrollment", course_id.as_bytes(), user.key()]Lesson bitmap, completion timestamps (closeable)
Credential["credential", learner.key(), track_id.to_le_bytes()]ZK compressed via Light Protocol, upgradeable per track

Instructions (16 Total)

CategoryInstructions
Platform Management (4)initialize, create_season, close_season, update_config
Courses (2)create_course, update_course
Learner (4)init_learner, register_referral, claim_achievement, award_streak_freeze
Enrollment & Progress (6)enroll, unenroll, complete_lesson, finalize_course, issue_credential, close_enrollment

Core Learning Loop

code
ENROLL → COMPLETE LESSONS → FINALIZE COURSE → ISSUE CREDENTIAL → CLOSE ENROLLMENT
  1. Enroll: Learner signs, prerequisite check, create Enrollment PDA
  2. Complete Lessons: Backend signs, set bitmap bit, mint lesson XP, update streak
  3. Finalize Course: Backend signs, verify all lessons done, mint learner + creator XP
  4. Issue Credential: Backend signs, Light CPI to create/upgrade ZK compressed credential
  5. Close Enrollment: Learner signs, reclaim rent

Key Design Decisions

  • XP = soulbound Token-2022 token (NonTransferable + PermanentDelegate)
  • Seasons = new mint per season; old tokens remain as history
  • Credentials use ZK Compression (Light Protocol) — no merkle tree, no rent, upgradeable
  • finalize_course and issue_credential are split — XP awards don't depend on credential CPI
  • On-chain daily XP cap — defense-in-depth even if backend compromised
  • UTC standard for all day boundaries (streaks, rate limiting)
  • Rotatable backend signer stored in Config
  • Reserved bytes on all accounts for future-proofing without migrations

Technology Stack

LayerStack
ProgramsAnchor 0.31+, Rust 1.82+
Token StandardToken-2022 (NonTransferable, PermanentDelegate, MetadataPointer, TokenMetadata)
CredentialsLight SDK (ZK Compression) — compressed PDAs, Photon indexer
TestingMollusk, LiteSVM, Trident (fuzz)
ClientTypeScript, @coral-xyz/anchor, @solana/web3.js
FrontendNext.js 14+, React, Tailwind CSS
RPCHelius (DAS API + Photon for ZK Compression)
ContentArweave (immutable course content)
MultisigSquads (platform authority)

Compute Budgets

InstructionCU Budget
initialize~5K
create_season~50K
complete_lesson~40K
finalize_course~100K
issue_credential~200-300K

Operating Procedure

1. Classify the task

  • Platform setup (Config, seasons, authority)
  • Course management (create, update, track assignment)
  • Learner lifecycle (init, streaks, achievements, referrals)
  • Enrollment flow (enroll, lessons, finalize, credentials, close)
  • Account structure (PDAs, compressed accounts, state)
  • Access control (backend signer, authority, permissions)
  • Testing (unit, integration, fuzz)
  • Security (audit, attack vectors)
  • Deployment (devnet, mainnet)

2. Implementation Checklist

Always verify:

  • Account validation (owner, signer, PDA seeds + bump)
  • Backend signer matches Config.backend_signer
  • Checked arithmetic throughout (checked_add, checked_sub, checked_mul)
  • Bitmap operations correct for lesson tracking
  • Daily XP cap enforced before minting
  • Streak logic uses UTC day boundaries
  • Events emitted for state changes
  • Canonical PDA bumps stored (never recalculated)
  • Reserved bytes preserved on account modifications
  • CPI target program IDs validated

3. Testing Requirements

  • Unit test (Mollusk): Each instruction in isolation
  • Integration test (LiteSVM): Full enroll → complete lessons → finalize → credential flow
  • Fuzz test (Trident): Random amounts, edge cases, bitmap bounds
  • Attack test: Daily cap bypass, unauthorized signer, double completion
  • Streak test: UTC boundary edge cases

Progressive Disclosure (read when needed)

Programs & Development

Testing & Security

  • testing.md — LiteSVM, Mollusk, Trident, CI guidance
  • security.md — Vulnerability categories, program checklists

Deployment

  • deployment.md — Devnet/mainnet workflows, verifiable builds, multisig

Ecosystem & Reference

Task Routing Guide

User asks about...Primary file(s)
Anchor program codeprograms-anchor.md
Unit/integration testingtesting.md
Fuzz testing (Trident)testing.md
Security review, auditsecurity.md
Deploy to devnet/mainnetdeployment.md
Token standards, SPL, Token-2022ecosystem.md
Generated clients, IDLidl-codegen.md
Official docs and resourcesresources.md

Implementation Phases

Refer to docs/IMPLEMENTATION_ORDER.md for details. Summary:

  1. Config + Seasons → foundation (~1-2 days)
  2. LearnerProfile → user onboarding (~0.5 days)
  3. Course Registry → content management (~1 day)
  4. Enrollment + Lessons → core learning loop (~3-4 days)
  5. Finalize Course → working MVP (~1-2 days) ← devnet deploy here
  6. Credentials (ZK) → verifiable credentials (~3-4 days)
  7. Achievements → gamification (~1 day)
  8. Streak Freezes → streak polish (~0.5 days)
  9. Referrals → growth (~0.5 days)
  10. Close Enrollment → rent reclaim (~0.5 days)

Canonical Docs

DocumentPurpose
docs/SPEC.mdSource of truth for all program behavior
docs/ARCHITECTURE.mdAccount maps, data flows, CU budgets
docs/IMPLEMENTATION_ORDER.md10-phase incremental build plan
docs/FUTURE_IMPROVEMENTS.mdV2/V3 deferred features backlog