agentleFS
rsicarellirsicarelli/fakt/.claude/skills/sample-scaffolder/SKILL.md

sample-scaffolder

Skill67 starsChanged 46 days agoApache-2.0View on GitHub

Scaffolds new Fakt sample projects with correct structure, build scripts, and CI integration. Supports JVM, KMP, Android, multi-module, test-fixtures, and fake-publishing types. Use when creating a new sample project, adding a demo for a new feature, setting up a new test project, or scaffolding a demonstration project. Make sure to use this skill whenever a new sample directory needs to be created — it handles build scripts, CI integration, and settings.gradle.kts registration that are easy to miss manually.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use AskUserQuestion to select type:

    line 15
  2. Distinctive:

    Ask for: sample name (kebab-case), purpose/feature being demonstrated.

    line 23
  3. Distinctive:

    All samples use this template (adjust relative paths for nesting depth):

    line 66
  4. Very specific:

    Android single-module: use fakt-sample-android convention plugin.

    line 167
  5. Very specific:

    JVM test-fixtures: add java-test-fixtures plugin, fakt { useGradleTestFixtures.set(true) }.

    line 169

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sample Project Scaffolder

Creates new sample projects under samples/ following confirmed patterns from existing samples.

Instructions

1. Determine Sample Type

Use AskUserQuestion to select type:

  • JVM single-module — simplest, src/main + src/test
  • KMP single-module — commonMain/commonTest, all targets
  • KMP multi-module — multiple submodules with -fakes collectors
  • Android single-module — Android library with Fakt
  • JVM test-fixtures — Gradle java-test-fixtures plugin
  • Fake publishing — publisher + consumer via Maven coordinates

Ask for: sample name (kebab-case), purpose/feature being demonstrated.

2. Create Directory Structure

JVM single-module:

samples/{name}/
├── build.gradle.kts
├── settings.gradle.kts
└── src/
    ├── main/kotlin/com/rsicarelli/fakt/samples/{camelName}/
    │   ├── models/
    │   └── scenarios/
    └── test/kotlin/com/rsicarelli/fakt/samples/{camelName}/

KMP single-module:

samples/{name}/
├── build.gradle.kts
├── settings.gradle.kts
└── src/
    ├── commonMain/kotlin/com/rsicarelli/fakt/samples/{camelName}/
    │   ├── models/
    │   └── scenarios/
    └── commonTest/kotlin/com/rsicarelli/fakt/samples/{camelName}/

KMP multi-module:

samples/{name}/
├── build.gradle.kts          (root: apply plugins false)
├── settings.gradle.kts       (include submodules)
├── core/{module}/
│   ├── build.gradle.kts
│   └── src/commonMain/...
└── core/{module}-fakes/
    ├── build.gradle.kts      (collectFakesFrom)
    └── src/commonMain/...

3. Generate settings.gradle.kts

All samples use this template (adjust relative paths for nesting depth):

rootProject.name = "{name}"

pluginManagement {
    includeBuild("../../build-logic")
    repositories {
        mavenLocal()
        gradlePluginPortal()
        mavenCentral()
        google()
        maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
    }
}

dependencyResolutionManagement {
    @Suppress("UnstableApiUsage")
    repositories {
        mavenLocal()
        mavenCentral()
        google()
        maven {
            name = "Central Portal Snapshots"
            url = uri("https://central.sonatype.com/repository/maven-snapshots/")
        }
    }
    versionCatalogs {
        create("libs") {
            from(files("../../gradle/libs.versions.toml"))
        }
    }
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Rules:

  • mavenLocal() FIRST in both repository blocks
  • includeBuild points to build-logic (adjust depth: ../../ for top-level, ../../../ for nested)
  • Version catalog always references shared libs.versions.toml

Note: JVM samples may use a simpler repository setup without Central Portal Snapshots. Always check an existing sample of the same type for the exact template. rootProject.name placement (top vs bottom) and @Suppress("UnstableApiUsage") usage also vary between samples.

4. Generate build.gradle.kts

JVM single-module:

import com.rsicarelli.fakt.compiler.api.LogLevel

plugins {
    id("fakt-sample-jvm")
    alias(libs.plugins.fakt)
}

dependencies {
    implementation(libs.fakt.annotations)
    testImplementation(kotlin("test"))
    testImplementation(libs.coroutines.test)
}

fakt {
    logLevel.set(LogLevel.DEBUG)
}

KMP single-module:

import com.rsicarelli.fakt.compiler.api.LogLevel

plugins {
    id("fakt-sample-kmp")
    alias(libs.plugins.fakt)
}

kotlin {
    sourceSets {
        commonMain {
            dependencies {
                implementation(libs.fakt.annotations)
            }
        }
        commonTest {
            dependencies {
                implementation(kotlin("test"))
                implementation(libs.coroutines.test)
            }
        }
        jvmTest {
            dependencies {
                implementation(kotlin("test-junit5"))
            }
        }
    }
}

fakt {
    logLevel.set(LogLevel.DEBUG)
}

Android single-module: use fakt-sample-android convention plugin.

JVM test-fixtures: add java-test-fixtures plugin, fakt { useGradleTestFixtures.set(true) }.

KMP multi-module root: apply plugins false, submodules apply independently.

Collector module (multi-module -fakes):

plugins {
    id("fakt-sample-kmp")
    id("com.rsicarelli.fakt")
}

kotlin {
    sourceSets {
        commonMain {
            dependencies {
                api(projects.core.{module})
                implementation(libs.coroutines)
            }
        }
    }
}

fakt {
    logLevel.set(com.rsicarelli.fakt.compiler.api.LogLevel.DEBUG)
    @OptIn(com.rsicarelli.fakt.gradle.ExperimentalFaktMultiModule::class)
    collectFakesFrom(projects.core.{module})
}

5. Create Example Interface

// Copyright (C) 2025 Rodrigo Sicarelli
// SPDX-License-Identifier: Apache-2.0
package com.rsicarelli.fakt.samples.{camelName}.scenarios

import com.rsicarelli.fakt.Fake

@Fake
interface {ExampleInterface} {
    fun getData(): String
    suspend fun fetchItems(): List<String>
}

6. Add to CI

Edit .github/actions/test-samples/action.yml:

JVM/Android samples — add build step:

- name: "Test {name} sample"
  run: ./gradlew -p samples/{name} build

KMP samples — add allTests + check:

- name: "Test {name} sample"
  run: ./gradlew -p samples/{name} allTests --continue

- name: "Check {name} sample"
  run: ./gradlew -p samples/{name} check

7. Verify

make publish-local
./gradlew -p samples/{name} build  # or allTests for KMP

Convention plugins available: fakt-sample-jvm, fakt-sample-kmp, fakt-sample-android.

Related Skills

  • compilation — diagnose build failures in new samples
  • feature-option — new features often need a sample to demonstrate

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.