api-docs SKILL.md skillB
api-docs from tw2066/api-docs is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add tw2066/api-docs/api-docs@git:20261031.a21cbe0Pins git:20261031.a21cbe0 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- B, 16 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- tw2066/api-docs
- Path
publish/skills/api-docs/SKILL.md- Versions recorded
- 4
- Latest version
- git:20261031.a21cbe0, committed Oct 31, 2026
- First version recorded
- Sep 15, 2026
- Size
- 17,556 bytes
- Repository stars
- 50
- License
- MIT
tangwei/apidocs 组件(Hyperf Swagger/OpenAPI 文档自动生成)使用指南。内容包括注解编写(#[Api]、#[ApiOperation]、#[ApiResponse]、#[ApiModelProperty]、#[ApiHeader] 等)、DTO 与文档联动、config/autoload/api_docs.php 配置、文档 UI 与 llms.txt 访问、故障排除。当需要为控制器编写/修改 API 注解、生成或排查 Swagger 文档、配置 API 文档组件时使用。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Hyperf API Docs(tangwei/apidocs)使用指南
本组件基于 PHP 8 Attributes 扫描控制器路由,在**应用启动时**自动生成 OpenAPI 3.x 描述文件,并提供 Swagger UI、Knife4j、ReDoc、RapiDoc、Scalar 等多种文档界面及供 AI 读取的 llms.txt 输出。
核心依赖:文档中的 DTO、验证与注解扫描由 `tangwei/dto` 组件(`Hyperf\DTO\*` 命名空间)提供。
## 快速开始
```bash
composer require tangwei/apidocs
php bin/hyperf.php vendor:publish tangwei/apidocs # 发布配置到 config/autoload/api_docs.php
php bin/hyperf.php start # 启动后访问 http://127.0.0.1:9501/swagger
```
最小配置(`config/autoload/api_docs.php`):
```php
<?php
use function Hyperf\Support\env;
return [
'enable' => env('APP_ENV') !== 'prod',
'format' => 'json', // json 或 yaml
'output_dir' => BASE_PATH . '/runtime/container', // OpenAPI 文件输出目录
'prefix_url' => env('API_DOCS_PREFIX_URL', '/swagger'),
];
```
零配置即可使用,以上为常用项;完整配置模板见组件 `publish/api_docs.php`。
## 核心注解速查
所有注解位于 `Hyperf\ApiDocs\Annotation\` 命名空间。
### Api —— 控制器分组
```php
use Hyperf\ApiDocs\Annotation\Api;
#[Api(tags: '用户管理', description: '用户相关接口', position: 1)]
class UserController
{
}
```
参数:`tags`(字符串或数组)、`description`、`position`(排序位置)、`hidden`。
### ApiOperation —— 接口描述
```php
…Read the whole file at its exact version.
How to install
mdr add tw2066/api-docs/api-docs@sha256:2378497fe594c60cThe line at the top of this page pins the label git:20261031.a21cbe0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_lpm5mqhc3zwv4fbe)
0 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 4 versions of this file, between Sep 15, 2026 and Oct 31, 2026, about one every 16 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20261031.a21cbe0 latest | 2026-10-31 | a21cbe0 | 17,556 B | B | view · diff |
| git:20261031.88700a0 | 2026-10-31 | 88700a0 | 17,461 B | B | view · diff |
| git:20260922.4e65501 | 2026-09-22 | 4e65501 | 16,974 B | B | view · diff |
| git:20260915.e0c123f | 2026-09-15 | e0c123f | 16,331 B | B | view |
Audit of the latest version
- fail: No link to a raw IP address (matched: http://127.0.0.1:9501)
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (17556 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No script tag
Starting a new one? Use a template for SKILL.md on mdpantry, which passes every one of these checks and says what to change in it.
Source
tw2066/api-docs · 50 stars · license MIT · pushed 2026-11-05 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_lpm5mqhc3zwv4fbe GET https://markdownregistry.com/api/v1/resolve?ref=tw2066/api-docs/api-docs GET https://markdownregistry.com/api/v1/blob/2378497fe594c60c4c3391db3da6e8c743a00ddf1b65a7d52bfb6d6649d32260
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.