本文へ移動
cccskills
無料GitHub で公開

lint-fix

Detect project linting and validation tools, build an execution pipeline, run all tools to zero errors, and fix issues using an atomic fix protocol. Auto-detects Makefile targets, package.json scripts, Go tools, Python tools, and other common linters. Use when fixing linting errors, running validation pipelines, or ensuring code quality before committing.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md5.2 KB
  • references/fix-protocol.md2.2 KB
  • references/tool-detection.md3.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<!-- Copyright 2025-2026 Richard Shade. Licensed under Apache-2.0. --> <!-- SPDX-License-Identifier: Apache-2.0 -->

Lint and Validation Pipeline

Detect all linting, formatting, and validation tools in the project, build an ordered execution pipeline, run everything to zero errors, and fix issues atomically.

Step 1: Detect project tools

Scan the project root for configuration files, Makefile targets, and package manager scripts to identify available tools.

Check in order:

  1. Makefile — discover targets: lint, test, validate, format, gen, build, check, vet
  2. package.json — discover scripts: lint, test, format, prettier, eslint, build, typecheck
  3. go.mod — check for golangci-lint, gofmt, go vet, go test
  4. pyproject.toml / setup.py — check for ruff, black, flake8, mypy, pytest
  5. .csproj / .sln — check for dotnet format, build, test
  6. Cargo.toml — check for cargo clippy, fmt, test
  7. Standalone configs — .eslintrc*, .prettierrc*, biome.json, .golangci.yml, .markdownlint*

For detailed detection commands per ecosystem, see references/tool-detection.md.

If no tools are detected, report to the user and offer to help set up linting. Do not proceed with an empty pipeline.

Step 2: Check for code generation

If make gen, make generate, or an equivalent code generation command is detected, run it before any linting.

Generated code can overwrite manual fixes. Always generate first.

make gen 2>&1

If generation fails, stop and fix the generation issue before proceeding to linting.

Step 3: Build ordered pipeline

Arrange detected tools in execution order:

  1. Generation (make gen, code generators)
  2. Formatting (prettier, black, gofmt, rustfmt, dotnet format)
  3. Linting (eslint, golangci-lint, ruff, clippy, markdownlint)
  4. Type checking (tsc --noEmit, mypy)
  5. Validation (make validate, schema checks)
  6. Testing (go test, pytest, jest, cargo test, dotnet test)
  7. Building (go build, cargo build, dotnet build)

Present the detected pipeline to the user before executing:

Detected validation pipeline:
  1. make gen
  2. gofmt -s -l .
  3. golangci-lint run
  4. markdownlint '**/*.md'
  5. go test ./...
  6. go build ./...

Proceed? (y/n)

If the user wants to add, remove, or reorder commands, adjust the pipeline accordingly.

Step 4: Execute pipeline

Run each command in order. Stop at the first failure.

# Run each command, stop on failure
for cmd in "${PIPELINE[@]}"; do
    echo "Running: $cmd"
    eval "$cmd" 2>&1
    if [ $? -ne 0 ]; then
        echo "FAILED: $cmd"
        # Proceed to atomic fix protocol for this command
        break
    fi
    echo "PASSED: $cmd"
done

Capture the full output of the failing command — file paths, line numbers, rule names, and error messages are needed for fixing.

Step 5: Atomic fix protocol

Fix issues from the failing command one at a time. This prevents cascade failures where fixing one issue introduces others.

For each issue:

  1. Fix exactly ONE issue (minimal change)
  2. Re-run the failing command immediately
  3. Verify: the issue is resolved AND no new issues appeared
  4. If fix created new issues: revert and try a different approach
  5. If fix is clean: move to the next issue

After all issues for the failing command are resolved, continue the pipeline from the next command.

For detailed protocol, rollback strategies, and edge cases, see references/fix-protocol.md.

Step 6: Final verification

After all commands pass individually, run the full pipeline end-to-end as a single sequence:

cmd1 && cmd2 && cmd3 && ... && echo "PASS" || echo "FAIL"

All commands must pass in sequence. If any command fails in the final run, return to Step 5 for that command.

Present the final result:

Validation pipeline: ALL PASSED

  1. make gen           PASS
  2. gofmt -s -l .      PASS
  3. golangci-lint run   PASS
  4. markdownlint        PASS
  5. go test ./...       PASS
  6. go build ./...      PASS

Zero errors across all validation tools.

Common fix patterns

Formatting issues: run the formatter with --write or -w flag instead of --check. Most formatters have an auto-fix mode.

Import ordering: most linters have auto-fix for import sorting. Check for --fix flags.

Trailing whitespace / EOF newlines: fix with editor settings or sed -i 's/[[:space:]]*$//' file.

Type errors: these usually require code changes, not auto-fix. Read the error carefully and fix the root cause.

Test failures: investigate the failure — is it a real bug introduced by your changes, or a pre-existing flaky test?

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Prepares Go applications to work effectively with AI coding agents. Use when setting up a new Go project or retrofitting an existing one to ensure: structured JSON logging (slog/Zap/ZeroLog/Logrus), machine-readable command output, thorough golangci-lint configuration, non-interactive CLI design with --yes flags, structured error handling with meaningful exit codes, proper context.Context propagation, graceful shutdown, health check endpoints, and a standardized Makefile. Triggers when a user asks to make their Go app "agent-ready," "AI-friendly," wants to improve agent tooling/observability in a Go project, or needs to audit an existing Go project against agent-readiness best practices.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

Use when creating or updating AGENTS.md files, .github/copilot-instructions.md, or other AI agent rule files, onboarding AI agents to a project, standardizing agent documentation, or when anyone mentions AGENTS.md, agent rules, project onboarding, or codebase documentation for AI agents.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

Use when designing new high-level system architecture, reviewing existing designs, or making architectural decisions. Invoke to create architecture diagrams, write Architecture Decision Records (ADRs), evaluate technology trade-offs, design component interactions, and plan for scalability. Use for system design, architecture review, microservices structuring, ADR authoring, scalability planning, and infrastructure pattern selection — distinct from code-level design patterns or database-only design tasks.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

Use when building CLI tools, implementing argument parsing, or adding interactive prompts. Invoke for parsing flags and subcommands, displaying progress bars and spinners, generating bash/zsh/fish completion scripts, CLI design, shell completions, and cross-platform terminal applications using commander, click, typer, or cobra.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

Convert an AWS CloudFormation stack or template to Pulumi. This skill MUST be loaded whenever a user requests migration or conversion of CloudFormation to Pulumi.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then produces a structured review report with prioritized, actionable feedback. Use when reviewing pull requests, conducting code quality audits, identifying refactoring opportunities, or checking for security issues. Invoke for PR reviews, code quality checks, refactoring suggestions, review code, code quality. Complements specialized skills (security-reviewer, test-master) by providing broad-scope review across correctness, performance, maintainability, and test coverage in a single pass.

日本語の概要は準備中です。原文の説明を表示しています。

dirien/yet-another-agent-harness202026年5月31日 更新

dirien のスキルをすべて見る

このスキルの問題を報告する