agentleFS
otavioserraotavioserra/conn2flow-ai-workspace/.claude/skills/c2f-gd-image-safety/SKILL.md

c2f-gd-image-safety

Skill4 starsChanged 34 days agoMITView on GitHub

LEIA ANTES de manipular imagens com PHP GD (redimensionamento, conversão, thumbnails). Se não ler: o servidor entra em Fatal Error por falta de suporte a formatos (WebP/AVIF), esgota memória ou corrompe uploads.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Segurança de imagens GD

⚡ Gatilho Obrigatório

  • TRIGGER: Manipular upload, redimensionamento, recorte ou conversão de imagens usando a extensão GD do PHP.
  • SKIP APENAS SE: Upload de arquivos binários não-imagem (PDFs, vídeos, áudios) tratados como arquivos estáticos puros.
  • CONSEQUÊNCIA DE IGNORAR: Fatal Errors não capturados (\Throwable) em servidores sem suporte nativo a formatos específicos (WebP/AVIF) e corrupção de imagens de usuários.

  • Antes de processar um formato, confirme function_exists tanto para a função de leitura quanto para a de escrita.
  • Não presuma suporte WebP/AVIF a partir da presença da extensão GD; valide as funções específicas ou gd_info().
  • Capture \Throwable, não apenas \Exception: função GD ausente lança \Error e pode causar HTTP 500.
  • Se o servidor não puder gerar miniatura, degrade com segurança para o arquivo original quando o navegador suportá-lo.
  • Valide entrada, saída e destruição de recursos; nunca grave arquivo parcial sobre o original.
  • Teste explicitamente um runtime sem suporte ao formato opcional.

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.