agent-configs 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/README.md +12 -8
  2. package/bundles/docs-bundle/.claude/commands/update-codemaps.md +17 -0
  3. package/bundles/docs-bundle/.claude/commands/update-docs.md +31 -0
  4. package/bundles/docs-bundle/.claude/settings.json +29 -0
  5. package/bundles/docs-bundle/.cursor/commands/update-codemaps.md +17 -0
  6. package/bundles/docs-bundle/.cursor/commands/update-docs.md +31 -0
  7. package/bundles/docs-bundle/.cursor/hooks.json +19 -0
  8. package/bundles/review-bundle/.claude/agents/code-reviewer.md +104 -0
  9. package/bundles/review-bundle/.claude/agents/security-reviewer.md +545 -0
  10. package/bundles/review-bundle/.claude/commands/code-review.md +40 -0
  11. package/{hooks/hooks.json → bundles/review-bundle/.claude/settings.json} +4 -34
  12. package/bundles/review-bundle/.claude/skills/security-review/SKILL.md +497 -0
  13. package/bundles/review-bundle/.claude/skills/security-review/references/cloud-infrastructure-security.md +361 -0
  14. package/bundles/review-bundle/.cursor/agents/code-reviewer.md +104 -0
  15. package/bundles/review-bundle/.cursor/agents/security-reviewer.md +545 -0
  16. package/bundles/review-bundle/.cursor/commands/code-review.md +40 -0
  17. package/bundles/review-bundle/.cursor/hooks.json +19 -0
  18. package/bundles/review-bundle/.cursor/skills/security-review/SKILL.md +497 -0
  19. package/bundles/review-bundle/.cursor/skills/security-review/references/cloud-infrastructure-security.md +361 -0
  20. package/cli.js +10 -8
  21. package/configs.json +10 -20
  22. package/package.json +1 -1
  23. package/skills/ai-config-architect/references/hooks.md +122 -19
package/README.md CHANGED
@@ -8,7 +8,7 @@ CLI tool to install curated Claude Code and Cursor configurations.
8
8
 
9
9
  - **交互式菜单** - 上下选择、Enter 进入/安装、Esc 返回
10
10
  - **双平台支持** - Claude Code + Cursor(默认 Cursor)
11
- - **完整配置** - Commands + Skills + Rules + Agents + Hooks + Bundles
11
+ - **完整配置** - Commands + Skills + Rules + Agents + Bundles(Hooks 通过 Bundles 提供)
12
12
  - **Bundle 优先** - 相关配置打包,一键安装
13
13
 
14
14
  ## 快速开始
@@ -41,11 +41,10 @@ agent-configs - Claude Code & Cursor 配置共享工具
41
41
 
42
42
  ? 选择类别
43
43
  ❯ Commands (10) ★2 (claude/cursor)
44
- Skills (7) (claude/cursor)
44
+ Skills (8) (claude/cursor)
45
45
  Rules (8) ★1 (cursor)
46
46
  Agents (6) ★2 (claude/cursor)
47
- Hooks (1) (claude/cursor)
48
- Bundles (5) ★3
47
+ Bundles (6) ★4
49
48
  ──────────────
50
49
  退出
