Communitygithub.com

ASoudy/AGS

將經自動記憶(MEMORY.md)驗證的模式提升至 CLAUDE.md 或 .claude/rules/,以永久強制執行。

AGS 是什麼?

此技能提供一個名為 `/si:promote` 的指令,用於將 Claude 自動記憶(MEMORY.md)中經過驗證的模式,提升至專案的規則系統,使其從背景筆記轉變為強制執行的指令。這對於開發人員和 AI 代理使用者非常有用,因為它確保了專案慣例(如使用 pnpm 而非 npm)能被永久記錄並在後續的工作階段中自動遵循。該技能支援所有 Claude 專案,並可將規則提升至 `CLAUDE.md` 或路徑限定的 `.claude/rules/` 檔案。其工作流程包括:解析使用者描述、在 MEMORY.md 中搜尋相關條目、根據範圍決定目標檔案、將描述性筆記提煉為簡潔的指令式規則、寫入目標檔案、清理自動記憶,最後確認完成。技能還提供了決策指南,協助判斷何時該提升模式,以及何時應保留在自動記憶中。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ASoudy/AGS/tree/HEAD/claude_skills_libraries/nginity-skills-library/engineering-team/self-improving-agent/skills/promote

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

/si:promote — 將學習成果提升為規則

將經驗證的模式從 Claude 的自動記憶移至專案的規則系統,使其成為強制執行的指令,而非背景筆記。

使用方式

/si:promote <pattern description>                    # 自動偵測最佳目標
/si:promote <pattern> --target claude.md             # 提升至 CLAUDE.md
/si:promote <pattern> --target rules/testing.md      # 提升至範圍限定的規則
/si:promote <pattern> --target rules/api.md --paths "src/api/**/*.ts"  # 含路徑的範圍限定規則

工作流程

步驟 1:理解模式

解析使用者的描述。如果描述模糊,提出一個釐清問題:

  • 「Claude 應遵循哪個具體行為?」
  • 「這適用於所有檔案還是特定路徑?」

步驟 2:在自動記憶中尋找模式

# 在 MEMORY.md 中搜尋相關條目
MEMORY_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|%2F|g; s|%2F|/|; s|^/||')/memory"
grep -ni "< keywords >" "$MEMORY_DIR/MEMORY.md"

顯示符合的條目,並確認這是使用者所指的內容。

步驟 3:決定合適的目標

模式範圍目標範例
適用於整個專案./CLAUDE.md「使用 pnpm,不要使用 npm」
適用於特定檔案類型.claude/rules/<topic>.md「API 處理器需要驗證」
適用於你所有的專案~/.claude/CLAUDE.md「偏好明確的錯誤處理」

如果使用者未指定目標,請根據範圍推薦一個。

步驟 4:提煉為簡潔的規則

將學習成果從自動記憶的筆記格式轉換為 CLAUDE.md 的指令格式:

之前(MEMORY.md — 描述性):

此專案使用 pnpm 工作區。我嘗試 npm install 時失敗了。鎖定檔是 pnpm-lock.yaml。必須使用 pnpm install 來安裝相依套件。

之後(CLAUDE.md — 規範性):

## 建置與相依套件
- 套件管理器:pnpm(不是 npm)。使用 `pnpm install`。

提煉規則:

  • 盡可能一行一條規則
  • 使用祈使語氣(「使用 X」、「永遠 Y」、「絕不 Z」)
  • 包含指令或範例,而不只是概念
  • 無需背景故事 — 只需指令

步驟 5:寫入目標

對於 CLAUDE.md:

  1. 讀取現有的 CLAUDE.md
  2. 找到適當的章節(或建立一個)
  3. 在正確的標題下附加新規則
  4. 如果檔案會超過 200 行,建議改用 .claude/rules/

對於 .claude/rules/:

  1. 如果檔案不存在則建立它
  2. 如果有限定路徑,則添加包含 paths 的 YAML 前置資料
  3. 撰寫規則內容
---
paths:
  - "src/api/**/*.ts"
  - "tests/api/**/*"
