generate method
Generates the agent directory if needed and writes the content rule file.
Implementation
Future<void> generate(String content) async {
final dir = Directory(targetDirectory);
if (!await dir.exists()) {
await dir.create(recursive: true);
}
await writeFile(content);
}