51
50
  ```
@@ -71,10 +70,11 @@ agent-configs - Claude Code & Cursor 配置共享工具
71
70
  | update-docs | 同步文档 |
72
71
  | update-codemaps | 更新架构文档 |
73
72
 
74
- ### Skills(7 个)
73
+ ### Skills(8 个)
75
74
 
76
75
  | Skill | 说明 |
77
76
  |-------|------|
77
+ | ai-config-architect | AI 配置架构师 - 生成 rules/skills/commands/hooks/agents 配置,支持 Claude/Cursor 双平台 |
78
78
  | tdd-workflow | TDD 完整工作流和最佳实践 |
79
79
  | security-review | 安全审查检查清单 |
80
80
  | coding-standards | 编码规范和风格指南 |
@@ -94,7 +94,7 @@ agent-configs - Claude Code & Cursor 配置共享工具
94
94
  | agents | 子代理使用规范 |
95
95
  | patterns | API 响应格式规范 |
96
96
  | performance | 模型选择和上下文管理 |
97
- | hooks | Hook 使用文档 |
97
+ | hooks-guide | Hook 使用文档 |
98
98
 
99
99
  ### Agents(6 个)
100
100
 
@@ -107,15 +107,17 @@ agent-configs - Claude Code & Cursor 配置共享工具
107
107
  | security-reviewer | 安全审查专家 |
108
108
  | refactor-cleaner | 重构清理专家 |
109
109
 
110
- ### Bundles(5 个)
110
+ ### Bundles(6 个)
111
111
 
112
112
  | Bundle | 包含内容 | 说明 |
113
113
  |--------|----------|------|
114
114
  | shared-memory | commands + hooks + lib + skills + rules | 跨会话记忆管理系统 |
115
115
  | tdd-bundle | tdd + tdd-workflow + tdd-guide | TDD 完整工作流 |
116
- | review-bundle | code-review + security-review + code-reviewer + security-reviewer | 代码审查全套 |
116
+ | review-bundle | code-review + security-review + code-reviewer + security-reviewer + hooks | 代码审查全套 - 包含 /code-review 命令、审查 agents、Prettier/TypeScript/console.log 检查 hooks |
117
117
  | planning-bundle | plan + planner + architect | 规划和架构设计 |
118
118
  | bk-chat-bundle | bk-chat-helper + bk-chat-x | 蓝鲸 AI Chat 开发 |
119
+ | continuous-learning | commands + hooks + lib + skills + rules | 持续学习 - 从会话中自动提取 patterns,保存为 skills/instincts |
120
+ | docs-bundle | commands + hooks | 文档自动化 - 包含 /update-docs、/update-codemaps 命令及文档更新提醒 hooks |
119
121
 
120
122
  ## 使用方式
121
123
 
@@ -158,6 +160,8 @@ npx agent-configs install review-bundle
158
160
  npx agent-configs install planning-bundle
159
161
  npx agent-configs install bk-chat-bundle
160
162
  npx agent-configs install shared-memory
163
+ npx agent-configs install continuous-learning
164
+ npx agent-configs install docs-bundle
161
165
 
162
166
  # 指定平台
163
167
  npx agent-configs install plan --agent claude
@@ -0,0 +1,17 @@
1
+ # Update Codemaps
2
+
3
+ Analyze the codebase structure and update architecture documentation:
4
+
5
+ 1. Scan all source files for imports, exports, and dependencies
6
+ 2. Generate token-lean codemaps in the following format:
7
+ - codemaps/architecture.md - Overall architecture
8
+ - codemaps/backend.md - Backend structure
9
+ - codemaps/frontend.md - Frontend structure
10
+ - codemaps/data.md - Data models and schemas
11
+
12
+ 3. Calculate diff percentage from previous version
13
+ 4. If changes > 30%, request user approval before updating
14
+ 5. Add freshness timestamp to each codemap
15
+ 6. Save reports to .reports/codemap-diff.txt
16
+
17
+ Use TypeScript/Node.js for analysis. Focus on high-level structure, not implementation details.
@@ -0,0 +1,31 @@
1
+ # Update Documentation
2
+
3
+ Sync documentation from source-of-truth:
4
+
5
+ 1. Read package.json scripts section
6
+ - Generate scripts reference table
7
+ - Include descriptions from comments
8
+
9
+ 2. Read .env.example
10
+ - Extract all environment variables
11
+ - Document purpose and format
12
+
13
+ 3. Generate docs/CONTRIB.md with:
14
+ - Development workflow
15
+ - Available scripts
16
+ - Environment setup
17
+ - Testing procedures
18
+
19
+ 4. Generate docs/RUNBOOK.md with:
20
+ - Deployment procedures
21
+ - Monitoring and alerts
22
+ - Common issues and fixes
23
+ - Rollback procedures
24
+
25
+ 5. Identify obsolete documentation:
26
+ - Find docs not modified in 90+ days
27
+ - List for manual review
28
+
29
+ 6. Show diff summary
30
+
31
+ Single source of truth: package.json and .env.example
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "tool == \"Write\" && tool_input.file_path matches \"\\\\.(md|txt)$\" && !(tool_input.file_path matches \"README\\\\.md|CLAUDE\\\\.md|AGENTS\\\\.md|CONTRIBUTING\\\\.md|CHANGELOG\\\\.md\")",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';if(/\\.(md|txt)$/.test(p)&&!/(README|CLAUDE|AGENTS|CONTRIBUTING|CHANGELOG)\\.md$/.test(p)&&!/codemaps\\//.test(p)&&!/docs\\//.test(p)){console.error('[Hook] BLOCKED: Unnecessary documentation file creation');console.error('[Hook] File: '+p);console.error('[Hook] Use README.md or docs/ directory instead');process.exit(1)}console.log(d)})\""
11
+ }
12
+ ],
13
+ "description": "Block creation of random .md files - keeps docs consolidated"
14
+ }
15
+ ],
16
+ "Stop": [
17
+ {
18
+ "matcher": "*",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node -e \"const{execSync}=require('child_process');const fs=require('fs');try{const diff=execSync('git diff --name-only HEAD 2>/dev/null',{encoding:'utf8'});const staged=execSync('git diff --name-only --cached 2>/dev/null',{encoding:'utf8'});const all=[...diff.split('\\n'),...staged.split('\\n')].filter(Boolean);const code=all.filter(f=>/\\.(js|ts|tsx|jsx|json)$/.test(f)&&!/package-lock|pnpm-lock/.test(f));const docs=all.filter(f=>/README\\.md|CLAUDE\\.md|CHANGELOG/.test(f));if(code.length>0&&docs.length===0){console.log(JSON.stringify({reminder:'📝 Code changed but docs not updated. Modified: '+code.slice(0,3).join(', ')+(code.length>3?' (+'+(code.length-3)+' more)':'')+'. Consider: /update-docs'}));}}catch(e){}\""
23
+ }
24
+ ],
25
+ "description": "Remind to update docs when code changes but README unchanged"
26
+ }
27
+ ]
28
+ }
29
+ }
@@ -0,0 +1,17 @@
1
+ # Update Codemaps
2
+
3
+ Analyze the codebase structure and update architecture documentation:
4
+
5
+ 1. Scan all source files for imports, exports, and dependencies
6
+ 2. Generate token-lean codemaps in the following format:
7
+ - codemaps/architecture.md - Overall architecture
8
+ - codemaps/backend.md - Backend structure
9
+ - codemaps/frontend.md - Frontend structure
10
+ - codemaps/data.md - Data models and schemas
11
+
12
+ 3. Calculate diff percentage from previous version
13
+ 4. If changes > 30%, request user approval before updating
14
+ 5. Add freshness timestamp to each codemap
15
+ 6. Save reports to .reports/codemap-diff.txt
16
+
17
+ Use TypeScript/Node.js for analysis. Focus on high-level structure, not implementation details.
@@ -0,0 +1,31 @@
1
+ # Update Documentation
2
+
3
+ Sync documentation from source-of-truth:
4
+
5
+ 1. Read package.json scripts section
6
+ - Generate scripts reference table
7
+ - Include descriptions from comments
8
+
9
+ 2. Read .env.example
10
+ - Extract all environment variables
11
+ - Document purpose and format
12
+
13
+ 3. Generate docs/CONTRIB.md with:
14
+ - Development workflow
15
+ - Available scripts
16
+ - Environment setup
17
+ - Testing procedures
18
+
19
+ 4. Generate docs/RUNBOOK.md with:
20
+ - Deployment procedures
21
+ - Monitoring and alerts
22
+ - Common issues and fixes
23
+ - Rollback procedures
24
+
25
+ 5. Identify obsolete documentation:
26
+ - Find docs not modified in 90+ days
27
+ - List for manual review
28
+
29
+ 6. Show diff summary
30
+
31
+ Single source of truth: package.json and .env.example
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": 1,
3
+ "hooks": {
4
+ "preToolUse": [
5
+ {
6
+ "matcher": "Write",
7
+ "command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';if(/\\.(md|txt)$/.test(p)&&!/(README|CLAUDE|AGENTS|CONTRIBUTING|CHANGELOG)\\.md$/.test(p)&&!/codemaps\\//.test(p)&&!/docs\\//.test(p)){console.error('[Hook] BLOCKED: Unnecessary documentation file creation');console.error('[Hook] File: '+p);console.error('[Hook] Use README.md or docs/ directory instead');process.exit(2)}})\"",
8
+ "description": "Block creation of random .md files - keeps docs consolidated"
9
+ }
10
+ ],
11
+ "stop": [
12
+ {
13
+ "command": "node -e \"const{execSync}=require('child_process');try{const diff=execSync('git diff --name-only HEAD 2>/dev/null',{encoding:'utf8'});const staged=execSync('git diff --name-only --cached 2>/dev/null',{encoding:'utf8'});const all=[...diff.split('\\n'),...staged.split('\\n')].filter(Boolean);const code=all.filter(f=>/\\.(js|ts|tsx|jsx|json)$/.test(f)&&!/package-lock|pnpm-lock/.test(f));const docs=all.filter(f=>/README\\.md|CLAUDE\\.md|CHANGELOG/.test(f));if(code.length>0&&docs.length===0){const files=code.slice(0,3).join(', ')+(code.length>3?' (+'+(code.length-3)+' more)':'');console.log(JSON.stringify({followup_message:'[文档提醒] 代码已修改但文档未更新。修改的文件: '+files+'。如需更新文档请使用 /update-docs,否则请忽略此消息。'}));}else{console.log('{}');}}catch(e){console.log('{}');}\"",
14
+ "loop_limit": 1,
15
+ "description": "Remind to update docs when code changes but README unchanged"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code. MUST BE USED for all code changes.
4
+ tools: ["Read", "Grep", "Glob", "Bash"]
5
+ model: opus
6
+ ---
7
+
8
+ You are a senior code reviewer ensuring high standards of code quality and security.
9
+
10
+ When invoked:
11
+ 1. Run git diff to see recent changes
12
+ 2. Focus on modified files
13
+ 3. Begin review immediately
14
+
15
+ Review checklist:
16
+ - Code is simple and readable
17
+ - Functions and variables are well-named
18
+ - No duplicated code
19
+ - Proper error handling
20
+ - No exposed secrets or API keys
21
+ - Input validation implemented
22
+ - Good test coverage
23
+ - Performance considerations addressed
24
+ - Time complexity of algorithms analyzed
25
+ - Licenses of integrated libraries checked
26
+
27
+ Provide feedback organized by priority:
28
+ - Critical issues (must fix)
29
+ - Warnings (should fix)
30
+ - Suggestions (consider improving)
31
+
32
+ Include specific examples of how to fix issues.
33
+
34
+ ## Security Checks (CRITICAL)
35
+
36
+ - Hardcoded credentials (API keys, passwords, tokens)
37
+ - SQL injection risks (string concatenation in queries)
38
+ - XSS vulnerabilities (unescaped user input)
39
+ - Missing input validation
40
+ - Insecure dependencies (outdated, vulnerable)
41
+ - Path traversal risks (user-controlled file paths)
42
+ - CSRF vulnerabilities
43
+ - Authentication bypasses
44
+
45
+ ## Code Quality (HIGH)
46
+
47
+ - Large functions (>50 lines)
48
+ - Large files (>800 lines)
49
+ - Deep nesting (>4 levels)
50
+ - Missing error handling (try/catch)
51
+ - console.log statements
52
+ - Mutation patterns
53
+ - Missing tests for new code
54
+
55
+ ## Performance (MEDIUM)
56
+
57
+ - Inefficient algorithms (O(n²) when O(n log n) possible)
58
+ - Unnecessary re-renders in React
59
+ - Missing memoization
60
+ - Large bundle sizes
61
+ - Unoptimized images
62
+ - Missing caching
63
+ - N+1 queries
64
+
65
+ ## Best Practices (MEDIUM)
66
+
67
+ - Emoji usage in code/comments
68
+ - TODO/FIXME without tickets
69
+ - Missing JSDoc for public APIs
70
+ - Accessibility issues (missing ARIA labels, poor contrast)
71
+ - Poor variable naming (x, tmp, data)
72
+ - Magic numbers without explanation
73
+ - Inconsistent formatting
74
+
75
+ ## Review Output Format
76
+
77
+ For each issue:
78
+ ```
79
+ [CRITICAL] Hardcoded API key
80
+ File: src/api/client.ts:42
81
+ Issue: API key exposed in source code
82
+ Fix: Move to environment variable
83
+
84
+ const apiKey = "sk-abc123"; // ❌ Bad
85
+ const apiKey = process.env.API_KEY; // ✓ Good
86
+ ```
87
+
88
+ ## Approval Criteria
89
+
90
+ - ✅ Approve: No CRITICAL or HIGH issues
91
+ - ⚠️ Warning: MEDIUM issues only (can merge with caution)
92
+ - ❌ Block: CRITICAL or HIGH issues found
93
+
94
+ ## Project-Specific Guidelines (Example)
95
+
96
+ Add your project-specific checks here. Examples:
97
+ - Follow MANY SMALL FILES principle (200-400 lines typical)
98
+ - No emojis in codebase
99
+ - Use immutability patterns (spread operator)
100
+ - Verify database RLS policies
101
+ - Check AI integration error handling
102
+ - Validate cache fallback behavior
103
+
104
+ Customize based on your project's `CLAUDE.md` or skill files.