ima-claude 2.16.0 → 2.20.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 (41) hide show
  1. package/README.md +16 -1
  2. package/dist/cli.js +9 -1
  3. package/package.json +1 -1
  4. package/plugins/ima-claude/.claude-plugin/plugin.json +2 -2
  5. package/plugins/ima-claude/agents/wp-developer.md +2 -1
  6. package/plugins/ima-claude/hooks/prompt_coach_digest.md +1 -1
  7. package/plugins/ima-claude/skills/agentic-workflows/SKILL.md +133 -0
  8. package/plugins/ima-claude/skills/agentic-workflows/references/phases/deliver.md +181 -0
  9. package/plugins/ima-claude/skills/agentic-workflows/references/phases/draft.md +99 -0
  10. package/plugins/ima-claude/skills/agentic-workflows/references/phases/gather.md +130 -0
  11. package/plugins/ima-claude/skills/agentic-workflows/references/phases/outline.md +106 -0
  12. package/plugins/ima-claude/skills/agentic-workflows/references/phases/review.md +137 -0
  13. package/plugins/ima-claude/skills/agentic-workflows/references/standards/draft-format.md +159 -0
  14. package/plugins/ima-claude/skills/agentic-workflows/references/standards/editorial-standards.md +160 -0
  15. package/plugins/ima-claude/skills/agentic-workflows/references/standards/outline-format.md +110 -0
  16. package/plugins/ima-claude/skills/agentic-workflows/references/templates/avada-construction-guide.md +263 -0
  17. package/plugins/ima-claude/skills/agentic-workflows/references/templates/avada-webinar-example.txt +275 -0
  18. package/plugins/ima-claude/skills/agentic-workflows/references/templates/cta-block-catalog.md +169 -0
  19. package/plugins/ima-claude/skills/agentic-workflows/references/templates/espo-email-preparation.md +241 -0
  20. package/plugins/ima-claude/skills/agentic-workflows/references/templates/webinar-recap-email-espo.html +339 -0
  21. package/plugins/ima-claude/skills/agentic-workflows/references/templates/webinar-reminder-email-espo.html +458 -0
  22. package/plugins/ima-claude/skills/agentic-workflows/references/workflows/editorial/webinar-summary.md +81 -0
  23. package/plugins/ima-claude/skills/design-to-code/SKILL.md +126 -0
  24. package/plugins/ima-claude/skills/design-to-code/references/guardrails.md +46 -0
  25. package/plugins/ima-claude/skills/design-to-code/references/phase-a-design-to-prompt.md +141 -0
  26. package/plugins/ima-claude/skills/design-to-code/references/phase-b-prompt-to-code.md +155 -0
  27. package/plugins/ima-claude/skills/design-to-code/references/prompt-template.md +95 -0
  28. package/plugins/ima-claude/skills/espocrm/SKILL.md +79 -0
  29. package/plugins/ima-claude/skills/espocrm-api/SKILL.md +360 -0
  30. package/plugins/ima-claude/skills/espocrm-api/references/where-operators.md +84 -0
  31. package/plugins/ima-claude/skills/functional-programmer/SKILL.md +15 -0
  32. package/plugins/ima-claude/skills/mcp-atlassian/SKILL.md +94 -14
  33. package/plugins/ima-claude/skills/mcp-atlassian/references/direct-api-attachments.md +115 -0
  34. package/plugins/ima-claude/skills/mcp-atlassian/references/direct-api-auth.md +103 -0
  35. package/plugins/ima-claude/skills/mcp-atlassian/references/direct-api-bulk.md +149 -0
  36. package/plugins/ima-claude/skills/mcp-atlassian/references/direct-api-misc.md +195 -0
  37. package/plugins/ima-claude/skills/mcp-atlassian/references/direct-api-sprints.md +158 -0
  38. package/plugins/ima-claude/skills/prompt-starter/SKILL.md +9 -6
  39. package/plugins/ima-claude/skills/wp-ddev/SKILL.md +264 -0
  40. package/plugins/ima-claude/skills/wp-ddev/references/ddev-commands.md +232 -0
  41. package/plugins/ima-claude/skills/wp-ddev/references/wp-cli-reference.md +406 -0
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: design-to-code
3
+ description: "Convert design screenshots into working WordPress code through a two-phase workflow. Phase A: analyze screenshots + Jira context → detailed implementation prompt. Phase B: execute prompt → PHP/SCSS code via agent delegation. Use when: user provides design screenshots, says 'implement this design,' 'design to code,' 'convert this mockup,' or has screenshots to turn into WordPress code. Also use when user has an existing implementation prompt to execute. Requires opus for orchestration. Delegates to wp-developer for code generation. Always load ima-brand alongside."
4
+ ---
5
+
6
+ # Design to Code
7
+
8
+ Orchestrate the transformation of design screenshots into working WordPress code. Two phases, one skill — produce the implementation prompt (Phase A), then execute it (Phase B).
9
+
10
+ You are the orchestrator. You analyze designs, compose prompts, delegate implementation, and verify results. You do NOT implement directly — you delegate to `ima-claude:wp-developer` agents.
11
+
12
+ ---
13
+
14
+ ## Mode Selection
15
+
16
+ Determine the mode from the user's input:
17
+
18
+ ```
19
+ What did the user provide?
20
+ ├── Screenshots/mockups (no existing prompt)
21
+ │ → Phase A: Design → Prompt
22
+ │ → Read references/phase-a-design-to-prompt.md
23
+
24
+ ├── An existing implementation prompt
25
+ │ → Phase B: Prompt → Code
26
+ │ → Read references/phase-b-prompt-to-code.md
27
+
28
+ └── Screenshots + "implement this" / "full pipeline"
29
+ → Phase A then Phase B in sequence
30
+ → Phase A produces prompt → user reviews → Phase B executes
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Required Skills
36
+
37
+ Always load alongside this skill:
38
+ - **`ima-brand`** — color palette, typography, mixins (needed for both phases)
39
+ - **`ima-bootstrap`** — utility classes, grid system, components
40
+
41
+ Phase B additionally needs:
42
+ - **`php-fp-wordpress`** — WordPress development patterns, security, shortcodes
43
+
44
+ ---
45
+
46
+ ## Phase A: Design → Prompt
47
+
48
+ Transform design screenshots into a detailed, section-by-section implementation prompt. Output: a ~200-300 line prompt file matching the team's established template structure.
49
+
50
+ Before starting, search Qdrant for `design-to-prompt` to recall prior lessons.
51
+
52
+ ### Steps (read `references/phase-a-design-to-prompt.md` for detailed procedures)
53
+
54
+ 1. **GATHER** — Fetch Jira context + receive screenshots + explore codebase (parallel)
55
+ 2. **ANALYZE** — Load brand palette from `ima-brand` (**must complete before COMPOSE**)
56
+ 3. **CROP** — Full view → section detection → detail crops (iterative PIL cropping)
57
+ 4. **EXTRACT** — Per crop: exact text, icons, colors, layout, spacing
58
+ 5. **MAP** — Visual elements → brand variables, components → existing shortcodes
59
+ 6. **COMPOSE** — Write prompt using `references/prompt-template.md` structure
60
+ 7. **VALIDATE** — Re-check each section against its crop for accuracy
61
+
62
+ **Output**: Save prompt to `docs/designs/{ticket}/PROMPT.md` and Serena memory as `{feature-name}-plan`.
63
+
64
+ After Phase A, present the prompt to the user. Stop here unless running full pipeline.
65
+
66
+ ---
67
+
68
+ ## Phase B: Prompt → Code
69
+
70
+ Execute an implementation prompt to produce working WordPress code. Input: a structured prompt (from Phase A or user-provided).
71
+
72
+ Before starting, search Qdrant for `design-to-code` to recall prior lessons.
73
+
74
+ ### Steps (read `references/phase-b-prompt-to-code.md` for detailed procedures)
75
+
76
+ 1. **RESEARCH** — Brand SCSS files + current code + component libraries (parallel explorers)
77
+ 2. **ARCHITECTURE** — New file vs modify, function reuse, component migration decision
78
+ 3. **DECOMPOSE** — Stories by page section; Story 1 = foundation, Stories 2-N = parallel fills, final = polish
79
+ 4. **IMPLEMENT** — Delegate to `ima-claude:wp-developer` per story with precise prompts
80
+ 5. **REVIEW** — Verify copy, colors, element order, asset paths (orchestrator review before visual test)
81
+ 6. **VISUAL-QA** — Compile SASS → screenshot desktop + mobile → compare to design → iterate
82
+
83
+ ---
84
+
85
+ ## Critical Guardrails
86
+
87
+ Read `references/guardrails.md` for the complete set. The top 5 (each learned from a real failure):
88
+
89
+ 1. **Never hardcode colors** — always brand SCSS variables or Bootstrap utilities
90
+ 2. **Always verify asset paths exist** — Glob/grep before referencing; check existing usage patterns
91
+ 3. **Always provide exact copy text** — never let agents paraphrase; include verbatim text in quotes
92
+ 4. **Load brand palette BEFORE composition** — informs every color reference on first pass
93
+ 5. **Check site header/footer first** — don't build custom components that duplicate existing site elements
94
+
95
+ ---
96
+
97
+ ## Agent Delegation Model
98
+
99
+ | Role | Agent | When |
100
+ |---|---|---|
101
+ | Orchestrator | opus (you) | All phases — research, planning, decomposition, delegation, review, surgical fixes |
102
+ | Codebase explorer | `ima-claude:explorer` (haiku) | GATHER/RESEARCH: find existing shortcodes, templates, SCSS files |
103
+ | Implementer | `ima-claude:wp-developer` (sonnet) | IMPLEMENT: write PHP/SCSS with skills: ima-brand, ima-bootstrap, php-fp-wordpress |
104
+ | Reviewer | `ima-claude:reviewer` (sonnet, read-only) | REVIEW: brand compliance + accessibility audit (for larger implementations) |
105
+
106
+ Orchestrator does surgical fixes (<5 lines) directly via Edit tool. Anything larger → delegate to wp-developer.
107
+
108
+ ---
109
+
110
+ ## Qdrant Integration
111
+
112
+ Before each phase, search Qdrant for prior lessons:
113
+ - Phase A: `qdrant_find("design-to-prompt workflow")` — retrieves methodology, cropping techniques, composition decisions
114
+ - Phase B: `qdrant_find("design-to-code implementation")` — retrieves decomposition patterns, delegation templates, QA patterns
115
+
116
+ ---
117
+
118
+ ## Related Skills
119
+
120
+ | Skill | Relationship |
121
+ |---|---|
122
+ | `ima-brand` | Required — color palette, typography, mixins |
123
+ | `ima-bootstrap` | Required — utility classes, grid, components |
124
+ | `php-fp-wordpress` | Required for Phase B — WordPress dev patterns |
125
+ | `task-master` | Optional — for complex multi-page designs needing Epic > Story > Task decomposition |
126
+ | `prompt-starter` | Pattern borrowed — Phase A follows its "builder not executor" philosophy |
@@ -0,0 +1,46 @@
1
+ # Guardrails — Lessons from Real Failures
2
+
3
+ Every rule here was learned from a specific failure during the FNR-2785 implementation. Prevention strategies are included so the same mistakes don't recur.
4
+
5
+ ---
6
+
7
+ ## Color
8
+
9
+ - **Never hardcode hex values** in SCSS or inline styles. Every color must come from `$ima-brand-*` SCSS variables or Bootstrap `.text-*` / `.bg-*` utility classes.
10
+ - **Load the brand palette BEFORE composing the prompt or writing code.** Doing this after means an expensive editing pass to replace color descriptions with variable names.
11
+ - **Decorative category colors are the exception** — colors that serve UI categorization (not brand identity) can use explicit hex values. Example: pink for "Family Medicine" chip icons.
12
+ - **Final check**: `rg '#[0-9a-fA-F]{3,6}' --type php --type scss` should return zero matches in new code.
13
+
14
+ ## Copy
15
+
16
+ - **Always provide exact text in quotes.** "Search our directory of ethics-committed physicians dedicated to honest, patient-first care." — not a paraphrase like "Search our curated network of independent practitioners."
17
+ - **Agents WILL paraphrase** descriptive text unless given the exact copy. This is the most common failure mode.
18
+ - **If text is unclear in the screenshot**, flag it with `[VERIFY: exact text unclear from screenshot]` rather than guessing.
19
+ - **Include ALL text** — headings, subheadings, body copy, button labels, placeholder text, tooltip text. If it's visible in the design, it goes in the prompt.
20
+
21
+ ## Assets
22
+
23
+ - **Verify every asset path exists** before referencing it in code. Use `Glob` or `rg` to find existing usage.
24
+ - **Never assume local file paths.** Logos may be served from CDN, uploads directory, or rendered via a filter. Grep for existing usage patterns (e.g., `ima_ui_footer_logo_url`).
25
+ - **Check the existing icon system** before introducing new icon dependencies. If the site uses Font Awesome, use Font Awesome — don't mix Bootstrap Icons into FA sites.
26
+
27
+ ## Architecture
28
+
29
+ - **Check if site header/footer already provides the element.** Design screenshots show the final composite — the nav bar in the design may BE the standard site header via `get_header()`, not a custom inline nav. Building a custom one creates a duplicate.
30
+ - **Preserve existing backend logic.** Design changes are presentation-layer only. Search logic, API endpoints, pure functions, sorting, pagination — these do NOT change unless explicitly stated.
31
+ - **Bootstrap utility first, custom SCSS only when Bootstrap cannot express the style.** Check the hierarchy: Bootstrap utility → IMA brand mixin → Bootstrap variable override → then custom CSS.
32
+ - **Evaluate component libraries before implementing.** Check ima-forms, ima-ui-components for existing patterns. Decide based on feature support, not preference. Document the decision.
33
+
34
+ ## Spatial Relationships
35
+
36
+ - **Be explicit about element order** in prompts. "Left to right: social icons → logo" — agents don't reliably interpret spatial relationships from screenshots.
37
+ - **Specify flex direction and alignment** when order matters: `d-flex flex-row` vs `flex-row-reverse`.
38
+ - **For stacked layouts**, specify top-to-bottom order explicitly.
39
+
40
+ ## Verification
41
+
42
+ - **Run `php -l` after every PHP change.** Syntax errors caught early prevent cascading debugging.
43
+ - **Recompile SASS before ANY visual testing.** New SCSS imports don't auto-apply. Run `ddev wp ima-scss compile` and verify new classes appear in `bundle.css`.
44
+ - **Screenshot at both desktop and mobile widths.** Desktop (1920px) and mobile (375px) catch different categories of issues.
45
+ - **Grep for hardcoded hex values** as a final check. New code should reference only brand variables.
46
+ - **Verify existing functionality** still works after changes — search, filters, pagination, form submissions.
@@ -0,0 +1,141 @@
1
+ # Phase A: Design → Prompt — Detailed Procedure
2
+
3
+ Transform design screenshots into a structured implementation prompt. This phase requires opus-level judgment for visual analysis, brand mapping, and prompt composition.
4
+
5
+ **Steps**: [1. GATHER](#step-1-gather-parallel) → [2. ANALYZE](#step-2-analyze-brand-palette-loading) → [3. CROP](#step-3-crop-iterative-image-analysis) → [4. EXTRACT](#step-4-extract-per-crop) → [5. MAP](#step-5-map-visual--technical) → [6. COMPOSE](#step-6-compose) → [7. VALIDATE](#step-7-validate)
6
+
7
+ ---
8
+
9
+ ## Step 1: GATHER (Parallel)
10
+
11
+ Run three parallel streams:
12
+
13
+ ### Stream 1: Jira Context
14
+ - Fetch issue via mcp-atlassian (`getJiraIssue`)
15
+ - Extract: summary, description, acceptance criteria, linked issues
16
+ - Read ALL comments — stakeholder requirements often hide in comment threads, not the description
17
+ - Note attachment metadata (screenshot filenames, dimensions)
18
+
19
+ ### Stream 2: Screenshots
20
+ - Receive screenshots from user or download from Jira attachments
21
+ - Save to `docs/designs/{ticket}/` directory
22
+ - Note image dimensions — tall images (>2000px) will need cropping
23
+
24
+ ### Stream 3: Codebase Exploration
25
+ - Dispatch `ima-claude:explorer` agent to map:
26
+ - Current template file and shortcodes
27
+ - Existing helper/render functions (signatures and return types)
28
+ - SCSS file structure (partials, variables, existing page styles)
29
+ - Page template chain (`get_header()` → content → `get_footer()`)
30
+ - Key question: What exists today that the redesign must preserve?
31
+
32
+ ---
33
+
34
+ ## Step 2: ANALYZE (Brand Palette Loading)
35
+
36
+ **This step MUST complete before Step 6 (COMPOSE).** Loading the palette first means every section gets correct brand variable references on the first pass — avoiding an expensive editing pass afterward.
37
+
38
+ - Load `ima-brand` skill for the complete palette
39
+ - Create a working color mapping table:
40
+
41
+ ```
42
+ | Visual Element | Brand Variable | Hex | Bootstrap Utility |
43
+ |---|---|---|---|
44
+ | Dark blue headers | $ima-brand-primary | #00066F | .text-primary |
45
+ | Teal buttons/CTAs | $ima-brand-secondary | #00B8B8 | .text-secondary, .bg-secondary |
46
+ | Gold accents | $ima-brand-gold | #FFCC00 | .text-ima-gold |
47
+ | Light backgrounds | $ima-brand-gray-light | #F2F3F5 | .bg-light |
48
+ ```
49
+
50
+ - Inventory available brand mixins: `@include ima-gradient-bg`, `@include ima-card-white`, `@include ima-button-primary`, etc.
51
+
52
+ ---
53
+
54
+ ## Step 3: CROP (Iterative Image Analysis)
55
+
56
+ Full-image views lose critical detail — text becomes unreadable, subtle elements get missed. Use iterative cropping:
57
+
58
+ ### Pass 1: Full-image overview
59
+ - View each screenshot at full size
60
+ - Identify section boundaries (background changes, whitespace gaps, visual groupings)
61
+ - Identify page states (e.g., landing vs results, empty vs populated)
62
+
63
+ ### Pass 2: Section crops (6-8 per image)
64
+ - Use Python PIL to crop each section:
65
+ ```python
66
+ from PIL import Image
67
+ img = Image.open('screenshot.png')
68
+ # Overlap sections by ~100px to avoid missing content at boundaries
69
+ section = img.crop((0, start_y, width, end_y))
70
+ section.save(f'section-{name}.png')
71
+ ```
72
+ - Name crops descriptively: `hero-section.png`, `search-form.png`, `discover-cards.png`
73
+
74
+ ### Pass 3: Detail crops (targeted)
75
+ - After viewing section crops, identify areas too small for text extraction
76
+ - Crop individual components: single cards (~450x360px), form fields, badge legends
77
+ - Crop text areas for exact copy extraction
78
+
79
+ ---
80
+
81
+ ## Step 4: EXTRACT (Per Crop)
82
+
83
+ For each section/detail crop, extract:
84
+
85
+ - **Text content** — exact wording in quotes. "Discover Providers Who Share Your Values" not "Find providers who share your values"
86
+ - **Icons** — identify by library and class name (e.g., `fa-regular fa-stethoscope`). If uncertain, use "fa-regular fa-stethoscope or similar" pattern
87
+ - **Colors** — note approximate hex values for mapping in Step 5
88
+ - **Layout** — describe grid structure (e.g., "3-column on desktop, stacked on mobile")
89
+ - **Interactive behavior** — specify URL params, form actions, click targets. Bridge design → engineering by documenting function, not just appearance
90
+
91
+ ---
92
+
93
+ ## Step 5: MAP (Visual → Technical)
94
+
95
+ Translate visual elements to technical references:
96
+
97
+ | Visual | Technical |
98
+ |---|---|
99
+ | Colors | Brand SCSS variables (`$ima-brand-primary`) |
100
+ | Components | Existing shortcode names (`[ima_directory_filters]`) |
101
+ | Icons | FontAwesome/Bootstrap Icons classes (`fa-regular fa-search`) |
102
+ | Layout | Bootstrap grid classes (`col-lg-4 col-md-6`) |
103
+ | Spacing | Bootstrap utilities (`py-5`, `mb-4`) or brand scale |
104
+
105
+ For redesigns: explicitly document which existing functions to reuse vs rebuild.
106
+
107
+ ---
108
+
109
+ ## Step 6: COMPOSE
110
+
111
+ Read `references/prompt-template.md` for the template structure. Write the prompt section-by-section:
112
+
113
+ ### Structure conventions
114
+ - **Named sections** over numbered: "Header Section", "Search Form" not "Section 01"
115
+ - **State annotations** on every section: `(Both States)`, `(Landing Only)`, `(Results Only)`
116
+ - **Exact text in quotes** — never describe text, provide it verbatim
117
+ - **Brand variables inline** — `$ima-brand-secondary` not "teal"
118
+ - **Bootstrap classes inline** — `.text-primary`, `.bg-light`
119
+
120
+ ### For redesigns
121
+ - Add a **"What Changes vs What Stays"** section at the top
122
+ - Explicitly list what NOT to modify (backend logic, API, pure functions)
123
+ - Frame component migration as a decision point with criteria, not a directive
124
+
125
+ ### For multi-state pages
126
+ - Document each state separately with clear annotations
127
+ - Shared elements get `(Both States)` annotation
128
+
129
+ ---
130
+
131
+ ## Step 7: VALIDATE
132
+
133
+ Before presenting to the user:
134
+
135
+ 1. Re-read each prompt section
136
+ 2. Compare against the corresponding crop
137
+ 3. Verify: exact text match, correct brand variables, correct element order, no missing elements
138
+ 4. Check all referenced file paths exist in the codebase
139
+ 5. Ensure the "What Changes vs What Stays" section is accurate
140
+
141
+ Save the completed prompt to `docs/designs/{ticket}/PROMPT.md` and Serena memory.
@@ -0,0 +1,155 @@
1
+ # Phase B: Prompt → Code — Detailed Procedure
2
+
3
+ Execute a structured implementation prompt to produce working WordPress code. This phase delegates to `ima-claude:wp-developer` agents and reviews their output.
4
+
5
+ **Steps**: [1. RESEARCH](#step-1-research-parallel-explorers) → [2. ARCHITECTURE](#step-2-architecture-decisions-before-code) → [3. DECOMPOSE](#step-3-decompose-stories-by-section) → [4. IMPLEMENT](#step-4-implement-agent-delegation) → [5. REVIEW](#step-5-review-before-visual-test) → [6. VISUAL-QA](#step-6-visual-qa)
6
+
7
+ ---
8
+
9
+ ## Step 1: RESEARCH (Parallel Explorers)
10
+
11
+ Dispatch `ima-claude:explorer` agents in parallel to gather:
12
+
13
+ ### Explorer 1: Brand System
14
+ - Read `_variables.scss` — complete color palette, font stack, spacing scale
15
+ - Read `_mixins.scss` — available brand mixins and their parameters
16
+ - Read `_theme_variables.scss` — Bootstrap variable overrides
17
+ - Summarize: what Bootstrap utilities map to brand colors
18
+
19
+ ### Explorer 2: Current Implementation
20
+ - Read the template file being modified (or closest existing template)
21
+ - Inventory existing shortcodes: names, parameters, what they return
22
+ - Read existing helper/render functions — signatures, return types, reuse candidates
23
+ - Check page template chain: what does `get_header()` provide? What does `get_footer()` provide?
24
+
25
+ ### Explorer 3: Component Libraries (if applicable)
26
+ - Check ima-forms: does it support the form patterns needed? (icons in inputs, custom dropdowns)
27
+ - Check ima-ui-components: any reusable components?
28
+ - Evaluate migration: use existing library or raw HTML + Bootstrap?
29
+
30
+ ---
31
+
32
+ ## Step 2: ARCHITECTURE (Decisions Before Code)
33
+
34
+ Document these decisions before proceeding:
35
+
36
+ 1. **New file vs modify existing?** — New shortcode file for redesigns avoids merge conflicts during development
37
+ 2. **Function reuse** — List exact functions to call (not duplicate). Include signatures:
38
+ ```
39
+ ima_directory_get_filter_options() → ['specialties' => [...], 'states' => [...]]
40
+ ima_directory_search($params) → WP_Query results
41
+ ```
42
+ 3. **Component migration** — Use existing library or raw HTML? Decide based on feature support, not preference
43
+ 4. **Page template changes** — Does the page template need modification, or just the shortcode?
44
+ 5. **State management** — What's shared between page states vs state-specific?
45
+
46
+ ---
47
+
48
+ ## Step 3: DECOMPOSE (Stories by Section)
49
+
50
+ Break the prompt into implementation stories. Follow the foundation-first pattern:
51
+
52
+ ### Story 1: Foundation (no dependencies)
53
+ - Create the file (PHP shortcode + SCSS partial)
54
+ - Main orchestrator function with state detection
55
+ - Placeholder calls for each section
56
+ - SCSS import in `_custom.scss`
57
+ - `require_once` in `functions.php`
58
+
59
+ ### Stories 2-N: Section Fills (parallelizable)
60
+ - Group by page state when applicable:
61
+ - Landing state sections (one story)
62
+ - Results state sections (one story)
63
+ - Shared sections (one story)
64
+ - Each story fills placeholder slots from Story 1
65
+ - Stories touching independent insertion points run in parallel
66
+
67
+ ### Final Story: Polish
68
+ - Animation and transitions (progressive enhancement — static first)
69
+ - Responsive refinements
70
+ - Accessibility review
71
+ - Visual QA
72
+
73
+ ### Parallelization Rules
74
+ - Stories with independent insertion points → run in parallel
75
+ - Stories sharing the same function/placeholder → run sequentially
76
+ - Story 1 must complete before all others (creates the file structure)
77
+ - Polish story runs last (needs all sections in place)
78
+
79
+ ---
80
+
81
+ ## Step 4: IMPLEMENT (Agent Delegation)
82
+
83
+ Delegate each story to `ima-claude:wp-developer`. Each agent prompt MUST include:
84
+
85
+ ### Required Prompt Elements
86
+ 1. **Task identity** — Story number, section name, where it fits in the page
87
+ 2. **File context** — Exact file paths, line numbers to modify, current state of the code
88
+ 3. **HTML structure** — Specific elements with Bootstrap classes, not "create a search form" but:
89
+ ```
90
+ Row 1: Full-width input with fa-magnifying-glass icon
91
+ - Placeholder: "Keyword search (e.g. name, specialty, or city...)"
92
+ Row 2: 3 equal-width dropdowns (col-12 col-md-4)
93
+ ```
94
+ 4. **Brand color mapping** — Exact variable names for every color used in this section
95
+ 5. **Existing functions to reuse** — Function names, signatures, return values
96
+ 6. **What NOT to do** — Guardrails specific to this story
97
+ 7. **Verification step** — `php -l` on the PHP file after changes
98
+
99
+ ### Anti-patterns
100
+ - "Implement the discover section" → too vague, inconsistent results
101
+ - "Make it look like the screenshot" → agent can't see screenshots
102
+ - "Use appropriate colors" → must specify exact variable names
103
+ - Omitting existing function signatures → agent will reinvent them
104
+
105
+ ---
106
+
107
+ ## Step 5: REVIEW (Before Visual Test)
108
+
109
+ The orchestrator reviews each agent's output BEFORE visual testing. This catches most issues faster than visual → fix → retest cycles.
110
+
111
+ ### Review Checklist
112
+ 1. **Exact copy** — Diff generated text against prompt's quoted text. Agents paraphrase.
113
+ 2. **Element order** — Compare DOM order to prompt's section order. Spatial relationships get reversed.
114
+ 3. **URL paths** — Verify every href matches the prompt spec. Agents default to common paths (`/join/` instead of `/register/`)
115
+ 4. **Asset paths** — Glob to verify every referenced image/icon path exists. Grep for existing usage patterns.
116
+ 5. **Color compliance** — Grep for hardcoded hex values (should be zero — all brand variables)
117
+ 6. **Function reuse** — Verify agents called existing functions instead of reimplementing
118
+
119
+ ### Fixing Issues
120
+ - <5 lines: Orchestrator fixes directly via Edit tool (faster than re-delegating)
121
+ - Larger issues: Re-delegate to wp-developer with specific correction instructions
122
+
123
+ ---
124
+
125
+ ## Step 6: VISUAL-QA
126
+
127
+ ### Step 0: Compile SASS (before anything else)
128
+ New SCSS won't appear until compiled. Verify new classes exist in `bundle.css` before testing.
129
+ ```
130
+ ddev wp ima-scss compile
131
+ ```
132
+
133
+ ### Desktop Testing
134
+ 1. Navigate to page in chrome-devtools
135
+ 2. Full-page screenshot at 1920px width (landing state)
136
+ 3. Full-page screenshot (results state with search params)
137
+ 4. Viewport screenshots of specific sections as needed
138
+
139
+ ### Mobile Testing
140
+ 1. Emulate mobile device (390x844, 2x DPR, touch)
141
+ 2. Screenshot both page states
142
+ 3. Verify responsive stacking (single-column layout)
143
+
144
+ ### What to Check
145
+ - Gradient rendering
146
+ - Card floating/overlap effects
147
+ - Color matches (brand colors, not approximations)
148
+ - Text content matches design exactly
149
+ - Icons correct (FA vs BI, regular vs solid weight)
150
+ - Responsive stacking on mobile
151
+ - Interactive elements visible and clickable
152
+ - Sticky/fixed elements behave correctly
153
+
154
+ ### Iteration
155
+ Compare screenshots against original design. Note discrepancies, fix via Edit or re-delegate, re-screenshot until acceptable. Usually 1-2 iteration rounds.
@@ -0,0 +1,95 @@
1
+ # Implementation Prompt Template
2
+
3
+ This is the template structure for Phase A output. Fill in the bracketed placeholders with extracted design data. Delete sections that don't apply.
4
+
5
+ ---
6
+
7
+ ```markdown
8
+ /task-master [One-line goal as a user story]
9
+ Save this prompt and plan to Serena memory as `{feature-name}-plan`.
10
+
11
+ ## Context
12
+
13
+ - **Page URL**: [current URL of the page being built/redesigned]
14
+ - **Design files**: [paths to screenshots in docs/designs/{ticket}/]
15
+ - **Related pages**: [URLs of pages with shared components or navigation]
16
+ - **Branding reference**: Load `ima-brand` skill for color palette and typography
17
+ - **Bootstrap reference**: Load `ima-bootstrap` skill for utility classes and grid
18
+ - **Existing code**: [paths to current shortcode files, SCSS partials, page templates]
19
+
20
+ ## What Changes vs What Stays
21
+
22
+ > Include this section for redesigns. Omit for greenfield pages.
23
+
24
+ **Changes** (presentation layer only):
25
+ - [List specific files/functions that will be modified]
26
+
27
+ **Stays unchanged** (do not modify):
28
+ - [List backend logic, APIs, pure functions, search/filter logic]
29
+ - [List existing shortcodes that continue to work as-is]
30
+
31
+ ## Plan
32
+
33
+ ### [Section Name] ([State Annotation])
34
+
35
+ > State annotations: (Both States), (Landing State Only), (Results State Only)
36
+ > Repeat this block for each visual section of the page.
37
+
38
+ **Layout**: [grid description — e.g., "full-width container, 3-column card grid on lg, stacked on mobile"]
39
+ **Background**: [brand variable — e.g., "$ima-brand-primary" or "@include ima-gradient-bg"]
40
+
41
+ **Text**:
42
+ - Heading: "[exact heading text]" — `h2`, `.text-primary`, `fw-bold`
43
+ - Subheading: "[exact subheading text]" — `p`, `.text-white`, `mx-auto`
44
+ - Body: "[exact body copy]" — `p`, `.text-muted`
45
+
46
+ **Elements** (left to right, top to bottom):
47
+ - [element description] — [Bootstrap classes] — [icon: `fa-regular fa-icon-name`]
48
+ - [element description] — [href: /path/to/page]
49
+ - [element description] — [existing function: `ima_function_name()`]
50
+
51
+ **SCSS needed**:
52
+ - [Custom SCSS rules — only what Bootstrap utilities can't express]
53
+ - [Reference brand mixins: `@include ima-card-white`]
54
+
55
+ **Notes**: [animation as progressive enhancement, conditional display logic, accessibility considerations]
56
+
57
+ ## Implement
58
+
59
+ 1. Create/modify [file path] — [what to add: main shortcode, orchestrator function, state detection]
60
+ 2. Create/modify [SCSS file path] — [what to add: page-specific styles, import in _custom.scss]
61
+ 3. [Additional file changes in priority order]
62
+
63
+ **Branch strategy**: `feature/{ticket}-{short-description}`
64
+ **Approach**: Mobile-first, progressive enhancement. Static layout first, animation as enhancement.
65
+
66
+ ## Test
67
+
68
+ - [ ] `php -l` on all modified PHP files
69
+ - [ ] SCSS compiles without errors (`ddev wp ima-scss compile`)
70
+ - [ ] Desktop screenshot matches design at 1920px (landing state)
71
+ - [ ] Desktop screenshot matches design at 1920px (results state)
72
+ - [ ] Mobile screenshot matches design at 375px (both states)
73
+ - [ ] All links resolve to valid paths
74
+ - [ ] No hardcoded color values (`rg '#[0-9a-fA-F]{3,6}' --type php --type scss`)
75
+ - [ ] Existing functionality preserved (search, filters, pagination)
76
+
77
+ ## Review
78
+
79
+ - `ima-claude:reviewer` for brand compliance + accessibility audit
80
+ - Verify exact copy matches design screenshots
81
+ - Verify element order matches design
82
+ - Check responsive behavior at all breakpoints
83
+
84
+ ## Document
85
+
86
+ - [ ] Update Jira ticket with implementation notes
87
+ - [ ] Save session to Serena memory as `{feature-name}-implementation`
88
+ - [ ] Update component inventory if new shortcodes were created
89
+
90
+ ## Agents
91
+
92
+ - `ima-claude:explorer` (haiku) — parallel codebase research
93
+ - `ima-claude:wp-developer` (sonnet) — PHP/SCSS implementation with skills: `ima-brand`, `ima-bootstrap`, `php-fp-wordpress`
94
+ - `ima-claude:reviewer` (sonnet, read-only) — brand compliance after implementation
95
+ ```
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: "espocrm"
3
+ description: >-
4
+ EspoCRM skill family router. Detects intent (API calls, extension development,
5
+ UI customization) and routes to the appropriate child skill. Provides shared
6
+ context: v9.x target, entity-based REST architecture, Salesforce mental model
7
+ mapping. Use when: any EspoCRM work, CRM integration, CRM API, EspoCRM
8
+ customization. Triggers on: EspoCRM, Espo, CRM API, CRM integration, CRM
9
+ entity, CRM webhook, CRM hook.
10
+ ---
11
+
12
+ # EspoCRM - Skill Family Router
13
+
14
+ Routes EspoCRM work to the right child skill based on intent.
15
+
16
+ **Target version**: v9.x (9.0+)
17
+ **Architecture**: Entity-based REST API, PHP backend, Backbone.js frontend
18
+
19
+ ## Decision Tree
20
+
21
+ ```
22
+ What are you doing with EspoCRM?
23
+ ├── REST API calls (external integration)?
24
+ │ → espocrm-api (primary) + php-fp or js-fp-api
25
+ │ → Auth, CRUD, filtering, webhooks, mass ops
26
+
27
+ ├── PHP extension development (hooks, services, custom entities)?
28
+ │ → espocrm-extensions (Phase 2) + php-fp
29
+ │ → ORM, hooks, services, DI, custom controllers, modules
30
+
31
+ ├── Frontend/UI customization (views, fields, layouts)?
32
+ │ → espocrm-ui (Phase 3)
33
+ │ → Backbone views, Espo.Ajax, Handlebars templates
34
+
35
+ └── Not sure / mixed?
36
+ → Start with espocrm-api for data access
37
+ → Route to extension/UI skill once scope is clear
38
+ ```
39
+
40
+ ## Shared Context
41
+
42
+ ### Entity-Based Model
43
+ EspoCRM organizes data as **Entity Types** (Account, Contact, Lead, Opportunity, custom types). Every entity type gets automatic REST endpoints. Custom entities created via Entity Manager are immediately API-accessible.
44
+
45
+ ### Salesforce Mental Model
46
+ For developers familiar with Salesforce, this mapping accelerates onboarding:
47
+
48
+ | Salesforce | EspoCRM |
49
+ |---|---|
50
+ | sObject | Entity Type |
51
+ | Connected App + OAuth | API User + API Key |
52
+ | SOQL | WHERE JSON filters + select/orderBy params |
53
+ | SOSL | Text filter on list endpoint |
54
+ | Apex Trigger | PHP Hook (beforeSave, afterSave) |
55
+ | Apex REST endpoint | Custom API Action (Controller + routes.json) |
56
+ | LWC / Visualforce | Custom Views (JS, extending base views) |
57
+ | Platform Events / CDC | Webhooks ({Entity}.create, .update, .delete) |
58
+ | Bulk API 2.0 | No equivalent (loop individual calls or use Import) |
59
+ | Governor Limits | None (self-hosted, you manage resources) |
60
+ | AppExchange | EspoCRM Extensions marketplace |
61
+
62
+ ### Key Differences from Salesforce
63
+ - **No SOQL** — queries use structured JSON WHERE filters (verbose but explicit)
64
+ - **No Bulk API** — mass operations exist (massUpdate, massDelete) but no batch create
65
+ - **No Composite API** — one request per operation
66
+ - **No governor limits** — self-hosted, manage at server/proxy level
67
+ - **Simpler auth** — API Key in one header vs. multi-step OAuth
68
+ - **Metadata is JSON files** — no deployment steps, changes take effect on cache clear
69
+
70
+ ### Documentation Lookup
71
+ Use Context7 for live EspoCRM docs: `resolve-library-id("espocrm")` resolves to `/espocrm/documentation`.
72
+
73
+ ## Child Skill Status
74
+
75
+ | Skill | Status | Covers |
76
+ |---|---|---|
77
+ | `espocrm-api` | Active | REST API, auth, CRUD, filtering, webhooks, mass ops |
78
+ | `espocrm-extensions` | Planned | PHP hooks, services, ORM, custom entities, modules |
79
+ | `espocrm-ui` | Planned | JS views, fields, Espo.Ajax, Backbone, Handlebars |