add-ktnip-parameter-strategy

Add custom parameter resolution strategies to the ktnip KSP processor.

247|18|Updated May 26, 2022
One-click install
npx skills add https://github.com/vendelieu/telegram-bot --skill add-ktnip-parameter-strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-ktnip-parameter-strategy
Source: https://github.com/vendelieu/telegram-bot/tree/main/.cursor/skills/library-dev/add-ktnip-parameter-strategy
Command: npx skills add https://github.com/vendelieu/telegram-bot --skill add-ktnip-parameter-strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of adding new parameter types that can be automatically resolved and injected into Telegram bot handler functions by the ktnip KSP processor.

Core Features & Use Cases

  • Extensibility: Allows library contributors to easily add support for new parameter types (e.g., ChatMember, InlineQuery) or new resolvable types during Activity invocation.
  • Developer Productivity: Reduces boilerplate code for developers using the library by enabling automatic resolution of custom or new parameter types.
  • Use Case: A library developer needs to add support for resolving the User object directly from an Update object. They would use this Skill to modify the ktnip processor to recognize and extract the User object.

Quick Start

Follow the workflow outlined in the documentation to add a new parameter resolution strategy to the ktnip KSP processor.

Frequently Asked Questions about add-ktnip-parameter-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a custom parameter resolution strategy to a Kotlin Symbol Processing processor?

To add a custom parameter resolution strategy to a Kotlin Symbol Processing processor, you modify the ktnip library files like ParameterResolutionStrategy.kt, TypeConstants.kt, ParameterResolver.kt, and InvocationCodeGenerator.kt to recognize and inject new types.

How does parameter resolution work in Telegram bot handlers using ktnip?

Parameter resolution in ktnip uses a KSP processor to automatically recognize, extract, and inject specific parameter types, such as a User object from an Update, directly into your Telegram bot handler functions during Activity invocation.

Can I automatically resolve and inject new parameter types into my Kotlin Telegram bot handlers?

Yes, you can automatically resolve and inject new parameter types into Kotlin Telegram bot handlers by extending the ktnip KSP processor with custom resolution strategies to support new objects like ChatMember or InlineQuery.

What is the best way to extend ktnip to support resolvable types during Activity invocation?

The best way to extend ktnip for resolvable types during Activity invocation is to add new parameter resolution strategies by updating the core processor files, reducing boilerplate for developers using the library.

Do I need to modify specific ktnip library files to add support for new resolvable types?

Yes, adding support for new resolvable types requires modifying ParameterResolutionStrategy.kt, TypeConstants.kt, ParameterResolver.kt, and InvocationCodeGenerator.kt within the ktnip library to enable the KSP processor to handle the new types.

When should I extend the ktnip parameter resolution strategy for my Telegram bot?

You should extend the ktnip parameter resolution strategy when you need the KSP processor to automatically resolve and inject custom or new parameter types into your Telegram bot handler functions that are not supported by default.