-
Notifications
You must be signed in to change notification settings - Fork 2
Add B2C Commerce agent skills and docs commands #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
clavery
wants to merge
11
commits into
main
Choose a base branch
from
feature/b2c-agent-skills
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+164,194
−73
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add 9 agent skills for B2C Commerce development guidance: **Developer Skills (plugins/b2c/skills/):** - b2c-custom-job-steps: Task and chunk-oriented job step creation - b2c-controllers: SFRA and classic controller patterns - b2c-isml: ISML template tags and expressions - b2c-forms: Form XML definitions and SFRA handling - b2c-localization: Resource bundles and locale support - b2c-business-manager-extensions: BM menu items and extensions - b2c-page-designer: Page and component development - b2c-metadata: System object extensions and custom objects **CLI Skills (plugins/b2c-cli/skills/):** - b2c-site-import-export: Site archive import/export with CLI **Validation against official sources:** - Validated against official B2C Commerce documentation - XML examples validated against XSD schemas from dwre-tools - Key fixes applied: - steptypes.json location (cartridge root, not inside cartridge/) - preferences.xml structure (custom-preferences/preference) - Value definitions use <display> not <display-value> - Custom object data uses <object-attribute> not <custom-attribute> - ISML tag location constraints documented - Parameter validation attributes for job steps
Comprehensive skill covering: - Service Framework overview and components - LocalServiceRegistry.createService() pattern - Service callbacks (createRequest, parseResponse, execute, etc.) - Result object handling and error states - Log filtering for sensitive data Reference documentation includes: - HTTP-SERVICES.md: REST API patterns, authentication (Basic, OAuth, API keys), multipart uploads, file downloads, response caching, mTLS - FTP-SERVICES.md: SFTP operations (list, get, put, delete), multi-operation patterns, file processing workflows - SOAP-SERVICES.md: WSDL stubs, WS-Security, WSUtil, custom headers, complex types, MTOM attachments - SERVICES-XML.md: XML import/export format for service configurations, credentials, profiles, and services
Comprehensive skill covering: - Logger class (static methods for quick logging) - Log class (instance methods with categories) - Log levels: debug, info, warn, error, fatal - Custom named log files with file prefix - LogNDC for nested diagnostic context - Message formatting with Java MessageFormat syntax - Best practices for logging Reference documentation includes: - LOG-FILES.md: Log file types (custom and system), WebDAV locations, retention periods, storage limits, quota logs, security logs, import/export logs, and log entry formats
Added detailed log file documentation: - Log file naming patterns (<type>-<hostname>-appserver-<date>.log) - Custom log file types (customdebug, custominfo, customwarn, customerror, customfatal) - Custom named log files (custom-<prefix>-<hostname>-appserver-<date>.log) - System log file types (error, warn, jobs, quota, deprecation, etc.) - Log retention and archive locations (log_archive/ for compressed logs) - Security logs and import/export logs - Common log query examples using grep
Meta-skill documenting how to create and maintain agent skills: - Skill structure (SKILL.md + optional directories) - Frontmatter metadata requirements - Progressive disclosure principles (metadata → instructions → references) - Token budgets and context efficiency - Optional directories (scripts/, references/, assets/) - File reference patterns - Skill categories (developer vs user-facing) - Writing effective skills checklist Reference documentation includes: - PATTERNS.md: Patterns learned from B2C skills including content organization, effective tables, code examples, XML validation, progressive complexity, common skill templates, and anti-patterns Canonical reference: https://agentskills.io/home
- Describe plugins generally instead of listing every individual skill - Remove skill tables that would need constant updates as skills are added - Link to GitHub directories for browsing available skills - Add Cursor docs link for skills configuration - Add VS Code Agent Skills documentation link - Update usage examples to include logging and web services
Covers: - When to use custom caches (expensive calculations, external responses, config) - Defining caches in caches.json with package.json reference - CacheMgr and Cache Script API classes - get(key, loader) pattern for automatic population - Scoped cache keys for site/catalog/locale separation - Limitations (20MB memory, 128KB entry size, no cross-server sync) - Common patterns for external APIs, calculations, and configuration - Troubleshooting guide Content validated against official documentation and Script API reference.
Covers: - Hook registration via package.json and hooks.json - HookMgr API for calling and checking hooks - Status object for controlling hook flow - OCAPI/SCAPI hooks (before/after/modifyResponse patterns) - System hooks (calculate, payment, order) - Custom extension points - Passing data between hooks via request.custom - Remote includes in modifyResponse hooks - Custom properties (c_ prefix) in API responses - Error handling and circuit breaker - SCAPI vs OCAPI detection with request.isSCAPI() Reference files: - OCAPI-SCAPI-HOOKS.md: API hook patterns by resource - SYSTEM-HOOKS.md: Calculate, payment, order hooks Content validated against official documentation and Script API reference.
New CLI commands: - `b2c docs search <query>` - Fuzzy search bundled Script API documentation - `b2c docs read <query>` - Read documentation with terminal markdown rendering - `b2c docs schema <query>` - Read XSD schema files with fuzzy matching - `b2c docs download <output>` - Download docs from B2C instance SDK changes: - Add operations/docs module with search, read, and download functions - Bundle 519 Script API markdown files and 54 XSD schemas in data/ - Use createRequire for robust path resolution to bundled data - Export docs operations from main SDK entry point Also adds b2c-docs skill for agent usage examples.
Use createRequire to load the marked-terminal CJS module, avoiding eslint-plugin-import parser issues that caused inconsistent behavior between local and CI environments.
- Use standard ESM named import for marked-terminal - Disable import/namespace rule for that line (parser issue with CJS) - Set reportUnusedDisableDirectives to warn to handle environment differences where import/namespace may or may not fire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note this PR is extremely huge because it contains a copy of the script API docs, XSDs and other derived documentation
Summary
This PR adds 14 user-facing agent skills for B2C Commerce development guidance, plus a developer skill for authoring new skills. All XML examples validated against official XSD schemas.
Additionally, this PR adds a new
docscommand topic to the B2C CLI for searching and reading bundled Script API documentation and XSD schemas.Developer Skills (
plugins/b2c/skills/)b2c-custom-job-stepsb2c-controllersb2c-ismlb2c-formsb2c-localizationb2c-business-manager-extensionsb2c-page-designerb2c-metadatab2c-webservicesb2c-loggingb2c-custom-cachesb2c-hooksCLI Skills (
plugins/b2c-cli/skills/)b2c-site-import-exportb2c jobcommandsb2c-webdavb2c-docsContributor Skills (
.claude/skills/)skill-authoringNew CLI Commands:
docsTopicNew commands for accessing bundled B2C Commerce documentation offline:
b2c docs search <query>b2c docs read <class>b2c docs schema [name]b2c docs download <dir>Features:
--rawflag for piping markdown output--jsonflag for programmatic access--listflag to enumerate all available docs/schemasDocumentation
docs/guide/agent-skills.mdto describe plugins generally instead of listing every skillValidation
All skills validated against:
commerce-cloud-docs)dwre-tools/dwredocs/xsd/sfcc-b2c-offline-docs)Key XSD Validations Applied
cartridge/<custom-preferences>/<preference>structure (not<custom-preference>)<display>element (not<display-value>)<object-attribute>directly (not<custom-attributes>/<custom-attribute>)<isprint>only in body, etc.)Skill Highlights
b2c-hooks (new)
b2c-custom-caches
b2c-webservices
b2c-logging
b2c-webdav (updated)
skill-authoring (contributor skill)
Test Plan
b2c docs search ProductMgrreturns relevant resultsb2c docs read ProductMgrrenders documentation in terminalb2c docs schema catalogdisplays XSD schema