ccg-workflow 1.8.2 → 2.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 (111) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/dist/index.d.mts +1 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.mjs +1 -1
  5. package/dist/shared/{ccg-workflow.B1RHp04H.mjs → ccg-workflow.iK6lgCG3.mjs} +204 -6
  6. package/package.json +1 -1
  7. package/templates/commands/agents/team-architect.md +97 -0
  8. package/templates/commands/agents/team-qa.md +121 -0
  9. package/templates/commands/agents/team-reviewer.md +112 -0
  10. package/templates/output-styles/abyss-command.md +56 -0
  11. package/templates/output-styles/abyss-concise.md +89 -0
  12. package/templates/output-styles/abyss-ritual.md +70 -0
  13. package/templates/rules/ccg-skill-routing.md +83 -0
  14. package/templates/skills/domains/ai/SKILL.md +34 -0
  15. package/templates/skills/domains/ai/agent-dev.md +242 -0
  16. package/templates/skills/domains/ai/llm-security.md +288 -0
  17. package/templates/skills/domains/ai/prompt-and-eval.md +279 -0
  18. package/templates/skills/domains/ai/rag-system.md +542 -0
  19. package/templates/skills/domains/architecture/SKILL.md +42 -0
  20. package/templates/skills/domains/architecture/api-design.md +225 -0
  21. package/templates/skills/domains/architecture/caching.md +299 -0
  22. package/templates/skills/domains/architecture/cloud-native.md +285 -0
  23. package/templates/skills/domains/architecture/message-queue.md +329 -0
  24. package/templates/skills/domains/architecture/security-arch.md +297 -0
  25. package/templates/skills/domains/data-engineering/SKILL.md +207 -0
  26. package/templates/skills/domains/development/SKILL.md +46 -0
  27. package/templates/skills/domains/development/cpp.md +246 -0
  28. package/templates/skills/domains/development/go.md +323 -0
  29. package/templates/skills/domains/development/java.md +277 -0
  30. package/templates/skills/domains/development/python.md +288 -0
  31. package/templates/skills/domains/development/rust.md +313 -0
  32. package/templates/skills/domains/development/shell.md +313 -0
  33. package/templates/skills/domains/development/typescript.md +277 -0
  34. package/templates/skills/domains/devops/SKILL.md +39 -0
  35. package/templates/skills/domains/devops/cost-optimization.md +272 -0
  36. package/templates/skills/domains/devops/database.md +217 -0
  37. package/templates/skills/domains/devops/devsecops.md +198 -0
  38. package/templates/skills/domains/devops/git-workflow.md +181 -0
  39. package/templates/skills/domains/devops/observability.md +280 -0
  40. package/templates/skills/domains/devops/performance.md +336 -0
  41. package/templates/skills/domains/devops/testing.md +283 -0
  42. package/templates/skills/domains/frontend-design/SKILL.md +242 -0
  43. package/templates/skills/domains/frontend-design/agents/openai.yaml +4 -0
  44. package/templates/skills/domains/frontend-design/claymorphism/SKILL.md +119 -0
  45. package/templates/skills/domains/frontend-design/claymorphism/references/tokens.css +52 -0
  46. package/templates/skills/domains/frontend-design/component-patterns.md +202 -0
  47. package/templates/skills/domains/frontend-design/engineering.md +287 -0
  48. package/templates/skills/domains/frontend-design/glassmorphism/SKILL.md +140 -0
  49. package/templates/skills/domains/frontend-design/glassmorphism/references/tokens.css +32 -0
  50. package/templates/skills/domains/frontend-design/liquid-glass/SKILL.md +137 -0
  51. package/templates/skills/domains/frontend-design/liquid-glass/references/tokens.css +81 -0
  52. package/templates/skills/domains/frontend-design/neubrutalism/SKILL.md +143 -0
  53. package/templates/skills/domains/frontend-design/neubrutalism/references/tokens.css +44 -0
  54. package/templates/skills/domains/frontend-design/reference/color-and-contrast.md +132 -0
  55. package/templates/skills/domains/frontend-design/reference/interaction-design.md +195 -0
  56. package/templates/skills/domains/frontend-design/reference/motion-design.md +99 -0
  57. package/templates/skills/domains/frontend-design/reference/responsive-design.md +114 -0
  58. package/templates/skills/domains/frontend-design/reference/spatial-design.md +100 -0
  59. package/templates/skills/domains/frontend-design/reference/typography.md +133 -0
  60. package/templates/skills/domains/frontend-design/reference/ux-writing.md +107 -0
  61. package/templates/skills/domains/frontend-design/state-management.md +680 -0
  62. package/templates/skills/domains/frontend-design/ui-aesthetics.md +110 -0
  63. package/templates/skills/domains/frontend-design/ux-principles.md +156 -0
  64. package/templates/skills/domains/infrastructure/SKILL.md +200 -0
  65. package/templates/skills/domains/mobile/SKILL.md +224 -0
  66. package/templates/skills/domains/orchestration/SKILL.md +29 -0
  67. package/templates/skills/domains/orchestration/multi-agent.md +263 -0
  68. package/templates/skills/domains/security/SKILL.md +72 -0
  69. package/templates/skills/domains/security/blue-team.md +436 -0
  70. package/templates/skills/domains/security/code-audit.md +265 -0
  71. package/templates/skills/domains/security/pentest.md +226 -0
  72. package/templates/skills/domains/security/red-team.md +374 -0
  73. package/templates/skills/domains/security/threat-intel.md +372 -0
  74. package/templates/skills/domains/security/vuln-research.md +369 -0
  75. package/templates/skills/impeccable/adapt/SKILL.md +199 -0
  76. package/templates/skills/impeccable/animate/SKILL.md +174 -0
  77. package/templates/skills/impeccable/arrange/SKILL.md +124 -0
  78. package/templates/skills/impeccable/audit/SKILL.md +147 -0
  79. package/templates/skills/impeccable/bolder/SKILL.md +116 -0
  80. package/templates/skills/impeccable/clarify/SKILL.md +183 -0
  81. package/templates/skills/impeccable/colorize/SKILL.md +142 -0
  82. package/templates/skills/impeccable/critique/SKILL.md +201 -0
  83. package/templates/skills/impeccable/critique/reference/cognitive-load.md +106 -0
  84. package/templates/skills/impeccable/critique/reference/heuristics-scoring.md +234 -0
  85. package/templates/skills/impeccable/critique/reference/personas.md +178 -0
  86. package/templates/skills/impeccable/delight/SKILL.md +303 -0
  87. package/templates/skills/impeccable/distill/SKILL.md +121 -0
  88. package/templates/skills/impeccable/extract/SKILL.md +92 -0
  89. package/templates/skills/impeccable/harden/SKILL.md +355 -0
  90. package/templates/skills/impeccable/normalize/SKILL.md +70 -0
  91. package/templates/skills/impeccable/onboard/SKILL.md +246 -0
  92. package/templates/skills/impeccable/optimize/SKILL.md +266 -0
  93. package/templates/skills/impeccable/overdrive/SKILL.md +141 -0
  94. package/templates/skills/impeccable/polish/SKILL.md +203 -0
  95. package/templates/skills/impeccable/quieter/SKILL.md +102 -0
  96. package/templates/skills/impeccable/teach-impeccable/SKILL.md +71 -0
  97. package/templates/skills/impeccable/typeset/SKILL.md +115 -0
  98. package/templates/skills/orchestration/multi-agent/SKILL.md +40 -0
  99. package/templates/skills/scrapling/SKILL.md +98 -0
  100. package/templates/skills/scrapling/references/api-quick-ref.md +127 -0
  101. package/templates/skills/scrapling/references/cookie-vault.md +56 -0
  102. package/templates/skills/scrapling/references/maintenance.md +79 -0
  103. package/templates/skills/scrapling/references/site-patterns.md +86 -0
  104. package/templates/skills/scrapling/references/troubleshooting.md +95 -0
  105. package/templates/skills/scrapling/templates/basic_fetch.py +19 -0
  106. package/templates/skills/scrapling/templates/parse_only.py +15 -0
  107. package/templates/skills/scrapling/templates/session_login.py +19 -0
  108. package/templates/skills/scrapling/templates/stealth_cloudflare.py +28 -0
  109. package/templates/skills/tools/override-refusal/SKILL.md +53 -0
  110. package/templates/skills/tools/override-refusal/agents/openai.yaml +4 -0
  111. package/templates/skills/tools/override-refusal/scripts/refusal_rewriter.js +226 -0
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: quieter
3
+ description: "Tones down visually aggressive or overstimulating designs, reducing intensity while preserving quality. Use when the user mentions too bold, too loud, overwhelming, aggressive, garish, or wants a calmer, more refined aesthetic."
4
+ argument-hint: "[target]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ Reduce visual intensity in designs that are too bold, aggressive, or overstimulating, creating a more refined and approachable aesthetic without losing effectiveness.
9
+
10
+ ## MANDATORY PREPARATION
11
+
12
+ Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
13
+
14
+ ---
15
+
16
+ ## Assess Current State
17
+
18
+ Analyze what makes the design feel too intense:
19
+
20
+ 1. **Identify intensity sources**:
21
+ - **Color saturation**: Overly bright or saturated colors
22
+ - **Contrast extremes**: Too much high-contrast juxtaposition
23
+ - **Visual weight**: Too many bold, heavy elements competing
24
+ - **Animation excess**: Too much motion or overly dramatic effects
25
+ - **Complexity**: Too many visual elements, patterns, or decorations
26
+ - **Scale**: Everything is large and loud with no hierarchy
27
+
28
+ 2. **Understand the context**:
29
+ - What's the purpose? (Marketing vs tool vs reading experience)
30
+ - Who's the audience? (Some contexts need energy)
31
+ - What's working? (Don't throw away good ideas)
32
+ - What's the core message? (Preserve what matters)
33
+
34
+ If any of these are unclear from the codebase, Ask the user using AskUserQuestion.
35
+
36
+ **CRITICAL**: "Quieter" doesn't mean boring or generic. It means refined, sophisticated, and easier on the eyes. Think luxury, not laziness.
37
+
38
+ ## Plan Refinement
39
+
40
+ Create a strategy to reduce intensity while maintaining impact:
41
+
42
+ - **Color approach**: Desaturate or shift to more sophisticated tones?
43
+ - **Hierarchy approach**: Which elements should stay bold (very few), which should recede?
44
+ - **Simplification approach**: What can be removed entirely?
45
+ - **Sophistication approach**: How can we signal quality through restraint?
46
+
47
+ **IMPORTANT**: Great quiet design is harder than great bold design. Subtlety requires precision.
48
+
49
+ ## Refine the Design
50
+
51
+ Systematically reduce intensity across these dimensions:
52
+
53
+ ### Color Refinement
54
+ - **Reduce saturation**: Shift from fully saturated to 70-85% saturation
55
+ - **Soften palette**: Replace bright colors with muted, sophisticated tones
56
+ - **Reduce color variety**: Use fewer colors more thoughtfully
57
+ - **Neutral dominance**: Let neutrals do more work, use color as accent (10% rule)
58
+ - **Gentler contrasts**: High contrast only where it matters most
59
+ - **Tinted grays**: Use warm or cool tinted grays instead of pure gray—adds sophistication without loudness
60
+ - **Never gray on color**: If you have gray text on a colored background, use a darker shade of that color or transparency instead
61
+
62
+ ### Visual Weight Reduction
63
+ - **Typography**: Reduce font weights (900 → 600, 700 → 500), decrease sizes where appropriate
64
+ - **Hierarchy through subtlety**: Use weight, size, and space instead of color and boldness
65
+ - **White space**: Increase breathing room, reduce density
66
+ - **Borders & lines**: Reduce thickness, decrease opacity, or remove entirely
67
+
68
+ ### Simplification
69
+ - **Remove decorative elements**: Gradients, shadows, patterns, textures that don't serve purpose
70
+ - **Simplify shapes**: Reduce border radius extremes, simplify custom shapes
71
+ - **Reduce layering**: Flatten visual hierarchy where possible
72
+ - **Clean up effects**: Reduce or remove blur effects, glows, multiple shadows
73
+
74
+ ### Motion Reduction
75
+ - **Reduce animation intensity**: Shorter distances (10-20px instead of 40px), gentler easing
76
+ - **Remove decorative animations**: Keep functional motion, remove flourishes
77
+ - **Subtle micro-interactions**: Replace dramatic effects with gentle feedback
78
+ - **Refined easing**: Use ease-out-quart for smooth, understated motion—never bounce or elastic
79
+ - **Remove animations entirely** if they're not serving a clear purpose
80
+
81
+ ### Composition Refinement
82
+ - **Reduce scale jumps**: Smaller contrast between sizes creates calmer feeling
83
+ - **Align to grid**: Bring rogue elements back into systematic alignment
84
+ - **Even out spacing**: Replace extreme spacing variations with consistent rhythm
85
+
86
+ **NEVER**:
87
+ - Make everything the same size/weight (hierarchy still matters)
88
+ - Remove all color (quiet ≠ grayscale)
89
+ - Eliminate all personality (maintain character through refinement)
90
+ - Sacrifice usability for aesthetics (functional elements still need clear affordances)
91
+ - Make everything small and light (some anchors needed)
92
+
93
+ ## Verify Quality
94
+
95
+ Ensure refinement maintains quality:
96
+
97
+ - **Still functional**: Can users still accomplish tasks easily?
98
+ - **Still distinctive**: Does it have character, or is it generic now?
99
+ - **Better reading**: Is text easier to read for extended periods?
100
+ - **Sophistication**: Does it feel more refined and premium?
101
+
102
+ Remember: Quiet design is confident design. It doesn't need to shout. Less is more, but less is also harder. Refine with precision and maintain intentionality.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: teach-impeccable
3
+ description: One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.
4
+ user-invocable: true
5
+ ---
6
+
7
+ Gather design context for this project, then persist it for all future sessions.
8
+
9
+ ## Step 1: Explore the Codebase
10
+
11
+ Before asking questions, thoroughly scan the project to discover what you can:
12
+
13
+ - **README and docs**: Project purpose, target audience, any stated goals
14
+ - **Package.json / config files**: Tech stack, dependencies, existing design libraries
15
+ - **Existing components**: Current design patterns, spacing, typography in use
16
+ - **Brand assets**: Logos, favicons, color values already defined
17
+ - **Design tokens / CSS variables**: Existing color palettes, font stacks, spacing scales
18
+ - **Any style guides or brand documentation**
19
+
20
+ Note what you've learned and what remains unclear.
21
+
22
+ ## Step 2: Ask UX-Focused Questions
23
+
24
+ Ask the user using AskUserQuestion. Focus only on what you couldn't infer from the codebase:
25
+
26
+ ### Users & Purpose
27
+ - Who uses this? What's their context when using it?
28
+ - What job are they trying to get done?
29
+ - What emotions should the interface evoke? (confidence, delight, calm, urgency, etc.)
30
+
31
+ ### Brand & Personality
32
+ - How would you describe the brand personality in 3 words?
33
+ - Any reference sites or apps that capture the right feel? What specifically about them?
34
+ - What should this explicitly NOT look like? Any anti-references?
35
+
36
+ ### Aesthetic Preferences
37
+ - Any strong preferences for visual direction? (minimal, bold, elegant, playful, technical, organic, etc.)
38
+ - Light mode, dark mode, or both?
39
+ - Any colors that must be used or avoided?
40
+
41
+ ### Accessibility & Inclusion
42
+ - Specific accessibility requirements? (WCAG level, known user needs)
43
+ - Considerations for reduced motion, color blindness, or other accommodations?
44
+
45
+ Skip questions where the answer is already clear from the codebase exploration.
46
+
47
+ ## Step 3: Write Design Context
48
+
49
+ Synthesize your findings and the user's answers into a `## Design Context` section:
50
+
51
+ ```markdown
52
+ ## Design Context
53
+
54
+ ### Users
55
+ [Who they are, their context, the job to be done]
56
+
57
+ ### Brand Personality
58
+ [Voice, tone, 3-word personality, emotional goals]
59
+
60
+ ### Aesthetic Direction
61
+ [Visual tone, references, anti-references, theme]
62
+
63
+ ### Design Principles
64
+ [3-5 principles derived from the conversation that should guide all design decisions]
65
+ ```
66
+
67
+ Write this section to `.impeccable.md` in the project root. If the file already exists, update the Design Context section in place.
68
+
69
+ Then Ask the user using AskUserQuestion. whether they'd also like the Design Context appended to CLAUDE.md. If yes, append or update the section there as well.
70
+
71
+ Confirm completion and summarize the key design principles that will now guide all future work.
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: typeset
3
+ description: "Improves typography by fixing font choices, hierarchy, sizing, weight, and readability so text feels intentional. Use when the user mentions fonts, type, readability, text hierarchy, sizing looks off, or wants more polished, intentional typography."
4
+ argument-hint: "[target]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ Assess and improve typography that feels generic, inconsistent, or poorly structured — turning default-looking text into intentional, well-crafted type.
9
+
10
+ ## MANDATORY PREPARATION
11
+
12
+ Invoke /frontend-design — it contains design principles, anti-patterns, and the **Context Gathering Protocol**. Follow the protocol before proceeding — if no design context exists yet, you MUST run /teach-impeccable first.
13
+
14
+ ---
15
+
16
+ ## Assess Current Typography
17
+
18
+ Analyze what's weak or generic about the current type:
19
+
20
+ 1. **Font choices**:
21
+ - Are we using invisible defaults? (Inter, Roboto, Arial, Open Sans, system defaults)
22
+ - Does the font match the brand personality? (A playful brand shouldn't use a corporate typeface)
23
+ - Are there too many font families? (More than 2-3 is almost always a mess)
24
+
25
+ 2. **Hierarchy**:
26
+ - Can you tell headings from body from captions at a glance?
27
+ - Are font sizes too close together? (14px, 15px, 16px = muddy hierarchy)
28
+ - Are weight contrasts strong enough? (Medium vs Regular is barely visible)
29
+
30
+ 3. **Sizing & scale**:
31
+ - Is there a consistent type scale, or are sizes arbitrary?
32
+ - Does body text meet minimum readability? (16px+)
33
+ - Is the sizing strategy appropriate for the context? (Fixed `rem` scales for app UIs; fluid `clamp()` for marketing/content page headings)
34
+
35
+ 4. **Readability**:
36
+ - Are line lengths comfortable? (45-75 characters ideal)
37
+ - Is line-height appropriate for the font and context?
38
+ - Is there enough contrast between text and background?
39
+
40
+ 5. **Consistency**:
41
+ - Are the same elements styled the same way throughout?
42
+ - Are font weights used consistently? (Not bold in one section, semibold in another for the same role)
43
+ - Is letter-spacing intentional or default everywhere?
44
+
45
+ **CRITICAL**: The goal isn't to make text "fancier" — it's to make it clearer, more readable, and more intentional. Good typography is invisible; bad typography is distracting.
46
+
47
+ ## Plan Typography Improvements
48
+
49
+ Consult the [typography reference](reference/typography.md) from the frontend-design skill for detailed guidance on scales, pairing, and loading strategies.
50
+
51
+ Create a systematic plan:
52
+
53
+ - **Font selection**: Do fonts need replacing? What fits the brand/context?
54
+ - **Type scale**: Establish a modular scale (e.g., 1.25 ratio) with clear hierarchy
55
+ - **Weight strategy**: Which weights serve which roles? (Regular for body, Semibold for labels, Bold for headings — or whatever fits)
56
+ - **Spacing**: Line-heights, letter-spacing, and margins between typographic elements
57
+
58
+ ## Improve Typography Systematically
59
+
60
+ ### Font Selection
61
+
62
+ If fonts need replacing:
63
+ - Choose fonts that reflect the brand personality
64
+ - Pair with genuine contrast (serif + sans, geometric + humanist) — or use a single family in multiple weights
65
+ - Ensure web font loading doesn't cause layout shift (`font-display: swap`, metric-matched fallbacks)
66
+
67
+ ### Establish Hierarchy
68
+
69
+ Build a clear type scale:
70
+ - **5 sizes cover most needs**: caption, secondary, body, subheading, heading
71
+ - **Use a consistent ratio** between levels (1.25, 1.333, or 1.5)
72
+ - **Combine dimensions**: Size + weight + color + space for strong hierarchy — don't rely on size alone
73
+ - **App UIs**: Use a fixed `rem`-based type scale, optionally adjusted at 1-2 breakpoints. Fluid sizing undermines the spatial predictability that dense, container-based layouts need
74
+ - **Marketing / content pages**: Use fluid sizing via `clamp(min, preferred, max)` for headings and display text. Keep body text fixed
75
+
76
+ ### Fix Readability
77
+
78
+ - Set `max-width` on text containers using `ch` units (`max-width: 65ch`)
79
+ - Adjust line-height per context: tighter for headings (1.1-1.2), looser for body (1.5-1.7)
80
+ - Increase line-height slightly for light-on-dark text
81
+ - Ensure body text is at least 16px / 1rem
82
+
83
+ ### Refine Details
84
+
85
+ - Use `tabular-nums` for data tables and numbers that should align
86
+ - Apply proper `letter-spacing`: slightly open for small caps and uppercase, default or tight for large display text
87
+ - Use semantic token names (`--text-body`, `--text-heading`), not value names (`--font-16`)
88
+ - Set `font-kerning: normal` and consider OpenType features where appropriate
89
+
90
+ ### Weight Consistency
91
+
92
+ - Define clear roles for each weight and stick to them
93
+ - Don't use more than 3-4 weights (Regular, Medium, Semibold, Bold is plenty)
94
+ - Load only the weights you actually use (each weight adds to page load)
95
+
96
+ **NEVER**:
97
+ - Use more than 2-3 font families
98
+ - Pick sizes arbitrarily — commit to a scale
99
+ - Set body text below 16px
100
+ - Use decorative/display fonts for body text
101
+ - Disable browser zoom (`user-scalable=no`)
102
+ - Use `px` for font sizes — use `rem` to respect user settings
103
+ - Default to Inter/Roboto/Open Sans when personality matters
104
+ - Pair fonts that are similar but not identical (two geometric sans-serifs)
105
+
106
+ ## Verify Typography Improvements
107
+
108
+ - **Hierarchy**: Can you identify heading vs body vs caption instantly?
109
+ - **Readability**: Is body text comfortable to read in long passages?
110
+ - **Consistency**: Are same-role elements styled identically throughout?
111
+ - **Personality**: Does the typography reflect the brand?
112
+ - **Performance**: Are web fonts loading efficiently without layout shift?
113
+ - **Accessibility**: Does text meet WCAG contrast ratios? Is it zoomable to 200%?
114
+
115
+ Remember: Typography is the foundation of interface design — it carries the majority of information. Getting it right is the highest-leverage improvement you can make.
@@ -113,6 +113,46 @@ disable-model-invocation: false
113
113
 
114
114
  ---
115
115
 
116
+ ## 企业级角色扩展(`/ccg:team` 专用)
117
+
118
+ `/ccg:team` 命令在蚁群基础角色之上,增加 3 个大厂级专业角色,对应 Agent Teams 真实 teammates:
119
+
120
+ | 角色 | Agent 名 | 道语 | 职责 | 工具权限 | 模型 |
121
+ |------|----------|------|------|----------|------|
122
+ | 🏗 架构师 (Architect) | `team-architect` | 天罗军师 | 代码库扫描、架构蓝图、文件分配矩阵 | Read/Glob/Grep(只读) | Sonnet |
123
+ | 🧪 QA 工程师 (QA) | `team-qa` | 天罗验毒 | 写测试、跑测试、lint、typecheck | Read/Write/Edit/Bash/Glob/Grep | Sonnet |
124
+ | 🔬 审查员 (Reviewer) | `team-reviewer` | 天罗护法 | 综合 Codex/Gemini 审查、分级判决 | Read/Glob/Grep(只读) | Sonnet |
125
+
126
+ ### 8 阶段流水线
127
+
128
+ ```
129
+ Phase 0: PRE-FLIGHT → 环境检测 + 参数解析
130
+ Phase 1: REQUIREMENT → Lead 需求增强 → mini-PRD
131
+ Phase 2: ARCHITECTURE → Codex∥Gemini 外援 + Architect teammate 出蓝图
132
+ Phase 3: PLANNING → Lead 拆任务 → 零决策并行计划
133
+ Phase 4: DEVELOPMENT → Dev×N teammates 并行编码(文件隔离)
134
+ Phase 5: TESTING → QA teammate 写测试 + 跑全量验证
135
+ Phase 6: REVIEW → Codex∥Gemini 外援 + Reviewer teammate 综合审查
136
+ Phase 7: FIX → Dev teammate(s) 修复 Critical(最多 2 轮)
137
+ Phase 8: INTEGRATION → Lead 全量验证 + 报告 + 清理
138
+ ```
139
+
140
+ ### 角色生命周期
141
+
142
+ ```
143
+ TeamCreate ─── Phase 2: spawn Architect → shutdown
144
+ ├─ Phase 4: spawn Dev×N → shutdown
145
+ ├─ Phase 5: spawn QA → shutdown
146
+ ├─ Phase 6: spawn Reviewer → shutdown
147
+ ├─ Phase 7: spawn Fix-Dev(s) → shutdown
148
+ └─ Phase 8: TeamDelete
149
+ ```
150
+
151
+ **推荐入口**:`/ccg:team <需求描述>` — 一键跑完 8 阶段。
152
+ **分步入口**(兼容):`/ccg:team-research` → `/ccg:team-plan` → `/ccg:team-exec` → `/ccg:team-review`
153
+
154
+ ---
155
+
116
156
  ## 信息素系统(Stigmergy)
117
157
 
118
158
  蚁群通过信息素间接通信,而非直接对话。在 Claude Code 中,用 **TaskCreate metadata** 模拟信息素:
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: scrapling
3
+ description: "使用 scrapling 进行网页抓取和数据提取。自动选择 Fetcher,支持 Cloudflare/WAF 绕过、Session 登录、HTML 解析。当用户提到 scrape/crawl/fetch page/extract data/爬取/抓取/绕过Cloudflare/解析HTML/批量采集 时触发。"
4
+ user-invocable: true
5
+ allowed-tools: Read, Bash
6
+ argument-hint: "[URL or scraping task description]"
7
+ license: MIT
8
+ ---
9
+
10
+ # Scrapling 网页抓取 Skill
11
+
12
+ ## 步骤 0:检查版本
13
+
14
+ ```bash
15
+ pip show scrapling
16
+ ```
17
+
18
+ - 未安装 → 执行 `pip install "scrapling[fetchers]"` + `scrapling install`
19
+ - 有新版 → 执行 `pip install --upgrade "scrapling[fetchers]"` → 查 changelog 告知用户
20
+ - 已最新 → 继续
21
+
22
+ ## 步骤 1:选择 Fetcher
23
+
24
+ ```
25
+ 目标网站 →
26
+
27
+ ├─ 已有 HTML 字符串/文件,只需解析?
28
+ │ → Selector(纯解析,无网络请求)
29
+ │ → 模板: templates/parse_only.py
30
+
31
+ ├─ 静态页面,无 JS 渲染,无反爬?
32
+ │ → Fetcher(最快,基于 curl_cffi)
33
+ │ → 模板: templates/basic_fetch.py
34
+
35
+ ├─ 需要登录(HTTP 表单,非 JS 登录)?
36
+ │ → FetcherSession(保持会话 cookie)
37
+ │ → 模板: templates/session_login.py
38
+
39
+ ├─ 有 Cloudflare / WAF 保护?
40
+ │ → StealthyFetcher(Camoufox 浏览器,自动过 CF)
41
+ │ → 模板: templates/stealth_cloudflare.py
42
+
43
+ ├─ SPA 应用(React/Vue),需要 JS 渲染?
44
+ │ → DynamicFetcher(Playwright 浏览器)
45
+ │ → 基于模板即时生成
46
+
47
+ └─ 不确定?
48
+ → 先用 Fetcher 试,403/空内容 → 升级到 StealthyFetcher
49
+ ```
50
+
51
+ ## 步骤 2:执行工作流
52
+
53
+ ```
54
+ 1. 检查版本(步骤 0)
55
+ 2. 查阅 references/site-patterns.md — 匹配已有模式则直接复用
56
+ 3. 无匹配 → 用决策树选择 Fetcher
57
+ 4. 读取对应模板 → 替换参数 → 生成完整脚本
58
+ 5. 执行脚本 → 返回结果
59
+ 6. **沉淀经验(必做)**:
60
+ - 新站点 → 追加到 site-patterns.md
61
+ - 新 cookie / 用户提供了 cookie → 保存到 cookie-vault.md
62
+ - **完成抓取后必须检查**:是否有新的 cookie 或 site pattern 需要保存
63
+ ```
64
+
65
+ ## Cookie 格式速查
66
+
67
+ | Fetcher 类型 | Cookie 格式 | 示例 |
68
+ |-------------|-------------|------|
69
+ | Fetcher / FetcherSession | `dict` | `{'name': 'value', 'token': 'abc'}` |
70
+ | StealthyFetcher / DynamicFetcher | `list[dict]` | `[{'name': 'n', 'value': 'v', 'domain': '.site.com', 'path': '/'}]` |
71
+
72
+ **浏览器 Fetcher cookie 必填字段**: `name`, `value`, `domain`, `path`
73
+
74
+ ## 超时单位速查
75
+
76
+ | Fetcher 类型 | 超时单位 | 示例 |
77
+ |-------------|---------|------|
78
+ | Fetcher / FetcherSession | 秒 | `timeout=30` |
79
+ | StealthyFetcher / DynamicFetcher | 毫秒 | `timeout=60000` |
80
+
81
+ ## 模板索引
82
+
83
+ | 模板 | 文件 | 何时读取 |
84
+ |------|------|---------|
85
+ | 基础 HTTP 抓取 | `templates/basic_fetch.py` | 目标为静态页面,无反爬 |
86
+ | Cloudflare 绕过 | `templates/stealth_cloudflare.py` | 目标有 CF/WAF 保护 |
87
+ | Session 登录 | `templates/session_login.py` | 需 HTTP 表单登录后抓取 |
88
+ | 纯 HTML 解析 | `templates/parse_only.py` | 已有 HTML 字符串,只需提取数据 |
89
+
90
+ ## References 索引
91
+
92
+ | 文件 | 何时读取 |
93
+ |------|---------|
94
+ | `references/site-patterns.md` | **每次抓取前先查阅** — 检查目标站点是否有已记录的模式 |
95
+ | `references/api-quick-ref.md` | 生成脚本时查阅 — Fetcher/Selector 方法签名和参数 |
96
+ | `references/troubleshooting.md` | 执行报错时查阅 — 按错误信息查找原因和解决方案 |
97
+ | `references/cookie-vault.md` | 需要登录 cookie 时查阅 — 检查是否有历史记录可复用 |
98
+ | `references/maintenance.md` | 安装/升级/依赖问题时查阅 — 安装层级和验证命令 |
@@ -0,0 +1,127 @@
1
+ # Scrapling API 速查卡
2
+
3
+ ## Fetcher(基于 curl_cffi,最快)
4
+
5
+ ```python
6
+ from scrapling.fetchers import Fetcher
7
+
8
+ # GET 请求
9
+ page = Fetcher.get(url, impersonate='chrome', timeout=30, headers=None, cookies=None)
10
+
11
+ # POST 请求
12
+ page = Fetcher.post(url, data=None, json=None, impersonate='chrome', timeout=30)
13
+ ```
14
+
15
+ **Cookie 格式**: `dict` — `{'name': 'value'}`
16
+ **超时单位**: 秒
17
+
18
+ ## FetcherSession(保持会话 cookie)
19
+
20
+ ```python
21
+ from scrapling.fetchers import FetcherSession
22
+
23
+ with FetcherSession(impersonate='chrome') as s:
24
+ s.post(login_url, data={'user': '...', 'pass': '...'})
25
+ page = s.get(target_url)
26
+ ```
27
+
28
+ ## StealthyFetcher(Camoufox,绕过反爬)
29
+
30
+ ```python
31
+ from scrapling.fetchers import StealthyFetcher
32
+
33
+ page = StealthyFetcher.fetch(
34
+ url,
35
+ headless=True, # 无头模式
36
+ solve_cloudflare=True, # 自动过 Cloudflare
37
+ cookies=None, # list[dict] 格式
38
+ timeout=60000, # 毫秒
39
+ network_idle=True, # 等待网络空闲
40
+ hide_canvas=True, # 隐藏 canvas 指纹
41
+ block_webrtc=True, # 阻止 WebRTC 泄露 IP
42
+ disable_resources=False, # 禁用图片/字体加速
43
+ )
44
+ ```
45
+
46
+ **Cookie 格式**: `list[dict]` — `[{'name': 'n', 'value': 'v', 'domain': '.site.com', 'path': '/'}]`
47
+ **超时单位**: 毫秒
48
+
49
+ ## DynamicFetcher(Playwright,JS 渲染)
50
+
51
+ ```python
52
+ from scrapling.fetchers import DynamicFetcher
53
+
54
+ page = DynamicFetcher.fetch(
55
+ url,
56
+ headless=True,
57
+ cookies=None, # list[dict] 格式
58
+ timeout=30000, # 毫秒
59
+ network_idle=True, # 等待网络空闲
60
+ wait_selector=None, # 等待特定元素出现
61
+ disable_resources=True, # 跳过图片/字体/CSS 加速
62
+ )
63
+ ```
64
+
65
+ **Cookie 格式**: `list[dict]`
66
+ **超时单位**: 毫秒
67
+
68
+ ## Selector(纯 HTML 解析,无网络请求)
69
+
70
+ ```python
71
+ from scrapling.parser import Selector
72
+
73
+ page = Selector(html_string, url='https://base-url.com')
74
+ ```
75
+
76
+ ## Response 常用属性
77
+
78
+ ```python
79
+ page.status # HTTP 状态码 (int)
80
+ page.text # 原始 HTML/文本内容 (str)
81
+ page.url # 最终 URL(可能经过重定向)
82
+ page.cookies # 响应 cookie
83
+ page.headers # 响应头
84
+ ```
85
+
86
+ ## 选择器方法
87
+
88
+ ```python
89
+ # CSS 选择器
90
+ page.css('div.content') # 返回元素列表
91
+ page.css_first('h1') # 返回第一个匹配元素
92
+
93
+ # XPath 选择器
94
+ page.xpath('//div[@class="content"]')
95
+
96
+ # 文本提取伪元素
97
+ page.css('h1::text') # 提取文本内容
98
+ page.css('a::attr(href)') # 提取属性值
99
+
100
+ # 获取所有匹配结果的文本
101
+ results = page.css('h1::text').getall() # list[str]
102
+
103
+ # 获取第一个匹配结果的文本
104
+ result = page.css('h1::text').get() # str | None
105
+ ```
106
+
107
+ ## 元素方法
108
+
109
+ ```python
110
+ element = page.css_first('div.post')
111
+
112
+ element.text # 直接子文本
113
+ element.get_all_text(strip=True) # 递归获取所有文本
114
+ element.attrib # 属性字典
115
+ element.attrib.get('href') # 获取单个属性
116
+ element.css('span.author::text') # 在子树中继续选择
117
+ element.parent # 父元素
118
+ element.children # 子元素列表
119
+ ```
120
+
121
+ ## 正则提取
122
+
123
+ ```python
124
+ # 从文本中提取匹配
125
+ page.re(r'price: \$(\d+\.\d+)') # list[str] — 所有匹配
126
+ page.re_first(r'price: \$(\d+\.\d+)') # str | None — 第一个匹配
127
+ ```
@@ -0,0 +1,56 @@
1
+ # Cookie 保险库
2
+
3
+ 按站点分区记录历史 cookie,供抓取时快速查找使用。
4
+
5
+ > **安全提示**: 此文件存储敏感 cookie 值,请勿提交到版本控制或分享给他人。
6
+ > 实际使用时,请将此文件复制为 `cookie-vault.local.md` 并填入真实值。
7
+
8
+ ---
9
+
10
+ ## 示例站点 (example.com)
11
+
12
+ **最后更新**: YYYY-MM-DD
13
+ **状态**: 有效 / 可能已过期
14
+ **登录 cookie 字段**: `session_id`, `auth_token`
15
+ **Fetcher 类型**: StealthyFetcher
16
+
17
+ ### Playwright 格式(StealthyFetcher/DynamicFetcher 用)
18
+
19
+ ```python
20
+ cookies = [
21
+ {'name': 'session_id', 'value': '<YOUR_SESSION_ID>', 'domain': '.example.com', 'path': '/'},
22
+ {'name': 'auth_token', 'value': '<YOUR_AUTH_TOKEN>', 'domain': '.example.com', 'path': '/'},
23
+ ]
24
+ ```
25
+
26
+ ### 备注
27
+
28
+ - 从浏览器 DevTools > Application > Cookies 获取真实值
29
+ - cookie 有效期取决于站点设置,过期后需重新获取
30
+
31
+ ---
32
+
33
+ ## 模板:添加新站点
34
+
35
+ 复制以下模板,替换具体内容后追加到此文件:
36
+
37
+ ```markdown
38
+ ## 站点名称 (域名)
39
+
40
+ **最后更新**: YYYY-MM-DD
41
+ **状态**: 有效 / 可能已过期
42
+ **登录 cookie 字段**: `field1`, `field2`
43
+ **Fetcher 类型**: Fetcher / StealthyFetcher / DynamicFetcher
44
+
45
+ ### Playwright 格式
46
+
47
+ \```python
48
+ cookies = [
49
+ {'name': 'field1', 'value': '...', 'domain': '.example.com', 'path': '/'},
50
+ ]
51
+ \```
52
+
53
+ ### 备注
54
+
55
+ - 相关注意事项
56
+ ```