Skip to content

Instantly share code, notes, and snippets.

View jerrylususu's full-sized avatar

Neko Null jerrylususu

View GitHub Profile

根据您提供的社区讨论,我深入分析了在大型 monorepo 中管理 AI 助手(Claude Code、Cursor、GitHub Copilot 等)配置与规则文件的核心挑战和最佳实践。以下是结构化的总结和建议。

核心挑战识别

  1. 上下文过载:AI 无法处理整个 monorepo 的代码(如 800 万行),导致建议不相关、速度慢或产生“幻觉”。
  2. 配置碎片化:不同工具(Claude Code, Cursor, Copilot)使用不同的配置文件(CLAUDE.md, .cursor/rules/, copilot-instructions.md, AGENTS.md),导致重复和维护困难。
  3. 发现与一致性:随着规则文件增多,人和 AI 都难以找到正确的指引,且难以保证跨模块的代码一致性(如设计模式、工具函数复用)。
  4. 团队协作:如何让多名开发者共享并维护一套统一的 AI 规则,避免每个人都有自己的“魔法咒语”。

最佳实践提炼(结构化方案)

Using LLMs to Analyze a Large C++ Codebase for Defects
Challenges in Large-Scale Code Scanning
Scanning a decade-old C++ codebase for subtle defects (like an upstream variable assignment in an exception branch causing downstream failures) is non-trivial. Large Language Models (LLMs) can understand code logic well when given the right context, but providing that context across a huge codebase is challenging
levelup.gitconnected.com
levelup.gitconnected.com
. A naive approach (e.g. dumping all code into a prompt) is impossible due to context length limits, and pure semantic search may miss critical flows. The key is to break down the analysis using structured techniques so the LLM sees the relevant call chains and data flows without hallucinating or overlooking dependencies. Recent studies and experiences indicate that combining static code structure with LLM reasoning is essential for accurate results
dev.to
siquick.com
.
Graph-Based Approaches (Call Graphs & Knowledge Graphs)
@jerrylususu
jerrylususu / chapter-1-thinking-styles.md
Created October 19, 2025 16:02
cursor new guide (glm4.6)

第1章:思维方式

你已经了解了 AI 的基础原理,现在让我们进入最重要的部分:如何调整你的思维方式来真正发挥 AI 助手的威力。

从传统编程到 AI 协作开发的转变,不仅仅是工具的更换,更是思维模式的革新。这一章将帮助你建立正确的"AI 心智模型"。

范式转变:从执行者到指挥者

传统开发中,你是代码的创造者和执行者。每一行代码、每一个逻辑决策都出自你的大脑。这种模式就像是自己动手做一顿饭——从买菜、洗菜、切菜到下锅,每一步都要亲力亲为。

https://github.blog/developer-skills/github/completing-urgent-fixes-anywhere-with-github-copilot-coding-agent-and-mobile/
 This included the core purpose of the repository, the tech stack used, architecture constraints, coding standards, testing strategy, dependency management, observability, documentation, error handling, and more.
 https://github.com/github/awesome-copilot
https://blog.cloudflare.com/introducing-react-why-we-built-an-elite-incident-response-team/
Vibe coding:向 AI 模型提供自然语言提示以生成代码的实践可能会产生关键漏洞,这些漏洞可以被利用者通过远程代码执行(RCE)、内存损坏和 SQL 注入等技术进行利用。
https://simonwillison.net/2025/Oct/7/vibe-engineering/#atom-everything
[
{
"id": 1754581181413,
"name": "播客中文总结",
"system": "你是一位有帮助的助手。",
"before": "我会发送给你一段播客转录,其中可能存在拼写错误,尽量理解即可。",
"after": "深入总结以上播客内容,简体中文输出。"
},
{
"id": 1754581181414,
@jerrylususu
jerrylususu / ts-matcher-playground.html
Created May 19, 2025 14:45
typescript matcher playground
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TypeScript Match Engine Playground</title>
<style>
body { font-family: sans-serif; display: flex; flex-direction: column; height: 100vh; margin: 0; }
.main-container { display: flex; flex: 1; overflow: hidden; } /* Changed from .container to .main-container */
import os
import json
import time
from datetime import datetime
from openai import OpenAI
import argparse
from typing import Dict, List, Any, Optional, Union, TypedDict, cast
from dataclasses import dataclass
@dataclass
@jerrylususu
jerrylususu / README.md
Created March 23, 2025 11:39
flask sse proxy

original: https://github.com/wujianguo/openai-proxy

  • flask_proxy_for_continue: 修复了硅基流动 reasoning_content 在 continue 插件不显示的问题;对于文本总结自动换用一个小模型
  • flask_proxy:original 的备份,改了目标地址为硅基流动

和 pyhttpdbg 一起用,可以观察app到底给大模型发送了什么

pyhttpdbg --script proxy.py

@jerrylususu
jerrylususu / createWithNestedDefaults.js
Created December 19, 2024 16:17
protobuf js magic
createWithNestedDefaults = (messageType) => {
const message = messageType.create();
console.log(message);
// 遍历消息的属性
for (const [key, field] of Object.entries(messageType.fields)) {
// 检查该属性是否是嵌套的消息类型
console.log(field)
@jerrylususu
jerrylususu / select_mermaid.js
Created September 26, 2024 14:36
Render Mermaid diagrams from selected text
// ==UserScript==
// @name Mermaid Diagram Renderer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Render Mermaid diagrams from selected text
// @author Claude
// @match *://*/*
// @require https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.14.0/mermaid.min.js
// @grant GM_addStyle
// ==/UserScript==