Skip to content

Instantly share code, notes, and snippets.

/**
* 微信公众号「发表记录」全量抓取脚本
*
* 思路:
* 后端区分 navigation 请求和 fetch 请求,fetch 拿到 SPA 骨架,只有真正
* navigate 才拿得到含数据的 HTML。所以用隐藏 iframe 模拟 navigation,
* 等渲染完从 contentDocument 拿数据,iframe 立即销毁。
* 主页面的 console / JS 上下文全程存活。
*
* 用法:

我按“核心架构”与“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