heraspec 0.1.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 (47) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +57 -0
  3. package/bin/heraspec.js +3803 -0
  4. package/bin/heraspec.js.map +7 -0
  5. package/dist/core/templates/skills/CHANGELOG.md +117 -0
  6. package/dist/core/templates/skills/README-template.md +58 -0
  7. package/dist/core/templates/skills/README.md +36 -0
  8. package/dist/core/templates/skills/content-optimization-skill.md +104 -0
  9. package/dist/core/templates/skills/data/charts.csv +26 -0
  10. package/dist/core/templates/skills/data/colors.csv +97 -0
  11. package/dist/core/templates/skills/data/landing.csv +31 -0
  12. package/dist/core/templates/skills/data/pages-proposed.csv +22 -0
  13. package/dist/core/templates/skills/data/pages.csv +10 -0
  14. package/dist/core/templates/skills/data/products.csv +97 -0
  15. package/dist/core/templates/skills/data/prompts.csv +24 -0
  16. package/dist/core/templates/skills/data/stacks/flutter.csv +53 -0
  17. package/dist/core/templates/skills/data/stacks/html-tailwind.csv +56 -0
  18. package/dist/core/templates/skills/data/stacks/nextjs.csv +53 -0
  19. package/dist/core/templates/skills/data/stacks/react-native.csv +52 -0
  20. package/dist/core/templates/skills/data/stacks/react.csv +54 -0
  21. package/dist/core/templates/skills/data/stacks/svelte.csv +54 -0
  22. package/dist/core/templates/skills/data/stacks/swiftui.csv +51 -0
  23. package/dist/core/templates/skills/data/stacks/vue.csv +50 -0
  24. package/dist/core/templates/skills/data/styles.csv +59 -0
  25. package/dist/core/templates/skills/data/typography.csv +58 -0
  26. package/dist/core/templates/skills/data/ux-guidelines.csv +100 -0
  27. package/dist/core/templates/skills/documents-skill.md +114 -0
  28. package/dist/core/templates/skills/e2e-test-skill.md +119 -0
  29. package/dist/core/templates/skills/integration-test-skill.md +118 -0
  30. package/dist/core/templates/skills/module-codebase-skill.md +110 -0
  31. package/dist/core/templates/skills/scripts/CODE_EXPLANATION.md +394 -0
  32. package/dist/core/templates/skills/scripts/SEARCH_ALGORITHMS_COMPARISON.md +421 -0
  33. package/dist/core/templates/skills/scripts/SEARCH_MODES_GUIDE.md +238 -0
  34. package/dist/core/templates/skills/scripts/core.py +385 -0
  35. package/dist/core/templates/skills/scripts/search.py +73 -0
  36. package/dist/core/templates/skills/suggestion-skill.md +118 -0
  37. package/dist/core/templates/skills/templates/accessibility-checklist.md +40 -0
  38. package/dist/core/templates/skills/templates/example-prompt-full-theme.md +333 -0
  39. package/dist/core/templates/skills/templates/page-types-guide.md +338 -0
  40. package/dist/core/templates/skills/templates/pages-proposed-summary.md +273 -0
  41. package/dist/core/templates/skills/templates/pre-delivery-checklist.md +42 -0
  42. package/dist/core/templates/skills/templates/prompt-template-full-theme.md +313 -0
  43. package/dist/core/templates/skills/templates/responsive-design.md +40 -0
  44. package/dist/core/templates/skills/ui-ux-skill.md +584 -0
  45. package/dist/core/templates/skills/unit-test-skill.md +111 -0
  46. package/dist/index.js +1736 -0
  47. package/package.json +71 -0
