用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fabioc-aloha/Alex_Plug_In --skill ralph-loop命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Create and maintain ASCII visual dashboards for project tracking with parallel lane progress bars
Store and manage voice samples for TTS cloning — portable, version-controlled audio references
Clear documentation through visual excellence
正在显示 SKILL.md
基于 SOC 职业分类
| name | ralph-loop |
| description | Iterative quality improvement — generate, evaluate, feedback, re-generate until threshold met |
| applyTo | **/*quality*,**/*eval*,**/*iterate*,**/*ralph* |
| domain | Quality Engineering |
| category | Iterative Improvement |
| tier | advanced |
| dependencies | ["testing-strategies","code-review"] |
| created | "2026-04-14T00:00:00.000Z" |
| author | Alex |
| source | microsoft/skills (Sensei technique by Shayne Boyer) |
Generate → Evaluate → Feedback → Re-generate until quality threshold met.
Inspired by the Sensei iterative quality improvement patterns from GitHub Copilot for Azure:
"LLMs improve dramatically when given structured feedback about what went wrong and specific guidance on how to fix it."
— Shayne Boyer (@spboyer), Microsoft
┌─────────────────────────────────────────────────────────────┐
│ RALPH LOOP │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Generate │────▶│ Evaluate │────▶│ Analyze │ │
│ └─────────┘ └──────────┘ └──────────┘ │
│ ▲ │ │
│ │ ┌──────────────────────┘ │
│ │ ▼ │
│ │ ┌──────────┐ ┌───────────┐ │
│ └────│ Feedback │◀────│ Threshold │ │
│ └──────────┘ │ Met? │ │
│ └───────────┘ │
│ │ Yes │
│ ▼ │
│ ┌────────┐ │
│ │ Done │ │
│ └────────┘ │
└─────────────────────────────────────────────────────────────┘
| Parameter | Default | Description |
|---|---|---|
maxIterations | 5 | Maximum iterations before stopping |
qualityThreshold | 80 | Score (0-100) to consider quality met |
improvementThreshold | 5 | Minimum improvement required per iteration |
earlyStopOnPerfect | true | Stop immediately when score reaches 100 |
includeFeedback | true | Include feedback in re-generation prompts |
qualityThresholdimprovementThreshold for 2+ iterationsmaxIterationsCriteria define what "good" looks like:
{
"skillName": "cosmos-db-patterns",
"language": "typescript",
"correctPatterns": [
{
"code": "container.items.query()",
"description": "Use container.items.query() for parameterized queries",
"section": "query-patterns"
}
],
"incorrectPatterns": [
{
"code": "SELECT * FROM c",
"description": "Avoid SELECT * — specify required fields",
"section": "query-patterns"
}
],
"rules": [
{
"name": "error-handling",
"requiredPatterns": ["try {", "catch ("],
"forbiddenPatterns": ["// eslint-disable"]
}
]
}
Transforms evaluation findings into LLM-actionable feedback:
{
"score": 65,
"passed": false,
"findings": [
{
"severity": "error",
"rule": "pattern:query-patterns",
"message": "Incorrect pattern found: Avoid SELECT * — specify required fields"
}
],
"matchedIncorrect": ["query-patterns"]
}
## Issues Found in Generated Content
### CRITICAL ERRORS (Must Fix)
- **pattern:query-patterns**: Incorrect pattern found: Avoid SELECT * — specify required fields
- Suggestion: Review acceptance criteria for correct usage
### INCORRECT PATTERNS DETECTED
Found incorrect patterns in sections: **query-patterns**
Review the acceptance criteria for these sections and use correct patterns instead.
### SUGGESTED CORRECTIONS
Based on the acceptance criteria, consider:
- Use: Use container.items.query() for parameterized queries
# Evaluate content against criteria
node ralph-loop.cjs --evaluate --content "SELECT * FROM c" --criteria criteria.json
# Evaluate from file
node ralph-loop.cjs --evaluate --content-file output.ts --criteria criteria.json
# Extract criteria from SKILL.md
node ralph-loop.cjs --extract-criteria --skill .github/skills/cosmos-db/SKILL.md
# Build feedback from findings
node ralph-loop.cjs --feedback --findings '[{"severity":"error","rule":"syntax","message":"Missing semicolon"}]'
# Stdin mode (for extension integration)
echo '{"content":"...","criteria":{...}}' | node ralph-loop.cjs --stdin
import { ContentEvaluator, FeedbackBuilder, RalphLoopController } from './ralph-loop';
// Create evaluator with criteria
const criteria = loadSkillCriteria('cosmos-db-patterns');
const controller = new RalphLoopController(criteria, {
maxIterations: 3,
qualityThreshold: 85,
});
// Run loop with Copilot LLM
const result = await controller.run(
async (prompt) => await copilot.generate(prompt),
"Write a Cosmos DB query for user lookup",
"user-query-scenario"
);
console.log(`Final score: ${result.finalScore}`);
console.log(`Converged: ${result.converged}`);
console.log(`Iterations: ${result.iterations.length}`);
const evaluator = new ContentEvaluator(criteria);
const feedbackBuilder = new FeedbackBuilder();
const result = evaluator.evaluate(generatedCode, 'my-scenario');
const feedback = feedbackBuilder.buildFeedback(result, criteria);
if (!result.passed) {
console.log(feedback); // Give to LLM for improvement
}
Track these across iterations:
| Metric | Description |
|---|---|
score | Overall quality score (0-100) |
errorCount | Number of critical errors |
warningCount | Number of warnings |
matchedCorrect | Correct patterns found |
matchedIncorrect | Incorrect patterns found |
improvement | Score change from first to last iteration |
converged | Whether quality threshold was met |
| Don't | Do |
|---|---|
Set maxIterations too high (>5) | Usually 3-5 iterations sufficient |
Set qualityThreshold at 100 | 80-90 is realistic for most use cases |
| Include vague criteria | Be specific with patterns and rules |
| Skip feedback on failure | Always provide structured feedback |