Custom plugin problem

Hello everybody! I ran into a problem. I am developing a gradle plugin in Kotlin. There are several extensions in my plugin. The project is built on a composite build so I can immediately test my plugin, composite build example (GitHub - cortinico/kotlin-gradle-plugin-template: ๐Ÿ˜ A template to let you started with custom Gradle Plugins + Kotlin in a few seconds). My extensions work fine, but when I publish and add a dependency to another project, those extensions become unavailable, although new tasks appear. What could be the reason?

// Plugin
open class CorePlugin : Plugin<Project> {
    override fun apply(target: Project) {
        val buildConfigs = target.extensions.create<BuildConfig>("buildConfigs")
        // tasks creation
// Extension
open class BuildConfig {
    private val params: MutableMap<String, Any> = mutableMapOf()

    fun putString(fieldName: String, value: String) {
        params[fieldName] = value
// Extension usage in build.gradle (unresolved after publication)
buildConfigs {
    putString("Tara", "+529943241241")
    putString("Max", "+529943241241")
    putString("Sasha", "+529943241241")

Also after publishing I canโ€™t add plugin dependency via block plugin { ... }, only use apply(plugin = "...")

The last sentence is the key actually.
Type-safe accessors are only generated for plugins that you apply using the plugins { ... } block, not using the legacy apply mechanism.
If you apply using the legacy mechanism, you need to use the more verbose syntax and configure by type instead of using the buildConfigs accessor.

If the plugins { ... } block is not working, you are probably just publishing the code artifact, but not the marker artifact, but that is just a wild guess unless you provide the build script / release process.