AgentSkillsCN

gates

9 种语言的质量门禁验证:包括 lint 检查、格式化、类型检查以及测试执行。在代码完成前,确保代码变更符合质量标准。当您:(1) 完成代码实现后;(2) 创建 PR 之前;(3) 作为 /orchestrator 第 6 步的一部分;(4) 进行人工质量检查时,可调用此技能。常用触发词包括:/gates、“质量门禁”、“运行验证”、“检查质量”、“验证代码”。

SKILL.md
--- frontmatter
# VERSION: 2.43.0
name: gates
description: "9-language quality gate validation: linting, formatting, type checking, and test execution. Validates code changes meet quality standards before completion. Use when: (1) after code implementation, (2) before PR creation, (3) as part of /orchestrator Step 6, (4) manual quality check. Triggers: /gates, 'quality gates', 'run validation', 'check quality', 'validate code'."
context: fork
user-invocable: true

Gates - Quality Validation (v2.37)

Comprehensive quality validation across 9 programming languages with TLDR-assisted analysis.

Quick Start

bash
/gates              # Run all quality gates
ralph gates         # Via CLI
ralph gates src/    # Specific directory

Pre-Gates: TLDR Language Detection (v2.37)

AUTOMATIC - Detect project languages efficiently:

bash
# Get codebase structure to detect languages (95% token savings)
tldr structure . > /tmp/project-structure.md

# From structure, identify:
# - Primary language(s)
# - Config files present
# - Test frameworks used

Supported Languages

LanguageLinterFormatterTypes
TypeScriptESLintPrettiertsc
JavaScriptESLintPrettier-
PythonRuffBlackmypy
RustClippyrustfmtcargo check
Gogolintgofmtgo vet
JavaCheckstylegoogle-java-format-
RubyRuboCop-Sorbet
PHPPHP_CodeSnifferphp-cs-fixerPHPStan
SoliditySolhintprettier-solidity-

Workflow

1. Detect Languages

bash
# Auto-detect based on file extensions and config files

2. Run Linters

bash
# Per-language linting
npx eslint src/          # TypeScript/JavaScript
ruff check .             # Python
cargo clippy             # Rust
golangci-lint run        # Go

3. Check Formatting

bash
npx prettier --check .   # JS/TS
black --check .          # Python
rustfmt --check src/     # Rust
gofmt -l .               # Go

4. Type Checking

bash
npx tsc --noEmit         # TypeScript
mypy .                   # Python
cargo check              # Rust
go vet ./...             # Go

5. Run Tests

bash
npm test                 # Node projects
pytest                   # Python
cargo test               # Rust
go test ./...            # Go

Exit Codes

CodeMeaning
0All gates passed
1Lint errors
2Format errors
3Type errors
4Test failures

Gate Configuration

Minimal (fast)

bash
ralph gates --minimal    # Lint only

Standard (default)

bash
ralph gates              # Lint + Format + Types

Full (CI)

bash
ralph gates --full       # Lint + Format + Types + Tests

Integration

  • Invoked by /orchestrator in Step 6
  • Pre-step: tldr structure for language detection (v2.37)
  • Must pass before VERIFIED_DONE
  • Hooks: quality-gates.sh (PostToolUse)

TLDR Integration (v2.37)

PhaseTLDR CommandPurpose
Language detectiontldr structure .Identify languages
Error contexttldr context $FILE .Understand failing code
Impact analysistldr deps $FILE .Find related tests

Anti-Patterns

  • Never skip gates for "quick fixes"
  • Never ignore type errors
  • Never commit with lint warnings