c2f-environment-configuration
Skill5 starsChanged 2 months agoMITView on GitHub
LEIA ANTES de adicionar ou manipular credenciais, variáveis de ambiente (.env) e configurações centrais em config.php. Se não ler: segredos vazam no repositório git público, variáveis não propagam para produção ou geram erros fatais.
- Reads credentials
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 68
Remove comentários HTML (<!-- ...
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Configuração de Ambiente e Variáveis Sensíveis do Conn2Flow
⚡ Gatilho Obrigatório
- TRIGGER: Declarar, ler ou alterar variáveis de ambiente (
$_ENV), constantes emgestor/config.phpou templates emautenticacoes.exemplo/. - SKIP APENAS SE: Valores de apresentação/UI que devem residir obrigatoriamente no sistema de variáveis (
variables.json). - CONSEQUÊNCIA DE IGNORAR: Vazamento de credenciais privadas em repositórios públicos, erros fatais de configuração indefinida em produção ou mistura indevida de dados de apresentação no
.env.
[!CAUTION] PROTOCOLO OBRIGATÓRIO PARA CREDENCIAIS E SEGREDOS: NUNCA insira credenciais, API keys, tokens ou senhas diretamente no código-fonte PHP! Todo dado sensível DEVE seguir o fluxo:
.env->config.php->$_CONFIGou$_GESTOR.
1. Fluxo Obrigatório para Novas Variáveis Sensíveis
Passo 1: Registrar no Template .env
Arquivo: gestor/autenticacoes.exemplo/dominio/.env
# === Minha Nova Integração ===
MINHA_API_KEY=
MINHA_API_SECRET=
MINHA_WEBHOOK_URL=[!IMPORTANT] O arquivo
autenticacoes.exemplo/é o template de referência versionado no Git. A instalação real fica emgestor/autenticacoes/<dominio>/.env(que é gitignored). Ao registrar no template, você garante que novos deploys e desenvolvedores saibam quais variáveis configurar.
Passo 2: Mapear em gestor/config.php
// Em gestor/config.php, dentro do bloco de carregamento de configurações:
$_CONFIG['minha_api_key'] = $_ENV['MINHA_API_KEY'] ?? '';
$_CONFIG['minha_api_secret'] = $_ENV['MINHA_API_SECRET'] ?? '';
$_CONFIG['minha_webhook_url'] = $_ENV['MINHA_WEBHOOK_URL'] ?? '';Passo 3: Consumir no Código
// Em qualquer módulo PHP:
$apiKey = $_CONFIG['minha_api_key'];
$secret = $_CONFIG['minha_api_secret'];
// Verificação antes de uso:
if (empty($_CONFIG['minha_api_key'])) {
// Log de erro ou fallback seguro
}2. Governança da Variável HTML_SANITIZE
O Conn2Flow utiliza a flag HTML_SANITIZE no .env para controlar a minificação e limpeza do HTML entregue:
# Habilita a higienização e minificação de HTML para visitantes públicos (padrão: true)
HTML_SANITIZE=trueHTML_SANITIZE=true(Padrão em Produção):- Remove comentários HTML (
<!-- ... -->), CSS (/* ... */) e JS (// ...), compactando espaços em branco para visitantes anônimos. - Bypass Automático: Usuários autenticados no Gestor ou com Live Editor ativo (
gestor_dashboard_toolbar_ativo() === true) têm a sanitização 100% desligada para preservar marcadores de widgets (<!-- widgets#... -->) e notas de layout.
- Remove comentários HTML (
HTML_SANITIZE=false(Debug Global):- Desativa a sanitização incondicionalmente para todos os visitantes durante depurações profundas de layout.
3. Categorias de Configuração em $_CONFIG
| Categoria | Exemplos de Chaves | Origem |
| Banco de Dados | Via $_BANCO['host'], $_BANCO['nome'] | .env |
| Sessões/Cookies | session_lifetime, cookie_secure, cookie_httponly | .env / hardcoded |
| Segurança CSP/CORS | csp_policy, cors_origins | config.php |
| Performance HTML | html_sanitize | .env |
| OAuth | oauth_google_client_id, oauth_google_secret | .env |
| Email/SMTP | smtp_host, smtp_port, smtp_user, smtp_pass | .env |
| Pagamentos | paypal_client_id, stripe_key | .env |
| APIs Externas | openai_api_key, anthropic_api_key | .env |
4. Estrutura de Diretórios
gestor/
autenticacoes.exemplo/ <-- Template (versionado no Git)
dominio/
.env <-- Exemplo com todas as chaves documentadas
autenticacoes/ <-- Instalação real (GITIGNORED)
meusite.com/
.env <-- Valores reais e secretos
config.php <-- Bootstrap: carrega .env e popula $_CONFIG, $_BANCO, $_GESTORIn this repository102 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/sdd.mdcCursor rule
- c2f-database-testingSkill
- c2f-gd-image-safetySkill
- c2f-json-resources-syncSkill
- c2f-mdd-indexing-and-handoffsSkill
- c2f-mysql-utf8-emoji-encodingSkill
- c2f-tailwind-css-architectureSkill
- c2f-tailwind-module-migrationSkill
- c2f-widget-developmentSkill
- c2f-agent-visual-inspectionSkill
- c2f-ai-featuresSkill
- c2f-architect-masterSkill
- c2f-database-operationsSkill
- c2f-database-testingSkill
- c2f-dev-scriptsSkill
- c2f-docker-environmentSkill
- c2f-documentation-governanceSkill
- c2f-documentationSkill
- c2f-executor-agentSkill
- c2f-gd-image-safetySkill
- c2f-gestor-functionsSkill
- c2f-global-variablesSkill
- c2f-hooks-systemSkill
- c2f-html-css-pages-and-componentsSkill
- c2f-interface-v2-architectureSkill
- c2f-javascript-ajaxSkill
- c2f-json-resources-syncSkill
- c2f-mdd-indexing-and-handoffsSkill
- c2f-modelo-templatesSkill
- c2f-module-crud-scaffoldingSkill
- c2f-module-visual-assetsSkill
- c2f-multilingual-systemSkill
- c2f-mysql-utf8-emoji-encodingSkill
- c2f-payment-gatewaysSkill
- c2f-plugin-architectureSkill
- c2f-preview-modals-systemSkill
- c2f-project-pipeline-and-tasksSkill
- c2f-projects-systemSkill
- c2f-resources-systemSkill
- c2f-reviewer-agentSkill
- c2f-shell-and-windows-trapsSkill
- c2f-system-tasksSkill
- c2f-tailwind-css-architectureSkill
- c2f-tailwind-module-migrationSkill
- c2f-variables-systemSkill
- c2f-widget-developmentSkill
- continue-mdd-batchSkill
- mdd-memory-gardeningSkill
- mdd-workflowSkill
- project-validationSkill
- raise-spec-changeSkill
- review-current-batchSkill
- start-mdd-sliceSkill
- c2f-agent-visual-inspectionSkill
- c2f-ai-featuresSkill
- c2f-architect-masterSkill
- The first 60 shown.
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
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.

