ksp
AGENTS.md3.5k starsChanged 9 days agoApache-2.0View on GitHub
Welcome! This file defines the mandatory workflow, engineering methodology, and project context for AI coding agents working in the Kotlin Symbol Processing (KSP) repository. You are working on a compiler plugin and symbol processing engine. There must be zero speculation, hand-waving, or hallucination. where `<CURREN
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about google/ksp
- google/dagger“Feature request: Support KSP”GitHub · Feb 1, 2021 · 841 reactions
- mapstruct/mapstruct“Feature request: Support KSP”GitHub · Jul 20, 2021 · 141 reactions
- spring-projects/spring-boot“Allow ConfigurationProcessor to work with Kotlin Symbol Processor”GitHub · Sep 17, 2021 · 62 reactions
- gradle/gradle“Consider introducing "generated folder" APIs?”GitHub · Jan 15, 2025 · 21 reactions
- bumptech/glide“Build fails when OkHttp3 Integration Library is used with KSP2”GitHub · Apr 12, 2025 · 14 reactions
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub (50 times).
On GitHub · 50
- Feb 1, 2021Feature request: Support KSP — google/dagger841 reactions · 79 comments
- Jul 20, 2021Feature request: Support KSP — mapstruct/mapstruct141 reactions · 48 comments
- Sep 17, 2021Allow ConfigurationProcessor to work with Kotlin Symbol Processor — spring-projects/spring-boot62 reactions · 18 comments
- Jan 15, 2025Consider introducing "generated folder" APIs? — gradle/gradle21 reactions · 4 comments
- Apr 12, 2025Build fails when OkHttp3 Integration Library is used with KSP2 — bumptech/glide14 reactions · 1 comment
45 more on GitHub
- May 7, 2024[KSP2] Dagger and Hilt incompatibility with KSP2 — google/dagger14 reactions · 4 comments
- Oct 20, 2021KSP support — airbnb/epoxy13 reactions · 5 comments
- Oct 16, 2025Modules discovery doesn't work for KSP later than 2.1.20-1.0.32 in multi-module KMP project — InsertKoinIO/koin-annotations12 reactions · 10 comments
- Jul 16, 2024KSP Blockers Tracking — ZacSweers/anvil12 reactions · 1 comment
- Nov 5, 2025KSP2 is breaking Koin Annotations KMP app scanning — InsertKoinIO/koin-annotations11 reactions · 4 comments
- Feb 8, 2022[Request Feature] Support for Kotlin Symbol Processing — johncarl81/parceler10 reactions
- May 14, 2025Showkase don't work with KSP2 and Room 2.7 — airbnb/Showkase9 reactions · 2 comments
- Feb 2, 2023Introduce a KSP-based annotation processor for Kotlin projects — PaperMC/Velocity9 reactions
- Mar 18, 2025[FR]: Make nowinandroid Gradle Isolated Projects compatible — android/nowinandroid8 reactions · 7 comments
- Nov 16, 2023Kotlin 2.0.0 — android/nowinandroid6 reactions · 7 comments
- Sep 10, 2021Upstream KSP implementation — square/moshi6 reactions · 3 comments
- May 16, 2024[Feature] Support Kotlin 2 — mockative/mockative5 reactions · 10 comments
- Aug 21, 2021Add multiplatform support via ksp — livefront/sealed-enum5 reactions · 4 comments
- Feb 22, 2021Support KSP — airbnb/DeepLinkDispatch4 reactions · 1 comment
- Jan 15, 2026"lintKotlin" task no longer registered with AGP 9 and built-in Kotlin — jeremymailen/kotlinter-gradle3 reactions · 7 comments
- May 19, 2025Migrate Anvil away from AGP's legacy variant API — square/anvil3 reactions
- Sep 4, 2021Multiplatform support — livefront/sealed-enum3 reactions · 1 comment
- Jun 23, 2026[KSP] Retrofit triggers all target Metadata compilation tasks/damages build cacheability — Foso/Ktorfit2 reactions · 2 comments
- May 28, 2026build(deps): bump the gradle-minor-patch group across 1 directory with 2 updates — tajemniktv/TajsOS2 reactions · 2 comments
- May 27, 2026build(deps): bump com.google.devtools.ksp from 2.3.8 to 2.3.9 in the gradle-minor-patch group — tajemniktv/TajsOS2 reactions · 2 comments
- Sep 14, 2025AGP 9 — android/nowinandroid2 reactions · 5 comments
- May 23, 2025AA: trie-based scope for library module — JetBrains/kotlin2 reactions · 5 comments
- Oct 25, 2024Ksp 1.0.26 — Foso/Ktorfit2 reactions · 3 comments
- Jan 21, 2021nested classes in java sources cannot be resolved — tschuchortdev/kotlin-compile-testing2 reactions · 12 comments
- Nov 10, 2020compilation errors are hidden when KSP is used — tschuchortdev/kotlin-compile-testing2 reactions · 28 comments
- Nov 9, 2026chore(deps): bump com.google.devtools.ksp from 2.3.11 to 2.3.13 — Prekzursil/bilbo-app1 reaction · 2 comments
- Nov 3, 2026chore(deps): update dependency com.google.devtools.ksp to v2.3.13 — waffiqaziz/BAZZ-Movies1 reaction · 6 comments
- Nov 3, 2026build(deps): bump the kotlin group across 1 directory with 2 updates — Kitty-Hivens/Nexira1 reaction · 2 comments
- Nov 3, 2026revert: downgrade KSP from v2.3.13 to v2.3.12 — waffiqaziz/BAZZ-Movies1 reaction · 4 comments
- Nov 2, 2026Build(deps): Bump com.google.devtools.ksp:symbol-processing-api from 2.3.12 to 2.3.13 — MixinNetwork/android-app1 reaction · 1 comment
- Nov 2, 2026Build(deps): Bump com.google.devtools.ksp from 2.3.12 to 2.3.13 — MixinNetwork/android-app1 reaction · 1 comment
- Nov 2, 2026deps: bump the misc-minor-patch group with 3 updates — travnie/Autka1 reaction · 5 comments
- Nov 2, 2026chore(deps): bump the android-deps group in /apps/android with 2 updates — openclaw/openclaw1 reaction · 3 comments
- Nov 2, 2026build(deps): bump com.google.devtools.ksp from 2.3.6 to 2.3.12 — ravidorr/ForkSure1 reaction · 5 comments
- Oct 30, 2026chore(deps): update plugin com.google.devtools.ksp to v2.3.13 — deepanjanxyz/notepad1 reaction · 2 comments
- Oct 30, 2026chore(deps): update dependency com.google.devtools.ksp to v2.3.13 — waffiqaziz/BAZZ-Movies1 reaction · 5 comments
- Oct 30, 2026chore(deps): update plugin com.google.devtools.ksp to v2.3.13 — reitojike/think-canvas1 reaction · 5 comments
- Oct 30, 2026chore(deps): bump the android-dependencies group across 1 directory with 13 updates — edwardlthompson/OpenShouter1 reaction · 1 comment
- Oct 12, 2026Bump com.google.devtools.ksp from 2.3.9 to 2.3.12 — Sottti/Android-App-Template1 reaction · 5 comments
- Sep 28, 2026Bump the gradle-minor-patch group across 1 directory with 11 updates — Airuxn/Pocket-AI1 reaction · 2 comments
- Sep 21, 2026chore(deps)(deps): bump the kotlin-and-ksp group with 3 updates — EliorMachlev/CurrenciX1 reaction · 2 comments
- Sep 21, 2026Bump the gradle-minor-patch group with 9 updates — Airuxn/Pocket-AI1 reaction · 3 comments
- Sep 19, 2026chore(deps): bump com.google.devtools.ksp from 2.3.11 to 2.3.12 in the kotlin_ksp group — LM-Firefly/FlyCat1 reaction · 2 comments
- Sep 17, 2026fix(deps): bump com.google.devtools.ksp from 2.3.11 to 2.3.12 — Insaner1980/runcheck1 reaction · 3 comments
- Sep 14, 2026chore(deps): bump the android-dependencies group across 1 directory with 7 updates — edwardlthompson/AstroAlarm1 reaction · 5 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Read
CONTRIBUTING.mdFirst: Before proposing plans or modifying code, read CONTRIBUTING.md. - Distinctive: line 10
Consult Additional Documentation On-Demand: Read the following repository documents when relevant to your task.
- Distinctive: line 18
The Codebase is the Single Source of Truth: Every claim, diagnosis, or proposed change must be backed by concrete code snippets and traced …
- Very specific: line 23
No Guessing: If an API contract, compiler behavior, or user requirement is ambiguous, inspect the implementation and test suite …
- Distinctive: line 24
Outline a Detailed Plan First: Always outline a clear, detailed plan supported by code references and dataflow analysis before you begin.
- Very specific: line 35
Copyright Headers: All new source files (.kt, .java) must include the standard Apache 2.0 license header used across the codebase:
- Very specific: line 132
Before submitting a pull request to the KSP repository, you must always run the entire ./gradlew check task and check that it completes …
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
AGENTS.md — Guidelines for AI Coding Agents in KSP
Welcome! This file defines the mandatory workflow, engineering methodology, and project context for AI coding agents working in the Kotlin Symbol Processing (KSP) repository.
1. Documentation Discovery & Reference Map
- Read
CONTRIBUTING.mdFirst: Before proposing plans or modifying code, readCONTRIBUTING.md. It is the authoritative source for the bug contribution workflow (@Bug/BugState),api/api.baseverification (checkApi/updateApi), and writing unit tests inkotlin-analysis-api. - Consult Additional Documentation On-Demand: Read the following repository documents when relevant to your task. Documentation can be found in Markdown files, LICENSE, and doc comments in Kotlin source files.
2. Core Engineering Methodology: Scientific Method & Zero Speculation
You are working on a compiler plugin and symbol processing engine. There must be zero speculation, hand-waving, or hallucination.
- The Codebase is the Single Source of Truth: Every claim, diagnosis, or proposed change must be backed by concrete code snippets and traced through the actual codebase.
- Falsify Hypotheses First (Scientific Method):
- Whenever you form a hypothesis about how a symbol is resolved, how a type is computed, or why a bug occurs, actively try to disprove your hypothesis first using concrete code examples and dataflow examples from the codebase.
- Trace the exact dataflow end-to-end (e.g., from
Resolverentry points toAnnotationResolutionStrategy/ Analysis API session calls toKSNode/KSTypewrappers to PSI / FIR symbols) and cite the concrete classes, functions, and line ranges involved. - Revise your mental model repeatedly whenever the code contradicts your assumptions.
- No Guessing: If an API contract, compiler behavior, or user requirement is ambiguous, inspect the implementation and test suite (
kotlin-analysis-api/testDataandKSPUnitTestSuite.kt) or ask the user clarifying questions rather than guessing. - Outline a Detailed Plan First: Always outline a clear, detailed plan supported by code references and dataflow analysis before you begin. Use this plan as your reference when you are making changes.
- Preserve & Synchronize Documentation:
- Preserve all existing comments and docstrings unrelated to your changes unless explicitly instructed otherwise.
- Keep Documentation in Sync with Code Changes: Whenever you modify code, behavior, APIs, Gradle properties, or build configurations, you must also update the corresponding KDoc/doc comments and any relevant documentation files in the repository (e.g.,
README.md,CONTRIBUTING.md,DEVELOPMENT.md,AGENTS.md, ordocs/) so that documentation never drifts out of sync with the implementation. This AGENTS.md file must also be kept in sync.
3. License & Legal Compliance
- License: This repository is licensed under the Apache License, Version 2.0 (see
LICENSE). - CLA: Contributions require a Google Contributor License Agreement (
CONTRIBUTING.md). - Copyright Headers: All new source files (
.kt,.java) must include the standard Apache 2.0 license header used across the codebase:
/*
* Copyright <CURRENT YEAR> Google LLC
* Copyright 2010-<CURRENT YEAR> JetBrains s.r.o. and Kotlin Programming Language contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/where <CURRENT YEAR> is the current year.
You will likely find files that do not have a copyright header. The headers may have been lost when moving the file in the editor. Do not restore those.
4. Repository Architecture & Module Guide
Important Note on KSP1: KSP 1.x has been removed and is no longer supported (
README.md). All active compiler engine development targets KSP2 (kotlin-analysis-api).
The project consists of Gradle subprojects configured in settings.gradle.kts:
| Module | Purpose & Key Details |
:api | Public-facing, dependency-free library (com.google.devtools.ksp:symbol-processing-api). Tracked by Metalava against api/api.base. |
:kotlin-analysis-api | Core KSP2 engine implemented on top of the Kotlin Analysis API (FIR/K2). Key entry points: KotlinSymbolProcessing.kt (src/main/kotlin/com/google/devtools/ksp/impl/), ResolverAAImpl.kt, AnnotationResolutionStrategy.kt (src/main/kotlin/com/google/devtools/ksp/common/impl/ with AAResolutionStrategy and PsiResolutionStrategy), all KS* symbol implementations (src/main/kotlin/com/google/devtools/ksp/impl/symbol/), and the primary unit test suite (KSPUnitTestSuite.kt). |
:symbol-processing-aa-embeddable | Repackages :kotlin-analysis-api and its dependencies into a self-contained uber-jar, relocating bundled packages under the ksp.* namespace (symbol-processing-aa-embeddable/build.gradle.kts) to avoid classpath conflicts. Entry point: KSPLoader.loadAndRunKSP(). |
:gradle-plugin | The KSP Gradle plugin (id("com.google.devtools.ksp"), KspGradleSubplugin in KspSubplugin.kt, and KspAATask.kt). Configures KSP tasks for JVM, Android, and Kotlin Multiplatform (KMP) projects. |
:common-util | Shared internal utilities used by :kotlin-analysis-api and other modules. |
:common-deps | Shared dependencies and command-line argument parsing utilities (symbol-processing-common-deps). Uses :cmdline-parser-gen via KSP. |
:cmdline-parser-gen | Internal KSP processor used during the build to generate command-line parser code for :common-deps. |
:integration-tests | End-to-end Gradle TestKit tests validating the published KSP uber-jar and Gradle plugin across real build scenarios (primaryTest, secondaryTest, androidTest, agpTest). |
:symbol-processing | Dummy POM-only artifact maintained for KotlinCompilerPluginSupportPlugin compatibility. |
:test-utils | Legacy test utilities. Deprecated for new unit tests (CONTRIBUTING.md)—all new unit tests belong in :kotlin-analysis-api. |
5. Contribution, Bug & Testing Workflows
Read CONTRIBUTING.md.
6. Build, Version Synchronization & Verification Reference
JDK & Kotlin Version Constraints
- Carefully read the Gradle build files for a particular module to find out what its Java and Kotlin constraints are.
- Decoupled Versions (
gradle.properties&gradle/libs.versions.toml):buildKotlinVersion/buildKspVersion: Used ingradle.propertiesto bootstrap and compile the KSP project itself.kotlinBaseVersion(kotlin-base) &agpBaseVersion(agp-base): Duplicated in bothgradle.propertiesandgradle/libs.versions.toml.gradle-plugin'sTestConfigloadsgradle.propertiesdirectly at test runtime—always keep both files in sync.aa-kotlin-base(aaKotlinBaseVersion): The specific (often developmental) Kotlin version used for Analysis API dependencies in:kotlin-analysis-apiand:symbol-processing-aa-embeddable.
Essential Gradle Tasks
- Run a single unit test method across all 4 suite configurations:
Note: Because
KSPUnitTestSuiteisabstract, use a wildcard or a concrete subclass name with--tests:./gradlew :kotlin-analysis-api:test --tests "*.<testMethodName>" - Run all Analysis API unit tests:
./gradlew :kotlin-analysis-api:test - Check / Update Public API Signatures (
Metalava): Whenever modifying public declarations in:api, verify compatibility againstapi/api.base:./gradlew :api:checkApi ./gradlew :api:updateApi - Shadow JAR & Relocation Validation:
./gradlew :kotlin-analysis-api:validateShadowJar: Runsjdepsagainstkotlin-analysis-api/shadow-validation-baseline.txtand verifies no forbidden packages (such asorg/apache/log4j/jdbc) leak into the shadow JAR../gradlew :symbol-processing-aa-embeddable:shadowJar: Verifies that all bundled classes are relocated into allowedksp.*namespaces.
- Gradle Plugin Tests:
./gradlew :gradle-plugin:test: Runs tests for the KSP Gradle plugin.
- Run Integration Tests:
Integration tests publish all artifacts to
<rootProject>/build/repos/testand run Gradle TestKit suites (integration-tests/build.gradle.kts):
Integration tests may take a long time to run so it may be helpful to just run a single test or test class when making changes, e.g.,./gradlew :integration-tests:primaryTest ./gradlew :integration-tests:secondaryTest ./gradlew :integration-tests:androidTest ./gradlew :integration-tests:agpTest
where./gradlew :integration-tests:primaryTest --tests "com.google.devtools.ksp.test.primary.<TestClass>.<method>"TestClassis the name of the class containing tests andmethodis the name of test method/entrypoint. - Full Verification:
Before submitting a pull request to the KSP repository, you must always run the entire
./gradlew checktask and check that it completes successfully.Note: It may be necessary to pass
--rerun-tasksto ensure cached test or task outputs are re-evaluated after changes../gradlew check --rerun-tasks
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
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.

