├── postcss.config.mjs
├── content
├── sources
│ ├── 99%.png
│ ├── tips-FradSer.md
│ ├── ui-visual-validator-agent_20250830.md
│ ├── INDEX.md
│ ├── you_are_not_right.sh
│ ├── Andrej Karpathy.md
│ ├── community-tips-code-simplifie.md
│ ├── cui-web-ui_2025-01-15.md
│ ├── best-practices-cal-rueb.md
│ └── you_are_not_right_2025-08-05.md
├── assets
│ └── claude-code-setup-tips
│ │ └── hero-image.jpg
└── docs
│ ├── zh
│ ├── cursor
│ │ ├── index.mdx
│ │ └── building-cursor-with-cursor.mdx
│ ├── sub-agents
│ │ └── index.mdx
│ ├── community-tips
│ │ ├── index.mdx
│ │ └── fradser-trust-init-command.mdx
│ ├── advanced
│ │ └── index.mdx
│ ├── tools
│ │ ├── index.mdx
│ │ ├── context-engineering.mdx
│ │ ├── cui-web-ui.mdx
│ │ └── claude-code-templates.mdx
│ ├── index.mdx
│ └── best-practices
│ │ ├── optimal-ai-development-workflow.mdx
│ │ ├── master-engineering-workflow-5x-productivity.mdx
│ │ ├── index.mdx
│ │ └── cal-rueb-claude-code-best-practices.mdx
│ ├── index.mdx
│ └── en
│ ├── cursor
│ └── index.mdx
│ ├── sub-agents
│ └── index.mdx
│ ├── community-tips
│ └── index.mdx
│ ├── advanced
│ └── index.mdx
│ └── tools
│ └── index.mdx
├── app
├── global.css
├── api
│ └── search
│ │ └── route.ts
├── (home)
│ └── layout.tsx
├── docs
│ ├── layout.tsx
│ └── [[...slug]]
│ │ └── page.tsx
├── layout.config.tsx
└── layout.tsx
├── public
└── images
│ ├── safe-yolo-mode.png
│ ├── claude-give-urls.png
│ ├── claude-give-images.png
│ ├── claude-mention-files.png
│ ├── onevcat-article
│ ├── mic.jpg
│ └── claude-welcome.jpg
│ ├── claude-git-interaction.png
│ ├── steipete-article
│ └── hero.png
│ ├── builder-claude-code
│ ├── image-1.png
│ └── image-2.png
│ ├── claude-code-analysis
│ ├── tools.png
│ ├── prompts.png
│ └── control_loop.gif
│ ├── claude-code-tool-allowlist.png
│ ├── claude-code-reverse-analysis
│ ├── 01-测试截图.png
│ ├── 03-解析工具.png
│ ├── 04-可视化界面.png
│ ├── 00-代码植入过程截图.png
│ ├── 02-日志文件生成.png
│ ├── 05-第一条对话截图.png
│ ├── 06-第二条对话截图.png
│ ├── 07-第三条对话截图.png
│ ├── 09-第四条对话截图.png
│ ├── 10-LS工具执行结果.png
│ ├── 11-第五条对话截图.png
│ ├── 13-最终结果截图.png
│ ├── 00-API拦截代码示例.png
│ ├── 12-第六第七条对话截图.png
│ └── 08-prompt_5详细内容.png
│ ├── optimal-ai-development-workflow
│ └── hero.png
│ ├── compounding-engineering
│ ├── monitor-setup-warp.png
│ └── automated-code-reviewer.jpeg
│ ├── claude-code-comprehensive-guide
│ ├── clear-context.jpg
│ ├── github-action.jpg
│ ├── compact-context.jpg
│ ├── cost-monitoring.jpg
│ ├── resume-history.jpg
│ ├── vs-code-plugin.jpg
│ ├── ccusage-monitoring.jpg
│ ├── image-placeholder.jpg
│ ├── interrupt-operation.jpg
│ └── claude-md-dynamic-add.jpg
│ ├── 99-percent-ai-development
│ └── michal-villnow-experiment.png
│ ├── diwank-article
│ ├── 5dd77e55-5b53-412a-a169-e61d88eff60a.png
│ ├── 8da4f924-0f2a-44c4-91f6-d285ace5e8a4.jpg
│ ├── 97c55ab9-c876-4018-841f-ee014757e908.webp
│ ├── a4c32be3-f91c-44e3-aebd-c65f50fbd379.png
│ ├── d84d1867-c2b4-4ef9-8904-b7c69cf12154.webp
│ ├── e482b99a-9e1e-4f5b-b968-0bf6255566d2.png
│ ├── e771b36e-bdb6-4c99-8949-0a3583bc6259.png
│ └── ede9227b-cd8d-4505-ba93-21c9c7fcb31a.png
│ ├── effective-context-engineering
│ ├── system-prompt-calibration.png
│ └── prompt-vs-context-engineering.png
│ └── six-weeks-of-claude-code
│ ├── README.md
│ ├── vscode-themes.svg
│ └── missing-link-puzzle.svg
├── lib
├── i18n.ts
├── source.ts
├── recent-posts.ts
└── changelog.ts
├── next.config.mjs
├── mdx-components.tsx
├── .gitignore
├── middleware.ts
├── source.config.ts
├── tsconfig.json
├── package.json
├── CHANGELOG_TEMPLATE.md
├── .backups
├── recent-posts-2025-08-24T22-06-53-398Z.ts
├── recent-posts-2025-08-25T07-41-00-874Z.ts
├── recent-posts-2025-08-31T22-56-59-669Z.ts
├── recent-posts-2025-09-17T11-23-32-304Z.ts
├── recent-posts-2025-08-30T12-27-32-815Z.ts
├── recent-posts-2025-08-24T11-49-47-091Z.ts
├── recent-posts-2025-08-24T20-07-17-756Z.ts
├── recent-posts-2025-08-30T12-49-21-770Z.ts
├── recent-posts-2025-08-24T14-51-38-531Z.ts
├── recent-posts-2025-08-26T22-40-20-039Z.ts
├── recent-posts-2025-08-27T08-58-19-866Z.ts
├── recent-posts-2025-08-25T10-06-10-966Z.ts
├── recent-posts-2025-09-17T19-23-33-591Z.ts
├── recent-posts-2025-08-30T12-41-50-984Z.ts
├── recent-posts-2025-08-30T12-49-12-676Z.ts
├── recent-posts-2025-09-30T19-15-46-416Z.ts
├── recent-posts-2025-08-31T22-56-11-811Z.ts
├── recent-posts-2025-08-31T22-56-59-717Z.ts
├── recent-posts-2025-08-24T22-06-53-453Z.ts
├── recent-posts-2025-08-24T20-07-17-809Z.ts
├── recent-posts-2025-08-24T10-50-10-191Z.ts
├── recent-posts-2025-08-25T10-06-11-017Z.ts
├── recent-posts-2025-08-24T11-49-47-141Z.ts
├── recent-posts-2025-08-31T22-56-06-041Z.ts
├── recent-posts-2025-08-25T07-41-00-940Z.ts
├── recent-posts-2025-08-27T08-58-19-926Z.ts
├── recent-posts-2025-08-24T14-51-38-581Z.ts
├── recent-posts-2025-08-26T22-40-20-096Z.ts
├── recent-posts-2025-09-17T11-23-32-349Z.ts
├── recent-posts-2025-09-17T19-23-33-633Z.ts
├── recent-posts-2025-08-30T12-27-36-266Z.ts
├── recent-posts-2025-08-30T12-41-51-032Z.ts
├── recent-posts-2025-09-30T19-15-49-464Z.ts
└── recent-posts-2025-08-24T10-50-10-136Z.ts
├── docs
├── recent-posts-management.md
└── CRITICAL_REQUIREMENTS_CHECKLIST.md
└── pm_docs
└── 0806_0131_fix.md
/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | '@tailwindcss/postcss': {},
4 | },
5 | };
6 |
--------------------------------------------------------------------------------
/content/sources/ 99%.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/content/sources/ 99%.png
--------------------------------------------------------------------------------
/app/global.css:
--------------------------------------------------------------------------------
1 | @import 'tailwindcss';
2 | @import 'fumadocs-ui/css/neutral.css';
3 | @import 'fumadocs-ui/css/preset.css';
4 |
--------------------------------------------------------------------------------
/public/images/safe-yolo-mode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/safe-yolo-mode.png
--------------------------------------------------------------------------------
/public/images/claude-give-urls.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-give-urls.png
--------------------------------------------------------------------------------
/public/images/claude-give-images.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-give-images.png
--------------------------------------------------------------------------------
/public/images/claude-mention-files.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-mention-files.png
--------------------------------------------------------------------------------
/public/images/onevcat-article/mic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/onevcat-article/mic.jpg
--------------------------------------------------------------------------------
/public/images/claude-git-interaction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-git-interaction.png
--------------------------------------------------------------------------------
/public/images/steipete-article/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/steipete-article/hero.png
--------------------------------------------------------------------------------
/public/images/builder-claude-code/image-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/builder-claude-code/image-1.png
--------------------------------------------------------------------------------
/public/images/builder-claude-code/image-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/builder-claude-code/image-2.png
--------------------------------------------------------------------------------
/public/images/claude-code-analysis/tools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-analysis/tools.png
--------------------------------------------------------------------------------
/public/images/claude-code-tool-allowlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-tool-allowlist.png
--------------------------------------------------------------------------------
/public/images/claude-code-analysis/prompts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-analysis/prompts.png
--------------------------------------------------------------------------------
/public/images/onevcat-article/claude-welcome.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/onevcat-article/claude-welcome.jpg
--------------------------------------------------------------------------------
/content/assets/claude-code-setup-tips/hero-image.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/content/assets/claude-code-setup-tips/hero-image.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-analysis/control_loop.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-analysis/control_loop.gif
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/01-测试截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/01-测试截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/03-解析工具.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/03-解析工具.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/04-可视化界面.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/04-可视化界面.png
--------------------------------------------------------------------------------
/public/images/optimal-ai-development-workflow/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/optimal-ai-development-workflow/hero.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/00-代码植入过程截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/00-代码植入过程截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/02-日志文件生成.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/02-日志文件生成.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/05-第一条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/05-第一条对话截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/06-第二条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/06-第二条对话截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/07-第三条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/07-第三条对话截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/09-第四条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/09-第四条对话截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/10-LS工具执行结果.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/10-LS工具执行结果.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/11-第五条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/11-第五条对话截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/13-最终结果截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/13-最终结果截图.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/00-API拦截代码示例.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/00-API拦截代码示例.png
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/12-第六第七条对话截图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/12-第六第七条对话截图.png
--------------------------------------------------------------------------------
/public/images/compounding-engineering/monitor-setup-warp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/compounding-engineering/monitor-setup-warp.png
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/clear-context.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/clear-context.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/github-action.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/github-action.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-reverse-analysis/08-prompt_5详细内容.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-reverse-analysis/08-prompt_5详细内容.png
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/compact-context.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/compact-context.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/cost-monitoring.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/cost-monitoring.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/resume-history.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/resume-history.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/vs-code-plugin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/vs-code-plugin.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/ccusage-monitoring.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/ccusage-monitoring.jpg
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/image-placeholder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/image-placeholder.jpg
--------------------------------------------------------------------------------
/public/images/compounding-engineering/automated-code-reviewer.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/compounding-engineering/automated-code-reviewer.jpeg
--------------------------------------------------------------------------------
/lib/i18n.ts:
--------------------------------------------------------------------------------
1 | import type { I18nConfig } from 'fumadocs-core/i18n';
2 |
3 | export const i18n: I18nConfig = {
4 | defaultLanguage: 'en',
5 | languages: ['en', 'zh'],
6 | hideLocale: 'default-locale',
7 | };
--------------------------------------------------------------------------------
/public/images/99-percent-ai-development/michal-villnow-experiment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/99-percent-ai-development/michal-villnow-experiment.png
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/interrupt-operation.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/interrupt-operation.jpg
--------------------------------------------------------------------------------
/public/images/diwank-article/5dd77e55-5b53-412a-a169-e61d88eff60a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/5dd77e55-5b53-412a-a169-e61d88eff60a.png
--------------------------------------------------------------------------------
/public/images/diwank-article/8da4f924-0f2a-44c4-91f6-d285ace5e8a4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/8da4f924-0f2a-44c4-91f6-d285ace5e8a4.jpg
--------------------------------------------------------------------------------
/public/images/diwank-article/97c55ab9-c876-4018-841f-ee014757e908.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/97c55ab9-c876-4018-841f-ee014757e908.webp
--------------------------------------------------------------------------------
/public/images/diwank-article/a4c32be3-f91c-44e3-aebd-c65f50fbd379.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/a4c32be3-f91c-44e3-aebd-c65f50fbd379.png
--------------------------------------------------------------------------------
/public/images/diwank-article/d84d1867-c2b4-4ef9-8904-b7c69cf12154.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/d84d1867-c2b4-4ef9-8904-b7c69cf12154.webp
--------------------------------------------------------------------------------
/public/images/diwank-article/e482b99a-9e1e-4f5b-b968-0bf6255566d2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/e482b99a-9e1e-4f5b-b968-0bf6255566d2.png
--------------------------------------------------------------------------------
/public/images/diwank-article/e771b36e-bdb6-4c99-8949-0a3583bc6259.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/e771b36e-bdb6-4c99-8949-0a3583bc6259.png
--------------------------------------------------------------------------------
/public/images/diwank-article/ede9227b-cd8d-4505-ba93-21c9c7fcb31a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/diwank-article/ede9227b-cd8d-4505-ba93-21c9c7fcb31a.png
--------------------------------------------------------------------------------
/public/images/claude-code-comprehensive-guide/claude-md-dynamic-add.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/claude-code-comprehensive-guide/claude-md-dynamic-add.jpg
--------------------------------------------------------------------------------
/public/images/effective-context-engineering/system-prompt-calibration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/effective-context-engineering/system-prompt-calibration.png
--------------------------------------------------------------------------------
/public/images/effective-context-engineering/prompt-vs-context-engineering.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foreveryh/claude-code-best-practices/HEAD/public/images/effective-context-engineering/prompt-vs-context-engineering.png
--------------------------------------------------------------------------------
/next.config.mjs:
--------------------------------------------------------------------------------
1 | import { createMDX } from 'fumadocs-mdx/next';
2 |
3 | const withMDX = createMDX();
4 |
5 | /** @type {import('next').NextConfig} */
6 | const config = {
7 | reactStrictMode: true,
8 | };
9 |
10 | export default withMDX(config);
11 |
--------------------------------------------------------------------------------
/app/api/search/route.ts:
--------------------------------------------------------------------------------
1 | import { source } from '@/lib/source';
2 | import { createFromSource } from 'fumadocs-core/search/server';
3 |
4 | export const { GET } = createFromSource(source, {
5 | // https://docs.orama.com/open-source/supported-languages
6 | language: 'english',
7 | });
8 |
--------------------------------------------------------------------------------
/app/(home)/layout.tsx:
--------------------------------------------------------------------------------
1 | import type { ReactNode } from 'react';
2 | import { HomeLayout } from 'fumadocs-ui/layouts/home';
3 | import { baseOptions } from '@/app/layout.config';
4 |
5 | export default function Layout({ children }: { children: ReactNode }) {
6 | return {children};
7 | }
8 |
--------------------------------------------------------------------------------
/mdx-components.tsx:
--------------------------------------------------------------------------------
1 | import defaultMdxComponents from 'fumadocs-ui/mdx';
2 | import type { MDXComponents } from 'mdx/types';
3 |
4 | // use this function to get MDX components, you will need it for rendering MDX
5 | export function getMDXComponents(components?: MDXComponents): MDXComponents {
6 | return {
7 | ...defaultMdxComponents,
8 | ...components,
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # deps
2 | /node_modules
3 |
4 | # generated content
5 | .contentlayer
6 | .content-collections
7 | .source
8 |
9 | # test & build
10 | /coverage
11 | /.next/
12 | /out/
13 | /build
14 | *.tsbuildinfo
15 |
16 | # misc
17 | .DS_Store
18 | *.pem
19 | /.pnp
20 | .pnp.js
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # others
26 | .env*.local
27 | .vercel
28 | next-env.d.ts
29 |
30 | /pm_docs
--------------------------------------------------------------------------------
/app/docs/layout.tsx:
--------------------------------------------------------------------------------
1 | import { DocsLayout } from 'fumadocs-ui/layouts/docs';
2 | import type { ReactNode } from 'react';
3 | import { baseOptions } from '@/app/layout.config';
4 | import { source } from '@/lib/source';
5 |
6 | export default function Layout({ children }: { children: ReactNode }) {
7 | return (
8 |
9 | {children}
10 |
11 | );
12 | }
13 |
--------------------------------------------------------------------------------
/public/images/six-weeks-of-claude-code/README.md:
--------------------------------------------------------------------------------
1 | # Six Weeks of Claude Code - 图片目录
2 |
3 | 这个目录包含来自 Puzzmo 博客文章 "6 Weeks of Claude Code" 的图片。
4 |
5 | ## 图片列表
6 |
7 | - `vscode-themes.png` - VS Code 不同主题的截图,展示双克隆开发环境
8 | - `missing-link-puzzle.png` - Missing Link 拼图游戏截图,展示单元格被打乱的状态
9 |
10 | ## 注意
11 |
12 | 由于无法直接访问原文图片,这些是占位符图片。原始图片可以在以下链接中找到:
13 | https://blog.puzzmo.com/posts/2025/07/30/six-weeks-of-claude-code/
14 |
15 |
16 |
--------------------------------------------------------------------------------
/middleware.ts:
--------------------------------------------------------------------------------
1 | import { createI18nMiddleware } from 'fumadocs-core/i18n';
2 | import { i18n } from './lib/i18n';
3 |
4 | // Temporarily disable middleware for testing
5 | export default function middleware() {
6 | return;
7 | }
8 |
9 | // export default createI18nMiddleware(i18n);
10 |
11 | export const config = {
12 | // Matcher ignoring `/_next/` and `/api/`
13 | // You may need to adjust it to ignore static assets in `/public` folder
14 | matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
15 | };
--------------------------------------------------------------------------------
/content/sources/tips-FradSer.md:
--------------------------------------------------------------------------------
1 | @FradSer
2 |
3 | ](https://x.com/FradSer)
4 |
5 | ·
6 |
7 | [12h](https://x.com/FradSer/status/1952205197784297646)
8 |
9 | 对比官方给的最佳实践,我的经验: 1. 永远相信 \`/init\` ,定期的使用 \`/init\` 让 [http://CLAUDE.md](https://t.co/KJRQh1Og26) 更新到最佳状态。重要功能在子文件夹创建 [http://CLAUDE.md](https://t.co/KJRQh1Og26) 。 2. 大胆一点,没有生成环境操作直接 \`claude --dangerously-skip-permissions\` 给全部权限。 3. git commit...commit...commit ,永远不要嫌多 4. git worktree 一定记得配合 git flow ,降低操作的心智负担 5. 多使用 esc,感觉方向不对及时调整。 6. sub agnet 至少有:Tech Lead 设计长期架构目标,尽量避免架构混乱。UX Reviewer 检查体验设计问题,最典型的结果是 Swift 项目大量优化 a11y 。Code Simplifier 避免代码过度膨胀,这个是第一顺位。
--------------------------------------------------------------------------------
/lib/source.ts:
--------------------------------------------------------------------------------
1 | import { docs } from '@/.source';
2 | import { loader } from 'fumadocs-core/source';
3 |
4 | // See https://fumadocs.vercel.app/docs/headless/source-api for more info
5 | export const source = loader({
6 | // it assigns a URL to your pages
7 | baseUrl: '/docs',
8 | source: docs.toFumadocsSource(),
9 | });
10 |
11 | // For proper i18n support, we use separate sources for different languages
12 | // This approach is more aligned with Fumadocs standards and Next.js App Router
13 | export const sourceZh = loader({
14 | baseUrl: '/docs/zh',
15 | source: docs.toFumadocsSource(),
16 | });
17 |
--------------------------------------------------------------------------------
/source.config.ts:
--------------------------------------------------------------------------------
1 | import {
2 | defineConfig,
3 | defineDocs,
4 | frontmatterSchema,
5 | metaSchema,
6 | } from 'fumadocs-mdx/config';
7 | import { z } from 'zod';
8 |
9 | // Define custom schema with language support
10 | const customFrontmatterSchema = frontmatterSchema.extend({
11 | // Add language field for content
12 | lang: z.enum(['en', 'zh']).optional(),
13 | });
14 |
15 | // Single docs configuration that supports multiple languages
16 | export const docs = defineDocs({
17 | dir: 'content/docs',
18 | docs: {
19 | schema: customFrontmatterSchema,
20 | },
21 | meta: {
22 | schema: metaSchema,
23 | },
24 | });
25 |
26 | export default defineConfig({
27 | mdxOptions: {
28 | // MDX options
29 | },
30 | });
31 |
--------------------------------------------------------------------------------
/content/docs/zh/cursor/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cursor
3 | description: 了解 Cursor IDE 及其与 ClaudeCode 的集成
4 | lang: zh
5 | ---
6 |
7 | # Cursor
8 |
9 | 欢迎来到 Cursor 专区!在这里您将找到关于 Cursor 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:Cursor 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
29 |
30 | ## 开始使用
31 |
32 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 Cursor。
33 |
34 | ## 贡献
35 |
36 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
37 |
38 | ---
39 |
40 | *探索这些文章,提升您的 Cursor 使用体验!*
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "target": "ESNext",
5 | "lib": ["dom", "dom.iterable", "esnext"],
6 | "allowJs": true,
7 | "skipLibCheck": true,
8 | "strict": true,
9 | "forceConsistentCasingInFileNames": true,
10 | "noEmit": true,
11 | "esModuleInterop": true,
12 | "module": "esnext",
13 | "moduleResolution": "bundler",
14 | "resolveJsonModule": true,
15 | "isolatedModules": true,
16 | "jsx": "preserve",
17 | "incremental": true,
18 | "paths": {
19 | "@/.source": ["./.source/index.ts"],
20 | "@/*": ["./*"]
21 | },
22 | "plugins": [
23 | {
24 | "name": "next"
25 | }
26 | ]
27 | },
28 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
29 | "exclude": ["node_modules"]
30 | }
31 |
--------------------------------------------------------------------------------
/content/docs/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 首页
3 | description: ClaudeCode 最佳实践、社区技巧和工具的综合指南
4 | lang: zh
5 | ---
6 |
7 | # 欢迎使用 ClaudeCode 文档
8 |
9 | 欢迎来到 ClaudeCode 的综合文档!这里是您获取最佳实践、社区分享技巧和有效智能编程工具的首选资源。
10 |
11 | ## 您可以在这里找到
12 |
13 |
14 |
19 |
24 |
29 |
30 |
31 | ## 关于 ClaudeCode
32 |
33 | ClaudeCode 是由 Anthropic 开发的智能编程命令行工具。它提供了一种灵活、可定制且安全的方式来将 Claude 集成到您的编程工作流程中。
34 |
35 | ## 快速开始
36 |
37 | 准备开始了吗?查看我们的[最佳实践指南](/docs/zh/best-practices/claude-code-best-practices),了解使用 ClaudeCode 的最有效模式。
38 |
39 | ---
40 |
41 | *本文档由 ClaudeCode 社区维护。欢迎贡献!*
42 |
--------------------------------------------------------------------------------
/content/docs/zh/sub-agents/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 子代理
3 | description: 了解子代理和专门的助手
4 | lang: zh
5 | ---
6 |
7 | # 子代理
8 |
9 | 欢迎来到 子代理 专区!在这里您将找到关于 子代理 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:子代理 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
33 |
34 |
35 | ## 开始使用
36 |
37 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 子代理。
38 |
39 | ## 贡献
40 |
41 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
42 |
43 | ---
44 |
45 | *探索这些文章,提升您的 子代理 使用体验!*
--------------------------------------------------------------------------------
/content/sources/ui-visual-validator-agent_20250830.md:
--------------------------------------------------------------------------------
1 | # UI Visual Validator Agent 社区分享
2 |
3 | ## 原始内容记录
4 |
5 | **发布时间**: 2025-08-30
6 | **作者**: cryptonerdcn
7 | **项目地址**: https://github.com/cryptonerdcn/UI-Visual-Validator-Agent
8 |
9 | ## 原始分享内容
10 |
11 | 忍不了了,写了人生中第一个 sub agent。
12 | 起因是最近的 Claude Code 过分智障,嘴硬心虚。让它改个UI,它扫一眼代码说"好了",截图一看,一塌糊涂。再让它自己改完截图验证,它还是说"好了"。但你拷问它说这TM能叫改好了的时候,它TMD的又能精准描述自己哪里改错了,然后下次继续再犯。
13 |
14 | 来回拉扯两小时后,顿悟了,得发动群众斗群众。
15 | 于是写了这个 agent,专治各种"我觉得我改好了"。它的原则很简单:默认失败,只认截图,不听辩解,通过严格的视觉分析来验证UI修改是否真的达成目标。
16 |
17 | 你以为这就完了?并没有。
18 | 现在 Claude Code 会说:"虽然没通过UI-Visual-Validator的验证,但从技术上看,该问题已经得到修正了。"
19 | 于是所以TMD你光用我这个agent还不行,你还得在你的Claude的md中写入TMD相应的规则,具体见agent的Repo Reamde里的说明。
20 |
21 | ## 技术要点
22 |
23 | 1. **核心原理**: 默认失败,只认截图,对抗性验证
24 | 2. **解决痛点**: Claude Code 在 UI 验证上的过度乐观和视觉幻觉问题
25 | 3. **工作机制**: 通过独立的验证代理形成制衡机制
26 | 4. **集成要求**: 需要在 CLAUDE.md 中添加强制规则
27 |
28 | ## 发布状态
29 |
30 | - ✅ 中文版本已发布: /docs/zh/sub-agents/ui-visual-validator-agent
31 | - ✅ 英文版本已发布: /docs/en/sub-agents/ui-visual-validator-agent
32 | - ✅ 已添加到最近文章列表
33 | - ✅ 已更新分类索引
--------------------------------------------------------------------------------
/content/docs/zh/community-tips/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 社区技巧
3 | description: 发现 ClaudeCode 社区分享的技巧和窍门
4 | lang: zh
5 | ---
6 |
7 | # 社区技巧
8 |
9 | 欢迎来到 社区技巧 专区!在这里您将找到关于 社区技巧 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:社区技巧 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
33 |
38 |
39 |
40 | ## 开始使用
41 |
42 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 社区技巧。
43 |
44 | ## 贡献
45 |
46 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
47 |
48 | ---
49 |
50 | *探索这些文章,提升您的 社区技巧 使用体验!*
--------------------------------------------------------------------------------
/content/docs/zh/advanced/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 高级
3 | description: ClaudeCode 的高级技术和概念
4 | lang: zh
5 | ---
6 |
7 | # 高级
8 |
9 | 欢迎来到 高级 专区!在这里您将找到关于 高级 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:高级 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
33 |
38 |
39 |
40 | ## 开始使用
41 |
42 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 高级。
43 |
44 | ## 贡献
45 |
46 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
47 |
48 | ---
49 |
50 | *探索这些文章,提升您的 高级 使用体验!*
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "deeptoai",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "build": "next build",
7 | "dev": "next dev --turbo",
8 | "start": "next start",
9 | "postinstall": "fumadocs-mdx",
10 | "update-indexes": "node scripts/update-indexes.js",
11 | "recent-posts": "node scripts/manage-recent-posts.js",
12 | "changelog": "node scripts/changelog.js",
13 | "publish-complete": "node scripts/publish-complete.js complete",
14 | "publish-dry": "node scripts/publish-complete.js complete --dry",
15 | "quick-add": "node scripts/publish-complete.js quick-add"
16 | },
17 | "dependencies": {
18 | "fumadocs-core": "15.6.8",
19 | "fumadocs-mdx": "11.7.3",
20 | "fumadocs-ui": "15.6.8",
21 | "gray-matter": "^4.0.3",
22 | "next": "15.4.5",
23 | "react": "^19.1.1",
24 | "react-dom": "^19.1.1"
25 | },
26 | "devDependencies": {
27 | "@tailwindcss/postcss": "^4.1.11",
28 | "@types/mdx": "^2.0.13",
29 | "@types/node": "24.1.0",
30 | "@types/react": "^19.1.9",
31 | "@types/react-dom": "^19.1.7",
32 | "postcss": "^8.5.6",
33 | "tailwindcss": "^4.1.11",
34 | "typescript": "^5.9.2"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/content/docs/en/cursor/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cursor
3 | description: Learn about Cursor IDE and its integration with ClaudeCode
4 | lang: en
5 | ---
6 |
7 | # Cursor
8 |
9 | Welcome to the Cursor section! Here you'll find valuable resources and guides about Cursor.
10 |
11 | ## What You'll Find Here
12 |
13 | This section contains:
14 |
15 | - **Practical Guides**: Detailed usage guides for Cursor
16 | - **Best Practices**: Proven best practices and techniques
17 | - **Case Studies**: Real-world application examples
18 | - **Advanced Tips**: Advanced techniques to improve efficiency
19 |
20 | ## Featured Articles
21 |
22 |
23 |
28 |
29 |
30 | ## Getting Started
31 |
32 | Whether you're a beginner or an experienced user, these articles will help you better understand and use Cursor.
33 |
34 | ## Contributing
35 |
36 | Have great content to share? We welcome community contributions! Please follow our contribution guidelines to help make this resource even better.
37 |
38 | ---
39 |
40 | *Explore these articles to enhance your Cursor experience!*
--------------------------------------------------------------------------------
/app/layout.config.tsx:
--------------------------------------------------------------------------------
1 | import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
2 |
3 | /**
4 | * Shared layout configurations
5 | *
6 | * you can customise layouts individually from:
7 | * Home Layout: app/(home)/layout.tsx
8 | * Docs Layout: app/docs/layout.tsx
9 | */
10 | export const baseOptions: BaseLayoutProps = {
11 | nav: {
12 | title: (
13 | <>
14 |
22 | Killer Code
23 | >
24 | ),
25 | },
26 | // see https://fumadocs.dev/docs/ui/navigation/links
27 | links: [
28 | {
29 | text: 'Best Practices',
30 | url: '/docs',
31 | },
32 | {
33 | text: 'Claude.md',
34 | url: 'https://claude.md',
35 | external: true,
36 | },
37 | {
38 | text: 'Cookbook',
39 | url: 'https://github.com/foreveryh/claude-code-cookbook',
40 | external: true,
41 | },
42 | {
43 | text: 'CCM Switch',
44 | url: 'https://github.com/foreveryh/claude-code-switch',
45 | external: true,
46 | },
47 | {
48 | text: 'ClaudeCode 101',
49 | url: 'https://www.anthropic.com/learn/build-with-claude',
50 | external: true,
51 | },
52 | {
53 | text: 'Author',
54 | url: 'https://x.com/Stephen4171127',
55 | external: true,
56 | },
57 | ],
58 | };
--------------------------------------------------------------------------------
/app/docs/[[...slug]]/page.tsx:
--------------------------------------------------------------------------------
1 | import { source } from '@/lib/source';
2 | import {
3 | DocsPage,
4 | DocsBody,
5 | DocsDescription,
6 | DocsTitle,
7 | } from 'fumadocs-ui/page';
8 | import { notFound } from 'next/navigation';
9 | import { createRelativeLink } from 'fumadocs-ui/mdx';
10 | import { getMDXComponents } from '@/mdx-components';
11 |
12 | export default async function Page(props: {
13 | params: Promise<{ slug?: string[] }>;
14 | }) {
15 | const params = await props.params;
16 | const page = source.getPage(params.slug);
17 | if (!page) notFound();
18 |
19 | const MDXContent = page.data.body;
20 |
21 | return (
22 |
23 | {page.data.title}
24 | {page.data.description}
25 |
26 |
32 |
33 |
34 | );
35 | }
36 |
37 | export async function generateStaticParams() {
38 | return source.generateParams();
39 | }
40 |
41 | export async function generateMetadata(props: {
42 | params: Promise<{ slug?: string[] }>;
43 | }) {
44 | const params = await props.params;
45 | const page = source.getPage(params.slug);
46 | if (!page) notFound();
47 |
48 | return {
49 | title: page.data.title,
50 | description: page.data.description,
51 | };
52 | }
53 |
--------------------------------------------------------------------------------
/app/layout.tsx:
--------------------------------------------------------------------------------
1 | import '@/app/global.css';
2 | import { RootProvider } from 'fumadocs-ui/provider';
3 | import { Inter } from 'next/font/google';
4 | import type { ReactNode } from 'react';
5 | import type { Metadata } from 'next';
6 |
7 | const inter = Inter({
8 | subsets: ['latin'],
9 | });
10 |
11 | export const metadata: Metadata = {
12 | title: {
13 | default: 'Killer Code - AI-Powered Programming Revolution',
14 | template: '%s | Killer Code'
15 | },
16 | description: '我学了一辈子的技能,被屠杀了,claude code 已经是远超人类 99% 程序员的编程能力了。Learn the killer techniques of AI-assisted programming with Claude Code.',
17 | keywords: 'Claude Code, AI Programming, Vibe Coding, AI Development, Programming Tools, Anthropic, Code Generation',
18 | authors: [{ name: 'Killer Code Team' }],
19 | creator: 'Killer Code',
20 | publisher: 'Killer Code',
21 | robots: 'index, follow',
22 | openGraph: {
23 | title: 'Killer Code - AI-Powered Programming Revolution',
24 | description: '我学了一辈子的技能,被屠杀了,claude code 已经是远超人类 99% 程序员的编程能力了。Learn the killer techniques of AI-assisted programming.',
25 | type: 'website',
26 | locale: 'en_US',
27 | siteName: 'Killer Code',
28 | },
29 | twitter: {
30 | card: 'summary_large_image',
31 | title: 'Killer Code - AI-Powered Programming Revolution',
32 | description: '我学了一辈子的技能,被屠杀了,claude code 已经是远超人类 99% 程序员的编程能力了。Learn the killer techniques of AI-assisted programming.',
33 | },
34 | };
35 |
36 | export default function Layout({ children }: { children: ReactNode }) {
37 | return (
38 |
39 |
40 | {children}
41 |
42 |
43 | );
44 | }
45 |
--------------------------------------------------------------------------------
/content/docs/en/sub-agents/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Sub Agents
3 | description: Learn about sub-agents and specialized assistants
4 | lang: en
5 | ---
6 |
7 | # Sub Agents
8 |
9 | Welcome to the Sub Agents section! Here you'll find valuable resources and guides about Sub Agents.
10 |
11 | ## What You'll Find Here
12 |
13 | This section contains:
14 |
15 | - **Practical Guides**: Detailed usage guides for Sub Agents
16 | - **Best Practices**: Proven best practices and techniques
17 | - **Case Studies**: Real-world application examples
18 | - **Advanced Tips**: Advanced techniques to improve efficiency
19 |
20 | ## Featured Articles
21 |
22 |
23 |
28 |
33 |
34 |
35 | ## Getting Started
36 |
37 | Whether you're a beginner or an experienced user, these articles will help you better understand and use Sub Agents.
38 |
39 | ## Contributing
40 |
41 | Have great content to share? We welcome community contributions! Please follow our contribution guidelines to help make this resource even better.
42 |
43 | ---
44 |
45 | *Explore these articles to enhance your Sub Agents experience!*
--------------------------------------------------------------------------------
/content/docs/en/community-tips/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Community Tips
3 | description: Discover tips and tricks shared by the ClaudeCode community
4 | lang: en
5 | ---
6 |
7 | # Community Tips
8 |
9 | Welcome to the Community Tips section! Here you'll find valuable resources and guides about Community Tips.
10 |
11 | ## What You'll Find Here
12 |
13 | This section contains:
14 |
15 | - **Practical Guides**: Detailed usage guides for Community Tips
16 | - **Best Practices**: Proven best practices and techniques
17 | - **Case Studies**: Real-world application examples
18 | - **Advanced Tips**: Advanced techniques to improve efficiency
19 |
20 | ## Featured Articles
21 |
22 |
23 |
28 |
33 |
38 |
39 |
40 | ## Getting Started
41 |
42 | Whether you're a beginner or an experienced user, these articles will help you better understand and use Community Tips.
43 |
44 | ## Contributing
45 |
46 | Have great content to share? We welcome community contributions! Please follow our contribution guidelines to help make this resource even better.
47 |
48 | ---
49 |
50 | *Explore these articles to enhance your Community Tips experience!*
--------------------------------------------------------------------------------
/content/sources/INDEX.md:
--------------------------------------------------------------------------------
1 | # 原文库索引
2 |
3 | 本文档记录所有收集的原始资料,便于后续定位和使用。
4 |
5 | ## 索引格式说明
6 |
7 | 每条记录包含以下信息:
8 | - **原文标题**:文章的标题
9 | - **原文URL**:原始链接
10 | - **抓取日期**:获取原文的日期
11 | - **主题分类**:文章所属的主题类别
12 | - **相关文档页面**:基于该原文创建的文档页面链接
13 | - **简短描述**:文章的简要说明
14 | - **发布状态**:是否已发布到 content/docs 中
15 |
16 | ---
17 |
18 | ## 原文记录
19 |
20 | ### 1. Claude Code: Best practices for agentic coding
21 |
22 | - **原文标题**:Claude Code: Best practices for agentic coding
23 | - **原文URL**:https://www.anthropic.com/engineering/claude-code-best-practices
24 | - **抓取日期**:2025-08-04
25 | - **主题分类**:最佳实践
26 | - **相关文档页面**:`/docs/en/best-practices/claude-code-best-practices`
27 | - **简短描述**:Anthropic 官方发布的 Claude Code 最佳实践指南,涵盖设置、工作流程、优化等方面
28 | - **发布状态**:✅ 已发布(需要使用完整原文重新更新)
29 | - **原文文件**:`claude-code-best-practices-for-agentic-coding_2025-08-04.md`
30 |
31 | ---
32 |
33 | ### 2. 6 Weeks of Claude Code
34 |
35 | - **原文标题**:6 Weeks of Claude Code
36 | - **原文URL**:https://blog.puzzmo.com/posts/2025/07/30/six-weeks-of-claude-code/
37 | - **抓取日期**:2025-01-15
38 | - **主题分类**:最佳实践
39 | - **相关文档页面**:`/docs/en/best-practices/six-weeks-of-claude-code`、`/docs/zh/best-practices/six-weeks-of-claude-code`
40 | - **简短描述**:Puzzmo 工程师 Orta Therox 使用 Claude Code 六周后的回顾与思考,涵盖维护改进、工作流程变化和真实项目示例
41 | - **发布状态**:✅ 已发布(中英文双语版本)
42 | - **原文文件**:`six-weeks-of-claude-code_2025-07-30.md`
43 |
44 | ---
45 |
46 | ### 3. My Current AI Dev Workflow
47 |
48 | - **原文标题**:My Current AI Dev Workflow
49 | - **原文URL**:https://steipete.me/posts/2025/optimal-ai-development-workflow
50 | - **抓取日期**:2025-09-01
51 | - **主题分类**:最佳实践
52 | - **相关文档页面**:`/docs/en/best-practices/optimal-ai-development-workflow`、`/docs/zh/best-practices/optimal-ai-development-workflow`
53 | - **简短描述**:Peter Steinberger 分享的最新 AI 开发工作流,使用 Ghostty + Claude Code + 极简工具实现最大生产力
54 | - **发布状态**:✅ 已发布(中英文双语版本)
55 | - **原文文件**:`optimal-ai-development-workflow_20250901.md`
56 |
57 | ---
58 |
59 | ## 统计信息
60 |
61 | - **总计原文数量**:3
62 | - **已发布文档数量**:3
63 | - **待发布文档数量**:0
64 |
65 | *最后更新:2025-09-01*
66 |
--------------------------------------------------------------------------------
/public/images/six-weeks-of-claude-code/vscode-themes.svg:
--------------------------------------------------------------------------------
1 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/CHANGELOG_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # Changelog Entry Template
2 |
3 | Use this template when manually adding entries to the changelog, or use the automated script:
4 |
5 | ```bash
6 | npm run changelog add
7 | ```
8 |
9 | ## Manual Entry Template
10 |
11 | ```markdown
12 | ## [YYYY-MM-DD] - Article Title
13 |
14 | ### Added
15 | - **[category]** New article/tutorial/guide: "Article Title"
16 | - Source: https://original-url.com
17 | - Author: Original Author Name
18 | - Languages: EN/ZH
19 | - Type: Article/Tutorial/Guide/Review/Analysis
20 | - Description: Brief description of the content
21 | - Files:
22 | - EN: `/content/docs/en/category/slug.mdx`
23 | - ZH: `/content/docs/zh/category/slug.mdx`
24 | - Source: `/content/sources/source-file.md`
25 | - Images: `/public/images/folder/` (if applicable)
26 | ```
27 |
28 | ## Categories
29 |
30 | - `best-practices` - Claude Code and AI coding best practices
31 | - `community-tips` - Community-contributed tips and tricks
32 | - `cursor` - Cursor IDE related content
33 | - `sub-agents` - Sub-agent implementations and patterns
34 | - `tools` - Development tools and utilities
35 | - `advanced` - Advanced techniques and patterns
36 |
37 | ## Types
38 |
39 | - `Article` - General articles and blog posts
40 | - `Tutorial` - Step-by-step guides
41 | - `Guide` - Comprehensive guides and documentation
42 | - `Review` - Product or tool reviews
43 | - `Analysis` - In-depth analysis and research
44 |
45 | ## Workflow After Adding Entry
46 |
47 | 1. Create the content files at specified paths
48 | 2. Add to recent posts: `npm run recent-posts add `
49 | 3. Update indexes: `npm run update-indexes`
50 | 4. Verify all links work correctly
51 |
52 | ## Quick Commands
53 |
54 | ```bash
55 | # Add new changelog entry (interactive)
56 | npm run changelog add
57 |
58 | # View changelog statistics
59 | npm run changelog stats
60 |
61 | # Add to recent posts
62 | npm run recent-posts add /docs/en/category/slug en
63 | npm run recent-posts add /docs/zh/category/slug zh
64 |
65 | # Update all indexes
66 | npm run update-indexes
67 |
68 | # List recent posts
69 | npm run recent-posts list
70 |
71 | # Remove from recent posts
72 | npm run recent-posts remove slug
73 | ```
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T22-06-53-398Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "复合式工程:构建自我改进的开发系统",
7 | description: "学习如何构建随着每次迭代变得更快、更安全、更优秀的开发系统。将你的工程工作流程从短期收益转变为永久改进。",
8 | date: "2025-01-24",
9 | category: "advanced",
10 | language: "zh",
11 | slug: "zh/advanced/compounding-engineering",
12 | url: "/docs/zh/advanced/compounding-engineering"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/content/docs/en/advanced/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Advanced
3 | description: Advanced techniques and concepts for ClaudeCode
4 | lang: en
5 | ---
6 |
7 | # Advanced
8 |
9 | Welcome to the Advanced section! Here you'll find valuable resources and guides about Advanced.
10 |
11 | ## What You'll Find Here
12 |
13 | This section contains:
14 |
15 | - **Practical Guides**: Detailed usage guides for Advanced
16 | - **Best Practices**: Proven best practices and techniques
17 | - **Case Studies**: Real-world application examples
18 | - **Advanced Tips**: Advanced techniques to improve efficiency
19 |
20 | ## Featured Articles
21 |
22 |
23 |
28 |
33 |
38 |
39 |
40 | ## Getting Started
41 |
42 | Whether you're a beginner or an experienced user, these articles will help you better understand and use Advanced.
43 |
44 | ## Contributing
45 |
46 | Have great content to share? We welcome community contributions! Please follow our contribution guidelines to help make this resource even better.
47 |
48 | ---
49 |
50 | *Explore these articles to enhance your Advanced experience!*
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-25T07-41-00-874Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "掌握 Claude Code 的 33 个必知设置技巧",
7 | description: "通过 33 个基础到高级的技巧全面掌握 Claude Code,涵盖快捷键、提示技巧、MCP 服务器、项目规则和自动化钩子。从新手到专家级生产力的完整指南。",
8 | date: "2025-08-11",
9 | category: "advanced",
10 | language: "zh",
11 | slug: "zh/advanced/claude-code-setup-tips",
12 | url: "/docs/zh/advanced/claude-code-setup-tips"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-31T22-56-59-669Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "我当前的 AI 开发工作流",
7 | description: "Peter Steinberger 使用 Ghostty、Claude Code 和极简工具链优化的 AI 开发工作流,实现最大生产力",
8 | date: "2025-08-25",
9 | category: "general",
10 | language: "zh",
11 | slug: "zh/best-practices/optimal-ai-development-workflow",
12 | url: "/docs/zh/best-practices/optimal-ai-development-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-17T11-23-32-304Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "我当前的 AI 开发工作流",
7 | description: "Peter Steinberger 使用 Ghostty、Claude Code 和极简工具链优化的 AI 开发工作流,实现最大生产力",
8 | date: "2025-08-25",
9 | category: "general",
10 | language: "zh",
11 | slug: "zh/best-practices/optimal-ai-development-workflow",
12 | url: "/docs/zh/best-practices/optimal-ai-development-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-27-32-815Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "把随机对话变成可复现的产线:Claude Code 高阶实战指南",
7 | description: "将混乱的 AI 辅助开发转化为结构化的文档先行、差异驱动工作流,通过系统化规划和执行实现可预测的结果。",
8 | date: "2025-08-27",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/claude-code-production-workflow",
12 | url: "/docs/zh/best-practices/claude-code-production-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T11-49-47-091Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Happy:Claude Code 的移动端和网页客户端",
7 | description: "一个全面的移动端和网页客户端,为您的手机带来具备端到端加密、语音控制和多会话支持的 Claude Code。让您在任何地方都能使用 Claude Code,无需改变工作流程。",
8 | date: "2024-08-24",
9 | category: "tools",
10 | language: "zh",
11 | slug: "zh/tools/happy-mobile-claude-code-client",
12 | url: "/docs/zh/tools/happy-mobile-claude-code-client"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T20-07-17-756Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "揭秘 Claude Code 为何如此出色:深度分析",
7 | description: "基于拦截日志和数月使用经验,深入分析 Claude Code 成为最令人愉悦的 AI 编程代理的原因。学习架构决策、提示工程技术和工具设计原则,应用到您自己的 LLM 代理中。",
8 | date: "2024-08-24",
9 | category: "advanced",
10 | language: "zh",
11 | slug: "zh/advanced/decoding-claude-code-analysis",
12 | url: "/docs/zh/advanced/decoding-claude-code-analysis"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-49-21-770Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "忍无可忍写了人生中第一个 Sub Agent:UI Visual Validator",
7 | description: "面对 Claude Code 在 UI 修改验证上的自欺欺人问题,我开发了这个严格的视觉验证代理——默认失败,只认截图,专治各种我觉得我改好了的情况。",
8 | date: "2025-08-30",
9 | category: "sub-agents",
10 | language: "zh",
11 | slug: "zh/sub-agents/ui-visual-validator-agent",
12 | url: "/docs/zh/sub-agents/ui-visual-validator-agent"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T14-51-38-531Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "CCPM:Claude Code 项目管理器",
7 | description: "一个革命性的 Claude Code 项目管理系统,使用 GitHub Issues 和 Git worktrees 实现并行代理执行。将 PRD 转化为已发布的代码,具备完整的可追溯性和前所未有的开发速度。",
8 | date: "2024-08-24",
9 | category: "tools",
10 | language: "zh",
11 | slug: "zh/tools/ccpm-claude-code-project-manager",
12 | url: "/docs/zh/tools/ccpm-claude-code-project-manager"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-26T22-40-20-039Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "在 Claude Code 中创建 Gemini CLI 驱动的子代理:完整教程",
7 | description: "学习如何创建一个专门的子代理,利用 Gemini 的 100万 token 上下文窗口进行大规模代码库分析,同时保持在 Claude Code 的工作流程中。",
8 | date: "2025-01-25",
9 | category: "sub-agents",
10 | language: "zh",
11 | slug: "zh/sub-agents/gemini-cli-subagent-tutorial",
12 | url: "/docs/zh/sub-agents/gemini-cli-subagent-tutorial"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-27T08-58-19-866Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "99.9% AI 驱动开发:全面实施指南",
7 | description: "通过系统化实践、先进工具和经过验证的架构模式,学习如何实现近乎完全的 AI 开发自动化,从而实现快速、高质量的代码交付。",
8 | date: "2025-01-27",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/99-percent-ai-development-comprehensive-guide",
12 | url: "/docs/zh/best-practices/99-percent-ai-development-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-25T10-06-10-966Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Andrej Karpathy 谈 LLM 辅助编程的演进:哲学与实践的融合",
7 | description: "AI 传奇人物 Andrej Karpathy 对多层次 LLM 编程工作流的深度洞察,结合实用的 Claude Code 技巧和策略,探索最佳 AI 辅助开发方案。",
8 | date: "2025-01-24",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/karpathy-llm-coding-evolution",
12 | url: "/docs/zh/best-practices/karpathy-llm-coding-evolution"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-17T19-23-33-591Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "掌握 Vibe Coding:AI 驱动开发的完整指南",
7 | description: "为软件开发者提供的完整战略框架,最大化 AI 工具价值。学习基础思维模式、项目规划、实施工作流程和专业 AI 辅助开发的高级技巧。",
8 | date: "2025-01-17",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/yc-vibe-coding-mastering-ai-driven-development",
12 | url: "/docs/zh/best-practices/yc-vibe-coding-mastering-ai-driven-development"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-41-50-984Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Claude Code 用法全面拆解!26 项核心功能 + 实战技巧(建议收藏!)",
7 | description: "Claude Code 简直强到离谱!这段时间系统梳理了 26 个关键功能,从基础指令到上下文压缩、从代码辅助到 GitHub 自动化,很多用法都超出了 AI 写代码的传统理解。",
8 | date: "2025-01-20",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/claude-code-comprehensive-guide",
12 | url: "/docs/zh/best-practices/claude-code-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-49-12-676Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Claude Code 用法全面拆解!26 项核心功能 + 实战技巧(建议收藏!)",
7 | description: "Claude Code 简直强到离谱!这段时间系统梳理了 26 个关键功能,从基础指令到上下文压缩、从代码辅助到 GitHub 自动化,很多用法都超出了 AI 写代码的传统理解。",
8 | date: "2025-01-20",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/claude-code-comprehensive-guide",
12 | url: "/docs/zh/best-practices/claude-code-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-30T19-15-46-416Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "使用 Claude Code 自动化文档:构建基于 Docusaurus Agent 的自更新文档系统",
7 | description: "学习如何使用 Claude Code 和 Docusaurus 构建自动化文档系统。设置文档代理分析代码变更,自动更新项目文档,并与 CI/CD 工作流程集成。",
8 | date: "2025-09-17",
9 | category: "tools",
10 | language: "zh",
11 | slug: "zh/tools/automated-documentation-claude-code-docusaurus",
12 | url: "/docs/zh/tools/automated-documentation-claude-code-docusaurus"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/lib/recent-posts.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "AI 代理的有效上下文工程",
7 | description: "上下文工程的全面指南——从提示工程到管理可用于 LLM 的整体状态,以构建可控、高效的代理。学习优化上下文窗口、管理注意力预算和设计高效代理架构的策略。",
8 | date: "Tue Sep 30 2025 02:00:00 GMT+0200 (Central European Summer Time)",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/effective-context-engineering-for-ai-agents",
12 | url: "/docs/zh/best-practices/effective-context-engineering-for-ai-agents"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-31T22-56-11-811Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "My Current AI Dev Workflow",
7 | description: "Peter Steinberger's optimized AI development workflow using Ghostty, Claude Code, and minimal tooling for maximum productivity",
8 | date: "2025-08-25",
9 | category: "general",
10 | language: "en",
11 | slug: "en/best-practices/optimal-ai-development-workflow",
12 | url: "/docs/en/best-practices/optimal-ai-development-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-31T22-56-59-717Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "My Current AI Dev Workflow",
7 | description: "Peter Steinberger's optimized AI development workflow using Ghostty, Claude Code, and minimal tooling for maximum productivity",
8 | date: "2025-08-25",
9 | category: "general",
10 | language: "en",
11 | slug: "en/best-practices/optimal-ai-development-workflow",
12 | url: "/docs/en/best-practices/optimal-ai-development-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T22-06-53-453Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "33 Claude Code Setup Tips You NEED to Know",
7 | description: "Master Claude Code with 33 essential tips covering shortcuts, prompting techniques, MCP servers, project rules, and automation hooks. Transform from beginner to expert level productivity.",
8 | date: "2025-08-11",
9 | category: "advanced",
10 | language: "en",
11 | slug: "en/advanced/claude-code-setup-tips",
12 | url: "/docs/en/advanced/claude-code-setup-tips"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T20-07-17-809Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Compounding Engineering: Building Self-Improving Development Systems",
7 | description: "Learn how to build development systems that get faster, safer, and better with each iteration. Transform your engineering workflow from short-term gains to permanent improvements.",
8 | date: "2025-01-24",
9 | category: "advanced",
10 | language: "en",
11 | slug: "en/advanced/compounding-engineering",
12 | url: "/docs/en/advanced/compounding-engineering"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T10-50-10-191Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Happy: Mobile and Web Client for Claude Code",
7 | description: "A comprehensive mobile and web client that brings Claude Code to your phone with end-to-end encryption, voice control, and multi-session support. Use Claude Code from anywhere with zero workflow disruption.",
8 | date: "2024-08-24",
9 | category: "tools",
10 | language: "en",
11 | slug: "en/tools/happy-mobile-claude-code-client",
12 | url: "/docs/en/tools/happy-mobile-claude-code-client"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-25T10-06-11-017Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Create a Gemini CLI Powered Subagent in Claude Code: Complete Tutorial",
7 | description: "Learn how to create a specialized subagent that leverages Gemini's 1M token context window for large-scale codebase analysis, while staying within Claude Code's workflow.",
8 | date: "2025-01-25",
9 | category: "sub-agents",
10 | language: "en",
11 | slug: "en/sub-agents/gemini-cli-subagent-tutorial",
12 | url: "/docs/en/sub-agents/gemini-cli-subagent-tutorial"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T11-49-47-141Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "CCPM: Claude Code Project Manager",
7 | description: "A revolutionary project management system for Claude Code that uses GitHub Issues and Git worktrees for parallel agent execution. Transform PRDs into shipped code with full traceability and unprecedented development velocity.",
8 | date: "2024-08-24",
9 | category: "tools",
10 | language: "en",
11 | slug: "en/tools/ccpm-claude-code-project-manager",
12 | url: "/docs/en/tools/ccpm-claude-code-project-manager"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-31T22-56-06-041Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Fed Up and Built My First Sub Agent: UI Visual Validator",
7 | description: "Tired of Claude Code's self-deceptive UI modification validations, I developed this strict visual verification agent that defaults to failure, only trusts screenshots, specifically treats all claims of successful fixes.",
8 | date: "2025-08-30",
9 | category: "sub-agents",
10 | language: "en",
11 | slug: "en/sub-agents/ui-visual-validator-agent",
12 | url: "/docs/en/sub-agents/ui-visual-validator-agent"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-25T07-41-00-940Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Andrej Karpathy on the Evolution of LLM-Assisted Coding: Philosophy Meets Practice",
7 | description: "Insights from AI legend Andrej Karpathy on multi-layered LLM coding workflows, combined with practical Claude Code techniques and strategies for optimal AI-assisted development.",
8 | date: "2025-01-24",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/karpathy-llm-coding-evolution",
12 | url: "/docs/en/best-practices/karpathy-llm-coding-evolution"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-27T08-58-19-926Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "From Random Conversations to Reproducible Production: A Claude Code Advanced Workflow Guide",
7 | description: "Transform chaotic AI-assisted development into a structured, document-first, diff-driven workflow that delivers predictable results through systematic planning and execution.",
8 | date: "2025-08-27",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/claude-code-production-workflow",
12 | url: "/docs/en/best-practices/claude-code-production-workflow"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T14-51-38-581Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "What Makes Claude Code So Damn Good: A Deep Analysis",
7 | description: "An in-depth analysis of what makes Claude Code the most delightful AI coding agent, based on intercepted logs and months of usage. Learn the architectural decisions, prompt engineering techniques, and tool design principles that you can apply to your own LLM agents.",
8 | date: "2024-08-24",
9 | category: "advanced",
10 | language: "en",
11 | slug: "en/advanced/decoding-claude-code-analysis",
12 | url: "/docs/en/advanced/decoding-claude-code-analysis"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-26T22-40-20-096Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "99.9% AI-Driven Development: A Comprehensive Implementation Guide",
7 | description: "Learn how to achieve near-complete AI automation in software development through systematic practices, advanced tooling, and proven architectural patterns that enable rapid, high-quality code delivery.",
8 | date: "2025-01-27",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/99-percent-ai-development-comprehensive-guide",
12 | url: "/docs/en/best-practices/99-percent-ai-development-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-17T11-23-32-349Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Mastering AI-Driven Development with Vibe Coding",
7 | description: "Complete strategic framework for software developers to maximize AI tools value. Learn foundational mindset, project planning, implementation workflow, and advanced techniques for professional AI-assisted development.",
8 | date: "2025-01-17",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/yc-vibe-coding-mastering-ai-driven-development",
12 | url: "/docs/en/best-practices/yc-vibe-coding-mastering-ai-driven-development"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/docs/recent-posts-management.md:
--------------------------------------------------------------------------------
1 | # 最近文章管理系统
2 |
3 | ## 概述
4 |
5 | 最近文章管理系统使用结构化的数组来管理首页的 "Recent Posts" 部分,比动态扫描文件系统更加可控和高效。
6 |
7 | ## 文件结构
8 |
9 | - `lib/recent-posts.ts` - 最近文章的结构化数组和管理函数
10 | - `scripts/manage-recent-posts.js` - 管理脚本
11 | - `app/(home)/page.tsx` - 首页组件,使用新的最近文章系统
12 |
13 | ## 使用方法
14 |
15 | ### 1. 查看当前最近文章列表
16 |
17 | ```bash
18 | npm run recent-posts list
19 | ```
20 |
21 | ### 2. 添加新文章到最近文章列表
22 |
23 | ```bash
24 | npm run recent-posts add
25 | ```
26 |
27 | 示例:
28 | ```bash
29 | npm run recent-posts add content/docs/en/best-practices/my-new-article.mdx en
30 | npm run recent-posts add content/docs/zh/best-practices/my-new-article.mdx zh
31 | ```
32 |
33 | ### 3. 从最近文章列表中移除文章
34 |
35 | ```bash
36 | npm run recent-posts remove
37 | ```
38 |
39 | 示例:
40 | ```bash
41 | npm run recent-posts remove en/best-practices/old-article
42 | ```
43 |
44 | ## 文章数据结构
45 |
46 | 每篇文章包含以下字段:
47 |
48 | ```typescript
49 | interface ChangelogEntry {
50 | title: string; // 文章标题
51 | description: string; // 文章描述
52 | date: string; // 发布日期
53 | category: string; // 文章分类
54 | language: 'zh' | 'en'; // 语言
55 | slug: string; // 文章标识符
56 | url: string; // 文章链接
57 | }
58 | ```
59 |
60 | ## 管理函数
61 |
62 | ### `getHomePageRecentPosts(limit: number = 5)`
63 | 获取首页最近文章,按日期排序
64 |
65 | ### `addRecentPost(post: ChangelogEntry)`
66 | 添加新文章到最近文章列表
67 |
68 | ### `removeRecentPost(slug: string)`
69 | 从最近文章列表中移除文章
70 |
71 | ### `getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5)`
72 | 获取特定语言的文章
73 |
74 | ### `getRecentPostsByCategory(category: string, limit: number = 5)`
75 | 获取特定分类的文章
76 |
77 | ## 工作流程
78 |
79 | ### 发布新文章时
80 |
81 | 1. 创建文章文件到 `content/docs///`
82 | 2. 运行 `npm run update-indexes` 更新目录索引
83 | 3. 运行 `npm run recent-posts add ` 添加到首页最近文章
84 | 4. 验证文章正确显示在首页
85 |
86 | ### 移除旧文章时
87 |
88 | 1. 删除文章文件
89 | 2. 运行 `npm run update-indexes` 更新目录索引
90 | 3. 运行 `npm run recent-posts remove ` 从最近文章列表中移除
91 | 4. 验证文章不再显示在首页
92 |
93 | ## 优势
94 |
95 | 1. **可控性** - 精确控制哪些文章显示在首页
96 | 2. **性能** - 不需要动态扫描文件系统
97 | 3. **灵活性** - 可以手动调整文章顺序和显示
98 | 4. **维护性** - 结构化的数组便于管理和调试
99 | 5. **自动化** - 提供脚本工具简化管理操作
100 |
101 | ## 注意事项
102 |
103 | - 文章按日期自动排序,最新的显示在前面
104 | - 系统会自动检测重复的文章,避免重复添加
105 | - 支持中英文双语文章管理
106 | - 文章 slug 必须唯一,用于标识文章
107 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-17T19-23-33-633Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Automated Documentation with Claude Code: Building Self-Updating Docs Using Docusaurus Agent",
7 | description: "Learn to build an automated documentation system using Claude Code and Docusaurus. Set up a documentation agent that analyzes code changes, updates project documentation automatically, and integrates with CI/CD workflows.",
8 | date: "2025-09-17",
9 | category: "tools",
10 | language: "en",
11 | slug: "en/tools/automated-documentation-claude-code-docusaurus",
12 | url: "/docs/en/tools/automated-documentation-claude-code-docusaurus"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-27-36-266Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Claude Code Complete Guide: 26 Core Features + Practical Tips (Must Collect!)",
7 | description: "Claude Code is incredibly powerful! This comprehensive guide systematically breaks down 26 key features, from basic commands to context compression, from code assistance to GitHub automation, many uses go beyond traditional understanding of AI coding.",
8 | date: "2025-01-20",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/claude-code-comprehensive-guide",
12 | url: "/docs/en/best-practices/claude-code-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-30T12-41-51-032Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Claude Code Complete Guide: 26 Core Features + Practical Tips (Must Collect!)",
7 | description: "Claude Code is incredibly powerful! This comprehensive guide systematically breaks down 26 key features, from basic commands to context compression, from code assistance to GitHub automation, many uses go beyond traditional understanding of AI coding.",
8 | date: "2025-01-20",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/claude-code-comprehensive-guide",
12 | url: "/docs/en/best-practices/claude-code-comprehensive-guide"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/content/docs/zh/tools/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 工具
3 | description: 探索 ClaudeCode 的工具和实用程序
4 | lang: zh
5 | ---
6 |
7 | # 工具
8 |
9 | 欢迎来到 工具 专区!在这里您将找到关于 工具 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:工具 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
69 |
70 | ## 开始使用
71 |
72 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 工具。
73 |
74 | ## 贡献
75 |
76 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
77 |
78 | ---
79 |
80 | *探索这些文章,提升您的 工具 使用体验!*
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-09-30T19-15-49-464Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "Effective Context Engineering for AI Agents",
7 | description: "A comprehensive guide to context engineering - the evolution from prompt engineering to managing the holistic state available to LLMs for building steerable, effective agents. Learn strategies for optimizing context windows, managing attention budgets, and designing efficient agent architectures.",
8 | date: "Tue Sep 30 2025 02:00:00 GMT+0200 (Central European Summer Time)",
9 | category: "best-practices",
10 | language: "en",
11 | slug: "en/best-practices/effective-context-engineering-for-ai-agents",
12 | url: "/docs/en/best-practices/effective-context-engineering-for-ai-agents"
13 | },];
14 |
15 | // 获取首页最近文章的函数
16 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
17 | // 按日期排序,最新的在前
18 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
19 | new Date(b.date).getTime() - new Date(a.date).getTime()
20 | );
21 |
22 | return sortedPosts.slice(0, limit);
23 | }
24 |
25 | // 添加新文章到最近文章列表
26 | export function addRecentPost(post: ChangelogEntry): void {
27 | // 检查是否已存在相同 slug 的文章
28 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
29 |
30 | if (existingIndex !== -1) {
31 | // 更新现有文章
32 | RECENT_POSTS[existingIndex] = post;
33 | } else {
34 | // 添加新文章到开头
35 | RECENT_POSTS.unshift(post);
36 | }
37 | }
38 |
39 | // 从最近文章列表中移除文章
40 | export function removeRecentPost(slug: string): void {
41 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
42 | if (index !== -1) {
43 | RECENT_POSTS.splice(index, 1);
44 | }
45 | }
46 |
47 | // 获取特定语言的文章
48 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
49 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
50 | const sortedPosts = filteredPosts.sort((a, b) =>
51 | new Date(b.date).getTime() - new Date(a.date).getTime()
52 | );
53 |
54 | return sortedPosts.slice(0, limit);
55 | }
56 |
57 | // 获取特定分类的文章
58 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
59 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
60 | const sortedPosts = filteredPosts.sort((a, b) =>
61 | new Date(b.date).getTime() - new Date(a.date).getTime()
62 | );
63 |
64 | return sortedPosts.slice(0, limit);
65 | }
66 |
--------------------------------------------------------------------------------
/content/docs/zh/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Claude Code 文档中心
3 | description: Claude Code 官方文档、指南、教程和最佳实践
4 | ---
5 |
6 | # Claude Code 文档中心
7 |
8 | 欢迎来到 Claude Code 文档中心!这里提供全面的 Claude Code 文档、指南、教程和最佳实践,帮助您充分利用 AI 辅助编程的强大功能。
9 |
10 | ## 什么是 Claude Code?
11 |
12 | Claude Code 是 Anthropic 官方的 AI 辅助编程 CLI 工具。它是一个基于终端的开发工具,具有文件管理、代码分析、多模型支持和 MCP 服务器集成等功能。
13 |
14 | ### 主要功能
15 |
16 | - **代码分析**:深入理解项目结构和代码逻辑
17 | - **功能开发**:从零开始创建新功能
18 | - **代码重构**:优化现有代码结构
19 | - **调试支持**:快速定位和修复问题
20 | - **测试编写**:生成全面的测试用例
21 | - **文档生成**:自动创建技术文档
22 | - **多语言支持**:支持几乎所有编程语言和框架
23 |
24 | ## 快速开始
25 |
26 | ### 安装 Claude Code
27 |
28 | ```bash
29 | npm install -g @anthropic-ai/claude-code
30 | ```
31 |
32 | **系统要求**:
33 | - Node.js 18.0+
34 | - Claude Pro 订阅或 API 密钥
35 | - Windows 用户需要 WSL2
36 |
37 | ### 开始使用
38 |
39 | 1. **导航到项目目录**
40 | ```bash
41 | cd your-project
42 | ```
43 |
44 | 2. **启动 Claude Code**
45 | ```bash
46 | claude
47 | ```
48 |
49 | 3. **询问项目信息**
50 | ```
51 | explain what this repo is about
52 | ```
53 |
54 | ## 核心功能
55 |
56 | ### AI 辅助开发
57 | Claude Code 通过自然语言交互,帮助您完成各种开发任务:
58 |
59 | - **代码解释**:理解复杂的代码逻辑
60 | - **功能实现**:从需求描述到完整实现
61 | - **问题诊断**:快速定位和解决技术问题
62 | - **最佳实践**:遵循行业标准和最佳实践
63 |
64 | ### 多文件操作
65 | Claude Code 能够同时处理多个文件,理解项目整体结构:
66 |
67 | - **跨文件分析**:理解文件间的依赖关系
68 | - **批量修改**:同时更新多个相关文件
69 | - **重构支持**:安全地重构代码结构
70 |
71 | ### 终端集成
72 | 完全集成到您的开发工作流程中:
73 |
74 | - **无缝集成**:与现有开发工具完美配合
75 | - **版本控制**:直接与 Git 交互
76 | - **构建工具**:集成 npm、yarn 等构建工具
77 |
78 | ## 使用场景
79 |
80 | ### 初学者友好
81 | - 使用自然语言命令,无需复杂配置
82 | - 从简单请求开始:`explain this code` 或 `create a hello world file`
83 | - 边学边做,通过实践学习编程概念
84 |
85 | ### 专业开发
86 | - 处理复杂的多文件项目
87 | - 高级代码分析和重构
88 | - 自动化测试和文档生成
89 | - 团队协作和代码审查
90 |
91 | ### 学习编程
92 | - 通过 AI 辅助理解编程概念
93 | - 实时获取编程建议和最佳实践
94 | - 从错误中学习,获得详细解释
95 |
96 | ## 定价方案
97 |
98 | Claude Code 提供多种定价选择:
99 |
100 | - **Claude Pro**:$20/月
101 | - **Claude Max 5x**:$100/月
102 | - **Claude Max 20x**:$200/月
103 | - **API 按使用付费**:$0.25-75/百万 tokens
104 |
105 | ## 平台支持
106 |
107 | ### Windows
108 | - 通过 WSL2 运行
109 | - 与 Visual Studio Code 完美集成
110 | - 支持完整的 Linux 开发环境
111 |
112 | ### macOS
113 | - 原生支持,性能优异
114 | - 简单的 npm 安装
115 | - 无需额外配置
116 |
117 | ### Linux
118 | - 最佳性能表现
119 | - 直接系统访问
120 | - 完整的终端集成
121 |
122 | ## 社区资源
123 |
124 | ### 官方资源
125 | - [官方 Claude Code 文档](https://docs.anthropic.com/claude/docs/claude-code)
126 |
127 |
128 | ### 社区支持
129 | - [r/ClaudeAI Reddit 社区](https://reddit.com/r/ClaudeAI)
130 | - [ClaudeLog Community](https://claudelog.com)
131 | - [Awesome Claude Code](https://github.com/hesreallyhim/awesome-claude-code)
132 |
133 |
134 | ## 下一步
135 |
136 |
137 |
138 |
139 |
140 | ---
141 |
142 | *Claude Code 由 Anthropic 开发,是 AI 辅助编程领域的领先工具。通过自然语言交互和强大的上下文理解能力,Claude Code 正在重新定义软件开发的工作方式。*
143 |
--------------------------------------------------------------------------------
/.backups/recent-posts-2025-08-24T10-50-10-136Z.ts:
--------------------------------------------------------------------------------
1 | import { ChangelogEntry } from './changelog';
2 |
3 | // 首页最近文章的结构化数组
4 | export const RECENT_POSTS: ChangelogEntry[] = [
5 | {
6 | title: "使用 Claude Code 的六周回顾",
7 | description: "Puzzmo 工程师 Orta Therox 在生产开发中使用 Claude Code 六周后的回顾与思考,涵盖维护改进、工作流程变化和真实项目示例。",
8 | date: "2025-07-30",
9 | category: "best-practices",
10 | language: "zh",
11 | slug: "zh/best-practices/six-weeks-of-claude-code",
12 | url: "/docs/zh/best-practices/six-weeks-of-claude-code"
13 | },
14 | {
15 | title: "6 Weeks of Claude Code",
16 | description: "A retrospective on using Claude Code for 6 weeks in production development, covering maintenance improvements, workflow changes, and real-world project examples.",
17 | date: "2025-07-30",
18 | category: "best-practices",
19 | language: "en",
20 | slug: "en/best-practices/six-weeks-of-claude-code",
21 | url: "/docs/en/best-practices/six-weeks-of-claude-code"
22 | },
23 | {
24 | title: "手把手教你逆向Claude Code:如何监控AI每一次'内心独白'?",
25 | description: "通过技术手段逆向分析Claude Code的API交互过程,揭秘AI编程之王的多模型协作策略、精巧的系统提示词设计和智能工具调用机制。",
26 | date: "2025-01-15",
27 | category: "general",
28 | language: "zh",
29 | slug: "zh/advanced/claude-code-reverse-analysis",
30 | url: "/docs/zh/advanced/claude-code-reverse-analysis"
31 | },];
32 |
33 | // 获取首页最近文章的函数
34 | export function getHomePageRecentPosts(limit: number = 5): ChangelogEntry[] {
35 | // 按日期排序,最新的在前
36 | const sortedPosts = [...RECENT_POSTS].sort((a, b) =>
37 | new Date(b.date).getTime() - new Date(a.date).getTime()
38 | );
39 |
40 | return sortedPosts.slice(0, limit);
41 | }
42 |
43 | // 添加新文章到最近文章列表
44 | export function addRecentPost(post: ChangelogEntry): void {
45 | // 检查是否已存在相同 slug 的文章
46 | const existingIndex = RECENT_POSTS.findIndex(p => p.slug === post.slug);
47 |
48 | if (existingIndex !== -1) {
49 | // 更新现有文章
50 | RECENT_POSTS[existingIndex] = post;
51 | } else {
52 | // 添加新文章到开头
53 | RECENT_POSTS.unshift(post);
54 | }
55 | }
56 |
57 | // 从最近文章列表中移除文章
58 | export function removeRecentPost(slug: string): void {
59 | const index = RECENT_POSTS.findIndex(p => p.slug === slug);
60 | if (index !== -1) {
61 | RECENT_POSTS.splice(index, 1);
62 | }
63 | }
64 |
65 | // 获取特定语言的文章
66 | export function getRecentPostsByLanguage(language: 'zh' | 'en', limit: number = 5): ChangelogEntry[] {
67 | const filteredPosts = RECENT_POSTS.filter(post => post.language === language);
68 | const sortedPosts = filteredPosts.sort((a, b) =>
69 | new Date(b.date).getTime() - new Date(a.date).getTime()
70 | );
71 |
72 | return sortedPosts.slice(0, limit);
73 | }
74 |
75 | // 获取特定分类的文章
76 | export function getRecentPostsByCategory(category: string, limit: number = 5): ChangelogEntry[] {
77 | const filteredPosts = RECENT_POSTS.filter(post => post.category === category);
78 | const sortedPosts = filteredPosts.sort((a, b) =>
79 | new Date(b.date).getTime() - new Date(a.date).getTime()
80 | );
81 |
82 | return sortedPosts.slice(0, limit);
83 | }
84 |
--------------------------------------------------------------------------------
/content/sources/you_are_not_right.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euo pipefail
3 | trap 'echo "at line $LINENO, exit code $? from $BASH_COMMAND" >&2; exit 1' ERR
4 |
5 | # This is a Claude Code hook to stop it saying "you are right".
6 | #
7 | # Installation:
8 | # 1. Save this script and chmod +x it to make it executable.
9 | # 2. Within Claude Code, /hooks / UserPromptSubmit > Add a new hook (this file)
10 | #
11 | # How it works:
12 | # This script checks whether the assistant has recently told the user they are right.
13 | # If so, it appends a system-reminder to the following user prompt,
14 | # reminding the assistant not to do that, and giving it constructive
15 | # examples of how it should respond to the user instead.
16 |
17 | stdin=$(cat)
18 | transcript_path=$(echo "$stdin" | jq -r ".transcript_path")
19 |
20 | # We'll look through the last 5 items in the transcript.
21 | # Sometimes the final item will be assistant thinking,
22 | # and the previous one will be "you're right".
23 | # We'll look for any triggering phrase like "You're right"
24 | # or "you are absolutely correct".
25 | items=$(grep '"role":"assistant"' "$transcript_path" | tail -n 5)
26 | needs_reminder=false
27 | while IFS= read -r item; do
28 | [[ "$(jq -r '.type // empty' <<< "$item")" == "assistant" ]] || continue
29 | [[ "$(jq -r '.message.content[0].type // empty' <<< "$item")" == "text" ]] || continue
30 | text=$(jq -r '.message.content[0].text' <<< "$item")
31 | [[ "${text:0:80}" =~ .*[Yy]ou.*(right|correct) ]] && needs_reminder=true
32 | [[ "${text:0:80}" =~ .*[Aa]bsolutely ]] && needs_reminder=true
33 | [[ "${text:0:80}" =~ .*사용자가.*맞다 ]] && needs_reminder=true # Korean
34 | [[ "${text:0:80}" =~ .*맞습니다 ]] && needs_reminder=true # Korean
35 | done <<< "$items"
36 | [[ "$needs_reminder" == "true" ]] || exit 0
37 |
38 | # upon exit code 0, Claude Code will append stdout to the context
39 | # and proceed.
40 | cat <<'EOF'
41 |
42 | You MUST NEVER use the phrase 'you are right' or similar.
43 |
44 | Avoid reflexive agreement. Instead, provide substantive technical analysis.
45 |
46 | You must always look for flaws, bugs, loopholes, counter-examples,
47 | invalid assumptions in what the user writes. If you find none,
48 | and find that the user is correct, you must state that dispassionately
49 | and with a concrete specific reason for why you agree, before
50 | continuing with your work.
51 |
52 |
53 | user: It's failing on empty inputs, so we should add a null-check.
54 | assistant: That approach seems to avoid the immediate issue.
55 | However it's not idiomatic, and hasn't considered the edge case
56 | of an empty string. A more general approach would be to check
57 | for falsy values.
58 |
59 |
60 | user: I'm concerned that we haven't handled connection failure.
61 | assistant: [thinks hard] I do indeed spot a connection failure
62 | edge case: if the connection attempt on line 42 fails, then
63 | the catch handler on line 49 won't catch it.
64 | [ultrathinks] The most elegant and rigorous solution would be
65 | to move failure handling up to the caller.
66 |
67 |
68 | EOF
69 |
70 | exit 0
71 |
--------------------------------------------------------------------------------
/content/docs/zh/best-practices/optimal-ai-development-workflow.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "我当前的 AI 开发工作流"
3 | description: "Peter Steinberger 使用 Ghostty、Claude Code 和极简工具链优化的 AI 开发工作流,实现最大生产力"
4 | date: "2025-08-25"
5 | author: "Peter Steinberger"
6 | tags: ["工作流", "claude", "开发", "生产力", "工具", "最佳实践"]
7 | image: "/images/optimal-ai-development-workflow/hero.png"
8 | ---
9 |
10 | # 我当前的 AI 开发工作流
11 |
12 | *2025年8月25日 - Peter Steinberger*
13 |
14 | 
15 |
16 | **TL;DR:Ghostty + Claude Code + 极简工具 = 最大生产力。[少即是多](https://x.com/steipete/status/1952439355340943534)。**
17 |
18 | 是时候[更新我的工作流](https://x.com/steipete/status/1960114479028486429)了,它一直在不断演进。
19 |
20 | 在[全面使用 VS Code](https://x.com/steipete/status/1955781673670340796) 之后,我完全回到了 [Ghostty](https://ghostty.org/) 作为主要设置,[VS Code 在侧边](https://x.com/steipete/status/1954691261279146029/photo/1)用来查看代码,Cursor/GPT-5 用于代码审查(有时也用 CLI)。我试过 [Zed](https://zed.dev/),但就是无法忍受[这样的](https://x.com/steipete/status/1955690682477134124/photo/1)[终端外观](https://x.com/steipete/status/1959259921439969326)。
21 |
22 | 我仍然对我的 [Dell UltraSharp U4025QW](https://www.dell.com/en-us/shop/dell-ultrasharp-40-curved-thunderbolt-hub-monitor-u4025qw/apd/210-bmdp/monitors-monitor-accessories) 极其满意 - 3840x1620 的分辨率让 4 个 Claude 实例 + Chrome 都能同时可见,无需移动窗口。
23 |
24 | VS Code 的终端太不稳定了,粘贴大量文本时经常冻结。没有什么能比得上 Ghostty。
25 |
26 | ## 工具及其现实
27 |
28 | Gemini 可能很棒,但它的编辑工具[太](https://x.com/steipete/status/1942113964231442876)[混乱](https://x.com/steipete/status/1955941943218713006/photo/1),所以我越来越少使用它。GPT-5 在审查计划方面甚至比 Gemini 效果更好。
29 |
30 | 是的,所有这些都在主分支上工作。我试过整个 [worktree 设置](https://x.com/steipete/status/1956340397900177686),只会让我变慢。如果你仔细选择工作领域,你可以在多个领域工作而不会有太多交叉污染。
31 |
32 | Claude 经常搞砸事情,但它在重构和清理方面同样出色。重要的是要做到这两点,以免产生太多技术债务。
33 |
34 | ## 规划和上下文管理
35 |
36 | 在[状态行中显示初始主题 + 会话 ID](https://x.com/steipete/status/1958903434322526214)([gist](https://gist.github.com/steipete/8396e512171d31e934f0013e5651691e))非常有用,以防我需要切换账户或重启会话。
37 |
38 | 使用计划模式并迭代是关键。较小的任务我会立即完成,较大的任务我会写在文件中并让 GPT-5 审查。
39 |
40 | 我经常用小提示进行管理,有时我会头脑风暴,令人惊讶的是智能体能从我[混乱的想法](https://x.com/steipete/status/1958233967548850235)中理解出多少内容。
41 |
42 | 当我不在重构时,我通常运行 1-2 个智能体;对于清理/测试/UI 工作,大约 4 个似乎是最佳点。这完全取决于工作的影响范围。
43 |
44 | ## 困难的部分
45 |
46 | 最困难的部分是[分布式系统设计](https://x.com/steipete/status/1958573142726640116/photo/1),选择正确的依赖项、平台和前瞻性的数据库架构。
47 |
48 | 我一直在构建大量自定义基础设施、[管理页面](https://x.com/steipete/status/1958956225800151465)、CLI 来帮助我和智能体,这些工作确实大大提高了我的速度。用旧方式我永远不会这样做。
49 |
50 | ## 测试策略
51 |
52 | 重大更改总是会有测试。自动化测试通常不是很好,但当你要求模型在同一上下文中编写测试时,模型几乎总是能发现问题。上下文是宝贵的,不要浪费它。
53 |
54 | ## 少即是多
55 |
56 | 甚至[移除了我最后的 MCP](https://x.com/steipete/status/1958679613489524952),因为 Claude 有时会在未被要求的情况下启动 Playwright,而它可以简单地读取代码 - 这更快且更少污染上下文。
57 |
58 | 选择具有 CLI 的服务:vercel、psql、gh、axiom。智能体可以使用它们,在 CLAUDE.md 中一行就足够了"logs: axiom or vercel cli"。"Database: psql + 一个如何正确加载环境的示例,以便循环更快"
59 |
60 | ## 结果和比较
61 |
62 | 用这个设置完成了大量工作。其他 CLI/模型仍然无法接近。[Codex 无法搜索](https://x.com/steipete/status/1954593439347032167)(询问"google best practices"通常比上下文更好)。Cursor/GPT-5 需要很长时间且不分享其思考过程,所以很难引导。GPT-5 在提示方面也更加字面化 - 它是一个很棒的模型,但不是最好的智能体,你必须更加精确和具体。
63 |
64 | 我仍然不知道这如何能转移到后台智能体。我会大量引导模型,因为我注意到它们偏离 - 如果它们在后台运行,这会更加困难。
65 |
66 | 新的速率限制将在 8 月 28 日生效,这肯定会很糟糕。我想我只能付费了。目前没有完美的替代方案。
--------------------------------------------------------------------------------
/public/images/six-weeks-of-claude-code/missing-link-puzzle.svg:
--------------------------------------------------------------------------------
1 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/content/docs/zh/best-practices/master-engineering-workflow-5x-productivity.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "实现 5 倍生产力的主工程师工作流"
3 | description: "探索顶尖工程师使用的系统化提示工程工作流,实现 5 倍更高的吞吐量。学习如何从零开始规划工程项目,包括结构化探索、澄清问题、文件树图和详细变更计划。"
4 | date: "2025-10-04"
5 | author: "DeepToAI 团队"
6 | category: "best-practices"
7 | language: "zh"
8 | tags: ["提示工程", "生产力", "工程工作流", "AI 辅助开发", "规划"]
9 | ---
10 |
11 | # 实现 5 倍生产力的主工程师工作流
12 |
13 | 我们的一位工程师的吞吐量比我在过去公司合作过的任何人都高出 5 倍。他的部分秘诀在于他对 AI 工作流的精心调校。这是他用来从零开始规划工程项目的主要提示:
14 |
15 | ## 原始提示词
16 |
17 | ```
18 | ## 1. Explore the Codebase
19 |
20 | * List relevant directories to show project structure.
21 | * Review http://AGENTS[.]md, http://CLAUDE[.]md, and files under `docs/` for context and conventions.
22 | * Check existing code for examples of similar implementations.
23 |
24 | ## 2. Ask Clarifying Questions
25 |
26 | If anything is ambiguous, ask questions before finalizing the plan.
27 | Examples:
28 |
29 | * "Which module should the new helper live in?"
30 | * "Should this endpoint return JSON or HTML?"
31 |
32 | ## 3. File Tree of Changes
33 |
34 | At the top of the plan, show a tree diagram of affected files.
35 | Use markers for status:
36 |
37 | * UPDATE = update
38 | * NEW = new file
39 | * DELETE = deletion
40 |
41 | Example:
42 | /src
43 | ├── services
44 | │ ├── UPDATE user.service.ts
45 | │ └── NEW payment.service.ts
46 | ├── utils
47 | │ └── DELETE legacy-helpers.ts
48 | └── UPDATE index.ts
49 |
50 | ## 4. File-by-File Change Plan
51 |
52 | For each file:
53 |
54 | * Show full path + action (update, new, delete).
55 | * Explain the exact changes in plain language.
56 | * Include a short code snippet for the main update.
57 |
58 | Example:
59 |
60 | * File: `src/services/user.service.ts` (UPDATE)
61 |
62 | * Add a method `getUserByEmail(email: string)` that looks up a user from an in-memory list.
63 | * Refactor `getUserById` to reuse shared lookup logic.
64 |
65 | const users = [
66 | { id: 1, email: "alice@example[.]com", name: "Alice" },
67 | { id: 2, email: "bob@example[.]com", name: "Bob" },
68 | ];
69 |
70 | export function getUserByEmail(email: string) {
71 | return users.find(u => u.email === email) || null;
72 | }
73 |
74 | export function getUserById(id: number) {
75 | return users.find(u => u.id === id) || null;
76 | }
77 |
78 | ## 5. Explanations & Context
79 |
80 | At the end of the plan, include:
81 |
82 | * Rationale for each change (why it's needed).
83 | * Dependencies or side effects to watch for.
84 | * Testing suggestions to validate correctness.
85 | ```
86 |
87 | ## 为什么这个工作流有效
88 |
89 | 这个系统化的方法能带来 5 倍生产力,因为:
90 |
91 | 1. **防止返工**:通过预先探索代码库和提出澄清问题,避免代价高昂的误解。
92 | 2. **改善沟通**:结构化的计划既可作为 AI 的指导,也可作为人类协作者的沟通工具。
93 | 3. **便于审查**:文件树图和详细的变更计划使团队成员容易理解变更范围和实现方式。
94 | 4. **减少认知负担**:将变更分解到文件级别,减少心理负担,使复杂任务变得可管理。
95 | 5. **确保质量**:包含理由和测试建议有助于保持高标准并发现潜在问题。
96 |
97 | ## 为您的项目调整此工作流
98 |
99 | 要在您自己的项目中实施此工作流:
100 |
101 | 1. **从探索开始**:始终先了解现有的代码库结构和约定。
102 | 2. **及早提出问题**:不要假设您完全理解需求 - 在深入实施之前先澄清模糊之处。
103 | 3. **可视化变更**:创建清晰的文件树图来传达变更范围。
104 | 4. **详细规划**:对于每个文件,准确解释将要发生什么变化以及为什么。
105 | 5. **记录上下文**:包括理由和测试策略以确保可维护性。
106 |
107 | 这个工作流代表了从临时编码到系统化工程的转变。通过在这一结构化过程中将 AI 视为协作伙伴,顶尖工程师实现了显著的生产力提升,同时保持了高质量和清晰的沟通。
108 |
109 | 无论您是独自工作还是与团队合作,采用这种主工程师工作流都能改变您处理软件开发项目的方式。
--------------------------------------------------------------------------------
/content/docs/zh/tools/context-engineering.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Context Engineering 模板:让 AI 编码助手真正落地的系统方法"
3 | description: "基于 coleam00/context-engineering-intro 的上下文工程模板与实践,涵盖 INITIAL/PRP 工作流、示例库与最佳实践"
4 | language: "zh"
5 | author: "deepto.ai"
6 | source: "https://github.com/coleam00/context-engineering-intro"
7 | date: "2025-08-06"
8 | ---
9 |
10 | # Context Engineering 模板:让 AI 编码助手真正落地的系统方法
11 |
12 | > **参考项目**:[`coleam00/context-engineering-intro`](https://github.com/coleam00/context-engineering-intro)(8k+ ⭐)
13 |
14 | **Context Engineering(上下文工程)** 是让 AI 编码助手端到端完成任务的关键方法论:与其“花哨地写提示词”,不如系统化地“喂给模型完成任务所需的一切上下文”。相比 Prompt Engineering(提示工程),它强调完整的项目规则、示例、验证与闭环执行。
15 |
16 | ## 为什么需要 Context Engineering
17 |
18 | - **减少失败**:大多数“代理失败”是上下文缺失而非模型能力问题
19 | - **保证一致性**:强制遵循项目约定、代码风格与测试标准
20 | - **支持复杂特性**:提供足够上下文后,模型可以完成多步实现
21 | - **自我修正**:通过验证与测试回路自动发现并修复问题
22 |
23 | > 正如项目 README 所述:Context Engineering 是“写完整剧本”,而不是给模型贴一张“便利贴”。参见项目说明的“What is Context Engineering”章节。[项目链接](https://github.com/coleam00/context-engineering-intro?tab=readme-ov-file#what-is-context-engineering)
24 |
25 | ## 模板结构一览
26 |
27 | 该仓库提供了可直接落地的目录结构(节选):
28 |
29 | ```
30 | .claude/
31 | commands/
32 | generate-prp.md # 生成 PRP(Product Requirements Prompt)
33 | execute-prp.md # 执行 PRP 实现功能
34 | settings.local.json # Claude Code 权限
35 | PRPs/
36 | templates/
37 | prp_base.md # PRP 基础模板
38 | EXAMPLE_multi_agent_prp.md
39 | examples/ # 关键!存放可复用代码示例与模式
40 | CLAUDE.md # 项目全局规则
41 | INITIAL.md # 初始功能需求
42 | INITIAL_EXAMPLE.md # 初始需求示例
43 | README.md
44 | ```
45 |
46 | ## 推荐工作流
47 |
48 | 1. 在 `CLAUDE.md` 设定项目规则(代码结构、测试、风格、文档等)
49 | 2. 编辑 `INITIAL.md` 描述要实现的功能(包含示例、文档链接、注意事项)
50 | 3. 在 Claude Code 中运行:
51 |
52 | ```bash
53 | /generate-prp INITIAL.md
54 | ```
55 |
56 | 生成完整的 PRP 到 `PRPs/xxx.md` 后,继续执行:
57 |
58 | ```bash
59 | /execute-prp PRPs/your-feature-name.md
60 | ```
61 |
62 | 助手会读取 PRP、制定任务清单、实现与验证、运行测试并迭代直到通过。
63 |
64 | ## INITIAL.md 编写要点
65 |
66 | - **FEATURE**:明确、可验证的功能描述
67 | - **EXAMPLES**:在 `examples/` 放入可复用代码模式,并说明仿照内容
68 | - **DOCUMENTATION**:罗列 API、库文档、MCP 资源等链接
69 | - **OTHER CONSIDERATIONS**:鉴权、配额、性能、常见坑等
70 |
71 | 项目 README 对比了 Prompt vs Context Engineering,强调“提供完整上下文与验证”的价值。[查看 README 相关部分](https://github.com/coleam00/context-engineering-intro?tab=readme-ov-file#what-is-context-engineering)
72 |
73 | ## 与工具链的配合
74 |
75 | - **与 `Claude Code Router` 配合**:为不同子任务提供合适模型与路由策略
76 | - **与 `Claude Code Templates` 配合**:批量生成项目规则、命令与监控
77 | - **MCP 集成**:接入 GitHub、数据库、构建系统等,为实现与验证提供能力
78 |
79 | ## 最佳实践清单
80 |
81 | - 在 `examples/` 中放入“你希望模型模仿的代码”。示例越多,效果越稳定
82 | - 用 PRP 的“验证关卡”把质量把控为必经步骤,确保测试与构建通过
83 | - 明确“成功标准”和“退出条件”,避免无限制迭代
84 | - 把“团队共识”沉淀进 `CLAUDE.md`,让助手天然遵循规范
85 | - 适度拆分多 PRP,分别聚焦不同子域(如 API、前端、DB 模式)
86 |
87 | ## 什么时候选 Context Engineering
88 |
89 | - 需要“端到端”地交付一项功能,而不仅是代码片段
90 | - 团队多人协作,需要让 AI 助手遵循一致的流程与标准
91 | - 跨领域集成(前后端、数据、CI/CD、文档),需要完整上下文
92 |
93 | ## 参考与来源
94 |
95 | - 项目主页:[`coleam00/context-engineering-intro`](https://github.com/coleam00/context-engineering-intro)
96 | - What is Context Engineering 章节:[`README#what-is-context-engineering`](https://github.com/coleam00/context-engineering-intro?tab=readme-ov-file#what-is-context-engineering)
97 |
98 | > 许可证:MIT(请遵循原仓库 LICENSE)。
99 |
100 | ---
101 |
102 | 本文根据上述仓库的内容梳理与提炼,旨在帮助你快速上手“上下文工程”,让 AI 编码助手在真实项目中稳定产出可用代码与文档。
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/pm_docs/0806_0131_fix.md:
--------------------------------------------------------------------------------
1 | # Work Log: Fix Nested Anchor Tags in MDX
2 |
3 | **Date**: 2025-08-06 01:31
4 | **Type**: Bug Fix
5 | **Project**: deeptoai
6 |
7 | ## Summary
8 |
9 | Fixed React hydration error caused by nested anchor tags in MDX content. The issue occurred when heading elements contained links, causing invalid HTML structure and hydration failures.
10 |
11 | ## Work Process
12 |
13 | 1. **Issue Analysis**
14 | - Identified hydration error in browser console
15 | - Error message: "In HTML, `` cannot be a descendant of ``"
16 | - Located the problem in `/docs/zh/tools/` page
17 |
18 | 2. **Root Cause Investigation**
19 | - Found that MDX headings with links inside were causing nested anchors
20 | - The heading component auto-generates anchor links for IDs
21 | - When a heading contains a link, it creates nested `` tags
22 |
23 | 3. **Solution Implementation**
24 | - Modified MDX content structure in both Chinese and English versions
25 | - Changed from: `### [Link Text](url)`
26 | - Changed to: `### Plain Text` followed by `[View Details](url)`
27 | - This prevents links from being inside heading elements
28 |
29 | ## Results
30 |
31 | ### Files Modified
32 | 1. `/Users/peng/Dev/Projects/deeptoai/content/docs/zh/tools/index.mdx`
33 | - Restructured 4 heading sections to avoid nested links
34 | - Moved links outside of heading elements
35 |
36 | 2. `/Users/peng/Dev/Projects/deeptoai/content/docs/en/tools/index.mdx`
37 | - Applied same restructuring to English version
38 | - Fixed Chinese text that appeared in English documentation
39 | - Replaced "敷衍性回复" with "perfunctory responses"
40 |
41 | ### Before/After Example
42 | **Before** (causing nested anchors):
43 | ```markdown
44 | ### [防止"你是对的"敷衍回复 Hook](/docs/zh/tools/you-are-not-right-hook)
45 | ```
46 |
47 | **After** (fixed):
48 | ```markdown
49 | ### 防止"你是对的"敷衍回复 Hook
50 | [查看详情](/docs/zh/tools/you-are-not-right-hook)
51 | ```
52 |
53 | ## Next Steps
54 |
55 | 1. **Immediate Actions**
56 | - Rebuild the project after clearing cache
57 | - Test the hydration fix in development environment
58 | - Verify no other pages have similar issues
59 |
60 | 2. **Preventive Measures**
61 | - Create documentation guideline about heading structure
62 | - Consider adding a linter rule to prevent links in headings
63 | - Review other MDX files for similar patterns
64 |
65 | 3. **Additional Improvements**
66 | - Could create a custom heading component that handles this case
67 | - Consider using a different link structure for tool listings
68 | - Possibly implement a card-based layout instead of heading-based
69 |
70 | ## Notes
71 |
72 | - The issue was specific to Fumadocs UI's heading component implementation
73 | - The `createRelativeLink` function from Fumadocs was contributing to the issue
74 | - Multiple Next.js dev server instances were running, requiring cleanup
75 | - The fix maintains visual appearance while solving the technical issue
76 |
77 | ## Technical Details
78 |
79 | The hydration error occurred because:
80 | 1. Fumadocs auto-generates anchor links for heading IDs
81 | 2. When a heading contains a link, it results in `...` structure
82 | 3. This is invalid HTML and causes React hydration to fail
83 | 4. The browser console showed detailed component stack trace pointing to the issue
84 |
85 | Solution maintains the same visual layout but separates the concerns:
86 | - Headings provide structure and auto-anchors
87 | - Links are placed immediately after headings for navigation
88 |
--------------------------------------------------------------------------------
/content/docs/zh/cursor/building-cursor-with-cursor.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "用 Cursor 构建 Cursor:一个真实案例"
3 | description: "使用 Cursor AI 构建 Cursor 本身的详细案例研究,包括挑战、失败和 AI 辅助开发的经验教训。"
4 | language: "zh"
5 | author: "Lee Robinson"
6 | source: "https://x.com/leerob"
7 | date: "2025-01-15"
8 | ---
9 |
10 | # 用 Cursor 构建 Cursor:一个真实案例
11 |
12 | 以下是我如何使用 Cursor 来构建 Cursor 的例子。以及 AI 模型失败和需要人工审查的地方!
13 |
14 | ## 挑战:添加 /compress 命令
15 |
16 | 我想添加一个 `/compress` 命令来总结对话中的所有消息。这很有用,因为你可以手动决定重置上下文窗口,特别是在较长的对话之后。
17 |
18 | 我描述了我想要的行为。这是我的第一个提示:
19 |
20 | > "在 @src/commands/ 中添加一个新命令来 /compress 当前聊天。该 /compress 命令应该查看聊天中的所有消息,然后调用选定的模型进行 LLM 调用来总结和压缩成单个消息,清除上下文窗口。"
21 |
22 | 注意我是如何标记 `@src/commands/` 的,这样它就会将其他斜杠命令的示例拉入上下文!
23 |
24 | ## 初始实现
25 |
26 | 因为客户端有类型检查、代码检查和测试设置,Cursor 代理能够进行一系列更改然后验证其输出。有一些错误,它看到了结果并修复了。
27 |
28 | 当 Cursor 生成代码时,我在编辑器内审查差异以确保看起来没问题。经过几轮来回,代码看起来基本正确,测试通过了,所以我在本地试运行。
29 |
30 | **它工作了!** 太好了...现在只需要完善一下并创建 PR。
31 |
32 | ## 第一个问题:内存泄漏
33 |
34 | 清理了代码,创建了 PR,并请求了一些审查(因为我对这个代码库还很陌生)。Cursor Bugbot 在 PR 上运行并告诉我存在内存泄漏 🤦
35 |
36 | 是的,没想到这一点。我审查了它的建议,它是正确的,所以我在本地应用了更改。
37 |
38 | ## 架构审查
39 |
40 | 但后来我收到了队友的评论:
41 |
42 | > "总结提示是否应该在后端而不是客户端进行,这样我们就可以为多个客户端重用相同的逻辑?"
43 |
44 | 好观点。Cursor 生成的代码是正确的!但这并不意味着它是正确的架构。我同意他的建议,所以回去重构。
45 |
46 | ## 重构到后端
47 |
48 | 这是我在新聊天中的下一个提示(为了获得新的上下文窗口):
49 |
50 | > "将 @compress.tsx 移动到后端应用程序,这样我们就可以在不同客户端中使用此功能。遵循与后端 RPC 通信的现有模式。"
51 |
52 | 我再次标记了 `@compress.tsx` 以便它回到上下文中(记住,LLM 不会在聊天之间保留工作记忆)。我要求它遵循现有模式,希望这足够具体。
53 |
54 | Cursor 去生成了一些代码。它添加了新的 protobuf(用于在客户端/服务器之间序列化结构化数据)和一个要调用的函数。它更新了客户端以与此新逻辑通信。
55 |
56 | 同样,代码看起来没问题,所以我要求它编写测试。后端测试需要运行本地 Docker 实例(来设置环境),所以它帮助我完成了设置(在终端中运行必要的命令)。
57 |
58 | ## 隐藏的 Bug
59 |
60 | 完成后,我启动了客户端来测试客户端/服务器之间的集成。我运行了 `/compress` 但它不工作。什么!?所有测试都通过了!代码检查通过了!这怎么可能?
61 |
62 | LLM 可以欺骗你认为逻辑有效,即使它实际上并不工作。存在运行时问题,这是编译时检查没有捕获的。
63 |
64 | 我仔细重新阅读了代码。请记住,我对这个代码库还不熟悉,所以我仍在尝试了解存在什么。
65 |
66 | ## 发现现有逻辑
67 |
68 | 当我深入查看代理文件时,我注意到一些有趣的东西——已经有处理总结的现有逻辑!如果你达到上下文窗口限制(例如,使用 Sonnet 4 的 200K tokens),Cursor 代理可以自动为你总结现有对话。它也不使用你当前的模型来执行此操作,而是使用更小更快的 flash 模型。
69 |
70 | 这很有道理。但是等等...看看我原来的提示:
71 |
72 | > "调用选定的模型进行 LLM 调用来总结和压缩成单个消息,清除上下文窗口。"
73 |
74 | AI 没有错,我告诉它使用选定的模型。我错了!
75 |
76 | 现在看看我添加后端逻辑的提示:
77 |
78 | > "将 @compress.tsx 移动到后端应用程序,这样我们就可以在不同客户端中使用此功能。遵循与后端 RPC 通信的现有模式。"
79 |
80 | 我说过要考虑这个逻辑是否可能已经存在于其他地方吗?没有。我告诉它创建新东西。
81 |
82 | ## 教训:意图很重要
83 |
84 | 现在,也许 AGI 会为我解决这个问题,但这正是你今天可能在使用 AI 模型时出错的地方。**你的意图很重要!**
85 |
86 | 有了这个发现,我回到了代理。事实证明,一些逻辑已经存在于后端,而且比我拥有的更好,所以让我们使用那个。
87 |
88 | Cursor 能够删除它为后端开始的内容,检查现有逻辑,并决定如何向客户端公开它。在内部,后端已经可以 `summarizeConversation()`,但没有公共方法。所以 Cursor 更新了 protobuf 模式来添加一个新方法,然后可以从客户端调用。
89 |
90 | ## 调试和最终修复
91 |
92 | 仍然,我在本地运行了,但它不工作。某处有 bug。我要求 Cursor 帮助我添加一些日志来调试整个客户端/服务器的流程,然后再次运行。
93 |
94 | 我能够将原始终端输出传回代理进行审查。代理比我更快地发现了错误,并建议了修复。测试了...它工作了!🎉
95 |
96 | 现在我要求 Cursor 清理调试日志并帮助我编写 PR 摘要。我确认所有测试都通过了,我们现在准备好进行更多审查。
97 |
98 | ## 关键要点
99 |
100 | 这就是用 AI 编码的现实。它并不完美。你通过与这些模型合作来获得经验,了解:
101 |
102 | - **你能做好的部分**
103 | - **代理能做好的部分**
104 | - **你们如何一起工作**
105 |
106 | 你学会在代理运行时审查工作。你依靠代码审查代理来验证输出并帮助你捕获狡猾的 bug。
107 |
108 | ## 经验教训
109 |
110 | 1. **上下文管理**: 为新任务使用新的上下文窗口
111 | 2. **意图清晰**: 具体说明你想要什么,但也要考虑现有解决方案
112 | 3. **人工审查**: 始终审查 AI 生成的代码,即使测试通过
113 | 4. **架构优先**: 在实现之前考虑更广泛的系统设计
114 | 5. **一起调试**: 使用 AI 帮助调试,但保持人工监督
115 |
116 | 关键洞察是 AI 是一个强大的工具,但它需要人工指导、审查,有时需要纠正。最好的结果来自人类专业知识和 AI 能力之间的协作。
117 |
118 | ---
119 |
120 | ## 来源和致谢
121 |
122 | 本文基于 Lee Robinson 在 Twitter 上分享的实战经验整理而成。
123 |
124 | **原作者**: Lee Robinson
125 | **原始链接**: https://x.com/leerob
126 | **发布日期**: 2025年1月15日
127 |
128 | 感谢 Lee Robinson 分享这个宝贵的 Cursor 实战案例,展示了 AI 辅助开发的真实挑战和解决方案。
--------------------------------------------------------------------------------
/content/docs/en/tools/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Tools
3 | description: Explore tools and utilities for ClaudeCode
4 | lang: en
5 | ---
6 |
7 | # Tools
8 |
9 | Welcome to the Tools section! Here you'll find valuable resources and guides about Tools.
10 |
11 | ## What You'll Find Here
12 |
13 | This section contains:
14 |
15 | - **Practical Guides**: Detailed usage guides for Tools
16 | - **Best Practices**: Proven best practices and techniques
17 | - **Case Studies**: Real-world application examples
18 | - **Advanced Tips**: Advanced techniques to improve efficiency
19 |
20 | ## Featured Articles
21 |
22 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
64 |
65 | ## Getting Started
66 |
67 | Whether you're a beginner or an experienced user, these articles will help you better understand and use Tools.
68 |
69 | ## Contributing
70 |
71 | Have great content to share? We welcome community contributions! Please follow our contribution guidelines to help make this resource even better.
72 |
73 | ---
74 |
75 | *Explore these articles to enhance your Tools experience!*
--------------------------------------------------------------------------------
/content/sources/Andrej Karpathy.md:
--------------------------------------------------------------------------------
1 | Source: https://x.com/karpathy/status/1959703967694545296
2 | Continuing the journey of optimal LLM-assisted coding experience. In particular, I find that instead of narrowing in on a perfect one thing my usage is increasingly diversifying across a few workflows that I "stitch up" the pros/cons of:
3 |
4 | Personally the bread & butter (~75%?) of my LLM assistance continues to be just (Cursor) tab complete. This is because I find that writing concrete chunks of code/comments myself and in the right part of the code is a high bandwidth way of communicating "task specification" to the LLM, i.e. it's primarily about task specification bits - it takes too many bits and too much latency to communicate what I want in text, and it's faster to just demonstrate it in the code and in the right place. Sometimes the tab complete model is annoying so I toggle it on/off a lot.
5 |
6 | Next layer up is highlighting a concrete chunk of code and asking for some kind of a modification.
7 |
8 | Next layer up is Claude Code / Codex / etc, running on the side of Cursor, which I go to for larger chunks of functionality that are also fairly easy to specify in a prompt. These are super helpful, but still mixed overall and slightly frustrating at times. I don't run in YOLO mode because they can go off-track and do dumb things you didn't want/need and I ESC fairly often. I also haven't learned to be productive using more than one instance in parallel - one already feels hard enough. I haven't figured out a good way to keep CLAUDE[.]md good or up to date. I often have to do a pass of "cleanups" for coding style, or matters of code taste. E.g. they are too defensive and often over-use try/catch statements, they often over-complicate abstractions, they overbloat code (e.g. a nested if-the-else constructs when a list comprehension or a one-liner if-then-else would work), or they duplicate code chunks instead of creating a nice helper function, things like that... they basically don't have a sense of taste. They are indispensable in cases where I inch into a more vibe-coding territory where I'm less familiar (e.g. writing some rust recently, or sql commands, or anything else I've done less of before). I also tried CC to teach me things alongside the code it was writing but that didn't work at all - it really wants to just write code a lot more than it wants to explain anything along the way. I tried to get CC to do hyperparameter tuning, which was highly amusing. They are also super helpful in all kinds of lower-stakes one-off custom visualization or utilities or debugging code that I would never write otherwise because it would have taken way too long. E.g. CC can hammer out 1,000 lines of one-off extensive visualization/code just to identify a specific bug, which gets all deleted right after we find it. It's the code post-scarcity era - you can just create and then delete thousands of lines of super custom, super ephemeral code now, it's ok, it's not this precious costly thing anymore.
9 |
10 | Final layer of defense is GPT5 Pro, which I go to for the hardest things. E.g. it has happened to me a few times now that I / Cursor / CC are all stuck on a bug for 10 minutes, but when I copy paste the whole thing to 5 Pro, it goes off for 10 minutes but then actually finds a really subtle bug. It is very strong. It can dig up all kinds of esoteric docs and papers and such. I've also used it for other meatier tasks, e.g. suggestions on how to clean up abstractions (mixed results, sometimes good ideas but not all), or an entire literature review around how people do this or that and it comes back with good relevant resources / pointers.
11 |
12 | Anyway, coding feels completely blown open with possibility across a number of "kinds" of coding and then a number of tools with their pros/cons. It's hard to avoid the feeling of anxiety around not being at the frontier of what is collectively possible, hence random sunday shower of thoughts and a good amount of curiosity about what others are finding.
--------------------------------------------------------------------------------
/content/docs/zh/tools/cui-web-ui.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "CUI: Claude Code Web UI"
3 | description: "一个现代化的 Claude Code 代理 Web UI,允许您在任何浏览器中访问 Claude Code,支持并行后台代理和任务管理。"
4 | language: "zh"
5 | author: "wbopan"
6 | source: "https://github.com/wbopan/cui"
7 | date: "2025-01-15"
8 | ---
9 |
10 | # CUI: Claude Code Web UI
11 |
12 | > **⭐ GitHub**: [wbopan/cui](https://github.com/wbopan/cui) (455 stars)
13 |
14 | 一个现代化的 Claude Code 代理 Web UI。启动服务器,在浏览器中访问 Claude Code。
15 |
16 | ## 亮点
17 |
18 | * **现代设计**: 精美的响应式 UI,可在任何地方工作
19 | * **并行后台代理**: 同时流式处理多个会话
20 | * **任务管理**: 访问所有对话并分支/恢复/归档它们
21 | * **Claude Code 兼容性**: 熟悉的自动完成和 CLI 交互
22 | * **推送通知**: 当代理完成时获得通知
23 | * **语音听写**: 由 Gemini 2.5 Flash 提供精确的语音听写
24 |
25 | ## 开始使用
26 |
27 | 1. 确保您已登录 Claude Code 或拥有有效的 Anthropic API 密钥。
28 | 2. 使用 Node.js >= 20.19.0,启动服务器:
29 | ```bash
30 | npx cui-server
31 | ```
32 | 或全局安装:
33 | ```bash
34 | npm install -g cui-server
35 | ```
36 | 3. 在浏览器中打开 `http://localhost:3001/#your-token`(令牌将显示在 cui-server 命令输出中)。
37 | 4. (可选)配置通知和听写设置。
38 |
39 | ## 使用方法
40 |
41 | ### 任务
42 |
43 | * **启动新任务**
44 | cui 自动扫描 `~/.claude/` 中现有的 Claude Code 历史记录并在主页上显示,允许您恢复任何之前的任务。输入区域的下拉菜单显示所有之前的工作目录。
45 |
46 | * **分支任务**
47 | 要从现有任务创建分支(仅支持从 cui 启动的任务),导航到主页的"历史"选项卡,找到要分支的会话,并使用新消息恢复它。
48 |
49 | * **管理任务**
50 | 启动任务后可以随意关闭页面——它将在后台继续运行。运行多个任务时(从 cui 启动),您可以在"任务"选项卡中检查其状态。您也可以通过点击"归档"按钮来归档任务。归档的任务在"已归档"选项卡中仍然可访问。
51 |
52 | ### 语音听写
53 |
54 | cui 使用 Gemini 2.5 Flash 提供高度准确的语音听写,对长句子特别有效。要启用此功能,您需要具有慷慨免费层使用量的 Gemini API 密钥。在启动服务器之前设置 `GOOGLE_API_KEY` 环境变量。请注意,使用此功能将与 Google 共享您的音频数据。
55 |
56 | ### 通知
57 |
58 | 当任务完成或 Claude 等待您允许使用工具时,您可以接收推送通知。通知使用 ntfy 发送。要接收它们,在任何设备上安装 ntfy 并订阅主题(请参阅设置)。
59 |
60 | ### 键盘快捷键
61 |
62 | 更多键盘快捷键即将推出。目前可用:
63 |
64 | * `Enter`: 输入新行
65 | * `Command/Ctrl + Enter`: 发送消息
66 | * `/`: 列出所有命令
67 | * `@`: 列出当前工作目录中的所有文件
68 |
69 | 所有内联语法如 `/init` 或 `@file.txt` 都像在 CLI 中一样受支持。
70 |
71 | ### 远程访问
72 |
73 | 1. 打开 `~/.cui/config.json` 设置 `server.host` (0.0.0.0) 和 `server.port`。或者,您可以在启动服务器时使用 `--host` 和 `--port` 标志。
74 | 2. 如果从本地网络外部访问服务器,请确保使用安全身份验证令牌。身份验证令牌在启动服务器时生成,可以在 `~/.cui/config.json` 文件中更改。
75 | 3. 推荐:使用 HTTPS 访问服务器。您可以使用反向代理如 Caddy 来设置。在 iOS 上,听写功能仅在您使用 HTTPS 时可用。
76 |
77 | ### 配置
78 |
79 | 所有配置和数据都存储在 `~/.cui/` 中。
80 |
81 | * `config.json` - 服务器设置
82 | * `session-info.json` - 会话元数据
83 | * `preferences.json` - 用户偏好
84 |
85 | 要卸载 cui,只需删除 `~/.cui/` 目录并使用 `npm uninstall -g cui-server` 删除包。
86 |
87 | ## 主要功能
88 |
89 | ### 基于 Web 的界面
90 | - **浏览器访问**: 从任何带有 Web 浏览器的设备访问 Claude Code
91 | - **响应式设计**: 在桌面、平板和移动设备上无缝工作
92 | - **现代 UI**: 符合现代 Web 标准的干净直观界面
93 |
94 | ### 多会话管理
95 | - **并行处理**: 同时运行多个 Claude Code 会话
96 | - **后台执行**: 即使关闭浏览器,任务也会继续运行
97 | - **会话历史**: 自动扫描并显示您现有的 Claude Code 历史记录
98 |
99 | ### 高级功能
100 | - **语音听写**: 由 Gemini 2.5 Flash 提供准确的语音转文本
101 | - **推送通知**: 任务完成或需要关注时的实时提醒
102 | - **远程访问**: 通过适当配置从任何地方安全访问
103 |
104 | ### CLI 兼容性
105 | - **熟悉命令**: 所有 CLI 命令和快捷键在 Web 界面中工作
106 | - **文件操作**: 完全支持文件浏览和操作
107 | - **工具集成**: 完全访问所有 Claude Code 工具和功能
108 |
109 | ## 使用场景
110 |
111 | ### 对于开发者
112 | - **远程开发**: 从任何设备或位置访问 Claude Code
113 | - **团队协作**: 与团队成员共享会话和协作
114 | - **移动开发**: 在平板和移动设备上使用 Claude Code
115 |
116 | ### 对于团队
117 | - **集中访问**: 为团队成员提供基于 Web 的 Claude Code 访问
118 | - **会话共享**: 轻松共享和恢复协作会话
119 | - **监控**: 跟踪团队使用情况和会话活动
120 |
121 | ### 对于组织
122 | - **企业部署**: 在内部服务器上部署 CUI 以安全访问
123 | - **用户管理**: 通过配置控制访问和权限
124 | - **集成**: 与现有开发工作流程和工具集成
125 |
126 | ## 技术要求
127 |
128 | - **Node.js**: >= 20.19.0
129 | - **Claude Code**: 必须安装和配置
130 | - **网络访问**: 用于远程访问和通知
131 | - **可选**: 用于听写功能的 Gemini API 密钥
132 |
133 | ## 贡献
134 |
135 | 贡献的最佳方式是提出改进建议或在问题中报告错误,并给我们一个星标 ⭐!
136 |
137 | 在提交 PR 之前,请确保您(或您的 AI 伙伴)已阅读 CONTRIBUTING.md。
138 |
139 | ## 许可证
140 |
141 | Apache-2.0 许可证
142 |
143 | ---
144 |
145 | ## 来源和致谢
146 |
147 | 本文基于 [wbopan/cui](https://github.com/wbopan/cui) GitHub 仓库整理而成。
148 |
149 | **原作者**: wbopan
150 | **原始链接**: https://github.com/wbopan/cui
151 | **许可证**: Apache-2.0 License
152 |
153 | 感谢 wbopan 创建了这个优秀的 Claude Code Web UI,为 AI 辅助开发提供了现代化的浏览器界面和强大的多会话管理能力。
--------------------------------------------------------------------------------
/content/sources/community-tips-code-simplifie.md:
--------------------------------------------------------------------------------
1 | 为了防止 claude code 习惯性代码过度膨胀,我的做法是使用一个 code-simplifie 的 sub agent ,要求每一个功能/todo之后都需要使 code-simplifie 优化代码。
2 |
3 | 缺点是功能的完成速度会慢一倍,好处是代码量会少一点。
4 |
5 | ---
6 | name: code-simplifier
7 | description: Use this agent when you have functional code that needs refactoring to improve readability, reduce complexity, or eliminate redundancy. Examples: Context: User has written a complex function with nested conditionals and wants to simplify it. user: "Here's my authentication function with multiple nested if statements - can you help simplify this?" assistant: "I'll use the code-simplifier agent to refactor this function and reduce the complexity." The user has complex code that needs simplification, so use the code-simplifier agent to apply refactoring techniques. Context: User has legacy code with duplicated logic across multiple methods. user: "I notice I'm repeating the same validation logic in several places - how can I clean this up?" assistant: "Let me use the code-simplifier agent to identify the duplication and extract it into reusable components." Since there's code duplication that needs to be eliminated following DRY principles, use the code-simplifier agent. Context: User has working code but wants to modernize it with current language features. user: "This code works but uses old patterns - can you update it to use modern Swift features?" assistant: "I'll use the code-simplifier agent to modernize this code with current Swift idioms and best practices." The user wants to modernize legacy code, which is a perfect use case for the code-simplifier agent.
8 | model: sonnet
9 | color: purple
10 | ---
11 |
12 | You are a specialist in code refactoring and simplification. Your purpose is to take existing code and make it more concise, readable, and efficient without altering its external functionality. You are an expert at identifying complexity and applying techniques to reduce it.
13 |
14 | When analyzing code, you will:
15 |
16 | **Identify and Eliminate Redundancy:**
17 | - Find and remove duplicated code by extracting it into reusable functions, classes, or modules following the DRY principle
18 | - Replace custom verbose implementations with built-in language features and standard libraries
19 | - Consolidate similar logic patterns into unified approaches
20 |
21 | **Enhance Readability:**
22 | - Simplify complex conditional logic using guard clauses, early returns, polymorphism, or pattern matching
23 | - Break down large methods into smaller, single-responsibility functions with descriptive names
24 | - Improve variable, function, and class naming to be more descriptive and intuitive
25 | - Reduce nesting levels and cognitive complexity
26 |
27 | **Modernize Syntax and Idioms:**
28 | - Update code to use modern language features and idiomatic expressions (e.g., Swift's modern concurrency, optional chaining, property wrappers)
29 | - Replace verbose patterns with concise, expressive alternatives
30 | - Apply current best practices and language conventions
31 | - Leverage functional programming concepts where appropriate
32 |
33 | **Improve Structure:**
34 | - Analyze dependencies and suggest better separation of concerns following SOLID principles
35 | - Identify opportunities to extract protocols, extensions, or utility classes
36 | - Recommend architectural improvements that enhance maintainability
37 | - Ensure proper encapsulation and information hiding
38 |
39 | **Your approach:**
40 | 1. First, analyze the provided code to understand its functionality and identify complexity issues
41 | 2. Explain what makes the current code complex or difficult to maintain
42 | 3. Present the simplified version with clear explanations of each improvement
43 | 4. Highlight the specific techniques used (e.g., "extracted common logic", "applied guard clauses", "used modern Swift features")
44 | 5. Ensure the refactored code maintains identical external behavior and functionality
45 | 6. When relevant, mention performance improvements or potential issues to watch for
46 |
47 | Always preserve the original functionality while making the code more elegant, maintainable, and aligned with modern best practices. Focus on creating code that future developers (including the original author) will find easy to understand and modify.
--------------------------------------------------------------------------------
/content/docs/zh/best-practices/index.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 最佳实践
3 | description: 学习有效使用 ClaudeCode 的最佳实践
4 | lang: zh
5 | ---
6 |
7 | # 最佳实践
8 |
9 | 欢迎来到 最佳实践 专区!在这里您将找到关于 最佳实践 的宝贵资源和指南。
10 |
11 | ## 您可以在这里找到
12 |
13 | 本专区包含:
14 |
15 | - **实用指南**:最佳实践 的详细使用指南
16 | - **最佳实践**:经过验证的最佳实践和技巧
17 | - **案例研究**:真实世界的应用案例
18 | - **高级技巧**:提升效率的高级技巧
19 |
20 | ## 精选文章
21 |
22 |
23 |
28 |
33 |
38 |
43 |
48 |
53 |
58 |
63 |
68 |
73 |
78 |
83 |
88 |
93 |
98 |
103 |
108 |
109 |
110 | ## 开始使用
111 |
112 | 无论您是初学者还是经验丰富的用户,这些文章都将帮助您更好地理解和使用 最佳实践。
113 |
114 | ## 贡献
115 |
116 | 有好的内容要分享吗?我们欢迎社区贡献!请遵循我们的贡献指南,帮助让这个资源变得更好。
117 |
118 | ---
119 |
120 | *探索这些文章,提升您的 最佳实践 使用体验!*
--------------------------------------------------------------------------------
/content/sources/cui-web-ui_2025-01-15.md:
--------------------------------------------------------------------------------
1 | # cui: Claude Code Web UI
2 |
3 | A modern web UI for Claude Code agents. Start the server and access Claude Code anywhere in your browser.
4 |
5 | ## GitHub Stats
6 | - **Stars**: 455
7 | - **Forks**: 36
8 | - **Watchers**: 3
9 | - **Releases**: 8
10 | - **Contributors**: 3
11 |
12 | ## Technology Stack
13 | - **TypeScript**: 91.2%
14 | - **CSS**: 7.1%
15 | - **JavaScript**: 1.6%
16 | - **HTML**: 0.1%
17 |
18 | ## Highlights
19 |
20 | * **Modern Design**: Polished, responsive UI that works anywhere
21 | * **Parallel Background Agents**: Stream multiple sessions simultaneously
22 | * **Manage Tasks**: Access all your conversations and fork/resume/archive them
23 | * **Claude Code Parity**: Familiar autocompletion and interaction with CLI
24 | * **Push Notifications**: Get notified when your agents are finished
25 | * **Dictation**: Precise dictation powered by Gemini 2.5 Flash
26 |
27 | ## Getting Started
28 |
29 | 1. Ensure you're logged into Claude Code or have a valid Anthropic API key.
30 | 2. With Node.js >= 20.19.0, start the server:
31 | ```bash
32 | npx cui-server
33 | ```
34 | or install it globally:
35 | ```bash
36 | npm install -g cui-server
37 | ```
38 | 3. Open in your browser (the token will be displayed in the cui-server command output).
39 | 4. (Optional) Configure the settings for notifications and dictation.
40 |
41 | ## Usage
42 |
43 | ### Tasks
44 |
45 | * **Start a New Task**
46 | cui automatically scans your existing Claude Code history in `~/.claude/` and displays it on the home page, allowing you to resume any of your previous tasks. The dropdown menu in the input area shows all your previous working directories.
47 |
48 | * **Fork a Task**
49 | To create a branch from an existing task (only supported for tasks started from cui), navigate to the "History" tab on the home page, find the session you want to fork, and resume it with new messages.
50 |
51 | * **Manage Tasks**
52 | Feel free to close the page after starting a task—it will continue running in the background. When running multiple tasks (started from cui), you can check their status in the "Tasks" tab. You can also archive tasks by clicking the "Archive" button. Archived tasks remain accessible in the "Archived" tab.
53 |
54 | ### Dictation
55 |
56 | cui uses Gemini 2.5 Flash to provide highly accurate dictation, particularly effective for long sentences. To enable this feature, you'll need a Gemini API key with generous free-tier usage. Set the `GOOGLE_API_KEY` environment variable before starting the server. Note that using this feature will share your audio data with Google.
57 |
58 | ### Notifications
59 |
60 | You can receive push notifications when your task is finished or when Claude is waiting for your permission to use tools. Notifications are sent using ntfy. To receive them, install ntfy on any of your devices and subscribe to the topic (see settings).
61 |
62 | ### Keyboard Shortcuts
63 |
64 | More keyboard shortcuts are coming. Currently available:
65 |
66 | * `Enter`: Enter a new line
67 | * `Command/Ctrl + Enter`: Send message
68 | * `/`: List all commands
69 | * `@`: List all files in the current working directory
70 |
71 | All inline syntaxes like `/init` or `@file.txt` are supported just like in the CLI.
72 |
73 | ### Remote Access
74 |
75 | 1. Open `~/.cui/config.json` to set the `server.host` (0.0.0.0) and `server.port`. Alternatively, you can use `--host` and `--port` flags when starting the server.
76 | 2. Ensure you use a secure auth token if accessing the server from outside your local network. The auth token is generated when you start the server and can be changed in the `~/.cui/config.json` file.
77 | 3. Recommended: Use HTTPS to access the server. You can use a reverse proxy like Caddy to set this up. On iOS, the dictation feature is only available when using HTTPS.
78 |
79 | ### Configuration
80 |
81 | All configuration and data are stored in `~/.cui/`.
82 |
83 | * `config.json` - Server settings
84 | * `session-info.json` - Session metadata
85 | * `preferences.json` - User preferences
86 |
87 | To uninstall cui, simply delete the `~/.cui/` directory and remove the package with `npm uninstall -g cui-server`.
88 |
89 | ## Contributing
90 |
91 | The best way to contribute is to suggest improvements or report bugs in the issues and give us a star ⭐!
92 |
93 | Before submitting a PR, please make sure you (or your fellow AI) have read CONTRIBUTING.md.
94 |
95 | ## License
96 |
97 | Apache-2.0 license
--------------------------------------------------------------------------------
/content/docs/zh/tools/claude-code-templates.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Claude Code Templates: 配置和监控 Claude Code 的 CLI 工具"
3 | description: "一个全面的 CLI 工具,用于配置和监控 Claude Code,具有框架特定命令、实时分析仪表板和独立组件安装功能。"
4 | language: "zh"
5 | author: "davila7"
6 | source: "https://github.com/davila7/claude-code-templates"
7 | date: "2025-01-15"
8 | ---
9 |
10 | # Claude Code Templates: 配置和监控 Claude Code 的 CLI 工具
11 |
12 | > **⭐ GitHub**: [davila7/claude-code-templates](https://github.com/davila7/claude-code-templates) (2.6k stars)
13 |
14 | **配置和监控 Claude Code 的 CLI 工具** - 为任何项目提供快速设置,包含框架特定命令和实时监控仪表板。
15 |
16 | ## 🚀 快速开始
17 |
18 | ```bash
19 | # 交互式设置(推荐)
20 | npx claude-code-templates@latest
21 |
22 | # 实时分析仪表板
23 | npx claude-code-templates@latest --analytics
24 |
25 | # 实时聊天 Web UI
26 | npx claude-code-templates@latest --chats
27 |
28 | # 系统健康检查
29 | npx claude-code-templates@latest --health-check
30 | ```
31 |
32 | ## ✨ 核心功能
33 |
34 | - **📋 智能项目设置** - 自动检测和配置任何项目,提供框架特定命令
35 | - **📊 实时分析** - 通过实时状态检测和性能指标监控 Claude Code 会话
36 | - **🔍 健康检查** - 全面的系统验证,提供可操作的推荐
37 | - **🧩 独立组件** - 单独安装专门的代理、命令和 MCP
38 |
39 | ## 🌐 浏览和安装组件
40 |
41 | **🎯 浏览所有组件** - 交互式 Web 界面,用于探索和安装模板、代理、命令和 MCP。
42 |
43 | 访问: [aitmpl.com](https://aitmpl.com)
44 |
45 | ## 🎯 您将获得什么
46 |
47 | | 组件 | 描述 | 示例 |
48 | | ----------- | ---------------------------- | ------------------------------------------------------------ |
49 | | **CLAUDE.md** | 项目特定配置 | 框架最佳实践、编码标准 |
50 | | **Commands** | 自定义斜杠命令 | /generate-tests, /check-file, /optimize-bundle |
51 | | **Agents** | 领域 AI 专家 | API 安全审计、React 性能、数据库优化 |
52 | | **MCPs** | 外部服务集成 | GitHub、数据库、开发工具 |
53 | | **Analytics** | 实时监控仪表板 | 实时会话跟踪、使用统计、导出 |
54 |
55 | ## 📖 文档
56 |
57 | **📚 完整文档** - 综合指南、示例和 API 参考
58 |
59 | 文档: [docs.aitmpl.com](https://docs.aitmpl.com)
60 |
61 | 快速链接:
62 |
63 | - **开始使用** - 安装和第一步
64 | - **项目设置** - 配置您的项目
65 | - **分析仪表板** - 实时监控
66 | - **独立组件** - 代理、命令、MCP
67 | - **CLI 选项** - 所有可用命令
68 | - **🔍 跟踪系统架构** - 带有 Mermaid 图表的技术文档
69 |
70 | ## 🎯 关键组件
71 |
72 | ### CLAUDE.md 模板
73 | 项目特定的配置文件,为 Claude Code 提供框架最佳实践和编码标准。
74 |
75 | ### 自定义命令
76 | 专门的斜杠命令,扩展 Claude Code 的功能:
77 | - `/generate-tests` - 自动化测试生成
78 | - `/check-file` - 文件验证和分析
79 | - `/optimize-bundle` - 性能优化
80 |
81 | ### AI 代理
82 | 可以集成到您工作流程中的领域特定 AI 专家:
83 | - **API 安全审计** - 全面的安全分析
84 | - **React 性能** - 前端优化
85 | - **数据库优化** - 查询和模式优化
86 |
87 | ### MCP(模型上下文协议)集成
88 | 将 Claude Code 与开发工具连接的外部服务集成:
89 | - **GitHub 集成** - 仓库管理和协作
90 | - **数据库连接** - 直接数据库访问和查询
91 | - **开发工具** - IDE 和构建系统集成
92 |
93 | ### 分析仪表板
94 | 实时监控功能:
95 | - **实时会话跟踪** - 监控活跃的 Claude Code 会话
96 | - **使用统计** - 跟踪使用模式和性能
97 | - **导出功能** - 生成报告和洞察
98 |
99 | ## 🤝 贡献
100 |
101 | 我们欢迎开源社区的贡献!
102 |
103 | **🎯 浏览组件** 查看可用的内容,然后查看我们的贡献指南来添加您自己的模板、代理、命令或 MCP。
104 |
105 | **贡献前请阅读我们的行为准则。**
106 |
107 | ## 归属
108 |
109 | 此集合包含来自多个来源的组件:
110 |
111 | **代理集合:**
112 | - **wshobson/agents Collection** by wshobson - 基于 MIT 许可证(48 个代理)
113 |
114 | **命令集合:**
115 | - **awesome-claude-code Commands** by hesreallyhim - 基于 CC0 1.0 Universal(21 个命令)
116 |
117 | ## 📄 许可证
118 |
119 | 本项目基于 MIT 许可证 - 详情请参阅 LICENSE 文件。
120 |
121 | ## 🔗 链接
122 |
123 | - **🌐 浏览组件**: [aitmpl.com](https://aitmpl.com)
124 | - **📚 文档**: [docs.aitmpl.com](https://docs.aitmpl.com)
125 | - **🐛 问题**: [GitHub Issues](https://github.com/davila7/claude-code-templates/issues)
126 | - **💬 讨论**: [GitHub Discussions](https://github.com/davila7/claude-code-templates/discussions)
127 | - **🔒 安全**: [安全政策](https://github.com/davila7/claude-code-templates/security)
128 |
129 | ## 使用场景
130 |
131 | ### 对于开发者
132 | - **快速项目设置** - 在任何框架中开始使用 Claude Code
133 | - **自定义工作流程** - 为您的开发过程创建专门的命令
134 | - **性能监控** - 跟踪和优化您的 AI 辅助开发
135 |
136 | ### 对于团队
137 | - **标准化配置** - 确保团队成员之间一致的 Claude Code 设置
138 | - **分析洞察** - 了解团队使用模式和生产力
139 | - **协作工具** - 共享和重用自定义命令和代理
140 |
141 | ### 对于组织
142 | - **企业集成** - 与现有开发工具和工作流程连接
143 | - **安全合规** - 使用专门的代理进行安全审计
144 | - **可扩展监控** - 跟踪多个团队和项目的使用情况
145 |
146 | ---
147 |
148 | ## 来源和致谢
149 |
150 | 本文基于 [davila7/claude-code-templates](https://github.com/davila7/claude-code-templates) GitHub 仓库整理而成。
151 |
152 | **原作者**: davila7
153 | **原始链接**: https://github.com/davila7/claude-code-templates
154 | **许可证**: MIT License
155 |
156 | 感谢 davila7 和所有贡献者创建了这个优秀的 Claude Code 工具集合,为 AI 辅助开发提供了强大的配置和监控能力。
--------------------------------------------------------------------------------
/lib/changelog.ts:
--------------------------------------------------------------------------------
1 | import fs from 'fs';
2 | import path from 'path';
3 | import matter from 'gray-matter';
4 |
5 | export interface ChangelogEntry {
6 | title: string;
7 | description: string;
8 | date: string;
9 | category: string;
10 | language: 'zh' | 'en';
11 | slug: string;
12 | url: string;
13 | }
14 |
15 | export interface CourseEntry {
16 | title: string;
17 | description: string;
18 | url: string;
19 | provider: string;
20 | duration?: string;
21 | instructor?: string;
22 | }
23 |
24 | export function getRecentUpdates(limit: number = 5): ChangelogEntry[] {
25 | const entries: ChangelogEntry[] = [];
26 |
27 | // 扫描所有文档目录
28 | const docsDir = path.join(process.cwd(), 'content/docs');
29 |
30 | function scanDirectory(dir: string, lang: 'zh' | 'en') {
31 | if (!fs.existsSync(dir)) return;
32 |
33 | const items = fs.readdirSync(dir, { withFileTypes: true });
34 |
35 | for (const item of items) {
36 | const fullPath = path.join(dir, item.name);
37 |
38 | if (item.isDirectory()) {
39 | // 递归扫描子目录
40 | scanDirectory(fullPath, lang);
41 | } else if (item.isFile() && item.name.endsWith('.mdx')) {
42 | try {
43 | // 读取MDX文件
44 | const content = fs.readFileSync(fullPath, 'utf-8');
45 | const { data } = matter(content);
46 |
47 | // 检查是否有必要的元数据
48 | if (data.date && data.title) {
49 | const relativePath = path.relative(path.join(process.cwd(), 'content/docs'), fullPath);
50 | const slug = relativePath.replace(/\.mdx$/, '');
51 |
52 | entries.push({
53 | title: data.title,
54 | description: data.description || '',
55 | date: data.date,
56 | category: data.category || 'general',
57 | language: lang,
58 | slug,
59 | url: `/docs/${slug}`
60 | });
61 | }
62 | } catch (error) {
63 | console.warn(`Failed to parse MDX file: ${fullPath}`, error);
64 | // 跳过有问题的文件,继续处理其他文件
65 | continue;
66 | }
67 | }
68 | }
69 | }
70 |
71 | try {
72 | // 只扫描中文文档,避免中英文重复
73 | scanDirectory(path.join(docsDir, 'zh'), 'zh');
74 |
75 | // 按日期排序,最新的在前
76 | entries.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
77 |
78 | return entries.slice(0, limit);
79 | } catch (error) {
80 | console.warn('Error scanning documents:', error);
81 | return [];
82 | }
83 | }
84 |
85 | export function getChangelogByCategory(category: string, limit: number = 3): ChangelogEntry[] {
86 | const allEntries = getRecentUpdates(20); // 获取更多条目以便筛选
87 | return allEntries
88 | .filter(entry => entry.category === category)
89 | .slice(0, limit);
90 | }
91 |
92 | export function getLatestAdvancedArticles(limit: number = 3): ChangelogEntry[] {
93 | return getChangelogByCategory('advanced', limit);
94 | }
95 |
96 | export function getClaudeCodeCourses(): CourseEntry[] {
97 | return [
98 | {
99 | title: "Claude Code: A Highly Agentic Coding Assistant",
100 | description: "Learn best practices for agentic coding with Claude Code. Explore codebases, develop features, test, refactor, and debug with AI assistance. Master MCP servers, GitHub integration, and advanced workflows.",
101 | url: "https://www.deeplearning.ai/short-courses/claude-code-a-highly-agentic-coding-assistant/",
102 | provider: "DeepLearning.AI",
103 | duration: "1 Hour 50 Minutes",
104 | instructor: "Elie Schoppik"
105 | },
106 | {
107 | title: "Claude Code in Action",
108 | description: "Comprehensive training on using Claude Code for software development. Learn coding assistant architecture, tool use systems, context management, and advanced integration strategies.",
109 | url: "https://anthropic.skilljar.com/claude-code-in-action",
110 | provider: "Anthropic Academy",
111 | duration: "Self-paced",
112 | instructor: "Anthropic Team"
113 | },
114 | {
115 | title: "Build with Claude",
116 | description: "Start developing Claude-powered applications with comprehensive API guides and best practices. Learn about Claude 4, APIs & SDKs, Computer Use, and advanced development techniques.",
117 | url: "https://www.anthropic.com/learn/build-with-claude",
118 | provider: "Anthropic",
119 | duration: "Self-paced",
120 | instructor: "Anthropic Team"
121 | }
122 | ];
123 | }
--------------------------------------------------------------------------------
/content/sources/best-practices-cal-rueb.md:
--------------------------------------------------------------------------------
1 | https://www.youtube.com/watch?v=gv0WHhKelSE
2 | [Claude Code 最佳实践]
3 | 来自 Anthropic 技术团队成员 Cal Rueb 在 'Code w/ Claude' 的主题演讲,通过自己的使用经历、工具的底层工作原理、适用场景以及最佳实践,为我们全面展示了 Claude Code 的魅力和实用性,他强调的“简单但有效”的设计哲学,以及对安全、权限的重视,说明 Anthropic 在打造实用工具时兼顾了可靠性和用户体验。
4 |
5 | Cal 的亲身经历:从“上瘾”到核心贡献者
6 | Cal 分享了自己如何“迷上” Claude Code 的故事。他是个爱折腾代码但总半途而废的程序员,去年在公司 Slack 里听说这个工具后,迫不及待在周末下载试玩。他用 Claude Code 开发一个笔记应用,整个人像着了魔,抱着笔记本到处跑,边按回车边看应用在眼前成型。那种“看着代码自己长出来”的感觉,让他彻底改变了对编码的看法。
7 |
8 | 更有趣的是,Claude Code 团队有个内部排行榜,记录员工的使用量。Cal 那周末疯狂“肝”工具,直接冲到榜首,引起了团队注意。他因此认识了开发团队,开始贡献自己的提示工程经验,最终成了核心成员,负责优化系统提示、工具描述和评估方法。
9 |
10 | 这个故事不仅让人觉得 Claude Code 好玩,还传递了一个信息:它对新手和专家都友好,能迅速提升编码效率。
11 |
12 | Claude Code 的最佳用例
13 | Cal 总结了 Claude Code 的几大“杀手级”应用场景,覆盖了从代码探索到部署的整个开发生命周期:
14 | · 代码库探索:跳进一个陌生代码库时,Claude Code 能帮你快速上手。你可以问它“这个功能在哪实现的?”或者“看看 Git 历史,讲讲这文件最近咋改的?”它会像老司机一样带你熟悉项目,省去摸索时间。
15 | · 头脑风暴:在动手写代码前,你可以让 Claude Code 搜索代码库,提出 2-3 种实现方案,帮你理清思路。比如,“我想加个新功能,搜搜看咋搞,给我几个选项。”
16 | · 代码编写:从零开始建应用(比如写个小游戏)超级爽,Claude Code 能快速搭框架。但更牛的是,它擅长在现有代码库里干活,比如加功能、写单元测试、优化代码。因为它会自动跑测试、检查 TS 和 linting,代码质量有保障。
17 | · 提交与 PR:写完代码后,让 Claude Code 帮你写清晰的 Git 提交信息或 PR 描述,省时又专业。
18 | · 部署与 CI/CD:通过 Claude Code 的 SDK,你可以把它嵌入 CI/CD 流程,比如用在 GitHub Actions 里,自动处理某些任务。
19 | · 调试与支持:遇到错误?让 Claude Code 分析日志,定位问题。卡在 Git rebase 里?它能帮你解套。
20 | · 代码迁移:对于大型重构(比如从 Java 老版本升级,或 PHP 转 React),Claude Code 能降低迁移难度,帮你自动化部分工作。
21 |
22 | 最佳实践:如何用好 Claude Code
23 | Cal 分享了几个实用技巧,让你能最大化 Claude Code 的价值。这些建议既有基础操作,也有进阶玩法:
24 | · 用 claude. md 文件:这是 Claude Code 的“记忆本”。在项目根目录或子目录放一个 claude. md,写上项目概况、测试运行方式、代码风格指南等。Claude 启动时会自动读这个文件,相当于给它一份“项目说明书”。你也可以在用户主目录放一个全局 claude. md,记录个人偏好。
25 | · 权限管理:Claude Code 的默认设置是读操作随便,写操作或跑命令得确认。你可以调权限加速流程,比如设置某些命令(像 npm run test)自动通过,或者用“自动接受模式”(Shift+Tab)让 Claude 直接干活。
26 | · 善用 CLI 工具:Claude Code 擅长终端操作,装上 GitHub 的 gh 工具或公司内部 CLI 工具,能让它干更多活。Cal 建议优先用成熟的 CLI 工具,而不是啥都靠 MCP 服务器。
27 | · 上下文管理:Claude 的上下文窗口有 20 万 token,但长对话可能塞满。如果你看到警告,可以用 /clear 清空上下文(保留 claude. md),或者用 /compact 让 Claude 总结对话,压缩上下文继续干活。
28 | · 计划先行:别直接让 Claude 修 bug,先让它搜搜问题,出一份修复计划。你确认计划靠谱后再动手,能省不少时间。Claude 还能自动生成待办清单(to-do list),你可以边看边调整。
29 | · 测试驱动开发:让 Claude 小步快跑,改一点代码就跑测试,检查 TS 和 linting,确保没问题再提交。这样即使出岔子,也能快速回滚。
30 | · 用截图辅助:Claude 支持多模态输入,遇到 UI 问题可以截图扔给它,比如“照着这个 mock.png 建个网页”。
31 | · 进阶玩法:
32 | · 多 Claude 并行:高手可以同时跑 2-4 个 Claude 实例(比如用 Tmux 或多标签页),像指挥乐队一样分工合作。Cal 坦言自己最多搞两个,但见过四 Claude 大神。
33 | · 善用 Escape 键:Claude 干活时,你可以随时按 Escape 打断,调整方向。双击 Escape 还能回溯对话,改之前的指令。
34 | · 扩展工具:如果默认工具不够用,可以加 MCP 服务器,解锁更多功能。
35 | · 无头自动化:用 Claude Code SDK 在 CI/CD 或其他流程里跑自动化任务,比如自动审代码、写测试。
36 |
37 | 新功能亮点
38 | Cal 在演讲最后展示了几个刚发布的功能,凸显 Claude Code 的快速迭代:
39 | · 切换模型:用 /model 查看当前模型(默认是 Sonnet),可以切到 Opus。/config 还能调其他设置。
40 | · 增强思考能力:新模型(Claude 4)支持在工具调用间“思考”,能更聪明地分析问题。比如让它“think hard”去理解项目结构,你会看到它一边搜文件一边推理,过程透明。
41 | · IDE 集成:VS Code 和 JetBrains 的插件更强大,Claude 能感知你当前编辑的文件,上下文更精准。
42 | · 保持更新:Claude Code 在 GitHub 上有公开项目,Cal 建议每周看下变更日志,紧跟新功能。
43 |
44 | 观众问答:解决实际问题
45 | 演讲最后,Cal 回答了几个观众的疑问,透露了一些实用信息:
46 | · 多 claude. md 文件咋办?默认只读当前目录的 claude. md,但 Claude 搜子目录时会读相关的 claude. md。你还可以在 claude. md 里用 @ 引用其他文件,灵活组合。
47 | · Claude 不听 claude. md 咋整? 早期模型确实有点“倔”,比如爱加没用的代码注释。Claude 4 改进了指令遵循能力,Cal 建议升级模型并检查 claude. md 内容,删掉过时指令。
48 | · 多智能体协作咋搞? 目前没原生支持复杂多智能体上下文共享,但可以让智能体写共享文件(比如 ticket. md)来传递状态。未来可能会有更优雅的解决方案。
49 |
50 | ——
51 | Essential Claude Code best practices from Anthropic's Cal Rueb
52 | Just watched this excellent presentation from a core Claude Code contributor at Anthropic. Here are the most actionable best practices:
53 | Essential setup:
54 | - claude.md files are crucial for persistent context. Put project-specific ones in your repo root, personal defaults in your home directory.
55 | - Configure permission management: auto-accept safe commands like npm run test, use Shift+Tab for auto-accept mode.
56 |
57 | Workflow optimization
58 | - Ask Claude to explore and create a plan before implementation instead of diving straight into codin
59 | - Use /compact to summarize long sessions vs /clear to start fresh
60 | - Press Escape strategically to redirect Claude when it goes off track
61 | - Use "think hard" with Claude 4 for complex debugging (models now think between tool calls)
62 |
63 | Advanced techniques:
64 | - Run multiple Claude instances in parallel for complex projects
65 | - Screenshots work well for UI guidance since the models are multimodal
66 | - Install CLI tools (like GitHub's gh) rather than MCP servers when possible for better performance
67 |
68 | Key insight: Claude Code uses agentic search (grep, find, glob) to explore codebases naturally, just like humans do. No fancy indexing needed.
69 | The talk covers much more detail on context management, integration setup, and real workflows. Definitely worth the full watch if you're serious about maximizing Claude Code.
--------------------------------------------------------------------------------
/content/docs/zh/community-tips/fradser-trust-init-command.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: "FradSer:信任 /init 命令"
3 | description: "学习来自社区专家 FradSer 的实用技巧,最大化 Claude Code 的有效性"
4 | language: zh
5 | author: "FradSer"
6 | source: "https://x.com/FradSer/status/1952205197784297646"
7 | date: "2025-01-27"
8 | ---
9 |
10 | # FradSer:信任 /init 命令
11 |
12 | ## 概述
13 |
14 | 基于对 Claude Code 的丰富经验,社区专家 FradSer 分享了超越官方文档的实用策略,以最大化您的开发效率和代码质量。
15 |
16 | ## 核心原则
17 |
18 | ### 1. 信任 `/init` 命令
19 |
20 | **永远相信 `/init`** - 定期使用 `/init` 命令让您的 `CLAUDE.md` 保持最佳状态。对于重要功能,在子文件夹中创建 `CLAUDE.md` 文件,以在每个级别维护上下文和最佳实践。
21 |
22 | **为什么有效:**
23 | - 保持项目上下文的新鲜和相关
24 | - 确保 Claude Code 拥有关于代码库的最新信息
25 | - 在不同项目领域保持一致性
26 |
27 | ### 2. 拥抱完全权限
28 |
29 | **大胆使用权限** - 当您没有生产环境担忧时,使用 `claude --dangerously-skip-permissions` 授予完全权限。这消除了不必要的限制,让 Claude Code 以最高效率工作。
30 |
31 | **何时使用:**
32 | - 开发环境
33 | - 本地测试场景
34 | - 当您需要最大灵活性时
35 | - 原型设计和实验
36 |
37 | ### 3. 频繁提交
38 |
39 | **Git commit...commit...commit** - 永远不要认为您提交得太频繁。频繁的提交创建清晰的历史记录,使调试更容易,并提供安全的回滚点。
40 |
41 | **好处:**
42 | - 清晰的开发时间线
43 | - 简单的错误跟踪和二分查找
44 | - 安全的实验和回滚能力
45 | - 与团队成员更好的协作
46 |
47 | ### 4. 利用 Git Worktree 配合 Git Flow
48 |
49 | **使用 git worktree 配合 git flow** - 这种组合显著减少了复杂 Git 操作的心智负担。Git worktree 允许您同时处理多个分支,而 git flow 提供结构化的分支策略。
50 |
51 | **设置示例:**
52 | ```bash
53 | # 使用 worktree 创建新功能分支
54 | git worktree add -b feature/new-feature ../new-feature-branch main
55 |
56 | # 在功能分支上工作
57 | cd ../new-feature-branch
58 | # 进行更改,频繁提交
59 |
60 | # 准备合并时
61 | git checkout main
62 | git merge feature/new-feature
63 | git worktree remove ../new-feature-branch
64 | ```
65 |
66 | ### 5. 自由使用 ESC
67 |
68 | **经常按 ESC** - 如果感觉不对,不要犹豫调整方向。ESC 键是您的好朋友,用于:
69 | - 取消进展不顺利的操作
70 | - 需要时重置上下文
71 | - 卡住时重新开始
72 | - 保持对工作流程的控制
73 |
74 | ### 6. 必要的子代理
75 |
76 | **始终在设置中包含这些子代理:**
77 |
78 | #### Tech Lead
79 | - **目的**:设计长期架构目标
80 | - **好处**:防止架构混乱
81 | - **重点**:系统设计、可扩展性、可维护性
82 |
83 | #### UX Reviewer
84 | - **目的**:检查用户体验设计问题
85 | - **好处**:改善可访问性和用户满意度
86 | - **示例**:具有显著 a11y 优化的 Swift 项目
87 |
88 | #### Code Simplifier
89 | - **目的**:防止代码过度工程化
90 | - **优先级**:**第一优先级** - 在其他代理之前使用
91 | - **好处**:保持代码库清洁和可维护
92 |
93 | ## 实施策略
94 |
95 | ### 设置您的环境
96 |
97 | 1. **使用 `/init` 初始化**
98 | ```bash
99 | # 在项目根目录
100 | claude /init
101 | ```
102 |
103 | 2. **创建子文件夹文档**
104 | ```bash
105 | # 对于重要功能
106 | mkdir feature-name
107 | cd feature-name
108 | echo "# 功能文档" > CLAUDE.md
109 | ```
110 |
111 | 3. **配置权限**
112 | ```bash
113 | # 对于开发环境
114 | claude --dangerously-skip-permissions
115 | ```
116 |
117 | ### 工作流程集成
118 |
119 | 1. **每个会话都以 `/init` 开始**
120 | 2. **每次重要更改后提交**
121 | 3. **需要时使用 ESC 重置**
122 | 4. **始终首先运行 Code Simplifier**
123 | 5. **对面向用户的功能使用 UX Reviewer 审查**
124 | 6. **对架构决策咨询 Tech Lead**
125 |
126 | ## 高级技巧
127 |
128 | ### Git Worktree 最佳实践
129 |
130 | ```bash
131 | # 为新功能创建 worktree
132 | git worktree add -b feature/user-auth ../auth-feature main
133 |
134 | # 在功能分支上工作
135 | cd ../auth-feature
136 | # 进行更改,频繁提交
137 |
138 | # 准备合并时
139 | git checkout main
140 | git merge feature/user-auth
141 | git worktree remove ../auth-feature
142 | ```
143 |
144 | ### 子代理优先级顺序
145 |
146 | 1. **Code Simplifier** - 始终首先运行
147 | 2. **Tech Lead** - 用于架构决策
148 | 3. **UX Reviewer** - 用于面向用户的功能
149 | 4. **其他专业代理** - 根据需要
150 |
151 | ### 上下文管理
152 |
153 | - 战略性地使用 `CLAUDE.md` 文件
154 | - 定期使用 `/init` 更新上下文
155 | - 保持文档接近代码
156 | - 为不同功能维护单独的上下文
157 |
158 | ## 要避免的常见陷阱
159 |
160 | ### ❌ 不要跳过 `/init`
161 | - **问题**:过时的上下文导致糟糕的建议
162 | - **解决方案**:定期使用 `/init`
163 |
164 | ### ❌ 不要害怕频繁提交
165 | - **问题**:大型提交使调试变得困难
166 | - **解决方案**:早提交,常提交
167 |
168 | ### ❌ 不要忽略 ESC
169 | - **问题**:陷入无成效的工作流程
170 | - **解决方案**:使用 ESC 重置并重试
171 |
172 | ### ❌ 不要跳过 Code Simplifier
173 | - **问题**:过度工程化、复杂的代码
174 | - **解决方案**:始终首先运行 Code Simplifier
175 |
176 | ## 成功指标
177 |
178 | 跟踪这些指标来衡量您的 Claude Code 有效性:
179 |
180 | - **减少调试时间** - 频繁提交的帮助
181 | - **更清洁的代码库** - Code Simplifier 的结果
182 | - **更好的用户体验** - UX Reviewer 的改进
183 | - **一致的架构** - Tech Lead 的指导
184 | - **更快的开发周期** - 优化的工作流程
185 |
186 | ## 结论
187 |
188 | 来自 FradSer 的这些社区测试实践为最大化 Claude Code 的有效性提供了坚实的基础。关键是:
189 |
190 | 1. **信任工具** - 在适当时使用 `/init` 和完全权限
191 | 2. **保持组织性** - 频繁提交并使用 git worktree
192 | 3. **保持灵活性** - 需要时使用 ESC 调整方向
193 | 4. **优先考虑质量** - 始终首先使用 Code Simplifier
194 |
195 | 通过遵循这些实践,您将创建一个更高效、可维护和愉快的 Claude Code 开发体验。
196 |
197 | ---
198 |
199 | ## 来源和致谢
200 |
201 | 本文基于 **FradSer** 的原创工作,并扩展了额外的实施细节和最佳实践。核心洞察最初在 [Twitter/X](https://x.com/FradSer/status/1952205197784297646) 上分享。
202 |
203 | **原作者**: FradSer
204 | **来源**: [https://x.com/FradSer/status/1952205197784297646](https://x.com/FradSer/status/1952205197784297646)
--------------------------------------------------------------------------------
/content/sources/you_are_not_right_2025-08-05.md:
--------------------------------------------------------------------------------
1 | # Claude Code Hook: 防止"你是对的"敷衍回复
2 |
3 | **来源**: [GitHub Gist](https://gist.github.com/ljw1004/34b58090c16ee6d5e6f13fce07463a31)
4 | **作者**: ljw1004
5 | **日期**: 2025-08-05
6 | **类型**: Claude Code Hook / 脚本工具
7 |
8 | ## 概述
9 |
10 | 这是一个 Claude Code 的钩子脚本,用于防止 AI 助手使用过于简单或讨好的语言回应用户。脚本会检测助手是否使用了类似"你是对的"、"You're right"等敷衍性表达,如果发现,会自动插入系统提示,要求助手提供更深入的技术分析。
11 |
12 | ## Claude Code Hooks 背景
13 |
14 | Claude Code 的 Hooks 是一种事件驱动机制,允许在特定事件发生时执行自定义脚本。目前支持的主要类型包括:
15 |
16 | ### Hooks 类型
17 | - **UserPromptSubmit**: 在用户提交提示时触发,可以检查和修改输入内容
18 | - **其他类型**: 用于 CI/CD 集成、自动化流程和代码审查
19 |
20 | ### Hooks 工作原理
21 | 1. **事件触发**: 当特定事件发生时(如用户提交提示)
22 | 2. **脚本执行**: Claude Code 自动执行配置的脚本
23 | 3. **输入处理**: 脚本接收 JSON 格式的输入数据
24 | 4. **输出处理**: 脚本的输出会被附加到 Claude 的上下文中
25 | 5. **继续执行**: Claude Code 使用修改后的上下文继续处理
26 |
27 | ## 脚本功能
28 |
29 | ### 1. 检测机制
30 | - 读取 Claude Code 的对话记录文件
31 | - 检查最近 5 条助手的回复
32 | - 识别多种敷衍性表达:
33 | - 英文:`You're right`, `you are absolutely correct`
34 | - 韩文:`사용자가 맞다`, `맞습니다`
35 |
36 | ### 2. 触发条件
37 | 当助手回复中包含以下短语时,脚本会触发:
38 | - `You're right` / `you are right`
39 | - `absolutely correct`
40 | - `사용자가 맞다` (韩文)
41 | - `맞습니다` (韩文)
42 |
43 | ### 3. 系统提示内容
44 | 脚本会插入 ``,要求助手:
45 |
46 | **禁止行为**:
47 | - 使用"你是对的"或类似表达
48 | - 避免盲目同意用户
49 |
50 | **必须行为**:
51 | - 提供实质性的技术分析
52 | - 寻找用户输入中的缺陷、漏洞、反例
53 | - 检查无效假设
54 | - 如果用户确实正确,必须冷静地说明具体原因
55 |
56 | ## 安装方法
57 |
58 | ### 1. 下载脚本
59 | ```bash
60 | # 下载脚本到本地
61 | curl -s https://gist.githubusercontent.com/ljw1004/34b58090c16ee6d5e6f13fce07463a31/raw/you_are_not_right.sh -o you_are_not_right.sh
62 |
63 | # 设置执行权限(必需)
64 | chmod +x you_are_not_right.sh
65 | ```
66 |
67 | ### 2. 脚本保存位置
68 | 脚本可以保存在以下位置:
69 | - **推荐**: `~/.claude-code/hooks/` 目录(如果存在)
70 | - **备选**: 项目根目录或任意可访问的目录
71 | - **注意**: 确保脚本有执行权限,且路径在 Claude Code 中可访问
72 |
73 | ### 3. 在 Claude Code 中配置
74 | 1. **启动 Claude Code**:
75 | ```bash
76 | claude
77 | ```
78 |
79 | 2. **配置 Hook**:
80 | - 在 Claude Code 中输入 `/hooks`
81 | - 选择 `UserPromptSubmit` 事件类型
82 | - 选择 `Add a new hook` 选项
83 | - 选择下载的脚本文件路径
84 |
85 | 3. **验证配置**:
86 | - 输入 `/hooks` 查看已配置的 hooks
87 | - 确认脚本已正确加载
88 |
89 | ## 工作原理
90 |
91 | ### 脚本执行流程
92 | 1. **读取输入**: 从 stdin 读取 JSON 数据,获取对话记录路径
93 | 2. **分析历史**: 检查最近 5 条助手回复
94 | 3. **模式匹配**: 使用正则表达式检测敷衍性表达
95 | 4. **插入提示**: 如果检测到问题,输出系统提示
96 | 5. **退出**: 脚本退出码为 0 时,Claude Code 会将输出附加到上下文
97 |
98 | ### 输入数据格式
99 | 脚本接收的 JSON 输入包含:
100 | ```json
101 | {
102 | "transcript_path": "/path/to/conversation/transcript.json",
103 | "user_prompt": "用户的输入内容",
104 | "session_id": "会话ID"
105 | }
106 | ```
107 |
108 | ### 示例效果
109 |
110 | **触发前**(敷衍回复):
111 | ```
112 | 用户: 空输入导致失败,我们应该添加空值检查。
113 | 助手: 你是对的,这确实是个问题。
114 | ```
115 |
116 | **触发后**(深入分析):
117 | ```
118 | 用户: 空输入导致失败,我们应该添加空值检查。
119 | 助手: 这种方法可以避免当前问题,但不够优雅。
120 | 它没有考虑空字符串的边缘情况。更通用的方法是检查假值。
121 | ```
122 |
123 | ## 为什么重要?
124 |
125 | ### 问题背景
126 | Claude Code 有时会用过于简单或讨好的语言回应用户,这可能导致:
127 | - 用户错过代码改进机会
128 | - 降低工具的专业性
129 | - 缺乏深度技术分析
130 |
131 | ### 解决方案
132 | 通过强制助手进行更深入的思考和反馈,这个脚本:
133 | - 提升了 Claude Code 在编程场景中的实用性
134 | - 促使更高质量的对话
135 | - 避免空洞的赞同,提供建设性建议
136 |
137 | ## 技术细节
138 |
139 | ### 脚本特点
140 | - **多语言支持**: 检测英文和韩文敷衍表达
141 | - **精确匹配**: 只检查回复前 80 个字符,避免误判
142 | - **安全退出**: 未检测到问题时直接退出,不影响正常使用
143 | - **错误处理**: 包含完整的错误处理和调试信息
144 |
145 | ### 正则表达式模式
146 | ```bash
147 | # 英文模式
148 | .*[Yy]ou.*(right|correct)
149 | .*[Aa]bsolutely
150 |
151 | # 韩文模式
152 | .*사용자가.*맞다
153 | .*맞습니다
154 | ```
155 |
156 | ### 依赖要求
157 | - **jq**: 用于解析 JSON 数据
158 | - **bash**: 脚本执行环境
159 | - **grep**: 用于文本搜索
160 |
161 | ## 使用建议
162 |
163 | 1. **配合其他钩子**: 可以与其他 Claude Code 钩子配合使用
164 | 2. **定期更新**: 关注脚本更新,获取新功能
165 | 3. **自定义扩展**: 可以根据需要添加其他语言的检测模式
166 | 4. **效果评估**: 观察使用前后对话质量的变化
167 | 5. **调试技巧**: 使用 `set -x` 启用调试模式查看执行过程
168 |
169 | ## 故障排除
170 |
171 | ### 常见问题
172 | 1. **脚本无权限**: 确保执行了 `chmod +x you_are_not_right.sh`
173 | 2. **jq 未安装**: 安装 JSON 处理器 `brew install jq` (macOS) 或 `apt install jq` (Linux)
174 | 3. **路径错误**: 确保脚本路径在 Claude Code 中可访问
175 | 4. **无效果**: 检查 `/hooks` 命令确认脚本已正确加载
176 |
177 | ### 调试方法
178 | ```bash
179 | # 测试脚本是否可执行
180 | ./you_are_not_right.sh
181 |
182 | # 启用调试模式
183 | bash -x you_are_not_right.sh
184 | ```
185 |
186 | ## 相关资源
187 |
188 | - [原始 GitHub Gist](https://gist.github.com/ljw1004/34b58090c16ee6d5e6f13fce07463a31)
189 | - [Claude Code 官方文档](https://docs.anthropic.com/claude/docs/claude-code)
190 | - [Claude Code Hooks 文档](https://docs.anthropic.com/claude/docs/claude-code-hooks)
191 | - [Claude Code 最佳实践](https://docs.anthropic.com/claude/docs/claude-code-best-practices)
192 |
193 | ---
194 |
195 | *这个脚本是 Claude Code 社区的重要贡献,展示了如何通过钩子机制来改善 AI 助手的回复质量。*
--------------------------------------------------------------------------------
/content/docs/zh/best-practices/cal-rueb-claude-code-best-practices.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: Cal Rueb 的 Claude Code 最佳实践
3 | description: 来自 Anthropic 技术团队成员 Cal Rueb 的 Claude Code 最佳实践分享,涵盖从基础设置到高级技巧的完整指南。
4 | lang: zh
5 | ---
6 |
7 | # Cal Rueb 的 Claude Code 最佳实践
8 |
9 | **发布于 2025 年 1 月 15 日**
10 |
11 | 来自 Anthropic 技术团队成员 Cal Rueb 在 'Code w/ Claude' 的主题演讲中,通过自己的使用经历、工具的底层工作原理、适用场景以及最佳实践,为我们全面展示了 Claude Code 的魅力和实用性。他强调的"简单但有效"的设计哲学,以及对安全、权限的重视,说明 Anthropic 在打造实用工具时兼顾了可靠性和用户体验。
12 |
13 | ## 完整演讲视频
14 |
15 |
24 |
25 | ## Cal 的亲身经历:从"上瘾"到核心贡献者
26 |
27 | Cal 分享了自己如何"迷上" Claude Code 的故事。他是个爱折腾代码但总半途而废的程序员,去年在公司 Slack 里听说这个工具后,迫不及待在周末下载试玩。他用 Claude Code 开发一个笔记应用,整个人像着了魔,抱着笔记本到处跑,边按回车边看应用在眼前成型。那种"看着代码自己长出来"的感觉,让他彻底改变了对编码的看法。
28 |
29 | 更有趣的是,Claude Code 团队有个内部排行榜,记录员工的使用量。Cal 那周末疯狂"肝"工具,直接冲到榜首,引起了团队注意。他因此认识了开发团队,开始贡献自己的提示工程经验,最终成了核心成员,负责优化系统提示、工具描述和评估方法。
30 |
31 | 这个故事不仅让人觉得 Claude Code 好玩,还传递了一个信息:它对新手和专家都友好,能迅速提升编码效率。
32 |
33 | ## Claude Code 的最佳用例
34 |
35 | Cal 总结了 Claude Code 的几大"杀手级"应用场景,覆盖了从代码探索到部署的整个开发生命周期:
36 |
37 | ### 代码库探索
38 | 跳进一个陌生代码库时,Claude Code 能帮你快速上手。你可以问它"这个功能在哪实现的?"或者"看看 Git 历史,讲讲这文件最近咋改的?"它会像老司机一样带你熟悉项目,省去摸索时间。
39 |
40 | ### 头脑风暴
41 | 在动手写代码前,你可以让 Claude Code 搜索代码库,提出 2-3 种实现方案,帮你理清思路。比如,"我想加个新功能,搜搜看咋搞,给我几个选项。"
42 |
43 | ### 代码编写
44 | 从零开始建应用(比如写个小游戏)超级爽,Claude Code 能快速搭框架。但更牛的是,它擅长在现有代码库里干活,比如加功能、写单元测试、优化代码。因为它会自动跑测试、检查 TS 和 linting,代码质量有保障。
45 |
46 | ### 提交与 PR
47 | 写完代码后,让 Claude Code 帮你写清晰的 Git 提交信息或 PR 描述,省时又专业。
48 |
49 | ### 部署与 CI/CD
50 | 通过 Claude Code 的 SDK,你可以把它嵌入 CI/CD 流程,比如用在 GitHub Actions 里,自动处理某些任务。
51 |
52 | ### 调试与支持
53 | 遇到错误?让 Claude Code 分析日志,定位问题。卡在 Git rebase 里?它能帮你解套。
54 |
55 | ### 代码迁移
56 | 对于大型重构(比如从 Java 老版本升级,或 PHP 转 React),Claude Code 能降低迁移难度,帮你自动化部分工作。
57 |
58 | ## 最佳实践:如何用好 Claude Code
59 |
60 | Cal 分享了几个实用技巧,让你能最大化 Claude Code 的价值。这些建议既有基础操作,也有进阶玩法:
61 |
62 | ### 基础设置
63 |
64 | #### 用 claude.md 文件
65 | 这是 Claude Code 的"记忆本"。在项目根目录或子目录放一个 claude.md,写上项目概况、测试运行方式、代码风格指南等。Claude 启动时会自动读这个文件,相当于给它一份"项目说明书"。你也可以在用户主目录放一个全局 claude.md,记录个人偏好。
66 |
67 | #### 权限管理
68 | Claude Code 的默认设置是读操作随便,写操作或跑命令得确认。你可以调权限加速流程,比如设置某些命令(像 npm run test)自动通过,或者用"自动接受模式"(Shift+Tab)让 Claude 直接干活。
69 |
70 | #### 善用 CLI 工具
71 | Claude Code 擅长终端操作,装上 GitHub 的 gh 工具或公司内部 CLI 工具,能让它干更多活。Cal 建议优先用成熟的 CLI 工具,而不是啥都靠 MCP 服务器。
72 |
73 | ### 工作流程优化
74 |
75 | #### 上下文管理
76 | Claude 的上下文窗口有 20 万 token,但长对话可能塞满。如果你看到警告,可以用 `/clear` 清空上下文(保留 claude.md),或者用 `/compact` 让 Claude 总结对话,压缩上下文继续干活。
77 |
78 | #### 计划先行
79 | 别直接让 Claude 修 bug,先让它搜搜问题,出一份修复计划。你确认计划靠谱后再动手,能省不少时间。Claude 还能自动生成待办清单(to-do list),你可以边看边调整。
80 |
81 | #### 测试驱动开发
82 | 让 Claude 小步快跑,改一点代码就跑测试,检查 TS 和 linting,确保没问题再提交。这样即使出岔子,也能快速回滚。
83 |
84 | #### 用截图辅助
85 | Claude 支持多模态输入,遇到 UI 问题可以截图扔给它,比如"照着这个 mock.png 建个网页"。
86 |
87 | ### 进阶技巧
88 |
89 | #### 多 Claude 并行
90 | 高手可以同时跑 2-4 个 Claude 实例(比如用 Tmux 或多标签页),像指挥乐队一样分工合作。Cal 坦言自己最多搞两个,但见过四 Claude 大神。
91 |
92 | #### 善用 Escape 键
93 | Claude 干活时,你可以随时按 Escape 打断,调整方向。双击 Escape 还能回溯对话,改之前的指令。
94 |
95 | #### 扩展工具
96 | 如果默认工具不够用,可以加 MCP 服务器,解锁更多功能。
97 |
98 | #### 无头自动化
99 | 用 Claude Code SDK 在 CI/CD 或其他流程里跑自动化任务,比如自动审代码、写测试。
100 |
101 | ## 新功能亮点
102 |
103 | Cal 在演讲最后展示了几个刚发布的功能,凸显 Claude Code 的快速迭代:
104 |
105 | ### 切换模型
106 | 用 `/model` 查看当前模型(默认是 Sonnet),可以切到 Opus。`/config` 还能调其他设置。
107 |
108 | ### 增强思考能力
109 | 新模型(Claude 4)支持在工具调用间"思考",能更聪明地分析问题。比如让它"think hard"去理解项目结构,你会看到它一边搜文件一边推理,过程透明。
110 |
111 | ### IDE 集成
112 | VS Code 和 JetBrains 的插件更强大,Claude 能感知你当前编辑的文件,上下文更精准。
113 |
114 | ### 保持更新
115 | Claude Code 在 GitHub 上有公开项目,Cal 建议每周看下变更日志,紧跟新功能。
116 |
117 | ## 观众问答:解决实际问题
118 |
119 | 演讲最后,Cal 回答了几个观众的疑问,透露了一些实用信息:
120 |
121 | ### 多 claude.md 文件咋办?
122 | 默认只读当前目录的 claude.md,但 Claude 搜子目录时会读相关的 claude.md。你还可以在 claude.md 里用 @ 引用其他文件,灵活组合。
123 |
124 | ### Claude 不听 claude.md 咋整?
125 | 早期模型确实有点"倔",比如爱加没用的代码注释。Claude 4 改进了指令遵循能力,Cal 建议升级模型并检查 claude.md 内容,删掉过时指令。
126 |
127 | ### 多智能体协作咋搞?
128 | 目前没原生支持复杂多智能体上下文共享,但可以让智能体写共享文件(比如 ticket.md)来传递状态。未来可能会有更优雅的解决方案。
129 |
130 | ## 核心洞察
131 |
132 | Claude Code 使用代理式搜索(grep、find、glob)来自然地探索代码库,就像人类一样。不需要花哨的索引。
133 |
134 | 演讲涵盖了更多关于上下文管理、集成设置和真实工作流程的详细信息。如果你认真想要最大化 Claude Code 的价值,绝对值得完整观看。
135 |
136 | ## 总结
137 |
138 | Cal Rueb 的分享为我们提供了一个全面的 Claude Code 使用指南,从基础设置到高级技巧,从个人使用到团队协作。他的亲身经历和实用建议,让这个强大的工具变得更加亲民和实用。
139 |
140 | 关键要点:
141 | - **简单但有效**:Claude Code 的设计哲学
142 | - **claude.md 文件**:持久化上下文的关键
143 | - **权限管理**:平衡安全性和效率
144 | - **计划先行**:不要直接跳入编码
145 | - **多模态支持**:截图和文本结合使用
146 | - **持续学习**:跟上新功能和最佳实践
147 |
148 | 通过这些最佳实践,你可以充分利用 Claude Code 的强大功能,提升你的编码效率和代码质量。
--------------------------------------------------------------------------------
/docs/CRITICAL_REQUIREMENTS_CHECKLIST.md:
--------------------------------------------------------------------------------
1 | # 🚨 CRITICAL REQUIREMENTS CHECKLIST
2 |
3 | > **USE THIS EVERY TIME** before starting content production
4 |
5 | ## ⚠️ MANDATORY BEFORE STARTING
6 |
7 | ### 🖼️ IMAGE PROCESSING REQUIREMENTS
8 | - [ ] **SCAN ENTIRE SOURCE** for all images/visuals
9 | - [ ] **IDENTIFY EVERY IMAGE** including charts, diagrams, GIFs, screenshots
10 | - [ ] **CREATE IMAGE DIRECTORY**: `public/images/[article-slug]/`
11 | - [ ] **DOWNLOAD ALL IMAGES** to local directory
12 | - [ ] **UPDATE ALL IMAGE PATHS** from external URLs to local paths
13 | - [ ] **VERIFY IMAGE ACCESS** - test every image displays correctly
14 |
15 | ### 📝 TRANSLATION QUALITY REQUIREMENTS
16 | - [ ] **FAITHFUL TRANSLATION** - Translate 100% of content (NEVER create summaries)
17 | - [ ] **STORYTELLING STYLE** - Engaging tone for general AI readers (not academic)
18 | - [ ] **TECHNICAL ACCURACY** - All facts, data, statistics match exactly
19 | - [ ] **NATURAL CHINESE FLOW** - Use natural sentence structure
20 | - [ ] **STANDARD TERMINOLOGY** - Use industry terms + English original on first use
21 | - [ ] **FORMAT PRESERVATION** - Keep ALL Markdown formatting
22 |
23 | ## 🔄 VALIDATION STEPS
24 |
25 | ### Before Publication:
26 | ```bash
27 | # 1. Test with dry run
28 | npm run publish-dry
29 |
30 | # 2. Start dev server and visually verify
31 | npm run dev
32 | # Check: Images display, content reads naturally, formatting intact
33 | ```
34 |
35 | ### Common Failure Points:
36 | ❌ **Missing images** - Source had visuals you didn't download
37 | ❌ **Summary instead of translation** - Restructured instead of faithfully translating
38 | ❌ **Poor Chinese flow** - Literal word-for-word translation
39 | ❌ **Missing technical terms** - Didn't explain terminology properly
40 | ❌ **Broken image paths** - External URLs not replaced with local paths
41 |
42 | ## 🎯 SUCCESS CRITERIA
43 |
44 | ✅ **100% Content Fidelity** - Every section, detail, and fact from original
45 | ✅ **100% Image Localization** - All visuals downloaded and working locally
46 | ✅ **Natural Language Quality** - Reads like native Chinese content
47 | ✅ **Technical Accuracy Preserved** - All data and facts exactly match
48 | ✅ **Complete Format Integrity** - All Markdown formatting maintained
49 |
50 | ---
51 |
52 | > **Remember**: This checklist exists because these are the most common and critical errors. Use it every time!
53 |
54 |
55 | # 🚨 CRITICAL REQUIREMENTS CHECKLIST
56 |
57 | > **USE THIS EVERY TIME** before starting content production
58 |
59 | ## ⚠️ MANDATORY BEFORE STARTING
60 |
61 | ### 🖼️ IMAGE PROCESSING REQUIREMENTS
62 | - [ ] **SCAN ENTIRE SOURCE** for all images/visuals
63 | - [ ] **IDENTIFY EVERY IMAGE** including charts, diagrams, GIFs, screenshots
64 | - [ ] **CREATE IMAGE DIRECTORY**: `public/images/[article-slug]/`
65 | - [ ] **DOWNLOAD ALL IMAGES** to local directory
66 | - [ ] **UPDATE ALL IMAGE PATHS** from external URLs to local paths
67 | - [ ] **VERIFY IMAGE ACCESS** - test every image displays correctly
68 |
69 | ### 📝 TRANSLATION QUALITY REQUIREMENTS
70 | - [ ] **FAITHFUL TRANSLATION** - Translate 100% of content (NEVER create summaries)
71 | - [ ] **STORYTELLING STYLE** - Engaging tone for general AI readers (not academic)
72 | - [ ] **TECHNICAL ACCURACY** - All facts, data, statistics match exactly
73 | - [ ] **NATURAL CHINESE FLOW** - Use natural sentence structure
74 | - [ ] **STANDARD TERMINOLOGY** - Use industry terms + English original on first use
75 | - [ ] **FORMAT PRESERVATION** - Keep ALL Markdown formatting
76 |
77 | ## 🔄 VALIDATION STEPS
78 |
79 | ### Before Publication:
80 | ```bash
81 | # 1. Test with dry run
82 | npm run publish-dry
83 |
84 | # 2. Start dev server and visually verify
85 | npm run dev
86 | # Check: Images display, content reads naturally, formatting intact
87 | ```
88 |
89 | ### Common Failure Points:
90 | ❌ **Missing images** - Source had visuals you didn't download
91 | ❌ **Summary instead of translation** - Restructured instead of faithfully translating
92 | ❌ **Poor Chinese flow** - Literal word-for-word translation
93 | ❌ **Missing technical terms** - Didn't explain terminology properly
94 | ❌ **Broken image paths** - External URLs not replaced with local paths
95 |
96 | ## 🎯 SUCCESS CRITERIA
97 |
98 | ✅ **100% Content Fidelity** - Every section, detail, and fact from original
99 | ✅ **100% Image Localization** - All visuals downloaded and working locally
100 | ✅ **Natural Language Quality** - Reads like native Chinese content
101 | ✅ **Technical Accuracy Preserved** - All data and facts exactly match
102 | ✅ **Complete Format Integrity** - All Markdown formatting maintained
103 |
104 | ---
105 |
106 | > **Remember**: This checklist exists because these are the most common and critical errors. Use it every time!
--------------------------------------------------------------------------------