(afaiu) KSP doesn't help you write kotlin code (KotlinPoet usually does that), it helps "scanning" the code. KSP offers you a way to write a file (CodeGenerator.createNewFile) which accepts an extension. If the extension is "kt" (or "java" I suppose), then it will be handled as code and go in src/main/kotlin (see multiple round processing), if the extension is "json" for example, then it will go under src/main/resources and not be considered as code at all. I'm using it for non kt file, no problem so far, so given the API I understand it's totally ok to write those files from KSP.