Agent skill

Tianji Read-Only Data Queries

by msgbyte in msgbyte/tianji

Answers questions about website traffic, monitors, surveys, events and billing from a Tianji instance using read-only GET calls checked against its live OpenAPI document.

Apache-2.0Auto-check passedData & Analytics

Install Tianji Read-Only Data Queries

skills CLI
$ npx skills add msgbyte/tianji --skill tianji-data-query -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install msgbyte/tianji tianji-data-query --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/msgbyte/tianji.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tianji-data-query .claude/skills/tianji-data-query && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tianji-data-query
GitHub stars
3.1k
Token cost
~1.5k tokens
SKILL.md length
635 words
Files
7 (incl. scripts, references)
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Answers questions about website traffic, monitors, surveys, events and billing from a Tianji instance using read-only GET calls checked against its live OpenAPI document.

  • Works in 4 steps: Identify the service domain from the… → Read the target's /open/_document and… → Construct the GET request using the live… → …
  • Checking website traffic and pageviews in Tianji
  • SKILL.md covers Configuration, Making API Requests, Service Domains and Workflow, plus 3 more sections
  • Runs Shell and JavaScript scripts from its folder; calls curl; needs TIANJI_API_KEY

What it does

Three values come from the skill config: `TIANJI_BASE_URL`, `TIANJI_API_KEY` and `TIANJI_WORKSPACE_ID`. Before querying, the agent fetches the target instance's own OpenAPI document from its `/open/_document` path and confirms it is a JSON object with `openapi` and `paths`. If discovery fails it reports that and stops rather than guessing endpoints. The live document confirms method, path, parameters, response schema and authentication, `$ref` schemas are resolved, and the API key is sent as a bearer header, never in a URL or in output.

Only GET requests are allowed even though the document also describes writes, and when an operation has no GET route the agent reports the limitation instead of deriving routes from the dashboard. The bundled `references/api-endpoints.md` and `references/openapi-readonly.json` are snapshots for finding likely operations, and the live document wins over them. Typical questions cover traffic and pageviews, monitor status, survey feedback, telemetry events, feed channels, billing usage and application stats.

When your agent uses it

  • Checking website traffic and pageviews in Tianji
  • Reading uptime monitor status or survey feedback
  • Looking at billing usage or application stats for a workspace
  • Listing telemetry events or feed channels without changing anything

Example prompts

  • “How many pageviews did my main site get over the last week in Tianji?”
  • “Which uptime monitors are currently failing in my Tianji workspace?”
  • “Summarize the latest survey feedback from Tianji.”
  • “Show this month's billing usage for the workspace.”

Requirements

  • A Tianji instance with OpenAPI enabled
  • `TIANJI_BASE_URL`, `TIANJI_API_KEY` and `TIANJI_WORKSPACE_ID` configured
  • `curl`

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Identify the service domain from the user's question
  2. Read the target's /open/_document and find the relevant exported GET operation; bundled references are lookup hints only
  3. Construct the GET request using the live path and parameter schemas, actual resource IDs, and required authentication
  4. Parse the JSON response, redact sensitive fields, and summarize for the user

What it can do on your machine

Read from SKILL.md and the folder at commit 45578dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell and JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • TIANJI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tianji Read-Only Data Queries loads about 1.5k tokens when it runs, and up to ~86k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 635 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~86k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from msgbyte/tianji at commit 45578dd, republished under its Apache-2.0 licence (© msgbyte). 635 words, ~1,516 tokens.

Download SKILL.mdSave it as .claude/skills/tianji-data-query/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
tianji-data-query
description
Use when the user asks about website traffic, pageviews, monitor status, survey feedback, telemetry events, feed channels, billing usage, application stats, or other Tianji platform data through read-only queries.

Tianji Analytics

Query any read-only data from the Tianji monitoring and analytics platform.

Configuration

Three values are required (provided via skill config):

