writing-diva-files

Writes and patches Divalto text files with ISO-8859-1 encoding and CRLF line endings.

6|Updated May 11, 2026
One-click install
npx skills add https://github.com/divalto/divalto-ia-devkit --skill writing-diva-files-divalto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-diva-files
Source: https://github.com/divalto/divalto-ia-devkit/tree/main/plugins/divalto-devkit/skills/writing-diva-files
Command: npx skills add https://github.com/divalto/divalto-ia-devkit --skill writing-diva-files-divalto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Divalto text files (.dhsp, .dhsq, .dhsd, .dhsf, .dhpt, .dhps) must use ISO-8859-1 encoding with CRLF line endings, but standard editors and AI coding tools write UTF-8 with LF, corrupting files and causing compilation errors like Erreur 135. This Skill provides scripts that create, patch, verify, and repair Divalto files while guaranteeing the correct encoding. ## Core Features & Use Cases - Safe file creation and rewriting: write_file.py creates files in ISO-8859-1 + CRLF with automatic .bak backups and a guaranteed final CRLF. - Surgical patching: patch_file.py inserts, replaces, or deletes lines by anchor or line range without rewriting the whole file, with --expect guards, --dry-run previews, and automatic refusal of structured files (.dhsd, .dhsf, .dhsi). - Verification and repair: verify_encoding.py detects UTF-8, LF, BOM, and missing final CRLF; convert_file.py fixes corrupted files with backup and post-conversion verification. - Use Case: A developer needs to insert a line after "Procedure Init" in an existing .dhsp file. The Skill patches only that location, preserves all other content, backs up the original, and re-verifies encoding automatically. ## Quick Start Ask the AI to create a Divalto .dhsp file containing a simple procedure with French comments, then verify its encoding.

Frequently Asked Questions about writing-diva-files

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Divalto .dhsp file with correct encoding?

Use write_file.py with --path and --content (or --stdin for long content). It writes the file in ISO-8859-1 with CRLF line endings and a guaranteed final CRLF, then verify the result with verify_encoding.py.

How do I modify a Divalto file without rewriting it entirely?

Use patch_file.py with operations like insert, replace, or delete, targeting lines by --anchor or --line-range. It preserves the rest of the file, creates a .bak backup, supports --dry-run previews, and re-verifies encoding after writing.

Why do Divalto files get corrupted when edited with standard tools?

Standard editors and AI Edit/Write tools save files as UTF-8 with LF line endings, while Divalto requires ISO-8859-1 with CRLF. PowerShell pipes can also add a BOM, and a missing final CRLF causes Erreur 135 at compilation.

Can patch_file.py edit .dhsd or .dhsf dictionary files?

No, patch_file.py refuses structured files (.dhsd, .dhsf, .dhsi) because their positions and offsets make line-by-line editing risky. Use the dedicated skills managing-diva-dictionaries or manipulating-dhsf-screens, or override with --force-structured.

How do I fix a Divalto file that was saved as UTF-8?

Run convert_file.py on the file. It detects the current encoding and line endings, converts to ISO-8859-1 with CRLF, removes any BOM, adds the final CRLF, creates a .bak backup, and verifies the result.