Skip to content

Commit de9a5b9

Browse files
authored
Add B2C Commerce agent skills and docs commands (#34)
* Add B2C Commerce agent skills with XSD-validated XML examples 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 * Add b2c-webservices skill for web service integrations 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 * Add b2c-logging skill for script logging 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 * Update b2c-webdav skill with comprehensive log file reference 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 * Add skill-authoring skill for creating user-facing skills 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 * Update agent-skills documentation to be more maintainable - 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 * Add b2c-custom-caches skill for custom cache usage 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. * Add b2c-hooks skill for hook registration and customization 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. * Add docs command topic for Script API documentation and XSD schemas 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. * Fix eslint import/namespace error for marked-terminal Use createRequire to load the marked-terminal CJS module, avoiding eslint-plugin-import parser issues that caused inconsistent behavior between local and CI environments. * Fix eslint CI error for marked-terminal import - 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 * skill clarity after manual testing for e2e scenario * clarity
1 parent 8a1a9ef commit de9a5b9

643 files changed

Lines changed: 164239 additions & 81 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
---
2+
name: skill-authoring
3+
description: Guide for creating and maintaining user-facing agent skills
4+
---
5+
6+
# Skill Authoring Guide
7+
8+
This skill guides you through creating user-facing agent skills. For the canonical reference, see [agentskills.io](https://agentskills.io/home).
9+
10+
## Skill Structure
11+
12+
A skill is a folder containing a `SKILL.md` file with metadata and instructions:
13+
14+
```
15+
my-skill/
16+
├── SKILL.md # Required: instructions + metadata
17+
├── scripts/ # Optional: executable code
18+
├── references/ # Optional: additional documentation
19+
└── assets/ # Optional: templates, resources
20+
```
21+
22+
## SKILL.md Format
23+
24+
### Required Frontmatter
25+
26+
```yaml
27+
---
28+
name: skill-name
29+
description: Brief description of what the skill does
30+
---
31+
```
32+
33+
- **name**: Unique identifier (lowercase, hyphens)
34+
- **description**: One-line summary (loaded at startup for all skills)
35+
36+
### Instructions Body
37+
38+
The body contains markdown instructions that tell the agent how to perform the task.
39+
40+
```markdown
41+
---
42+
name: my-skill
43+
description: Does something useful
44+
---
45+
46+
# Skill Title
47+
48+
Brief overview of what this skill helps accomplish.
49+
50+
## When to Use
51+
52+
Describe scenarios when this skill applies.
53+
54+
## How to Use
55+
56+
Step-by-step instructions or patterns.
57+
58+
## Examples
59+
60+
Concrete examples demonstrating usage.
61+
62+
## Reference
63+
64+
- [Detailed Reference](references/REFERENCE.md) - Link to additional docs
65+
```
66+
67+
## Progressive Disclosure
68+
69+
Structure skills for efficient context usage:
70+
71+
| Layer | Token Budget | When Loaded |
72+
|-------|--------------|-------------|
73+
| Metadata | ~100 tokens | At startup (all skills) |
74+
| Instructions | < 5000 tokens | When skill activated |
75+
| References | As needed | On demand |
76+
77+
### Guidelines
78+
79+
1. **Keep SKILL.md under 500 lines** - Move detailed content to references
80+
2. **Front-load key information** - Put most important patterns first
81+
3. **Use tables for quick reference** - Easy to scan
82+
4. **Link to references** - Don't inline everything
83+
84+
## Optional Directories
85+
86+
### scripts/
87+
88+
Executable code that agents can run:
89+
90+
```
91+
scripts/
92+
├── validate.sh # Validation script
93+
├── generate.py # Code generator
94+
└── setup.js # Setup helper
95+
```
96+
97+
Scripts should:
98+
- Be self-contained or document dependencies
99+
- Include helpful error messages
100+
- Handle edge cases gracefully
101+
102+
### references/
103+
104+
Additional documentation loaded on demand:
105+
106+
```
107+
references/
108+
├── PATTERNS.md # Common patterns
109+
├── API.md # API reference
110+
└── EXAMPLES.md # Extended examples
111+
```
112+
113+
Keep individual reference files focused. Smaller files = less context usage.
114+
115+
### assets/
116+
117+
Static resources:
118+
119+
```
120+
assets/
121+
├── template.xml # File templates
122+
├── schema.json # Schemas
123+
└── diagram.png # Visual aids
124+
```
125+
126+
## File References
127+
128+
Use relative paths from the skill root:
129+
130+
```markdown
131+
See [the reference guide](references/REFERENCE.md) for details.
132+
133+
Run the setup script:
134+
scripts/setup.sh
135+
```
136+
137+
Keep references one level deep. Avoid deeply nested chains.
138+
139+
## Skill Categories
140+
141+
### Developer Skills (`.claude/skills/`)
142+
143+
Skills for contributors working on this codebase:
144+
145+
- Command development patterns
146+
- Testing approaches
147+
- API client patterns
148+
- Documentation standards
149+
150+
### User-Facing Skills (`plugins/*/skills/`)
151+
152+
Skills for users of the tool:
153+
154+
- CLI command usage
155+
- Platform-specific patterns (B2C Commerce)
156+
- Integration guides
157+
158+
## Writing Effective Skills
159+
160+
### 1. Start with the User's Goal
161+
162+
```markdown
163+
## Overview
164+
165+
This skill helps you [accomplish X] by [doing Y].
166+
```
167+
168+
### 2. Provide Quick Reference Tables
169+
170+
```markdown
171+
| Command | Description |
172+
|---------|-------------|
173+
| `cmd1` | Does X |
174+
| `cmd2` | Does Y |
175+
```
176+
177+
### 3. Show Concrete Examples
178+
179+
```markdown
180+
## Examples
181+
182+
### Basic Usage
183+
184+
\`\`\`bash
185+
b2c command --flag value
186+
\`\`\`
187+
188+
### Advanced Usage
189+
190+
\`\`\`bash
191+
b2c command --complex-flag
192+
\`\`\`
193+
```
194+
195+
### 4. Explain When NOT to Use
196+
197+
```markdown
198+
## When NOT to Use
199+
200+
- Scenario A (use skill-x instead)
201+
- Scenario B (manual approach better)
202+
```
203+
204+
### 5. Link to Authoritative Sources
205+
206+
Reference official documentation rather than duplicating it:
207+
208+
```markdown
209+
## Reference
210+
211+
For complete API documentation, see [Official Docs](https://example.com/docs).
212+
```
213+
214+
## Validation Checklist
215+
216+
Before publishing a skill:
217+
218+
- [ ] Frontmatter has `name` and `description`
219+
- [ ] SKILL.md under 500 lines
220+
- [ ] Key information appears early
221+
- [ ] Examples are concrete and runnable
222+
- [ ] Reference links are valid
223+
- [ ] No deeply nested reference chains
224+
- [ ] Tested with target agent
225+
226+
## Detailed Reference
227+
228+
- [Patterns and Examples](references/PATTERNS.md) - Patterns from B2C skills

0 commit comments

Comments
 (0)