VariableDescription
TIANJI_BASE_URLTianji instance URL (e.g. https://tianji.example.com)
TIANJI_API_KEYAPI key for authentication
TIANJI_WORKSPACE_IDDefault workspace ID

Making API Requests

Before querying data, fetch and read the target instance's OpenAPI document. TIANJI_BASE_URL is the instance URL without the /open suffix:

bash
curl --fail-with-body --silent --show-error \
  "${TIANJI_BASE_URL%/}/open/_document"

Confirm a successful response containing an OpenAPI JSON object with openapi and paths, not HTML or an error payload. If discovery fails, report the failure and stop API queries; do not substitute bundled paths or guess endpoints. The instance must enable OpenAPI to serve this document.

Use the live document to confirm the operation's method, path, path/query parameters, response schema, and authentication. Resolve referenced schemas ($ref), including required fields, types, formats, defaults, enums, and pagination. Resolve servers against the target instance before appending an operation path (normally /open; do not add it twice). Keep authenticated requests on the intended instance and send the API key via Authorization: Bearer ..., never in the URL or output.

Only GET requests are allowed, even though the live document also describes writes. If the requested operation has no exported GET route, report that limitation. Do not derive /open routes from dashboard tRPC procedures; those need separate maintained references and are outside this skill.

The target document takes precedence over bundled references and examples. Reuse it within the same task and target; fetch again after switching instances, an upgrade, or a schema-related failure. Parse successful API responses as JSON and report HTTP/API errors rather than treating them as query results.

Service Domains

api-endpoints.md and openapi-readonly.json are bundled snapshots for discovering likely operations. Their endpoint counts and schemas may differ from the target; confirm every selected operation against its live document.

DomainEndpointsTypical Questions
Website13Traffic stats, pageviews, geo distribution, Lighthouse scores
Monitor9Uptime status, recent check data, monitor events
Survey8Survey responses, result stats, AI categories
Telemetry7Custom event counts, telemetry pageviews, metrics
Billing7Usage quotas, subscription tier, credit balance
Feed6Feed channels, event streams, feed states
Application5App store reviews, app info, event stats
AI/AIGateway5Gateway logs, model pricing, quota alerts
Worker3Worker list, worker details, revisions
Page2Status pages
Workspace2Members, service counts
Global1Platform configuration
AuditLog1Audit trail
Show full SKILL.md (244 more words)Show less

Workflow

  1. Identify the service domain from the user's question
  2. Read the target's /open/_document and find the relevant exported GET operation; bundled references are lookup hints only
  3. Construct the GET request using the live path and parameter schemas, actual resource IDs, and required authentication
  4. Parse the JSON response, redact sensitive fields, and summarize for the user

Common Scenarios

The routes below illustrate the bundled version. Confirm paths, parameters, timestamp formats, and pagination against the target document before using them.

Website traffic overview
GET /open/workspace/{workspaceId}/website/all

Pick the target website ID, then:

GET /open/workspace/{workspaceId}/website/{websiteId}/stats?startAt={timestamp}&endAt={timestamp}
Monitor health check
GET /open/workspace/{workspaceId}/monitor/all

Pick the target monitor ID, then:

GET /open/workspace/{workspaceId}/monitor/{monitorId}/get
GET /open/workspace/{workspaceId}/monitor/{monitorId}/status
Survey results analysis
GET /open/workspace/{workspaceId}/survey/all

Pick the target survey ID, then:

GET /open/workspace/{workspaceId}/survey/{surveyId}/result/list?startAt={timestamp}&endAt={timestamp}&limit=50
GET /open/workspace/{workspaceId}/survey/{surveyId}/stats?startAt={timestamp}&endAt={timestamp}
Feed event inspection
GET /open/workspace/{workspaceId}/feed/channels

Pick the channel ID, then:

GET /open/workspace/{workspaceId}/feed/{channelId}/fetchEventsByCursor?limit=20

Sensitive Data Handling

Some GET endpoints may return fields containing platform-stored secrets (e.g. modelApiKey, customModelBaseUrl in AI Gateway responses). Additionally, endpoints like workspace members, audit logs, and billing may contain PII or internal details.

Rules:

  • Live schemas and API responses are not redacted by the bundled schema's filtering; always apply these rules yourself
  • NEVER display modelApiKey, apiKey, secret, token, password, or credential fields to the user
  • Redact or omit these fields when summarizing API responses
  • When querying workspace members or audit logs, only surface non-sensitive metadata (names, roles, timestamps) unless the user explicitly requests full detail

Notes

  • Use timestamp formats and metric type enums from the target operation; bundled examples use milliseconds since epoch
  • Follow the target operation's pagination contract; some endpoints use cursor and return nextCursor

© msgbyte, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts, references) in skills/tianji-data-query of msgbyte/tianji.

  • SKILL.md
  • build.sh
  • clawhub.json
  • references/api-endpoints.md
  • references/openapi-readonly.json
  • scripts/filter-openapi.cjs
  • skill.yaml

Open the folder on GitHubat commit 45578dd

Compare with similar skills

Tianji Read-Only Data Queries next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tianji Read-Only Data Queries compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tianji Read-Only Data Queries this skillmsgbyte/tianji3.1k—~1.5kAutomated safety check: PassApache-2.0
ToolJet Marketplace Plugin BuilderToolJet/ToolJet41k—~2.1kAutomated safety check: PassAGPL-3.0
Zodjasonjgardner/blockbench-mcp-plugin4913 repos~1.4kAutomated safety check: PassGPL-3.0
DocsInsForge/InsForge13k—~761Automated safety check: PassApache-2.0
OpenAPI CLI CallerEvilFreelancer/openapi-to-cli265—~879Automated safety check: PassMIT
Soundcloud API Integrationsoundcloud/api258—~787Automated safety check: PassNone

