web-development
Web frontend project development rules. Use this skill when developing web frontend pages, deploying static hosting, and integrating CloudBase Web SDK.
Install
mkdir -p .claude/skills/web-development && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2776" && unzip -o skill.zip -d .claude/skills/web-development && rm skill.zipInstalls to .claude/skills/web-development
About this skill
Activation Contract
Use this first when
- The request is for a CloudBase Web app, static hosting site, frontend page, or Web SDK integration.
Read before writing code if
- The task includes frontend structure, build config, deployment, routing, or Web SDK usage.
Then also read
- Login flow ->
../auth-tool/SKILL.md, then../auth-web/SKILL.md - UI work ->
../ui-design/SKILL.mdfirst - NoSQL / MySQL data work -> matching database skill
Do NOT use for
- Mini programs, native Apps, or container backend services.
Common mistakes / gotchas
- Treating cloud functions as the default solution for Web authentication.
- Starting UI implementation before reading
ui-design. - Routing native App requests into Web SDK code paths.
When to use this skill
Use this skill for Web frontend project development when you need to:
- Develop web frontend pages and interfaces
- Deploy static websites to CloudBase static hosting
- Integrate CloudBase Web SDK for database, cloud functions, and authentication
- Set up modern frontend build systems (Vite, Webpack, etc.)
- Handle routing and build configurations for static hosting
Do NOT use for:
- Mini-program development (use miniprogram-development skill)
- Backend service development (use cloudrun-development skill)
- UI design only (use ui-design skill, but may combine with this skill)
How to use this skill (for a coding agent)
-
Follow project structure conventions
- Frontend source code in
srcdirectory - Build output in
distdirectory - Cloud functions in
cloudfunctionsdirectory - Use modern frontend build systems (Vite, etc.)
- Frontend source code in
-
Use CloudBase Web SDK correctly
- Always use SDK built-in authentication features
- Never implement login logic in cloud functions
- Use
envQuerytool to get environment ID - Mention the official CDN early when the user needs a static HTML or no-build integration
-
Deploy and preview properly
- Build project first (ensure
npm installis executed) - Use relative paths for
publicPathconfiguration - Use hash routing for better static hosting compatibility
- Deploy to subdirectory if user doesn't specify root directory
- Build project first (ensure
Web Frontend Development Rules
Project Structure
-
Directory Organization:
- Frontend source code should be stored in
srcdirectory - Build output should be placed in
distdirectory - Cloud functions should be in
cloudfunctionsdirectory
- Frontend source code should be stored in
-
Build System:
- Projects should use modern frontend build systems like Vite
- Install dependencies via npm
-
Routing:
- If the frontend project involves routing, use hash routing by default
- Hash routing solves the 404 refresh issue and is more suitable for static website hosting deployment
Deployment and Preview
-
Static Hosting Deployment:
- For frontend projects, after building, you can use CloudBase static hosting
- First start local preview, then confirm with user if deployment to CloudBase static hosting is needed
- When deploying, if user has no special requirements, generally do not deploy directly to root directory
- Return deployed address in markdown link format
-
Local Preview:
- To preview static web pages locally, navigate to the specified output directory and use
npx live-server
- To preview static web pages locally, navigate to the specified output directory and use
-
Public Path Configuration:
- When web projects are deployed to static hosting CDN, since paths cannot be known in advance,
publicPathand similar configurations should use relative paths instead of absolute paths - This solves resource loading issues
- When web projects are deployed to static hosting CDN, since paths cannot be known in advance,
CloudBase Web SDK Usage
- SDK Integration:
- If user's project needs database, cloud functions, and other features, need to introduce
@cloudbase/js-sdk@latestin the web application - Official CDN:
https://static.cloudbase.net/cloudbase-js-sdk/latest/cloudbase.full.js - Prefer npm for React, Vue, Vite, Webpack, and other bundler-based projects
- Prefer the CDN only for static HTML pages, quick demos, embedded snippets, or README examples where a build step is unnecessary
- If user's project needs database, cloud functions, and other features, need to introduce
CDN quick start (static HTML / no-build):
<script src="https://static.cloudbase.net/cloudbase-js-sdk/latest/cloudbase.full.js"></script>
<script>
const app = cloudbase.init({
env: "xxxx-yyy",
});
</script>
Important: Authentication must use SDK built-in features. It is strictly forbidden to implement login authentication logic using cloud functions!
import cloudbase from "@cloudbase/js-sdk";
const app = cloudbase.init({
env: "xxxx-yyy", // Can query environment ID via envQuery tool
});
const auth = app.auth();
// Check current login state
let loginState = await auth.getLoginState();
if (loginState && loginState.user) {
// Logged in
const user = await auth.getCurrentUser();
console.log("Current user:", user);
} else {
// Not logged in - use SDK built-in authentication features
// Collect user's phone number into variable `phoneNum` by providing a input UI
// Send SMS code
const verificationInfo = await auth.getVerification({
phone_number: `+86 ${phoneNum}`,
});
// Collect user's phone number into variable `verificationCode` by providing a input UI
// Sign in
await auth.signInWithSms({
verificationInfo,
verificationCode,
phoneNum,
});
}
Initialization rules (Web, @cloudbase/js-sdk):
- Always use synchronous initialization with the pattern above
- Do not lazy-load the SDK with
import("@cloudbase/js-sdk") - Do not wrap SDK initialization in async helpers such as
initCloudBase()with internalinitPromisecaches - Keep a single shared
app/authinstance in your frontend app; reuse it instead of re-initializing
Web SDK API usage rules
- Only use documented CloudBase Web SDK methods
- Before calling any method on
app,auth,db, or other SDK objects, confirm it exists in the official CloudBase Web SDK documentation - If a method or option is not mentioned in the official docs (for example some guessed method name), do NOT invent or use it
Authentication Best Practices
-
Must use SDK built-in authentication: CloudBase Web SDK provides complete authentication features, including login by SMS, anonymous login, custom login, etc.
-
Forbidden to implement login using cloud functions: Do not create cloud functions to handle login logic, this is the wrong approach
-
User data management: After login, user information can be obtained via
auth.getCurrentUser(), then stored to database -
Error handling: All authentication operations should include complete error handling logic
Build Process
Web project build process: Ensure npm install command has been executed first, then refer to project documentation for building
More by TencentCloudBase
View all →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
rust-coding-skill
UtakataKyosui
Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.