ccg-ros2-workflow 2.2.2 → 3.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 (186) hide show
  1. package/README.md +211 -96
  2. package/README.zh-CN.md +256 -0
  3. package/dist/cli.mjs +15 -15
  4. package/dist/index.d.mts +59 -36
  5. package/dist/index.d.ts +59 -36
  6. package/dist/index.mjs +4 -4
  7. package/dist/shared/ccg-ros2-workflow.Bhm8c7P1.mjs +5154 -0
  8. package/package.json +31 -12
  9. package/templates/codex/AGENTS.md +348 -0
  10. package/templates/codex/agents/ccg-implement.toml +73 -0
  11. package/templates/codex/agents/ccg-research.toml +73 -0
  12. package/templates/codex/agents/ccg-review.toml +82 -0
  13. package/templates/codex/config.toml +21 -0
  14. package/templates/codex/hooks/ccg-workflow.py +253 -0
  15. package/templates/codex/hooks.json +15 -0
  16. package/templates/commands/agents/planner.md +97 -122
  17. package/templates/commands/agents/system-integrator.md +2 -2
  18. package/templates/commands/agents/team-architect.md +97 -0
  19. package/templates/commands/agents/team-qa.md +121 -0
  20. package/templates/commands/agents/team-reviewer.md +112 -0
  21. package/templates/commands/commit.md +30 -1
  22. package/templates/commands/context.md +332 -0
  23. package/templates/commands/go.md +206 -0
  24. package/templates/commands/init.md +1 -1
  25. package/templates/commands/spec-impl.md +41 -21
  26. package/templates/commands/spec-init.md +21 -27
  27. package/templates/commands/spec-plan.md +54 -21
  28. package/templates/commands/spec-research.md +78 -26
  29. package/templates/commands/spec-review.md +20 -16
  30. package/templates/{commands → commands-legacy}/analyze.md +1 -1
  31. package/templates/commands-legacy/backend.md +224 -0
  32. package/templates/commands-legacy/codex-exec.md +411 -0
  33. package/templates/{commands → commands-legacy}/debug.md +1 -1
  34. package/templates/commands-legacy/enhance.md +55 -0
  35. package/templates/{commands → commands-legacy}/feat.md +2 -2
  36. package/templates/commands-legacy/frontend.md +213 -0
  37. package/templates/{commands → commands-legacy}/optimize.md +1 -1
  38. package/templates/{commands → commands-legacy}/plan.md +1 -15
  39. package/templates/{commands → commands-legacy}/team-plan.md +1 -1
  40. package/templates/commands-legacy/team.md +475 -0
  41. package/templates/{commands → commands-legacy}/test.md +1 -1
  42. package/templates/commands-legacy/workflow.md +283 -0
  43. package/templates/engine/model-router.md +123 -0
  44. package/templates/engine/phase-guide.md +207 -0
  45. package/templates/engine/strategies/debug-investigate.md +169 -0
  46. package/templates/engine/strategies/deep-research.md +141 -0
  47. package/templates/engine/strategies/direct-fix.md +108 -0
  48. package/templates/engine/strategies/full-collaborate.md +389 -0
  49. package/templates/engine/strategies/git-action.md +43 -0
  50. package/templates/engine/strategies/guided-develop.md +282 -0
  51. package/templates/engine/strategies/optimize-measure.md +103 -0
  52. package/templates/engine/strategies/quick-implement.md +96 -0
  53. package/templates/engine/strategies/refactor-safely.md +180 -0
  54. package/templates/engine/strategies/review-audit.md +123 -0
  55. package/templates/hooks/session-start.js +100 -0
  56. package/templates/hooks/skill-router.js +144 -0
  57. package/templates/hooks/subagent-context.js +161 -0
  58. package/templates/hooks/task-utils.js +190 -0
  59. package/templates/hooks/workflow-state.js +55 -0
  60. package/templates/output-styles/abyss-command.md +56 -0
  61. package/templates/output-styles/abyss-concise.md +89 -0
  62. package/templates/output-styles/abyss-ritual.md +70 -0
  63. package/templates/output-styles/engineer-professional.md +20 -3
  64. package/templates/output-styles/laowang-engineer.md +2 -2
  65. package/templates/prompts/antigravity/analyzer.md +59 -0
  66. package/templates/prompts/antigravity/architect.md +55 -0
  67. package/templates/prompts/antigravity/builder.md +52 -0
  68. package/templates/prompts/antigravity/debugger.md +48 -0
  69. package/templates/prompts/antigravity/frontend.md +50 -0
  70. package/templates/prompts/antigravity/optimizer.md +40 -0
  71. package/templates/prompts/antigravity/reviewer.md +67 -0
  72. package/templates/prompts/antigravity/tester.md +39 -0
  73. package/templates/prompts/claude/debugger.md +1 -1
  74. package/templates/prompts/claude/reviewer.md +1 -1
  75. package/templates/prompts/codex/analyzer.md +8 -0
  76. package/templates/prompts/codex/architect.md +9 -1
  77. package/templates/prompts/codex/builder.md +61 -0
  78. package/templates/prompts/codex/debugger.md +9 -1
  79. package/templates/prompts/codex/optimizer.md +7 -0
  80. package/templates/prompts/codex/reviewer.md +7 -0
  81. package/templates/prompts/codex/tester.md +8 -1
  82. package/templates/prompts/gemini/analyzer.md +11 -3
  83. package/templates/prompts/gemini/architect.md +10 -2
  84. package/templates/prompts/gemini/debugger.md +8 -0
  85. package/templates/prompts/gemini/frontend.md +10 -2
  86. package/templates/prompts/gemini/optimizer.md +9 -2
  87. package/templates/prompts/gemini/reviewer.md +7 -0
  88. package/templates/prompts/gemini/tester.md +8 -1
  89. package/templates/rules/ccg-skill-routing.md +91 -0
  90. package/templates/rules/ccg-skills.md +65 -0
  91. package/templates/skills/SKILL.md +92 -0
  92. package/templates/skills/domains/ai/SKILL.md +34 -0
  93. package/templates/skills/domains/ai/agent-dev.md +242 -0
  94. package/templates/skills/domains/ai/llm-security.md +288 -0
  95. package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
  96. package/templates/skills/domains/ai/rag-system.md +542 -0
  97. package/templates/skills/domains/architecture/SKILL.md +42 -0
  98. package/templates/skills/domains/architecture/api-design.md +225 -0
  99. package/templates/skills/domains/architecture/caching.md +299 -0
  100. package/templates/skills/domains/architecture/cloud-native.md +285 -0
  101. package/templates/skills/domains/architecture/message-queue.md +329 -0
  102. package/templates/skills/domains/architecture/security-arch.md +297 -0
  103. package/templates/skills/domains/data-engineering/SKILL.md +207 -0
  104. package/templates/skills/domains/development/SKILL.md +46 -0
  105. package/templates/skills/domains/development/cpp.md +369 -0
  106. package/templates/skills/domains/development/go.md +323 -0
  107. package/templates/skills/domains/development/java.md +277 -0
  108. package/templates/skills/domains/development/python.md +487 -0
  109. package/templates/skills/domains/development/rust.md +313 -0
  110. package/templates/skills/domains/development/shell.md +313 -0
  111. package/templates/skills/domains/development/typescript.md +277 -0
  112. package/templates/skills/domains/devops/SKILL.md +39 -0
  113. package/templates/skills/domains/devops/cost-optimization.md +272 -0
  114. package/templates/skills/domains/devops/database.md +217 -0
  115. package/templates/skills/domains/devops/devsecops.md +198 -0
  116. package/templates/skills/domains/devops/git-workflow.md +181 -0
  117. package/templates/skills/domains/devops/observability.md +280 -0
  118. package/templates/skills/domains/devops/performance.md +336 -0
  119. package/templates/skills/domains/devops/testing.md +283 -0
  120. package/templates/skills/domains/infrastructure/SKILL.md +200 -0
  121. package/templates/skills/domains/mobile/SKILL.md +224 -0
  122. package/templates/skills/domains/orchestration/SKILL.md +29 -0
  123. package/templates/skills/domains/orchestration/multi-agent.md +263 -0
  124. package/templates/skills/domains/ros2-control/SKILL.md +206 -0
  125. package/templates/skills/domains/ros2-hardware/SKILL.md +277 -0
  126. package/templates/skills/domains/ros2-manipulation/SKILL.md +237 -0
  127. package/templates/skills/domains/ros2-navigation/SKILL.md +196 -0
  128. package/templates/skills/domains/ros2-perception/SKILL.md +166 -0
  129. package/templates/skills/domains/ros2-upper-app/SKILL.md +50 -0
  130. package/templates/skills/domains/ros2-upper-app/launch-files.md +224 -0
  131. package/templates/skills/domains/ros2-upper-app/parameters.md +192 -0
  132. package/templates/skills/domains/ros2-upper-app/python-nodes.md +249 -0
  133. package/templates/skills/domains/ros2-upper-app/rviz-config.md +158 -0
  134. package/templates/skills/domains/ros2-upper-app/simulation.md +225 -0
  135. package/templates/skills/domains/security/SKILL.md +72 -0
  136. package/templates/skills/domains/security/blue-team.md +436 -0
  137. package/templates/skills/domains/security/code-audit.md +265 -0
  138. package/templates/skills/domains/security/pentest.md +226 -0
  139. package/templates/skills/domains/security/red-team.md +374 -0
  140. package/templates/skills/domains/security/threat-intel.md +372 -0
  141. package/templates/skills/domains/security/vuln-research.md +369 -0
  142. package/templates/skills/orchestration/multi-agent/SKILL.md +533 -0
  143. package/templates/skills/run_skill.js +129 -0
  144. package/templates/skills/scrapling/SKILL.md +98 -0
  145. package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
  146. package/templates/skills/scrapling/references/cookie-vault.md +56 -0
  147. package/templates/skills/scrapling/references/maintenance.md +79 -0
  148. package/templates/skills/scrapling/references/site-patterns.md +86 -0
  149. package/templates/skills/scrapling/references/troubleshooting.md +95 -0
  150. package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
  151. package/templates/skills/scrapling/templates/parse_only.py +15 -0
  152. package/templates/skills/scrapling/templates/session_login.py +19 -0
  153. package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
  154. package/templates/skills/tools/gen-docs/SKILL.md +116 -0
  155. package/templates/skills/tools/gen-docs/scripts/doc_generator.js +435 -0
  156. package/templates/skills/tools/lib/shared.js +98 -0
  157. package/templates/skills/tools/override-refusal/SKILL.md +53 -0
  158. package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
  159. package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
  160. package/templates/skills/tools/verify-change/SKILL.md +140 -0
  161. package/templates/skills/tools/verify-change/scripts/change_analyzer.js +289 -0
  162. package/templates/skills/tools/verify-module/SKILL.md +127 -0
  163. package/templates/skills/tools/verify-module/scripts/module_scanner.js +171 -0
  164. package/templates/skills/tools/verify-quality/SKILL.md +160 -0
  165. package/templates/skills/tools/verify-quality/scripts/quality_checker.js +337 -0
  166. package/templates/skills/tools/verify-security/SKILL.md +143 -0
  167. package/templates/skills/tools/verify-security/scripts/security_scanner.js +283 -0
  168. package/templates/spec/guides/index.md +30 -0
  169. package/templates/spec/low-control/index.md +31 -0
  170. package/templates/spec/upper-app/index.md +31 -0
  171. package/bin/codeagent-wrapper-darwin-amd64 +0 -0
  172. package/bin/codeagent-wrapper-darwin-arm64 +0 -0
  173. package/bin/codeagent-wrapper-linux-amd64 +0 -0
  174. package/bin/codeagent-wrapper-linux-arm64 +0 -0
  175. package/bin/codeagent-wrapper-windows-amd64.exe +0 -0
  176. package/bin/codeagent-wrapper-windows-arm64.exe +0 -0
  177. package/dist/shared/ccg-ros2-workflow.DnOr3oPi.mjs +0 -2480
  178. package/templates/commands/backend.md +0 -162
  179. package/templates/commands/enhance.md +0 -36
  180. package/templates/commands/frontend.md +0 -162
  181. package/templates/commands/workflow.md +0 -202
  182. /package/templates/{commands → commands-legacy}/execute.md +0 -0
  183. /package/templates/{commands → commands-legacy}/review.md +0 -0
  184. /package/templates/{commands → commands-legacy}/team-exec.md +0 -0
  185. /package/templates/{commands → commands-legacy}/team-research.md +0 -0
  186. /package/templates/{commands → commands-legacy}/team-review.md +0 -0
