tg-miniapp

tg-miniapp is a skill for Claude Code, Codex from RaNDoM6913/claude-code-superkit. It costs 47 tokens per session (1,670 once invoked), scanned A, original, MIT.

A collection of patterns for Telegram Mini Apps, which are web apps opened inside Telegram, including device safe areas, fixed elements, navigation buttons, sharing, and fullscreen behavior.

In plain words
What is it for?
Use it when building Telegram Web Apps with fullscreen screens, modals, bottom sheets, safe-area padding, or Telegram navigation controls.
Why use it?
Telegram and different phones can reserve space for status bars and controls in different ways, causing overlaps or broken layouts.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/random6913/claude-code-superkit/tg-miniapp
Any agent
npx skills add RaNDoM6913/claude-code-superkit --skill tg-miniapp
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for tg-miniapp

README.md
[![agentmods](https://agentmods.dev/badge/skills/random6913/claude-code-superkit/tg-miniapp.svg)](https://agentmods.dev/skills/random6913/claude-code-superkit/tg-miniapp)
Your own site
<a href="https://agentmods.dev/skills/random6913/claude-code-superkit/tg-miniapp"><img src="https://agentmods.dev/badge/skills/random6913/claude-code-superkit/tg-miniapp.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,670 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.01670
Opus 5 $0.00023 $0.00835
Sonnet 5 $0.00009 $0.00334
Haiku 4.5 $0.00005 $0.00167

Measured yesterday against content hash 354502e87336, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tg-miniapp 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 yesterday.

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.

packages/showcase/.claude/skills/tg-miniapp/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Telegram Mini App — Critical Patterns

🔴 CRITICAL: Safe Area в Fullscreen

safeAreaInset может вернуть 0 при инициализации — нельзя читать один раз. Значения обновляются асинхронно. iOS и Android дают разные safe areas.

Решение — реактивный хук (файл: src/hooks/useSafeAreaInset.ts):

import { useSafeAreaInset } from "@/hooks/useSafeAreaInset";

// В компоненте:
const safeArea = useSafeAreaInset();

// Полные поля:
safeArea.top         // комбинированная safe area (systemTop + contentTop, с fallback)
safeArea.bottom      // нижний отступ
safeArea.systemTop   // высота статус-бара устройства (0 вне fullscreen)
safeArea.contentTop  // высота TG-контролов — "Закрыть", "˅", "..." (0 вне fullscreen)
safeArea.isFullscreen // true если Mini App в fullscreen

// Простое использование — paddingTop = combined safe area:
<div style={{ paddingTop: safeArea.top }}>

Минимальные fallback для fullscreen:

  • iOS: top = 100px (если сумма < 80)
  • Android: top = 80px (если сумма < 80)

Архитектура safe area зон (fullscreen):

┌──────────────────────────────┐
│  22:54   📶  📶  🔋          │  ← systemTop (статус-бар / notch)
│ ✕ Закрыть          ˅  ...   │  ← contentTop (TG floating controls)
│  ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─   │  ← safeArea.top = systemTop + contentTop
│       App content            │
  • safeAreaInset.top и contentSafeAreaInset.topаддитивны в fullscreen
  • Вне fullscreen оба = 0 (нативный TG-хидер управляет сам)

Sticky header с safe area:

// WRONG — контент просвечивает сквозь gap
<div className="sticky top-0">Header</div>

// CORRECT
<div className="sticky top-0" style={{ paddingTop: safeArea.top, background: COLORS.bg }}>
  Header
</div>

🔴 CRITICAL: Брендинг в зоне TG-контролов (fullscreen header)

В fullscreen режиме можно разместить текст/логотип между системными кнопками TG ("Закрыть" слева, "˅ + ..." справа). Это заменяет кастомный хидер и экономит место.

Паттерн — branding в TG controls zone:

const safeArea = useSafeAreaInset();

{/* Прозрачный spacer = вся safe area */}
{safeArea.top > 0 && (
  <div className="shrink-0 relative" style={{ height: safeArea.top }}>
    {/* Текст позиционирован точно в зоне TG-контролов */}
    {safeArea.isFullscreen && safeArea.contentTop > 0 && (
      <div
        className="absolute left-0 right-0 flex items-center justify-center pointer-events-none"
        style={{
          top: safeArea.systemTop,
          height: safeArea.contentTop,
        }}
      >
        <span
          className="text-[15px] font-bold tracking-[0.08em] uppercase"
          style={{ color: "rgba(228,228,240,0.55)" }}
        >
          MyApp
        </span>
      </div>
    )}
  </div>
)}

Read the full file on GitHub · 178 lines

Changes

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.

  1. yesterday First seen · 178 lines · 47 tokens per session scan A 354502e87336

Subscribe to this mod's changes

tg-miniapp is a skill published in the GitHub repository RaNDoM6913/claude-code-superkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 1,670 once invoked, about $0.0002 per session on Opus 5. 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-09-03.

Related

Other skills, from other repositories

cli-logging-ux

Use this skill when editing or creating CLI output, logging, warnings, error messages, progress indicators, or diagnostic summaries in the APM codebase. Activate whenever code touches console helpers (richsuccess, richwarning, richerror, richinfo, richecho), DiagnosticCollector, STATUSSYMBOLS, CommandLogger, or any…

microsoft/apm · 94 tokens

cut-release

Use this skill to cut an APM release from the current worktree: assess whether the cycle since the last tag warrants a patch or minor bump (semver discipline against the merged-since-last-tag diff), sanitize the [Unreleased] CHANGELOG block into a dated version block with one concise "so what" entry per merged PR…

microsoft/apm · 198 tokens

docs-sync

Use this skill whenever a pull request is opened, reopened, or synchronized in microsoft/apm to assess whether and how the documentation corpus must change to stay truthful with the proposed code change. Activate even when the PR title or body says nothing about docs -- the skill must run on every PR to detect silent…

microsoft/apm · 150 tokens

shepherd-driver

Use only as the composed drive-to-merge stage of an APM batch orchestrator (batch-bug-shepherd, apm-issue-autopilot) that has already selected ONE open pull request in microsoft/apm. Do NOT use for user-facing requests to triage issues, sweep a queue, or open PRs -- the parent orchestrator owns those. Spawn one…

microsoft/apm · 193 tokens

docs-impact-architect

Use this skill when the docs-impact-classifier returns a structural verdict, signalling that the documentation TOC must change to accommodate the PR. Proposes TOC deltas (new pages, moves, merges) and emits new-page outline stubs that the doc-sync panel later fleshes out. Holds the 3-promise narrative (consume /…

microsoft/apm · 85 tokens

devx-ux

Activate when designing or modifying CLI command surfaces, command help text, install/init/run flows, error wording, or first-run experience in the APM CLI -- even when the user does not say "UX" explicitly.

microsoft/apm · 48 tokens