耳朵初始化
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js · Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
EARS initialized for <project-name>:
- CLAUDE.md: <created | updated | already exists>
- traces/<task>/trace.md: created
- KNOWN_ISSUES.md: <created | already exists>
- LEARNING.md: <created | already exists>
- ears-config.json: created (<tech-stack> patterns)
- Cursor rules: <created | skipped>
- Codex AGENTS.md: <created | skipped>
- Hook: <upgraded | current | skipped>
You're ready to go. EARS will automatically prompt you to record
errors, checkpoints, discoveries, and dead ends as you work.
扫描项目以构建配置文件: 检测语言和框架:查找 `package.json` → Node.js/TypeScript 查找 `pyproject.toml` 或 `setup.py` 或 `requirements.txt` → Python 查找 `Cargo.toml` → Rust
使用项目分析填一个CLAUDE.md。使用此插件的 `templates/PROJECT-CLAUDE.md` 中的模板作为基本结构。如果 CLAUDE.md 已存在:完整阅读检查它是否有 EARS 部分如果没有 EARS 部分:建议附加 EARS 块
创建目录结构和文件: `traces/` 目录 — 如果缺少则创建 初始跟踪.md — 询问用户当前任务名称,创建 `traces/<task-name>/trace.md`: `KNOWN_ISSUES.md` — 如果缺少则从模板创建 `LEARNING.md` — 如果缺少则创建:
询问用户:“这个项目使用 Cursor 还是 Codex?我也可以为它们生成 EARS 规则。”如果使用光标:生成`.cursor/rules/ears-project.mdc`(如果需要,创建`.cursor/rules/`):使用`templates/cursor-ears.mdc`模板填写项目名称和技术堆栈
检查 `~/.claude/scripts/ears-trace.py` 是否存在 如果存在,通知用户 Synapse 插件中改进的挂钩 提供安装/升级:将 `hooks/ears-trace.py` 从插件复制到 `~/.claude/scripts/ears-trace.py` 验证 `~/.claude/settings.json` 是否已配置 PostToolUse 挂钩
# EARS Init: Project-Aware EARS Initialization
Analyze the current project and generate customized EARS configuration files so that Claude Code (and optionally Cursor and Codex) can capture knowledge effectively.
## When to Use
- Starting work on a new project that has no EARS setup
- Onboarding a project that another developer started
- Upgrading a project from generic EARS to project-specific EARS
- After significant project restructuring
## Workflow
### Phase 1: Project Analysis
Scan the project to build a profile:
1. **Detect language and framework:**
- Look for `package.json` → Node.js/TypeScript
- Look for `pyproject.toml` or `setup.py` or `requirements.txt` → Python
- Look for `Cargo.toml` → Rust
- Look for `go.mod` → Go
- Look for `pom.xml` or `build.gradle` → Java/Kotlin
- Look for `*.sln` or `*.csproj` → C#/.NET
- Look for `Makefile` + `*.c`/`*.cpp`/`*.h` → C/C++
- Look for `Gemfile` → Ruby
- Look for `mix.exs` → Elixir
- Multiple matches = polyglot project
2. **Detect build commands:**
- `package.json` → read `scripts` (build, test, dev, start)
- `pyproject.toml` → read `[project.scripts]` and `[tool.pytest]`
- `Makefile` → list top-level targets
- `Cargo.toml` → `cargo build`, `cargo test`
- `go.mod` → `go build`, `go test`
3. **Detect test commands:**
- Python: `pytest`, `python -m unittest`, `tox`
- Node.js: `jest`, `vitest`, `mocha`, `npm test`
- Rust: `cargo test`
- Go: `go test ./...`
- Java: `mvn test`, `gradle test`
4. **Understand architecture:**
- List top-level directories with brief descriptions
- Read existing README.md for project overview
- Identify key patterns (monorepo, MVC, microservices, library, CLI tool, etc.)
5. **Check for existing EARS artifacts:**
- `CLAUDE.md` → exists? has EARS section?
- `KNOWN_ISSUES.md` → exists?
- `LEARNING.md` → exists?
- `traces/` → exists? has content?
- `ears-config.json` → exists?
- `.cursor/rules/` → has EARS rules?
- `AGENTS.md` → exists?
### Phase 2: Generate Project CLAUDE.md
Use the project analysis to fill in a CLAUDE.md. Use the template from this plugin's `templates/PROJECT-CLAUDE.md` as the base structure.
**If CLAUDE.md already exists:**
- Read it fully
- Check if it has an EARS section
- If no EARS section: offer to append the EARS block
- If has EARS section: compare and offer to update
- NEVER overwrite existing content without asking
**If CLAUDE.md does not exist:**
- Generate a complete one using the template
- Fill in all placeholders from the analysis:
- Project name from package manifest or directory name
- Overview from README.md or directory structure
- Build & test commands from detected tools
- Architecture from directory scan
- EARS section fully populated
**The EARS section must include:**
- PostToolUse hook behavior explanation
- All three entry formats (Error, Checkpoint, Dead End) with examples
- Four-tier knowledge architecture with promotion rules
- "How to respond" guidance when seeing `[EARS]` prompts
- Project-specific error patterns to watch for
### Phase 3: Create EARS Skeleton
Create the directory structure and files:
1. **`traces/` directory** — create if missing
2. **Initial trace.md** — ask user for the current task name, create `traces/<task-name>/trace.md`:
```markdown
# Trace: <task-name>
Started: <current timestamp>
```
3. **`KNOWN_ISSUES.md`** — create from template if missing
4. **`LEARNING.md`** — create if missing:
```markdown
# Learning Log
Tech decisions, new concepts, mistakes, and lessons for this project.
```
5. **`ears-config.json`** — create with project-specific error patterns:
For **Python** projects:
```json
{
"error_patterns": [
"Traceback (most recent call last)",
"SyntaxError:", "TypeError:", "ValueError:", "KeyError:",
"IndexError:", "AttributeError:", "ImportError:",
"ModuleNotFoundError:", "FileNotFoundError:", "RuntimeError:",
"AssertionError:", "PermissionError:", "ConnectionError:"
],
"checkpoint_interval": 10,
"error_cooldown_seconds": 120,
"checkpoint_cooldown_seconds": 600,
"ignore_paths": [".claude/", ".git/", "__pycache__/", ".venv/", ".mypy_cache/"]
}
```
For **Node.js/TypeScript** projects:
```json
{
"error_patterns": [
"ReferenceError:", "TypeError:", "SyntaxError:", "RangeError:",
"ENOENT:", "EACCES:", "ECONNREFUSED:", "ERR_MODULE_NOT_FOUND",
"Cannot find module", "Unexpected token", "FATAL ERROR:",
"UnhandledPromiseRejection"
],
"checkpoint_interval": 10,
"error_cooldown_seconds": 120,
"checkpoint_cooldown_seconds": 600,
"ignore_paths": [".git/", "node_modules/", "dist/", ".next/", "coverage/"]
}
```
For **Rust** projects:
```json
{
"error_patterns": [
"error[E", "panicked at", "fatal runtime error",
"thread 'main' panicked", "cannot find", "mismatched types",
"borrow of moved value", "lifetime"
],
"checkpoint_interval": 10,
"error_cooldown_seconds": 120,
"checkpoint_cooldown_seconds": 600,
"ignore_paths": [".git/", "target/"]
}
```
For **Go** projects:
```json
{
"error_patterns": [
"panic:", "fatal error:", "undefined:", "cannot use",
"too many arguments", "not enough arguments",
"imported and not used", "declared and not used"
],
"checkpoint_interval": 10,
"error_cooldown_seconds": 120,
"checkpoint_cooldown_seconds": 600,
"ignore_paths": [".git/", "vendor/"]
}
```
For **other/mixed** projects: use the default patterns from the hook.
### Phase 4: Multi-Tool Setup (Optional)
Ask the user: "Do you use Cursor or Codex for this project? I can generate EARS rules for them too."
**If Cursor is used:**
Generate `.cursor/rules/ears-project.mdc` (create `.cursor/rules/` if needed):
- Use the `templates/cursor-ears.mdc` template
- Fill in project name and tech stack
- Set `alwaysApply: true`
**If Codex is used:**
Generate project-level `AGENTS.md`:
- Use the `templates/PROJECT-AGENTS.md` template
- Fill in project overview, build/test commands, architecture
- Include EARS instructions
### Phase 5: Hook Check (Optional)
1. Check if `~/.claude/scripts/ears-trace.py` exists
2. If it exists, inform the user about the improved hook in the Synapse plugin
3. Offer to install/upgrade:
- Copy `hooks/ears-trace.py` from the plugin to `~/.claude/scripts/ears-trace.py`
- Verify `~/.claude/settings.json` has PostToolUse hooks configured
4. If the user declines, that's fine — the existing hook works, just without auto-discovery
## Output Summary
After completion, display a summary:
```
EARS initialized for <project-name>:
- CLAUDE.md: <created | updated | already exists>
- traces/<task>/trace.md: created
- KNOWN_ISSUES.md: <created | already exists>
- LEARNING.md: <created | already exists>
- ears-config.json: created (<tech-stack> patterns)
- Cursor rules: <created | skipped>
- Codex AGENTS.md: <created | skipped>
- Hook: <upgraded | current | skipped>
You're ready to go. EARS will automatically prompt you to record
errors, checkpoints, discoveries, and dead ends as you work.
```
## Important Principles
- **Never overwrite** existing files without asking
- **Merge, don't replace** — append EARS sections to existing CLAUDE.md
- **Project-specific** — error patterns, ignore paths, and commands should reflect the actual project
- **Minimal by default** — only create what's needed, ask before adding optional pieces
- **Respect existing setup** — if the project already has EARS, offer upgrades, don't force changes
---
> Source: [CHOSENX-GPU/synapse](https://github.com/CHOSENX-GPU/synapse) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
按说明文件中的顺序排列。
何时使用
第一阶段:项目分析
第 2 阶段:生成项目 CLAUDE.md
第 3 阶段:创建 EARS 骨架
第 4 阶段:多工具设置(可选)
文件/命令 -> package.json · pyproject.toml · setup.py · requirements.txt · Cargo.toml · go.mod · pom.xml · build.gradle
内容校验值 -> 1bf50150c137
当前原文的自动摘译,尚未人工审校。
何时使用
开始处理没有 EARS 设置的新项目 加入另一个开发人员启动的项目 将项目从通用 EARS 升级到项目特定的 EARS 在重大项目重组之后
第 3 阶段:创建 EARS 骨架
创建目录结构和文件:
traces/目录 — 如果缺少则创建 初始跟踪.md — 询问用户当前任务名称,创建traces/<task-name>/trace.md:KNOWN_ISSUES.md— 如果缺少则从模板创建LEARNING.md— 如果缺少则创建: