본문으로 건너뛰기
cccskills
무료GitHub에 공개

makefile-validator

Validate, lint, audit, or check Makefiles and .mk files for errors.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(8)

  • SKILL.md7.0 KB
  • docs/bake-tool.md20.6 KB
  • docs/best-practices.md17.8 KB
  • docs/common-mistakes.md18.7 KB
  • examples/bad-makefile.mk1.6 KB
  • examples/good-makefile.mk2.6 KB
  • scripts/test_validate.sh16.3 KB
  • scripts/validate_makefile.sh27.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Makefile Validator

Overview

Use this skill to validate Makefiles with a local-first, deterministic flow.

Default validator entrypoint:

bash scripts/validate_makefile.sh <makefile-path>

Validation layers:

  1. Dependency preflight (python3, pip3, make)
  2. GNU make syntax check (make -n --dry-run) when make is available
  3. mbake validate
  4. mbake format --check
  5. Custom security, best-practice, and optimization checks
  6. Optional checkmake and unmake checks when installed

Trigger Guidance

Use this skill when the request includes Makefile quality, linting, validation, hardening, or troubleshooting.

Trigger Phrases

  • "Validate this Makefile"
  • "Lint my .mk file"
  • "Find issues in this build Makefile"
  • "Check Makefile security problems"
  • "Review this Makefile before CI"

Non-Trigger Examples

  • Creating a brand new Makefile from scratch (use makefile-generator)
  • Running build targets as part of delivery
  • General shell scripting work unrelated to Makefiles

Deterministic Execution Model

Run from this skill directory for shortest commands:

cd devops-skills-plugin/skills/makefile-validator

Step 1: Preflight

  1. Confirm target file exists and is readable.
  2. Confirm whether file edits are allowed (writable) or only suggestions can be returned (read-only).
  3. Prefer the default validator path first; use fallbacks only when blocked by environment constraints.

Step 2: Baseline Validation (Default Path)

# From skill directory
bash scripts/validate_makefile.sh <makefile-path>

# From repository root
bash devops-skills-plugin/skills/makefile-validator/scripts/validate_makefile.sh <makefile-path>

Always record:

  • command executed
  • exit code
  • summary counts (Errors, Warnings, Info)
  • issue locations reported by tools

Step 3: Interpret Output and Exit Code

Exit codeMeaningExpected summary lineAction
0no blocking findingsValidation PASSEDoptional improvements only
1warning-only resultValidation PASSED with warningsfix recommended; merge policy dependent
2error resultValidation FAILED - errors must be fixedfix required, then rerun

Step 4: Progressive Reference Loading

Open only the docs required by the current findings.

Finding typeReference doc
.PHONY, .DELETE_ON_ERROR, .ONESHELL, variable usage, performance structuredocs/best-practices.md
tabs vs spaces, dependency mistakes, credential patterns, anti-patternsdocs/common-mistakes.md
mbake behavior, formatter flags, known mbake caveatsdocs/bake-tool.md

Step 5: Fix + Rerun Loop

After applying fixes, rerun:

bash scripts/validate_makefile.sh <makefile-path>

Loop rules:

  1. Stop only when no new errors are introduced.
  2. If warnings remain intentionally, document why they are accepted.
  3. Always report the latest rerun exit code.

How to Open Docs

Use explicit file-open commands so paths are unambiguous.

From repository root:

sed -n '1,220p' devops-skills-plugin/skills/makefile-validator/docs/best-practices.md
sed -n '1,220p' devops-skills-plugin/skills/makefile-validator/docs/common-mistakes.md
sed -n '1,220p' devops-skills-plugin/skills/makefile-validator/docs/bake-tool.md
rg -n "PHONY|DELETE_ON_ERROR|ONESHELL|tab|credential|mbake" devops-skills-plugin/skills/makefile-validator/docs/*.md

From devops-skills-plugin/skills/makefile-validator:

sed -n '1,220p' docs/best-practices.md
sed -n '1,220p' docs/common-mistakes.md
sed -n '1,220p' docs/bake-tool.md
rg -n "PHONY|DELETE_ON_ERROR|ONESHELL|tab|credential|mbake" docs/*.md

If shell commands are unavailable, use the environment's file-open/read actions on the same paths.

Fallback Behavior

Use these only when the default validator path cannot run fully.

ConstraintFallback actionReporting requirement
python3 or pip3 unavailableRun limited checks (make -f <file> -n --dry-run if make exists, plus focused grep checks)State that mbake stages were skipped and coverage is reduced
pip3 install mbake fails (offline/proxy/index issue)Keep syntax/custom checks that still work; defer formatter/linter stagesReport install failure and request rerun in a network-enabled environment
make unavailableContinue with non-syntax stages; script already downgrades syntax stageExplicitly note syntax coverage was skipped
checkmake or unmake unavailableContinue; these are optional stagesNote optional lint/portability coverage not executed
target file is read-onlyProvide patch suggestions onlyMark response as advisory only
command execution unavailableProvide static review from file contents and docsMark result as non-executed analysis

Minimal fallback commands:

# Syntax only (when make exists)
make -f <makefile-path> -n --dry-run

# Focused quick checks
grep -n "^\\.DELETE_ON_ERROR:" <makefile-path>
grep -n "^\\.PHONY:" <makefile-path>
grep -nE "^(  |    |        )[a-zA-Z@\\$\\(]" <makefile-path>

Example Outcomes Mapped to Exit Codes

Clean Result (exit 0)

Errors:   0
Warnings: 0
Info:     2
✓ Validation PASSED

Warning-Only Result (exit 1)

Errors:   0
Warnings: 3
Info:     1
⚠ Validation PASSED with warnings

Error Result (exit 2)

Errors:   2
Warnings: 1
Info:     0
⚠ Validation FAILED - errors must be fixed

Troubleshooting Quick Start

  1. Verify required tools:
command -v python3 pip3 make
  1. Isolate GNU make syntax failures:
make -f <makefile-path> -n --dry-run
  1. Check likely tab-indentation violations:
grep -nE "^(  |    |        )[a-zA-Z@\\$\\(]" <makefile-path>
  1. Rerun validator with plain output and capture log:
NO_COLOR=1 bash scripts/validate_makefile.sh <makefile-path> > /tmp/makefile-validator.log 2>&1
echo "exit=$? log=/tmp/makefile-validator.log"
  1. If mbake install keeps failing, validate in a network-enabled shell or with an internal PyPI mirror, then rerun the full validator.

Skill Paths

makefile-validator/
├── SKILL.md
├── scripts/
│   └── validate_makefile.sh
├── docs/
│   ├── best-practices.md
│   ├── common-mistakes.md
│   └── bake-tool.md
└── examples/
    ├── good-makefile.mk
    └── bad-makefile.mk

Done Criteria

This skill update is complete when all are true:

  1. Trigger guidance is explicit and easy to identify.
  2. Execution flow is deterministic (preflight -> run -> interpret -> docs -> rerun).
  3. "How to open docs" instructions include exact commands and paths.
  4. Example outcomes are explicitly tied to exit codes (0, 1, 2).
  5. Fallback behavior is documented for missing tools and constrained environments.
  6. Troubleshooting quick-start is concise and runnable.
  7. Frontmatter name and description remain unchanged.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

Generate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

Validate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

Validate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

akin-ozer/cc-devops-skills3252026년 7월 27일 업데이트

akin-ozer의 스킬 모두 보기

이 스킬의 문제 신고