用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill ecom-integrations命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
Create clear action plans with steps, success criteria, and risk awareness. Use before implementing features, making changes, starting projects, or anytime you need a roadmap to success. Triggers on "plan this", "how should we approach", "what's the strategy", "steps to complete", or when facing complex multi-step work.
Add keyboard navigation to a feature using CommandRegistryService. Use when implementing keyboard shortcuts, vim-style navigation, or hotkeys for a page or component.
基于 SOC 职业分类
正在显示 SKILL.md
| name | ecom-integrations |
| description | Ecommerce integration patterns and decomposer/composer |
Decomposers transform external platform data → Violet canonical models.
public interface Decomposer<P, V> {
V decompose(P platformEntity);
List<V> decomposeList(List<P> platformEntities);
}
public class ShopifyProductDecomposer implements Decomposer<ShopifyProduct, Offer> {
public static Offer decompose(ShopifyProduct shopifyProduct) {
Offer offer = new Offer();
offer.setExternalId(String.valueOf(shopifyProduct.getId()));
offer.setName(shopifyProduct.getTitle());
offer.setDescription(shopifyProduct.getBodyHtml());
offer.setVendor(shopifyProduct.getVendor());
offer.setSkus(decomposeVariants(shopifyProduct.getVariants()));
offer.setImages(decomposeImages(shopifyProduct.getImages()));
offer.setTags(parseTags(shopifyProduct.getTags()));
offer.setStatus(mapStatus(shopifyProduct.getStatus()));
return offer;
}
private static OfferStatus mapStatus(String shopifyStatus) {
return switch (shopifyStatus) {
case "active" -> OfferStatus.AVAILABLE;
case "draft" -> OfferStatus.DRAFT;
case "archived" -> OfferStatus.UNAVAILABLE;
default -> OfferStatus.UNKNOWN;
};
}
}
Composers transform Violet canonical models → external platform formats.
public interface Composer<V, P> {
P compose(V violetEntity);
List<P> composeList(List<V> violetEntities);
}
public class ShopifyOrderComposer implements Composer<Order, ShopifyOrderInput> {
public static ShopifyOrderInput compose(Order violetOrder) {
ShopifyOrderInput input = new ShopifyOrderInput();
input.setEmail(violetOrder.getCustomer().getEmail());
input.setLineItems(composeLineItems(violetOrder.getItems()));
input.setShippingAddress(composeAddress(violetOrder.getShippingAddress()));
input.setBillingAddress(composeAddress(violetOrder.getBillingAddress()));
input.setFinancialStatus(mapFinancialStatus(violetOrder.getPaymentStatus()));
input.setFulfillmentStatus(mapFulfillmentStatus(violetOrder.getFulfillmentStatus()));
return input;
}
private static String mapFinancialStatus(PaymentStatus status) {
return switch (status) {
case PAID -> "paid";
case PENDING -> "pending";
case REFUNDED -> "refunded";
case PARTIALLY_REFUNDED -> "partially_refunded";
default -> "pending";
};
}
}
@Test
void decompose_shouldMapAllFields() {
ShopifyProduct input = createTestProduct();
Offer result = ShopifyProductDecomposer.decompose(input);
assertThat(result.getExternalId()).isEqualTo("123");
assertThat(result.getName()).isEqualTo("Test Product");
assertThat(result.getStatus()).isEqualTo(OfferStatus.AVAILABLE);
}
@Test
void decompose_shouldHandleNullFields() {
ShopifyProduct input = new ShopifyProduct();
input.setId(123L);
// Other fields null
Offer result = ShopifyProductDecomposer.decompose(input);
assertThat(result.getExternalId()).isEqualTo("123");
assertThat(result.getName()).isNull();
}
@Test
void compose_shouldProduceValidPlatformInput() {
Order violetOrder = createTestOrder();
ShopifyOrderInput result = ShopifyOrderComposer.compose(violetOrder);
assertThat(result.getEmail()).isNotNull();
assertThat(result.getLineItems()).isNotEmpty();
}
@Test
void compose_shouldMapStatusCorrectly() {
Order order = new Order();
order.setPaymentStatus(PaymentStatus.PAID);
ShopifyOrderInput result = ShopifyOrderComposer.compose(order);
assertThat(result.getFinancialStatus()).isEqualTo("paid");
}
Every integration must document status mappings:
| Violet Status | Shopify | BigCommerce | WooCommerce |
|---|---|---|---|
| PENDING | unfulfilled | Awaiting Fulfillment | pending |
| PROCESSING | in_progress | Awaiting Shipment | processing |
| SHIPPED | fulfilled | Shipped | completed |
| DELIVERED | fulfilled | Delivered | completed |
| CANCELLED | cancelled | Cancelled | cancelled |