本文へ移動
cccskills
無料GitHub で公開

compilation

Validates compilation of generated Fakt fakes and diagnoses build failures — where fakes are generated, which path produced them, error classification, and root cause analysis. Use when compilation fails, generated code has errors, no fakes were generated, validating changes compile before committing, or checking if generated code is valid. Make sure to use this skill whenever a build error mentions generated fakes or the Fakt plugin — even if the root cause might be elsewhere, this skill's error classification pinpoints the actual source.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/faktスター 67(GitHub 67 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Compilation Validator & Error Analyzer

Validates that generated fakes compile and diagnoses failures when they don't.

Instructions

1. Publish the Plugin First

Samples consume the plugin from Maven Local, so a stale publish is the most common cause of "my change had no effect":

make publish-local

2. Build and Capture Output

Samples are separate Gradle builds, not subprojects of the root build:

./gradlew -p samples/jvm-single-module build 2>&1 | tee compilation.log
./gradlew -p samples/android-single-module build 2>&1 | tee -a compilation.log
./gradlew -p samples/kmp-single-module compileKotlinJvm --no-build-cache 2>&1 | tee -a compilation.log
./gradlew -p samples/kmp-multi-module build 2>&1 | tee -a compilation.log

make test-sample runs the KMP single-module sample end to end.

3. Know Which Path Generated the Fakes

  • Default (cache-correct): faktGenerate<Target><Compilation> tasks (FaktGenerateTask) run an embedded K2 compiler in a Gradle worker; FIR checkers emit the fakes (compiler/.../fir/generation/).
  • Legacy in-process: compilations the task can't drive (LEGACY), or any build with -Pfakt.useExperimentalGenerateTask=false. Generation runs inside compileKotlin* via UnifiedFaktIrGenerationExtension.

Routing lives in FaktGradleSubplugin.kt (CacheCorrectDecision). If a failure only reproduces on one path, compare with the other by toggling the property above.

4. Validate Generated Files

Generated sources land in each sample's own build directory:

find samples/<name>/build/generated/fakt -name "Fake*.kt"

Per @Fake type, expect FakeXxxImpl, the fakeXxx {} factory, and FakeXxxConfig.

If nothing was generated, check:

  1. The plugin is applied and fakt { enabled } isn't set to false
  2. The type is annotated with @Fake in a main source set (main/commonMain)
  3. The faktGenerate* task ran: ./gradlew -p samples/<name> tasks --all | grep faktGenerate
  4. Logs: set fakt { logLevel.set(LogLevel.DEBUG) }, or run make debug

5. Check Generated Code Against the Source

  • Parameter, return, nullable and generic types (class-level, method-level, bounded) match the source; all are supported, so a mismatch is a bug
  • suspend is preserved on overrides and behavior lambdas
  • Defaults follow codegen/strategy/: primitives 0/""/false, nullable null, collections empty*(), Flow → emptyFlow(), Result<T> → Result.success(default), Unit → Unit; any other type gets a behavior that throws "requires explicit configuration"
  • FakeXxxConfig holds behaviors as nullable internal vars; the fake is immutable after construction unless mutable fakes are enabled

6. Classify the Error

CategoryIndicatorsWhere to look
Plugin loadingCompilerPluginRegistrar / ServiceLoader errorsmake publish-local; compiler/src/main/resources/META-INF/services/
FIR emission (default)faktGenerate* task or worker failure, fake missingcompiler/.../fir/generation/ (FirFakeEmitter, FirToFakeDeclarationTranslator)
IR generation (legacy)IrGenerationExtension stack tracesir/generation/UnifiedFaktIrGenerationExtension.kt
FIR detection@Fake validation diagnosticsfir/FaktFirExtensionRegistrar.kt, fir/checkers/
Generated codeErrors in build/generated/fakt/...Read the file; fix the generator in codegen-runtime/
Imports / cross-moduleUnresolved reference in generated codecompiler/.../core/context/ImportResolver.kt; type must be visible to the test source set
Kotlin versionNoSuchMethodError / NoClassDefFoundError on compiler classesA compiler API missing in an older supported Kotlin — see kotlin-api-consultant

Before filing a limitation as a bug, check docs/user-guide/known-issues.md.

7. Report

COMPILATION VALIDATION REPORT

Path: {default FaktGenerateTask | legacy in-process}
Generation: {count} files generated
Compilation: {Success/Failed} ({error_count} errors)

ERRORS:
1. [{category}] {description} — File: {path}:{line} — Fix: {solution}

Related Skills

  • bdd-test-runner — Run tests after successful validation
  • kotlin-api-consultant — Compiler API differences across supported Kotlin versions
  • codegen — Fix the generator behind a bad generated file

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

Runs BDD-compliant GIVEN-WHEN-THEN tests, validates naming compliance, and analyzes coverage. Use when running tests, checking BDD compliance, validating test patterns, or verifying that test names follow GIVEN-WHEN-THEN conventions. Make sure to use this skill whenever tests need to be executed — it validates naming compliance and catches convention violations that plain test runners miss.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

codegen

無料

Documents the Fakt code generation pipeline — immutable AST model, builder DSL, renderer, default value strategies, and extension functions. Use when modifying code generation, changing generated output, adding new generated patterns, understanding builders or renderers, adding a new default value strategy, or debugging generated output. Make sure to use this skill whenever generated Kotlin code needs to change — the pipeline has strict conventions (immutable AST, builder DSL, renderer separation) that must be followed even for small changes.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

commit

無料

Creates project commits — Conventional Commits format, message quality (72 char subject, 80 char body), staged-change checks, and the AI co-author trailer. Use when committing changes, running /commit, creating commit messages, or reviewing commit message quality. Make sure to use this skill whenever a git commit is being created — it is the project's commit workflow and replaces the default one.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

Guides step-by-step through all 11 touchpoints for adding a new @Fake annotation option (like mutability or callHistory). Covers annotation enum, CLI processor, Gradle plugin, FIR metadata, FIR translator, the shared FakeDeclaration model, and code generators. Use when adding a new option to @Fake, adding a new enum to the annotation, making something configurable per-interface, implementing a new compiler plugin feature flag, adding a new Gradle extension property, or extending the three-tier resolution (annotation → plugin → default). Make sure to use this skill whenever a change touches more than one layer of the option pipeline, even for small additions like a new enum value.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

Creates well-structured GitHub issues using gh CLI with auto-detected project context (version, platform, module). Supports bug reports, feature requests, and internal tasks following repo templates. Use when creating a GitHub issue, reporting a bug, requesting a feature, logging a task, documenting a TODO as an issue, or recording a bug found during development. Make sure to use this skill whenever an issue needs to be created — it auto-detects project context and applies the correct template.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

Checks Kotlin compiler API usage against the Kotlin versions Fakt supports — which path runs on which compiler, how compat shims are written, how to verify across versions, and how to bump Kotlin. Use when calling a new FIR/IR/compiler-plugin API, seeing NoSuchMethodError, NoSuchFieldError or NoClassDefFoundError from compiler classes, bumping the Kotlin version, or checking whether an API exists in the minimum supported Kotlin. Make sure to use this skill whenever compiler plugin code starts using a Kotlin compiler API it didn't use before — these APIs change between Kotlin releases and a break only shows up on an older supported version.

日本語の概要は準備中です。原文の説明を表示しています。

rsicarelli/fakt672026年10月23日 更新

rsicarelli のスキルをすべて見る

このスキルの問題を報告する