|
| 1 | +--- |
| 2 | +description: Get PWA Kit v3 development guidelines and best practices for React, Chakra UI, and Commerce API. |
| 3 | +--- |
| 4 | + |
| 5 | +# pwakit_development_guidelines |
| 6 | + |
| 7 | +Returns critical architecture rules, coding standards, and best practices for building PWA Kit v3 applications with React, Chakra UI, and Commerce API. **Use this tool first** before writing any PWA Kit code. |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +The `pwakit_development_guidelines` tool provides essential development guidance for PWA Kit v3. It: |
| 12 | + |
| 13 | +1. Returns comprehensive guidelines by default (quick-reference plus key sections). |
| 14 | +2. Supports retrieving specific topic sections on demand. |
| 15 | +3. Loads content from markdown files covering components, data fetching, routing, configuration, and more. |
| 16 | + |
| 17 | +**Important:** This tool is the **essential first step** for PWA Kit v3 development. Use it before writing any code to understand non-negotiable patterns for React components, data fetching, routing, configuration, and framework constraints. |
| 18 | + |
| 19 | +This tool is part of the PWAV3 toolset and is auto-enabled for PWA Kit v3 projects (detected by `@salesforce/pwa-kit-*` dependencies). |
| 20 | + |
| 21 | +## Authentication |
| 22 | + |
| 23 | +No authentication required. This tool operates on local content only—guidelines are loaded from markdown files bundled with the MCP server. |
| 24 | + |
| 25 | +## Parameters |
| 26 | + |
| 27 | +| Parameter | Type | Required | Default | Description | |
| 28 | +|-----------|------|----------|---------|-------------| |
| 29 | +| `sections` | string[] | No | `['quick-reference', 'components', 'data-fetching', 'routing']` | Optional array of specific sections to retrieve. If not specified, returns comprehensive guidelines. Pass an empty array to return an empty string. | |
| 30 | + |
| 31 | +### Available Sections |
| 32 | + |
| 33 | +| Section | Topics Covered | |
| 34 | +|---------|----------------| |
| 35 | +| `quick-reference` | Critical rules, architecture principles, quick patterns | |
| 36 | +| `components` | Component patterns, Chakra UI, special components (_app, _app-config, _error), React Hooks | |
| 37 | +| `data-fetching` | React Query, commerce-sdk-react hooks, useCustomQuery/useCustomMutation, custom APIs, caching | |
| 38 | +| `routing` | Express.js, React Router, configureRoutes, SSR/CSR navigation, withReactQuery, getProps patterns | |
| 39 | +| `config` | Configuration files, environment variables, file precedence, proxy setup, multi-site | |
| 40 | +| `state-management` | Context API, useReducer, Redux integration, AppConfig methods | |
| 41 | +| `extensibility` | Template extension, ccExtensibility configuration, overrides directory | |
| 42 | +| `testing` | Jest, React Testing Library, MSW, test organization, coverage | |
| 43 | +| `i18n` | React Intl, translation extraction/compilation, multi-locale support | |
| 44 | +| `styling` | Chakra UI theming, Emotion CSS-in-JS, responsive design | |
| 45 | + |
| 46 | +## Usage Examples |
| 47 | + |
| 48 | +### Default (Comprehensive Guidelines) |
| 49 | + |
| 50 | +Get the default comprehensive set (quick-reference, components, data-fetching, routing): |
| 51 | + |
| 52 | +``` |
| 53 | +Use the MCP tool to get PWA Kit development guidelines before I start coding. |
| 54 | +``` |
| 55 | + |
| 56 | +### Single Section |
| 57 | + |
| 58 | +Retrieve a specific topic: |
| 59 | + |
| 60 | +``` |
| 61 | +Use the MCP tool to get PWA Kit guidelines for data-fetching patterns. |
| 62 | +``` |
| 63 | + |
| 64 | +### Multiple Related Sections |
| 65 | + |
| 66 | +Combine related sections in one call: |
| 67 | + |
| 68 | +``` |
| 69 | +Use the MCP tool to get PWA Kit guidelines for components, routing, and config. |
| 70 | +``` |
| 71 | + |
| 72 | +### All Sections |
| 73 | + |
| 74 | +Retrieve all available sections: |
| 75 | + |
| 76 | +``` |
| 77 | +Use the MCP tool to get all PWA Kit development guidelines. |
| 78 | +``` |
| 79 | + |
| 80 | +## Output |
| 81 | + |
| 82 | +Returns text content with guidelines for the requested section(s): |
| 83 | + |
| 84 | +- **Single section**: Returns content directly (no separators or instructions). |
| 85 | +- **Multiple sections**: Returns content with `---` separators between sections, prefixed with instructions to display full content without summarization. |
| 86 | + |
| 87 | +The returned content includes: |
| 88 | + |
| 89 | +- Critical rules and best practices |
| 90 | +- Code examples (correct ✅ and incorrect ❌ patterns) |
| 91 | +- Quick reference snippets |
| 92 | +- Framework-specific patterns for React, Chakra UI, and commerce-sdk-react |
| 93 | + |
| 94 | +## Requirements |
| 95 | + |
| 96 | +- PWA Kit v3 project or general PWA Kit development context |
| 97 | +- No credentials or instance configuration needed |
| 98 | + |
| 99 | +## Related Tools |
| 100 | + |
| 101 | +- Part of the [PWAV3](../toolsets#pwav3) toolset |
| 102 | +- Auto-enabled for PWA Kit v3 projects (detected by `@salesforce/pwa-kit-*` dependencies) |
| 103 | +- [`mrt_bundle_push`](./mrt-bundle-push) - Build and push bundles to Managed Runtime |
| 104 | + |
| 105 | +## See Also |
| 106 | + |
| 107 | +- [PWAV3 Toolset](../toolsets#pwav3) - Overview of PWA Kit v3 tools |
| 108 | +- [Configuration](../configuration) - Configure MCP server and toolset selection |
0 commit comments