跳到正文
cccskills
免费在 GitHub 公开

sync-knowledge

Auto-generate knowledge YAML from the codebase. Use when the user runs /sync-knowledge or wants knowledge files refreshed.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(2)

  • SKILL.md6.2 KB
  • agents/openai.yaml237 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

/sync-knowledge — Auto-Generate Knowledge YAML

Explores a repo's codebase and synthesizes a knowledge YAML file. Keeps agents productive without manual documentation.

Usage

/sync-knowledge my-api                   # Sync one repo (an archived one too)
/sync-knowledge --all                    # Sync all repos in repos.json except archived ones
/sync-knowledge --all --include-archived # Sync all repos in repos.json, archived ones included
/sync-knowledge                          # Sync current repo (if in a sub-repo)

Step 1 — Identify Target Repos

Single repo

ls repos/<repo-name>/   # Verify the repo is cloned

If not cloned: bun run repo init --human first.

All repos (--all)

cat repos/repos.json   # Get the full list

Leave out every entry with "archived": true unless --include-archived was passed, and name the ones left out in the report. An archived repository named on its own (/sync-knowledge <name>) is synced like any other.

Process each repo sequentially (not in parallel — each is a full codebase exploration).


Step 2 — Spawn Explore Agent

For each target repo, spawn an Explore subagent:

Explore the repository at repos/<repo-name>/ and answer these questions:

1. What does this repo do? (2-3 sentence overview)
2. What is the directory structure? (top 2 levels, key directories only)
3. What is the tech stack? (runtime, framework, key libraries with versions from package.json)
4. What are the main entry points? (e.g., src/index.ts, src/App.tsx, src/server.ts)
5. What are the key architectural patterns? (e.g., repository pattern, hooks-based state, event-driven)
6. What is the error handling convention? (throw vs return result, error types used)
7. What is the module organization? (how are files grouped, naming conventions)
8. What is the authentication/authorization approach? (if applicable)
9. What are the 5-10 most important files? (with brief description of each)
10. What are the integration points with other systems? (API contracts, shared types, events)
11. What has changed recently? (run: git log --oneline -20 in the repo)
12. What are the test patterns? (test framework, file naming, what gets tested)
13. What are the coding conventions? (commit format, branch naming, PR requirements from CONTRIBUTING.md or AGENTS.md)

Be specific — include real file paths, function names, and type names.
Max 400 lines in your response.

Step 3 — Synthesize YAML

From the Explore agent's findings, write knowledge/repos/<repo-name>.yaml:

# knowledge/repos/<repo-name>.yaml
# Auto-generated by /sync-knowledge
# Last updated: <ISO date>
# Commit: <git rev-parse HEAD of repo>

overview:
  name: <repo-name>
  description: >
    <2-3 sentence description of what the repo does>
  purpose: <backend | frontend | library | infrastructure | tooling>
  tech_stack:
    runtime: <node | bun | python | go | ...>
    framework: <express | next | fastapi | ...>
    language: <typescript | python | go | ...>
    key_libraries:
      - <name>: <version> — <purpose>

architecture:
  structure: |
    src/
      api/        REST endpoint handlers
      hooks/      React hooks (frontend)
      types/      Shared TypeScript interfaces
      utils/      Pure utility functions
      components/ UI components (frontend)
  entry_points:
    - <path>: <description>
  key_components:
    - <name>: <file path> — <description>

patterns:
  error_handling: >
    <describe the pattern: throw vs Result type, error classes used>
  state_management: >
    <describe: Redux / Zustand / hooks / context, etc.>
  module_organization: >
    <describe file grouping and naming conventions>
  authentication: >
    <describe auth approach if applicable>
  testing: >
    <framework, test file naming, what's covered>

conventions:
  commit_format: "<type>(<scope>): <description>"
  branch_naming: "<type>/<task-id>-<description>"
  pr_requirements:
    - All CI checks pass
    - At least one approval
    - Tests cover new code
  coding_standards:
    - TypeScript strict mode
    - No 'any' without justification comment
    - Error boundaries on all async operations

integration_points:
  apis:
    - endpoint: <path>
      method: <GET|POST|...>
      request: <type>
      response: <type>
      notes: <any important constraints>
  shared_types:
    - name: <TypeName>
      file: <path>
      consumers: [<other-repo>]
  events:
    - name: <event-name>
      producer: <repo>
      consumer: <repo>
      payload: <type or description>

key_files:
  - path: <relative file path>
    description: <what this file does and why it matters>
    key_exports:
      - <function/type name>: <brief description>

recent_changes:
  - <commit hash short>: <description> (<date>)
  - <commit hash short>: <description> (<date>)
  # (last 5-10 significant changes)

Max 400 lines. If the repo is large, prioritize depth over breadth — cover the most-used patterns fully rather than every file shallowly.


Step 4 — Update MEMORY.md Index

If using the harness's auto-memory system, update the index:

# Note the new file in memory index if a MEMORY.md index exists
echo "- [$(repo-name) knowledge](knowledge/repos/$(repo-name).yaml) — $(date)" >> ~/.claude/memory/MEMORY.md

Step 5 — Report

✓ knowledge/repos/my-api.yaml generated
  Lines: 187
  Sections: overview, architecture, patterns, conventions, integration_points (3 endpoints), key_files (8), recent_changes (10)
  Commit distance: 0 (fresh)

Next: run /ask to query this knowledge, or /go to start work.

If --all:

✓ Synced 3 repos:
  - knowledge/repos/my-api.yaml       (187 lines)
  - knowledge/repos/my-frontend.yaml  (212 lines)
  - knowledge/repos/my-infra.yaml     (94 lines)
Skipped (archived): old-docs — /sync-knowledge old-docs or --include-archived syncs it

Staleness Tracking

The YAML file stores the commit hash at generation time:

# Commit: abc1234f

The /ask command uses this to compute commit distance and warn when >50 commits behind. Run /sync-knowledge <repo> any time significant architecture changes are made.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

add-bead

免费

Capture free-text work as a tracked Beads issue. Use when the user runs /add-bead or wants to quickly file a Beads issue.

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

add-repo

免费

Register a new sub-repo in the knowledge base.

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

Add focused Bun unit tests for mission-critical behavior and edge cases — not blanket coverage.

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

ask

免费

Answer questions about the codebase from knowledge files. Use when the user runs /ask or asks a domain/knowledge question about the repos.

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

Meta-skill for creating Agent Forge skills under .claude/skills/ with SKILL.md, optional references/ and scripts/, and Bun scaffolds. Use when the user wants to add or author a skill, scaffold a new skill folder, or align skill docs with harness conventions (JSON script output, Beads for tasks).

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

Choose Beads issue priority (P0–P4, numeric, or named) from urgency, impact, and risk when creating or triaging work.

中文简介正在准备中。当前显示原文说明。

jupes/agent-forge-harness22026年10月19日 更新

查看 jupes 的全部技能

报告此技能的问题