tiktok-guidelines-knowledge

Provides TikTok API design standards and Go coding style guidelines for IDL authoring and code review.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill tiktok-guidelines-knowledge-yuezhen-huang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tiktok-guidelines-knowledge
Source: https://github.com/yuezhen-huang/my-bytedance-skillhub/tree/main/tiktok-guidelines-knowledge
Command: npx skills add https://github.com/yuezhen-huang/my-bytedance-skillhub --skill tiktok-guidelines-knowledge-yuezhen-huang

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Engineers working on TikTok services need to follow strict API design standards and Go coding conventions, but the rules are scattered across many documents. This Skill consolidates the TikTok API design guidelines, API workflow, and Go code style rules into one knowledge base so an AI agent can design compliant IDL, generate conforming Go code, and perform standards-based code review. ## Core Features & Use Cases - API Design Standards: Covers resource-oriented design, naming conventions (snake_case files, lower_snake_case Protobuf fields, CamelCase Thrift fields), standard methods (Get/List/Create/Update/Delete), pagination, filtering, error handling, and security requirements. - API Workflow Guidance: Explains the four-phase Design-First workflow (design, prototype with Mock servers, develop and test, consume) plus tooling such as BAM, DevFlow, PBBuilder, and ByteMock. - Go Code Style Rules: Details formatting (gofmt/goimports, import grouping), comments, naming, function design, control structures, initialization, interface checking, and the ByteCheck rule set with severity levels. - Use Case: When reviewing a Go merge request, ask the agent to check the code against TikTok conventions; it will flag issues like functions with more than 5 parameters, nesting deeper than 3 levels, errors compared with == instead of errors.Is, or missing field names in struct literals. ## Quick Start Review this Go service code and its Thrift IDL against the TikTok API design guidelines and Go coding standards, then list all violations with their ByteCheck rule references.

Frequently Asked Questions about tiktok-guidelines-knowledge

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

FAQPage Schema
How do I design a TikTok-compliant API IDL?

Use Protocol Buffers for HTTP APIs and Thrift for RPC APIs, with snake_case file names. Follow resource-oriented design with standard methods (Get, List, Create, Update, Delete), name Protobuf fields in lower_snake_case and Thrift fields in CamelCase, and include pagination with page_size and page_token for list operations.

What are the TikTok Go code style rules for functions?

Functions should be small and focused, take context.Context as the first parameter, and have no more than 5 parameters (warning) or 8 (error). Nesting depth must not exceed 3 levels, errors must never be ignored with blank identifiers, and defer should be used for resource cleanup.

How should errors be handled in TikTok API and Go code?

Error codes must distinguish infrastructure errors from business errors, and messages must be in English and actionable. RPC APIs must use BaseResponse for errors, HTTP APIs must not replace HTTP status codes with status_code fields, and Go code must compare errors with errors.Is rather than ==.

What is ByteCheck and which rules does it enforce?

ByteCheck is TikTok's automated code style checker with rules at error, warning, and info severity levels. It enforces limits like maximum 3-level nesting, function parameter counts, exported function comments, and proper error comparison using errors.Is.

What tools support the TikTok API development workflow?

The Design-First workflow uses the Byte API management platform and DevFlow for IDL lifecycle management, BAM and ByteMock for prototyping, PBBuilder and GDP for server code generation, and Rhino plus Tesla for testing. DevFlow coordinates multi-end code generation and compatibility checks.

When should fallthrough be avoided in Go switch statements?

Fallthrough should be used cautiously because it skips the next case's condition check and executes its branch unconditionally, which can produce unexpected output. It cannot appear in the last case branch, and branch ordering must be carefully considered when it is used.