---

# API 開發規則

- 所有端點必須使用 Zod 綱要驗證輸入
- 使用 `ApiError` 類別處理錯誤回應(不要使用原始 Error)
- 在處理函式上包含 OpenAPI JSDoc 註解

步驟 6:清理自動記憶

提升後,從 MEMORY.md 中移除或標記原始條目:

# 顯示將被移除的內容
grep -n "<pattern>" "$MEMORY_DIR/MEMORY.md"

要求使用者確認移除。然後編輯 MEMORY.md 以移除已提升的條目。這將為新的學習內容釋放空間。

步驟 7:確認

✅ 已提升至 {{target}}

規則:「{{distilled rule}}」
來源:MEMORY.md 第 {{n}} 行(已移除)
MEMORY.md:剩下 {{lines}}/200 行

該模式現在是一條強制性指令。Claude 將在未來所有工作階段中遵循它。

提升決策指南

以下情況應提升:

  • 模式在自動記憶中出現 3 次以上
  • 你糾正過 Claude 同一點超過一次
  • 這是任何貢獻者都應知道的專案慣例
  • 它可以防止重複發生的錯誤

以下情況不應提升:

  • 這是一次性的除錯筆記(留在自動記憶中)
  • 這是工作階段特定的上下文(工作階段記憶會處理)
  • 它可能很快就會改變(例如在遷移期間)
  • 現有規則已涵蓋

CLAUDE.md 與 .claude/rules/

使用 CLAUDE.md 的時機使用 .claude/rules/ 的時機
全域專案規則檔案類型特定的模式
建置指令測試慣例
架構決策API 設計規則
團隊慣例框架特定的雷區

提示

  • 保持 CLAUDE.md 在 200 行以下 — 超出時使用 rules/
  • 一行一條規則比段落更容易維護
  • 包含具體指令,而不只是概念
  • 每季審查已提升的規則 — 移除不再相關的內容

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ASoudy/AGS

Advanced JavaScript animation library skill for creating complex, high-performance web animations.

ASoudy/AGS

Astropy is the core Python package for astronomy, providing essential functionality for astronomical research and data analysis.

ASoudy/AGS

Build content-focused websites with Astro — zero JS by default, islands architecture, multi-framework components, and Markdown/MDX support.

ASoudy/AGS

One sentence - what this skill does and when to invoke it

ASoudy/AGS

Audit and fix animation performance issues including layout thrashing, compositor properties, scroll-linked motion, and blur effects. Use when animations stutter, transitions jank, or reviewing CSS/JS animation performance.

ASoudy/AGS

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

ASoudy/AGS

Pull a YouTube video transcript into a queryable markdown vault with yt-dlp subtitle discovery, VTT cleanup, metadata frontmatter, and capture-seed stubs.

ASoudy/AGS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

ASoudy/AGS

Generates high-converting Next.js/React landing pages with Tailwind CSS. Uses PAS, AIDA, and BAB frameworks for optimized copy/components (Heroes, Features, Pricing). Focuses on Core Web Vitals/SEO.

ASoudy/AGS

AI-powered animation tool for creating motion in logos, UI, icons, and social media assets.

ASoudy/AGS

CRITICAL: Use for Makepad animation system. Triggers on: makepad animation, makepad animator, makepad hover, makepad state, makepad transition, "from: { all: Forward", makepad pressed, makepad 动画, makepad 状态, makepad 过渡, makepad 悬停效果

ASoudy/AGS

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

ASoudy/AGS

Next.js App Router principles. Server Components, data fetching, routing patterns.

ASoudy/AGS

Expert integration of Supabase Auth with Next.js App Router

ASoudy/AGS

React and Next.js 14+ application development with App Router, Server Components, TypeScript, Tailwind CSS, and modern frontend patterns.

ASoudy/AGS

Best practices for Remotion - Video creation in React

ASoudy/AGS

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

ASoudy/AGS

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

ASoudy/AGS

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

ASoudy/AGS

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

相關技能