Similar skills

  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed
  • Zod

    jasonjgardner/blockbench-mcp-plugin

    Zod schema validation best practices for type safety, parsing, and error handling.

    491 GitHub starsUsed in 3 repos~1.4k tokens
    DevelopmentAuto-check passed
  • Docs

    InsForge/InsForge

    A skill your agent uses when contributing to InsForge's product documentation in this repository.

    13k GitHub stars~761 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • OpenAPI CLI Caller

    EvilFreelancer/openapi-to-cli

    Turns an OpenAPI, Swagger or OpenRPC spec into CLI commands the agent can search and call, with no MCP server or code generation.

    265 GitHub stars~879 tokensUpdated 15 days ago
    Backend & APIsAuto-check passed
  • Integrates applications with the SoundCloud HTTP API using OAuth 2.1, OpenAPI, and developer docs.

    258 GitHub stars~787 tokensUpdated 7 days ago
    Backend & APIsAuto-check passed
  • Oryxos Init

    oryx-labs/oryxos

    初始化 OryxOS(或同类 JDK 21 + Spring Boot 3.x 企业级单体)的工程地基:Maven 多模块骨架、 结构化日志、Actuator + Prometheus 监控、Spring MVC + 虚拟线程、springdoc OpenAPI、 统一响应体与全局异常/错误码、Google 格式 + 阿里编码规约(Spotless + 阿里 P3C +…

    186 GitHub stars~1.6k tokensUpdated today
    Backend & APIsAuto-check passed

More from msgbyte/tianji

  • Operates Tianji Workers: create, test, deploy, invoke, schedule, pause and roll back them, plus manage their environment variables and shared modules.

    3.1k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Questions about Tianji Read-Only Data Queries

What does Tianji Read-Only Data Queries do?

Answers questions about website traffic, monitors, surveys, events and billing from a Tianji instance using read-only GET calls checked against its live OpenAPI document. Three values come from the skill config: `TIANJI_BASE_URL`, `TIANJI_API_KEY` and `TIANJI_WORKSPACE_ID`. Before querying, the agent fetches the target instance's own OpenAPI document from its `/open/_document` path and confirms it is a JSON object with `openapi` and `paths`.

When should I use Tianji Read-Only Data Queries?

Tianji Read-Only Data Queries fits situations like: checking website traffic and pageviews in Tianji; reading uptime monitor status or survey feedback; looking at billing usage or application stats for a workspace; listing telemetry events or feed channels without changing anything.

How do I install Tianji Read-Only Data Queries in Claude Code?

Run `npx skills add msgbyte/tianji --skill tianji-data-query -a claude-code`. Or copy the skill folder (skills/tianji-data-query in msgbyte/tianji) into .claude/skills/tianji-data-query in your project. Claude Code loads it when a task matches its description.

How do I install Tianji Read-Only Data Queries in Codex?

Run `npx skills add msgbyte/tianji --skill tianji-data-query -a codex`. Or copy the skill folder (skills/tianji-data-query in msgbyte/tianji) into .agents/skills/tianji-data-query in your project. Codex loads it when a task matches its description.

Can I use Tianji Read-Only Data Queries in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add msgbyte/tianji --skill tianji-data-query -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tianji-data-query, .gemini/skills/tianji-data-query, .github/skills/tianji-data-query and .opencode/skills/tianji-data-query in your project.

What does Tianji Read-Only Data Queries need to run?

Going by SKILL.md and its folder, Tianji Read-Only Data Queries needs a shell and JavaScript for the scripts in its folder, the command-line tools its instructions call (curl) and credentials named TIANJI_API_KEY. Our summary lists: A Tianji instance with OpenAPI enabled; `TIANJI_BASE_URL`, `TIANJI_API_KEY` and `TIANJI_WORKSPACE_ID` configured; `curl`.

Does Tianji Read-Only Data Queries access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Tianji Read-Only Data Queries safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Tianji Read-Only Data Queries use?

Tianji Read-Only Data Queries is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tianji Read-Only Data Queries use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 84k tokens, read only when the agent opens those files.

What are the alternatives to Tianji Read-Only Data Queries?

Skills that share tags, products or a category with Tianji Read-Only Data Queries: ToolJet Marketplace Plugin Builder (ToolJet/ToolJet, 41k stars), Zod (jasonjgardner/blockbench-mcp-plugin, 491 stars), Docs (InsForge/InsForge, 13k stars) and OpenAPI CLI Caller (EvilFreelancer/openapi-to-cli, 265 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tianji Read-Only Data Queries?

msgbyte (a GitHub organization) maintains it in msgbyte/tianji, which has 3,103 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: msgbyte/tianji on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.