Local#154
Conversation
- Modified hooks/hooks.json - Modified scripts/hooks/session-start.js - Modified scripts/lib/utils.js
Added: - commands/multi-*.md (5 multi-model workflow commands) - commands/pm2.md (PM2 initialization) - rules/dev-server.md Modified: - hooks/hooks.json - README.md, README.zh-CN.md Removed (upstream-only, not in local customizations): - skills/django-*, skills/python-* (will fetch from upstream if needed) - sessions command and related scripts
) Add a new /sessions command to manage Claude Code session history with alias support for quick access to previous sessions. Features: - List sessions with pagination and filtering (by date, ID) - Load and view session content and metadata - Create memorable aliases for sessions - Remove aliases - Display session statistics (lines, items, size) - List all aliases New libraries: - scripts/lib/session-manager.js - Core session CRUD operations - scripts/lib/session-aliases.js - Alias management with atomic saves New command: - commands/sessions.md - Complete command with embedded scripts Modified: - scripts/lib/utils.js - Add getAliasesPath() export - scripts/hooks/session-start.js - Show available aliases on session start Session format support: - Old: YYYY-MM-DD-session.tmp - New: YYYY-MM-DD-<short-id>-session.tmp Aliases are stored in ~/.claude/session-aliases.json with Windows- compatible atomic writes and backup support. Co-authored-by: 王志坚 <wangzhijian10@bgyfw.com> Co-authored-by: Claude <noreply@anthropic.com>
Modified 19 command files to use plain markdown format: - pm2.md, multi-*.md (6 files) - plan.md, tdd.md, e2e.md, etc (13 files) Format changed from: --- description: 'xxx' --- # Title To: # Title xxx (description as first paragraph)
- Deleted outdated multi-workflow documentation to streamline processes. - Updated PM2 initialization documentation for clarity and consistency. - Enhanced service detection and command generation for PM2. - Improved hooks for continuous learning and tool usage observation. - Removed redundant dev server management rules and integrated them into hooks. - Added comprehensive verification loop skill for enhanced session validation. - Introduced a new observation hook for capturing tool usage patterns.
📝 WalkthroughWalkthroughThis pull request systematically removes GitHub Actions CI/workflow automation, configuration files, and legacy skill documentation while restructuring project documentation and introducing new synchronization tooling for development workflows. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 16
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/zh-TW/README.md (1)
206-242:⚠️ Potential issue | 🟡 MinorMissing "Requirements" section present in the main README.
The English README.md includes a "Requirements" section (lines 247-271) documenting the minimum Claude Code CLI version (v2.1.0+) and important information about hooks auto-loading behavior. This section appears to be missing from the Traditional Chinese translation, which could lead to user confusion about version compatibility.
🤖 Fix all issues with AI agents
In `@commands/evolve.md`:
- Around line 1-5: Remove the duplicated markdown header and fix the orphaned
YAML metadata in commands/evolve.md by either converting the standalone "name:
evolve" into proper YAML frontmatter (wrap it between --- delimiters at the top)
or removing it entirely if not needed; specifically delete the redundant second
"# Evolve Command" and ensure the remaining header and the "name: evolve"
metadata are properly formed (use the "# Evolve Command" header once and, if
keeping metadata, place --- name: evolve --- immediately before the header).
In `@commands/instinct-export.md`:
- Around line 1-5: Remove the duplicate second heading and fix the orphaned
metadata by either deleting the lone "name: instinct-export" line or converting
it into proper YAML front-matter; specifically keep a single "# Instinct Export
Command" heading (remove the duplicate), and if the metadata is required wrap
"name: instinct-export" between YAML delimiters (---) above the heading so the
file contains one heading and valid front-matter.
In `@commands/instinct-import.md`:
- Around line 1-5: Remove the duplicate top-level heading and fix the orphaned
metadata by either converting the lone "name: instinct-import" into proper YAML
frontmatter (surround with --- above the first heading and --- below it) or
deleting the redundant "name: instinct-import" line; specifically remove one of
the identical "# Instinct Import Command" headings (the duplicate at the bottom)
and ensure "name: instinct-import" is only present inside YAML frontmatter,
leaving a single heading and valid metadata for the document.
In `@commands/instinct-status.md`:
- Around line 1-5: Remove the duplicate heading and fix the orphaned metadata:
keep a single top-level heading "# Instinct Status Command" and either wrap the
metadata key "name: instinct-status" in proper YAML front-matter delimiters (---
before and after) immediately above the heading, or remove the lone "name:
instinct-status" line if metadata is unnecessary; ensure only one heading
remains and the metadata (if kept) is valid front-matter.
In `@commands/pm2.md`:
- Around line 246-271: The fenced code block containing the "## PM2 Init
Complete" summary is missing a language identifier which triggers markdownlint
MD040; update the opening fence from ``` to a language-tagged fence such as
```text (i.e., change the code fence that begins before "## PM2 Init Complete"
to ```text) so the block is language-annotated and the lint warning is resolved.
- Around line 35-52: The fenced code block showing the project tree in
commands/pm2.md triggers markdownlint MD040 because it lacks a language
identifier; update the opening fence from ``` to ```text (or another appropriate
language) for that ASCII tree snippet so the block becomes fenced with a
language, satisfying MD040 and improving tooling support.
In `@commands/setup-pm.md`:
- Around line 1-6: Remove the duplicated heading and redundant description by
keeping a single "# Package Manager Setup" heading and consolidating the two
description lines into one concise sentence such as "Configure your preferred
package manager (npm/pnpm/yarn/bun) for this project or globally."; edit the
lines containing the duplicate heading "# Package Manager Setup" and the two
description lines "Configure your preferred package manager (npm/pnpm/yarn/bun)"
and "Configure your preferred package manager for this project or globally." to
produce one heading and one combined description.
In `@commands/skill-create.md`:
- Around line 1-5: Remove the duplicate header "/skill-create - Local Skill
Generation" (keep a single instance) and either delete the orphaned metadata
line "name: skill-create" or convert it into proper YAML front matter by
wrapping it with --- delimiters at the top of the file (e.g., add --- before and
after the metadata block). Ensure the file contains one header and
properly-formed front matter if metadata is required.
In `@hooks/hooks.json`:
- Around line 124-133: The hook spawns execFileSync('npx', ...) which may fail
if npx isn't in PATH; update the command generation to detect npx availability
or try a fallback before swallowing errors: ensure the script checks for
execFileSync('which'/'where' equivalent) or attempts a fallback like invoking
local node_modules/.bin/prettier if npx is missing, and surface failures by
logging stderr (use the existing try/catch around execFileSync in the inline
command to write an error message to stderr). Target symbols: execFileSync and
the 'npx' invocation used to run Prettier in the inline node -e command, and
keep the existing file-path and extension checks.
- Around line 134-143: The inline node command in the hooks.json uses execSync
with a single shell string (the 'execSync' invocation that runs "npx tsc
--noEmit --pretty false 2>&1"), which is vulnerable to shell injection via the
derived dir/file_path (p); change this to call a non-shell execution API
(execFileSync or spawnSync) with the command and arguments as an array and
without shell redirection, ensure you pass cwd: dir and capture both stdout and
stderr separately (or set stdio appropriately) so you still get tsc output
filtered for the file p; update the inline script that constructs and runs the
tsc invocation inside the node -e string to use execFileSync/spawnSync and
argument array form instead of a single concatenated shell string.
In `@README.zh-CN.md`:
- Around line 243-245: Add a "Requirements" (要求) section to README.zh-CN.md
before the "安装" section that mirrors the main README's content: state the
minimum Claude Code CLI version required (v2.1.0+), explain that hooks are
auto-loaded by the CLI and any implications for users (e.g., no manual hook
registration needed), and include any brief compatibility notes from the
original "Requirements" so the Chinese translation matches the main README.
In `@rules/hooks.md`:
- Around line 52-55: Update the documentation line that says "NEVER run `pnpm
dev` directly - hook will block it" to accurately describe the platform-specific
behavior: state that the pre-run hook only forces a hard block (exits with code
2) on Windows when `ecosystem.config.cjs` exists (see hooks.json behavior around
process.exit(2)), while on Linux/macOS without tmux the hook merely prints a tip
and exits 0 (no hard block); also mention the recommended flow to run
`/everything-claude-code:pm2 init` and that config files must use `.cjs` for
clarity.
In `@skills/continuous-learning-v2/hooks/observe.js`:
- Around line 140-147: The Promise that reads from process.stdin should clean up
listeners and stop the stream when the timeout fires: register named handler
functions (e.g., onData and onEnd) and store the setTimeout id; in the timeout
handler remove the 'data' and 'end' listeners from process.stdin (using
removeListener or off), call process.stdin.pause() to stop further input, and
then resolve; likewise, in the onEnd handler clear the timeout (clearTimeout)
and remove the listeners to avoid leaks. Update the code that sets up
process.stdin.on('data', ...), process.stdin.on('end', ...), and setTimeout(...)
to use these named handlers and the stored timeout id so both timeout and normal
end paths properly clean up.
- Around line 47-59: The archiveIfNeeded function can race when multiple
instances detect OBSERVATIONS_FILE is oversized; protect the rename by obtaining
a simple lock (create a lock file with fs.openSync using O_CREAT|O_EXCL, bail
out if lock acquisition fails) around the size check + rename, or if you prefer
a lighter change wrap the fs.renameSync(OBSERVATIONS_FILE, archivePath) in a
try/catch and ignore ENOENT (and log other errors) so concurrent renames don't
crash; ensure you always remove the lock file in a finally block and keep calls
to ensureDir, getFileSizeMB, OBSERVATIONS_FILE and archivePath intact.
In `@sync-tools.sh`:
- Line 145: The script currently runs cd "$(dirname "$0")" without checking for
failure; update the script to detect if that cd command fails and abort to avoid
running subsequent git/file operations in the wrong directory — after the cd
"$(dirname "$0")" statement, check its exit status and, on failure, print an
explanatory error to stderr and exit with a non-zero status (e.g., use a
conditional fallback that logs a message and calls exit 1) so the script stops
immediately when changing to the script directory fails.
- Around line 128-138: The rm -rf lines using "$PLUGIN_MARKET" and
"$PLUGIN_CACHE" are unsafe when those variables are empty; add a guard to abort
or fail fast if either variable is unset/empty (e.g., use parameter expansion
that errors like "${PLUGIN_MARKET:?}" / "${PLUGIN_CACHE:?}" or test [ -n
"$PLUGIN_MARKET" ] && [ -n "$PLUGIN_CACHE" ] and exit with a clear error) before
executing rm -rf "$PLUGIN_MARKET"/* and rm -rf "$PLUGIN_CACHE"/*, ensuring all
subsequent cp and rm -f operations only run after the check passes.
🧹 Nitpick comments (8)
scripts/hooks/suggest-compact.js (1)
33-55: Consider cleaning up stale counter files.Counter files in the temp directory accumulate over time since each day creates a new file (
claude-tool-count-{date}-{hash}). While the temp directory may be cleared by the OS periodically, you might want to clean up old counter files to avoid clutter.🧹 Optional: Add cleanup of old counter files
+ // Clean up counter files older than 7 days + const tempDir = getTempDir(); + try { + const files = require('fs').readdirSync(tempDir); + const now = Date.now(); + const maxAge = 7 * 24 * 60 * 60 * 1000; // 7 days + files.filter(f => f.startsWith('claude-tool-count-')).forEach(f => { + const filePath = path.join(tempDir, f); + try { + const stat = require('fs').statSync(filePath); + if (now - stat.mtimeMs > maxAge) { + require('fs').unlinkSync(filePath); + } + } catch {} + }); + } catch {} + const counterFile = path.join(getTempDir(), `claude-tool-count-${sessionId}`);skills/continuous-learning-v2/hooks/observe.js (1)
67-91: Consider validating hookPhase argument.
hookPhasefromprocess.argv[2]is used without validation. While the fallback logic handles unknown values gracefully, explicitly validating 'pre' or 'post' could help catch misconfiguration.hooks/hooks.json (1)
16-25: Complex inline script is hard to maintain.This 400+ character inline Node.js command is difficult to read, debug, and modify. Consider extracting it to an external script file like the other hooks (e.g.,
suggest-compact.js,session-start.js).♻️ Suggested approach
Create a dedicated script file:
// scripts/hooks/dev-server-blocker.js const os = require('os'); const fs = require('fs'); const path = require('path'); let d = ''; process.stdin.on('data', c => d += c); process.stdin.on('end', () => { // ... extracted logic here });Then reference it in hooks.json:
-"command": "node -e \"const os=require('os');..." +"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/dev-server-blocker.js\""sync-tools.sh (4)
45-53: Separate declaration and assignment to avoid masking return values.Combining
localwith command substitution masks the exit status of the command. Ifgit logfails, the error is silently absorbed.♻️ Proposed refactor
show_status() { echo ">>> 上游新提交 (可选择性拉取):" echo "" - local commits=$(git log HEAD..upstream/main --oneline --date=short --format="%h %ad %s" 2>/dev/null) + local commits + commits=$(git log HEAD..upstream/main --oneline --date=short --format="%h %ad %s" 2>/dev/null) if [ -z "$commits" ]; then echo " (无新提交)" else echo "$commits" fi echo "" echo ">>> 本地自定义提交 (不在上游):" - local local_commits=$(git log upstream/main..HEAD --oneline --date=short --format="%h %ad %s" 2>/dev/null) + local local_commits + local_commits=$(git log upstream/main..HEAD --oneline --date=short --format="%h %ad %s" 2>/dev/null) if [ -z "$local_commits" ]; then
5-6: Consider making the plugin version configurable.The hardcoded version
1.2.0inPLUGIN_CACHEwill require manual updates whenever the plugin version changes. Consider detecting the version dynamically or accepting it as an environment variable.💡 Example: Detect version dynamically
-PLUGIN_CACHE="$HOME/.claude/plugins/cache/everything-claude-code/everything-claude-code/1.2.0" +PLUGIN_VERSION="${PLUGIN_VERSION:-1.2.0}" +PLUGIN_CACHE="$HOME/.claude/plugins/cache/everything-claude-code/everything-claude-code/$PLUGIN_VERSION" PLUGIN_MARKET="$HOME/.claude/plugins/marketplaces/everything-claude-code"Alternatively, you could detect the latest version directory:
PLUGIN_CACHE=$(find "$HOME/.claude/plugins/cache/everything-claude-code/everything-claude-code" -maxdepth 1 -type d | sort -V | tail -1)
85-108: Add error handling for git operations.The
update_fileandupdate_dirfunctions don't handle failures fromgit checkout,git add, orgit commit. If the file doesn't exist upstream or if there are conflicts, the script continues and prints success messages regardless.♻️ Proposed fix for update_file
update_file() { local file="$1" if [ -z "$file" ]; then echo "错误: 请指定文件路径" exit 1 fi echo ">>> 从上游更新: $file" - git checkout upstream/main -- "$file" - git add "$file" - git commit -m "Update $file from upstream" + if ! git checkout upstream/main -- "$file"; then + echo "错误: 无法从上游获取 $file" + exit 1 + fi + git add "$file" + git commit -m "Update $file from upstream" || echo "提示: 文件可能未变更" echo ">>> 完成. 运行 './sync-tools.sh deploy' 同步到 Claude" }
171-173: Consider fetching upstream before cherry-pick for consistency.Unlike
update-fileandupdate-dir, thecherry-pickcommand doesn't callfetch_upstreamfirst. If the user provides an upstream commit hash without fetching, the operation will fail. Consider aligning this behavior with other commands or documenting the expectation.💡 Option: Add fetch before cherry-pick
cherry-pick) + fetch_upstream cherry_pick_commit "$2" ;;README.md (1)
12-15: Minor: Redundant language selector.Line 1 already has
**Language:** English | [繁體中文](docs/zh-TW/README.md)and lines 12-15 add another language selector with slightly different languages (linking toREADME.zh-CN.mdfor Simplified Chinese). Consider consolidating into a single language selector that includes all available translations.
| # Evolve Command | ||
|
|
||
| name: evolve | ||
| description: Cluster related instincts into skills, commands, or agents | ||
| command: true | ||
| --- | ||
|
|
||
| # Evolve Command |
There was a problem hiding this comment.
Remove duplicate header and fix orphaned metadata.
Lines 1-2 and Line 5 contain identical headers ("# Evolve Command"), and Line 3 has orphaned YAML metadata without delimiters. This mirrors the same issue found in commands/skill-create.md.
📝 Proposed fix to remove duplication and clean up metadata
-# Evolve Command
-
-name: evolve
-
# Evolve Command
## Implementation🤖 Prompt for AI Agents
In `@commands/evolve.md` around lines 1 - 5, Remove the duplicated markdown header
and fix the orphaned YAML metadata in commands/evolve.md by either converting
the standalone "name: evolve" into proper YAML frontmatter (wrap it between ---
delimiters at the top) or removing it entirely if not needed; specifically
delete the redundant second "# Evolve Command" and ensure the remaining header
and the "name: evolve" metadata are properly formed (use the "# Evolve Command"
header once and, if keeping metadata, place --- name: evolve --- immediately
before the header).
| # Instinct Export Command | ||
|
|
||
| name: instinct-export | ||
| description: Export instincts for sharing with teammates or other projects | ||
| command: /instinct-export | ||
| --- | ||
|
|
||
| # Instinct Export Command |
There was a problem hiding this comment.
Duplicate heading and orphaned metadata field.
The file has two issues:
- Duplicate heading: "# Instinct Export Command" appears on both lines 1 and 5
- Orphaned field: Line 3 has
name: instinct-exportwithout YAML front-matter delimiters
📝 Proposed fix to remove duplicates
-# Instinct Export Command
-
-name: instinct-export
-
# Instinct Export Command
Exports instincts to a shareable format. Perfect for:📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Instinct Export Command | |
| name: instinct-export | |
| description: Export instincts for sharing with teammates or other projects | |
| command: /instinct-export | |
| --- | |
| # Instinct Export Command | |
| # Instinct Export Command |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 5-5: Multiple headings with the same content
(MD024, no-duplicate-heading)
🤖 Prompt for AI Agents
In `@commands/instinct-export.md` around lines 1 - 5, Remove the duplicate second
heading and fix the orphaned metadata by either deleting the lone "name:
instinct-export" line or converting it into proper YAML front-matter;
specifically keep a single "# Instinct Export Command" heading (remove the
duplicate), and if the metadata is required wrap "name: instinct-export" between
YAML delimiters (---) above the heading so the file contains one heading and
valid front-matter.
| # Instinct Import Command | ||
|
|
||
| name: instinct-import | ||
| description: Import instincts from teammates, Skill Creator, or other sources | ||
| command: true | ||
| --- | ||
|
|
||
| # Instinct Import Command |
There was a problem hiding this comment.
Duplicate heading and orphaned metadata field.
Same pattern as instinct-export.md and instinct-status.md:
- Duplicate heading on lines 1 and 5
- Orphaned
name: instinct-importon line 3 without YAML delimiters
📝 Proposed fix to remove duplicates
-# Instinct Import Command
-
-name: instinct-import
-
# Instinct Import Command
## Implementation📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Instinct Import Command | |
| name: instinct-import | |
| description: Import instincts from teammates, Skill Creator, or other sources | |
| command: true | |
| --- | |
| # Instinct Import Command | |
| # Instinct Import Command | |
| ## Implementation |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)
[warning] 5-5: Multiple headings with the same content
(MD024, no-duplicate-heading)
🤖 Prompt for AI Agents
In `@commands/instinct-import.md` around lines 1 - 5, Remove the duplicate
top-level heading and fix the orphaned metadata by either converting the lone
"name: instinct-import" into proper YAML frontmatter (surround with --- above
the first heading and --- below it) or deleting the redundant "name:
instinct-import" line; specifically remove one of the identical "# Instinct
Import Command" headings (the duplicate at the bottom) and ensure "name:
instinct-import" is only present inside YAML frontmatter, leaving a single
heading and valid metadata for the document.
| # Instinct Status Command | ||
|
|
||
| name: instinct-status | ||
| description: Show all learned instincts with their confidence levels | ||
| command: true | ||
| --- | ||
|
|
||
| # Instinct Status Command |
There was a problem hiding this comment.
Duplicate heading and orphaned metadata field.
Same issue as commands/instinct-export.md:
- Duplicate heading on lines 1 and 5
- Orphaned
name: instinct-statuson line 3 without YAML front-matter delimiters
📝 Proposed fix to remove duplicates
-# Instinct Status Command
-
-name: instinct-status
-
# Instinct Status Command
Shows all learned instincts with their confidence scores, grouped by domain.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Instinct Status Command | |
| name: instinct-status | |
| description: Show all learned instincts with their confidence levels | |
| command: true | |
| --- | |
| # Instinct Status Command | |
| # Instinct Status Command | |
| Shows all learned instincts with their confidence scores, grouped by domain. |
🤖 Prompt for AI Agents
In `@commands/instinct-status.md` around lines 1 - 5, Remove the duplicate heading
and fix the orphaned metadata: keep a single top-level heading "# Instinct
Status Command" and either wrap the metadata key "name: instinct-status" in
proper YAML front-matter delimiters (--- before and after) immediately above the
heading, or remove the lone "name: instinct-status" line if metadata is
unnecessary; ensure only one heading remains and the metadata (if kept) is valid
front-matter.
| ``` | ||
| project/ | ||
| ├── ecosystem.config.cjs # PM2 config | ||
| ├── {backend}/start.cjs # Python wrapper (if applicable) | ||
| └── .claude/ | ||
| ├── commands/ | ||
| │ ├── pm2-all.md # Start all + monit | ||
| │ ├── pm2-all-stop.md # Stop all | ||
| │ ├── pm2-all-restart.md # Restart all | ||
| │ ├── pm2-{port}.md # Start single + logs | ||
| │ ├── pm2-{port}-stop.md # Stop single | ||
| │ ├── pm2-{port}-restart.md # Restart single | ||
| │ ├── pm2-logs.md # View all logs | ||
| │ └── pm2-status.md # View status | ||
| └── scripts/ | ||
| ├── pm2-logs-{port}.ps1 # Single service logs | ||
| └── pm2-monit.ps1 # PM2 monitor | ||
| ``` |
There was a problem hiding this comment.
Add language identifier to fenced code block.
markdownlint reports MD040 for a fenced block in this section. Add a language (e.g., text) to satisfy the rule and improve tooling support.
💡 Suggested fix
-```
+```text
project/
├── ecosystem.config.cjs # PM2 config
├── {backend}/start.cjs # Python wrapper (if applicable)
└── .claude/
├── commands/
│ ├── pm2-all.md # Start all + monit
│ ├── pm2-all-stop.md # Stop all
│ ├── pm2-all-restart.md # Restart all
│ ├── pm2-{port}.md # Start single + logs
│ ├── pm2-{port}-stop.md # Stop single
│ ├── pm2-{port}-restart.md # Restart single
│ ├── pm2-logs.md # View all logs
│ └── pm2-status.md # View status
└── scripts/
├── pm2-logs-{port}.ps1 # Single service logs
└── pm2-monit.ps1 # PM2 monitor🤖 Prompt for AI Agents
In `@commands/pm2.md` around lines 35 - 52, The fenced code block showing the
project tree in commands/pm2.md triggers markdownlint MD040 because it lacks a
language identifier; update the opening fence from ``` to ```text (or another
appropriate language) for that ASCII tree snippet so the block becomes fenced
with a language, satisfying MD040 and improving tooling support.
| **IMPORTANT**: | ||
| - NEVER run `pnpm dev` directly - hook will block it | ||
| - No `ecosystem.config.cjs` -> run `/everything-claude-code:pm2 init` first | ||
| - Config must use `.cjs` extension (ESM compatibility) |
There was a problem hiding this comment.
Clarify blocking behavior in documentation.
Line 53 states "NEVER run pnpm dev directly - hook will block it", but reviewing hooks.json (line 21), the hook only blocks with process.exit(2) on Windows when ecosystem.config.cjs exists. On Linux/macOS without tmux, it only prints a tip and exits 0 (doesn't block). Consider clarifying this platform-specific behavior.
📝 Suggested clarification
**IMPORTANT**:
-- NEVER run `pnpm dev` directly - hook will block it
+- NEVER run `pnpm dev` directly - hook blocks it on Windows (if PM2 config exists), suggests alternatives elsewhere
- No `ecosystem.config.cjs` -> run `/everything-claude-code:pm2 init` first🤖 Prompt for AI Agents
In `@rules/hooks.md` around lines 52 - 55, Update the documentation line that says
"NEVER run `pnpm dev` directly - hook will block it" to accurately describe the
platform-specific behavior: state that the pre-run hook only forces a hard block
(exits with code 2) on Windows when `ecosystem.config.cjs` exists (see
hooks.json behavior around process.exit(2)), while on Linux/macOS without tmux
the hook merely prints a tip and exits 0 (no hard block); also mention the
recommended flow to run `/everything-claude-code:pm2 init` and that config files
must use `.cjs` for clarity.
| function archiveIfNeeded() { | ||
| if (!fs.existsSync(OBSERVATIONS_FILE)) return; | ||
|
|
||
| const sizeMB = getFileSizeMB(OBSERVATIONS_FILE); | ||
| if (sizeMB >= MAX_FILE_SIZE_MB) { | ||
| const archiveDir = path.join(CONFIG_DIR, 'observations.archive'); | ||
| ensureDir(archiveDir); | ||
|
|
||
| const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19); | ||
| const archivePath = path.join(archiveDir, `observations-${timestamp}.jsonl`); | ||
| fs.renameSync(OBSERVATIONS_FILE, archivePath); | ||
| } | ||
| } |
There was a problem hiding this comment.
Race condition between size check and archive rename.
If multiple hook instances run concurrently, they could both see the file exceeds the threshold and both attempt to rename it, causing one to fail. Consider using a lock file or catching ENOENT on rename.
🔧 Proposed fix with error handling
function archiveIfNeeded() {
if (!fs.existsSync(OBSERVATIONS_FILE)) return;
const sizeMB = getFileSizeMB(OBSERVATIONS_FILE);
if (sizeMB >= MAX_FILE_SIZE_MB) {
const archiveDir = path.join(CONFIG_DIR, 'observations.archive');
ensureDir(archiveDir);
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
const archivePath = path.join(archiveDir, `observations-${timestamp}.jsonl`);
- fs.renameSync(OBSERVATIONS_FILE, archivePath);
+ try {
+ fs.renameSync(OBSERVATIONS_FILE, archivePath);
+ } catch (e) {
+ // Another process may have already archived - ignore ENOENT
+ if (e.code !== 'ENOENT') throw e;
+ }
}
}🤖 Prompt for AI Agents
In `@skills/continuous-learning-v2/hooks/observe.js` around lines 47 - 59, The
archiveIfNeeded function can race when multiple instances detect
OBSERVATIONS_FILE is oversized; protect the rename by obtaining a simple lock
(create a lock file with fs.openSync using O_CREAT|O_EXCL, bail out if lock
acquisition fails) around the size check + rename, or if you prefer a lighter
change wrap the fs.renameSync(OBSERVATIONS_FILE, archivePath) in a try/catch and
ignore ENOENT (and log other errors) so concurrent renames don't crash; ensure
you always remove the lock file in a finally block and keep calls to ensureDir,
getFileSizeMB, OBSERVATIONS_FILE and archivePath intact.
| await new Promise((resolve) => { | ||
| process.stdin.setEncoding('utf8'); | ||
| process.stdin.on('data', chunk => { inputData += chunk; }); | ||
| process.stdin.on('end', resolve); | ||
|
|
||
| // Timeout after 5 seconds | ||
| setTimeout(resolve, 5000); | ||
| }); |
There was a problem hiding this comment.
Timeout doesn't properly terminate stdin reading.
When the timeout fires after 5 seconds, it calls resolve() but doesn't close stdin. This means the data event listener remains active and could continue appending to inputData after the Promise resolves.
🔧 Proposed fix to properly handle timeout
await new Promise((resolve) => {
process.stdin.setEncoding('utf8');
process.stdin.on('data', chunk => { inputData += chunk; });
process.stdin.on('end', resolve);
// Timeout after 5 seconds
- setTimeout(resolve, 5000);
+ setTimeout(() => {
+ process.stdin.destroy();
+ resolve();
+ }, 5000);
});🤖 Prompt for AI Agents
In `@skills/continuous-learning-v2/hooks/observe.js` around lines 140 - 147, The
Promise that reads from process.stdin should clean up listeners and stop the
stream when the timeout fires: register named handler functions (e.g., onData
and onEnd) and store the setTimeout id; in the timeout handler remove the 'data'
and 'end' listeners from process.stdin (using removeListener or off), call
process.stdin.pause() to stop further input, and then resolve; likewise, in the
onEnd handler clear the timeout (clearTimeout) and remove the listeners to avoid
leaks. Update the code that sets up process.stdin.on('data', ...),
process.stdin.on('end', ...), and setTimeout(...) to use these named handlers
and the stored timeout id so both timeout and normal end paths properly clean
up.
| rm -rf "$PLUGIN_MARKET"/* | ||
| cp -r ./* "$PLUGIN_MARKET/" 2>/dev/null | ||
| cp -r ./.claude-plugin "$PLUGIN_MARKET/" 2>/dev/null | ||
| rm -f "$PLUGIN_MARKET/sync-tools.sh" "$PLUGIN_MARKET/SYNC-README.md" | ||
|
|
||
| # 同步到 Cache | ||
| echo ">>> 2/2 同步到 Cache..." | ||
| rm -rf "$PLUGIN_CACHE"/* | ||
| cp -r ./* "$PLUGIN_CACHE/" 2>/dev/null | ||
| cp -r ./.claude-plugin "$PLUGIN_CACHE/" 2>/dev/null | ||
| rm -f "$PLUGIN_CACHE/sync-tools.sh" "$PLUGIN_CACHE/SYNC-README.md" |
There was a problem hiding this comment.
Critical: Protect against catastrophic rm -rf /* if variables are empty.
If PLUGIN_MARKET or PLUGIN_CACHE is unset or empty, the rm -rf "$var"/* commands will expand to rm -rf /*, potentially deleting the entire filesystem. This is a well-known shell scripting pitfall flagged by ShellCheck (SC2115).
🛡️ Proposed fix using parameter expansion with error
# 同步到 Marketplaces
echo ">>> 1/2 同步到 Marketplaces..."
- rm -rf "$PLUGIN_MARKET"/*
+ rm -rf "${PLUGIN_MARKET:?PLUGIN_MARKET is not set}"/*
cp -r ./* "$PLUGIN_MARKET/" 2>/dev/null
cp -r ./.claude-plugin "$PLUGIN_MARKET/" 2>/dev/null
rm -f "$PLUGIN_MARKET/sync-tools.sh" "$PLUGIN_MARKET/SYNC-README.md"
# 同步到 Cache
echo ">>> 2/2 同步到 Cache..."
- rm -rf "$PLUGIN_CACHE"/*
+ rm -rf "${PLUGIN_CACHE:?PLUGIN_CACHE is not set}"/*
cp -r ./* "$PLUGIN_CACHE/" 2>/dev/null
cp -r ./.claude-plugin "$PLUGIN_CACHE/" 2>/dev/null
rm -f "$PLUGIN_CACHE/sync-tools.sh" "$PLUGIN_CACHE/SYNC-README.md"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| rm -rf "$PLUGIN_MARKET"/* | |
| cp -r ./* "$PLUGIN_MARKET/" 2>/dev/null | |
| cp -r ./.claude-plugin "$PLUGIN_MARKET/" 2>/dev/null | |
| rm -f "$PLUGIN_MARKET/sync-tools.sh" "$PLUGIN_MARKET/SYNC-README.md" | |
| # 同步到 Cache | |
| echo ">>> 2/2 同步到 Cache..." | |
| rm -rf "$PLUGIN_CACHE"/* | |
| cp -r ./* "$PLUGIN_CACHE/" 2>/dev/null | |
| cp -r ./.claude-plugin "$PLUGIN_CACHE/" 2>/dev/null | |
| rm -f "$PLUGIN_CACHE/sync-tools.sh" "$PLUGIN_CACHE/SYNC-README.md" | |
| rm -rf "${PLUGIN_MARKET:?PLUGIN_MARKET is not set}"/* | |
| cp -r ./* "$PLUGIN_MARKET/" 2>/dev/null | |
| cp -r ./.claude-plugin "$PLUGIN_MARKET/" 2>/dev/null | |
| rm -f "$PLUGIN_MARKET/sync-tools.sh" "$PLUGIN_MARKET/SYNC-README.md" | |
| # 同步到 Cache | |
| echo ">>> 2/2 同步到 Cache..." | |
| rm -rf "${PLUGIN_CACHE:?PLUGIN_CACHE is not set}"/* | |
| cp -r ./* "$PLUGIN_CACHE/" 2>/dev/null | |
| cp -r ./.claude-plugin "$PLUGIN_CACHE/" 2>/dev/null | |
| rm -f "$PLUGIN_CACHE/sync-tools.sh" "$PLUGIN_CACHE/SYNC-README.md" |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 128-128: Use "${var:?}" to ensure this never expands to /* .
(SC2115)
[warning] 135-135: Use "${var:?}" to ensure this never expands to /* .
(SC2115)
🤖 Prompt for AI Agents
In `@sync-tools.sh` around lines 128 - 138, The rm -rf lines using
"$PLUGIN_MARKET" and "$PLUGIN_CACHE" are unsafe when those variables are empty;
add a guard to abort or fail fast if either variable is unset/empty (e.g., use
parameter expansion that errors like "${PLUGIN_MARKET:?}" / "${PLUGIN_CACHE:?}"
or test [ -n "$PLUGIN_MARKET" ] && [ -n "$PLUGIN_CACHE" ] and exit with a clear
error) before executing rm -rf "$PLUGIN_MARKET"/* and rm -rf "$PLUGIN_CACHE"/*,
ensuring all subsequent cp and rm -f operations only run after the check passes.
| } | ||
|
|
||
| # 主逻辑 | ||
| cd "$(dirname "$0")" |
There was a problem hiding this comment.
Handle cd failure to prevent script from running in wrong directory.
If the cd command fails (e.g., the script's directory was deleted), subsequent git and file operations will execute in the wrong directory, potentially causing unintended behavior.
🛡️ Proposed fix
# 主逻辑
-cd "$(dirname "$0")"
+cd "$(dirname "$0")" || { echo "错误: 无法切换到脚本目录"; exit 1; }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| cd "$(dirname "$0")" | |
| cd "$(dirname "$0")" || { echo "错误: 无法切换到脚本目录"; exit 1; } |
🧰 Tools
🪛 Shellcheck (0.11.0)
[warning] 145-145: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)
🤖 Prompt for AI Agents
In `@sync-tools.sh` at line 145, The script currently runs cd "$(dirname "$0")"
without checking for failure; update the script to detect if that cd command
fails and abort to avoid running subsequent git/file operations in the wrong
directory — after the cd "$(dirname "$0")" statement, check its exit status and,
on failure, print an explanatory error to stderr and exit with a non-zero status
(e.g., use a conditional fallback that logs a message and calls exit 1) so the
script stops immediately when changing to the script directory fails.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
This PR appears to include unintended local changes:
Concerning Deletions:
- Removes all CI/CD workflows (
.github/workflows/) - Deletes Django skills (
django-patterns,django-security,django-tdd,django-verification) - Deletes Python skills (
python-patterns,python-testing) - Removes
.markdownlint.jsonand other config files
Additions that may be local-specific:
sync-tools.sh- appears to be a personal sync scriptSYNC-README.md- local dev documentation- Device-specific hook changes
Recommendation:
- Please create a new branch from
main - Cherry-pick only the intended changes (pm2 command, observe.js)
- Keep CI/CD and existing skills intact
If you intended to remove Django/Python skills, please open a separate issue for discussion first.
I'd be happy to help you extract the valuable parts of this PR into a clean submission!
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: Merge conflicts detected. Please rebase.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Review: Changes Requested
Thank you for the contribution. However, this PR has several significant issues that need to be addressed before it can be merged.
Critical Issues
-
Merge Conflicts: This PR currently has merge conflicts that must be resolved.
-
Removes CI/CD Infrastructure: This PR deletes all GitHub Actions workflows:
ci.yml- Removes automated testing across multiple OS/Node versionsmaintenance.yml- Removes dependency checks and stale issue managementrelease.ymland reusable workflows - Removes release automationPULL_REQUEST_TEMPLATE.md- Removes PR template
These are critical for maintaining code quality and should not be removed.
-
Deletes Valuable Skill Documentation: The PR removes ~4,000 lines of comprehensive documentation:
skills/django-patterns/SKILL.mdskills/django-security/SKILL.mdskills/django-tdd/SKILL.mdskills/django-verification/SKILL.mdskills/python-patterns/SKILL.mdskills/python-testing/SKILL.md
These are valuable resources that should be preserved.
-
Local-Specific Files: The PR adds files with hardcoded local paths that are not suitable for the main repository:
sync-tools.shwith paths likeD:\ai\mccand$HOME/.claude/plugins/...SYNC-README.mdappears to be personal workflow documentation
Recommendations
- Resolve merge conflicts before requesting review
- Keep CI/CD workflows - if they need modification, propose specific changes
- Keep skill documentation - if outdated, update rather than delete
- Remove local-specific files from this PR (sync-tools.sh, SYNC-README.md)
- Consider splitting this PR into focused changes:
- One PR for the new pm2 command (looks useful)
- One PR for hooks improvements
- One PR for observe.js continuous learning feature
- Separate discussion for any workflow changes
The new pm2 command and observe.js additions look potentially valuable, but should be submitted separately without the deletions.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
affaan-m
left a comment
There was a problem hiding this comment.
Automated review: this PR has merge conflicts. Please rebase or resolve.
|
Closing — this PR has merge conflicts, a vague title ("Local"), and changes were previously requested. If you'd like to resubmit, please rebase on |
Description
Type of Change
fix:Bug fixfeat:New featurerefactor:Code refactoringdocs:Documentationtest:Testschore:Maintenance/toolingci:CI/CD changesChecklist
node tests/run-all.js)Summary by CodeRabbit
New Features
Documentation
Removals