agentleFS
gerard-labsgerard-labs/superpowers-api-platform/skills/makefile-discipline/SKILL.md

makefile-discipline

Skill2 starsChanged 6 months agoMITView on GitHub

Edit Make-driven Symfony projects without breaking their boilerplate contract. Covers the `Makefile` (framework, regenerated by the boilerplate — read-only) vs `Makefile-solution` (project-owned, where you add targets) split used by Smile-style and many agency boilerplates, the `$(MAKEFILE_LIST)` aggregation pattern that powers `make help` across multiple files, target naming conventions (`##@ Group` for sections, `## helptext` per target), passing extra args via `MAKECMDGOALS` / `wordlist`, idiomatic Docker wrappers (`$(call run_in_php_project,...)`), and the anti-patterns that get a target wiped at the next boilerplate bump. Trigger when adding/editing make targets, when `make help` shows targets you didn't expect, when a custom target disappears after a boilerplate update, or when the project uses `make console`/`make tests` as its canonical commands.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If boilerplate_recipe.yml exists at the root → it's a boilerplate.

    line 23
  2. Very specific:

    If Makefile includes Makefile-solution → same split.

    line 24
  3. Very specific:

    If only Makefile exists → it's both.

    line 25
  4. Very specific:

    Add new targets to Makefile-solution (when present) or to a thematic section of Makefile.

    line 27
  5. Very specific:

    Run make help after the change — your target must appear with the right group + helptext.

    line 28
  6. Very specific:

    Run make -n <target> to dry-run before committing.

    line 29
  7. Very specific:

    Never edit the framework Makefile: when Makefile-solution exists — the boilerplate regenerates it.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Makefile Discipline (Symfony)

Use when

  • The project's CLAUDE.md says "all commands via Make" (and the session hook confirmed runner_type = make).
  • Adding a new target (test scenario, deploy step, scaffold helper, etc.).
  • Renaming or removing an existing target.
  • make help shows weird/duplicate targets and you need to know which file owns them.
  • A custom target was lost after a boilerplate update.

Default workflow

  1. Inspect the orchestration root for Makefile and Makefile-solution.
  2. Determine which file is the framework (read-only) and which is solution (editable). Heuristic:
    • If boilerplate_recipe.yml exists at the root → it's a boilerplate; Makefile is framework, Makefile-solution is solution.
    • If Makefile includes Makefile-solution → same split.
    • If only Makefile exists → it's both. Edit freely but follow conventions.
  3. Walk $(MAKEFILE_LIST) (read the includes — typically docker/<service>/Makefile) to see all aggregated sources.
  4. Add new targets to Makefile-solution (when present) or to a thematic section of Makefile. Always with ##@ Group headers and ## helptext per target.
  5. Run make help after the change — your target must appear with the right group + helptext.
  6. Run make -n <target> to dry-run before committing.

Guardrails

  • Never edit the framework Makefile when Makefile-solution exists — the boilerplate regenerates it.
  • Never use cd <dir> && cmd as a target body — use the project's idiomatic Docker wrapper ($(call run_in_php_project,...) or $(php) <cmd> or make console <cmd> recursively).
  • Never hardcode service names (docker compose exec php ...) — read them from conf/.env.* variables that the Makefile already exports.
  • Targets that mutate state (migrations, fixtures, prod ops) must be idempotent and never assume a fresh container.

Progressive disclosure

  • This file = editing posture + checklist.
  • reference.md = full pattern catalog (help-target awk script, MAKECMDGOALS parsing, wildcard $(ENV_DIR).env* env injection, COMPOSE_FILE aggregation, worktree-aware COMPOSE_PROJECT_NAME, $(call run_in_php_project,$1) idiom, anti-patterns).

Output contract

  • New/modified target in the right file (solution if split, otherwise the main Makefile).
  • make help reflects the change with the right group + helptext.
  • make -n <target> shows a sensible plan; make <target> runs green.
  • The change does not edit the framework Makefile when a solution file exists.

References

  • reference.md
  • gerard:runner-selection — sister skill (which file/runner to call)
  • hooks/session-start.sh — surfaces makefile.primary, makefile.solution_file, makefile.targets, makefile.is_boilerplate_smile

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.