基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/rudironsoni/Ghost --skill dotnet-slopwatch命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Rulesync CLI tool documentation - unified AI rule file management for various AI coding tools
Publishes .NET artifacts from Azure DevOps. NuGet push, containers to ACR, pipeline artifacts.
Configures artifacts output layout. UseArtifactsOutput, ArtifactsPath, impact on CI and Docker.
| name | dotnet-slopwatch |
| description | Runs Slopwatch CLI to detect LLM reward hacking -- disabled tests, suppressed warnings. |
| allowed-tools | ["Read","Grep","Glob","Bash","Write","Edit"] |
Slopwatch: LLM Anti-Cheat Quality Gate for .NET
Run the Slopwatch.Cmd dotnet tool as an automated quality gate after code modifications to detect "slop" -- shortcuts that make builds/tests pass without fixing real problems.
Slopwatch.Cmd NuGet package (v0.3.3+)Cross-references: [skill:dotnet-tool-management] for general dotnet tool installation mechanics.
Add to .config/dotnet-tools.json:
{
"version": 1,
"isRoot": true,
"tools": {
"slopwatch.cmd": {
"version": "0.3.3",
"commands": ["slopwatch"],
"rollForward": false
}
}
}
Then restore:
dotnet tool restore
dotnet tool install --global Slopwatch.Cmd
See [skill:dotnet-tool-management] for tool manifest conventions and restore patterns.
# Analyze current directory for slop
slopwatch analyze
# Analyze specific directory
slopwatch analyze -d ./src
# Strict mode -- fail on warnings too
slopwatch analyze --fail-on warning
# JSON output for tooling integration
slopwatch analyze --output json
# Show performance stats
slopwatch analyze --stats
For existing projects with pre-existing issues, create a baseline so slopwatch only catches new slop. The init command scans all files and records current findings as the accepted baseline:
slopwatch init
git add .slopwatch/baseline.json
git commit -m "Add slopwatch baseline"
Only update when slop is truly justified and documented:
slopwatch analyze --update-baseline
Valid reasons: third-party library forces a pattern, intentional rate-limiting delay (not test flakiness), generated code that cannot be modified. Always add a code comment explaining the justification.
Create .slopwatch/slopwatch.json to customize rules and exclusions:
{
"minSeverity": "warning",
"rules": {
"SW001": { "enabled": true, "severity": "error" },
"SW002": { "enabled": true, "severity": "warning" },
"SW003": { "enabled": true, "severity": "error" },
"SW004": { "enabled": true, "severity": "warning" },
Elevate all rules to errors during LLM coding sessions:
{
"minSeverity": "warning",
"rules": {
"SW001": { "enabled": true, "severity": "error" },
"SW002": { "enabled": true, "severity": "error" },
"SW003": { "enabled": true, "severity": "error" },
"SW004": { "enabled": true, "severity": "error" },
| Rule | Severity | What It Catches |
|---|---|---|
| SW001 | Error | Disabled tests (Skip=, Ignore, #if false) |
| SW002 | Warning | Warning suppression (#pragma warning disable, SuppressMessage) |
| SW003 | Error | Empty catch blocks that swallow exceptions |
| SW004 | Warning | Arbitrary delays in tests (Task.Delay, Thread.Sleep) |
| SW005 | Warning | Project file slop (NoWarn, TreatWarningsAsErrors=false) |
| SW006 | Warning | CPM bypass (VersionOverride, inline Version attributes) |
# Example output
❌ SW001 [Error]: Disabled test detected
File: tests/MyApp.Tests/OrderTests.cs:45
Pattern: [Fact(Skip="Test is flaky")]
Never disable tests to achieve a green build. Fix the underlying issue.
Add slopwatch as a PostToolUse hook to automatically validate every edit. Create or update .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "slopwatch analyze -d . --hook",
"timeout": 60000
}
]
}
]
}
}
The --hook flag:
This is the pattern used by projects like BrighterCommand/Brighter.
jobs:
slopwatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # any .NET 8+ SDK works
- name: Install Slopwatch
run: dotnet tool install --global Slopwatch.Cmd
- name: Run Slopwatch
run: slopwatch analyze -d . --fail-on warning
- task: DotNetCoreCLI@2
displayName: 'Install Slopwatch'
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install --global Slopwatch.Cmd'
- script: slopwatch analyze -d . --fail-on warning
displayName: 'Slopwatch Analysis'
--hook flag in Claude Code hooks, not bare analyze. The hook flag restricts analysis to dirty files for performance..config/dotnet-tools.json so the version is pinned and reproducible across team members.# First time setup
slopwatch init
git add .slopwatch/baseline.json
# After every code change
slopwatch analyze
# Strict mode (recommended)
slopwatch analyze --fail-on warning
# Hook mode (for Claude Code integration)
slopwatch analyze -d . --hook
# JSON output for tooling
slopwatch analyze --output json
# Update baseline (rare, document why)
slopwatch analyze --update-baseline