Skip to content

@W-20592401 PWA Kit Development Guidelines Tool#213

Merged
yhsieh1 merged 5 commits intomainfrom
t/commerce/W-20592401/pwa-guidelines-tool
Feb 25, 2026
Merged

@W-20592401 PWA Kit Development Guidelines Tool#213
yhsieh1 merged 5 commits intomainfrom
t/commerce/W-20592401/pwa-guidelines-tool

Conversation

@yhsieh1
Copy link
Contributor

@yhsieh1 yhsieh1 commented Feb 25, 2026

Summary

Tool Overview

Property Value
Tool name pwakit_development_guidelines
Toolset PWAV3
GA status isGA: false (requires --allow-non-ga-tools)
Requires instance No
Source src/tools/pwav3/pwa-kit-development-guidelines.ts
Content content/pwav3/*.md

Purpose

Returns PWA Kit v3 development guidelines and best practices. Intended to be used first before writing PWA Kit code. Covers architecture rules, coding standards, React components, data fetching, routing, configuration, and framework constraints.

Testing

MCP Prompts (with --allow-non-ga-tools)

Use these prompts against a running MCP server to verify the tool in context.

Default behavior (no sections)

  • "Use the MCP tool to get PWA Kit development guidelines."
  • "I'm starting a new PWA Kit project. Use the MCP tool to get the development guidelines."
  • "Use the MCP tool to show me what I need to know before writing PWA Kit code."

Expected: Content for quick-reference, components, data-fetching, routing.

Single section

  • "Use the MCP tool to show me PWA Kit data fetching patterns."
  • "Use the MCP tool to get PWA Kit component guidelines."
  • "Use the MCP tool to show me PWA Kit configuration best practices."
  • "Use the MCP tool to get PWA Kit routing and SSR patterns."
  • "Use the MCP tool to show me PWA Kit testing guidelines."
  • "Use the MCP tool to get PWA Kit i18n patterns."

Expected: Content for the requested section only.

Multiple sections

  • "Use the MCP tool to show me PWA Kit data fetching and component patterns."
  • "Use the MCP tool to get PWA Kit config, routing, and i18n guidelines."

Expected: Combined content with --- separators and display instructions.

Topic-specific

  • "Use the MCP tool to show me how to use useCustomQuery in PWA Kit."
  • "Use the MCP tool to show me PWA Kit _app-config and withReactQuery setup."
  • "Use the MCP tool to show me PWA Kit Chakra UI and shared/ui usage."
  • "Use the MCP tool to show me PWA Kit extensibility and overrides."

Expected: Relevant section(s) returned; content matches the topic.

Dependencies

  • No net-new third-party dependencies were added
  • If net-new third-party dependencies were added, rationale/discussion is included and 3pl-approved is set by a maintainer

  • Tests pass (pnpm test)
  • Code is formatted (pnpm run format)

Comment on lines +24 to +27
// Resolve the content directory from the package root
const require = createRequire(import.meta.url);
const packageRoot = path.dirname(require.resolve('@salesforce/b2c-dx-mcp/package.json'));
const CONTENT_DIR = path.join(packageRoot, 'content', 'pwav3');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i bet we use this everywhere, is it worth a util helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep this as future improvement.

Comment on lines +96 to +103
const SECTION_CONTENT: Record<SectionKey, string> = Object.fromEntries(
SECTIONS_METADATA.map((section) => {
const filename = `${section.key}.md`;
const filePath = path.join(CONTENT_DIR, filename);
const content = readFileSync(filePath, 'utf8');
return [section.key, content];
}),
) as Record<SectionKey, string>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if i am reading this correctly it seems to be loading all the content at MCP start-up? As our MCP content library grows we might want to switch to on-demand or lazy loading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, good suggestion. I will keep this in future improvement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sneaking a tighter coverage limit huh?

@yhsieh1 yhsieh1 merged commit f0e3f1a into main Feb 25, 2026
4 checks passed
@yhsieh1 yhsieh1 deleted the t/commerce/W-20592401/pwa-guidelines-tool branch February 25, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants