safeWriteFileSync = (filePath, content) => {
  try {
    fs.writeFileSync(filePath, content, { encoding: 'utf8' });
  } catch (error) {
    console.error(`Error writing file ${filePath}:`, error);
  }
}
Safe write file implementation to handle errors
@param {string} filePath - Path to write file
@param {string} content - Content to write