ccgx-workflow 1.0.0

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 (212) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +469 -0
  3. package/README.zh-CN.md +466 -0
  4. package/bin/ccg.mjs +2 -0
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.d.ts +1 -0
  7. package/dist/cli.mjs +173 -0
  8. package/dist/index.d.mts +1774 -0
  9. package/dist/index.d.ts +1774 -0
  10. package/dist/index.mjs +2029 -0
  11. package/dist/shared/ccgx-workflow.WgUzkiC3.mjs +5248 -0
  12. package/package.json +129 -0
  13. package/templates/commands/agents/assumptions-analyzer.md +129 -0
  14. package/templates/commands/agents/code-fixer.md +292 -0
  15. package/templates/commands/agents/codebase-mapper.md +152 -0
  16. package/templates/commands/agents/debug-session-manager.md +247 -0
  17. package/templates/commands/agents/debugger.md +111 -0
  18. package/templates/commands/agents/eval-auditor.md +171 -0
  19. package/templates/commands/agents/framework-selector.md +152 -0
  20. package/templates/commands/agents/get-current-datetime.md +29 -0
  21. package/templates/commands/agents/init-architect.md +114 -0
  22. package/templates/commands/agents/integration-checker.md +163 -0
  23. package/templates/commands/agents/interface-auditor.md +170 -0
  24. package/templates/commands/agents/nyquist-auditor.md +131 -0
  25. package/templates/commands/agents/pattern-mapper.md +111 -0
  26. package/templates/commands/agents/phase-runner.md +321 -0
  27. package/templates/commands/agents/plan-checker.md +255 -0
  28. package/templates/commands/agents/planner.md +320 -0
  29. package/templates/commands/agents/team-architect.md +186 -0
  30. package/templates/commands/agents/team-qa.md +121 -0
  31. package/templates/commands/agents/team-reviewer.md +157 -0
  32. package/templates/commands/agents/ui-ux-designer.md +573 -0
  33. package/templates/commands/agents/verifier.md +274 -0
  34. package/templates/commands/analyze.md +210 -0
  35. package/templates/commands/autonomous.md +792 -0
  36. package/templates/commands/cancel.md +132 -0
  37. package/templates/commands/clean-branches.md +117 -0
  38. package/templates/commands/codex-exec.md +404 -0
  39. package/templates/commands/commit.md +151 -0
  40. package/templates/commands/context.md +332 -0
  41. package/templates/commands/debate.md +165 -0
  42. package/templates/commands/debug.md +226 -0
  43. package/templates/commands/enhance.md +64 -0
  44. package/templates/commands/execute.md +380 -0
  45. package/templates/commands/init.md +123 -0
  46. package/templates/commands/optimize.md +217 -0
  47. package/templates/commands/plan.md +373 -0
  48. package/templates/commands/result.md +106 -0
  49. package/templates/commands/review.md +338 -0
  50. package/templates/commands/rollback.md +116 -0
  51. package/templates/commands/spec-impl.md +139 -0
  52. package/templates/commands/spec-init.md +101 -0
  53. package/templates/commands/spec-plan.md +210 -0
  54. package/templates/commands/spec-research.md +152 -0
  55. package/templates/commands/spec-review.md +120 -0
  56. package/templates/commands/status.md +206 -0
  57. package/templates/commands/team-exec.md +265 -0
  58. package/templates/commands/test.md +236 -0
  59. package/templates/commands/verify-work.md +338 -0
  60. package/templates/commands/verify.md +66 -0
  61. package/templates/commands/workflow.md +190 -0
  62. package/templates/commands/worktree.md +128 -0
  63. package/templates/hooks/ccg-context-monitor.js +159 -0
  64. package/templates/hooks/ccg-session-state.cjs +510 -0
  65. package/templates/hooks/ccg-statusline.js +142 -0
  66. package/templates/output-styles/abyss-command.md +56 -0
  67. package/templates/output-styles/abyss-concise.md +89 -0
  68. package/templates/output-styles/abyss-cultivator.md +302 -0
  69. package/templates/output-styles/abyss-ritual.md +70 -0
  70. package/templates/output-styles/engineer-professional.md +89 -0
  71. package/templates/output-styles/laowang-engineer.md +127 -0
  72. package/templates/output-styles/nekomata-engineer.md +120 -0
  73. package/templates/output-styles/ojousama-engineer.md +121 -0
  74. package/templates/prompts/claude/analyzer.md +59 -0
  75. package/templates/prompts/claude/architect.md +54 -0
  76. package/templates/prompts/claude/debugger.md +71 -0
  77. package/templates/prompts/claude/optimizer.md +73 -0
  78. package/templates/prompts/claude/reviewer.md +63 -0
  79. package/templates/prompts/claude/tester.md +69 -0
  80. package/templates/prompts/codex/analyzer.md +58 -0
  81. package/templates/prompts/codex/architect.md +54 -0
  82. package/templates/prompts/codex/debugger.md +74 -0
  83. package/templates/prompts/codex/optimizer.md +81 -0
  84. package/templates/prompts/codex/reviewer.md +73 -0
  85. package/templates/prompts/codex/tester.md +62 -0
  86. package/templates/prompts/gemini/analyzer.md +61 -0
  87. package/templates/prompts/gemini/architect.md +55 -0
  88. package/templates/prompts/gemini/debugger.md +78 -0
  89. package/templates/prompts/gemini/frontend.md +64 -0
  90. package/templates/prompts/gemini/optimizer.md +84 -0
  91. package/templates/prompts/gemini/reviewer.md +80 -0
  92. package/templates/prompts/gemini/tester.md +68 -0
  93. package/templates/rules/ccg-skill-routing.md +83 -0
  94. package/templates/rules/ccg-skills.md +71 -0
  95. package/templates/scripts/ccg-phase-runner-launcher.mjs +467 -0
  96. package/templates/scripts/invoke-model.mjs +949 -0
  97. package/templates/scripts/repatch-gemini-plugin.mjs +194 -0
  98. package/templates/skills/SKILL.md +92 -0
  99. package/templates/skills/domains/ai/SKILL.md +35 -0
  100. package/templates/skills/domains/ai/agent-dev.md +242 -0
  101. package/templates/skills/domains/ai/llm-security.md +288 -0
  102. package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
  103. package/templates/skills/domains/ai/rag-system.md +542 -0
  104. package/templates/skills/domains/architecture/SKILL.md +43 -0
  105. package/templates/skills/domains/architecture/api-design.md +225 -0
  106. package/templates/skills/domains/architecture/caching.md +299 -0
  107. package/templates/skills/domains/architecture/cloud-native.md +285 -0
  108. package/templates/skills/domains/architecture/message-queue.md +329 -0
  109. package/templates/skills/domains/architecture/security-arch.md +297 -0
  110. package/templates/skills/domains/data-engineering/SKILL.md +208 -0
  111. package/templates/skills/domains/development/SKILL.md +47 -0
  112. package/templates/skills/domains/development/cpp.md +246 -0
  113. package/templates/skills/domains/development/go.md +323 -0
  114. package/templates/skills/domains/development/java.md +277 -0
  115. package/templates/skills/domains/development/python.md +288 -0
  116. package/templates/skills/domains/development/rust.md +313 -0
  117. package/templates/skills/domains/development/shell.md +313 -0
  118. package/templates/skills/domains/development/typescript.md +277 -0
  119. package/templates/skills/domains/devops/SKILL.md +40 -0
  120. package/templates/skills/domains/devops/cost-optimization.md +272 -0
  121. package/templates/skills/domains/devops/database.md +217 -0
  122. package/templates/skills/domains/devops/devsecops.md +198 -0
  123. package/templates/skills/domains/devops/git-workflow.md +181 -0
  124. package/templates/skills/domains/devops/observability.md +280 -0
  125. package/templates/skills/domains/devops/performance.md +336 -0
  126. package/templates/skills/domains/devops/testing.md +283 -0
  127. package/templates/skills/domains/frontend-design/SKILL.md +244 -0
  128. package/templates/skills/domains/frontend-design/agents/openai.yaml +4 -0
  129. package/templates/skills/domains/frontend-design/claymorphism/SKILL.md +121 -0
  130. package/templates/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
  131. package/templates/skills/domains/frontend-design/component-patterns.md +202 -0
  132. package/templates/skills/domains/frontend-design/engineering.md +287 -0
  133. package/templates/skills/domains/frontend-design/glassmorphism/SKILL.md +142 -0
  134. package/templates/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
  135. package/templates/skills/domains/frontend-design/liquid-glass/SKILL.md +139 -0
  136. package/templates/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
  137. package/templates/skills/domains/frontend-design/neubrutalism/SKILL.md +145 -0
  138. package/templates/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
  139. package/templates/skills/domains/frontend-design/reference/color-and-contrast.md +132 -0
  140. package/templates/skills/domains/frontend-design/reference/interaction-design.md +195 -0
  141. package/templates/skills/domains/frontend-design/reference/motion-design.md +99 -0
  142. package/templates/skills/domains/frontend-design/reference/responsive-design.md +114 -0
  143. package/templates/skills/domains/frontend-design/reference/spatial-design.md +100 -0
  144. package/templates/skills/domains/frontend-design/reference/typography.md +133 -0
  145. package/templates/skills/domains/frontend-design/reference/ux-writing.md +107 -0
  146. package/templates/skills/domains/frontend-design/state-management.md +680 -0
  147. package/templates/skills/domains/frontend-design/ui-aesthetics.md +110 -0
  148. package/templates/skills/domains/frontend-design/ux-principles.md +156 -0
  149. package/templates/skills/domains/infrastructure/SKILL.md +201 -0
  150. package/templates/skills/domains/mobile/SKILL.md +225 -0
  151. package/templates/skills/domains/orchestration/SKILL.md +30 -0
  152. package/templates/skills/domains/orchestration/multi-agent.md +263 -0
  153. package/templates/skills/domains/security/SKILL.md +73 -0
  154. package/templates/skills/domains/security/blue-team.md +436 -0
  155. package/templates/skills/domains/security/code-audit.md +265 -0
  156. package/templates/skills/domains/security/pentest.md +226 -0
  157. package/templates/skills/domains/security/red-team.md +374 -0
  158. package/templates/skills/domains/security/threat-intel.md +372 -0
  159. package/templates/skills/domains/security/vuln-research.md +369 -0
  160. package/templates/skills/impeccable/adapt/SKILL.md +201 -0
  161. package/templates/skills/impeccable/animate/SKILL.md +176 -0
  162. package/templates/skills/impeccable/arrange/SKILL.md +126 -0
  163. package/templates/skills/impeccable/audit/SKILL.md +149 -0
  164. package/templates/skills/impeccable/bolder/SKILL.md +118 -0
  165. package/templates/skills/impeccable/clarify/SKILL.md +185 -0
  166. package/templates/skills/impeccable/colorize/SKILL.md +144 -0
  167. package/templates/skills/impeccable/critique/SKILL.md +203 -0
  168. package/templates/skills/impeccable/critique/reference/cognitive-load.md +106 -0
  169. package/templates/skills/impeccable/critique/reference/heuristics-scoring.md +234 -0
  170. package/templates/skills/impeccable/critique/reference/personas.md +178 -0
  171. package/templates/skills/impeccable/delight/SKILL.md +305 -0
  172. package/templates/skills/impeccable/distill/SKILL.md +123 -0
  173. package/templates/skills/impeccable/extract/SKILL.md +94 -0
  174. package/templates/skills/impeccable/harden/SKILL.md +357 -0
  175. package/templates/skills/impeccable/normalize/SKILL.md +72 -0
  176. package/templates/skills/impeccable/onboard/SKILL.md +248 -0
  177. package/templates/skills/impeccable/optimize/SKILL.md +268 -0
  178. package/templates/skills/impeccable/overdrive/SKILL.md +143 -0
  179. package/templates/skills/impeccable/polish/SKILL.md +205 -0
  180. package/templates/skills/impeccable/quieter/SKILL.md +104 -0
  181. package/templates/skills/impeccable/teach-impeccable/SKILL.md +72 -0
  182. package/templates/skills/impeccable/typeset/SKILL.md +117 -0
  183. package/templates/skills/orchestration/multi-agent/SKILL.md +533 -0
  184. package/templates/skills/run_skill.js +129 -0
  185. package/templates/skills/scrapling/SKILL.md +98 -0
  186. package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
  187. package/templates/skills/scrapling/references/cookie-vault.md +56 -0
  188. package/templates/skills/scrapling/references/maintenance.md +79 -0
  189. package/templates/skills/scrapling/references/site-patterns.md +86 -0
  190. package/templates/skills/scrapling/references/troubleshooting.md +95 -0
  191. package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
  192. package/templates/skills/scrapling/templates/parse_only.py +15 -0
  193. package/templates/skills/scrapling/templates/session_login.py +19 -0
  194. package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
  195. package/templates/skills/tools/extract-learnings/SKILL.md +77 -0
  196. package/templates/skills/tools/forensics/SKILL.md +89 -0
  197. package/templates/skills/tools/gen-docs/SKILL.md +116 -0
  198. package/templates/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
  199. package/templates/skills/tools/health/SKILL.md +121 -0
  200. package/templates/skills/tools/lib/shared.js +98 -0
  201. package/templates/skills/tools/map-codebase/SKILL.md +118 -0
  202. package/templates/skills/tools/override-refusal/SKILL.md +53 -0
  203. package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
  204. package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
  205. package/templates/skills/tools/verify-change/SKILL.md +143 -0
  206. package/templates/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
  207. package/templates/skills/tools/verify-module/SKILL.md +130 -0
  208. package/templates/skills/tools/verify-module/scripts/module_scanner.js +171 -0
  209. package/templates/skills/tools/verify-quality/SKILL.md +163 -0
  210. package/templates/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
  211. package/templates/skills/tools/verify-security/SKILL.md +146 -0
  212. package/templates/skills/tools/verify-security/scripts/security_scanner.js +283 -0
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * repatch-gemini-plugin.mjs — Idempotent Windows-spawn patch for
4
+ * gemini@google-gemini plugin (v1.0.1+). Adds `windowsHide: true` (and
5
+ * `shell: process.platform === "win32"` where needed) to all 8 known
6
+ * spawn points so plugin operations don't flash console windows on
7
+ * Windows. Safe to run repeatedly.
8
+ *
9
+ * Reference: <ccg-workflow>/.ccg-migration/PLUGIN-PATCHES.md
10
+ *
11
+ * Usage:
12
+ * node ~/.claude/.ccg/scripts/repatch-gemini-plugin.mjs
13
+ * node /path/to/repatch-gemini-plugin.mjs # standalone
14
+ *
15
+ * Re-run after every `claude plugin update gemini@google-gemini`.
16
+ *
17
+ * Patches use regex (not string includes) so they tolerate CRLF/LF line
18
+ * endings and minor whitespace variations between plugin versions.
19
+ */
20
+
21
+ import { readdirSync, readFileSync, writeFileSync, existsSync, statSync } from "node:fs";
22
+ import { homedir, platform } from "node:os";
23
+ import { join } from "node:path";
24
+
25
+ const PLUGIN_BASE = join(
26
+ homedir(),
27
+ ".claude",
28
+ "plugins",
29
+ "cache",
30
+ "google-gemini",
31
+ "gemini",
32
+ );
33
+
34
+ function findPluginVersion() {
35
+ if (!existsSync(PLUGIN_BASE)) {
36
+ throw new Error(
37
+ `gemini plugin not found at ${PLUGIN_BASE}. Install via: claude plugin install gemini@google-gemini`,
38
+ );
39
+ }
40
+ const versions = readdirSync(PLUGIN_BASE).filter((d) => {
41
+ try {
42
+ return statSync(join(PLUGIN_BASE, d)).isDirectory();
43
+ } catch {
44
+ return false;
45
+ }
46
+ });
47
+ if (versions.length === 0) {
48
+ throw new Error(`No gemini plugin version found under ${PLUGIN_BASE}`);
49
+ }
50
+ versions.sort();
51
+ return versions[versions.length - 1];
52
+ }
53
+
54
+ const VERSION = findPluginVersion();
55
+ const SCRIPTS = join(PLUGIN_BASE, VERSION, "scripts");
56
+
57
+ console.log(`Patching gemini plugin ${VERSION} at:\n ${SCRIPTS}\n`);
58
+
59
+ /**
60
+ * Each patch defines:
61
+ * id — patch ID for reporting
62
+ * file — relative to scripts/
63
+ * description — human-readable
64
+ * guard — regex; if matches → already patched (skip)
65
+ * match — regex; locates spawn call options block
66
+ * replace — replacer function/string for String.replace
67
+ *
68
+ * Regex patterns are CRLF/LF-tolerant via `\r?\n` and `[ \t]+`.
69
+ */
70
+ const PATCHES = [
71
+ {
72
+ id: "P-1",
73
+ file: "gemini-companion.mjs",
74
+ description: "spawnBackgroundWorker (Node task-worker)",
75
+ guard: /spawn\("node"[\s\S]{0,300}windowsHide:\s*true/,
76
+ match: /(spawn\("node",\s*\[scriptPath,\s*"task-worker",\s*jobId\],\s*\{[\s\S]*?detached:\s*true,)/,
77
+ replace: '$1\n windowsHide: true,',
78
+ },
79
+ {
80
+ id: "P-2a",
81
+ file: "acp-broker.mjs",
82
+ description: "spawnAcpProcess (gemini --acp CLI)",
83
+ guard: /spawn\("gemini",\s*\["--acp"\][\s\S]{0,400}windowsHide:\s*true/,
84
+ match: /(spawn\("gemini",\s*\["--acp"\],\s*\{[\s\S]*?env:\s*process\.env)(\r?\n\s*\}\);)/,
85
+ replace: '$1,\n shell: process.platform === "win32",\n windowsHide: true$2',
86
+ },
87
+ {
88
+ id: "P-2b",
89
+ file: "lib/acp-client.mjs",
90
+ description: "ACPClient.spawn (gemini --acp CLI)",
91
+ guard: /this\.proc\s*=\s*spawn\("gemini"[\s\S]{0,400}windowsHide:\s*true/,
92
+ match: /(this\.proc\s*=\s*spawn\("gemini",\s*\["--acp"\],\s*\{[\s\S]*?stdio:\s*\["pipe",\s*"pipe",\s*"pipe"\])(\r?\n\s*\}\);)/,
93
+ replace: '$1,\n shell: process.platform === "win32",\n windowsHide: true$2',
94
+ },
95
+ {
96
+ id: "P-4",
97
+ file: "lib/broker-lifecycle.mjs",
98
+ description: "broker daemon spawn (node serve)",
99
+ guard: /spawn\("node",\s*\[\s*BROKER_SCRIPT[\s\S]{0,500}windowsHide:\s*true/,
100
+ match: /(spawn\("node",\s*\[\s*BROKER_SCRIPT[\s\S]*?detached:\s*true,)/,
101
+ replace: '$1\n windowsHide: true,',
102
+ },
103
+ {
104
+ id: "P-5",
105
+ file: "lib/process.mjs",
106
+ description: "runCommand spawnSync (general helper)",
107
+ guard: /spawnSync\(command,\s*args,\s*\{[\s\S]*?windowsHide:\s*true/,
108
+ match: /(spawnSync\(command,\s*args,\s*\{[\s\S]*?stdio:\s*\["pipe",\s*"pipe",\s*"pipe"\])(\r?\n\s*\}\);)/,
109
+ replace: '$1,\n windowsHide: true$2',
110
+ },
111
+ {
112
+ id: "P-6",
113
+ file: "lib/process.mjs",
114
+ description: "taskkill spawnSync (terminate tree)",
115
+ guard: /spawnSync\("taskkill"[\s\S]*?windowsHide:\s*true/,
116
+ match: /(spawnSync\("taskkill",\s*\["\/pid",\s*String\(pid\),\s*"\/T",\s*"\/F"\],\s*\{\s*stdio:\s*"ignore")(\s*\})/,
117
+ replace: '$1, windowsHide: true$2',
118
+ },
119
+ {
120
+ id: "P-7",
121
+ file: "lib/process.mjs",
122
+ description: "spawnDetached helper",
123
+ guard: /nodeSpawn\(command,\s*args[\s\S]*?windowsHide:\s*true/,
124
+ match: /(nodeSpawn\(command,\s*args,\s*\{[\s\S]*?detached:\s*true,)/,
125
+ replace: '$1\n windowsHide: true,',
126
+ },
127
+ {
128
+ id: "P-8",
129
+ file: "lib/process.mjs",
130
+ description: "binaryAvailable (where/which)",
131
+ guard: /spawnSync\(command,\s*\[name\][\s\S]*?windowsHide:\s*true/,
132
+ match: /(spawnSync\(command,\s*\[name\],\s*\{\s*encoding:\s*"utf8",\s*stdio:\s*"pipe")(\s*\})/,
133
+ replace: '$1, windowsHide: true$2',
134
+ },
135
+ ];
136
+
137
+ let applied = 0;
138
+ let alreadyPatched = 0;
139
+ let notMatched = 0;
140
+ const seenFiles = new Map(); // file -> latest content (so multiple patches per file accumulate)
141
+
142
+ for (const patch of PATCHES) {
143
+ const path = join(SCRIPTS, patch.file);
144
+ if (!existsSync(path)) {
145
+ console.log(` [SKIP] ${patch.id} ${patch.description}: ${patch.file} not found`);
146
+ continue;
147
+ }
148
+
149
+ const content = seenFiles.get(path) ?? readFileSync(path, "utf8");
150
+
151
+ if (patch.guard.test(content)) {
152
+ console.log(` [OK] ${patch.id} ${patch.description} (already patched)`);
153
+ alreadyPatched++;
154
+ continue;
155
+ }
156
+
157
+ if (!patch.match.test(content)) {
158
+ console.log(` [MISS] ${patch.id} ${patch.description}: regex did not match (plugin version mismatch?)`);
159
+ notMatched++;
160
+ continue;
161
+ }
162
+
163
+ const next = content.replace(patch.match, patch.replace);
164
+ if (next === content) {
165
+ console.log(` [MISS] ${patch.id} ${patch.description}: replace produced no change`);
166
+ notMatched++;
167
+ continue;
168
+ }
169
+
170
+ seenFiles.set(path, next);
171
+ console.log(` [APPLY] ${patch.id} ${patch.description}`);
172
+ applied++;
173
+ }
174
+
175
+ // Flush all modified files at once (avoids partial writes on multi-patch files like process.mjs)
176
+ for (const [path, content] of seenFiles) {
177
+ writeFileSync(path, content, "utf8");
178
+ }
179
+
180
+ console.log(`\nSummary: ${applied} applied, ${alreadyPatched} already-patched, ${notMatched} unmatched`);
181
+
182
+ if (platform() === "win32" && applied > 0) {
183
+ console.log("\nIMPORTANT — restart broker daemon for new patches to take effect:");
184
+ console.log(" Option A: claude plugin disable gemini@google-gemini && claude plugin enable gemini@google-gemini");
185
+ console.log(" Option B (PowerShell): Get-CimInstance Win32_Process -Filter \"Name='node.exe'\" |");
186
+ console.log(" Where-Object { $_.CommandLine -match 'acp-broker|broker-lifecycle' } |");
187
+ console.log(" ForEach-Object { Stop-Process -Id $_.ProcessId -Force }");
188
+ }
189
+
190
+ if (notMatched > 0) {
191
+ console.log("\nWARNING — some patches did not match. Plugin version may have changed.");
192
+ console.log("Inspect spawn points manually and update PLUGIN-PATCHES.md.");
193
+ process.exit(1);
194
+ }
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: ccg-skills
3
+ description: CCG Skills - Quality gates, documentation generator, and multi-agent orchestration. Auto-installed by CCG workflow system.
4
+ license: MIT
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # CCG Skills
10
+
11
+ ## Directory Structure
12
+
13
+ ```
14
+ skills/
15
+ ├── tools/ # Quality gate tools
16
+ │ ├── verify-security/ # Security vulnerability scanning
17
+ │ ├── verify-quality/ # Code quality checking
18
+ │ ├── verify-change/ # Change analysis & doc sync
19
+ │ ├── verify-module/ # Module completeness validation
20
+ │ ├── gen-docs/ # README.md & DESIGN.md generator
21
+ │ └── lib/ # Shared utilities
22
+ ├── orchestration/ # Multi-agent coordination
23
+ │ └── multi-agent/ # Ant colony-inspired coordination
24
+ ├── run_skill.js # Unified skill runner
25
+ └── SKILL.md # This file
26
+ ```
27
+
28
+ ## Quick Navigation
29
+
30
+ | Category | Description | Entry |
31
+ |----------|-------------|-------|
32
+ | **Quality Gates** | Module completeness, security, quality, change validation | [Quality Gates](#quality-gates) |
33
+ | **Multi-Agent** | Multi-agent coordination and task decomposition | [Multi-Agent](#multi-agent-orchestration) |
34
+
35
+ ---
36
+
37
+ ## Quality Gates
38
+
39
+ **Mandatory quality checkpoints to ensure deliverable standards.**
40
+
41
+ | Skill | Trigger | Description |
42
+ |-------|---------|-------------|
43
+ | `/verify-module` | New module completed | Module structure & documentation completeness |
44
+ | `/verify-security` | New module / security changes / refactoring | Security vulnerability scanning |
45
+ | `/verify-change` | Design-level changes / refactoring | Document sync & change impact analysis |
46
+ | `/verify-quality` | Complex modules / refactoring | Code quality metrics checking |
47
+ | `/gen-docs` | New module created | README.md & DESIGN.md skeleton generator |
48
+
49
+ ### Auto-trigger Rules
50
+
51
+ ```
52
+ New module: /gen-docs → develop → /verify-module → /verify-security
53
+ Code changes: develop → /verify-change → /verify-quality
54
+ Security tasks: execute → /verify-security
55
+ Refactoring: refactor → /verify-change → /verify-quality → /verify-security
56
+ ```
57
+
58
+ ### Running Skills
59
+
60
+ ```bash
61
+ # Unified runner
62
+ node ~/.claude/skills/ccg/run_skill.js <skill-name> [args...]
63
+
64
+ # Examples
65
+ node ~/.claude/skills/ccg/run_skill.js verify-security ./src
66
+ node ~/.claude/skills/ccg/run_skill.js verify-quality ./src -v
67
+ node ~/.claude/skills/ccg/run_skill.js verify-change --mode staged
68
+ node ~/.claude/skills/ccg/run_skill.js verify-module ./my-module
69
+ node ~/.claude/skills/ccg/run_skill.js gen-docs ./new-module --force
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Multi-Agent Orchestration
75
+
76
+ | Skill | Trigger | Description |
77
+ |-------|---------|-------------|
78
+ | `multi-agent` | TeamCreate, parallel tasks, multi-agent | Ant colony-inspired multi-agent coordination |
79
+
80
+ Provides:
81
+ - Agent role system (Lead/Scout/Worker/Soldier/Drone)
82
+ - Pheromone-based indirect communication
83
+ - File ownership locking & conflict avoidance
84
+ - Adaptive concurrency control
85
+ - TeamCreate vs single-agent decision tree
86
+
87
+ ---
88
+
89
+ ## Installed by CCG
90
+
91
+ These skills are automatically installed during `npx ccg-workflow` initialization.
92
+ To update: run `npx ccg-workflow update` or `npx ccg-workflow` again.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: ai
3
+ description: AI/LLM 能力索引(Agent 开发、LLM 安全、RAG、Prompt 工程)。
4
+ license: MIT
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ context: fork
8
+ ---
9
+
10
+ # 丹鼎秘典 · AI/LLM 能力中枢
11
+
12
+ ## 能力矩阵
13
+
14
+ | Skill | 定位 | 核心能力 |
15
+ |-------|------|----------|
16
+ | [agent-dev](agent-dev.md) | Agent 开发 | 多 Agent 编排、工具调用、RAG |
17
+ | [llm-security](llm-security.md) | LLM 安全 | Prompt 注入、越狱防护、输出安全 |
18
+ | [rag-system](rag-system.md) | RAG 系统 | 向量数据库、检索策略、重排算法 |
19
+ | [prompt-and-eval](prompt-and-eval.md) | Prompt 工程与模型评估 | Few-shot、CoT、ReAct、RAGAS、LLM-as-Judge |
20
+
21
+ ## AI 工程原则
22
+
23
+ ```yaml
24
+ 设计原则:
25
+ - 人机协作,AI 增强而非替代
26
+ - 可解释性优先
27
+ - 安全边界明确
28
+ - 渐进式自主
29
+
30
+ 开发原则:
31
+ - Prompt 即代码,需版本控制
32
+ - 输入输出都需验证
33
+ - 成本与效果平衡
34
+ - 持续评估与迭代
35
+ ```
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: agent-dev
3
+ description: AI Agent 开发。多 Agent 编排、工具调用、RAG 系统、Prompt 工程。当用户提到 Agent、RAG、Prompt、LangChain、向量数据库时使用。
4
+ ---
5
+
6
+ # 🔮 丹鼎秘典 · AI Agent 开发
7
+
8
+
9
+ ## Agent 架构
10
+
11
+ ```
12
+ ┌─────────────────────────────────────────────────────────────┐
13
+ │ Agent 系统 │
14
+ ├─────────────────────────────────────────────────────────────┤
15
+ │ 用户输入 → 意图理解 → 规划 → 执行 → 反思 → 输出 │
16
+ │ │ │ │ │ │
17
+ │ Prompt Planner Tools Memory │
18
+ └─────────────────────────────────────────────────────────────┘
19
+ ```
20
+
21
+ ## 核心组件
22
+
23
+ ### 1. Prompt 工程
24
+
25
+ ```yaml
26
+ 结构化 Prompt:
27
+ - System: 角色定义、能力边界、行为规范
28
+ - Context: 背景信息、相关知识
29
+ - Task: 具体任务、输出格式
30
+ - Examples: Few-shot 示例
31
+
32
+ 技巧:
33
+ - 明确角色和边界
34
+ - 分步骤引导思考
35
+ - 提供输出格式示例
36
+ - 设置安全护栏
37
+ ```
38
+
39
+ ### 2. 工具调用
40
+
41
+ ```python
42
+ # 工具定义
43
+ tools = [
44
+ {
45
+ "name": "search",
46
+ "description": "搜索知识库",
47
+ "parameters": {
48
+ "type": "object",
49
+ "properties": {
50
+ "query": {"type": "string", "description": "搜索关键词"}
51
+ },
52
+ "required": ["query"]
53
+ }
54
+ }
55
+ ]
56
+
57
+ # 工具执行
58
+ def execute_tool(name: str, args: dict) -> str:
59
+ if name == "search":
60
+ return search_knowledge_base(args["query"])
61
+ raise ValueError(f"Unknown tool: {name}")
62
+ ```
63
+
64
+ ### 3. 记忆系统
65
+
66
+ ```yaml
67
+ 短期记忆:
68
+ - 对话历史
69
+ - 当前任务上下文
70
+ - 工具调用结果
71
+
72
+ 长期记忆:
73
+ - 向量数据库存储
74
+ - 用户偏好
75
+ - 历史交互摘要
76
+
77
+ 记忆管理:
78
+ - 滑动窗口
79
+ - 摘要压缩
80
+ - 重要性排序
81
+ ```
82
+
83
+ ## RAG 系统
84
+
85
+ ### 架构
86
+
87
+ ```
88
+ 文档 → 分块 → 嵌入 → 向量库
89
+
90
+ 查询 → 嵌入 → 检索 → 重排序 → 生成
91
+ ```
92
+
93
+ ### 实现
94
+
95
+ ```python
96
+ from langchain.text_splitter import RecursiveCharacterTextSplitter
97
+ from langchain.embeddings import OpenAIEmbeddings
98
+ from langchain.vectorstores import Chroma
99
+
100
+ # 文档处理
101
+ splitter = RecursiveCharacterTextSplitter(
102
+ chunk_size=1000,
103
+ chunk_overlap=200,
104
+ separators=["\n\n", "\n", "。", ",", " "]
105
+ )
106
+ chunks = splitter.split_documents(documents)
107
+
108
+ # 向量存储
109
+ embeddings = OpenAIEmbeddings()
110
+ vectorstore = Chroma.from_documents(chunks, embeddings)
111
+
112
+ # 检索
113
+ retriever = vectorstore.as_retriever(
114
+ search_type="mmr", # 最大边际相关性
115
+ search_kwargs={"k": 5, "fetch_k": 20}
116
+ )
117
+ ```
118
+
119
+ ### 优化策略
120
+
121
+ ```yaml
122
+ 分块策略:
123
+ - 语义分块 vs 固定长度
124
+ - 重叠避免信息丢失
125
+ - 保留元数据
126
+
127
+ 检索优化:
128
+ - 混合检索 (关键词 + 向量)
129
+ - 重排序 (Reranker)
130
+ - 查询扩展
131
+
132
+ 生成优化:
133
+ - 引用来源
134
+ - 置信度评估
135
+ - 幻觉检测
136
+ ```
137
+
138
+ ## 多 Agent 编排
139
+
140
+ ### 模式
141
+
142
+ ```yaml
143
+ 顺序执行:
144
+ Agent A → Agent B → Agent C
145
+
146
+ 并行执行:
147
+ Agent A ─┬─→ Agent B ─┬─→ 汇总
148
+ └─→ Agent C ─┘
149
+
150
+ 层级结构:
151
+ Orchestrator
152
+ ├── Planner Agent
153
+ ├── Executor Agent
154
+ └── Reviewer Agent
155
+
156
+ 对话式:
157
+ Agent A ←→ Agent B (多轮交互)
158
+ ```
159
+
160
+ ### 实现示例
161
+
162
+ ```python
163
+ class Orchestrator:
164
+ def __init__(self):
165
+ self.planner = PlannerAgent()
166
+ self.executor = ExecutorAgent()
167
+ self.reviewer = ReviewerAgent()
168
+
169
+ async def run(self, task: str) -> str:
170
+ # 规划
171
+ plan = await self.planner.plan(task)
172
+
173
+ # 执行
174
+ results = []
175
+ for step in plan.steps:
176
+ result = await self.executor.execute(step)
177
+ results.append(result)
178
+
179
+ # 审查
180
+ final = await self.reviewer.review(task, results)
181
+ return final
182
+ ```
183
+
184
+ ## 评估与监控
185
+
186
+ ```yaml
187
+ 评估维度:
188
+ - 准确性: 答案正确率
189
+ - 相关性: 检索质量
190
+ - 完整性: 信息覆盖
191
+ - 一致性: 多次回答稳定性
192
+
193
+ 监控指标:
194
+ - 延迟 (P50/P95/P99)
195
+ - Token 消耗
196
+ - 工具调用成功率
197
+ - 用户满意度
198
+ ```
199
+
200
+ ## 框架选择
201
+
202
+ ```yaml
203
+ LangChain:
204
+ - 优点: 生态丰富,组件多
205
+ - 缺点: 抽象层多,调试难
206
+ - 适合: 快速原型
207
+
208
+ LlamaIndex:
209
+ - 优点: RAG 专精
210
+ - 缺点: Agent 能力弱
211
+ - 适合: 知识库应用
212
+
213
+ 原生实现:
214
+ - 优点: 完全可控
215
+ - 缺点: 开发成本高
216
+ - 适合: 生产系统
217
+ ```
218
+
219
+ ## 最佳实践
220
+
221
+ ```yaml
222
+ 开发:
223
+ - Prompt 版本控制
224
+ - 单元测试覆盖
225
+ - 成本预算控制
226
+ - 降级策略
227
+
228
+ 部署:
229
+ - 流式输出
230
+ - 超时处理
231
+ - 重试机制
232
+ - 缓存策略
233
+
234
+ 安全:
235
+ - 输入验证
236
+ - 输出过滤
237
+ - 权限控制
238
+ - 审计日志
239
+ ```
240
+
241
+ ---
242
+