@@ -0,0 +1,91 @@
1
+ # CCG Domain Knowledge — Auto-routing Rules
2
+
3
+ When the user's request matches trigger keywords below, automatically READ the corresponding skill file to gain domain expertise before responding. These knowledge files are installed at `~/.claude/skills/ccg/domains/`.
4
+
5
+ **IMPORTANT**: Read the skill file FIRST, then respond. Do NOT fabricate domain knowledge from training data when a skill file exists.
6
+
7
+ ## Security Domain (`domains/security/`) — NOT installed by default
8
+
9
+ > Security domain files contain red team/pentest reference content that may trigger antivirus false positives.
10
+ > They are NOT installed by default. To enable, manually copy from the npm package:
11
+ > `cp -r $(npm root -g)/ccg-ros2-workflow/templates/skills/domains/security/ ~/.claude/skills/ccg/domains/security/`
12
+
13
+ | Trigger Keywords | Skill File | Description |
14
+ |------------------|-----------|-------------|
15
+ | pentest, red team, exploit, C2, lateral movement, privilege escalation, evasion, persistence | `~/.claude/skills/ccg/domains/security/red-team.md` | Red team attack techniques |
16
+ | blue team, alert, IOC, incident response, forensics, SIEM, EDR, containment | `~/.claude/skills/ccg/domains/security/blue-team.md` | Blue team defense & incident response |
17
+ | web pentest, API security, OWASP, SQLi, XSS, SSRF, RCE, injection | `~/.claude/skills/ccg/domains/security/pentest.md` | Web & API penetration testing |
18
+ | code audit, dangerous function, taint analysis, sink, source | `~/.claude/skills/ccg/domains/security/code-audit.md` | Source code security audit |
19
+ | binary, reversing, PWN, fuzzing, stack overflow, heap overflow, ROP | `~/.claude/skills/ccg/domains/security/vuln-research.md` | Vulnerability research & exploitation |
20
+ | OSINT, threat intelligence, threat modeling, ATT&CK, threat hunting | `~/.claude/skills/ccg/domains/security/threat-intel.md` | Threat intelligence & OSINT |
21
+
22
+ ## ROS2 Domain (`domains/ros2-*/`) — Robotics Specialization
23
+
24
+ > CCG-ROS2 specialized routing for ROS2 Humble robotics development.
25
+ > Routes upper-layer tasks (Launch/Python/RViz) to Antigravity, low-level tasks (C++/drivers) to Codex.
26
+
27
+ | Trigger Keywords | Skill File | Authority Model |
28
+ |------------------|-----------|-----------------|
29
+ | LiDAR, RPLidar, Velodyne, Ouster, Livox, point cloud, PointCloud2, PCL, voxel, RANSAC, camera calibration, RealSense, ZED, depth image, sensor fusion, TF2 sync | `~/.claude/skills/ccg/domains/ros2-perception/SKILL.md` | Codex (low-level driver) + Antigravity (config) |
30
+ | PID controller, MPC, LQR, trajectory tracking, Pure Pursuit, Stanley, ros2_control, controller_manager, hardware_interface, motor driver, encoder, CAN motor, Modbus motor | `~/.claude/skills/ccg/domains/ros2-control/SKILL.md` | Codex (real-time control) |
31
+ | Nav2, navigation_stack, SLAM, slam_toolbox, Cartographer, RTAB-Map, AMCL, costmap, planner, NavfnPlanner, SmacPlanner, DWB, RPP, MPPI, behavior tree | `~/.claude/skills/ccg/domains/ros2-navigation/SKILL.md` | Antigravity (config) + Codex (custom planner) |
32
+ | MoveIt, MoveIt2, move_group, manipulator, arm, grasp, pick, place, IK, FK, kinematics, URDF, SRDF, xacro, OMPL, CHOMP, STOMP | `~/.claude/skills/ccg/domains/ros2-manipulation/SKILL.md` | Codex (kinematics) + Antigravity (config) |
33
+ | serial, ttyUSB, ttyACM, RS232, RS485, CAN, SocketCAN, can0, candump, I2C, SPI, GPIO, udev rules, device permission, dialout group, modbus | `~/.claude/skills/ccg/domains/ros2-hardware/SKILL.md` | Codex (driver) |
34
+ | launch file, launch.py, IncludeLaunchDescription, launch_arguments, FindPackageShare, PathJoinSubstitution, PushRosNamespace, GroupAction | `~/.claude/skills/ccg/domains/ros2-upper-app/launch-files.md` | Antigravity (orchestration) |
35
+ | params.yaml, ros__parameters, declare_parameter, parameter override, ParameterDescriptor, on_set_parameters_callback | `~/.claude/skills/ccg/domains/ros2-upper-app/parameters.md` | Antigravity (config) |
36
+ | rviz, rviz2, .rviz config, displays, TF tree, Fixed Frame, RobotModel display, costmap visualization | `~/.claude/skills/ccg/domains/ros2-upper-app/rviz-config.md` | Antigravity (config) |
37
+ | rclpy, Python ROS2 node, MultiThreadedExecutor, callback group, ReentrantCallbackGroup, ActionClient, Lifecycle Python | `~/.claude/skills/ccg/domains/ros2-upper-app/python-nodes.md` | Antigravity (upper-layer) |
38
+ | Gazebo, gz sim, Ignition, ros_gz_bridge, sdf world, robot_state_publisher, gz_ros2_control, simulation time, use_sim_time | `~/.claude/skills/ccg/domains/ros2-upper-app/simulation.md` | Antigravity (simulation config) |
39
+
40
+ ## Architecture Domain (`domains/architecture/`)
41
+
42
+ | Trigger Keywords | Skill File |
43
+ |------------------|-----------|
44
+ | API design, REST, GraphQL, gRPC, endpoint, versioning | `~/.claude/skills/ccg/domains/architecture/api-design.md` |
45
+ | caching, Redis, Memcached, cache invalidation, CDN | `~/.claude/skills/ccg/domains/architecture/caching.md` |
46
+ | cloud native, Kubernetes, Docker, microservice, service mesh | `~/.claude/skills/ccg/domains/architecture/cloud-native.md` |
47
+ | message queue, Kafka, RabbitMQ, event driven, pub/sub | `~/.claude/skills/ccg/domains/architecture/message-queue.md` |
48
+ | security architecture, zero trust, defense in depth, IAM | `~/.claude/skills/ccg/domains/architecture/security-arch.md` |
49
+
50
+ ## AI / MLOps Domain (`domains/ai/`)
51
+
52
+ | Trigger Keywords | Skill File |
53
+ |------------------|-----------|
54
+ | RAG, retrieval augmented, vector database, embedding, chunking | `~/.claude/skills/ccg/domains/ai/rag-system.md` |
55
+ | AI agent, tool use, function calling, agent framework, orchestration | `~/.claude/skills/ccg/domains/ai/agent-dev.md` |
56
+ | LLM security, prompt injection, jailbreak, guardrail | `~/.claude/skills/ccg/domains/ai/llm-security.md` |
57
+ | prompt engineering, model evaluation, benchmark, fine-tuning | `~/.claude/skills/ccg/domains/ai/prompt-and-eval.md` |
58
+
59
+ ## DevOps Domain (`domains/devops/`)
60
+
61
+ | Trigger Keywords | Skill File |
62
+ |------------------|-----------|
63
+ | Git workflow, branching strategy, trunk-based, GitFlow | `~/.claude/skills/ccg/domains/devops/git-workflow.md` |
64
+ | testing strategy, unit test, integration test, e2e, test pyramid | `~/.claude/skills/ccg/domains/devops/testing.md` |
65
+ | database, migration, schema design, indexing, query optimization | `~/.claude/skills/ccg/domains/devops/database.md` |
66
+ | performance, profiling, load test, latency, throughput | `~/.claude/skills/ccg/domains/devops/performance.md` |
67
+ | observability, logging, tracing, metrics, Prometheus, Grafana | `~/.claude/skills/ccg/domains/devops/observability.md` |
68
+ | DevSecOps, CI security, SAST, DAST, supply chain | `~/.claude/skills/ccg/domains/devops/devsecops.md` |
69
+ | cost optimization, cloud cost, FinOps, resource right-sizing | `~/.claude/skills/ccg/domains/devops/cost-optimization.md` |
70
+
71
+ ## Development Domain (`domains/development/`)
72
+
73
+ When the user is working with a specific programming language, read the corresponding skill file for language-specific best practices:
74
+
75
+ | Language | Skill File |
76
+ |----------|-----------|
77
+ | Python | `~/.claude/skills/ccg/domains/development/python.md` |
78
+ | Go | `~/.claude/skills/ccg/domains/development/go.md` |
79
+ | Rust | `~/.claude/skills/ccg/domains/development/rust.md` |
80
+ | TypeScript / JavaScript | `~/.claude/skills/ccg/domains/development/typescript.md` |
81
+ | Java / Kotlin | `~/.claude/skills/ccg/domains/development/java.md` |
82
+ | C / C++ | `~/.claude/skills/ccg/domains/development/cpp.md` |
83
+ | Shell / Bash | `~/.claude/skills/ccg/domains/development/shell.md` |
84
+
85
+ ## Routing Rules
86
+
87
+ 1. **Keyword match is fuzzy** — match on intent, not exact string. "How to do SQL injection testing" triggers `pentest.md`.
88
+ 2. **Multiple matches** — if a request spans two domains, read both skill files.
89
+ 3. **Language detection** — automatically detect the programming language from file extensions or context, then read the corresponding development skill.
90
+ 4. **Read once per conversation** — no need to re-read the same skill file within the same conversation.
91
+ 5. **Skill files are authoritative** — when a skill file contradicts training data, the skill file wins.
@@ -0,0 +1,65 @@
1
+ # CCG Quality Gates — Auto-trigger Rules
2
+
3
+ When working in a project, automatically invoke the corresponding quality gate skills based on the scenario below. These skills are installed at `~/.claude/skills/ccg/` and can be called directly.
4
+
5
+ **IMPORTANT**: Skill names do NOT have a `ccg:` prefix. Use exactly: `verify-security`, `verify-quality`, `verify-change`, `verify-module`, `gen-docs`. Do NOT call `ccg:verify-security` — that will fail with "Unknown skill".
6
+
7
+ ## Trigger Rules
8
+
9
+ ### New Module Created
10
+
11
+ When a new module/package/directory is created with source code:
12
+
13
+ ```
14
+ /gen-docs <module-path> → Generate README.md + DESIGN.md skeleton
15
+ ↓ (after development)
16
+ /verify-module <module-path> → Check structure completeness
17
+
18
+ /verify-security <module-path> → Scan for security vulnerabilities
19
+ ```
20
+
21
+ ### Code Changes > 30 Lines
22
+
23
+ When a single task produces code changes exceeding 30 lines:
24
+
25
+ ```
26
+ /verify-change → Analyze change impact, check doc sync
27
+
28
+ /verify-quality <changed-path> → Check complexity, code smells, naming
29
+ ```
30
+
31
+ ### Security-Related Changes
32
+
33
+ When changes involve authentication, authorization, encryption, input validation, or secrets management:
34
+
35
+ ```
36
+ /verify-security <changed-path> → Scan for vulnerabilities
37
+ ```
38
+
39
+ ### Refactoring
40
+
41
+ When refactoring existing code:
42
+
43
+ ```
44
+ /verify-change → Ensure docs reflect the refactoring
45
+
46
+ /verify-quality <refactored-path> → Verify quality improved
47
+
48
+ /verify-security <refactored-path> → No new vulnerabilities introduced
49
+ ```
50
+
51
+ ## Execution Rules
52
+
53
+ 1. **Non-blocking** — Quality gates produce reports but do NOT block delivery unless Critical issues are found
54
+ 2. **Chainable** — Run gates in the order specified above; skip if previous gate fails
55
+ 3. **Silent on pass** — Only report findings; do not output "all clear" messages for every gate
56
+ 4. **Critical = must fix** — Only `Critical` / `High` severity findings require action before delivery
57
+ 5. **Idempotent** — Safe to re-run; same input produces same output
58
+
59
+ ## Multi-Agent Coordination
60
+
61
+ When a task involves 3+ independent files/modules or 2+ parallel workflows, refer to the multi-agent orchestration skill at `~/.claude/skills/ccg/orchestration/multi-agent/SKILL.md` for:
62
+
63
+ - Agent role assignment (Lead / Scout / Worker / Soldier / Drone)
64
+ - File ownership locking (one writer per file at any time)
65
+ - Task decomposition strategy (by file, by module, or by pipeline)
@@ -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-ros2-workflow` initialization.
92
+ To update: run `npx ccg-ros2-workflow update` or `npx ccg-ros2-workflow` again.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: ai
3
+ description: AI/LLM 能力索引。Agent 开发、LLM 安全、RAG 系统。当用户提到 AI、LLM、Agent、RAG、Prompt 时路由到此。
4
+ license: MIT
5
+ user-invocable: false
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # 丹鼎秘典 · AI/LLM 能力中枢
10
+
11
+ ## 能力矩阵
12
+
13
+ | Skill | 定位 | 核心能力 |
14
+ |-------|------|----------|
15
+ | [agent-dev](agent-dev.md) | Agent 开发 | 多 Agent 编排、工具调用、RAG |
16
+ | [llm-security](llm-security.md) | LLM 安全 | Prompt 注入、越狱防护、输出安全 |
17
+ | [rag-system](rag-system.md) | RAG 系统 | 向量数据库、检索策略、重排算法 |
18
+ | [prompt-and-eval](prompt-and-eval.md) | Prompt 工程与模型评估 | Few-shot、CoT、ReAct、RAGAS、LLM-as-Judge |
19
+
20
+ ## AI 工程原则
21
+
22
+ ```yaml
23
+ 设计原则:
24
+ - 人机协作,AI 增强而非替代
25
+ - 可解释性优先
26
+ - 安全边界明确
27
+ - 渐进式自主
28
+
29
+ 开发原则:
30
+ - Prompt 即代码,需版本控制
31
+ - 输入输出都需验证
32
+ - 成本与效果平衡
33
+ - 持续评估与迭代
34
+ ```
@@ -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
+