@goldencomm/create-baseline 0.0.1
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.
- package/README.md +88 -0
- package/index.mjs +296 -0
- package/package.json +44 -0
- package/templates/next/.claude/skills/ai-elements/SKILL.md +160 -0
- package/templates/next/.claude/skills/ai-elements/references/agent.md +134 -0
- package/templates/next/.claude/skills/ai-elements/references/artifact.md +84 -0
- package/templates/next/.claude/skills/ai-elements/references/attachments.md +190 -0
- package/templates/next/.claude/skills/ai-elements/references/audio-player.md +134 -0
- package/templates/next/.claude/skills/ai-elements/references/canvas.md +34 -0
- package/templates/next/.claude/skills/ai-elements/references/chain-of-thought.md +81 -0
- package/templates/next/.claude/skills/ai-elements/references/checkpoint.md +183 -0
- package/templates/next/.claude/skills/ai-elements/references/code-block.md +170 -0
- package/templates/next/.claude/skills/ai-elements/references/commit.md +177 -0
- package/templates/next/.claude/skills/ai-elements/references/confirmation.md +262 -0
- package/templates/next/.claude/skills/ai-elements/references/connection.md +34 -0
- package/templates/next/.claude/skills/ai-elements/references/context.md +126 -0
- package/templates/next/.claude/skills/ai-elements/references/controls.md +32 -0
- package/templates/next/.claude/skills/ai-elements/references/conversation.md +224 -0
- package/templates/next/.claude/skills/ai-elements/references/edge.md +52 -0
- package/templates/next/.claude/skills/ai-elements/references/environment-variables.md +102 -0
- package/templates/next/.claude/skills/ai-elements/references/file-tree.md +72 -0
- package/templates/next/.claude/skills/ai-elements/references/image.md +146 -0
- package/templates/next/.claude/skills/ai-elements/references/inline-citation.md +299 -0
- package/templates/next/.claude/skills/ai-elements/references/jsx-preview.md +104 -0
- package/templates/next/.claude/skills/ai-elements/references/message.md +237 -0
- package/templates/next/.claude/skills/ai-elements/references/mic-selector.md +189 -0
- package/templates/next/.claude/skills/ai-elements/references/model-selector.md +112 -0
- package/templates/next/.claude/skills/ai-elements/references/node.md +73 -0
- package/templates/next/.claude/skills/ai-elements/references/open-in-chat.md +67 -0
- package/templates/next/.claude/skills/ai-elements/references/package-info.md +95 -0
- package/templates/next/.claude/skills/ai-elements/references/panel.md +33 -0
- package/templates/next/.claude/skills/ai-elements/references/persona.md +166 -0
- package/templates/next/.claude/skills/ai-elements/references/plan.md +79 -0
- package/templates/next/.claude/skills/ai-elements/references/prompt-input.md +579 -0
- package/templates/next/.claude/skills/ai-elements/references/queue.md +172 -0
- package/templates/next/.claude/skills/ai-elements/references/reasoning.md +238 -0
- package/templates/next/.claude/skills/ai-elements/references/sandbox.md +129 -0
- package/templates/next/.claude/skills/ai-elements/references/schema-display.md +102 -0
- package/templates/next/.claude/skills/ai-elements/references/shimmer.md +48 -0
- package/templates/next/.claude/skills/ai-elements/references/snippet.md +64 -0
- package/templates/next/.claude/skills/ai-elements/references/sources.md +209 -0
- package/templates/next/.claude/skills/ai-elements/references/speech-input.md +163 -0
- package/templates/next/.claude/skills/ai-elements/references/stack-trace.md +224 -0
- package/templates/next/.claude/skills/ai-elements/references/suggestion.md +124 -0
- package/templates/next/.claude/skills/ai-elements/references/task.md +222 -0
- package/templates/next/.claude/skills/ai-elements/references/terminal.md +103 -0
- package/templates/next/.claude/skills/ai-elements/references/test-results.md +157 -0
- package/templates/next/.claude/skills/ai-elements/references/tool.md +285 -0
- package/templates/next/.claude/skills/ai-elements/references/toolbar.md +32 -0
- package/templates/next/.claude/skills/ai-elements/references/transcription.md +120 -0
- package/templates/next/.claude/skills/ai-elements/references/voice-selector.md +241 -0
- package/templates/next/.claude/skills/ai-elements/references/web-preview.md +200 -0
- package/templates/next/.claude/skills/ai-elements/scripts/agent.tsx +61 -0
- package/templates/next/.claude/skills/ai-elements/scripts/artifact.tsx +127 -0
- package/templates/next/.claude/skills/ai-elements/scripts/attachments-inline.tsx +128 -0
- package/templates/next/.claude/skills/ai-elements/scripts/attachments-list.tsx +95 -0
- package/templates/next/.claude/skills/ai-elements/scripts/attachments.tsx +85 -0
- package/templates/next/.claude/skills/ai-elements/scripts/audio-player-remote.tsx +35 -0
- package/templates/next/.claude/skills/ai-elements/scripts/audio-player.tsx +68 -0
- package/templates/next/.claude/skills/ai-elements/scripts/chain-of-thought.tsx +82 -0
- package/templates/next/.claude/skills/ai-elements/scripts/checkpoint.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/code-block-dark.tsx +46 -0
- package/templates/next/.claude/skills/ai-elements/scripts/code-block.tsx +120 -0
- package/templates/next/.claude/skills/ai-elements/scripts/commit.tsx +94 -0
- package/templates/next/.claude/skills/ai-elements/scripts/confirmation-accepted.tsx +40 -0
- package/templates/next/.claude/skills/ai-elements/scripts/confirmation-rejected.tsx +40 -0
- package/templates/next/.claude/skills/ai-elements/scripts/confirmation-request.tsx +54 -0
- package/templates/next/.claude/skills/ai-elements/scripts/confirmation.tsx +55 -0
- package/templates/next/.claude/skills/ai-elements/scripts/context.tsx +45 -0
- package/templates/next/.claude/skills/ai-elements/scripts/conversation.tsx +177 -0
- package/templates/next/.claude/skills/ai-elements/scripts/environment-variables.tsx +62 -0
- package/templates/next/.claude/skills/ai-elements/scripts/file-tree-basic.tsx +18 -0
- package/templates/next/.claude/skills/ai-elements/scripts/file-tree-expanded.tsx +21 -0
- package/templates/next/.claude/skills/ai-elements/scripts/file-tree-selection.tsx +24 -0
- package/templates/next/.claude/skills/ai-elements/scripts/file-tree.tsx +42 -0
- package/templates/next/.claude/skills/ai-elements/scripts/image.tsx +20 -0
- package/templates/next/.claude/skills/ai-elements/scripts/inline-citation.tsx +97 -0
- package/templates/next/.claude/skills/ai-elements/scripts/jsx-preview.tsx +104 -0
- package/templates/next/.claude/skills/ai-elements/scripts/message.tsx +365 -0
- package/templates/next/.claude/skills/ai-elements/scripts/mic-selector.tsx +49 -0
- package/templates/next/.claude/skills/ai-elements/scripts/model-selector.tsx +365 -0
- package/templates/next/.claude/skills/ai-elements/scripts/open-in-chat.tsx +33 -0
- package/templates/next/.claude/skills/ai-elements/scripts/package-info.tsx +51 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-command.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-glint.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-halo.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-mana.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-obsidian.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/persona-opal.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/plan.tsx +65 -0
- package/templates/next/.claude/skills/ai-elements/scripts/prompt-input-cursor.tsx +502 -0
- package/templates/next/.claude/skills/ai-elements/scripts/prompt-input-tooltip.tsx +44 -0
- package/templates/next/.claude/skills/ai-elements/scripts/prompt-input.tsx +267 -0
- package/templates/next/.claude/skills/ai-elements/scripts/queue-prompt-input.tsx +394 -0
- package/templates/next/.claude/skills/ai-elements/scripts/queue.tsx +295 -0
- package/templates/next/.claude/skills/ai-elements/scripts/reasoning.tsx +71 -0
- package/templates/next/.claude/skills/ai-elements/scripts/sandbox.tsx +178 -0
- package/templates/next/.claude/skills/ai-elements/scripts/schema-display-basic.tsx +9 -0
- package/templates/next/.claude/skills/ai-elements/scripts/schema-display-body.tsx +20 -0
- package/templates/next/.claude/skills/ai-elements/scripts/schema-display-nested.tsx +23 -0
- package/templates/next/.claude/skills/ai-elements/scripts/schema-display-params.tsx +16 -0
- package/templates/next/.claude/skills/ai-elements/scripts/schema-display.tsx +110 -0
- package/templates/next/.claude/skills/ai-elements/scripts/shimmer-duration.tsx +31 -0
- package/templates/next/.claude/skills/ai-elements/scripts/shimmer-elements.tsx +43 -0
- package/templates/next/.claude/skills/ai-elements/scripts/shimmer.tsx +17 -0
- package/templates/next/.claude/skills/ai-elements/scripts/snippet-plain.tsx +19 -0
- package/templates/next/.claude/skills/ai-elements/scripts/snippet.tsx +25 -0
- package/templates/next/.claude/skills/ai-elements/scripts/sources-custom.tsx +39 -0
- package/templates/next/.claude/skills/ai-elements/scripts/sources.tsx +32 -0
- package/templates/next/.claude/skills/ai-elements/scripts/speech-input.tsx +84 -0
- package/templates/next/.claude/skills/ai-elements/scripts/stack-trace-collapsed.tsx +39 -0
- package/templates/next/.claude/skills/ai-elements/scripts/stack-trace-no-internal.tsx +41 -0
- package/templates/next/.claude/skills/ai-elements/scripts/stack-trace.tsx +58 -0
- package/templates/next/.claude/skills/ai-elements/scripts/suggestion-input.tsx +144 -0
- package/templates/next/.claude/skills/ai-elements/scripts/suggestion.tsx +32 -0
- package/templates/next/.claude/skills/ai-elements/scripts/task.tsx +59 -0
- package/templates/next/.claude/skills/ai-elements/scripts/terminal-basic.tsx +7 -0
- package/templates/next/.claude/skills/ai-elements/scripts/terminal-clear.tsx +19 -0
- package/templates/next/.claude/skills/ai-elements/scripts/terminal-streaming.tsx +38 -0
- package/templates/next/.claude/skills/ai-elements/scripts/terminal.tsx +82 -0
- package/templates/next/.claude/skills/ai-elements/scripts/test-results-basic.tsx +27 -0
- package/templates/next/.claude/skills/ai-elements/scripts/test-results-errors.tsx +51 -0
- package/templates/next/.claude/skills/ai-elements/scripts/test-results-suites.tsx +40 -0
- package/templates/next/.claude/skills/ai-elements/scripts/test-results.tsx +102 -0
- package/templates/next/.claude/skills/ai-elements/scripts/tool-input-available.tsx +31 -0
- package/templates/next/.claude/skills/ai-elements/scripts/tool-input-streaming.tsx +30 -0
- package/templates/next/.claude/skills/ai-elements/scripts/tool-output-available.tsx +80 -0
- package/templates/next/.claude/skills/ai-elements/scripts/tool-output-error.tsx +44 -0
- package/templates/next/.claude/skills/ai-elements/scripts/tool.tsx +222 -0
- package/templates/next/.claude/skills/ai-elements/scripts/transcription.tsx +290 -0
- package/templates/next/.claude/skills/ai-elements/scripts/voice-selector.tsx +245 -0
- package/templates/next/.claude/skills/ai-elements/scripts/web-preview.tsx +115 -0
- package/templates/next/.claude/skills/ai-sdk/SKILL.md +78 -0
- package/templates/next/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/next/.claude/skills/frontend-design/SKILL.md +55 -0
- package/templates/next/.claude/skills/gc-implement-figma-page/SKILL.md +93 -0
- package/templates/next/.claude/skills/migrate-ai-sdk-v6-to-v7/SKILL.md +108 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/README.md +60 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/metadata.json +11 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/_sections.md +29 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/_template.md +24 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/templates/next/.claude/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/AGENTS.md +3810 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/README.md +123 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/SKILL.md +149 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/metadata.json +15 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/_sections.md +46 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/_template.md +28 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/advanced-effect-event-deps.md +56 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +37 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-defer-await.md +82 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-analyzable-paths.md +63 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +60 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-flatmap-filter.md +60 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-request-idle-callback.md +105 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-resource-hints.md +85 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-script-defer-async.md +68 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-no-inline-components.md +82 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +64 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-use-deferred-value.md +59 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +149 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-no-shared-module-state.md +50 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +34 -0
- package/templates/next/.claude/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/next/.claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/templates/next/CLAUDE.md +42 -0
- package/templates/next/README.md +30 -0
- package/templates/next/_gitignore +4 -0
- package/templates/next/app/globals.css +13 -0
- package/templates/next/app/layout.tsx +44 -0
- package/templates/next/app/page.tsx +30 -0
- package/templates/next/globals.d.ts +8 -0
- package/templates/next/next.config.mjs +6 -0
- package/templates/next/package.json +38 -0
- package/templates/next/postcss.config.mjs +5 -0
- package/templates/next/skills-lock.json +47 -0
- package/templates/next/tsconfig.json +36 -0
- package/templates/shopify-theme/.claude/skills/gc-shopify-block/SKILL.md +44 -0
- package/templates/shopify-theme/.claude/skills/shopify-dev/SKILL.md +51 -0
- package/templates/shopify-theme/.claude/skills/shopify-dev/scripts/log_skill_use.mjs +205 -0
- package/templates/shopify-theme/.claude/skills/shopify-dev/scripts/search_docs.mjs +272 -0
- package/templates/shopify-theme/.claude/skills/shopify-dev/scripts/track-telemetry.ps1 +361 -0
- package/templates/shopify-theme/.claude/skills/shopify-dev/scripts/track-telemetry.sh +527 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/SKILL.md +343 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/blocks/hero-slide.liquid +342 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/config/settings_schema.json +1 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/featured-collection.liquid +457 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/locales/en.default.json +10 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/locales/en.default.schema.json +103 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/package.json +10 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/scripts/search_docs.mjs +759 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/scripts/track-telemetry.ps1 +361 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/scripts/track-telemetry.sh +527 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/scripts/validate.mjs +654 -0
- package/templates/shopify-theme/.claude/skills/shopify-liquid/sections/hero-banner.liquid +329 -0
- package/templates/shopify-theme/.claude/skills/shopify-use-shopify-cli/SKILL.md +165 -0
- package/templates/shopify-theme/.claude/skills/shopify-use-shopify-cli/scripts/log_skill_use.mjs +205 -0
- package/templates/shopify-theme/.claude/skills/shopify-use-shopify-cli/scripts/track-telemetry.ps1 +361 -0
- package/templates/shopify-theme/.claude/skills/shopify-use-shopify-cli/scripts/track-telemetry.sh +527 -0
- package/templates/shopify-theme/.shopifyignore +9 -0
- package/templates/shopify-theme/CLAUDE.md +51 -0
- package/templates/shopify-theme/README.md +92 -0
- package/templates/shopify-theme/assets/baseline.css +8390 -0
- package/templates/shopify-theme/assets/swiper-element-bundle.min.js +14 -0
- package/templates/shopify-theme/blocks/_accordion.liquid +59 -0
- package/templates/shopify-theme/blocks/_carousel-slide.liquid +24 -0
- package/templates/shopify-theme/blocks/_modal-body.liquid +18 -0
- package/templates/shopify-theme/blocks/_modal-footer.liquid +36 -0
- package/templates/shopify-theme/blocks/_modal-header.liquid +19 -0
- package/templates/shopify-theme/blocks/_modal-media.liquid +37 -0
- package/templates/shopify-theme/blocks/accordion-group.liquid +53 -0
- package/templates/shopify-theme/blocks/alert.liquid +92 -0
- package/templates/shopify-theme/blocks/avatar-group.liquid +51 -0
- package/templates/shopify-theme/blocks/avatar.liquid +56 -0
- package/templates/shopify-theme/blocks/badge.liquid +33 -0
- package/templates/shopify-theme/blocks/breadcrumb.liquid +45 -0
- package/templates/shopify-theme/blocks/button.liquid +51 -0
- package/templates/shopify-theme/blocks/buttons.liquid +41 -0
- package/templates/shopify-theme/blocks/card.liquid +67 -0
- package/templates/shopify-theme/blocks/carousel.liquid +55 -0
- package/templates/shopify-theme/blocks/column.liquid +33 -0
- package/templates/shopify-theme/blocks/image.liquid +37 -0
- package/templates/shopify-theme/blocks/modal.liquid +52 -0
- package/templates/shopify-theme/blocks/popover.liquid +24 -0
- package/templates/shopify-theme/blocks/skeleton.liquid +22 -0
- package/templates/shopify-theme/blocks/spinner.liquid +22 -0
- package/templates/shopify-theme/blocks/split.liquid +39 -0
- package/templates/shopify-theme/blocks/tab.liquid +19 -0
- package/templates/shopify-theme/blocks/tabs.liquid +78 -0
- package/templates/shopify-theme/blocks/tags.liquid +55 -0
- package/templates/shopify-theme/blocks/text.liquid +55 -0
- package/templates/shopify-theme/blocks/tooltip.liquid +50 -0
- package/templates/shopify-theme/blocks/typography.liquid +90 -0
- package/templates/shopify-theme/config/settings_data.json +4 -0
- package/templates/shopify-theme/config/settings_schema.json +10 -0
- package/templates/shopify-theme/layout/theme.liquid +21 -0
- package/templates/shopify-theme/locales/en.default.json +5 -0
- package/templates/shopify-theme/locales/en.default.schema.json +131 -0
- package/templates/shopify-theme/package.json +21 -0
- package/templates/shopify-theme/scripts/sync-tokens.mjs +32 -0
- package/templates/shopify-theme/sections/baseline-components.liquid +81 -0
- package/templates/shopify-theme/skills-lock.json +23 -0
- package/templates/shopify-theme/snippets/lucide.liquid +34 -0
- package/templates/shopify-theme/snippets/pagination.liquid +44 -0
- package/templates/shopify-theme/templates/collection.json +13 -0
- package/templates/shopify-theme/templates/gift_card.liquid +5 -0
- package/templates/shopify-theme/templates/index.json +135 -0
- package/templates/shopify-theme/templates/list-collections.json +13 -0
- package/templates/shopify-theme/templates/product.json +13 -0
- package/templates/wordpress/.claude/CLAUDE.md +37 -0
- package/templates/wordpress/.claude/skills/wp-block-development/SKILL.md +174 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/attributes-and-serialization.md +22 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/block-json.md +49 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/creating-new-blocks.md +46 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/debugging.md +36 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/deprecations.md +24 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/dynamic-rendering.md +23 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/inner-blocks.md +25 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/registration.md +30 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/supports-and-wrappers.md +18 -0
- package/templates/wordpress/.claude/skills/wp-block-development/references/tooling-and-testing.md +21 -0
- package/templates/wordpress/.claude/skills/wp-block-development/scripts/list_blocks.mjs +121 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/SKILL.md +116 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/creating-new-block-theme.md +37 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/debugging.md +24 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/patterns.md +18 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/style-variations.md +14 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/templates-and-parts.md +16 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/references/theme-json.md +59 -0
- package/templates/wordpress/.claude/skills/wp-block-themes/scripts/detect_block_themes.mjs +117 -0
- package/templates/wordpress/.claude/skills/wp-performance/SKILL.md +146 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/autoload-options.md +24 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/cron.md +20 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/database.md +20 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/http-api.md +15 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/measurement.md +21 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/object-cache.md +24 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/query-monitor-headless.md +38 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/server-timing.md +22 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/wp-cli-doctor.md +24 -0
- package/templates/wordpress/.claude/skills/wp-performance/references/wp-cli-profile.md +32 -0
- package/templates/wordpress/.claude/skills/wp-performance/scripts/perf_inspect.mjs +128 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/SKILL.md +112 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/data-and-cron.md +19 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/debugging.md +19 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/lifecycle.md +33 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/security.md +29 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/settings-api.md +22 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/references/structure.md +16 -0
- package/templates/wordpress/.claude/skills/wp-plugin-development/scripts/detect_plugins.mjs +122 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/SKILL.md +114 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/authentication.md +18 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/custom-content-types.md +20 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/discovery-and-params.md +20 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/responses-and-fields.md +30 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/routes-and-endpoints.md +36 -0
- package/templates/wordpress/.claude/skills/wp-rest-api/references/schema.md +22 -0
- package/templates/wordpress/.ddev/commands/web/seed +7 -0
- package/templates/wordpress/.ddev/config.yaml +18 -0
- package/templates/wordpress/.ddev/docker-compose.packages.yaml +14 -0
- package/templates/wordpress/.ddev/docker-compose.redis.yaml +11 -0
- package/templates/wordpress/.env.example +33 -0
- package/templates/wordpress/CLAUDE.md +34 -0
- package/templates/wordpress/README.md +45 -0
- package/templates/wordpress/_gitignore +33 -0
- package/templates/wordpress/auth.json.example +18 -0
- package/templates/wordpress/composer.json +91 -0
- package/templates/wordpress/composer.lock +1594 -0
- package/templates/wordpress/package.json +13 -0
- package/templates/wordpress/scripts/seed.sh +64 -0
- package/templates/wordpress/skills-lock.json +35 -0
- package/templates/wordpress/wp-config.php +89 -0
- package/templates/wordpress/wp-content/index.php +2 -0
- package/templates/wordpress/wp-content/mu-plugins/baseline-bootstrap.php +26 -0
package/templates/wordpress/.claude/skills/wp-performance/references/query-monitor-headless.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Query Monitor (headless / backend-only)
|
|
2
|
+
|
|
3
|
+
Query Monitor is UI-first, but it can expose useful data to backend-only tooling.
|
|
4
|
+
|
|
5
|
+
## What it can show
|
|
6
|
+
|
|
7
|
+
Query Monitor can help debug:
|
|
8
|
+
|
|
9
|
+
- DB queries (slow/dupes/errors), hooks/actions, HTTP API calls, PHP errors
|
|
10
|
+
|
|
11
|
+
Plugin page:
|
|
12
|
+
|
|
13
|
+
- https://wordpress.org/plugins/query-monitor/
|
|
14
|
+
|
|
15
|
+
Configuration constants:
|
|
16
|
+
|
|
17
|
+
- https://querymonitor.com/help/configuration-constants/
|
|
18
|
+
|
|
19
|
+
## REST API requests (no browser needed)
|
|
20
|
+
|
|
21
|
+
Query Monitor can add performance/error info to authenticated REST responses.
|
|
22
|
+
|
|
23
|
+
Docs:
|
|
24
|
+
|
|
25
|
+
- https://querymonitor.com/wordpress-debugging/rest-api-requests/
|
|
26
|
+
|
|
27
|
+
High-level approach:
|
|
28
|
+
|
|
29
|
+
1. Authenticate (nonce or Application Password).
|
|
30
|
+
2. Make a REST request and inspect response headers like `x-qm-overview-*`.
|
|
31
|
+
3. If you request an enveloped response (`?_envelope`), you can get a `qm` property with:
|
|
32
|
+
- DB queries details, cache stats, HTTP API request details, etc.
|
|
33
|
+
|
|
34
|
+
## Guardrails
|
|
35
|
+
|
|
36
|
+
- Query Monitor adds some overhead; don’t enable it in production without approval.
|
|
37
|
+
- If it’s already installed by your platform (e.g. VIP), you may need to grant `view_query_monitor`.
|
|
38
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Server-Timing (Performance Lab)
|
|
2
|
+
|
|
3
|
+
Use this file when you can enable Server-Timing metrics and want backend-only inspection via HTTP headers.
|
|
4
|
+
|
|
5
|
+
Performance Lab plugin:
|
|
6
|
+
|
|
7
|
+
- https://wordpress.org/plugins/performance-lab/
|
|
8
|
+
|
|
9
|
+
Benchmarking guidance:
|
|
10
|
+
|
|
11
|
+
- https://make.wordpress.org/performance/handbook/measuring-performance/benchmarking-server-timing/
|
|
12
|
+
|
|
13
|
+
Backend-only approach:
|
|
14
|
+
|
|
15
|
+
- Enable the relevant module/standalone plugin.
|
|
16
|
+
- Request a URL and inspect the `Server-Timing` header:
|
|
17
|
+
- `curl -sS -D - https://example.test/ -o /dev/null | rg -i \"^server-timing:\"`
|
|
18
|
+
|
|
19
|
+
Guardrails:
|
|
20
|
+
|
|
21
|
+
- Don’t enable experimental modules in production without approval.
|
|
22
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# WP-CLI doctor (`wp doctor`)
|
|
2
|
+
|
|
3
|
+
Use this for quick “production readiness” checks.
|
|
4
|
+
|
|
5
|
+
## Install (if missing)
|
|
6
|
+
|
|
7
|
+
- `wp package install wp-cli/doctor-command`
|
|
8
|
+
|
|
9
|
+
Docs:
|
|
10
|
+
|
|
11
|
+
- Default checks: https://make.wordpress.org/cli/handbook/doctor-default-checks/
|
|
12
|
+
- Customize checks: https://make.wordpress.org/cli/handbook/guides/doctor/doctor-customize-config/
|
|
13
|
+
|
|
14
|
+
## Recommended usage
|
|
15
|
+
|
|
16
|
+
- `wp doctor check`
|
|
17
|
+
- `wp doctor list` (to see available checks)
|
|
18
|
+
|
|
19
|
+
Especially relevant to performance:
|
|
20
|
+
|
|
21
|
+
- `autoload-options-size` (autoloaded options threshold)
|
|
22
|
+
- `constant-savequeries-falsy` / `constant-wp-debug-falsy` (avoid perf-costly debug flags in prod)
|
|
23
|
+
- cron checks (count/duplicates)
|
|
24
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# WP-CLI profiling (`wp profile`)
|
|
2
|
+
|
|
3
|
+
Use this when you need actionable profiling without a browser.
|
|
4
|
+
|
|
5
|
+
## Install (if missing)
|
|
6
|
+
|
|
7
|
+
`wp profile` comes from a WP-CLI package:
|
|
8
|
+
|
|
9
|
+
- `wp package install wp-cli/profile-command`
|
|
10
|
+
|
|
11
|
+
Docs:
|
|
12
|
+
|
|
13
|
+
- https://wpcli.dev/docs/profile/stage
|
|
14
|
+
- https://wpcli.dev/docs/profile/hook
|
|
15
|
+
- https://wpcli.dev/docs/profile/eval
|
|
16
|
+
|
|
17
|
+
## Recommended sequence
|
|
18
|
+
|
|
19
|
+
1. Stage overview:
|
|
20
|
+
- `wp profile stage --fields=stage,time,cache_ratio [--url=<url>]`
|
|
21
|
+
2. Hooks hotspot:
|
|
22
|
+
- `wp profile hook --spotlight [--url=<url>]`
|
|
23
|
+
- then drill into a specific hook:
|
|
24
|
+
- `wp profile hook init --spotlight [--url=<url>]`
|
|
25
|
+
3. Targeted evaluation:
|
|
26
|
+
- `wp profile eval 'do_action(\"init\");' --hook=init`
|
|
27
|
+
|
|
28
|
+
Tips:
|
|
29
|
+
|
|
30
|
+
- Use `--url` to profile specific site/route behavior.
|
|
31
|
+
- Use `--skip-plugins` / `--skip-themes` to isolate culprit components (careful: behavior changes).
|
|
32
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
const TOOL_VERSION = "0.1.0";
|
|
6
|
+
|
|
7
|
+
function parseArgs(argv) {
|
|
8
|
+
const args = { path: null, url: null, allowRoot: false };
|
|
9
|
+
for (const a of argv) {
|
|
10
|
+
if (a === "--allow-root") args.allowRoot = true;
|
|
11
|
+
if (a.startsWith("--path=")) args.path = a.slice("--path=".length);
|
|
12
|
+
if (a.startsWith("--url=")) args.url = a.slice("--url=".length);
|
|
13
|
+
}
|
|
14
|
+
return args;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function existsFile(p) {
|
|
18
|
+
try {
|
|
19
|
+
return fs.statSync(p).isFile();
|
|
20
|
+
} catch {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function runWp(cmdArgs, { pathArg, urlArg, allowRoot }) {
|
|
26
|
+
const args = [];
|
|
27
|
+
if (allowRoot) args.push("--allow-root");
|
|
28
|
+
if (pathArg) args.push(`--path=${pathArg}`);
|
|
29
|
+
if (urlArg) args.push(`--url=${urlArg}`);
|
|
30
|
+
args.push(...cmdArgs);
|
|
31
|
+
|
|
32
|
+
const out = spawnSync("wp", args, { encoding: "utf8" });
|
|
33
|
+
return {
|
|
34
|
+
ok: out.status === 0,
|
|
35
|
+
status: out.status,
|
|
36
|
+
error: out.error ? { message: out.error.message, code: out.error.code } : null,
|
|
37
|
+
stdout: (out.stdout || "").trim(),
|
|
38
|
+
stderr: (out.stderr || "").trim(),
|
|
39
|
+
args,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function canRun(report, result, noteIfNotOk) {
|
|
44
|
+
report._runs.push({ cmd: result.args.join(" "), ok: result.ok, status: result.status, error: result.error });
|
|
45
|
+
if (!result.ok && noteIfNotOk) report.notes.push(noteIfNotOk);
|
|
46
|
+
return result.ok;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function main() {
|
|
50
|
+
const opts = parseArgs(process.argv.slice(2));
|
|
51
|
+
const report = {
|
|
52
|
+
tool: { name: "perf_inspect", version: TOOL_VERSION },
|
|
53
|
+
target: { path: opts.path, url: opts.url },
|
|
54
|
+
wpCli: { available: false },
|
|
55
|
+
wp: {
|
|
56
|
+
isInstalled: null,
|
|
57
|
+
coreVersion: null,
|
|
58
|
+
},
|
|
59
|
+
commands: {
|
|
60
|
+
doctor: { available: false },
|
|
61
|
+
profile: { available: false },
|
|
62
|
+
},
|
|
63
|
+
perfSignals: {
|
|
64
|
+
autoloadTotalBytes: null,
|
|
65
|
+
hasObjectCacheDropin: null,
|
|
66
|
+
hasAdvancedCacheDropin: null,
|
|
67
|
+
hasQueryMonitorPlugin: null,
|
|
68
|
+
hasPerformanceLabPlugin: null,
|
|
69
|
+
},
|
|
70
|
+
notes: [],
|
|
71
|
+
_runs: [],
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const info = runWp(["--info"], { pathArg: null, urlArg: null, allowRoot: opts.allowRoot });
|
|
75
|
+
report.wpCli.available = info.ok;
|
|
76
|
+
report.wpCli.info = info;
|
|
77
|
+
if (!info.ok) {
|
|
78
|
+
report.notes.push("WP-CLI not available on PATH. Run in the intended environment (container/ssh) or install WP-CLI.");
|
|
79
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const isInstalled = runWp(["core", "is-installed"], { pathArg: opts.path, urlArg: opts.url, allowRoot: opts.allowRoot });
|
|
84
|
+
report.wp.isInstalled = isInstalled.ok;
|
|
85
|
+
canRun(report, isInstalled, "WordPress not detected at the given --path/--url (check wp-config.php and targeting).");
|
|
86
|
+
if (!isInstalled.ok) {
|
|
87
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const coreVersion = runWp(["core", "version"], { pathArg: opts.path, urlArg: opts.url, allowRoot: opts.allowRoot });
|
|
92
|
+
report.wp.coreVersion = coreVersion.ok ? coreVersion.stdout : null;
|
|
93
|
+
canRun(report, coreVersion);
|
|
94
|
+
|
|
95
|
+
const doctorHelp = runWp(["doctor", "--help"], { pathArg: opts.path, urlArg: opts.url, allowRoot: opts.allowRoot });
|
|
96
|
+
report.commands.doctor.available = doctorHelp.ok;
|
|
97
|
+
canRun(report, doctorHelp);
|
|
98
|
+
|
|
99
|
+
const profileHelp = runWp(["profile", "--help"], { pathArg: opts.path, urlArg: opts.url, allowRoot: opts.allowRoot });
|
|
100
|
+
report.commands.profile.available = profileHelp.ok;
|
|
101
|
+
canRun(report, profileHelp);
|
|
102
|
+
|
|
103
|
+
const autoloadBytes = runWp(["option", "list", "--autoload=on", "--format=total_bytes"], {
|
|
104
|
+
pathArg: opts.path,
|
|
105
|
+
urlArg: opts.url,
|
|
106
|
+
allowRoot: opts.allowRoot,
|
|
107
|
+
});
|
|
108
|
+
if (autoloadBytes.ok && /^\d+$/.test(autoloadBytes.stdout)) {
|
|
109
|
+
report.perfSignals.autoloadTotalBytes = Number(autoloadBytes.stdout);
|
|
110
|
+
}
|
|
111
|
+
canRun(report, autoloadBytes);
|
|
112
|
+
|
|
113
|
+
if (opts.path) {
|
|
114
|
+
const wpContent = path.join(opts.path, "wp-content");
|
|
115
|
+
report.perfSignals.hasObjectCacheDropin = existsFile(path.join(wpContent, "object-cache.php"));
|
|
116
|
+
report.perfSignals.hasAdvancedCacheDropin = existsFile(path.join(wpContent, "advanced-cache.php"));
|
|
117
|
+
report.perfSignals.hasQueryMonitorPlugin = existsFile(path.join(wpContent, "plugins", "query-monitor", "query-monitor.php"));
|
|
118
|
+
report.perfSignals.hasPerformanceLabPlugin = existsFile(path.join(wpContent, "plugins", "performance-lab", "load.php"));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (!report.commands.doctor.available) report.notes.push("Tip: install WP-CLI doctor: `wp package install wp-cli/doctor-command`.");
|
|
122
|
+
if (!report.commands.profile.available) report.notes.push("Tip: install WP-CLI profile: `wp package install wp-cli/profile-command`.");
|
|
123
|
+
|
|
124
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
main();
|
|
128
|
+
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-plugin-development
|
|
3
|
+
description: "Use when developing WordPress plugins: architecture and hooks, activation/deactivation/uninstall, admin UI and Settings API, data storage, cron/tasks, security (nonces/capabilities/sanitization/escaping), and release packaging."
|
|
4
|
+
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node. Some workflows require WP-CLI."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# WP Plugin Development
|
|
8
|
+
|
|
9
|
+
## When to use
|
|
10
|
+
|
|
11
|
+
Use this skill for plugin work such as:
|
|
12
|
+
|
|
13
|
+
- creating or refactoring plugin structure (bootstrap, includes, namespaces/classes)
|
|
14
|
+
- adding hooks/actions/filters
|
|
15
|
+
- activation/deactivation/uninstall behavior and migrations
|
|
16
|
+
- adding settings pages / options / admin UI (Settings API)
|
|
17
|
+
- security fixes (nonces, capabilities, sanitization/escaping, SQL safety)
|
|
18
|
+
- packaging a release (build artifacts, readme, assets)
|
|
19
|
+
|
|
20
|
+
## Inputs required
|
|
21
|
+
|
|
22
|
+
- Repo root + target plugin(s) (path to plugin main file if known).
|
|
23
|
+
- Where this plugin runs: single site vs multisite; WP.com conventions if applicable.
|
|
24
|
+
- Target WordPress + PHP versions (affects available APIs and placeholder support in `$wpdb->prepare()`).
|
|
25
|
+
|
|
26
|
+
## Procedure
|
|
27
|
+
|
|
28
|
+
### 0) Triage and locate plugin entrypoints
|
|
29
|
+
|
|
30
|
+
1. Run triage:
|
|
31
|
+
- `node skills/wp-project-triage/scripts/detect_wp_project.mjs`
|
|
32
|
+
2. Detect plugin headers (deterministic scan):
|
|
33
|
+
- `node skills/wp-plugin-development/scripts/detect_plugins.mjs`
|
|
34
|
+
|
|
35
|
+
If this is a full site repo, pick the specific plugin under `wp-content/plugins/` or `mu-plugins/` before changing code.
|
|
36
|
+
|
|
37
|
+
### 1) Follow a predictable architecture
|
|
38
|
+
|
|
39
|
+
Guidelines:
|
|
40
|
+
|
|
41
|
+
- Keep a single bootstrap (main plugin file with header).
|
|
42
|
+
- Avoid heavy side effects at file load time; load on hooks.
|
|
43
|
+
- Prefer a dedicated loader/class to register hooks.
|
|
44
|
+
- Keep admin-only code behind `is_admin()` (or admin hooks) to reduce frontend overhead.
|
|
45
|
+
|
|
46
|
+
See:
|
|
47
|
+
- `references/structure.md`
|
|
48
|
+
|
|
49
|
+
### 2) Hooks and lifecycle (activation/deactivation/uninstall)
|
|
50
|
+
|
|
51
|
+
Activation hooks are fragile; follow guardrails:
|
|
52
|
+
|
|
53
|
+
- register activation/deactivation hooks at top-level, not inside other hooks
|
|
54
|
+
- flush rewrite rules only when needed and only after registering CPTs/rules
|
|
55
|
+
- uninstall should be explicit and safe (`uninstall.php` or `register_uninstall_hook`)
|
|
56
|
+
|
|
57
|
+
See:
|
|
58
|
+
- `references/lifecycle.md`
|
|
59
|
+
|
|
60
|
+
### 3) Settings and admin UI (Settings API)
|
|
61
|
+
|
|
62
|
+
Prefer Settings API for options:
|
|
63
|
+
|
|
64
|
+
- `register_setting()`, `add_settings_section()`, `add_settings_field()`
|
|
65
|
+
- sanitize via `sanitize_callback`
|
|
66
|
+
|
|
67
|
+
See:
|
|
68
|
+
- `references/settings-api.md`
|
|
69
|
+
|
|
70
|
+
### 4) Security baseline (always)
|
|
71
|
+
|
|
72
|
+
Before shipping:
|
|
73
|
+
|
|
74
|
+
- Validate/sanitize input early; escape output late.
|
|
75
|
+
- Use nonces to prevent CSRF *and* capability checks for authorization.
|
|
76
|
+
- Avoid directly trusting `$_POST` / `$_GET`; use `wp_unslash()` and specific keys.
|
|
77
|
+
- Use `$wpdb->prepare()` for SQL; avoid building SQL with string concatenation.
|
|
78
|
+
|
|
79
|
+
See:
|
|
80
|
+
- `references/security.md`
|
|
81
|
+
|
|
82
|
+
### 5) Data storage, cron, migrations (if needed)
|
|
83
|
+
|
|
84
|
+
- Prefer options for small config; custom tables only if necessary.
|
|
85
|
+
- For cron tasks, ensure idempotency and provide manual run paths (WP-CLI or admin).
|
|
86
|
+
- For schema changes, write upgrade routines and store schema version.
|
|
87
|
+
|
|
88
|
+
See:
|
|
89
|
+
- `references/data-and-cron.md`
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
|
|
93
|
+
- Plugin activates with no fatals/notices.
|
|
94
|
+
- Settings save and read correctly (capability + nonce enforced).
|
|
95
|
+
- Uninstall removes intended data (and nothing else).
|
|
96
|
+
- Run repo lint/tests (PHPUnit/PHPCS if present) and any JS build steps if the plugin ships assets.
|
|
97
|
+
|
|
98
|
+
## Failure modes / debugging
|
|
99
|
+
|
|
100
|
+
- Activation hook not firing:
|
|
101
|
+
- hook registered incorrectly (not in main file scope), wrong main file path, or plugin is network-activated
|
|
102
|
+
- Settings not saving:
|
|
103
|
+
- settings not registered, wrong option group, missing capability, nonce failure
|
|
104
|
+
- Security regressions:
|
|
105
|
+
- nonce present but missing capability checks; or sanitized input not escaped on output
|
|
106
|
+
|
|
107
|
+
See:
|
|
108
|
+
- `references/debugging.md`
|
|
109
|
+
|
|
110
|
+
## Escalation
|
|
111
|
+
|
|
112
|
+
For canonical detail, consult the Plugin Handbook and security guidelines before inventing patterns.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Data storage, cron, and upgrades
|
|
2
|
+
|
|
3
|
+
Use this file when adding persistent storage, background jobs, or upgrade routines.
|
|
4
|
+
|
|
5
|
+
## Data storage
|
|
6
|
+
|
|
7
|
+
- Prefer Options API for small config/state.
|
|
8
|
+
- Use custom tables only when needed; store schema version and provide upgrade paths.
|
|
9
|
+
|
|
10
|
+
## Cron
|
|
11
|
+
|
|
12
|
+
- Ensure tasks are idempotent (may run late or multiple times).
|
|
13
|
+
- Provide a manual trigger path for debugging (WP-CLI or admin-only action).
|
|
14
|
+
|
|
15
|
+
## Database safety note
|
|
16
|
+
|
|
17
|
+
If using `$wpdb->prepare()`, avoid building queries with concatenated user input.
|
|
18
|
+
Recent WordPress versions support identifier placeholders (`%i`) but you must not assume it exists without checking capabilities or target versions.
|
|
19
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Debugging quick routes
|
|
2
|
+
|
|
3
|
+
## Plugin doesn’t load / fatal errors
|
|
4
|
+
|
|
5
|
+
- Confirm correct plugin main file and header.
|
|
6
|
+
- Check PHP error logs and `WP_DEBUG_LOG`.
|
|
7
|
+
- If the repo is a site repo, confirm you edited the correct plugin under `wp-content/plugins/`.
|
|
8
|
+
|
|
9
|
+
## Activation hook surprises
|
|
10
|
+
|
|
11
|
+
- Hooks must be registered at top-level.
|
|
12
|
+
- Activation runs in a special context; avoid assuming other hooks already ran.
|
|
13
|
+
|
|
14
|
+
## Settings not saving
|
|
15
|
+
|
|
16
|
+
- Confirm `register_setting()` is called.
|
|
17
|
+
- Confirm the option group matches the form.
|
|
18
|
+
- Confirm capability checks and nonces.
|
|
19
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Activation, deactivation, uninstall
|
|
2
|
+
|
|
3
|
+
Use this file for lifecycle changes and data cleanup.
|
|
4
|
+
|
|
5
|
+
## Activation / deactivation hooks
|
|
6
|
+
|
|
7
|
+
- `register_activation_hook( __FILE__, 'callback' )`
|
|
8
|
+
- `register_deactivation_hook( __FILE__, 'callback' )`
|
|
9
|
+
|
|
10
|
+
Guardrails:
|
|
11
|
+
|
|
12
|
+
- These hooks must be registered at top-level (not inside other hooks).
|
|
13
|
+
- If you flush rewrite rules, ensure rules are registered first (often via a shared function called both on `init` and activation).
|
|
14
|
+
|
|
15
|
+
Upstream reference:
|
|
16
|
+
|
|
17
|
+
- https://developer.wordpress.org/plugins/plugin-basics/activation-deactivation-hooks/
|
|
18
|
+
|
|
19
|
+
## Uninstall
|
|
20
|
+
|
|
21
|
+
Preferred approaches:
|
|
22
|
+
|
|
23
|
+
- `uninstall.php` (runs only on uninstall)
|
|
24
|
+
- `register_uninstall_hook()`
|
|
25
|
+
|
|
26
|
+
Guardrails:
|
|
27
|
+
|
|
28
|
+
- Check `WP_UNINSTALL_PLUGIN` before running destructive cleanup.
|
|
29
|
+
|
|
30
|
+
Upstream reference:
|
|
31
|
+
|
|
32
|
+
- https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/
|
|
33
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security guardrails (plugin work)
|
|
2
|
+
|
|
3
|
+
Use this file when making security fixes or when handling any input/output.
|
|
4
|
+
|
|
5
|
+
## Nonces + permissions
|
|
6
|
+
|
|
7
|
+
- Nonces help prevent CSRF, not authorization.
|
|
8
|
+
- Always pair nonces with capability checks (`current_user_can()` or a more specific capability).
|
|
9
|
+
|
|
10
|
+
Upstream reference:
|
|
11
|
+
|
|
12
|
+
- https://developer.wordpress.org/apis/security/nonces/
|
|
13
|
+
|
|
14
|
+
## Sanitization and escaping
|
|
15
|
+
|
|
16
|
+
Golden rule:
|
|
17
|
+
|
|
18
|
+
- sanitize/validate on input, escape on output.
|
|
19
|
+
|
|
20
|
+
Practical rules:
|
|
21
|
+
|
|
22
|
+
- never process the entire `$_POST` / `$_GET` array; read explicit keys
|
|
23
|
+
- use `wp_unslash()` before sanitizing when needed
|
|
24
|
+
- use prepared statements for SQL; avoid interpolating user input into queries
|
|
25
|
+
|
|
26
|
+
Common review guidance:
|
|
27
|
+
|
|
28
|
+
- https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/
|
|
29
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Settings API (admin options)
|
|
2
|
+
|
|
3
|
+
Use this file when adding settings pages or storing user-configurable options.
|
|
4
|
+
|
|
5
|
+
Core APIs:
|
|
6
|
+
|
|
7
|
+
- `register_setting()`
|
|
8
|
+
- `add_settings_section()`
|
|
9
|
+
- `add_settings_field()`
|
|
10
|
+
|
|
11
|
+
Upstream references:
|
|
12
|
+
|
|
13
|
+
- Settings API overview: https://developer.wordpress.org/plugins/settings/settings-api/
|
|
14
|
+
- Register settings: https://developer.wordpress.org/plugins/settings/registration/
|
|
15
|
+
- Add settings fields: https://developer.wordpress.org/plugins/settings/settings-fields/
|
|
16
|
+
|
|
17
|
+
Practical guardrails:
|
|
18
|
+
|
|
19
|
+
- Use `sanitize_callback` to validate/sanitize data.
|
|
20
|
+
- Use capability checks (commonly `manage_options`) for settings screens and saves.
|
|
21
|
+
- Escape values on output (`esc_attr`, `esc_html`, etc.).
|
|
22
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Plugin structure and loading
|
|
2
|
+
|
|
3
|
+
Use this file when introducing or refactoring a plugin architecture.
|
|
4
|
+
|
|
5
|
+
## Core concepts
|
|
6
|
+
|
|
7
|
+
- Main plugin file contains the plugin header and bootstraps the plugin.
|
|
8
|
+
- Prefer predictable init:
|
|
9
|
+
- minimal boot file
|
|
10
|
+
- a loader/class that registers hooks
|
|
11
|
+
- admin-only code behind admin hooks
|
|
12
|
+
|
|
13
|
+
Upstream reference:
|
|
14
|
+
|
|
15
|
+
- https://developer.wordpress.org/plugins/plugin-basics/
|
|
16
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_IGNORES = new Set([
|
|
5
|
+
".git",
|
|
6
|
+
"node_modules",
|
|
7
|
+
"vendor",
|
|
8
|
+
"dist",
|
|
9
|
+
"build",
|
|
10
|
+
"coverage",
|
|
11
|
+
".next",
|
|
12
|
+
".turbo",
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function statSafe(p) {
|
|
16
|
+
try {
|
|
17
|
+
return fs.statSync(p);
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function readFileSafe(p, maxBytes = 128 * 1024) {
|
|
24
|
+
try {
|
|
25
|
+
const buf = fs.readFileSync(p);
|
|
26
|
+
if (buf.byteLength > maxBytes) return buf.subarray(0, maxBytes).toString("utf8");
|
|
27
|
+
return buf.toString("utf8");
|
|
28
|
+
} catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function findFilesRecursive(repoRoot, predicate, { maxFiles = 6000, maxDepth = 10 } = {}) {
|
|
34
|
+
const results = [];
|
|
35
|
+
const queue = [{ dir: repoRoot, depth: 0 }];
|
|
36
|
+
let visited = 0;
|
|
37
|
+
|
|
38
|
+
while (queue.length > 0) {
|
|
39
|
+
const { dir, depth } = queue.shift();
|
|
40
|
+
if (depth > maxDepth) continue;
|
|
41
|
+
|
|
42
|
+
let entries;
|
|
43
|
+
try {
|
|
44
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
45
|
+
} catch {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
for (const ent of entries) {
|
|
50
|
+
const fullPath = path.join(dir, ent.name);
|
|
51
|
+
if (ent.isDirectory()) {
|
|
52
|
+
if (DEFAULT_IGNORES.has(ent.name)) continue;
|
|
53
|
+
queue.push({ dir: fullPath, depth: depth + 1 });
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (!ent.isFile()) continue;
|
|
57
|
+
|
|
58
|
+
visited += 1;
|
|
59
|
+
if (visited > maxFiles) return { results, truncated: true };
|
|
60
|
+
if (predicate(fullPath)) results.push(fullPath);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return { results, truncated: false };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function parsePluginHeader(contents) {
|
|
68
|
+
// WordPress reads plugin headers from the top of the file. We only need key fields.
|
|
69
|
+
const header = {};
|
|
70
|
+
const pairs = [
|
|
71
|
+
["Plugin Name", "name"],
|
|
72
|
+
["Plugin URI", "uri"],
|
|
73
|
+
["Description", "description"],
|
|
74
|
+
["Version", "version"],
|
|
75
|
+
["Author", "author"],
|
|
76
|
+
["Author URI", "authorUri"],
|
|
77
|
+
["Text Domain", "textDomain"],
|
|
78
|
+
["Domain Path", "domainPath"],
|
|
79
|
+
];
|
|
80
|
+
for (const [label, key] of pairs) {
|
|
81
|
+
const m = contents.match(new RegExp(`^\\s*${label}:\\s*(.+)\\s*$`, "im"));
|
|
82
|
+
if (m) header[key] = m[1].trim();
|
|
83
|
+
}
|
|
84
|
+
if (!header.name) return null;
|
|
85
|
+
return header;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function main() {
|
|
89
|
+
const repoRoot = process.cwd();
|
|
90
|
+
|
|
91
|
+
const { results: phpFiles, truncated } = findFilesRecursive(repoRoot, (p) => p.toLowerCase().endsWith(".php"), {
|
|
92
|
+
maxFiles: 5000,
|
|
93
|
+
maxDepth: 10,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
const plugins = [];
|
|
97
|
+
|
|
98
|
+
for (const phpPath of phpFiles) {
|
|
99
|
+
const txt = readFileSafe(phpPath);
|
|
100
|
+
if (!txt) continue;
|
|
101
|
+
if (!/Plugin Name:/i.test(txt)) continue;
|
|
102
|
+
const header = parsePluginHeader(txt);
|
|
103
|
+
if (!header) continue;
|
|
104
|
+
plugins.push({
|
|
105
|
+
pluginFile: path.relative(repoRoot, phpPath),
|
|
106
|
+
...header,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const report = {
|
|
111
|
+
tool: { name: "detect_plugins", version: "0.1.0" },
|
|
112
|
+
repoRoot,
|
|
113
|
+
truncated,
|
|
114
|
+
count: plugins.length,
|
|
115
|
+
plugins,
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
main();
|
|
122
|
+
|