ワンクリックで
snippet-master
// Use when adding, reviewing, or fixing code snippets in Adapty technical documentation across any of the 7 SDK platforms: iOS, Android, React Native, Flutter, Unity, Kotlin Multiplatform, or Capacitor.
// Use when adding, reviewing, or fixing code snippets in Adapty technical documentation across any of the 7 SDK platforms: iOS, Android, React Native, Flutter, Unity, Kotlin Multiplatform, or Capacitor.
Use when adding support for a new locale/language to the Adapty docs site. Covers all hardcoded and dynamic locale registration points, translation commands, sitemap setup, Algolia search config, and the step-by-step order to follow.
Use when reviewing documentation from a product perspective — whether feature value is clear, onboarding flow makes sense, or technical descriptions align with real user experience. Does not check writing style.
Use when adding a new monthly section to src/content/docs/release-notes/whats-new.mdx — gathers commits to main over a date range, identifies user-facing updates worth featuring, confirms scope with the user, then drafts the section in the existing style.
Use when finishing work on a feature branch and wanting to promote it to develop (or another integration branch) while staying on the original branch. Handles commit, push, merge, push develop, and return.
Use when reviewing or writing MDX files in src/content/docs — proofreading, checking technical writing quality, verifying Simplified Technical English compliance, validating links and images, or drafting new doc content.
Walk through unresolved GitHub PR review comments one by one, suggest fixes, and track resolution in a local file. Use when the user wants to address PR feedback.
| name | snippet-master |
| description | Use when adding, reviewing, or fixing code snippets in Adapty technical documentation across any of the 7 SDK platforms: iOS, Android, React Native, Flutter, Unity, Kotlin Multiplatform, or Capacitor. |
Creates high-quality, consistent code snippets for technical documentation by finding relevant code in SDK repositories and adapting it according to documentation guidelines and best practices.
This skill supports three primary workflows:
Build new snippets by examining SDK code and applying platform-specific patterns.
Adapt existing snippets from one platform to another. This is often faster and ensures consistency across platforms.
Evaluate existing snippets for accuracy, best practices, consistency, and completeness. See the "Reviewing Existing Snippets" section below for the detailed review process.
When translating:
Example Translation Flow:
React Native snippet → Check Flutter SDK → Apply Flutter patterns → Flutter snippet
What to translate directly:
What to adapt:
.present())Before doing ANYTHING, you MUST collect all required information:
Article Context
src/content/docs/[filename].mdxPlatform Information
AdaptySDK-[platform] (use KMP for Kotlin Multiplatform, React-Native for RN)What to Demonstrate
Placement in Article
STOP HERE if any information is missing. Do not proceed until you have all 4 pieces.
Read the Article
view src/content/docs/[article-name].mdx
Analyze Existing Snippets (if any exist on the page)
Check Platform Guidelines
references/<platform>.md for platform-specific patternsLocate the SDK Repository
../AdaptySDK-[platform]/ (adjust based on actual location)Search for Relevant Code
# Search for the method/class
grep -r "methodName" ../AdaptySDK-[platform]/
# Look at implementation
view ../AdaptySDK-[platform]/path/to/file.swift
Understand the Real API
Start Minimal
Add Essential Context
Adapty.makePurchase(params) - show where params comes from// BAD - no context
Adapty.makePurchase(subscriptionUpdateParams)
// GOOD - shows construction
val subscriptionUpdateParams = AdaptySubscriptionUpdateParameters(
oldSubVendorProductId = "old_product_id",
replacementMode = AdaptySubscriptionUpdateReplacementMode.WITH_TIME_PRORATION
)
Adapty.makePurchase(subscriptionUpdateParams) { result ->
// handle result
}
Apply Platform Idioms
async/await with do-catchAdaptyResult.Success/Error patterntry/catch with async/awaittry/on AdaptyError/catch patternonSuccess/onError patterntry/catch with async/awaitAdd Appropriate Comments
// check the access or // handle the error styleFollow Best Practices
"YOUR_ACCESS_LEVEL"When the SDK offers multiple ways to accomplish something (e.g., standalone screen vs embedded widget), follow this pattern:
Document Structure
Progressive Detail
## Present as standalone screen
[minimal example with .present()]
### Dismiss the onboarding
[show .dismiss()]
### Configure iOS presentation style
[show optional iosPresentationStyle parameter]
Use Tabs for Context Variants
<Tabs>
<TabItem value="standalone" label="Standalone screen" default>
[snippet for standalone]
</TabItem>
<TabItem value="embedded" label="Embedded widget">
[snippet for embedded]
</TabItem>
</Tabs>
Code Block Language Identifiers
dart, kotlin, swift, typescript, csharpjavascript showLineNumbers title="Flutter"Convenience Methods vs Direct Calls
view.present() over AdaptyUI().presentView(view)Self-Review Checklist
Compare to Platform Style Guide
references/<platform>.mdValidate Against Real SDK
.present(), .dismiss())When asked to review existing snippets:
Read the Article Context
Check Against Criteria
Suggest Improvements
Missing Context
Adapty.makePurchase(params)params is createdOver-Commenting
// This line calls the getProfile method to retrieve the user's profile// check the accessInconsistency
No Error Handling
Outdated Patterns
Too Much Code
Load the relevant file(s) from references/ when working on a specific platform:
references/ios.md — Swift async/await, do-catch, guard clausesreferences/android.md — AdaptyResult sealed class, when expressionsreferences/react-native.md — TypeScript try/catch async/awaitreferences/flutter.md — Dart try/on AdaptyError/catch, pattern matchingreferences/unity.md — C# callback pattern, null checksreferences/kmp.md — Kotlin onSuccess/onError chainingreferences/capacitor.md — TypeScript try/catch (like RN, adds console.log)references/cross-platform.md — Consistency rules, formatting, translation checklist