-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathpwa-developer-guideline-tool.js
More file actions
53 lines (45 loc) · 1.92 KB
/
pwa-developer-guideline-tool.js
File metadata and controls
53 lines (45 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (c) 2025, Salesforce, Inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import {EmptyJsonSchema} from './utils'
const guidelinesText = `# Commerce Composable Storefront Development Guidelines
## Overview
Guidelines for Salesforce Commerce Composable Storefront development using PWA Kit, Retail React App, and Chakra UI.
## Core Principles
- Analyze requirements and existing codebase thoroughly
- Use existing components and hooks when possible
- Plan before implementing
- Test comprehensively with Jest
## PWA Kit Essentials
### Architecture
- Server-side rendering (SSR) for initial loads
- Client-side rendering (CSR) for interactions
- Isomorphic code (works on server and client)
- Proxy requests via \`/mobify/proxy/<PROXY_PATH>\`
### Special Components
- Components starting with \`_\` are special PWA Kit components
- \`_app-config\`: Top-level app configuration
- \`_app\`: Persistent layout (header, footer, sidebar)
- \`_error\`: 404 and error pages
## Development Rules
- Use kebab-case for file names (except special components with \`_\`)
- Use Chakra UI and existing components
- Create modular, reusable components
- Use React Hooks for state management
- Access data via commerce-sdk-react hooks
- Ensure mobile-friendly and accessible components
- Maintain consistent code formatting using project standards
- Write comprehensive test coverage
`
export default {
name: 'development_guidelines',
description: `You must follow this development guidelines before attempting to analyze/ generate / refactor / modify / fix code.
- e.g. "Create a customer service Chat component", "Find bugs in my_script.jsx", "Refactor my_script.jsx to use React Hooks"`,
inputSchema: EmptyJsonSchema,
fn: async () => ({
content: [{type: 'text', text: guidelinesText}]
})
}