Code Workflows - Development Orchestrator
Unified workflow guidance across 6 specialized code quality skills for frontend development.
Core Principle: Implementation → Debugging (if needed) → Verification (MANDATORY) = reliable frontend code.
1. 🎯 WHEN TO USE
Activation Triggers
Use this skill when:
- Starting frontend development work
- Implementing forms, APIs, DOM manipulation
- Integrating external libraries or media
- JavaScript files have been modified
- Encountering console errors or unexpected behavior
- Deep call stack issues or race conditions
- Multiple debugging attempts needed
- Need root cause identification
- Before ANY completion claim ("works", "fixed", "done", "complete", "passing")
- After implementing or debugging frontend code
Keyword triggers:
- Implementation: "implement", "build", "create", "add feature", "async", "validation", "CDN", "animation", "webflow", "performance", "security"
- Debugging: "debug", "fix", "error", "not working", "broken", "issue", "bug", "console error"
- Verification: "done", "complete", "works", "fixed", "finished", "verify", "test"
When NOT to Use
Do NOT use this skill for:
- Non-frontend tasks (backend, infrastructure, DevOps)
- Documentation-only changes
- Pure research without implementation
- Git/version control operations (use workflows-git instead)
- Skill creation/editing (use workflows-documentation instead)
Phase Overview
This orchestrator operates in three primary phases:
| Phase |
Purpose |
Trigger |
| Phase 1: Implementation |
Writing code with async handling, validation, cache-busting |
Starting new code, modifying existing |
| Phase 2: Debugging |
Fixing issues systematically using DevTools |
Console errors, unexpected behavior |
| Phase 3: Verification |
Browser testing before completion claims |
Before ANY "done" or "works" claim |
The Iron Law: NO COMPLETION CLAIMS WITHOUT FRESH BROWSER VERIFICATION EVIDENCE
2. 🧭 SMART ROUTING
Resource Loading Levels
| Level |
When to Load |
Resources |
| ALWAYS |
Every phase invocation |
Core workflow + essential patterns |
| CONDITIONAL |
If task keywords match |
Domain-specific references |
| ON_DEMAND |
Only on explicit request |
Deep-dive optimization guides |
Task Keyword Triggers
TASK_KEYWORDS = {
"VERIFICATION": ["done", "complete", "works", "verify", "finished"],
"DEBUGGING": ["bug", "fix", "error", "broken", "issue", "failing"],
"CODE_QUALITY": ["style check", "quality check", "validate code", "check standards", "code review"],
"ANIMATION": ["animation", "motion", "gsap", "lenis", "scroll"],
"FORMS": ["form", "validation", "input", "submit", "botpoison"],
"VIDEO": ["video", "hls", "streaming", "player"],
"DEPLOYMENT": ["deploy", "minify", "cdn", "r2", "production"],
# ON_DEMAND explicit request triggers
"PERFORMANCE": ["performance", "optimize", "core web vitals", "lazy load", "cache"],
"OBSERVERS": ["observer", "mutation", "intersection", "resize observer"]
}
Phase Detection
TASK CONTEXT
│
├─► Writing new code / implementing feature
│ └─► PHASE 1: Implementation
│ └─► Load: phase1-implementation/*.md (ALWAYS: implementation_workflows.md)
│ └─► At completion: CODE QUALITY GATE (see Phase 1.5)
│
├─► Implementation complete / claiming done
│ └─► PHASE 1.5: Code Quality Gate (MANDATORY for all code files)
│ └─► Load: assets/checklists/code_quality_checklist.md (ALWAYS)
│ └─► Load: references/standards/code_style_enforcement.md (if violations found)
│ └─► JavaScript (.js): Sections 2-7 of checklist
│ └─► CSS (.css): Section 8 of checklist
│ └─► ⚠️ HARD BLOCK: All P0 checklist items must pass before claiming complete
│
├─► Code not working / debugging issues
│ └─► PHASE 2: Debugging
│ └─► Load: phase2-debugging/debugging_workflows.md (ALWAYS)
│ └─► See: workflows-chrome-devtools skill for DevTools reference
│
├─► Code complete / needs verification
│ └─► PHASE 3: Verification (MANDATORY)
│ └─► Load: phase3-verification/verification_workflows.md (ALWAYS)
│ └─► ⚠️ The Iron Law: NO COMPLETION CLAIMS WITHOUT BROWSER VERIFICATION
│
└─► Quick reference needed
└─► Load: standards/quick_reference.md
Specific Use Case Router
Phase 1: Implementation
| Use Case |
Route To |
Load Level |
| Async/timing issues, DOM not ready, race conditions |
implementation_workflows.md#2-⏱️-condition-based-waiting |
ALWAYS |
| Form input, API calls, DOM manipulation validation |
implementation_workflows.md#3-🛡️-defense-in-depth-validation |
ALWAYS |
| JavaScript minification, terser, verification |
minification_guide.md |
CONDITIONAL |
| CDN deployment, version management, Cloudflare R2 |
cdn_deployment.md |
CONDITIONAL |
| CSS vs Motion.dev, entrance animations, scroll triggers |
animation_workflows.md |
CONDITIONAL |
| Webflow collection lists, platform limits, ID duplication |
webflow_patterns.md |
CONDITIONAL |
| Animation/video/asset optimization |
performance_patterns.md |
ON_DEMAND |
| XSS, CSRF, injection prevention |
security_patterns.md |
CONDITIONAL |
| Third-party library integration, CDN loading, HLS.js |
third_party_integrations.md |
CONDITIONAL |
| MutationObserver, IntersectionObserver, DOM watching |
observer_patterns.md |
ON_DEMAND |
Phase 2: Debugging
Phase 3: Verification
Resource Router
def route_frontend_resources(task):
# ──────────────────────────────────────────────────────────────────
# Level-based loading
# ALWAYS: Load for every phase invocation
# CONDITIONAL: Load if keywords match
# ON_DEMAND: Load on explicit request
# ──────────────────────────────────────────────────────────────────
# ──────────────────────────────────────────────────────────────────
# Phase 1: Implementation
# ALWAYS: implementation_workflows.md
# CONDITIONAL: animation, webflow, security (if keywords match)
# ON_DEMAND: performance, observer (on request)
# ──────────────────────────────────────────────────────────────────
if task.phase == "implementation":
# ALWAYS: Load for async/validation
if task.has_async_loading:
load("assets/patterns/wait_patterns.js") # ALWAYS: async waiting patterns
if task.needs_validation:
load("assets/patterns/validation_patterns.js") # ALWAYS: validation templates
# CONDITIONAL: Load if deployment keywords detected
if task.needs_minification:
return load("references/deployment/minification_guide.md") # CONDITIONAL: terser, verification
if task.needs_cdn_deployment:
return load("references/deployment/cdn_deployment.md") # CONDITIONAL: R2 upload, versioning
# CONDITIONAL: Load if animation keywords detected
if task.has_animations:
return load("references/phase1-implementation/animation_workflows.md") # CONDITIONAL: CSS vs Motion.dev
# CONDITIONAL: Load if webflow keywords detected
if task.webflow_specific:
return load("references/phase1-implementation/webflow_patterns.md") # CONDITIONAL: platform limits
# CONDITIONAL: Load if security keywords detected
if task.security_concerns:
return load("references/phase1-implementation/security_patterns.md") # CONDITIONAL: OWASP Top 10
# ON_DEMAND: Load on explicit request (performance optimization)
if task.needs_performance_optimization:
return load("references/phase1-implementation/performance_patterns.md") # ON_DEMAND: Core Web Vitals
# ON_DEMAND: Load on explicit request (observer patterns)
if task.needs_observer_patterns:
return load("references/phase1-implementation/observer_patterns.md") # ON_DEMAND: MutationObserver, IO
# ALWAYS: Default implementation patterns
return load("references/phase1-implementation/implementation_workflows.md")
# ──────────────────────────────────────────────────────────────────
# Phase 1.5: Code Quality Gate (MANDATORY for all code files)
# ALWAYS: code_quality_checklist.md
# CONDITIONAL: code_style_enforcement.md (if violations found)
# JavaScript (.js): Sections 2-7 | CSS (.css): Section 8
# ──────────────────────────────────────────────────────────────────
if task.phase == "code_quality" or task.implementation_complete:
load("assets/checklists/code_quality_checklist.md") # ALWAYS: validation checklist
if task.has_violations:
load("references/standards/code_style_enforcement.md") # CONDITIONAL: remediation
return True # Gate must pass before proceeding
# ──────────────────────────────────────────────────────────────────
# Phase 2: Debugging
# ALWAYS: debugging_workflows.md + debugging_checklist.md
# ──────────────────────────────────────────────────────────────────
if task.phase == "debugging":
load("assets/checklists/debugging_checklist.md") # ALWAYS: step-by-step workflow
# For DevTools reference, see workflows-chrome-devtools skill
return load("references/phase2-debugging/debugging_workflows.md") # ALWAYS: root cause tracing
# ──────────────────────────────────────────────────────────────────
# Phase 3: Verification (MANDATORY)
# ALWAYS: verification_workflows.md + verification_checklist.md
# ──────────────────────────────────────────────────────────────────
if task.phase == "verification" or task.claiming_complete:
load("assets/checklists/verification_checklist.md") # ALWAYS: mandatory steps
return load("references/phase3-verification/verification_workflows.md") # ALWAYS: browser testing
# ──────────────────────────────────────────────────────────────────
# Quick Reference
# ──────────────────────────────────────────────────────────────────
if task.needs_quick_reference:
return load("references/standards/quick_reference.md") # one-page cheat sheet
# ──────────────────────────────────────────────────────────────────
# STATIC RESOURCES (always available, not conditionally loaded)
# Located in references/standards/ for cross-phase access
# ──────────────────────────────────────────────────────────────────
# references/standards/code_quality_standards.md → Cross-phase: Initialization, error handling, validation patterns
# references/standards/code_style_guide.md → Cross-phase: Naming conventions, formatting, comments
# references/standards/code_style_enforcement.md → Phase 1.5: Enforcement rules with examples and remediation
# references/standards/shared_patterns.md → DevTools, logging, testing, error patterns
# references/phase1-implementation/performance_patterns.md → Phase 1: Performance optimization (ON_DEMAND)
# references/deployment/minification_guide.md → Safe JS minification with terser, verification pipeline
# references/deployment/cdn_deployment.md → Cloudflare R2 upload, version management, HTML updates
# assets/checklists/code_quality_checklist.md → Phase 1.5: Code quality validation checklist
# See "The Iron Law" in Section 1 - Phase 3: Verification
# See "Code Quality Gate" in Section 3 - Phase 1.5 for style enforcement
3. 🛠️ HOW IT WORKS
Development Lifecycle
Frontend development flows through phases with a mandatory quality gate:
Implementation → Code Quality Gate → Debugging (if issues) → Verification (MANDATORY)
Phase 1: Implementation
Implementation involves three specialized workflows:
Condition-Based Waiting - Replace arbitrary setTimeout with condition polling
- Wait for actual conditions, not timeouts
- Includes timeout limits with clear errors
- Handles: DOM ready, library loading, image/video ready, animations
Defense-in-Depth Validation - Validate at every layer data passes through
- Layer 1: Entry point validation
- Layer 2: Processing validation
- Layer 3: Output validation
- Layer 4: Safe access patterns
CDN Version Management - Update version parameters after JS changes
- Manual version increment workflow (see Section 4)
- Updates all HTML files referencing changed JS
- Forces browser cache refresh
See implementation_workflows.md for complete workflows.
Phase 1.5: Code Quality Gate
Before claiming implementation is complete, validate code against style standards:
Identify File Type - Determine which checklist sections apply:
- JavaScript (
.js): Sections 2-7 (13 P0 items)
- CSS (
.css): Section 8 (4 P0 items)
- Both: All sections (17 P0 items)
Load Checklist - Load code_quality_checklist.md
Validate P0 Items - Check all P0 (blocking) items for the file type:
JavaScript P0 Items:
- File header format (three-line with box-drawing characters)
- Section organization (IIFE, numbered headers)
- No commented-out code
- snake_case naming conventions
- CDN-safe initialization pattern
CSS P0 Items:
- Custom property naming (semantic prefixes:
--font-*, --vw-*, etc.)
- Attribute selectors use case-insensitivity flag
i
- BEM naming convention (
.block--element, .block-modifier)
- GPU-accelerated animation properties only (
transform, opacity, scale)
Validate P1 Items - Check all P1 (required) items for the file type
Fix or Document - For any failures:
- P0 violations: MUST fix before proceeding
- P1 violations: Fix OR document approved deferral
- P2 violations: Can defer with documented reason
Only Then - Proceed to verification or claim completion
Gate Rule: If ANY P0 item fails, completion is BLOCKED until fixed.
See code_style_enforcement.md for remediation instructions.
Phase 2: Debugging
Systematic Debugging uses a 4-phase framework:
Root Cause Investigation
- Read error messages carefully
- Reproduce consistently
- Check recent changes
- Gather evidence in DevTools
- Trace data flow
Pattern Analysis
- Find working examples
- Compare against references
- Identify differences
- Understand dependencies
Hypothesis and Testing
- Form single hypothesis
- Test minimally (one change at a time)
- Verify before continuing
- Ask when unsure
Implementation
- Document the fix
- Implement single fix
- Verify in browser
- If 3+ fixes failed → question approach
Root Cause Tracing traces backward through call chain:
- Observe symptom
- Find immediate cause
- Trace one level up
- Keep tracing up
- Fix at source, not symptom
See debugging_workflows.md for complete workflows.
Phase 3: Verification
The Gate Function - BEFORE claiming any status:
- IDENTIFY: What command/action proves this claim?
- OPEN: Launch actual browser
- TEST: Execute the interaction
- VERIFY: Does browser show expected behavior?
- VERIFY: Multi-viewport check (mobile + desktop)
- VERIFY: Cross-browser check (if critical)
- RECORD: Note what you saw
- ONLY THEN: Make the claim
Browser Testing Matrix:
Minimum (ALWAYS REQUIRED):
- Chrome Desktop (1920px)
- Mobile emulation (375px)
- DevTools Console - No errors
Standard (Production work):
- Chrome Desktop (1920px)
- Chrome Tablet emulation (768px)
- Chrome Mobile emulation (375px)
- DevTools console clear at all viewports
See verification_workflows.md for complete requirements.
4. 📋 RULES
Phase 1: Implementation
✅ ALWAYS
- Wait for actual conditions, not arbitrary timeouts (include timeout limits)
- Validate all inputs: function parameters, API responses, DOM elements
- Sanitize user input before storing or displaying
- Update CDN versions after JavaScript modifications
- Use optional chaining (
?.) and try/catch for safe access
- Log meaningful success/error messages
❌ NEVER
- Use
setTimeout without documenting WHY
- Assume data exists without checking
- Trust external data without validation
- Use innerHTML with unsanitized data
- Skip CDN version updates after JS changes
⚠️ ESCALATE IF
- Condition never becomes true (infinite wait)
- Validation logic becoming too complex
- Security concerns with XSS or injection attacks
- Script reports no HTML files found
- CDN version cannot be determined
See implementation_workflows.md for detailed rules.
Phase 1.5: Code Quality Gate (MANDATORY for all code files)
✅ ALWAYS
- Load code_quality_checklist.md before claiming implementation complete
- Identify file type (JavaScript → Sections 2-7, CSS → Section 8)
- Validate all P0 items for the applicable file type
- Fix P0 violations before proceeding
- Document any P1/P2 deferrals with reasons
- Use code_style_enforcement.md for remediation guidance
❌ NEVER (JavaScript)
- Skip the quality gate for "simple" changes
- Claim completion with P0 violations
- Use commented-out code (delete it)
- Use camelCase for variables/functions (use snake_case)
- Skip file headers or section organization
❌ NEVER (CSS)
- Use generic custom property names without semantic prefixes
- Omit case-insensitivity flag
i on data attribute selectors
- Use inconsistent BEM naming (mix snake_case, camelCase)
- Animate layout properties (width, height, top, left, padding, margin)
- Set
will-change permanently in CSS (set dynamically via JS)
⚠️ ESCALATE IF
- Cannot fix a P0 violation
- Standard conflicts with existing code patterns
- Unclear whether code is compliant
See code_quality_checklist.md and code_style_enforcement.md for detailed rules.
Phase 2: Debugging
✅ ALWAYS
- Open DevTools console BEFORE attempting fixes
- Read complete error messages and stack traces
- Test across multiple viewports (375px, 768px, 1920px)
- Test one change at a time
- Trace backward from symptom to root cause
- Document root cause in comments
❌ NEVER
- Skip console error messages
- Change multiple things simultaneously
- Proceed with 4th fix without questioning approach
- Fix only symptoms without tracing root cause
- Leave production console.log statements
⚠️ ESCALATE IF
- Bug only occurs in production
- Issue requires changing Webflow-generated code
- Cross-browser compatibility cannot be achieved
- Bug intermittent despite extensive logging
- Cannot trace backward (dead end)
- Root cause in third-party library
See debugging_workflows.md for detailed rules.
Phase 3: Verification (MANDATORY)
✅ ALWAYS
- Open actual browser to verify (not just code review)
- Test mobile viewport (375px minimum)
- Check DevTools console for errors
- Test interactive elements by clicking them
- Note what you tested in your claim
❌ NEVER
- Claim "works" without opening browser
- Say "should work" or "probably works" - test it
- Test only at one viewport size
- Assume desktop testing covers mobile
- Express satisfaction before verification
⚠️ ESCALATE IF
- Cannot test in required browsers
- Real device testing required but unavailable
- Issue only reproduces in production
- Performance testing requires specialized tools
See verification_workflows.md for detailed rules.
5. 🏆 SUCCESS CRITERIA
Phase 1: Implementation
Implementation is successful when:
- ✅ No arbitrary setTimeout used (or documented why needed)
- ✅ All inputs validated (parameters, DOM, API responses)
- ✅ User input sanitized
- ✅ CDN versions updated after JS changes
- ✅ Safe defaults provided for missing data
- ✅ Clear error messages logged
See implementation_workflows.md for complete criteria.
Phase 1.5: Code Quality Gate
Code Quality Gate passes when:
JavaScript (.js):
- ✅ All P0 checklist items verified and passing (Sections 2-7)
- ✅ All P1 checklist items verified or documented deferrals
- ✅ File headers use correct format (three-line, box-drawing)
- ✅ Section organization follows standard (IIFE, numbered headers)
- ✅ No commented-out code present
- ✅ All naming uses snake_case (not camelCase)
- ✅ CDN-safe initialization pattern followed
CSS (.css):
- ✅ All P0 checklist items verified and passing (Section 8)
- ✅ Custom properties use semantic prefixes (
--font-*, --vw-*, etc.)
- ✅ Attribute selectors include case-insensitivity flag
i
- ✅ Class names follow BEM convention (
.block--element, .block-modifier)
- ✅ Animations use GPU-accelerated properties only (
transform, opacity, scale)
See code_quality_checklist.md for complete criteria.
Phase 2: Debugging
Debugging is successful when:
- ✅ Root cause identified and documented
- ✅ Fix addresses cause, not symptom
- ✅ Tested across target browsers and viewports
- ✅ No console errors introduced
- ✅ Performance not degraded
- ✅ Code comments explain WHY fix needed
See debugging_workflows.md for complete criteria.
Phase 3: Verification
Verification is successful when:
- ✅ Opened actual browser (not just reviewed code)
- ✅ Tested in multiple viewports (mobile + desktop)
- ✅ Checked DevTools console (no errors)
- ✅ Tested interactions by actually clicking/hovering
- ✅ Documented what was tested in claim
- ✅ Can describe exactly what was seen in browser
See verification_workflows.md for complete criteria.
Verification Statement Template
See verification_checklist.md for the completion claim template.
6. 🔌 INTEGRATION POINTS
Framework Integration
This skill operates within the behavioral framework defined in AGENTS.md.
Key integrations:
- Gate 2: Skill routing via
skill_advisor.py
- Tool Routing: Per AGENTS.md Section 6 decision tree
- Memory: Context preserved via Spec Kit Memory MCP
Code Quality Standards
Primary References:
See these reference files for complete standards. Key patterns include CDN-safe initialization, snake_case naming, and defense-in-depth validation.
Tool Usage Guidelines
- Bash: Git commands, system operations
- Read: Examine code files, documentation
- Grep: Pattern searches, finding keywords
- Glob: File discovery by patterns
Additional Knowledge Base Dependencies
External Tools
- Browser DevTools - Chrome DevTools MCP (automated testing), Chrome DevTools (manual debugging)
- Python 3 - General scripting support
- Git - Version control for checking changes
- Motion.dev - Animation library (CDN: jsdelivr.net/npm/motion@12.15.0)
- mcp-narsil - Security scanning during debugging (OWASP, CWE, taint analysis via Code Mode)
Browser Verification
For browser debugging and verification, use the workflows-chrome-devtools skill which provides:
- CLI-first approach via
browser-debugger-cli (bdg)
- MCP fallback for multi-tool workflows
- Complete DevTools integration (644 methods across 53 domains)
See: .opencode/skill/workflows-chrome-devtools/SKILL.md for complete reference.
Quality Review Integration
Note: Review quality manually after file modifications.
Manual quality review steps:
- Review recent file changes for quality issues
- Check for consistent patterns across modifications
- Use as inputs to Phase 1 investigation during debugging
See shared_patterns.md for common patterns across all workflows.
7. 📚 EXTERNAL RESOURCES
Official Documentation
| Resource |
URL |
Use For |
| MDN Web Docs |
developer.mozilla.org |
JavaScript, DOM, Web APIs |
| Webflow University |
university.webflow.com |
Webflow platform patterns |
| Motion.dev |
motion.dev/docs |
Animation library |
| HLS.js |
github.com/video-dev/hls.js |
Video streaming |
| Lenis |
lenis.darkroom.engineering |
Smooth scroll |
Testing & Debugging
| Resource |
URL |
Use For |
| Chrome DevTools |
developer.chrome.com/docs/devtools |
Browser debugging |
| Can I Use |
caniuse.com |
Browser compatibility |
8. 🔗 RELATED RESOURCES
Related Skills
| Skill |
Use For |
| workflows-documentation |
Documentation quality, skill creation, markdown validation |
| workflows-git |
Git workflows, commit hygiene, PR creation |
| system-spec-kit |
Spec folder management, memory system, context preservation |
| mcp-narsil |
Code intelligence, security scanning, call graphs |
| workflows-chrome-devtools |
Browser debugging, screenshots, console access |
Navigation Guide
For Implementation Tasks:
- Start with Section 1 (When to Use) to confirm this skill applies
- Follow Implementation phase from Section 3 (How It Works)
- Load ALWAYS/CONDITIONAL resources from
references/phase1-implementation/
For Debugging Tasks:
- Load debugging_checklist.md
- Follow systematic debugging workflow in Section 3
- Use workflows-chrome-devtools skill for DevTools reference
For Verification Tasks:
- Load verification_checklist.md
- Complete all applicable checks
- Only claim "done" when checklist passes
9. 📍 WHERE AM I? (Phase Detection Helper)
If you're unsure which phase you're in:
Phase 1: Implementation
You're here if: Writing/modifying code, not yet testing
Exit criteria: Code written, builds successfully
Phase 2: Debugging
You're here if: Code written but has bugs/failing tests
Exit criteria: All tests passing, feature functional
Phase 3: Verification
You're here if: Tests pass, performing final validation
Exit criteria: Verified in browser, ready to ship
Phase Transitions
- Phase 1 → 2: Implementation reveals bugs → Switch to debugging
- Phase 2 → 1: Debugging reveals missing code → Return to implementation
- Phase 2 → 3: All bugs fixed → Proceed to verification
- Phase 3 → 1/2: Verification reveals issues → Return to appropriate phase
Key principle: Always end with Phase 3 before claiming completion.
1---2name: workflows-code3description: Orchestrator guiding developers through implementation, debugging, and verification phases across specialized code quality skills (project)4---5
6<!-- Keywords: workflows-code, development-orchestrator, frontend-development, browser-verification, debugging-workflow, implementation-patterns, webflow-integration -->
7
8# Code Workflows - Development Orchestrator
9
10Unified workflow guidance across 6 specialized code quality skills for frontend development.
11
12**Core Principle**: Implementation → Debugging (if needed) → Verification (MANDATORY) = reliable frontend code.
13
14---
15
16## 1. 🎯 WHEN TO USE
17
18### Activation Triggers
19
20**Use this skill when:**
21- Starting frontend development work
22- Implementing forms, APIs, DOM manipulation
23- Integrating external libraries or media
24- JavaScript files have been modified
25- Encountering console errors or unexpected behavior
26- Deep call stack issues or race conditions
27- Multiple debugging attempts needed
28- Need root cause identification
29- Before ANY completion claim ("works", "fixed", "done", "complete", "passing")
30- After implementing or debugging frontend code
31
32**Keyword triggers:**
33- Implementation: "implement", "build", "create", "add feature", "async", "validation", "CDN", "animation", "webflow", "performance", "security"
34- Debugging: "debug", "fix", "error", "not working", "broken", "issue", "bug", "console error"
35- Verification: "done", "complete", "works", "fixed", "finished", "verify", "test"
36
37### When NOT to Use
38
39**Do NOT use this skill for:**
40- Non-frontend tasks (backend, infrastructure, DevOps)
41- Documentation-only changes
42- Pure research without implementation
43- Git/version control operations (use workflows-git instead)
44- Skill creation/editing (use workflows-documentation instead)
45
46### Phase Overview
47
48This orchestrator operates in three primary phases:
49
50| Phase | Purpose | Trigger |
51| --------------------------- | ----------------------------------------------------------- | ------------------------------------- |
52| **Phase 1: Implementation** | Writing code with async handling, validation, cache-busting | Starting new code, modifying existing |
53| **Phase 2: Debugging** | Fixing issues systematically using DevTools | Console errors, unexpected behavior |
54| **Phase 3: Verification** | Browser testing before completion claims | Before ANY "done" or "works" claim |
55
56**The Iron Law**: NO COMPLETION CLAIMS WITHOUT FRESH BROWSER VERIFICATION EVIDENCE
57
58---
59
60## 2. 🧭 SMART ROUTING
61
62### Resource Loading Levels
63
64| Level | When to Load | Resources |
65| ----------- | ------------------------ | ---------------------------------- |
66| ALWAYS | Every phase invocation | Core workflow + essential patterns |
67| CONDITIONAL | If task keywords match | Domain-specific references |
68| ON_DEMAND | Only on explicit request | Deep-dive optimization guides |
69
70### Task Keyword Triggers
71
72```python
73TASK_KEYWORDS = {
74 "VERIFICATION": ["done", "complete", "works", "verify", "finished"],
75 "DEBUGGING": ["bug", "fix", "error", "broken", "issue", "failing"],
76 "CODE_QUALITY": ["style check", "quality check", "validate code", "check standards", "code review"],
77 "ANIMATION": ["animation", "motion", "gsap", "lenis", "scroll"],
78 "FORMS": ["form", "validation", "input", "submit", "botpoison"],
79 "VIDEO": ["video", "hls", "streaming", "player"],
80 "DEPLOYMENT": ["deploy", "minify", "cdn", "r2", "production"],
81 # ON_DEMAND explicit request triggers
82 "PERFORMANCE": ["performance", "optimize", "core web vitals", "lazy load", "cache"],
83 "OBSERVERS": ["observer", "mutation", "intersection", "resize observer"]
84}
85```
86
87### Phase Detection
88```
89TASK CONTEXT
90 │
91 ├─► Writing new code / implementing feature
92 │ └─► PHASE 1: Implementation
93 │ └─► Load: phase1-implementation/*.md (ALWAYS: implementation_workflows.md)
94 │ └─► At completion: CODE QUALITY GATE (see Phase 1.5)
95 │
96 ├─► Implementation complete / claiming done
97 │ └─► PHASE 1.5: Code Quality Gate (MANDATORY for all code files)
98 │ └─► Load: assets/checklists/code_quality_checklist.md (ALWAYS)
99 │ └─► Load: references/standards/code_style_enforcement.md (if violations found)
100 │ └─► JavaScript (.js): Sections 2-7 of checklist
101 │ └─► CSS (.css): Section 8 of checklist
102 │ └─► ⚠️ HARD BLOCK: All P0 checklist items must pass before claiming complete
103 │
104 ├─► Code not working / debugging issues
105 │ └─► PHASE 2: Debugging
106 │ └─► Load: phase2-debugging/debugging_workflows.md (ALWAYS)
107 │ └─► See: workflows-chrome-devtools skill for DevTools reference
108 │
109 ├─► Code complete / needs verification
110 │ └─► PHASE 3: Verification (MANDATORY)
111 │ └─► Load: phase3-verification/verification_workflows.md (ALWAYS)
112 │ └─► ⚠️ The Iron Law: NO COMPLETION CLAIMS WITHOUT BROWSER VERIFICATION
113 │
114 └─► Quick reference needed
115 └─► Load: standards/quick_reference.md
116```
117
118### Specific Use Case Router
119
120**Phase 1: Implementation**
121
122| Use Case | Route To | Load Level |
123| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
124| Async/timing issues, DOM not ready, race conditions | [implementation_workflows.md#2-⏱️-condition-based-waiting](./references/phase1-implementation/implementation_workflows.md#2-⏱️-condition-based-waiting) | ALWAYS |
125| Form input, API calls, DOM manipulation validation | [implementation_workflows.md#3-🛡️-defense-in-depth-validation](./references/phase1-implementation/implementation_workflows.md#3-🛡️-defense-in-depth-validation) | ALWAYS |
126| JavaScript minification, terser, verification | [minification_guide.md](./references/deployment/minification_guide.md) | CONDITIONAL |
127| CDN deployment, version management, Cloudflare R2 | [cdn_deployment.md](./references/deployment/cdn_deployment.md) | CONDITIONAL |
128| CSS vs Motion.dev, entrance animations, scroll triggers | [animation_workflows.md](./references/phase1-implementation/animation_workflows.md) | CONDITIONAL |
129| Webflow collection lists, platform limits, ID duplication | [webflow_patterns.md](./references/phase1-implementation/webflow_patterns.md) | CONDITIONAL |
130| Animation/video/asset optimization | [performance_patterns.md](./references/phase1-implementation/performance_patterns.md) | ON_DEMAND |
131| XSS, CSRF, injection prevention | [security_patterns.md](./references/phase1-implementation/security_patterns.md) | CONDITIONAL |
132| Third-party library integration, CDN loading, HLS.js | [third_party_integrations.md](./references/phase1-implementation/third_party_integrations.md) | CONDITIONAL |
133| MutationObserver, IntersectionObserver, DOM watching | [observer_patterns.md](./references/phase1-implementation/observer_patterns.md) | ON_DEMAND |
134
135**Phase 2: Debugging**
136
137| Use Case | Route To | Load Level |
138| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
139| Console errors, layout bugs, event handler failures | [debugging_workflows.md#2-🔍-systematic-debugging](./references/phase2-debugging/debugging_workflows.md#2-🔍-systematic-debugging) | ALWAYS |
140| Deep call stack, mysterious failures, corrupted data | [debugging_workflows.md#3-🎯-root-cause-tracing](./references/phase2-debugging/debugging_workflows.md#3-🎯-root-cause-tracing) | ALWAYS |
141| Slow page, janky animations, memory leaks | [debugging_workflows.md#4-🔍-performance-debugging](./references/phase2-debugging/debugging_workflows.md#4-🔍-performance-debugging) | CONDITIONAL |
142| Collection list not rendering, event listeners failing | [webflow_patterns.md](./references/phase1-implementation/webflow_patterns.md) | CONDITIONAL |
143| Motion.dev not loading, layout jumps, jank | [animation_workflows.md#7-🐛-common-issues-and-solutions](./references/phase1-implementation/animation_workflows.md#7-🐛-common-issues-and-solutions) | CONDITIONAL |
144
145**Phase 3: Verification**
146
147| Use Case | Route To | Load Level |
148| ---------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------- |
149| Before claiming "works", "fixed", "done", "complete" | [verification_workflows.md](./references/phase3-verification/verification_workflows.md) | ALWAYS |
150| Animation working, layout fixed, feature complete | [verification_workflows.md](./references/phase3-verification/verification_workflows.md) | ALWAYS |
151| Video/media loads, form submission works | [verification_workflows.md](./references/phase3-verification/verification_workflows.md) | ALWAYS |
152
153### Resource Router
154```python
155def route_frontend_resources(task):
156 # ──────────────────────────────────────────────────────────────────
157 # Level-based loading
158 # ALWAYS: Load for every phase invocation
159 # CONDITIONAL: Load if keywords match
160 # ON_DEMAND: Load on explicit request
161 # ──────────────────────────────────────────────────────────────────
162
163 # ──────────────────────────────────────────────────────────────────
164 # Phase 1: Implementation
165 # ALWAYS: implementation_workflows.md
166 # CONDITIONAL: animation, webflow, security (if keywords match)
167 # ON_DEMAND: performance, observer (on request)
168 # ──────────────────────────────────────────────────────────────────
169 if task.phase == "implementation":
170 # ALWAYS: Load for async/validation
171 if task.has_async_loading:
172 load("assets/patterns/wait_patterns.js") # ALWAYS: async waiting patterns
173 if task.needs_validation:
174 load("assets/patterns/validation_patterns.js") # ALWAYS: validation templates
175
176 # CONDITIONAL: Load if deployment keywords detected
177 if task.needs_minification:
178 return load("references/deployment/minification_guide.md") # CONDITIONAL: terser, verification
179 if task.needs_cdn_deployment:
180 return load("references/deployment/cdn_deployment.md") # CONDITIONAL: R2 upload, versioning
181
182 # CONDITIONAL: Load if animation keywords detected
183 if task.has_animations:
184 return load("references/phase1-implementation/animation_workflows.md") # CONDITIONAL: CSS vs Motion.dev
185
186 # CONDITIONAL: Load if webflow keywords detected
187 if task.webflow_specific:
188 return load("references/phase1-implementation/webflow_patterns.md") # CONDITIONAL: platform limits
189
190 # CONDITIONAL: Load if security keywords detected
191 if task.security_concerns:
192 return load("references/phase1-implementation/security_patterns.md") # CONDITIONAL: OWASP Top 10
193
194 # ON_DEMAND: Load on explicit request (performance optimization)
195 if task.needs_performance_optimization:
196 return load("references/phase1-implementation/performance_patterns.md") # ON_DEMAND: Core Web Vitals
197
198 # ON_DEMAND: Load on explicit request (observer patterns)
199 if task.needs_observer_patterns:
200 return load("references/phase1-implementation/observer_patterns.md") # ON_DEMAND: MutationObserver, IO
201
202 # ALWAYS: Default implementation patterns
203 return load("references/phase1-implementation/implementation_workflows.md")
204
205 # ──────────────────────────────────────────────────────────────────
206 # Phase 1.5: Code Quality Gate (MANDATORY for all code files)
207 # ALWAYS: code_quality_checklist.md
208 # CONDITIONAL: code_style_enforcement.md (if violations found)
209 # JavaScript (.js): Sections 2-7 | CSS (.css): Section 8
210 # ──────────────────────────────────────────────────────────────────
211 if task.phase == "code_quality" or task.implementation_complete:
212 load("assets/checklists/code_quality_checklist.md") # ALWAYS: validation checklist
213 if task.has_violations:
214 load("references/standards/code_style_enforcement.md") # CONDITIONAL: remediation
215 return True # Gate must pass before proceeding
216
217 # ──────────────────────────────────────────────────────────────────
218 # Phase 2: Debugging
219 # ALWAYS: debugging_workflows.md + debugging_checklist.md
220 # ──────────────────────────────────────────────────────────────────
221 if task.phase == "debugging":
222 load("assets/checklists/debugging_checklist.md") # ALWAYS: step-by-step workflow
223 # For DevTools reference, see workflows-chrome-devtools skill
224 return load("references/phase2-debugging/debugging_workflows.md") # ALWAYS: root cause tracing
225
226 # ──────────────────────────────────────────────────────────────────
227 # Phase 3: Verification (MANDATORY)
228 # ALWAYS: verification_workflows.md + verification_checklist.md
229 # ──────────────────────────────────────────────────────────────────
230 if task.phase == "verification" or task.claiming_complete:
231 load("assets/checklists/verification_checklist.md") # ALWAYS: mandatory steps
232 return load("references/phase3-verification/verification_workflows.md") # ALWAYS: browser testing
233
234 # ──────────────────────────────────────────────────────────────────
235 # Quick Reference
236 # ──────────────────────────────────────────────────────────────────
237 if task.needs_quick_reference:
238 return load("references/standards/quick_reference.md") # one-page cheat sheet
239
240# ──────────────────────────────────────────────────────────────────
241# STATIC RESOURCES (always available, not conditionally loaded)
242# Located in references/standards/ for cross-phase access
243# ──────────────────────────────────────────────────────────────────
244# references/standards/code_quality_standards.md → Cross-phase: Initialization, error handling, validation patterns
245# references/standards/code_style_guide.md → Cross-phase: Naming conventions, formatting, comments
246# references/standards/code_style_enforcement.md → Phase 1.5: Enforcement rules with examples and remediation
247# references/standards/shared_patterns.md → DevTools, logging, testing, error patterns
248# references/phase1-implementation/performance_patterns.md → Phase 1: Performance optimization (ON_DEMAND)
249# references/deployment/minification_guide.md → Safe JS minification with terser, verification pipeline
250# references/deployment/cdn_deployment.md → Cloudflare R2 upload, version management, HTML updates
251# assets/checklists/code_quality_checklist.md → Phase 1.5: Code quality validation checklist
252
253# See "The Iron Law" in Section 1 - Phase 3: Verification
254# See "Code Quality Gate" in Section 3 - Phase 1.5 for style enforcement
255```
256
257---
258
259## 3. 🛠️ HOW IT WORKS
260
261### Development Lifecycle
262
263Frontend development flows through phases with a mandatory quality gate:
264
265```
266Implementation → Code Quality Gate → Debugging (if issues) → Verification (MANDATORY)
267```
268
269### Phase 1: Implementation
270
271**Implementation involves three specialized workflows:**
272
2731. **Condition-Based Waiting** - Replace arbitrary setTimeout with condition polling
274 - Wait for actual conditions, not timeouts
275 - Includes timeout limits with clear errors
276 - Handles: DOM ready, library loading, image/video ready, animations
277
2782. **Defense-in-Depth Validation** - Validate at every layer data passes through
279 - Layer 1: Entry point validation
280 - Layer 2: Processing validation
281 - Layer 3: Output validation
282 - Layer 4: Safe access patterns
283
2843. **CDN Version Management** - Update version parameters after JS changes
285 - Manual version increment workflow (see Section 4)
286 - Updates all HTML files referencing changed JS
287 - Forces browser cache refresh
288
289See [implementation_workflows.md](./references/phase1-implementation/implementation_workflows.md) for complete workflows.
290
291
292### Phase 1.5: Code Quality Gate
293
294**Before claiming implementation is complete, validate code against style standards:**
295
2961. **Identify File Type** - Determine which checklist sections apply:
297 - **JavaScript (`.js`)**: Sections 2-7 (13 P0 items)
298 - **CSS (`.css`)**: Section 8 (4 P0 items)
299 - **Both**: All sections (17 P0 items)
300
3012. **Load Checklist** - Load [code_quality_checklist.md](./assets/checklists/code_quality_checklist.md)
302
3033. **Validate P0 Items** - Check all P0 (blocking) items for the file type:
304
305 **JavaScript P0 Items:**
306 - File header format (three-line with box-drawing characters)
307 - Section organization (IIFE, numbered headers)
308 - No commented-out code
309 - snake_case naming conventions
310 - CDN-safe initialization pattern
311
312 **CSS P0 Items:**
313 - Custom property naming (semantic prefixes: `--font-*`, `--vw-*`, etc.)
314 - Attribute selectors use case-insensitivity flag `i`
315 - BEM naming convention (`.block--element`, `.block-modifier`)
316 - GPU-accelerated animation properties only (`transform`, `opacity`, `scale`)
317
3184. **Validate P1 Items** - Check all P1 (required) items for the file type
319
3205. **Fix or Document** - For any failures:
321 - P0 violations: MUST fix before proceeding
322 - P1 violations: Fix OR document approved deferral
323 - P2 violations: Can defer with documented reason
324
3256. **Only Then** - Proceed to verification or claim completion
326
327**Gate Rule**: If ANY P0 item fails, completion is BLOCKED until fixed.
328
329See [code_style_enforcement.md](./references/standards/code_style_enforcement.md) for remediation instructions.
330
331
332### Phase 2: Debugging
333
334**Systematic Debugging** uses a 4-phase framework:
335
3361. **Root Cause Investigation**
337 - Read error messages carefully
338 - Reproduce consistently
339 - Check recent changes
340 - Gather evidence in DevTools
341 - Trace data flow
342
3432. **Pattern Analysis**
344 - Find working examples
345 - Compare against references
346 - Identify differences
347 - Understand dependencies
348
3493. **Hypothesis and Testing**
350 - Form single hypothesis
351 - Test minimally (one change at a time)
352 - Verify before continuing
353 - Ask when unsure
354
3554. **Implementation**
356 - Document the fix
357 - Implement single fix
358 - Verify in browser
359 - If 3+ fixes failed → question approach
360
361**Root Cause Tracing** traces backward through call chain:
362
3631. Observe symptom
3642. Find immediate cause
3653. Trace one level up
3664. Keep tracing up
3675. Fix at source, not symptom
368
369See [debugging_workflows.md](./references/phase2-debugging/debugging_workflows.md) for complete workflows.
370
371
372### Phase 3: Verification
373
374**The Gate Function** - BEFORE claiming any status:
375
3761. IDENTIFY: What command/action proves this claim?
3772. OPEN: Launch actual browser
3783. TEST: Execute the interaction
3794. VERIFY: Does browser show expected behavior?
3805. VERIFY: Multi-viewport check (mobile + desktop)
3816. VERIFY: Cross-browser check (if critical)
3827. RECORD: Note what you saw
3838. ONLY THEN: Make the claim
384
385**Browser Testing Matrix:**
386
387**Minimum** (ALWAYS REQUIRED):
388- Chrome Desktop (1920px)
389- Mobile emulation (375px)
390- DevTools Console - No errors
391
392**Standard** (Production work):
393- Chrome Desktop (1920px)
394- Chrome Tablet emulation (768px)
395- Chrome Mobile emulation (375px)
396- DevTools console clear at all viewports
397
398See [verification_workflows.md](./references/phase3-verification/verification_workflows.md) for complete requirements.
399
400
401---
402
403## 4. 📋 RULES
404
405### Phase 1: Implementation
406
407#### ✅ ALWAYS
408- Wait for actual conditions, not arbitrary timeouts (include timeout limits)
409- Validate all inputs: function parameters, API responses, DOM elements
410- Sanitize user input before storing or displaying
411- Update CDN versions after JavaScript modifications
412- Use optional chaining (`?.`) and try/catch for safe access
413- Log meaningful success/error messages
414
415#### ❌ NEVER
416- Use `setTimeout` without documenting WHY
417- Assume data exists without checking
418- Trust external data without validation
419- Use innerHTML with unsanitized data
420- Skip CDN version updates after JS changes
421
422#### ⚠️ ESCALATE IF
423- Condition never becomes true (infinite wait)
424- Validation logic becoming too complex
425- Security concerns with XSS or injection attacks
426- Script reports no HTML files found
427- CDN version cannot be determined
428
429See [implementation_workflows.md](./references/phase1-implementation/implementation_workflows.md) for detailed rules.
430
431### Phase 1.5: Code Quality Gate (MANDATORY for all code files)
432
433#### ✅ ALWAYS
434- Load code_quality_checklist.md before claiming implementation complete
435- Identify file type (JavaScript → Sections 2-7, CSS → Section 8)
436- Validate all P0 items for the applicable file type
437- Fix P0 violations before proceeding
438- Document any P1/P2 deferrals with reasons
439- Use code_style_enforcement.md for remediation guidance
440
441#### ❌ NEVER (JavaScript)
442- Skip the quality gate for "simple" changes
443- Claim completion with P0 violations
444- Use commented-out code (delete it)
445- Use camelCase for variables/functions (use snake_case)
446- Skip file headers or section organization
447
448#### ❌ NEVER (CSS)
449- Use generic custom property names without semantic prefixes
450- Omit case-insensitivity flag `i` on data attribute selectors
451- Use inconsistent BEM naming (mix snake_case, camelCase)
452- Animate layout properties (width, height, top, left, padding, margin)
453- Set `will-change` permanently in CSS (set dynamically via JS)
454
455#### ⚠️ ESCALATE IF
456- Cannot fix a P0 violation
457- Standard conflicts with existing code patterns
458- Unclear whether code is compliant
459
460See [code_quality_checklist.md](./assets/checklists/code_quality_checklist.md) and [code_style_enforcement.md](./references/standards/code_style_enforcement.md) for detailed rules.
461
462### Phase 2: Debugging
463
464#### ✅ ALWAYS
465- Open DevTools console BEFORE attempting fixes
466- Read complete error messages and stack traces
467- Test across multiple viewports (375px, 768px, 1920px)
468- Test one change at a time
469- Trace backward from symptom to root cause
470- Document root cause in comments
471
472#### ❌ NEVER
473- Skip console error messages
474- Change multiple things simultaneously
475- Proceed with 4th fix without questioning approach
476- Fix only symptoms without tracing root cause
477- Leave production console.log statements
478
479#### ⚠️ ESCALATE IF
480- Bug only occurs in production
481- Issue requires changing Webflow-generated code
482- Cross-browser compatibility cannot be achieved
483- Bug intermittent despite extensive logging
484- Cannot trace backward (dead end)
485- Root cause in third-party library
486
487See [debugging_workflows.md](./references/phase2-debugging/debugging_workflows.md) for detailed rules.
488
489### Phase 3: Verification (MANDATORY)
490
491#### ✅ ALWAYS
492- Open actual browser to verify (not just code review)
493- Test mobile viewport (375px minimum)
494- Check DevTools console for errors
495- Test interactive elements by clicking them
496- Note what you tested in your claim
497
498#### ❌ NEVER
499- Claim "works" without opening browser
500- Say "should work" or "probably works" - test it
501- Test only at one viewport size
502- Assume desktop testing covers mobile
503- Express satisfaction before verification
504
505#### ⚠️ ESCALATE IF
506- Cannot test in required browsers
507- Real device testing required but unavailable
508- Issue only reproduces in production
509- Performance testing requires specialized tools
510
511See [verification_workflows.md](./references/phase3-verification/verification_workflows.md) for detailed rules.
512
513---
514
515## 5. 🏆 SUCCESS CRITERIA
516
517### Phase 1: Implementation
518
519**Implementation is successful when:**
520- ✅ No arbitrary setTimeout used (or documented why needed)
521- ✅ All inputs validated (parameters, DOM, API responses)
522- ✅ User input sanitized
523- ✅ CDN versions updated after JS changes
524- ✅ Safe defaults provided for missing data
525- ✅ Clear error messages logged
526
527See [implementation_workflows.md](./references/phase1-implementation/implementation_workflows.md) for complete criteria.
528
529### Phase 1.5: Code Quality Gate
530
531**Code Quality Gate passes when:**
532
533**JavaScript (.js):**
534- ✅ All P0 checklist items verified and passing (Sections 2-7)
535- ✅ All P1 checklist items verified or documented deferrals
536- ✅ File headers use correct format (three-line, box-drawing)
537- ✅ Section organization follows standard (IIFE, numbered headers)
538- ✅ No commented-out code present
539- ✅ All naming uses snake_case (not camelCase)
540- ✅ CDN-safe initialization pattern followed
541
542**CSS (.css):**
543- ✅ All P0 checklist items verified and passing (Section 8)
544- ✅ Custom properties use semantic prefixes (`--font-*`, `--vw-*`, etc.)
545- ✅ Attribute selectors include case-insensitivity flag `i`
546- ✅ Class names follow BEM convention (`.block--element`, `.block-modifier`)
547- ✅ Animations use GPU-accelerated properties only (`transform`, `opacity`, `scale`)
548
549See [code_quality_checklist.md](./assets/checklists/code_quality_checklist.md) for complete criteria.
550
551### Phase 2: Debugging
552
553**Debugging is successful when:**
554- ✅ Root cause identified and documented
555- ✅ Fix addresses cause, not symptom
556- ✅ Tested across target browsers and viewports
557- ✅ No console errors introduced
558- ✅ Performance not degraded
559- ✅ Code comments explain WHY fix needed
560
561See [debugging_workflows.md](./references/phase2-debugging/debugging_workflows.md) for complete criteria.
562
563### Phase 3: Verification
564
565**Verification is successful when:**
566- ✅ Opened actual browser (not just reviewed code)
567- ✅ Tested in multiple viewports (mobile + desktop)
568- ✅ Checked DevTools console (no errors)
569- ✅ Tested interactions by actually clicking/hovering
570- ✅ Documented what was tested in claim
571- ✅ Can describe exactly what was seen in browser
572
573See [verification_workflows.md](./references/phase3-verification/verification_workflows.md) for complete criteria.
574
575### Verification Statement Template
576
577See [verification_checklist.md](./assets/checklists/verification_checklist.md) for the completion claim template.
578
579---
580
581## 6. 🔌 INTEGRATION POINTS
582
583### Framework Integration
584
585This skill operates within the behavioral framework defined in [AGENTS.md](../../../AGENTS.md).
586
587Key integrations:
588- **Gate 2**: Skill routing via `skill_advisor.py`
589- **Tool Routing**: Per AGENTS.md Section 6 decision tree
590- **Memory**: Context preserved via Spec Kit Memory MCP
591
592### Code Quality Standards
593
594**Primary References:**
595- [code_quality_standards.md](./references/standards/code_quality_standards.md) - Initialization, error handling, validation, async patterns
596- [code_style_guide.md](./references/standards/code_style_guide.md) - Naming conventions, formatting, comments
597
598See these reference files for complete standards. Key patterns include CDN-safe initialization, snake_case naming, and defense-in-depth validation.
599
600### Tool Usage Guidelines
601
602- **Bash**: Git commands, system operations
603- **Read**: Examine code files, documentation
604- **Grep**: Pattern searches, finding keywords
605- **Glob**: File discovery by patterns
606
607### Additional Knowledge Base Dependencies
608
609- **Code Quality Standards** - Initialization and validation patterns in [code_quality_standards.md](./references/standards/code_quality_standards.md)
610- **Code Style Guide** - Naming conventions and formatting in [code_style_guide.md](./references/standards/code_style_guide.md)
611
612### External Tools
613
614- **Browser DevTools** - Chrome DevTools MCP (automated testing), Chrome DevTools (manual debugging)
615- **Python 3** - General scripting support
616- **Git** - Version control for checking changes
617- **Motion.dev** - Animation library (CDN: jsdelivr.net/npm/motion@12.15.0)
618- **mcp-narsil** - Security scanning during debugging (OWASP, CWE, taint analysis via Code Mode)
619
620### Browser Verification
621
622For browser debugging and verification, use the **workflows-chrome-devtools** skill which provides:
623- CLI-first approach via `browser-debugger-cli` (bdg)
624- MCP fallback for multi-tool workflows
625- Complete DevTools integration (644 methods across 53 domains)
626
627**See:** `.opencode/skill/workflows-chrome-devtools/SKILL.md` for complete reference.
628
629### Quality Review Integration
630
631> **Note:** Review quality manually after file modifications.
632
633**Manual quality review steps:**
634- Review recent file changes for quality issues
635- Check for consistent patterns across modifications
636- Use as inputs to Phase 1 investigation during debugging
637
638See [shared_patterns.md](./references/standards/shared_patterns.md) for common patterns across all workflows.
639
640---
641
642## 7. 📚 EXTERNAL RESOURCES
643
644### Official Documentation
645
646| Resource | URL | Use For |
647| ------------------ | --------------------------- | ------------------------- |
648| MDN Web Docs | developer.mozilla.org | JavaScript, DOM, Web APIs |
649| Webflow University | university.webflow.com | Webflow platform patterns |
650| Motion.dev | motion.dev/docs | Animation library |
651| HLS.js | github.com/video-dev/hls.js | Video streaming |
652| Lenis | lenis.darkroom.engineering | Smooth scroll |
653
654### Testing & Debugging
655
656| Resource | URL | Use For |
657| --------------- | ---------------------------------- | --------------------- |
658| Chrome DevTools | developer.chrome.com/docs/devtools | Browser debugging |
659| Can I Use | caniuse.com | Browser compatibility |
660
661---
662
663## 8. 🔗 RELATED RESOURCES
664
665### Related Skills
666
667| Skill | Use For |
668| ----------------------------- | ----------------------------------------------------------- |
669| **workflows-documentation** | Documentation quality, skill creation, markdown validation |
670| **workflows-git** | Git workflows, commit hygiene, PR creation |
671| **system-spec-kit** | Spec folder management, memory system, context preservation |
672| **mcp-narsil** | Code intelligence, security scanning, call graphs |
673| **workflows-chrome-devtools** | Browser debugging, screenshots, console access |
674
675### Navigation Guide
676
677**For Implementation Tasks:**
6781. Start with Section 1 (When to Use) to confirm this skill applies
6792. Follow Implementation phase from Section 3 (How It Works)
6803. Load ALWAYS/CONDITIONAL resources from `references/phase1-implementation/`
681
682**For Debugging Tasks:**
6831. Load [debugging_checklist.md](./assets/checklists/debugging_checklist.md)
6842. Follow systematic debugging workflow in Section 3
6853. Use workflows-chrome-devtools skill for DevTools reference
686
687**For Verification Tasks:**
6881. Load [verification_checklist.md](./assets/checklists/verification_checklist.md)
6892. Complete all applicable checks
6903. Only claim "done" when checklist passes
691
692---
693
694## 9. 📍 WHERE AM I? (Phase Detection Helper)
695
696If you're unsure which phase you're in:
697
698### Phase 1: Implementation
699**You're here if:** Writing/modifying code, not yet testing
700**Exit criteria:** Code written, builds successfully
701
702### Phase 2: Debugging
703**You're here if:** Code written but has bugs/failing tests
704**Exit criteria:** All tests passing, feature functional
705
706### Phase 3: Verification
707**You're here if:** Tests pass, performing final validation
708**Exit criteria:** Verified in browser, ready to ship
709
710### Phase Transitions
711
712- **Phase 1 → 2:** Implementation reveals bugs → Switch to debugging
713- **Phase 2 → 1:** Debugging reveals missing code → Return to implementation
714- **Phase 2 → 3:** All bugs fixed → Proceed to verification
715- **Phase 3 → 1/2:** Verification reveals issues → Return to appropriate phase
716
717**Key principle:** Always end with Phase 3 before claiming completion.