<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Kewei Yan</title><description>Kewei Yan 的个人网站，记录后端工程实践、问题排查、技术写作和个人应用。</description><link>https://www.yankewei.site/</link><item><title>给 Coding Agent 设计 Tool：从能跑到好用</title><link>https://www.yankewei.site/posts/designing-tools-for-coding-agents/</link><guid isPermaLink="true">https://www.yankewei.site/posts/designing-tools-for-coding-agents/</guid><description>Tool 设计会直接影响 Coding Agent 的调用准确率和安全边界。这篇从意图封装、原子操作、上下文控制、安全默认和 MCP 标准化几个角度，讲讲 Tool 怎么从能跑变成好用。</description><pubDate>Sat, 06 Jun 2026 02:00:00 GMT</pubDate></item><item><title>让 Agent 自己决定什么时候加载技能</title><link>https://www.yankewei.site/posts/coding-agent-skill-loading/</link><guid isPermaLink="true">https://www.yankewei.site/posts/coding-agent-skill-loading/</guid><description>从自动注入到按需 tool call，一次技能加载机制的重构，token 省了一大截，行为也更可控。</description><pubDate>Thu, 04 Jun 2026 02:00:00 GMT</pubDate></item><item><title>从零做一个 Coding Agent：我这几天真正学到的东西</title><link>https://www.yankewei.site/posts/building-a-coding-agent-from-scratch/</link><guid isPermaLink="true">https://www.yankewei.site/posts/building-a-coding-agent-from-scratch/</guid><description>这段时间我在做一个很小的 coding agent 实验项目。它不是 Cursor，也不是 Codex，只是一个命令行里的 TypeScript 程序：用户输入一个任务，模型决定要不要读文件、搜索代码、修改文件、跑测试，然后一步步把事情做完。</description><pubDate>Mon, 18 May 2026 02:00:00 GMT</pubDate></item><item><title>Laravel Batch Job 的隐藏陷阱：deleteWhenMissingModels 会让 finally 回调失效</title><link>https://www.yankewei.site/posts/laravel-batch-job-deletewhenmissingmodels-issue/</link><guid isPermaLink="true">https://www.yankewei.site/posts/laravel-batch-job-deletewhenmissingmodels-issue/</guid><description>TL;DR - deleteWhenMissingModels 会在反序列化阶段直接删除 Job，Batch 计数不会更新，pendingJobs 无法归零，finally 回调因此不触发。</description><pubDate>Thu, 29 Jan 2026 02:00:00 GMT</pubDate></item><item><title>🚀 PHP 8.5 新特性：管道符 |&gt; 终于来了，用过都说爽！</title><link>https://www.yankewei.site/posts/php-85-adds-pipe-operator/</link><guid isPermaLink="true">https://www.yankewei.site/posts/php-85-adds-pipe-operator/</guid><description>PHP 8.5 新特性管道符 |&gt;，让你的代码像读自然语言一样流畅，彻底告别嵌套地狱。</description><pubDate>Sun, 12 Oct 2025 02:00:00 GMT</pubDate></item><item><title>PHP 实现支持权重的 array_rand 方法</title><link>https://www.yankewei.site/posts/php-implementation-of-a-weighted-array_rand-method/</link><guid isPermaLink="true">https://www.yankewei.site/posts/php-implementation-of-a-weighted-array_rand-method/</guid><description>PHP 字段的 arrayrand 方法是从 array 中随机挑选一个并返回元素的 key。但是有时候 array 中的元素是有权重的，权重越大概率被随机到的概率也就越大。像 Python 就提供了一个 random.choices 的方法。网上搜到一个带权重的随机数生成，正好可以使用 PHP 来实现带权重的 arr...</description><pubDate>Thu, 15 May 2025 02:00:00 GMT</pubDate></item><item><title>Redis 驱动的 Laravel Job Release 实现原理</title><link>https://www.yankewei.site/posts/implementation-principle-of-laravel-job-release-driven-by-redis/</link><guid isPermaLink="true">https://www.yankewei.site/posts/implementation-principle-of-laravel-job-release-driven-by-redis/</guid><description>在 Laravel 中处理 job 时，可以使用 release 方法将 job 重新放回队列，并且可以自定义延迟时间。那么，这里有两个问题： 1.</description><pubDate>Wed, 15 Jan 2025 02:00:00 GMT</pubDate></item><item><title>Redis 简单动态字符串</title><link>https://www.yankewei.site/posts/redis-simple-dynamic-string/</link><guid isPermaLink="true">https://www.yankewei.site/posts/redis-simple-dynamic-string/</guid><description>Redis类型中有string的类型，比如我们用来做缓存的时候，经常会使用到string类型，这里就主要介绍一个Redis中string类型的实现，和C的字符串有什么区别。</description><pubDate>Sat, 10 Aug 2024 02:00:00 GMT</pubDate></item><item><title>Redis 数据持久化</title><link>https://www.yankewei.site/posts/redis-data-persistence/</link><guid isPermaLink="true">https://www.yankewei.site/posts/redis-data-persistence/</guid><description>我们知道Redis的数据是保存在内存里的，如果突然宕机，数据就会全部丢失，因此Redis必须要有一种持久化的机制来保证不会因为故障而丢失。有两个方式，一种是快照，以各种AOF日志。</description><pubDate>Sat, 20 Jul 2024 02:00:00 GMT</pubDate></item><item><title>PHP json_decode error: Control character error, possibly incorrectly encoded</title><link>https://www.yankewei.site/posts/php-json_decode-control-character-error/</link><guid isPermaLink="true">https://www.yankewei.site/posts/php-json_decode-control-character-error/</guid><description>PHP 在进行 json 解析的时候会有很多报错，如果解析失败，可以使用jsonlasterrormsg方法，它会返回一个解析失败的原因。原因之一就有一个JSONERRORCTRLCHAR，表示Control character error, possibly incorrectly encoded，提示有可能 JSO...</description><pubDate>Sat, 15 Jun 2024 02:00:00 GMT</pubDate></item></channel></rss>