Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/vendelieu/telegram-bot/ktnip-ksp-processorgit clone --depth 1 https://github.com/vendelieu/telegram-botWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/vendelieu/telegram-bot/ktnip-ksp-processor)<a href="https://agentmods.dev/rules/vendelieu/telegram-bot/ktnip-ksp-processor"><img src="https://agentmods.dev/badge/rules/vendelieu/telegram-bot/ktnip-ksp-processor.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00482 |
| Opus 5 | $0.00000 | $0.00241 |
| Sonnet 5 | $0.00000 | $0.00096 |
| Haiku 4.5 | $0.00000 | $0.00048 |
Grade A, and why
ktnip-ksp-processor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
KSP Processor Rules
Architecture
ActivityProcessor -> Collectors -> ActivityCodeGenerator -> ParameterResolver + InvocationCodeGenerator
- ActivityProcessorProvider: Entry; passes options, logger, codeGenerator
- Collectors: BotCtxCollector, CommandCollector, InputCollector, CommonCollector, UpdateHandlerCollector, UnprocessedHandlerCollector, WizardCollector
- Outputs: ActivitiesData.kt, BotCtx.kt (per package), KtGramCtxLoader, META-INF/services
ActivityProcessor
- Single-pass;
isProcessedguard - Options:
package(semicolon-separated),autoAnswerCallback - FileBuilder = KotlinPoet FileSpec.Builder
- Add
@Suppressand@OptInto generated files
Collectors
- Implement
Collector:collect(resolver: Resolver, ctx: CollectorsContext) - BaseCollector:
extractActivityMetadata(),generateAndRegisterActivity() - Discovery:
resolver.getAnnotatedFnSymbols(pkg, Annotation::class) - Annotations: use
findAnnotationRecursivelyfor meta-annotations - New collector: add to
processPackagelist in ActivityProcessor
ParameterResolutionStrategy
- User, Chat, Bot, ProcessingContext, Update, TypedUpdate
- StringParameter, PrimitiveParameter (Int, Long, etc.) - from parameters map
- Injectable - from injectableTypes; @ParamMapping for name override
- Unsupported - generates error
- New strategy: add to ParameterResolver + InvocationCodeGenerator
Conventions
- Use TypeConstants for type references (User, Chat, Bot, Update types)
- DEFAULT_CODEGEN_PACKAGE = "eu.vendeli.tgbot.generated"
- AnnotationExtractor: function > class > default for Guard, RateLimits, ArgParser
- KSPExtensions: findAnnotationRecursively, hasAnnotationRecursively for meta-annotations
Tests
- KSP tests:
./gradlew :ktnip:jvmTest(see ktnip-ksp-tests rule) - New collectors: add test data and
runTestin ProcessorTest
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 51 lines · 0 tokens per session scan A fa59540f72d6
ktnip-ksp-processor is a cursor rule published in the GitHub repository vendelieu/telegram-bot (248 stars, last pushed 7d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 482 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
ios-viewmodel
ViewModels conform to ObservableObject and expose state via @Published properties.
android-viewmodel
Android ViewModel conventions — StateFlow, repository abstraction, coroutines, no LiveData.
shared-module
KMP shared module constraints — no platform imports in domain/, expect/actual conventions, pure Kotlin business logic.
everything-mobile
Android, iOS, and Kotlin Multiplatform engineering guidance.
android_general_rules
For every Kotlin Android code you generate or refactor.
pglite-inspector
Cursor rule "pglite-inspector" from groupultra/telegram-search, covering pglite inspector (devtool), api & integration, behavior & ux and reliability & safety.