oceanbase-sql-doc
10
总安装量
4
周安装量
#30169
全站排名
安装命令
npx skills add https://github.com/amber-moe/oceanbase-doc-skills --skill oceanbase-sql-doc
Agent 安装分布
claude-code
3
trae
2
opencode
2
kilo
1
windsurf
1
Skill 文档
OceanBase SQL Documentation Skill
This skill provides guidelines for writing OceanBase database SQL statement documentation following the official documentation standards.
When to use
Use this skill when:
- Writing SQL statement reference documentation
- Editing existing SQL documentation
- Creating examples for SQL statements
- Formatting SQL syntax documentation
Document structure
Meta information table
All documents must start with a meta information table (not YAML frontmatter):
| Description | |
|---|---|
| description | ææ¡£çå 容æè¿°ã注æï¼å¥å°¾éè¦ç»ä¸å å¥å·ã |
| keywords | å ³é®è¯ï¼å¤ä¸ªå ³é®è¯ä¹é´ç¨è±æéå·éå¼ |
| dir-name | è¿éå¡«å叿å¨å½å ç«ææ¡£ä¸å¿ç®å½ä¸å±ç¤ºçåç§° |
| dir-name-en | è¿éå¡«å叿卿µ·å¤ç«ææ¡£ä¸å¿ç®å½ä¸å±ç¤ºçåç§° |
| tenant-type | MySQL Mode æ Oracle Modeï¼ä¸¤ç§æ¨¡å¼åéç¨åä¸å¡«åï¼ |
| ddl-type | Online DDL æ Offline DDLï¼ä» éç¨äºå æ ¸ SQL è¯å¥ç¸å ³ææ¡£ï¼ |
| machine-translation | æ è¯æºå¨ç¿»è¯çææ¡£ï¼å¦æï¼ |
Default: Only fill in necessary fields (description, keywords). Fill tenant-type only when applicable.
Standard sections
- Purpose – Brief description of what the statement does
- Syntax – SQL syntax definition (without semicolon)
- Parameters – Parameter descriptions in table format
- Examples – Executable SQL examples with results
- References – Links to related documentation
Formatting rules
Syntax section
- Syntax definitions end WITHOUT semicolons
- Syntax is for format/structure explanation, not executable statements
- Use code blocks with
sqllanguage tag
Example:
ALTER SYSTEM KILL SESSION 'session_id, serial#';
Examples section
SQL Statements:
- Prefix SQL statements with
obclient>orobclient [SCHEMA]>prompt - Include semicolons in executable statements
- Place SQL statements in separate code blocks
Query Results:
- Place query results in separate code blocks
- Connect SQL and results with text like “æ¥è¯¢ç»æå¦ä¸ï¼” or “Query results:”
- Do NOT include “Query OK” messages unless helpful
- Do NOT include “Query OK, 0 rows affected” or similar unless meaningful
Example Format:
obclient [KILL_USER]> SHOW PROCESSLIST;
æ¥è¯¢ç»æå¦ä¸ï¼
+------------+-----------+----------------------+-----------+---------+------+--------+------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+------------+-----------+----------------------+-----------+---------+------+--------+------------------+
| 3221487726 | KILL_USER | 100.xx.xxx.xxx:34803 | KILL_USER | Query | 0 | ACTIVE | SHOW PROCESSLIST |
+------------+-----------+----------------------+-----------+---------+------+--------+------------------+
1 row in set
Naming conventions
- Use meaningful names in examples (not simple names like
t1,tg1) - Table groups:
order_tg,product_tg - Tables:
order_table,user_info - Databases: Use business-meaningful names
- This helps users understand real-world application scenarios
Notice boxes
说æ (Explain):
注æ (Notice):
Spacing rules
- Space between title and body text
- Space between body text and code blocks/tables
- Space between sections
Quality checklist
Before finalizing documentation:
- Meta information table is properly formatted
- Syntax section has no semicolons
- Examples use
obclient>prefix - SQL statements and results are in separate code blocks
- Example names are meaningful and business-oriented
- Notice boxes use correct format
- Proper spacing throughout document
- No unnecessary “Query OK” messages
- All code blocks have appropriate language tags
Common patterns
Parameter tables
Use table format for parameters:
| Parameter | Description |
|---|---|
| session_id | The Client Session ID of the current session. This ID is the unique identifier of the session in the client. NoteYou can execute the SHOW PROCESSLIST; or SHOW FULL PROCESSLIST statement to view the session_id. |
Reference links
Format references as:
For more information about how to query the quantity and IDs of sessions in the current database, see [View tenant sessions](../../../../../1200.database-proxy/1500.view-tenant-sessions.md).
Testing against test cases
When sql_parser files and test cases differ:
- Always follow test cases – they reflect actual production functionality
- Test cases show what users can actually use
- Document the real, working syntax, not theoretical parser definitions