
e-commerce
E-commerce platforms, payment processing, and shopping cart patterns
- version
- 1.0.0
- GitHub stars
- 26
Add marketplace
/plugin marketplace add miles990/claude-software-skillsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install e-commerce@claude-software-skillsRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceE-Commerce Development
Overview
Building e-commerce applications with shopping carts, payment processing, inventory management, and order fulfillment.
Shopping Cart
Cart State Management
interface CartItem {
productId: string;
variantId?: string;
quantity: number;
price: number;
name: string;
image: string;
}
interface Cart {
id: string;
items: CartItem[];
subtotal: number;
tax: number;
shipping: number;
total: number;
discountCode?: string;
discountAmount: number;
}
// Zustand cart store
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
interface CartStore {
cart: Cart;
addItem: (item: Omit<CartItem, 'quantity'>, quantity?: number) => void;
updateQuantity: (productId: string, quantity: number) => void;
removeItem: (productId: string) => void;
clearCart: () => void;
applyDiscount: (code: string) => Promise<void>;
}
const useCartStore = create<CartStore>()(
persist(
(set, get) => ({
cart: createEmptyCart(),
addItem: (item, quantity = 1) => {
set((state) => {
const existingIndex = state.cart.items.findIndex(
(i) => i.productId === item.productId && i.variantId === item.variantId
);
const newItems = [...state.cart.items];
if (existingIndex >= 0) {
newItems[existingIndex].quantity += quantity;
} else {
newItems.push({ ...item, quantity });
}
return { cart: recalculateCart({ ...state.cart, items: newItems }) };
});
},
updateQuantity: (productId, quantity) => {
set((state) => {
if (quantity <= 0) {
return {
cart: recalculateCart({
...state.cart,
items: state.cart.items.filter((i) => i.productId !== productId),
}),
};
}
const newItems = state.cart.items.map((item) =>
item.productId === productId ? { ...item, quantity } : item
);
return { cart: recalculateCart({ ...state.cart, items: newItems }) };
});
},
removeItem: (productId) => {
set((state) => ({
cart: recalculateCart({
...state.cart,
items: state.cart.items.filter((i) => i.productId !== productId),
}),
}));
},
clearCart: () => set({ cart: createEmptyCart() }),
applyDiscount: async (code) => {
const discount = await validateDiscountCode(code);
set((state) => ({
cart: recalculateCart({
...state.cart,
discountCode: code,
discountAmount: discount.amount,
}),
}));
},
}),
{ name: 'cart-storage' }
)
);
function recalculateCart(cart: Cart): Cart {
const subtotal = cart.items.reduce(
(sum, item) => sum + item.price * item.quantity,
0
);
const tax = subtotal * 0.1; // 10% tax
const shipping = subtotal > 100 ? 0 : 9.99;
const total = subtotal + tax + shipping - cart.discountAmount;
return { ...cart, subtotal, tax, shipping, total };
}
Payment Processing
Stripe Integration
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2023-10-16',
});
// Create checkout session
async function createCheckoutSession(cart: Cart, customerId?: string) {
const session = await stripe.checkout.sessions.create({
mode: 'payment',
customer: customerId,
line_items: cart.items.map((item) => ({
price_data: {
currency: 'usd',
product_data: {
name: item.name,
images: [item.image],
},
unit_amount: Math.round(item.price * 100),
},
quantity: item.quantity,
})),
discounts: cart.discountCode
? [{ coupon: cart.discountCode }]
: undefined,
shipping_address_collection: {
allowed_countries: ['US', 'CA', 'GB'],
},
success_url: `${process.env.APP_URL}/checkout/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${process.env.APP_URL}/cart`,
metadata: {
cartId: cart.id,
},
});
return session;
}
// Create payment intent (for custom checkout)
async function createPaymentIntent(amount: number, customerId?: string) {
const paymentIntent = await stripe.paymentIntents.create({
amount: Math.round(amount * 100),
currency: 'usd',
customer: customerId,
automatic_payment_methods: { enabled: true },
});
return {
clientSecret: paymentIntent.client_secret,
paymentIntentId: paymentIntent.id,
};
}
// Webhook handler
async function handleStripeWebhook(body: string, signature: string) {
const event = stripe.webhooks.constructEvent(
body,
signature,
process.env.STRIPE_WEBHOOK_SECRET!
);
switch (event.type) {
case 'checkout.session.completed': {
const session = event.data.object as Stripe.Checkout.Session;
await fulfillOrder(session);
break;
}
case 'payment_intent.succeeded': {
const paymentIntent = event.data.object as Stripe.PaymentIntent;
await handlePaymentSuccess(paymentIntent);
break;
}
case 'payment_intent.payment_failed': {
const paymentIntent = event.data.object as Stripe.PaymentIntent;
await handlePaymentFailure(paymentIntent);
break;
}
}
}
React Stripe Elements
import { loadStripe } from '@stripe/stripe-js';
import {
Elements,
PaymentElement,
useStripe,
useElements,
} from '@stripe/react-stripe-js';
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_KEY!);
function CheckoutForm({ clientSecret }: { clientSecret: string }) {
const stripe = useStripe();
const elements = useElements();
const [error, setError] = useState<string | null>(null);
const [processing, setProcessing] = useState(false);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!stripe || !elements) return;
setProcessing(true);
setError(null);
const { error: submitError } = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: `${window.location.origin}/checkout/success`,
},
});
if (submitError) {
setError(submitError.message || 'Payment failed');
setProcessing(false);
}
};
return (
<form onSubmit={handleSubmit}>
<PaymentElement />
{error && <div className="error">{error}</div>}
<button type="submit" disabled={!stripe || processing}>
{processing ? 'Processing...' : 'Pay Now'}
</button>
</form>
);
}
function CheckoutPage() {
const [clientSecret, setClientSecret] = useState('');
useEffect(() => {
fetch('/api/create-payment-intent', {
method: 'POST',
body: JSON.stringify({ amount: cart.total }),
})
.then((res) => res.json())
.then((data) => setClientSecret(data.clientSecret));
}, []);
if (!clientSecret) return <Loading />;
return (
<Elements
stripe={stripePromise}
options={{ clientSecret, appearance: { theme: 'stripe' } }}
>
<CheckoutForm clientSecret={clientSecret} />
</Elements>
);
}
Inventory Management
interface Product {
id: string;
name: string;
sku: string;
price: number;
inventory: number;
lowStockThreshold: number;
variants: ProductVariant[];
}
interface ProductVariant {
id: string;
name: string;
sku: string;
price: number;
inventory: number;
attributes: Record<string, string>;
}
// Inventory operations with optimistic locking
async function reserveInventory(items: CartItem[]): Promise<boolean> {
return prisma.$transaction(async (tx) => {
for (const item of items) {
const product = await tx.product.findUnique({
where: { id: item.productId },
select: { inventory: true, version: true },
});
if (!product || product.inventory < item.quantity) {
throw new Error(`Insufficient inventory for ${item.name}`);
}
// Optimistic locking with version check
const updated = await tx.product.updateMany({
where: {
id: item.productId,
version: product.version,
inventory: { gte: item.quantity },
},
data: {
inventory: { decrement: item.quantity },
version: { increment: 1 },
},
});
if (updated.count === 0) {
throw new Error(`Concurrent modification for ${item.name}`);
}
}
return true;
});
}
// Release inventory (on order cancellation)
async function releaseInventory(orderId: string) {
const order = await prisma.order.findUnique({
where: { id: orderId },
include: { items: true },
});
await prisma.$transaction(
order.items.map((item) =>
prisma.product.update({
where: { id: item.productId },
data: { inventory: { increment: item.quantity } },
})
)
);
}
// Low stock alerts
async function checkLowStock() {
const lowStockProducts = await prisma.product.findMany({
where: {
inventory: { lte: prisma.product.fields.lowStockThreshold },
},
});
for (const product of lowStockProducts) {
await sendLowStockAlert(product);
}
}
Order Management
enum OrderStatus {
PENDING = 'pending',
PAID = 'paid',
PROCESSING = 'processing',
SHIPPED = 'shipped',
DELIVERED = 'delivered',
CANCELLED = 'cancelled',
REFUNDED = 'refunded',
}
interface Order {
id: string;
userId: string;
status: OrderStatus;
items: OrderItem[];
subtotal: number;
tax: number;
shipping: number;
total: number;
shippingAddress: Address;
billingAddress: Address;
paymentIntentId: string;
trackingNumber?: string;
createdAt: Date;
updatedAt: Date;
}
// Create order from checkout session
async function fulfillOrder(session: Stripe.Checkout.Session) {
const order = await prisma.order.create({
data: {
userId: session.client_reference_id!,
status: OrderStatus.PAID,
paymentIntentId: session.payment_intent as string,
subtotal: session.amount_subtotal! / 100,
total: session.amount_total! / 100,
shippingAddress: JSON.parse(session.metadata!.shippingAddress),
items: {
create: JSON.parse(session.metadata!.items),
},
},
});
// Reserve inventory
await reserveInventory(order.items);
// Send confirmation email
await sendOrderConfirmation(order);
// Notify fulfillment system
await notifyFulfillment(order);
return order;
}
// Order status updates
async function updateOrderStatus(orderId: string, status: OrderStatus) {
const order = await prisma.order.update({
where: { id: orderId },
data: { status },
});
// Send notification
await sendOrderStatusUpdate(order);
return order;
}
Product Catalog
// Product search with filters
async function searchProducts(params: {
query?: string;
category?: string;
minPrice?: number;
maxPrice?: number;
sortBy?: 'price' | 'name' | 'createdAt';
sortOrder?: 'asc' | 'desc';
page?: number;
limit?: number;
}) {
const {
query,
category,
minPrice,
maxPrice,
sortBy = 'createdAt',
sortOrder = 'desc',
page = 1,
limit = 20,
} = params;
const where: Prisma.ProductWhereInput = {
status: 'active',
...(query && {
OR: [
{ name: { contains: query, mode: 'insensitive' } },
{ description: { contains: query, mode: 'insensitive' } },
],
}),
...(category && { categoryId: category }),
...(minPrice && { price: { gte: minPrice } }),
...(maxPrice && { price: { lte: maxPrice } }),
};
const [products, total] = await Promise.all([
prisma.product.findMany({
where,
orderBy: { [sortBy]: sortOrder },
skip: (page - 1) * limit,
take: limit,
include: {
category: true,
images: true,
variants: true,
},
}),
prisma.product.count({ where }),
]);
return {
products,
pagination: {
page,
limit,
total,
totalPages: Math.ceil(total / limit),
},
};
}
Related Skills
- [[payment-processing]] - Payment systems
- [[backend]] - API development
- [[database]] - Data modeling
From the miles990/claude-software-skills README
Claude Software Skills
55 modular software development skills for Claude Code - from architecture to deployment
┌─────────────────────────────────────────────────────────────────┐
│ Claude Software Skills │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Software │ │ Software │ │ Development │ │
│ │ Design │ │ Engineering │ │ Stacks │ │
│ │ 6 │ │ 8 │ │ 8 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Tools & │ │ Domain │ │ Programming │ │
│ │ Integrations │ │ Applications │ │ Languages │ │
│ │ 9 │ │ 12 │ │ 12 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
│ AI 自動識別任務 → 載入對應領域知識 │
└─────────────────────────────────────────────────────────────────┘
Features
- MCP Compatible - Works with Claude Code, Cursor, and other MCP clients
- Semantic Search - Claude automatically finds relevant skills for your task
- Cross-Domain Integration - Skills work together seamlessly
- Best Practices Built-In - Each skill includes patterns and anti-patterns
- Modular Architecture - Use only what you need
- Sharp Edges - Proactive warnings about common pitfalls with detection patterns
- Validations - Executable code quality rules with regex/ast patterns
- Collaboration - Skills declare relationships for smart delegation and context passing
Installation
Plugin Marketplace (Recommended)
# 1. Add marketplace (GitHub format: owner/repo)
/plugin marketplace add miles990/claude-software-skills
# 2. Open plugin management interface, view available plugins in Discover tab
/plugin
# 3. Install specific skills (choose what you need)
/plugin install frontend@claude-software-skills
/plugin install backend@claude-software-skills
/plugin install api-design@claude-software-skills
# Or mention skill name in conversation, Claude will auto-load
Supported GitHub formats:
# Short format (recommended)
/plugin marketplace add miles990/claude-software-skills
# HTTPS URL
/plugin marketplace add https://github.com/miles990/claude-software-skills.git
# Specify branch or tag
/plugin marketplace add miles990/claude-software-skills#main
Plugin commands:
| Command | Description |
|---|---|
/plugin | Open interactive plugin management interface |
/plugin install <name>@<marketplace> | Install specific plugin |
/plugin disable <name>@<marketplace> | Temporarily disable plugin |
/plugin uninstall <name>@<marketplace> | Completely remove plugin |
Available Skills
Software Design (6 skills)
| Skill | Description |
|---|---|
architecture-patterns | Software architecture patterns and best practices |
design-patterns | Classic and modern software design patterns |
api-design | RESTful, GraphQL, gRPC, and API best practices |
system-design | Scalability, availability, and distributed systems design |
data-design | Data modeling, schema design, and data architecture |
ux-principles | User experience design principles for developers |
Software Engineering (8 skills)
| Skill | Description |
|---|---|
code-quality | Clean code principles, SOLID, and code review practices |
testing-strategies | Unit, integration, E2E testing and TDD practices |
devops-cicd | CI/CD pipelines, infrastructure as code, and deployment |
performance-optimization | Profiling, optimization techniques, and best practices |
security-practices | OWASP Top 10, authentication, and secure coding |
reliability-engineering | SRE principles, observability, and incident management |
documentation | Technical writing, API docs, and documentation best practices |
internationalization | i18n/l10n architecture design and multi-language support |
Development Stacks (8 skills)
| Skill | Description |
|---|---|
frontend | Modern frontend with React, Vue, and web technologies |
backend | Backend with Node.js, Express, NestJS, and server patterns |
mobile | Mobile with React Native, Flutter, and native patterns |
database | Database design, SQL, NoSQL, and data management |
cloud-platforms | AWS, GCP, Azure services and cloud-native development |
ai-ml-integration | AI/ML APIs, LLM integration, and intelligent apps |
realtime-systems | WebSocket, real-time communication, event-driven |
edge-iot | Edge computing, IoT protocols, and embedded systems |
Tools & Integrations (9 skills)
| Skill | Description |
|---|---|
git-workflows | Git version control, branching, and collaboration |
project-management | Agile, Scrum, Kanban, and issue tracking |
development-environment | IDE setup, dev containers, and local development |
monitoring-logging | Application monitoring, logging, and alerting |
api-tools | API testing, documentation, and development tools |
automation-scripts | Build automation, task runners, and scripting |
auto-dev-setup | Auto-Dev workflow for Human-in-the-Loop automation |
claude-code-plugin | Claude Code Plugin development and marketplace management |
claude-code-sdk | Claude Code SDK for AI-powered applications |
Domain Applications (12 skills)
| Skill | Description |
|---|---|
application-patterns | Common application development patterns |
e-commerce | E-commerce platforms, payments, shopping cart |
saas-platforms | SaaS architecture, multi-tenancy, subscriptions |
content-platforms | CMS, blogging platforms, content management |
communication-systems | Email, notifications, messaging systems |
developer-tools | CLI tools, SDKs, developer experience |
game-development | Game development patterns and architectures |
flame | Flame Engine 2D game development for Flutter |
flame-core | Flame Engine core - components, input, collision |
flame-systems | Flame Engine 14 game systems |
flame-templates | Game templates - RPG, Platformer, Roguelike |
desktop-apps | Desktop apps with Electron and Tauri |
Programming Languages (12 skills)
| Skill | Description |
|---|---|
javascript-typescript | Modern JavaScript and TypeScript patterns |
python | Python programming patterns and best practices |
go | Go programming patterns and idioms |
rust | Rust patterns and ownership concepts |
java-kotlin | Java and Kotlin programming patterns |
csharp-dotnet | C# and .NET development patterns |
cpp | Modern C++ programming patterns and idioms |
ruby | Ruby programming patterns and idioms |
php | Modern PHP programming patterns |
swift | Swift patterns for iOS and macOS |
shell-bash | Shell scripting and Bash programming |
sql | SQL patterns for database querying and design |
Other Installation Methods
Clone to Skills Directory
# Clone to your skills directory
git clone https://github.com/miles990/claude-software-skills.git ~/.claude/skills/software-skills
Claude will automatically discover and use the skills when relevant to your tasks.
With MCP Server
This repository is compatible with claude-skills-mcp:
# Install the MCP server
pip install claude-skills-mcp
# Add this repository as a skill source
# The server will load skills from ~/.claude/skills/
Cursor IDE
Add to your Cursor MCP settings:
{
"mcpServers": {
"software-skills": {
"command": "npx",
"args": ["-y", "claude-skills-mcp"],
"env": {
"SKILLS_PATH": "/path/to/claude-software-skills"
}
}
}
}
Manual Reference
Simply clone and reference the SKILL.md files in your prompts:
git clone https://github.com/miles990/claude-software-skills.git
Auto-Dev: Automated Development Workflow
One-click setup for GitHub Actions automated development workflow, let Claude help you complete development tasks.
Quick Setup
Using API Key:
curl -fsSL https://raw.githubusercontent.com/miles990/claude-software-skills/main/scripts/setup-auto-dev-apikey.sh | bash
Using Claude Max (OAuth):
curl -fsSL https://raw.githubusercontent.com/miles990/claude-software-skills/main/scripts/setup-auto-dev-max.sh | bash
Post-Installation Setup
| Version | Setup Method |
|---|---|
| API Key | Get Key from console.anthropic.com, set in GitHub Secrets ANTHROPIC_API_KEY |
| Claude Max | Run claude /install-github-app for auto OAuth Token setup |
Usage
- Issue Trigger: Create Issue → Add
auto-devlabel - Comment Trigger: Comment
@claude [instruction]on any Issue/PR
Detailed docs: AUTO-DEV.md
Usage Examples
User: Help me design a microservices architecture for an e-commerce platform
Claude: [Automatically uses architecture-patterns + e-commerce + api-design skills]
User: Review this Python code for performance issues
Claude: [Automatically uses python + performance-optimization + code-quality skills]
User: Set up CI/CD for a React + Node.js monorepo
Claude: [Automatically uses devops-cicd + frontend + backend + git-workflows skills]
Directory Structure
claude-software-skills/
├── .claude-plugin/ # Plugin configuration
│ └── marketplace.json # Lists all 55 skills as individual plugins
├── .github/
│ └── workflows/ # CI/CD automation
├── software-design/ # Architecture & design skills
├── software-engineering/ # Development practices
├── development-stacks/ # Tech stack skills
├── tools-integrations/ # Developer tools
├── domain-applications/ # Domain-specific patterns
├── programming-languages/ # Language-specific skills
├── docs/
│ ├── SKILL-TEMPLATE.md # Template for new skills
│ └── software-skills.md
├── CONTRIBUTING.md
├── LICENSE
└── README.md
How It Works
Each skill module contains a SKILL.md file with:
- Metadata - Name, description, tags for semantic search
- Key Concepts - Core knowledge and terminology
- Best Practices - Recommended approaches with examples
- Common Pitfalls - What to avoid and why
- Patterns & Anti-patterns - Do's and don'ts with code
- Tools & Resources - Recommended tools and references
- Decision Guide - When to use this skill
When you describe a task, Claude:
- Searches for relevant skills using semantic matching
- Loads the appropriate SKILL.md files
- Applies the knowledge to your specific context
- Follows best practices while avoiding common pitfalls
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Adding a New Skill
- Create a directory under the appropriate category
- Add a
SKILL.mdfollowing our template - Include practical examples and best practices
- Submit a pull request
License
MIT License - See LICENSE for details.
Related Projects
- claude-domain-skills - Non-technical domain skills
- claude-skills-mcp - MCP server for skill discovery
Built for developers, by developers, with Claude
Details
- Marketplace
- miles990/claude-software-skills
- Source
- domain-applications/e-commerce
- Category
- Community
- Listed since
- Apr 6, 2026
More from miles990/claude-software-skills
All 56- edge-iotv1.0.0
- flamev1.0.0
- flame-corev1.0.0
- flame-systemsv1.0.0
- flame-templatesv1.0.0
- frontendv1.0.0
- game-developmentv1.0.0
- git-workflowsv1.0.0
- gov1.0.0
- internationalizationv1.0.0
- java-kotlinv1.0.0
- javascript-typescriptv1.0.0
- mobilev1.0.0
- monitoring-loggingv1.0.0
- performance-optimizationv1.0.0
- phpv1.0.0
- project-managementv1.0.0
- pythonv1.0.0
- realtime-systemsv1.0.0
- reliability-engineeringv1.0.0
- rubyv1.0.0
- rustv1.0.0
- saas-platformsv1.0.0
- security-practicesv1.0.0
Similar to e-commerce
More E-commerce
payment-processingPluginwshobson/agents42.8K starsPayment gateway integration with Stripe, PayPal, checkout flow implementation, subscription billing, and PCI compliance
shipshitdev-paymentsPluginshipshitdev/library39 starsPayment processing and financial integrations
content-platformsPluginmiles990/claude-software-skills26 starsCMS, blogging platforms, and content management patterns
application-patternsPluginmiles990/claude-software-skills26 starsCommon application development patterns and implementations
ecommerce-rechtPluginKlotzkette/claude-fuer-deutsches-recht1.9K starsSuper-Plugin für Online-Shops, Plattformen, Marktplätze und digitale Verbraucherprozesse.
ecommerce-checkout-optimizationSkillnexscope-ai/ecommerce-skills1.4K installsStructured checkout-flow advisory that diagnoses cart abandonment across major e-commerce platforms.