AgentSkillsCN

project-context

为 RWA 房地产代币分析平台提供专属项目技术栈、架构及实施规范。

SKILL.md
--- frontmatter
name: project-context
description: Provides project-specific tech stack, architecture, and implementation rules for RWA real estate token analytics platform.

Project Context

Basic Configuration

Project Nature

  • Project Type: RWA (Real World Assets) analytics dashboard for tokenized real estate
  • Usage Scope: Aggregated blockchain data analysis, portfolio monitoring, transaction tracking
  • Implementation Policy: LLM-driven implementation, quality-focused, strict YAGNI principle adherence

Technology Stack

  • Monorepo: Nx 22.4.0 with npm workspaces
  • Frontend: Next.js 16 (App Router)
  • Backend: NestJS 11 (standalone applications)
  • Database: TimescaleDB + Drizzle ORM
  • Language: TypeScript 5.9.2 (strict mode)
  • Compiler: SWC
  • Linting: ESLint 9 (flat config) + Prettier
  • Git Hooks: Lefthook (pre-commit, pre-push)
  • CI/CD: GitHub Actions

Project Structure

code
apps/
├── chain-slurper/     # NestJS standalone - blockchain transaction fetcher
├── chain-slurper-e2e/ # E2E tests for chain-slurper
├── rwa-cli/           # CLI for AI-powered contract parsing and tokenizer discovery
├── web/               # Next.js 16 frontend (App Router)
└── web-e2e/           # Playwright E2E tests for web

packages/
├── blockchain-connectors/  # @rwa/blockchain-connectors - EVM chain communication
├── tokenizer-adapters/     # @rwa/tokenizer-adapters - Token discovery adapters
└── db/                     # @rwa/db - Drizzle ORM schemas and database utilities

Path Aliases

AliasPathDescription
@rwa/dbpackages/db/srcDatabase schemas and utilities
@rwa/blockchain-connectorspackages/blockchain-connectorsEVM chain communication layer
@rwa/tokenizer-adapterspackages/tokenizer-adaptersToken discovery and transaction parsing
@rwa/chain-slurperapps/chain-slurper/srcChain slurper exports
@rwa/webapps/web/srcWeb app exports

Applications

chain-slurper

  • Type: NestJS standalone application (no HTTP server)
  • Purpose: Fetch and process blockchain transactions
  • Entry: SlurperService.run() - continuous blockchain monitoring
  • Commands:
    • nx serve chain-slurper - development
    • nx build chain-slurper - production build

web

  • Type: Next.js 16 with App Router
  • Purpose: Analytics dashboard frontend
  • Structure: src/app/ with route groups
  • Commands:
    • nx dev web - development (port 3001)
    • nx build web - production build

rwa-cli

  • Type: CLI application (Commander.js)
  • Purpose: AI-powered contract parsing and tokenizer discovery
  • Features:
    • Decode event topic hashes (local cache + 4byte.directory)
    • Detect contract types (ERC-20, ERC-721, ERC-1155, ERC-3643)
    • Fetch verified ABIs from block explorers
    • Analyze factory contracts for token creation events
    • Find similar contracts by creator/bytecode/events
    • Scan factories for deployed tokens
  • Commands:
    • nx build rwa-cli - build CLI
    • node dist/apps/rwa-cli/main.js --help - show commands
  • Skill: See /rwa-cli skill for detailed usage

Libraries

@rwa/db

  • ORM: Drizzle ORM with node-postgres
  • Database: PostgreSQL/TimescaleDB
  • Schemas:
    • transactions - blockchain transactions
    • tokens - RWA token metadata
  • Usage:
    typescript
    import { getDb, transactions, tokens } from '@rwa/db';
    const db = getDb();
    

Quality Tools

Git Hooks (Lefthook)

HookActions
pre-commitprettier --check, eslint (staged files)
pre-pushnx affected -t lint typecheck test

ESLint Configuration

  • Flat config (eslint.config.mjs)
  • TypeScript-ESLint with projectService
  • Nx module boundaries enforcement
  • Prettier compatibility

Target Users

Retail Investors

  • Private individuals seeking portfolio diversification through RWA
  • Need simple analytics and portfolio tracking

Institutional Investors

  • Funds and asset managers
  • Require detailed analytics, historical data, and comprehensive reporting

Implementation Principles

Business Constraints

  1. Multi-chain Support: Aggregate data from multiple blockchains (Ethereum, Polygon, Arbitrum, etc.)
  2. Historical Data Storage: TimescaleDB for efficient storage and analysis of blockchain time-series data
  3. Real-time Updates: Track blockchain transactions and operations in real-time

Usage Scenarios

  • Analyze available RWA real estate tokens before investment
  • Monitor tokenized real estate portfolio
  • Track transactions and operations in real-time
  • Historical analysis of token yield and liquidity

Development Commands

bash
# Development
nx serve chain-slurper    # Run chain-slurper
nx dev web                # Run web (Next.js dev)

# Build
nx build <project>        # Build single project
nx run-many -t build      # Build all

# Quality
nx run-many -t lint       # Lint all
nx run-many -t test       # Test all
nx run-many -t typecheck  # Type check all

# Affected (for PRs)
nx affected -t lint test build

Development Structure

  • Team Composition: Individual development (1 developer)
  • Development Phase: Active development