âïž scripts/ folder: shell automation
The subfolder scripts/ contains the executables the agent invokes via Bash. Each script is atomic: one responsibility, one clear output.
#!/bin/bash
# check-deps.sh â verifica dependĂȘncias antes de executar
# Uso: bash scripts/check-deps.sh
set -e
echo "Verificando dependĂȘncias..."
# Verifica ffmpeg
if ! command -v ffmpeg &>/dev/null; then
echo "â ffmpeg nĂŁo encontrado. Instale: brew install ffmpeg"
exit 1
fi
# Verifica .env
if [ ! -f .env ]; then
echo "â .env nĂŁo encontrado. Copie .env.example e preencha."
exit 1
fi
echo "â
Tudo pronto!"
â Well-written scripts
- âOne responsibility per file
- âVerb-noun name (check-deps, analyze-video)
- âShebang on the first line
- âClear output with â /â
- âset -e for fast failure
â Problematic scripts
- âMonolithic 500-line script
- âInline code in SKILL.md
- âAPI key hardcoded in the script
- âNo error handling
- âGeneric name (script.sh, run.sh)
đ reference.md files
References are the skillâs "detailed manuals" â they contain everything that would be too extensive for the main SKILL.md. The agent consults them on demand when it needs in-depth information.
What goes in references/
- âą Complete API specifications
- âą Parameter tables
- âą JSON response examples
- âą Error codes and handling
- âą Copywriting formulas
- âą Content analysis rules
- âą Routing logic
- âą Prompt templates
- âą Complete HTML templates
- âą Color and typography system
- âą Reusable components
- âą Review checklists
## ReferĂȘncias
Sempre leia estes arquivos antes de criar ou editar qualquer pĂĄgina:
1. **`references/MASTER_COMPLETO.md`**
Templates HTML completos, CSS e JavaScript obrigatĂłrios.
ContĂ©m tudo que vocĂȘ precisa para construir qualquer pĂĄgina.
2. **`references/CHECKLIST_REVISAO.md`**
Checklist para verificar a pĂĄgina antes de entregar.
3. **`references/SVG-FUTURISTA.md`**
Leia SEMPRE que for criar um mĂłdulo de conteĂșdo.
# O SKILL.md menciona, mas nĂŁo duplica. Detalhes ficam nas refs.
đĄ Golden rule: mention, donât duplicate
The SKILL.md should only point for referencesânever copy their contents. Duplication creates inconsistencies: when you update a reference, the SKILL.md becomes outdated without you realizing it.
đ .env.example: Keep Secrets Out of Code
The file .env.example is the industry standard for documenting environment variables without exposing real values.
# .env.example â copie para .env e preencha com valores reais
# NUNCA faça commit do arquivo .env
# Arcads API
ARCADS_API_KEY=sua_chave_arcads_aqui
ARCADS_BASE_URL=https://api.arcads.ai/v1
# ConfiguraçÔes opcionais
ARCADS_DEFAULT_MODEL=seedance-2.0
ARCADS_TIMEOUT_SECONDS=300
# DiretĂłrios de trabalho
WORK_DIR=./tmp/arcads
OUTPUT_DIR=./output
â ïž Hard security rule
An API key exposed in a public commit can cause losses in minutes. Follow these rules without exception:
- â ïžNEVER commit the file
.envreal - â ïžNEVER log environment variables in output or debug
- â ïžALWAYS add
.envto .gitignore - â ïžALWAYS use
$VARIAVELin the scripts, never as a literal value
Setup cycle for new users
Clone / install the skill
The .env.example is already in the folder. The user can see what needs to be configured.
cp .env.example .env
Copy the template. The real .env never goes into the repository.
Fills in the actual values
Edit the .env with the real API key. The check.sh script checks that itâs filled in before using the skill.
đœ Progressive Disclosure
Progressive disclosure is the principle of showing the essentials first and revealing details on demand. Applied to skills: a short SKILL.md + detailed references + specialized scripts.
The 3 levels of detail
đĄ Why progressive disclosure saves tokens
A 500-line SKILL.md costs 5-10x more in tokens than a 100-line one â and is read on EVERY activation. References with 500 lines only cost tokens when the agent needs them. Progressive disclosure makes the skill scalable.
đ§ Hard Rules: Rules That Never Break
Hard rules are absolute restrictions â the skill's immune system. They differ from guidelines (suggestions) because they are non-negotiable. Written in UPPERCASE to make confusion impossible.
## Hard Rules
# Estas regras sĂŁo inviolĂĄveis â nĂŁo hĂĄ exceção.
- **NUNCA** parafrasear o transcript do vĂdeo original.
Usar verbatim (texto exato) para preservar timing e autenticidade.
- **SEMPRE** rodar o dialogue gate antes de gerar.
Confirmar todos os inputs com o usuårio para evitar gasto de créditos.
- **NUNCA** logar a API key em qualquer output ou arquivo de log.
Usar $ARCADS_API_KEY; nunca imprimir ou expor o valor real.
- **SEMPRE** verificar .env antes de executar qualquer script.
Rodar scripts/check.sh como primeiro passo de toda geração.
â Effective hard rules
- â3â7 rules (more becomes noise)
- âEach with a short justification
- âVerb in uppercase (NEVER, ALWAYS)
- âTestable with an adversarial case
- âProtection against the costliest errors
â Problematic hard rules
- â20+ rules â nobody remembers them all
- âNo justification â the reason is unknown
- âRules for very rare situations
- âMixing hard rules with guidelines
- âNo dedicated section â lost in the body
đ Confirmation Gates
One gate is a checkpoint where the agent stops and asks for confirmation before taking a costly, irreversible, or high-impact action. The cost of confirming is zero; the cost of not confirming can be enormous.
## Fluxo de Geração
1. Coletar inputs (imagem/ĂĄudio/vĂdeo/ator)
2. Detectar modelo recomendado (ver prompting/model-routing.md)
### DIALOGUE GATE â executar antes de qualquer chamada Ă API
Apresentar ao usuĂĄrio:
```
đ Resumo da geração:
Modelo: Seedance 2.0 (lip sync)
Ator: [nome]
Script: "[primeiros 50 chars...]"
Custo estimado: ~8 créditos Arcads
Duração: ~15 segundos
Confirma? (S/N)
```
NUNCA prosseguir sem confirmação explĂcita "S" ou "sim".
3. Executar scripts/arcads_generate.sh apenas após confirmação.
đ When to use a gate
API calls billed by usage (video, image, tokens)
delete files, publish to production, send emails
change the database, modify system settings
đĄ Quality gate, not bureaucracy
Gates should be informative, not annoying. A good gate shows the estimated cost, summarizes what will be done, and offers a clear way out. A gate that says "do you confirm? (y/n)" without context is as bad as having no gateâthe user will confirm without understanding what theyâre confirming.
đ Module Summary
Next Module:
3.4 â Case study: ads-skill (Arcads) â dissect a real production skill that applies everything youâve learned