Skip to content

Commit 3441a3c

Browse files
author
catlog22
committed
refactor: SKILL.md abstraction cleanup + coordinator frontend detection
- Remove ui-ux-pro-max/Shared Memory sections from SKILL.md (implementation details belong in role.md) - Replace Frontend Detection code block with reference to coordinator/role.md - Add detectImplMode() to coordinator Phase 1 for auto-detecting frontend tasks - Add fe-only/fullstack/full-lifecycle-fe mode choices - Add fe-developer + fe-qa spawning in Phase 2 for frontend pipelines - Initialize shared-memory.json when frontend pipeline is active
1 parent d6e282b commit 3441a3c

2 files changed

Lines changed: 67 additions & 113 deletions

File tree

.claude/skills/team-lifecycle-v2/SKILL.md

Lines changed: 2 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -426,28 +426,9 @@ Full-lifecycle + FE:
426426
→ IMPL-001 ∥ DEV-FE-001 → TEST-001 ∥ QA-FE-001 → REVIEW-001
427427
```
428428
429-
### Frontend Detection (Coordinator Phase 1)
429+
### Frontend Detection
430430
431-
```javascript
432-
const FE_KEYWORDS = /component|page|UI|前端|frontend|CSS|HTML|React|Vue|Tailwind|组件|页面|样式|layout|responsive|Svelte|Next\.js|Nuxt|shadcn|设计系统|design.system/i
433-
434-
const BE_KEYWORDS = /API|database|server|后端|backend|middleware|auth|REST|GraphQL|migration|schema|model|controller|service/i
435-
436-
function detectImplMode(taskDescription) {
437-
const hasFE = FE_KEYWORDS.test(taskDescription)
438-
const hasBE = BE_KEYWORDS.test(taskDescription)
439-
440-
// Also check project files
441-
const hasFEFiles = Bash(`test -f package.json && (grep -q react package.json || grep -q vue package.json || grep -q svelte package.json || grep -q next package.json); echo $?`) === '0'
442-
443-
if (hasFE && hasBE) return 'fullstack'
444-
if (hasFE || hasFEFiles) return 'fe-only'
445-
return 'impl-only' // default backend
446-
}
447-
448-
// Coordinator uses this in Phase 1 to select pipeline
449-
const implMode = detectImplMode(requirements.scope + ' ' + requirements.originalInput)
450-
```
431+
Coordinator 在 Phase 1 根据任务关键词 + 项目文件自动检测前端任务并选择流水线模式(fe-only / fullstack / impl-only)。检测逻辑见 [roles/coordinator/role.md](roles/coordinator/role.md)。
451432
452433
### Generator-Critic Loop (fe-developer ↔ fe-qa)
453434
@@ -523,79 +504,6 @@ Coordinator supports `--resume` / `--continue` flags to resume interrupted sessi
523504
10. **Kick** — 向首个可执行任务的 worker 发送 `task_unblocked` 消息,打破 resume 死锁
524505
11. Jumps to Phase 4 coordination loop
525506
526-
## ui-ux-pro-max Integration (Frontend Pipelines)
527-
528-
When frontend pipelines are active, the design intelligence chain leverages ui-ux-pro-max:
529-
530-
### Design Intelligence Chain
531-
532-
```
533-
analyst (RESEARCH-001)
534-
└→ Skill(skill="ui-ux-pro-max", args="${industry} ${keywords} --design-system")
535-
└→ Output: {session}/analysis/design-intelligence.json
536-
537-
architect (via planner PLAN-001)
538-
└→ Consumes design-intelligence.json → generates design-tokens.json
539-
└→ Output: {session}/architecture/design-tokens.json
540-
541-
fe-developer (DEV-FE-*)
542-
└→ Consumes design-tokens.json → generates src/styles/tokens.css (:root + dark mode)
543-
└→ Consumes anti-patterns + implementation checklist from design-intelligence.json
544-
545-
fe-qa (QA-FE-*)
546-
└→ Consumes design-intelligence.json → industry anti-pattern checks
547-
└→ Consumes design-tokens.json → design compliance checks
548-
└→ Uses industry strictness (standard/strict) for audit depth
549-
```
550-
551-
### Skill Invocation
552-
553-
```javascript
554-
// Full design system recommendation
555-
Skill(skill="ui-ux-pro-max", args="${industry} ${keywords} --design-system")
556-
557-
// Domain-specific search (UX guidelines, typography, color)
558-
Skill(skill="ui-ux-pro-max", args="${query} --domain ${domain}")
559-
560-
// Tech stack guidelines
561-
Skill(skill="ui-ux-pro-max", args="${query} --stack ${stack}")
562-
563-
// Persist design system (cross-session reuse)
564-
Skill(skill="ui-ux-pro-max", args="${query} --design-system --persist -p ${projectName}")
565-
```
566-
567-
### Supported Domains & Stacks
568-
569-
- **Domains**: product, style, typography, color, landing, chart, ux, web
570-
- **Stacks**: html-tailwind, react, nextjs, vue, svelte, shadcn, swiftui, react-native, flutter
571-
572-
### Fallback
573-
574-
若 ui-ux-pro-max skill 未安装,降级为 LLM 通用设计知识。安装命令:`/plugin install ui-ux-pro-max@ui-ux-pro-max-skill`
575-
576-
## Shared Memory (Frontend Pipelines)
577-
578-
Frontend pipelines use `shared-memory.json` for cross-role state accumulation:
579-
580-
```json
581-
{
582-
"design_intelligence": {},
583-
"design_token_registry": {
584-
"colors": {}, "typography": {}, "spacing": {}, "shadows": {}
585-
},
586-
"component_inventory": [],
587-
"style_decisions": [],
588-
"qa_history": [],
589-
"industry_context": { "industry": "SaaS/科技", "config": { "strictness": "standard" } }
590-
}
591-
```
592-
593-
| Role | Phase 2 (Read) | Phase 4/5 (Write) |
594-
|------|---------------|-------------------|
595-
| coordinator | — | Initialize shared-memory.json |
596-
| fe-developer | design_intelligence, design_token_registry | component_inventory |
597-
| fe-qa | design_intelligence, industry_context, qa_history | qa_history |
598-
599507
## Coordinator Spawn Template
600508
601509
When coordinator creates teammates, use this pattern:

.claude/skills/team-lifecycle-v2/roles/coordinator/role.md

Lines changed: 65 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ if (!mode) {
288288
choices: [
289289
"spec-only - Generate specifications only",
290290
"impl-only - Implementation only (requires existing spec)",
291-
"full-lifecycle - Complete spec + implementation"
291+
"full-lifecycle - Complete spec + implementation",
292+
"fe-only - Frontend-only pipeline (plan → dev → QA)",
293+
"fullstack - Backend + frontend parallel pipeline",
294+
"full-lifecycle-fe - Full lifecycle with frontend (spec → fullstack)"
292295
]
293296
})
294297
}
@@ -330,6 +333,38 @@ const requirements = {
330333
originalInput: userInput
331334
}
332335

336+
// --- Frontend Detection ---
337+
// Auto-detect frontend tasks and adjust pipeline mode
338+
const FE_KEYWORDS = /component|page|UI|前端|frontend|CSS|HTML|React|Vue|Tailwind|组件|页面|样式|layout|responsive|Svelte|Next\.js|Nuxt|shadcn|设计系统|design.system/i
339+
const BE_KEYWORDS = /API|database|server|后端|backend|middleware|auth|REST|GraphQL|migration|schema|model|controller|service/i
340+
341+
function detectImplMode(taskDescription) {
342+
const hasFE = FE_KEYWORDS.test(taskDescription)
343+
const hasBE = BE_KEYWORDS.test(taskDescription)
344+
345+
// Also check project files for frontend frameworks
346+
const hasFEFiles = Bash(`test -f package.json && (grep -q react package.json || grep -q vue package.json || grep -q svelte package.json || grep -q next package.json); echo $?`) === '0'
347+
348+
if (hasFE && hasBE) return 'fullstack'
349+
if (hasFE || hasFEFiles) return 'fe-only'
350+
return 'impl-only' // default backend
351+
}
352+
353+
// Apply frontend detection for implementation modes
354+
if (mode === 'impl-only' || mode === 'full-lifecycle') {
355+
const detectedMode = detectImplMode(scope + ' ' + userInput)
356+
if (detectedMode !== 'impl-only') {
357+
// Frontend detected — upgrade pipeline mode
358+
if (mode === 'impl-only') {
359+
mode = detectedMode // fe-only or fullstack
360+
} else if (mode === 'full-lifecycle') {
361+
mode = 'full-lifecycle-fe' // spec + fullstack
362+
}
363+
requirements.mode = mode
364+
Output(`[coordinator] Frontend detected → pipeline upgraded to: ${mode}`)
365+
}
366+
}
367+
333368
Output("[coordinator] Requirements clarified:")
334369
Output(` Mode: ${mode}`)
335370
Output(` Scope: ${scope}`)
@@ -395,31 +430,42 @@ const sessionData = {
395430
Write(sessionFile, sessionData)
396431
Output(`[coordinator] Session file created: ${sessionFile}`)
397432

398-
// Spawn workers conditionally
399-
if (requirements.mode === "spec-only" || requirements.mode === "full-lifecycle") {
400-
TeamSpawn({
401-
team_id: teamId,
402-
role: "spec-writer",
403-
count: 1
404-
})
433+
// Spawn workers conditionally based on pipeline mode
434+
const isFE = ['fe-only', 'fullstack', 'full-lifecycle-fe'].includes(requirements.mode)
435+
const isBE = ['impl-only', 'fullstack', 'full-lifecycle', 'full-lifecycle-fe'].includes(requirements.mode)
436+
const isSpec = ['spec-only', 'full-lifecycle', 'full-lifecycle-fe'].includes(requirements.mode)
437+
438+
if (isSpec) {
439+
TeamSpawn({ team_id: teamId, role: "spec-writer", count: 1 })
405440
Output("[coordinator] Spawned spec-writer")
406441
}
407442

408-
if (requirements.mode === "impl-only" || requirements.mode === "full-lifecycle") {
409-
TeamSpawn({
410-
team_id: teamId,
411-
role: "implementer",
412-
count: 1
413-
})
443+
if (isBE) {
444+
TeamSpawn({ team_id: teamId, role: "implementer", count: 1 })
414445
Output("[coordinator] Spawned implementer")
415446
}
416447

448+
if (isFE) {
449+
TeamSpawn({ team_id: teamId, role: "fe-developer", count: 1 })
450+
Output("[coordinator] Spawned fe-developer")
451+
TeamSpawn({ team_id: teamId, role: "fe-qa", count: 1 })
452+
Output("[coordinator] Spawned fe-qa")
453+
454+
// Initialize shared memory for frontend pipeline
455+
const sharedMemoryPath = `${sessionFolder}/shared-memory.json`
456+
Write(sharedMemoryPath, JSON.stringify({
457+
design_intelligence: {},
458+
design_token_registry: {},
459+
component_inventory: [],
460+
style_decisions: [],
461+
qa_history: [],
462+
industry_context: {}
463+
}, null, 2))
464+
Output("[coordinator] Initialized shared-memory.json for frontend pipeline")
465+
}
466+
417467
// Always spawn researcher for ambiguity resolution
418-
TeamSpawn({
419-
team_id: teamId,
420-
role: "researcher",
421-
count: 1
422-
})
468+
TeamSpawn({ team_id: teamId, role: "researcher", count: 1 })
423469
Output("[coordinator] Spawned researcher")
424470

425471
goto Phase3

0 commit comments

Comments
 (0)