> For the complete documentation index, see [llms.txt](https://book.funcd.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.funcd.org/xie-zuo-gui-fan/post-template.md).

# 文章模板

{% hint style="info" %}
**这是模板文件。** 用法：

```bash
cp meta/post-template.md posts/tech/my-new-post.md
```

复制后请删除本提示框，并替换下面所有占位内容。完整流程见 [写作与发布流程](/xie-zuo-gui-fan/writing-workflow.md)。
{% endhint %}

> `标签一` · `标签二` · YYYY-MM-DD

## 背景

发生了什么、我想解决什么问题。**别一上来就贴命令** —— 三个月后的自己需要先知道当时的处境。

如果是排障类文章，这里交代清楚：现象是什么、什么时候开始的、影响范围多大。

## 环境

技术类文章必填，其他类型可删掉本节。版本号写具体，"最新版"三个月后就没有意义了。

| 项    | 版本         |
| ---- | ---------- |
| 操作系统 | macOS 15.5 |
| 运行时  | Go 1.24.2  |
| 关键依赖 | xxx v2.1.0 |

## 过程

### 现象

贴**原始**报错，不要转述，不要截断：

```
error: something went wrong at line 42
  caused by: connection refused
```

### 排查

一步一步写，包括**走错的岔路**。别人（和自己）往往正是卡在那些"看起来对但不对"的方向上。

<details>

<summary>试过但不管用的方案</summary>

* 试了 A —— 不行，因为 ...
* 试了 B —— 表面上好了，但实际上只是掩盖了 ...

</details>

### 原因

真正的根因是什么。如果没查到根因，**如实写"未定位"**，别用一个说得通的猜想凑数。

## 解决

可以直接复制执行的命令或代码，不留 `<改成你自己的路径>` 这类模糊表述；确实需要替换的地方，明确说明替换成什么。

{% code title="fix.sh" %}

```bash
# 每一步在做什么，写在注释里
command --flag value
```

{% endcode %}

{% hint style="warning" %}
如果这只是绕过而非根治，在这里说清楚：它绕过了什么、什么情况下会再次出问题。
{% endhint %}

## 小结

* 结论一句话
* 下次遇到类似问题，先看哪里
* 遗留的疑问（如果有）

## 参考

* [链接标题](https://example.com) —— 简单说明为什么值得看


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.funcd.org/xie-zuo-gui-fan/post-template.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
