c2f-json-resources-sync
Skill5 starsChanged 2 months agoMITView on GitHub
LEIA ANTES de editar *Data.json ou rodar a compilação/sincronização de recursos. Se não ler: checksums inválidos impedem o deploy, recursos do banco não atualizam e alterações locais são sobrescritas.
Files
Sincronização de recursos JSON Conn2Flow
⚡ Gatilho Obrigatório
- TRIGGER: Editar manifests JSON de recursos (
pages.json,components.json,layouts.json,templates.json) ou executar o pipeline de compilação para*Data.json. - SKIP APENAS SE: Edição de código PHP de controladores sem alteração na estrutura de recursos.
- CONSEQUÊNCIA DE IGNORAR: Divergência entre arquivos físicos e os dados no banco SQL (
Data.json), falhas no cálculo de checksums e perda de alterações após deploy.
- Não calcule nem edite manualmente checksums de recursos.
- Em recurso novo, use a versão inicial exigida pelo manifesto, normalmente
1.0, e deixe checksums como string vazia. - Em recurso alterado, limpe os checksums afetados; não invente hashes nem faça bumps mecânicos fora do contrato do projeto.
- O pipeline de atualização/deploy executa
gestor/controladores/agents/arquitetura/atualizacao-dados-recursos.phpe recalcula versões/checksums. - Após testes que regeneram data files, confira
git statuse mantenha apenas artefatos que pertencem ao escopo aprovado.
Preservação de Barras Escapadas (\/) em JSON de Módulos
O PHP serializa JSON de módulos com escape de barra por padrão ("products\/add\/"). Ao manipular esses arquivos com ferramentas externas (Python, Node), o escape pode ser perdido, gerando ruídos massivos no Git diff.
Diretriz Normativa
Ao ler e reescrever arquivos JSON de módulos via Python:
import json
# Ler preservando encoding
with open(json_path, 'r', encoding='utf-8') as f:
original = f.read()
data = json.loads(original)
# Modificar dados...
data['nova_chave'] = 'valor'
# Reescrever PRESERVANDO escapes e line endings
output = json.dumps(data, indent=4, ensure_ascii=False)
# Restaurar escape de barra (PHP padrão)
if '\\/' in original:
output = output.replace('/', '\\/')
# Preservar line endings nativas (LF vs CRLF)
if '\\r\\n' in original:
output = output.replace('\\n', '\\r\\n')
with open(json_path, 'w', encoding='utf-8', newline='') as f:
f.write(output)| Requisito | Implementação |
| Escape de barra | output.replace('/', '\\/') quando o original contém \\/ |
| Encoding | ensure_ascii=False para preservar acentos e caracteres UTF-8 |
| Line endings | Detectar e manter LF ou CRLF nativo do arquivo original |
[!CAUTION] Sem a preservação do escape de barra, o
git diffaponta alterações artificiais em todas as linhas do arquivo que contêm caminhos com/, poluindo o histórico e dificultando revisões.
In 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-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-environment-configurationSkill
- 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.