@@ -0,0 +1,100 @@
1
+ No,Category,Issue,Platform,Description,Do,Don't,Code Example Good,Code Example Bad,Severity
2
+ 1,Navigation,Smooth Scroll,Web,Anchor links should scroll smoothly to target section,Use scroll-behavior: smooth on html element,Jump directly without transition,html { scroll-behavior: smooth; },<a href='#section'> without CSS,High
3
+ 2,Navigation,Sticky Navigation,Web,Fixed nav should not obscure content,Add padding-top to body equal to nav height,Let nav overlap first section content,pt-20 (if nav is h-20),No padding compensation,Medium
4
+ 3,Navigation,Active State,All,Current page/section should be visually indicated,Highlight active nav item with color/underline,No visual feedback on current location,text-primary border-b-2,All links same style,Medium
5
+ 4,Navigation,Back Button,Mobile,Users expect back to work predictably,Preserve navigation history properly,Break browser/app back button behavior,history.pushState(),location.replace(),High
6
+ 5,Navigation,Deep Linking,All,URLs should reflect current state for sharing,Update URL on state/view changes,Static URLs for dynamic content,Use query params or hash,Single URL for all states,Medium
7
+ 6,Navigation,Breadcrumbs,Web,Show user location in site hierarchy,Use for sites with 3+ levels of depth,Use for flat single-level sites,Home > Category > Product,Only on deep nested pages,Low
8
+ 7,Animation,Excessive Motion,All,Too many animations cause distraction and motion sickness,Animate 1-2 key elements per view maximum,Animate everything that moves,Single hero animation,animate-bounce on 5+ elements,High
9
+ 8,Animation,Duration Timing,All,Animations should feel responsive not sluggish,Use 150-300ms for micro-interactions,Use animations longer than 500ms for UI,transition-all duration-200,duration-1000,Medium
10
+ 9,Animation,Reduced Motion,All,Respect user's motion preferences,Check prefers-reduced-motion media query,Ignore accessibility motion settings,@media (prefers-reduced-motion: reduce),No motion query check,High
11
+ 10,Animation,Loading States,All,Show feedback during async operations,Use skeleton screens or spinners,Leave UI frozen with no feedback,animate-pulse skeleton,Blank screen while loading,High
12
+ 11,Animation,Hover vs Tap,All,Hover effects don't work on touch devices,Use click/tap for primary interactions,Rely only on hover for important actions,onClick handler,onMouseEnter only,High
13
+ 12,Animation,Continuous Animation,All,Infinite animations are distracting,Use for loading indicators only,Use for decorative elements,animate-spin on loader,animate-bounce on icons,Medium
14
+ 13,Animation,Transform Performance,Web,Some CSS properties trigger expensive repaints,Use transform and opacity for animations,Animate width/height/top/left properties,transform: translateY(),top: 10px animation,Medium
15
+ 14,Animation,Easing Functions,All,Linear motion feels robotic,Use ease-out for entering ease-in for exiting,Use linear for UI transitions,ease-out,linear,Low
16
+ 15,Layout,Z-Index Management,Web,Stacking context conflicts cause hidden elements,Define z-index scale system (10 20 30 50),Use arbitrary large z-index values,z-10 z-20 z-50,z-[9999],High
17
+ 16,Layout,Overflow Hidden,Web,Hidden overflow can clip important content,Test all content fits within containers,Blindly apply overflow-hidden,overflow-auto with scroll,overflow-hidden truncating content,Medium
18
+ 17,Layout,Fixed Positioning,Web,Fixed elements can overlap or be inaccessible,Account for safe areas and other fixed elements,Stack multiple fixed elements carelessly,Fixed nav + fixed bottom with gap,Multiple overlapping fixed elements,Medium
19
+ 18,Layout,Stacking Context,Web,New stacking contexts reset z-index,Understand what creates new stacking context,Expect z-index to work across contexts,Parent with z-index isolates children,z-index: 9999 not working,Medium
20
+ 19,Layout,Content Jumping,Web,Layout shift when content loads is jarring,Reserve space for async content,Let images/content push layout around,aspect-ratio or fixed height,No dimensions on images,High
21
+ 20,Layout,Viewport Units,Web,100vh can be problematic on mobile browsers,Use dvh or account for mobile browser chrome,Use 100vh for full-screen mobile layouts,min-h-dvh or min-h-screen,h-screen on mobile,Medium
22
+ 21,Layout,Container Width,Web,Content too wide is hard to read,Limit max-width for text content (65-75ch),Let text span full viewport width,max-w-prose or max-w-3xl,Full width paragraphs,Medium
23
+ 22,Touch,Touch Target Size,Mobile,Small buttons are hard to tap accurately,Minimum 44x44px touch targets,Tiny clickable areas,min-h-[44px] min-w-[44px],w-6 h-6 buttons,High
24
+ 23,Touch,Touch Spacing,Mobile,Adjacent touch targets need adequate spacing,Minimum 8px gap between touch targets,Tightly packed clickable elements,gap-2 between buttons,gap-0 or gap-1,Medium
25
+ 24,Touch,Gesture Conflicts,Mobile,Custom gestures can conflict with system,Avoid horizontal swipe on main content,Override system gestures,Vertical scroll primary,Horizontal swipe carousel only,Medium
26
+ 25,Touch,Tap Delay,Mobile,300ms tap delay feels laggy,Use touch-action CSS or fastclick,Default mobile tap handling,touch-action: manipulation,No touch optimization,Medium
27
+ 26,Touch,Pull to Refresh,Mobile,Accidental refresh is frustrating,Disable where not needed,Enable by default everywhere,overscroll-behavior: contain,Default overscroll,Low
28
+ 27,Touch,Haptic Feedback,Mobile,Tactile feedback improves interaction feel,Use for confirmations and important actions,Overuse vibration feedback,navigator.vibrate(10),Vibrate on every tap,Low
29
+ 28,Interaction,Focus States,All,Keyboard users need visible focus indicators,Use visible focus rings on interactive elements,Remove focus outline without replacement,focus:ring-2 focus:ring-blue-500,outline-none without alternative,High
30
+ 29,Interaction,Hover States,Web,Visual feedback on interactive elements,Change cursor and add subtle visual change,No hover feedback on clickable elements,hover:bg-gray-100 cursor-pointer,No hover style,Medium
31
+ 30,Interaction,Active States,All,Show immediate feedback on press/click,Add pressed/active state visual change,No feedback during interaction,active:scale-95,No active state,Medium
32
+ 31,Interaction,Disabled States,All,Clearly indicate non-interactive elements,Reduce opacity and change cursor,Confuse disabled with normal state,opacity-50 cursor-not-allowed,Same style as enabled,Medium
33
+ 32,Interaction,Loading Buttons,All,Prevent double submission during async actions,Disable button and show loading state,Allow multiple clicks during processing,disabled={loading} spinner,Button clickable while loading,High
34
+ 33,Interaction,Error Feedback,All,Users need to know when something fails,Show clear error messages near problem,Silent failures with no feedback,Red border + error message,No indication of error,High
35
+ 34,Interaction,Success Feedback,All,Confirm successful actions to users,Show success message or visual change,No confirmation of completed action,Toast notification or checkmark,Action completes silently,Medium
36
+ 35,Interaction,Confirmation Dialogs,All,Prevent accidental destructive actions,Confirm before delete/irreversible actions,Delete without confirmation,Are you sure modal,Direct delete on click,High
37
+ 36,Accessibility,Color Contrast,All,Text must be readable against background,Minimum 4.5:1 ratio for normal text,Low contrast text,#333 on white (7:1),#999 on white (2.8:1),High
38
+ 37,Accessibility,Color Only,All,Don't convey information by color alone,Use icons/text in addition to color,Red/green only for error/success,Red text + error icon,Red border only for error,High
39
+ 38,Accessibility,Alt Text,All,Images need text alternatives,Descriptive alt text for meaningful images,Empty or missing alt attributes,alt='Dog playing in park',alt='' for content images,High
40
+ 39,Accessibility,Heading Hierarchy,Web,Screen readers use headings for navigation,Use sequential heading levels h1-h6,Skip heading levels or misuse for styling,h1 then h2 then h3,h1 then h4,Medium
41
+ 40,Accessibility,ARIA Labels,All,Interactive elements need accessible names,Add aria-label for icon-only buttons,Icon buttons without labels,aria-label='Close menu',<button><Icon/></button>,High
42
+ 41,Accessibility,Keyboard Navigation,Web,All functionality accessible via keyboard,Tab order matches visual order,Keyboard traps or illogical tab order,tabIndex for custom order,Unreachable elements,High
43
+ 42,Accessibility,Screen Reader,All,Content should make sense when read aloud,Use semantic HTML and ARIA properly,Div soup with no semantics,<nav> <main> <article>,<div> for everything,Medium
44
+ 43,Accessibility,Form Labels,All,Inputs must have associated labels,Use label with for attribute or wrap input,Placeholder-only inputs,<label for='email'>,placeholder='Email' only,High
45
+ 44,Accessibility,Error Messages,All,Error messages must be announced,Use aria-live or role=alert for errors,Visual-only error indication,role='alert',Red border only,High
46
+ 45,Accessibility,Skip Links,Web,Allow keyboard users to skip navigation,Provide skip to main content link,No skip link on nav-heavy pages,Skip to main content link,100 tabs to reach content,Medium
47
+ 46,Performance,Image Optimization,All,Large images slow page load,Use appropriate size and format (WebP),Unoptimized full-size images,srcset with multiple sizes,4000px image for 400px display,High
48
+ 47,Performance,Lazy Loading,All,Load content as needed,Lazy load below-fold images and content,Load everything upfront,loading='lazy',All images eager load,Medium
49
+ 48,Performance,Code Splitting,Web,Large bundles slow initial load,Split code by route/feature,Single large bundle,dynamic import(),All code in main bundle,Medium
50
+ 49,Performance,Caching,Web,Repeat visits should be fast,Set appropriate cache headers,No caching strategy,Cache-Control headers,Every request hits server,Medium
51
+ 50,Performance,Font Loading,Web,Web fonts can block rendering,Use font-display swap or optional,Invisible text during font load,font-display: swap,FOIT (Flash of Invisible Text),Medium
52
+ 51,Performance,Third Party Scripts,Web,External scripts can block rendering,Load non-critical scripts async/defer,Synchronous third-party scripts,async or defer attribute,<script src='...'> in head,Medium
53
+ 52,Performance,Bundle Size,Web,Large JavaScript slows interaction,Monitor and minimize bundle size,Ignore bundle size growth,Bundle analyzer,No size monitoring,Medium
54
+ 53,Performance,Render Blocking,Web,CSS/JS can block first paint,Inline critical CSS defer non-critical,Large blocking CSS files,Critical CSS inline,All CSS in head,Medium
55
+ 54,Forms,Input Labels,All,Every input needs a visible label,Always show label above or beside input,Placeholder as only label,<label>Email</label><input>,placeholder='Email' only,High
56
+ 55,Forms,Error Placement,All,Errors should appear near the problem,Show error below related input,Single error message at top of form,Error under each field,All errors at form top,Medium
57
+ 56,Forms,Inline Validation,All,Validate as user types or on blur,Validate on blur for most fields,Validate only on submit,onBlur validation,Submit-only validation,Medium
58
+ 57,Forms,Input Types,All,Use appropriate input types,Use email tel number url etc,Text input for everything,type='email',type='text' for email,Medium
59
+ 58,Forms,Autofill Support,Web,Help browsers autofill correctly,Use autocomplete attribute properly,Block or ignore autofill,autocomplete='email',autocomplete='off' everywhere,Medium
60
+ 59,Forms,Required Indicators,All,Mark required fields clearly,Use asterisk or (required) text,No indication of required fields,* required indicator,Guess which are required,Medium
61
+ 60,Forms,Password Visibility,All,Let users see password while typing,Toggle to show/hide password,No visibility toggle,Show/hide password button,Password always hidden,Medium
62
+ 61,Forms,Submit Feedback,All,Confirm form submission status,Show loading then success/error state,No feedback after submit,Loading -> Success message,Button click with no response,High
63
+ 62,Forms,Input Affordance,All,Inputs should look interactive,Use distinct input styling,Inputs that look like plain text,Border/background on inputs,Borderless inputs,Medium
64
+ 63,Forms,Mobile Keyboards,Mobile,Show appropriate keyboard for input type,Use inputmode attribute,Default keyboard for all inputs,inputmode='numeric',Text keyboard for numbers,Medium
65
+ 64,Responsive,Mobile First,Web,Design for mobile then enhance for larger,Start with mobile styles then add breakpoints,Desktop-first causing mobile issues,Default mobile + md: lg: xl:,Desktop default + max-width queries,Medium
66
+ 65,Responsive,Breakpoint Testing,Web,Test at all common screen sizes,Test at 320 375 414 768 1024 1440,Only test on your device,Multiple device testing,Single device development,Medium
67
+ 66,Responsive,Touch Friendly,Web,Mobile layouts need touch-sized targets,Increase touch targets on mobile,Same tiny buttons on mobile,Larger buttons on mobile,Desktop-sized targets on mobile,High
68
+ 67,Responsive,Readable Font Size,All,Text must be readable on all devices,Minimum 16px body text on mobile,Tiny text on mobile,text-base or larger,text-xs for body text,High
69
+ 68,Responsive,Viewport Meta,Web,Set viewport for mobile devices,Use width=device-width initial-scale=1,Missing or incorrect viewport,<meta name='viewport'...>,No viewport meta tag,High
70
+ 69,Responsive,Horizontal Scroll,Web,Avoid horizontal scrolling,Ensure content fits viewport width,Content wider than viewport,max-w-full overflow-x-hidden,Horizontal scrollbar on mobile,High
71
+ 70,Responsive,Image Scaling,Web,Images should scale with container,Use max-width: 100% on images,Fixed width images overflow,max-w-full h-auto,width='800' fixed,Medium
72
+ 71,Responsive,Table Handling,Web,Tables can overflow on mobile,Use horizontal scroll or card layout,Wide tables breaking layout,overflow-x-auto wrapper,Table overflows viewport,Medium
73
+ 72,Typography,Line Height,All,Adequate line height improves readability,Use 1.5-1.75 for body text,Cramped or excessive line height,leading-relaxed (1.625),leading-none (1),Medium
74
+ 73,Typography,Line Length,Web,Long lines are hard to read,Limit to 65-75 characters per line,Full-width text on large screens,max-w-prose,Full viewport width text,Medium
75
+ 74,Typography,Font Size Scale,All,Consistent type hierarchy aids scanning,Use consistent modular scale,Random font sizes,Type scale (12 14 16 18 24 32),Arbitrary sizes,Medium
76
+ 75,Typography,Font Loading,Web,Fonts should load without layout shift,Reserve space with fallback font,Layout shift when fonts load,font-display: swap + similar fallback,No fallback font,Medium
77
+ 76,Typography,Contrast Readability,All,Body text needs good contrast,Use darker text on light backgrounds,Gray text on gray background,text-gray-900 on white,text-gray-400 on gray-100,High
78
+ 77,Typography,Heading Clarity,All,Headings should stand out from body,Clear size/weight difference,Headings similar to body text,Bold + larger size,Same size as body,Medium
79
+ 78,Feedback,Loading Indicators,All,Show system status during waits,Show spinner/skeleton for operations > 300ms,No feedback during loading,Skeleton or spinner,Frozen UI,High
80
+ 79,Feedback,Empty States,All,Guide users when no content exists,Show helpful message and action,Blank empty screens,No items yet. Create one!,Empty white space,Medium
81
+ 80,Feedback,Error Recovery,All,Help users recover from errors,Provide clear next steps,Error without recovery path,Try again button + help link,Error message only,Medium
82
+ 81,Feedback,Progress Indicators,All,Show progress for multi-step processes,Step indicators or progress bar,No indication of progress,Step 2 of 4 indicator,No step information,Medium
83
+ 82,Feedback,Toast Notifications,All,Transient messages for non-critical info,Auto-dismiss after 3-5 seconds,Toasts that never disappear,Auto-dismiss toast,Persistent toast,Medium
84
+ 83,Feedback,Confirmation Messages,All,Confirm successful actions,Brief success message,Silent success,Saved successfully toast,No confirmation,Medium
85
+ 84,Content,Truncation,All,Handle long content gracefully,Truncate with ellipsis and expand option,Overflow or broken layout,line-clamp-2 with expand,Overflow or cut off,Medium
86
+ 85,Content,Date Formatting,All,Use locale-appropriate date formats,Use relative or locale-aware dates,Ambiguous date formats,2 hours ago or locale format,01/02/03,Low
87
+ 86,Content,Number Formatting,All,Format large numbers for readability,Use thousand separators or abbreviations,Long unformatted numbers,"1.2K or 1,234",1234567,Low
88
+ 87,Content,Placeholder Content,All,Show realistic placeholders during dev,Use realistic sample data,Lorem ipsum everywhere,Real sample content,Lorem ipsum,Low
89
+ 88,Onboarding,User Freedom,All,Users should be able to skip tutorials,Provide Skip and Back buttons,Force linear unskippable tour,Skip Tutorial button,Locked overlay until finished,Medium
90
+ 89,Search,Autocomplete,Web,Help users find results faster,Show predictions as user types,Require full type and enter,Debounced fetch + dropdown,No suggestions,Medium
91
+ 90,Search,No Results,Web,Dead ends frustrate users,Show 'No results' with suggestions,Blank screen or '0 results',Try searching for X instead,No results found.,Medium
92
+ 91,Data Entry,Bulk Actions,Web,Editing one by one is tedious,Allow multi-select and bulk edit,Single row actions only,Checkbox column + Action bar,Repeated actions per row,Low
93
+ 92,AI Interaction,Disclaimer,All,Users need to know they talk to AI,Clearly label AI generated content,Present AI as human,AI Assistant label,Fake human name without label,High
94
+ 93,AI Interaction,Streaming,All,Waiting for full text is slow,Stream text response token by token,Show loading spinner for 10s+,Typewriter effect,Spinner until 100% complete,Medium
95
+ 94,Spatial UI,Gaze Hover,VisionOS,Elements should respond to eye tracking before pinch,Scale/highlight element on look,Static element until pinch,hoverEffect(),onTap only,High
96
+ 95,Spatial UI,Depth Layering,VisionOS,UI needs Z-depth to separate content from environment,Use glass material and z-offset,Flat opaque panels blocking view,.glassBackgroundEffect(),bg-white,Medium
97
+ 96,Sustainability,Auto-Play Video,Web,Video consumes massive data and energy,Click-to-play or pause when off-screen,Auto-play high-res video loops,playsInline muted preload='none',autoplay loop,Medium
98
+ 97,Sustainability,Asset Weight,Web,Heavy 3D/Image assets increase carbon footprint,Compress and lazy load 3D models,Load 50MB textures,Draco compression,Raw .obj files,Medium
99
+ 98,AI Interaction,Feedback Loop,All,AI needs user feedback to improve,Thumps up/down or 'Regenerate',Static output only,Feedback component,Read-only text,Low
100
+ 99,Accessibility,Motion Sensitivity,All,Parallax/Scroll-jacking causes nausea,Respect prefers-reduced-motion,Force scroll effects,@media (prefers-reduced-motion),ScrollTrigger.create(),High
@@ -0,0 +1,114 @@
1
+ # Skill: Documents (Cross-Cutting)
2
+
3
+ ## Purpose
4
+
5
+ This skill is used to create documentation for both technical and end-user audiences. Ensures documentation is complete, clear, and easy to understand.
6
+
7
+ ## When to Use
8
+
9
+ - When creating technical documentation
10
+ - When writing user guides
11
+ - When documenting APIs
12
+ - When creating changelogs
13
+ - When writing installation/setup guides
14
+
15
+ ## Step-by-Step Process
16
+
17
+ ### Step 1: Identify Document Type
18
+ - Technical docs: For developers
19
+ - User guide: For end-users
20
+ - API docs: For API consumers
21
+ - Changelog: For version releases
22
+
23
+ ### Step 2: Choose Appropriate Template
24
+ - Technical: `templates/technical-doc-template.md`
25
+ - User guide: `templates/user-guide-template.md`
26
+ - API: `templates/api-doc-template.md`
27
+ - Changelog: `templates/changelog-template.md`
28
+
29
+ ### Step 3: Gather Information
30
+ - Features and functionality
31
+ - Installation steps
32
+ - Configuration options
33
+ - Usage examples
34
+ - Troubleshooting tips
35
+
36
+ ### Step 4: Write Documentation
37
+ - Follow template structure
38
+ - Use good examples as reference
39
+ - Ensure code examples work
40
+ - Include screenshots if needed
41
+
42
+ ### Step 5: Validate & Generate
43
+ - Run script: `scripts/validate-docs.py`
44
+ - Run script: `scripts/generate-docs.sh` (if available)
45
+ - Review with good examples
46
+ - Test with target audience
47
+
48
+ ## Required Input
49
+
50
+ - **Document type**: Technical, user guide, API, changelog
51
+ - **Target audience**: Developers, end-users, admins
52
+ - **Features to document**: List of features to document
53
+ - **Code examples**: Code samples to include
54
+ - **Screenshots**: Images if needed
55
+
56
+ ## Expected Output
57
+
58
+ - Complete documentation file
59
+ - Proper formatting and structure
60
+ - Working code examples
61
+ - Clear instructions
62
+ - Troubleshooting section
63
+
64
+ ## Tone & Rules
65
+
66
+ ### Writing Style
67
+ - **Clear**: Write clearly, easy to understand
68
+ - **Concise**: Brief, not verbose
69
+ - **Actionable**: Can be followed
70
+ - **Complete**: Complete necessary information
71
+
72
+ ### Technical Docs
73
+ - Code examples must work
74
+ - Include prerequisites
75
+ - Explain "why" not just "what"
76
+ - Link to related docs
77
+
78
+ ### User Guides
79
+ - Step-by-step instructions
80
+ - Screenshots for complex steps
81
+ - Common issues and solutions
82
+ - Plain language (avoid jargon)
83
+
84
+ ### Limitations
85
+ - ❌ DO NOT skip prerequisites
86
+ - ❌ DO NOT assume prior knowledge
87
+ - ❌ DO NOT use untested code examples
88
+ - ❌ DO NOT write too technical for user guides
89
+ - ❌ DO NOT skip troubleshooting
90
+
91
+ ## Available Templates
92
+
93
+ - `templates/technical-doc-template.md` - Technical documentation
94
+ - `templates/user-guide-template.md` - User guide
95
+ - `templates/api-doc-template.md` - API documentation
96
+ - `templates/changelog-template.md` - Changelog template
97
+
98
+ ## Available Scripts
99
+
100
+ - `scripts/generate-docs.sh` - Automatically generate docs from code
101
+ - `scripts/validate-docs.py` - Validate format and completeness
102
+
103
+ ## Examples
104
+
105
+ See `examples/` directory for reference:
106
+ - `good-technical-doc.md` - Good technical doc example
107
+ - `good-user-guide.md` - Good user guide example
108
+ - `good-api-doc.md` - Good API doc example
109
+
110
+ ## Links to Other Skills
111
+
112
+ - **module-codebase**: Document module structure
113
+ - **ui-ux**: Document UI components and design system
114
+ - **content-optimization**: Optimize documentation for clarity
@@ -0,0 +1,119 @@
1
+ # Skill: End-to-End (E2E) Testing (Cross-Cutting)
2
+
3
+ ## Purpose
4
+
5
+ This skill is used to create end-to-end tests that verify complete user workflows from start to finish. E2E tests simulate real user interactions with the application.
6
+
7
+ ## When to Use
8
+
9
+ - When testing complete user workflows
10
+ - When testing critical user journeys
11
+ - When testing UI interactions
12
+ - When verifying application behavior from user perspective
13
+ - When testing authentication flows
14
+ - When testing payment/transaction flows
15
+
16
+ ## Step-by-Step Process
17
+
18
+ ### Step 1: Identify User Journeys
19
+ - Map critical user workflows
20
+ - Identify key user scenarios
21
+ - List user personas and their goals
22
+ - Determine test priorities (critical paths first)
23
+ - Document expected user behavior
24
+
25
+ ### Step 2: Set Up E2E Testing Framework
26
+ - Choose E2E testing tool (Playwright, Cypress, Selenium, etc.)
27
+ - Configure test environment
28
+ - Set up test browser/headless mode
29
+ - Configure test data and user accounts
30
+ - Set up test application instance
31
+
32
+ ### Step 3: Write E2E Tests
33
+ - Create test files for each user journey
34
+ - Write tests simulating user actions (click, type, navigate)
35
+ - Test complete workflows from start to finish
36
+ - Verify UI elements and feedback
37
+ - Test error scenarios and edge cases
38
+ - Use page objects for maintainability
39
+
40
+ ### Step 4: Run and Verify
41
+ - Run E2E tests
42
+ - Verify tests pass consistently
43
+ - Check test execution time
44
+ - Review test failures and flakiness
45
+ - Ensure tests are stable and reliable
46
+
47
+ ### Step 5: Maintain Tests
48
+ - Update tests when UI changes
49
+ - Keep page objects synchronized with UI
50
+ - Document test scenarios
51
+ - Monitor test stability
52
+
53
+ ## Required Input
54
+
55
+ - **User journeys**: List of critical user workflows
56
+ - **Test environment**: Application URL and test environment setup
57
+ - **Test accounts**: User accounts for testing
58
+ - **E2E framework**: Testing framework to use
59
+ - **Browser**: Browser to test in (Chrome, Firefox, etc.)
60
+
61
+ ## Expected Output
62
+
63
+ - E2E test files
64
+ - Test scenarios covering user journeys
65
+ - Page objects for UI elements
66
+ - Passing E2E test suite
67
+ - Documentation of E2E test scenarios
68
+
69
+ ## Tone & Rules
70
+
71
+ ### Test Scope
72
+ - Focus on critical user journeys
73
+ - Test from user perspective
74
+ - Verify complete workflows
75
+ - Test happy paths and error scenarios
76
+
77
+ ### Test Stability
78
+ - Use reliable selectors (data-testid, stable IDs)
79
+ - Add appropriate waits for async operations
80
+ - Handle flaky elements (retries, explicit waits)
81
+ - Keep tests independent and isolated
82
+
83
+ ### Performance
84
+ - E2E tests are slowest (run separately)
85
+ - Use headless mode for CI
86
+ - Parallelize tests when possible
87
+ - Consider test execution time
88
+
89
+ ### Limitations
90
+ - ❌ DO NOT test every UI element (focus on journeys)
91
+ - ❌ DO NOT use brittle selectors (XPath with complex paths)
92
+ - ❌ DO NOT skip error handling
93
+ - ❌ DO NOT write tests that depend on timing
94
+ - ❌ DO NOT test implementation details
95
+
96
+ ## Available Templates
97
+
98
+ - `templates/e2e-test-template.js` - JavaScript/Playwright template
99
+ - `templates/e2e-test-template.ts` - TypeScript/Cypress template
100
+ - `templates/e2e-test-template.py` - Python/Selenium template
101
+
102
+ ## Available Scripts
103
+
104
+ - `scripts/setup-e2e-env.sh` - Set up E2E test environment
105
+ - `scripts/run-e2e-tests.sh` - Run E2E test suite
106
+
107
+ ## Examples
108
+
109
+ See `examples/` directory for reference:
110
+ - `good-e2e-test/` - Well-structured E2E tests
111
+ - `bad-e2e-test/` - Examples to avoid
112
+
113
+ ## Links to Other Skills
114
+
115
+ - **unit-test**: Use for testing individual components
116
+ - **integration-test**: Use for testing component interactions
117
+ - **ui-ux**: Reference when testing UI interactions
118
+ - **documents**: Use to document E2E test strategy
119
+
@@ -0,0 +1,118 @@
1
+ # Skill: Integration Testing (Cross-Cutting)
2
+
3
+ ## Purpose
4
+
5
+ This skill is used to create integration tests that verify how different components work together. Integration tests check interactions between modules, services, databases, and external APIs.
6
+
7
+ ## When to Use
8
+
9
+ - When testing component interactions
10
+ - When testing API endpoints
11
+ - When testing database operations
12
+ - When testing service integrations
13
+ - When verifying data flow between components
14
+ - When testing with real dependencies (not mocks)
15
+
16
+ ## Step-by-Step Process
17
+
18
+ ### Step 1: Identify Integration Points
19
+ - Map component dependencies
20
+ - Identify external services and APIs
21
+ - List database operations
22
+ - Determine integration boundaries
23
+ - Identify critical integration paths
24
+
25
+ ### Step 2: Set Up Test Environment
26
+ - Configure test database
27
+ - Set up test services/mocks for external APIs
28
+ - Configure test environment variables
29
+ - Prepare test data fixtures
30
+ - Set up cleanup procedures
31
+
32
+ ### Step 3: Write Integration Tests
33
+ - Create test files for integration scenarios
34
+ - Test component interactions
35
+ - Test API endpoints with real requests
36
+ - Test database operations
37
+ - Test error handling across components
38
+ - Use test fixtures for consistent data
39
+
40
+ ### Step 4: Run and Verify
41
+ - Run integration tests
42
+ - Verify test isolation (tests don't affect each other)
43
+ - Check test execution time
44
+ - Ensure proper cleanup after tests
45
+ - Verify tests pass consistently
46
+
47
+ ### Step 5: Maintain Tests
48
+ - Update tests when interfaces change
49
+ - Keep test data synchronized
50
+ - Document test scenarios
51
+ - Monitor test execution time
52
+
53
+ ## Required Input
54
+
55
+ - **Components**: List of components to integrate
56
+ - **APIs**: API endpoints to test
57
+ - **Database schema**: Database structure for testing
58
+ - **External services**: External services to mock or use
59
+ - **Test data**: Sample data for testing
60
+
61
+ ## Expected Output
62
+
63
+ - Integration test files
64
+ - Test scenarios covering integration paths
65
+ - Test fixtures and setup code
66
+ - Passing integration test suite
67
+ - Documentation of integration test scenarios
68
+
69
+ ## Tone & Rules
70
+
71
+ ### Test Scope
72
+ - Test real interactions between components
73
+ - Use real databases (test database)
74
+ - Mock external services that can't be controlled
75
+ - Test error propagation across boundaries
76
+
77
+ ### Test Data
78
+ - Use consistent test fixtures
79
+ - Clean up test data after tests
80
+ - Use transactions for database tests when possible
81
+ - Isolate tests to prevent interference
82
+
83
+ ### Performance
84
+ - Integration tests are slower than unit tests
85
+ - Run integration tests separately from unit tests
86
+ - Use test database (not production)
87
+ - Consider test execution time
88
+
89
+ ### Limitations
90
+ - ❌ DO NOT use production database
91
+ - ❌ DO NOT test with real external APIs in CI (use mocks)
92
+ - ❌ DO NOT write tests that depend on test execution order
93
+ - ❌ DO NOT skip cleanup (tests must be isolated)
94
+ - ❌ DO NOT test implementation details
95
+
96
+ ## Available Templates
97
+
98
+ - `templates/integration-test-template.js` - JavaScript integration test template
99
+ - `templates/integration-test-template.php` - PHP integration test template
100
+ - `templates/integration-test-template.py` - Python integration test template
101
+
102
+ ## Available Scripts
103
+
104
+ - `scripts/setup-test-db.sh` - Set up test database
105
+ - `scripts/seed-test-data.sh` - Seed test data
106
+
107
+ ## Examples
108
+
109
+ See `examples/` directory for reference:
110
+ - `good-integration-test/` - Well-structured integration tests
111
+ - `bad-integration-test/` - Examples to avoid
112
+
113
+ ## Links to Other Skills
114
+
115
+ - **unit-test**: Use unit tests before integration tests
116
+ - **e2e-test**: Use for end-to-end user scenarios
117
+ - **documents**: Use to document integration test strategy
118
+
@@ -0,0 +1,110 @@
1
+ # Skill: Module Codebase (Perfex Module)
2
+
3
+ ## Purpose
4
+
5
+ This skill is used to create and manage codebase structure for Perfex CRM modules following Perfex best practices.
6
+
7
+ ## When to Use
8
+
9
+ - When creating a new module for Perfex CRM
10
+ - When refactoring existing module structure
11
+ - When ensuring module follows Perfex conventions
12
+ - When creating standard folder and file structure for module
13
+
14
+ ## Step-by-Step Process
15
+
16
+ ### Step 1: Analyze Requirements
17
+ - Identify main functionality of module
18
+ - Identify required database tables
19
+ - Identify hooks and filters to use
20
+ - Identify permissions to create
21
+
22
+ ### Step 2: Scaffold Structure
23
+ - Run script: `scripts/scaffold-module.sh <module-name>`
24
+ - Script will create standard folder structure:
25
+ - `modules/<module-name>/`
26
+ - `modules/<module-name>/controllers/`
27
+ - `modules/<module-name>/models/`
28
+ - `modules/<module-name>/views/`
29
+ - `modules/<module-name>/language/`
30
+ - `modules/<module-name>/assets/`
31
+ - Copy templates to correct locations
32
+
33
+ ### Step 3: Configure Module
34
+ - Fill information in `module-config.php` (from template)
35
+ - Register module in Perfex system
36
+ - Set up permissions and menu items
37
+
38
+ ### Step 4: Implement Core Logic
39
+ - Create controllers following Perfex structure
40
+ - Create models with Eloquent patterns
41
+ - Implement hooks and filters
42
+ - Create database migrations
43
+
44
+ ### Step 5: Testing & Documentation
45
+ - Test module with Perfex core
46
+ - Write documentation (use documents skill)
47
+ - Create user guide (use documents skill)
48
+
49
+ ## Required Input
50
+
51
+ - **Module name**: Module name (kebab-case, e.g., `category-management`)
52
+ - **Module description**: Module functionality description
53
+ - **Database tables**: List of tables to create
54
+ - **Hooks required**: List of hooks to implement
55
+ - **Permissions**: List of permissions to create
56
+ - **Menu items**: List of menu items to add
57
+
58
+ ## Expected Output
59
+
60
+ - Complete module folder structure
61
+ - Fully configured files
62
+ - Database migrations
63
+ - Module registration code
64
+ - Basic documentation structure
65
+
66
+ ## Tone & Rules
67
+
68
+ ### Code Style
69
+ - Follow PSR-12 coding standards
70
+ - Use camelCase for functions
71
+ - Use PascalCase for classes
72
+ - Comment in English
73
+
74
+ ### Naming Conventions
75
+ - Module folder: `perfex-<module-name>`
76
+ - Class names: `Perfex<ModuleName>`
77
+ - Function names: `perfex_<module_name>_<action>`
78
+ - Database tables: `tbl<ModuleName>`
79
+
80
+ ### Limitations
81
+ - ❌ DO NOT create global functions (except hooks)
82
+ - ❌ DO NOT hardcode database credentials
83
+ - ❌ DO NOT bypass Perfex permission system
84
+ - ❌ DO NOT modify core Perfex files
85
+ - ❌ DO NOT use deprecated Perfex APIs
86
+
87
+ ## Available Templates
88
+
89
+ - `templates/module-structure.php` - Basic module structure
90
+ - `templates/module-config.php` - Module configuration file
91
+ - `templates/module-hooks.php` - Template for hooks
92
+ - `templates/module-migration.php` - Database migration template
93
+
94
+ ## Available Scripts
95
+
96
+ - `scripts/scaffold-module.sh` - Automatically create module structure
97
+
98
+ ## Examples
99
+
100
+ See `examples/` directory for reference:
101
+ - `good-module-structure/` - Example of well-organized module
102
+ - `bad-module-structure/` - Example to avoid
103
+
104
+ ## Links to Other Skills
105
+
106
+ - **documents**: Use to create technical docs and user guide
107
+ - **ui-ux**: Use when module has admin interface
108
+ - **content-optimization**: Use for module marketing pages
109
+ - **module-registration**: Use to register module with Perfex
110
+ - **permission-group**: Use to create permissions for module