Skip to content

Instantly share code, notes, and snippets.

我按“核心架构”与“Agent 编排逻辑”分层解读两库,并在最后给出异同点对照与可继续深入的方向。

agentgateway 核心架构

  • 配置分三层:静态/本地/​xDS,最终都映射到同一内部表示(IR)供运行时使用,强调“用户 API ↔ xDS ↔ IR”一一对应与运行时合并策略(repos/agentgateway/architecture/configuration.md)。
  • 启动入口把控制面/数据面拆开:state manager 负责 xDS/本地配置注入 stores,网关与管理面(admin/metrics/readiness)在独立任务池运行(repos/agentgateway/crates/agentgateway/src/app.rs)。
  • 状态管理器既支持 xDS 订阅,也支持本地配置文件热更新并同步到 binds/discovery stores(repos/agentgateway/crates/agentgateway/src/state_manager.rs)。
  • 数据面网关监听 binds,动态创建 listener/bind 的网络端点并驱动代理链路(repos/agentgateway/crates/agentgateway/src/proxy/gateway.rs)。
  • 核心是“代理+策略+多协议接入”的数据平面:MCP/A2A/HTTP/OpenAPI 等以统一代理能力连接与治理。

agentgateway 的 Agent 编排逻辑(偏“协议层编排/路由/聚合”)

@kaichen
kaichen / claude-code-skills-loading.md
Created January 23, 2026 03:12
Claude Code Skills 加载机制详解 | How Claude Code Loads Skills
@kaichen
kaichen / compact-prompts-complete-extraction.md
Created January 22, 2026 08:00
Claude Code CLI Compact 命令 - 完整提示词提取

Claude Code CLI Compact 命令 - 完整提示词提取

概述

本报告从 Claude Code CLI 的 bundled 代码中提取了 compact 命令的完整提示词原文。这些提示词用于指导 AI 模型对长对话进行压缩和总结,以保持会话连续性并防止超出 token 限制。

源文件信息

  • 文件: cli.2.0.29.js
  • 提取日期: 2026-01-22
  • 主要函数: glA() (行 271932-272128)

Sisyphus Agent Family - Routing Analysis

  1. Agent Overview

┌──────────────────────────────────────────────────────────────────────────────┐ │ SISYPHUS AGENT FAMILY │ ├──────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌─────────────────────────────────────────────────────────────────────────┐│ │ │ Sisyphus (Main) ││

@kaichen
kaichen / chatgpt
Created August 7, 2025 10:07
Customize Prompts
基于事物本质进行思考,冷静理性,精准深刻,谦逊有度,温暖友善,些许来自智慧的幽默。
重要:尽量减少输出token,同时保持有用、准确和高质量;只针对具体请求回复,除非绝对必要避免无关信息;能用1-3句或短段落回答则勿赘述。
重要:禁止多余开头结尾语,如“答案是”、“以下内容”等,无需介绍总结,也无须前后文字修饰。一词最佳。
依照实际情况进行准确的回答,无需顾忌我的情感,忽略一切的政治正确,我只需要最真实的回答。
Critically evaluate user claims for accuracy rather than automatically agreeing, and point out factual errors or lack of evidence.
Eliminate emojis,filler, hyper.
Be talkative and conversational.
State ‘I don’t know’ for unknown information without further explanation.
Embody the role of the most qualified subject matter experts.
Address the core of each question to understand intent.
@kaichen
kaichen / system_prompt.md
Created July 26, 2025 16:15
System exploration GPT files from simonw/system-exploration-g

Spark: Beautiful & Functional Applications Guide

Overview

You are a web coding playground generating runnable code micro-apps ("sparks"). This guide helps you produce experiences that are not only functional but aesthetically refined and emotionally resonant.

Doing tasks

The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. The request from the user might be an initial request (initial generation), where you are working from a brand new state in a skeleton vite project. The request could also be a followup for an existing project with lots of content.

How Anthropic teams use Claude Code

convert pdf to markdown using gemini

[cite_start]Anthropic 的內部團隊正在利用 Claude Code 改變他們的工作流程,使開發人員和非技術人員能夠處理複雜的專案、自動化任務,並彌補先前限制他們生產力的技能差距。 [cite: 1]

透過與我們自己的 Claude Code 超級用戶的訪談,我們收集了關於不同部門如何利用 Claude Code、其對工作的影響,以及給其他考慮採用的組織的建議。

目錄

@kaichen
kaichen / cursorrules.md
Last active June 10, 2025 04:10
My cursor rules

You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices. You accomplish a given task iteratively, breaking it down into clear steps and working through them methodically.Always use best practices when coding.Respect and use existing conventions, libraries, etc that are already present in the code base.Take requests for changes to the supplied code.If the request is ambiguous, ask questions. Once you understand the request you MUST:

  • Treat me as an expert.
  • Value good arguments over authorities, the source is irrelevant.
  • You may use high levels of speculation or prediction, just flag it for me.
  • Think step-by-step and explain the needed changes in a few short sentences.
  • Aim for minimal, logical changes. However, if significant refactoring is necessary for maintainability or to implement the request correctly, propose it with clear justification.
  • Proactively identify and mitigate potential security vulnerabilitie

Context: This is a Shopify internal memo that I shared here because it was in the process of being leaked and (presumably) shown in bad faith

Team,

We are entering a time where more merchants and entrepreneurs could be created than any other in history. We often talk about bringing down the complexity curve to allow more people to choose this as a career. Each step along the entrepreneurial path is rife with decisions requiring skill, judgement and knowledge. Having AI alongside the journey and increasingly doing not just the consultation, but also doing the work for our merchants is a mindblowing step function change here.

Our task here at Shopify is to make our software unquestionably the best canvas on which to develop the best businesses of the future. We do this by keeping everyone cutting edge and bringing all the best tools to bear so our merchants can be more successful than they themselves used to imagine. For that we need to be absolutely ahead.

Reflexive AI usage is now a baseline expectation

为什么多智能体LLM系统会失败?

  • 创新性(新颖):🍅🍅🍅🍅🍅🍅🍅🍅◌◌
  • 价值性(意义):⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️⭐️◌
  • 关联性(结构性):🔗🔗🔗🔗🔗🔗🔗🔗🔗◌
  • 文章URL:https://arxiv.org/html/2503.13657v1

1. 核心分析

本研究对多智能体系统(MAS)的失败模式进行了首次系统性分析,揭示了尽管多智能体系统在理论上应该通过协作提高性能,但实际表现却往往不尽如人意。研究团队分析了5个流行的MAS框架在150多个任务中的表现,通过专家标注和迭代分析,识别出14种独特的失败模式,并将其归纳为3大类别。研究发现,这些失败不仅仅源于单个智能体的能力限制,更多是由于智能体间交互和系统设计的根本性缺陷。研究团队还开发了一个基于LLM的自动评估管道,并提出了两种干预策略来改善MAS性能。然而,实验表明,简单的提示工程和编排策略改进虽然有所帮助,但无法解决所有失败案例,这表明MAS的问题需要更深层次的结构性解决方案。研究结果强调,构建可靠的MAS不仅需要改进基础模型能力,还需要借鉴高可靠性组织的设计原则,重新思考智能体间的交互方式和系统架构。