AgentSkillsCN

SpecsVibeCode Expert

深入掌握SpecsVibeCode代码库——基于Rails 8的单体架构,用于AI驱动的文档生成。适用于任何涉及身份认证、项目、文档、生成流水线、计费(Stripe/YooKassa)、积分、订阅,或UI组件的开发任务。

SKILL.md
--- frontmatter
name: SpecsVibeCode Expert
description: Deep knowledge of SpecsVibeCode codebase — Rails 8 monolith for AI-powered documentation generation. Use this skill for any development task involving authentication, projects, documents, generation pipeline, billing (Stripe/YooKassa), credits, subscriptions, or UI components.

SpecsVibeCode Expert Skill

This skill provides comprehensive knowledge of the SpecsVibeCode project — a SaaS platform for AI-powered project documentation generation built on Rails 8 with Hotwire, Supabase Auth, and dual payment providers.

When to Use This Skill

  • Developing new features for SpecsVibeCode
  • Debugging issues in authentication, billing, or generation
  • Adding new document types to the generation pipeline
  • Working with credits, subscriptions, or payment flows
  • Creating or modifying UI components
  • Writing tests for any part of the application
  • Optimizing performance or queries
  • Deploying to Render.com

Quick Reference Resources

Architecture Patterns

📁 resources/architecture.md — Service objects, concerns, Turbo Streams patterns

Database Schema

📁 resources/database.md — Tables, enums, relationships, credit costs

Routes & Controllers

📁 resources/routes.md — All endpoints with their controllers and purposes

Generation Pipeline

📁 resources/generation.md — Document generation flow, orchestrator, generators

Billing System

📁 resources/billing.md — Stripe + YooKassa integration, webhooks, credit operations

UI Components

📁 resources/ui.md — Partials, Stimulus controllers, design tokens

Key Constants

ruby
# Credit costs
AI_SUGGESTION_COST = 1
DOCUMENT_GENERATION_COST = 1
MONTHLY_STARTER_CREDITS = 200
MONTHLY_PRO_CREDITS = 1000

# Retry limits
Project::MAX_RETRY_ATTEMPTS = 3

# Validation
Project::MIN_DESCRIPTION_LENGTH = 50

Common Tasks

Add a New Document Type

  1. Add to document_type enum in migration
  2. Create app/services/generation/{type}_generator.rb
  3. Create app/jobs/generation/generate_{type}_job.rb
  4. Add to Generation::GenerationOrchestrator::PIPELINE
  5. Add system prompt to app/services/generation/System_prompts/
  6. Update UI to display new document type

Add a New Payment Provider

  1. Create app/services/billing/{provider}_gateway.rb extending BasePaymentGateway
  2. Add to payment_provider enum
  3. Update PaymentGatewayFactory
  4. Create webhook handler in Api::Webhooks::PaymentsController
  5. Add environment variables

Add a New Stimulus Controller

  1. Create app/javascript/controllers/{name}_controller.js
  2. Export in app/javascript/controllers/index.js
  3. Use in views: data-controller="{name}"

File Locations

PurposeLocation
Modelsapp/models/
Controllersapp/controllers/
Servicesapp/services/
Jobsapp/jobs/
Viewsapp/views/
Stimulusapp/javascript/controllers/
Partials (UI)app/views/components/ui/
Translationsconfig/locales/
Routesconfig/routes.rb
Database Schemadb/schema.rb
Migrationsdb/migrate/
Testsspec/
DocumentationDocs/

Environment Variables

Required for full functionality:

code
DATABASE_URL
SUPABASE_URL, SUPABASE_KEY, SUPABASE_JWT_SECRET
OPENROUTER_API_KEY, OPENROUTER_MODEL
STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRET
STRIPE_STARTER_PRICE_ID, STRIPE_PRO_PRICE_ID
YOOKASSA_SHOP_ID, YOOKASSA_API_KEY
APP_URL, RAILS_MASTER_KEY

Testing Commands

bash
bundle exec rspec                    # All tests
bundle exec rspec spec/models        # Model tests
bundle exec rspec spec/services      # Service tests
bundle exec rspec spec/controllers   # Controller tests

Development Commands

bash
bin/dev              # Start dev server (Foreman)
bin/jobs             # Start Solid Queue
bin/rubocop          # Lint Ruby code
bin/brakeman         # Security scan
bin/rails console    # Rails console