AgentSkillsCN

run-generation

运行问题生成流水线,支持可选的问题类型与难度筛选。自动生成问题,经裁判评分、去重处理后,批量插入数据库。

SKILL.md
--- frontmatter
name: run-generation
description: Run the question generation pipeline with optional type and difficulty filters. Generates questions, evaluates with judge, deduplicates, and inserts to database.
allowed-tools: Bash

Run Generation Pipeline

Runs the full question generation pipeline locally using run_generation.py.

Usage

code
/run-generation [--type <type>] [--difficulty <difficulty>] [--count <n>] [--dry-run]

Arguments

ArgumentRequiredDefaultDescription
--typeNoallQuestion type: math, logic, pattern, spatial, verbal, memory
--difficultyNoallDifficulty level: easy, medium, hard
--countNo50Number of questions to generate
--dry-runNofalseGenerate and evaluate but don't insert to database

Implementation

Step 1: Parse Arguments

Extract the optional arguments from the user's input:

  • --type <type> or -t <type> - maps to --types <type>
  • --difficulty <difficulty> or -d <difficulty> - maps to --difficulties <difficulty>
  • --count <n> or -c <n> - maps to --count <n>
  • --dry-run - adds --dry-run flag

Validate:

  • Type must be one of: math, logic, pattern, spatial, verbal, memory
  • Difficulty must be one of: easy, medium, hard
  • Count must be a positive integer

Step 2: Build Command

Construct the command with only the specified arguments:

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --async --async-judge --verbose [additional args based on input]

Examples:

No arguments (generate all types/difficulties):

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --count 50 --async --async-judge --verbose

With type only:

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --types math --count 50 --async --async-judge --verbose

With difficulty only:

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --difficulties hard --count 50 --async --async-judge --verbose

With both:

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --types spatial --difficulties easy --count 50 --async --async-judge --verbose

Dry run:

bash
cd /Users/mattgioe/aiq/question-service && source venv/bin/activate && export $(grep -v '^#' .env | xargs) && python run_generation.py --types math --count 10 --async --async-judge --verbose --dry-run

Step 3: Run and Report

Execute the command and report results including:

  • Number of questions generated
  • Number approved by judge
  • Number unique after deduplication
  • Number inserted to database
  • Approval rate

Exit Codes

CodeMeaningAction
0SuccessAll questions generated and inserted
1Partial failureSome questions failed - check logs
2Complete failureNo questions generated - check API keys/quotas
3Config errorMissing or invalid environment variables
4Database errorCannot connect to database

Examples

code
/run-generation

Generate 50 questions of all types and difficulties.

code
/run-generation --type math

Generate 50 math questions at all difficulty levels.

code
/run-generation --difficulty hard

Generate 50 hard questions of all types.

code
/run-generation --type pattern --difficulty easy --count 20

Generate 20 easy pattern questions.

code
/run-generation --type spatial --count 30 --dry-run

Generate 30 spatial questions without inserting to database (for testing).

Requirements

  • question-service/.env must contain valid API keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.)
  • question-service/venv must be set up with dependencies installed
  • DATABASE_URL must be configured in .env