scc-universal 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +44 -0
- package/.cursor/agents/deep-researcher.md +142 -0
- package/.cursor/agents/doc-updater.md +219 -0
- package/.cursor/agents/eval-runner.md +335 -0
- package/.cursor/agents/learning-engine.md +210 -0
- package/.cursor/agents/loop-operator.md +245 -0
- package/.cursor/agents/refactor-cleaner.md +119 -0
- package/.cursor/agents/sf-admin-agent.md +127 -0
- package/.cursor/agents/sf-agentforce-agent.md +126 -0
- package/.cursor/agents/sf-apex-agent.md +117 -0
- package/.cursor/agents/sf-architect.md +426 -0
- package/.cursor/agents/sf-aura-reviewer.md +369 -0
- package/.cursor/agents/sf-bugfix-agent.md +101 -0
- package/.cursor/agents/sf-flow-agent.md +155 -0
- package/.cursor/agents/sf-integration-agent.md +141 -0
- package/.cursor/agents/sf-lwc-agent.md +123 -0
- package/.cursor/agents/sf-review-agent.md +357 -0
- package/.cursor/agents/sf-visualforce-reviewer.md +465 -0
- package/.cursor/hooks/adapter.js +81 -0
- package/.cursor/hooks/after-file-edit.js +26 -0
- package/.cursor/hooks/after-mcp-execution.js +12 -0
- package/.cursor/hooks/after-shell-execution.js +30 -0
- package/.cursor/hooks/after-tab-file-edit.js +12 -0
- package/.cursor/hooks/before-mcp-execution.js +11 -0
- package/.cursor/hooks/before-read-file.js +13 -0
- package/.cursor/hooks/before-shell-execution.js +29 -0
- package/.cursor/hooks/before-submit-prompt.js +23 -0
- package/.cursor/hooks/pre-compact.js +7 -0
- package/.cursor/hooks/session-end.js +10 -0
- package/.cursor/hooks/session-start.js +10 -0
- package/.cursor/hooks/stop.js +18 -0
- package/.cursor/hooks/subagent-start.js +10 -0
- package/.cursor/hooks/subagent-stop.js +10 -0
- package/.cursor/hooks.json +107 -0
- package/.cursor/skills/aside/SKILL.md +115 -0
- package/.cursor/skills/checkpoint/SKILL.md +50 -0
- package/.cursor/skills/configure-scc/SKILL.md +160 -0
- package/.cursor/skills/continuous-agent-loop/SKILL.md +260 -0
- package/.cursor/skills/mcp-server-patterns/SKILL.md +142 -0
- package/.cursor/skills/model-route/SKILL.md +81 -0
- package/.cursor/skills/prompt-optimizer/SKILL.md +366 -0
- package/.cursor/skills/refactor-clean/SKILL.md +133 -0
- package/.cursor/skills/resume-session/SKILL.md +111 -0
- package/.cursor/skills/save-session/SKILL.md +183 -0
- package/.cursor/skills/search-first/SKILL.md +140 -0
- package/.cursor/skills/security-scan/SKILL.md +142 -0
- package/.cursor/skills/sessions/SKILL.md +124 -0
- package/.cursor/skills/sf-agentforce-development/SKILL.md +449 -0
- package/.cursor/skills/sf-apex-async-patterns/SKILL.md +324 -0
- package/.cursor/skills/sf-apex-best-practices/SKILL.md +421 -0
- package/.cursor/skills/sf-apex-constraints/SKILL.md +79 -0
- package/.cursor/skills/sf-apex-cursor/SKILL.md +336 -0
- package/.cursor/skills/sf-apex-enterprise-patterns/SKILL.md +344 -0
- package/.cursor/skills/sf-apex-testing/SKILL.md +407 -0
- package/.cursor/skills/sf-api-design/SKILL.md +237 -0
- package/.cursor/skills/sf-approval-processes/SKILL.md +312 -0
- package/.cursor/skills/sf-aura-development/SKILL.md +260 -0
- package/.cursor/skills/sf-build-fix/SKILL.md +120 -0
- package/.cursor/skills/sf-data-modeling/SKILL.md +274 -0
- package/.cursor/skills/sf-debugging/SKILL.md +362 -0
- package/.cursor/skills/sf-deployment/SKILL.md +291 -0
- package/.cursor/skills/sf-deployment-constraints/SKILL.md +153 -0
- package/.cursor/skills/sf-devops-ci-cd/SKILL.md +322 -0
- package/.cursor/skills/sf-docs-lookup/SKILL.md +100 -0
- package/.cursor/skills/sf-e2e-testing/SKILL.md +321 -0
- package/.cursor/skills/sf-experience-cloud/SKILL.md +248 -0
- package/.cursor/skills/sf-flow-development/SKILL.md +376 -0
- package/.cursor/skills/sf-governor-limits/SKILL.md +319 -0
- package/.cursor/skills/sf-harness-audit/SKILL.md +139 -0
- package/.cursor/skills/sf-help/SKILL.md +156 -0
- package/.cursor/skills/sf-integration/SKILL.md +479 -0
- package/.cursor/skills/sf-lwc-constraints/SKILL.md +128 -0
- package/.cursor/skills/sf-lwc-development/SKILL.md +302 -0
- package/.cursor/skills/sf-lwc-testing/SKILL.md +387 -0
- package/.cursor/skills/sf-metadata-management/SKILL.md +285 -0
- package/.cursor/skills/sf-platform-events-cdc/SKILL.md +372 -0
- package/.cursor/skills/sf-quickstart/SKILL.md +170 -0
- package/.cursor/skills/sf-security/SKILL.md +330 -0
- package/.cursor/skills/sf-security-constraints/SKILL.md +125 -0
- package/.cursor/skills/sf-soql-constraints/SKILL.md +129 -0
- package/.cursor/skills/sf-soql-optimization/SKILL.md +353 -0
- package/.cursor/skills/sf-tdd-workflow/SKILL.md +332 -0
- package/.cursor/skills/sf-testing-constraints/SKILL.md +198 -0
- package/.cursor/skills/sf-trigger-constraints/SKILL.md +88 -0
- package/.cursor/skills/sf-trigger-frameworks/SKILL.md +343 -0
- package/.cursor/skills/sf-visualforce-development/SKILL.md +259 -0
- package/.cursor/skills/strategic-compact/SKILL.md +205 -0
- package/.cursor/skills/update-docs/SKILL.md +162 -0
- package/.cursor/skills/update-platform-docs/SKILL.md +86 -0
- package/.cursor-plugin/plugin.json +26 -0
- package/LICENSE +21 -0
- package/README.md +522 -0
- package/agents/deep-researcher.md +145 -0
- package/agents/doc-updater.md +222 -0
- package/agents/eval-runner.md +340 -0
- package/agents/learning-engine.md +211 -0
- package/agents/loop-operator.md +247 -0
- package/agents/refactor-cleaner.md +122 -0
- package/agents/sf-admin-agent.md +131 -0
- package/agents/sf-agentforce-agent.md +132 -0
- package/agents/sf-apex-agent.md +124 -0
- package/agents/sf-architect.md +435 -0
- package/agents/sf-aura-reviewer.md +372 -0
- package/agents/sf-bugfix-agent.md +105 -0
- package/agents/sf-flow-agent.md +159 -0
- package/agents/sf-integration-agent.md +146 -0
- package/agents/sf-lwc-agent.md +127 -0
- package/agents/sf-review-agent.md +366 -0
- package/agents/sf-visualforce-reviewer.md +468 -0
- package/assets/logo.svg +18 -0
- package/docs/ARCHITECTURE.md +133 -0
- package/docs/authoring-guide.md +373 -0
- package/docs/hook-development.md +578 -0
- package/docs/token-optimization.md +139 -0
- package/docs/workflow-examples.md +645 -0
- package/examples/agentforce-action/README.md +227 -0
- package/examples/apex-trigger-handler/README.md +114 -0
- package/examples/devops-pipeline/README.md +325 -0
- package/examples/flow-automation/README.md +188 -0
- package/examples/integration-pattern/README.md +416 -0
- package/examples/lwc-component/README.md +180 -0
- package/examples/platform-events/README.md +492 -0
- package/examples/scratch-org-setup/README.md +138 -0
- package/examples/security-audit/README.md +244 -0
- package/examples/visualforce-migration/README.md +314 -0
- package/hooks/hooks.json +338 -0
- package/hooks/memory-persistence/README.md +73 -0
- package/manifests/install-modules.json +217 -0
- package/manifests/install-profiles.json +17 -0
- package/mcp-configs/mcp-servers.json +19 -0
- package/package.json +89 -0
- package/schemas/hooks.schema.json +123 -0
- package/schemas/install-modules.schema.json +76 -0
- package/schemas/install-profiles.schema.json +28 -0
- package/schemas/install-state.schema.json +73 -0
- package/schemas/package-manager.schema.json +18 -0
- package/schemas/plugin.schema.json +112 -0
- package/schemas/scc-install-config.schema.json +29 -0
- package/schemas/state-store.schema.json +111 -0
- package/scripts/cli/install-apply.js +170 -0
- package/scripts/cli/uninstall.js +193 -0
- package/scripts/hooks/check-console-log.js +101 -0
- package/scripts/hooks/check-hook-enabled.js +17 -0
- package/scripts/hooks/check-platform-docs-age.js +48 -0
- package/scripts/hooks/cost-tracker.js +78 -0
- package/scripts/hooks/doc-file-warning.js +63 -0
- package/scripts/hooks/evaluate-session.js +98 -0
- package/scripts/hooks/governor-check.js +220 -0
- package/scripts/hooks/learning-observe.sh +206 -0
- package/scripts/hooks/mcp-health-check.js +588 -0
- package/scripts/hooks/post-bash-build-complete.js +34 -0
- package/scripts/hooks/post-bash-pr-created.js +43 -0
- package/scripts/hooks/post-edit-console-warn.js +61 -0
- package/scripts/hooks/post-edit-format.js +79 -0
- package/scripts/hooks/post-edit-typecheck.js +98 -0
- package/scripts/hooks/post-write.js +168 -0
- package/scripts/hooks/pre-bash-git-push-reminder.js +35 -0
- package/scripts/hooks/pre-bash-tmux-reminder.js +47 -0
- package/scripts/hooks/pre-compact.js +51 -0
- package/scripts/hooks/pre-tool-use.js +163 -0
- package/scripts/hooks/pre-write-doc-warn.js +9 -0
- package/scripts/hooks/quality-gate.js +251 -0
- package/scripts/hooks/run-with-flags-shell.sh +32 -0
- package/scripts/hooks/run-with-flags.js +135 -0
- package/scripts/hooks/session-end-marker.js +29 -0
- package/scripts/hooks/session-end.js +311 -0
- package/scripts/hooks/session-start.js +202 -0
- package/scripts/hooks/sfdx-scanner-check.js +142 -0
- package/scripts/hooks/sfdx-validate.js +119 -0
- package/scripts/hooks/stop-hook.js +170 -0
- package/scripts/hooks/suggest-compact.js +67 -0
- package/scripts/lib/agent-adapter.js +82 -0
- package/scripts/lib/apex-analysis.js +194 -0
- package/scripts/lib/hook-flags.js +74 -0
- package/scripts/lib/install-config.js +73 -0
- package/scripts/lib/install-executor.js +363 -0
- package/scripts/lib/install-state.js +121 -0
- package/scripts/lib/orchestration-session.js +299 -0
- package/scripts/lib/package-manager.js +124 -0
- package/scripts/lib/project-detect.js +228 -0
- package/scripts/lib/schema-validator.js +190 -0
- package/scripts/lib/skill-adapter.js +100 -0
- package/scripts/lib/state-store.js +376 -0
- package/scripts/lib/tmux-worktree-orchestrator.js +598 -0
- package/scripts/lib/utils.js +313 -0
- package/scripts/scc.js +164 -0
- package/skills/_reference/AGENTFORCE_PATTERNS.md +112 -0
- package/skills/_reference/APEX_CURSOR.md +159 -0
- package/skills/_reference/API_VERSIONS.md +78 -0
- package/skills/_reference/APPROVAL_PROCESSES.md +105 -0
- package/skills/_reference/ASYNC_PATTERNS.md +163 -0
- package/skills/_reference/AURA_COMPONENTS.md +146 -0
- package/skills/_reference/DATA_MIGRATION_PATTERNS.md +151 -0
- package/skills/_reference/DATA_MODELING.md +124 -0
- package/skills/_reference/DEBUGGING_TOOLS.md +140 -0
- package/skills/_reference/DEPLOYMENT_CHECKLIST.md +87 -0
- package/skills/_reference/DEPRECATIONS.md +79 -0
- package/skills/_reference/DOCKER_CI_PATTERNS.md +138 -0
- package/skills/_reference/ENTERPRISE_PATTERNS.md +122 -0
- package/skills/_reference/EXPERIENCE_CLOUD.md +143 -0
- package/skills/_reference/FLOW_PATTERNS.md +113 -0
- package/skills/_reference/GOVERNOR_LIMITS.md +77 -0
- package/skills/_reference/INTEGRATION_PATTERNS.md +105 -0
- package/skills/_reference/LWC_PATTERNS.md +79 -0
- package/skills/_reference/METADATA_TYPES.md +115 -0
- package/skills/_reference/NAMING_CONVENTIONS.md +84 -0
- package/skills/_reference/PACKAGE_DEVELOPMENT.md +150 -0
- package/skills/_reference/PLATFORM_EVENTS.md +121 -0
- package/skills/_reference/REPORTING_API.md +143 -0
- package/skills/_reference/SCRATCH_ORG_PATTERNS.md +126 -0
- package/skills/_reference/SECURITY_PATTERNS.md +127 -0
- package/skills/_reference/SHARING_MODEL.md +120 -0
- package/skills/_reference/SOQL_PATTERNS.md +119 -0
- package/skills/_reference/TESTING_STANDARDS.md +96 -0
- package/skills/_reference/TRIGGER_PATTERNS.md +114 -0
- package/skills/_reference/VISUALFORCE_PATTERNS.md +121 -0
- package/skills/aside/SKILL.md +118 -0
- package/skills/checkpoint/SKILL.md +53 -0
- package/skills/configure-scc/SKILL.md +163 -0
- package/skills/continuous-agent-loop/SKILL.md +264 -0
- package/skills/mcp-server-patterns/SKILL.md +146 -0
- package/skills/model-route/SKILL.md +84 -0
- package/skills/prompt-optimizer/SKILL.md +369 -0
- package/skills/refactor-clean/SKILL.md +136 -0
- package/skills/resume-session/SKILL.md +114 -0
- package/skills/save-session/SKILL.md +186 -0
- package/skills/search-first/SKILL.md +144 -0
- package/skills/security-scan/SKILL.md +146 -0
- package/skills/sessions/SKILL.md +127 -0
- package/skills/sf-agentforce-development/SKILL.md +450 -0
- package/skills/sf-apex-async-patterns/SKILL.md +326 -0
- package/skills/sf-apex-best-practices/SKILL.md +425 -0
- package/skills/sf-apex-constraints/SKILL.md +81 -0
- package/skills/sf-apex-cursor/SKILL.md +338 -0
- package/skills/sf-apex-enterprise-patterns/SKILL.md +348 -0
- package/skills/sf-apex-testing/SKILL.md +409 -0
- package/skills/sf-api-design/SKILL.md +238 -0
- package/skills/sf-approval-processes/SKILL.md +315 -0
- package/skills/sf-aura-development/SKILL.md +263 -0
- package/skills/sf-build-fix/SKILL.md +121 -0
- package/skills/sf-data-modeling/SKILL.md +278 -0
- package/skills/sf-debugging/SKILL.md +363 -0
- package/skills/sf-deployment/SKILL.md +295 -0
- package/skills/sf-deployment-constraints/SKILL.md +155 -0
- package/skills/sf-devops-ci-cd/SKILL.md +325 -0
- package/skills/sf-docs-lookup/SKILL.md +103 -0
- package/skills/sf-e2e-testing/SKILL.md +324 -0
- package/skills/sf-experience-cloud/SKILL.md +249 -0
- package/skills/sf-flow-development/SKILL.md +377 -0
- package/skills/sf-governor-limits/SKILL.md +323 -0
- package/skills/sf-harness-audit/SKILL.md +142 -0
- package/skills/sf-help/SKILL.md +159 -0
- package/skills/sf-integration/SKILL.md +483 -0
- package/skills/sf-lwc-constraints/SKILL.md +130 -0
- package/skills/sf-lwc-development/SKILL.md +303 -0
- package/skills/sf-lwc-testing/SKILL.md +388 -0
- package/skills/sf-metadata-management/SKILL.md +288 -0
- package/skills/sf-platform-events-cdc/SKILL.md +375 -0
- package/skills/sf-quickstart/SKILL.md +173 -0
- package/skills/sf-security/SKILL.md +334 -0
- package/skills/sf-security-constraints/SKILL.md +127 -0
- package/skills/sf-soql-constraints/SKILL.md +131 -0
- package/skills/sf-soql-optimization/SKILL.md +354 -0
- package/skills/sf-tdd-workflow/SKILL.md +336 -0
- package/skills/sf-testing-constraints/SKILL.md +200 -0
- package/skills/sf-trigger-constraints/SKILL.md +90 -0
- package/skills/sf-trigger-frameworks/SKILL.md +347 -0
- package/skills/sf-visualforce-development/SKILL.md +260 -0
- package/skills/strategic-compact/SKILL.md +208 -0
- package/skills/update-docs/SKILL.md +165 -0
- package/skills/update-platform-docs/SKILL.md +90 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# Authoring Guide
|
|
2
|
+
|
|
3
|
+
This guide covers how to create new agents, skills, and rules for Salesforce Claude Code (SCC). Each content type has a specific format, naming convention, and CI validation requirement.
|
|
4
|
+
|
|
5
|
+
## General Conventions
|
|
6
|
+
|
|
7
|
+
- **File naming**: Use lowercase with hyphens (kebab-case). Example: `sf-apex-agent.md`, `sf-tdd-workflow`.
|
|
8
|
+
- **Salesforce-specific prefix**: All Salesforce-specific content uses the `sf-` prefix. Platform-agnostic content omits the prefix (e.g., `strategic-compact`, `continuous-agent-loop`).
|
|
9
|
+
- **CommonJS throughout**: All Node.js scripts use `require()` and `module.exports`.
|
|
10
|
+
- **Origin tag**: All SCC content uses `origin: SCC` in frontmatter.
|
|
11
|
+
|
|
12
|
+
## Agent Authoring
|
|
13
|
+
|
|
14
|
+
Agents are specialized subagents that Claude Code delegates to for specific tasks. They live in the `agents/` directory as Markdown files with YAML frontmatter.
|
|
15
|
+
|
|
16
|
+
### Agent File Structure
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
---
|
|
20
|
+
name: sf-my-agent
|
|
21
|
+
description: "Use when [trigger] for Salesforce [domain]. Do NOT use for [exclusions]. (100-250 chars, 3+ SF keywords)"
|
|
22
|
+
tools: ["Read", "Grep", "Glob", "Bash", "Edit", "Write"]
|
|
23
|
+
model: sonnet
|
|
24
|
+
origin: SCC
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
You are an expert in [domain]. You [core capability statement].
|
|
28
|
+
|
|
29
|
+
## Severity Matrix
|
|
30
|
+
|
|
31
|
+
| Severity | Definition | Examples |
|
|
32
|
+
|----------|-----------|---------|
|
|
33
|
+
| CRITICAL | Will cause runtime failure or security breach | ... |
|
|
34
|
+
| HIGH | Will fail under load or incorrect in edge cases | ... |
|
|
35
|
+
| MEDIUM | Technical debt or best practice violation | ... |
|
|
36
|
+
| LOW | Style or minor improvement | ... |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## [Domain Area 1]
|
|
41
|
+
|
|
42
|
+
### [Specific Check or Pattern]
|
|
43
|
+
|
|
44
|
+
**Wrong:**
|
|
45
|
+
|
|
46
|
+
```apex
|
|
47
|
+
// Code that demonstrates the anti-pattern
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Right:**
|
|
51
|
+
|
|
52
|
+
```apex
|
|
53
|
+
// Code that demonstrates the correct approach
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Checklist Summary
|
|
59
|
+
|
|
60
|
+
When reviewing [content type], verify:
|
|
61
|
+
|
|
62
|
+
1. **Check 1**: Description
|
|
63
|
+
2. **Check 2**: Description
|
|
64
|
+
...
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Related
|
|
69
|
+
|
|
70
|
+
- **Skills**: `skill-name-1`, `skill-name-2`
|
|
71
|
+
- **Skills**: `/skill-name` (user-invocable)
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### YAML Frontmatter Fields
|
|
76
|
+
|
|
77
|
+
| Field | Required | Type | Description |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| `name` | Yes | string | Unique agent identifier. Use `sf-` prefix for Salesforce-specific agents. |
|
|
80
|
+
| `description` | Yes | string (100-250 chars) | Clear description with "Use when" clause, "Do NOT" clause, and 3+ SF keywords. |
|
|
81
|
+
| `tools` | Yes | array | List of tools the agent can use: `Read`, `Grep`, `Glob`, `Bash`, `Edit`, `Write`. |
|
|
82
|
+
| `model` | Yes | string | Model to use: `opus` (complex), `sonnet` (most agents), `haiku` (lightweight), `inherit` (caller decides). |
|
|
83
|
+
| `origin` | Yes | string | Must be `SCC` for all Salesforce Claude Code content. |
|
|
84
|
+
|
|
85
|
+
### Agent Content Guidelines
|
|
86
|
+
|
|
87
|
+
1. **Opening persona**: Start with "You are an expert in..." to establish the agent's domain expertise.
|
|
88
|
+
2. **Severity matrix**: Include a table mapping severity levels to definitions and examples. This helps the agent prioritize findings consistently.
|
|
89
|
+
3. **Code examples**: Use paired Wrong/Right examples showing anti-patterns and their corrections. Always use fenced code blocks with language identifiers (`apex`, `javascript`, `soql`, `html`).
|
|
90
|
+
4. **Checklist summary**: End with a numbered verification checklist the agent follows for every review.
|
|
91
|
+
5. **Related section**: Link to related skills for discoverability.
|
|
92
|
+
|
|
93
|
+
### Model Selection
|
|
94
|
+
|
|
95
|
+
- **opus**: Use for agents that perform deep architectural analysis, multi-file reasoning, or complex decision-making (e.g., `sf-architect`, `sf-integration-agent`).
|
|
96
|
+
- **sonnet**: Use for most agents. Good balance of capability and speed (e.g., `sf-apex-agent`, `sf-lwc-agent`, `sf-apex-agent`).
|
|
97
|
+
- **haiku**: Use for lightweight, fast-response agents that perform simple lookups or formatting.
|
|
98
|
+
|
|
99
|
+
## Skill Authoring
|
|
100
|
+
|
|
101
|
+
Skills are workflow/domain-knowledge modules that provide reference information and step-by-step patterns. They live in subdirectories under `skills/`, with each skill in its own directory containing a `SKILL.md` file.
|
|
102
|
+
|
|
103
|
+
### Skill Directory Structure
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
skills/
|
|
108
|
+
sf-apex-testing/
|
|
109
|
+
SKILL.md
|
|
110
|
+
sf-governor-limits/
|
|
111
|
+
SKILL.md
|
|
112
|
+
sf-lwc-development/
|
|
113
|
+
SKILL.md
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### SKILL.md Format
|
|
118
|
+
|
|
119
|
+
```markdown
|
|
120
|
+
---
|
|
121
|
+
name: sf-my-skill
|
|
122
|
+
description: One-line description of what this skill teaches. Should be specific and actionable.
|
|
123
|
+
origin: SCC
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
# Skill Title
|
|
127
|
+
|
|
128
|
+
A 1-2 sentence introduction explaining the skill's scope and why it matters.
|
|
129
|
+
|
|
130
|
+
## When to Use
|
|
131
|
+
|
|
132
|
+
- When [specific situation 1]
|
|
133
|
+
- When [specific situation 2]
|
|
134
|
+
- When [specific situation 3]
|
|
135
|
+
|
|
136
|
+
## [Core Concept 1]
|
|
137
|
+
|
|
138
|
+
### [Subtopic]
|
|
139
|
+
|
|
140
|
+
Explanation with code examples:
|
|
141
|
+
|
|
142
|
+
```apex
|
|
143
|
+
// Practical, copy-paste-ready code example
|
|
144
|
+
public with sharing class ExampleService {
|
|
145
|
+
public void doSomething() {
|
|
146
|
+
// Demonstrates the pattern
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## [Core Concept 2]
|
|
154
|
+
|
|
155
|
+
...
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Anti-Patterns to Avoid
|
|
160
|
+
|
|
161
|
+
| Anti-Pattern | Problem | Fix |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| Pattern name | Why it is bad | How to fix it |
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Related
|
|
168
|
+
|
|
169
|
+
- **Agent**: `sf-agent-name` -- For interactive guidance
|
|
170
|
+
- **Skills**: `/sf-skill-name` -- Quick access via slash command (user-invocable)
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Skill Frontmatter Fields
|
|
175
|
+
|
|
176
|
+
| Field | Required | Type | Description |
|
|
177
|
+
|---|---|---|---|
|
|
178
|
+
| `name` | Yes | string | Unique skill identifier matching the directory name. |
|
|
179
|
+
| `description` | Yes | string | Concise description of the skill's teaching purpose. |
|
|
180
|
+
| `origin` | Recommended | string | Set to `SCC`. |
|
|
181
|
+
|
|
182
|
+
### Skill Content Guidelines
|
|
183
|
+
|
|
184
|
+
1. **"When to Use" section**: Always include this. It helps Claude Code decide when to apply the skill. Use bullet points starting with "When...".
|
|
185
|
+
2. **Practical examples**: Skills should be reference material, not abstract theory. Every concept should have a runnable code example.
|
|
186
|
+
3. **Anti-patterns table**: Include common mistakes, why they are wrong, and how to fix them.
|
|
187
|
+
4. **Cross-references**: Link to related agents and other skills in a "Related" section at the bottom.
|
|
188
|
+
5. **Depth over breadth**: A skill should thoroughly cover one topic rather than shallowly covering many. For example, `sf-apex-testing` covers test structure, TestDataFactory, isolation, async testing, mocking, and coverage strategy -- all within the testing domain.
|
|
189
|
+
|
|
190
|
+
### Salesforce-Specific vs Platform Skills
|
|
191
|
+
|
|
192
|
+
SCC includes two categories of skills:
|
|
193
|
+
|
|
194
|
+
- **Salesforce-specific** (39 skills, `sf-` prefix): `sf-apex-testing`, `sf-governor-limits`, `sf-lwc-development`, `sf-security`, `sf-trigger-frameworks`, `sf-apex-constraints`, etc.
|
|
195
|
+
- **Platform skills** (16 skills, no prefix): `configure-scc`, `continuous-agent-loop`, `mcp-server-patterns`, `prompt-optimizer`, `search-first`, `security-scan`, `strategic-compact`, `checkpoint`, `aside`, `model-route`, `sessions`, `save-session`, `resume-session`, `refactor-clean`, `update-docs`, `update-platform-docs`.
|
|
196
|
+
|
|
197
|
+
Platform skills are Salesforce-adapted patterns for AI-assisted development workflows (loops, research, verification, evaluation).
|
|
198
|
+
|
|
199
|
+
## User-Invocable Skill Authoring
|
|
200
|
+
|
|
201
|
+
User-invocable skills are skills that users can invoke directly as slash commands (e.g., `/sf-tdd-workflow`, `/sf-security`). They live in `skills/<skill-name>/SKILL.md` alongside standard skills, but include `user-invocable: true` in their frontmatter.
|
|
202
|
+
|
|
203
|
+
All commands have been migrated to user-invocable skills. There is no separate `commands/` directory.
|
|
204
|
+
|
|
205
|
+
### User-Invocable Skill File Structure
|
|
206
|
+
|
|
207
|
+
User-invocable skills follow the same directory structure as regular skills (`skills/<skill-name>/SKILL.md`) but require additional frontmatter fields:
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
---
|
|
211
|
+
name: sf-my-skill
|
|
212
|
+
description: "Use when [trigger] for Salesforce [domain]. Do NOT use for [exclusions]. (100-250 chars, 3+ SF keywords)"
|
|
213
|
+
origin: SCC
|
|
214
|
+
user-invocable: true
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
# Skill Title
|
|
218
|
+
|
|
219
|
+
Brief introduction explaining what this skill accomplishes and when to invoke it.
|
|
220
|
+
|
|
221
|
+
## When to Use
|
|
222
|
+
|
|
223
|
+
- When [specific situation 1]
|
|
224
|
+
- When [specific situation 2]
|
|
225
|
+
- When [specific situation 3]
|
|
226
|
+
|
|
227
|
+
## Workflow
|
|
228
|
+
|
|
229
|
+
### Step 1 -- [Action Name]
|
|
230
|
+
|
|
231
|
+
Description of what happens in this step.
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Example CLI command or tool invocation
|
|
235
|
+
sf apex run test --class-names MyTest --target-org <alias>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Step 2 -- [Action Name]
|
|
239
|
+
|
|
240
|
+
...
|
|
241
|
+
|
|
242
|
+
## Rules
|
|
243
|
+
|
|
244
|
+
- Rule 1: Constraint or requirement for this skill
|
|
245
|
+
- Rule 2: Another constraint
|
|
246
|
+
...
|
|
247
|
+
|
|
248
|
+
## Examples
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
/sf-my-skill Do something specific
|
|
252
|
+
/sf-my-skill Another usage example
|
|
253
|
+
/sf-my-skill With different parameters
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Related
|
|
257
|
+
|
|
258
|
+
- **Agent**: `sf-agent-name` -- For interactive guidance
|
|
259
|
+
- **Skills**: `/sf-other-skill` -- Complementary skill
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### User-Invocable Skill Frontmatter
|
|
264
|
+
|
|
265
|
+
| Field | Required | Type | Description |
|
|
266
|
+
|---|---|---|---|
|
|
267
|
+
| `name` | Yes | string | Unique skill identifier matching the directory name. |
|
|
268
|
+
| `description` | Yes | string (100-250 chars) | Clear description with "Use when" clause, "Do NOT" clause, and 3+ SF keywords. |
|
|
269
|
+
| `origin` | Yes | string | Set to `SCC` for all Salesforce Claude Code content. |
|
|
270
|
+
| `user-invocable` | Yes | boolean | Must be `true` to enable slash command invocation. |
|
|
271
|
+
|
|
272
|
+
### User-Invocable Skill Content Guidelines
|
|
273
|
+
|
|
274
|
+
1. **"When to Use" section**: Required. Helps Claude Code decide when to apply the skill. Use bullet points starting with "When...".
|
|
275
|
+
2. **Workflow steps**: Use numbered steps (Step 1, Step 2, etc.) to guide the agent through a structured process. Each step should be self-contained and actionable.
|
|
276
|
+
3. **Agent delegation**: Skills often delegate to specialized agents. Reference the agent by name (e.g., "Delegate to `sf-apex-agent` for the review phase").
|
|
277
|
+
4. **CLI examples**: Show exact `sf` CLI commands with realistic arguments. Use `<alias>` or `<placeholder>` for values the user must provide.
|
|
278
|
+
5. **Rules section**: Define constraints the skill enforces (e.g., "Never write production Apex without a failing test first").
|
|
279
|
+
6. **Usage examples**: Show 3-5 examples of how to invoke the skill with different arguments.
|
|
280
|
+
7. **Related section**: Link to complementary agents and skills at the bottom.
|
|
281
|
+
|
|
282
|
+
### Skill Naming
|
|
283
|
+
|
|
284
|
+
- Skills use descriptive names like `sf-apex-best-practices`, `sf-security`, `sf-deployment`.
|
|
285
|
+
- Salesforce-specific skills use the `sf-` prefix: `sf-tdd-workflow`, `sf-deployment`, `sf-security`.
|
|
286
|
+
- Platform skills omit the prefix: `checkpoint`, `strategic-compact`, `save-session`.
|
|
287
|
+
- Users invoke them via `/skill-name` (e.g., `/sf-tdd-workflow`, `/sf-security`, `/checkpoint`).
|
|
288
|
+
|
|
289
|
+
## CI Validation
|
|
290
|
+
|
|
291
|
+
Every content type has a corresponding CI validator in `scripts/ci/`. These run as part of `npm test` and in CI pipelines.
|
|
292
|
+
|
|
293
|
+
### Validator Summary
|
|
294
|
+
|
|
295
|
+
| Validator | What It Checks |
|
|
296
|
+
|---|---|
|
|
297
|
+
| `validate-agents.js` | Frontmatter: `name` (matches filename), `description` (100-250 chars, 3+ SF keywords, "Use when" clause), `tools` (array), `model` (opus/sonnet/haiku/inherit), `origin` (SCC). Body: `## When to Use`, `## Workflow`, 2+ steps, `## Escalation` for write agents. |
|
|
298
|
+
| `validate-skills.js` | Each skill directory has a `SKILL.md`. Frontmatter: `name`, `description` (100-250 chars, 3+ SF keywords), `origin` (SCC). Constraint skills: read-only tools, @reference required. |
|
|
299
|
+
| `validate-hooks.js` | `hooks.json` is valid JSON conforming to `schemas/hooks.schema.json`. All referenced scripts exist. Each entry has a `description`. |
|
|
300
|
+
| `validate-install-manifests.js` | Manifest files reference real files. No broken paths. |
|
|
301
|
+
| `validate-no-personal-paths.js` | No hardcoded personal paths (like `/Users/username/`) in any source files. |
|
|
302
|
+
|
|
303
|
+
### Running Validators
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
# Run all validators (part of npm test)
|
|
307
|
+
npm test
|
|
308
|
+
|
|
309
|
+
# Run a specific validator
|
|
310
|
+
node scripts/ci/validate-agents.js
|
|
311
|
+
node scripts/ci/validate-skills.js
|
|
312
|
+
node scripts/ci/validate-hooks.js
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Validators exit with code 0 on success and code 1 on failure, with detailed error messages showing which files failed and why.
|
|
316
|
+
|
|
317
|
+
## PR Submission Checklist
|
|
318
|
+
|
|
319
|
+
Before submitting a pull request that adds new content, verify:
|
|
320
|
+
|
|
321
|
+
### For New Agents
|
|
322
|
+
|
|
323
|
+
- [ ] File is in `agents/` directory with `.md` extension
|
|
324
|
+
- [ ] YAML frontmatter has `name`, `description` (100-250 chars, 3+ SF keywords), `tools` (array), `model`, `origin: SCC`
|
|
325
|
+
- [ ] `origin: SCC` is set
|
|
326
|
+
- [ ] Agent name uses `sf-` prefix for Salesforce-specific agents
|
|
327
|
+
- [ ] File uses kebab-case naming matching the frontmatter `name`
|
|
328
|
+
- [ ] Severity matrix is included for reviewer agents
|
|
329
|
+
- [ ] Code examples use fenced blocks with language identifiers
|
|
330
|
+
- [ ] Related section links to relevant skills
|
|
331
|
+
- [ ] `node scripts/ci/validate-agents.js` passes
|
|
332
|
+
|
|
333
|
+
### For New Skills
|
|
334
|
+
|
|
335
|
+
- [ ] Skill is in its own directory under `skills/` (e.g., `skills/sf-my-skill/SKILL.md`)
|
|
336
|
+
- [ ] YAML frontmatter has `name` and `description`
|
|
337
|
+
- [ ] `origin: SCC` is set
|
|
338
|
+
- [ ] "When to Use" section is present with bullet points
|
|
339
|
+
- [ ] Code examples are practical and copy-paste-ready
|
|
340
|
+
- [ ] Anti-patterns table is included
|
|
341
|
+
- [ ] Related section links agents and other skills
|
|
342
|
+
- [ ] `node scripts/ci/validate-skills.js` passes
|
|
343
|
+
|
|
344
|
+
### For New User-Invocable Skills
|
|
345
|
+
|
|
346
|
+
- [ ] Skill is in its own directory under `skills/` (e.g., `skills/sf-my-skill/SKILL.md`)
|
|
347
|
+
- [ ] YAML frontmatter has `name`, `description` (100-250 chars, 3+ SF keywords), `origin: SCC`, `user-invocable: true`
|
|
348
|
+
- [ ] Skill name uses `sf-` prefix for Salesforce-specific skills
|
|
349
|
+
- [ ] "When to Use" section is present with bullet points
|
|
350
|
+
- [ ] Workflow steps are numbered and actionable
|
|
351
|
+
- [ ] Usage examples show 3-5 invocation patterns
|
|
352
|
+
- [ ] Related agents and skills are linked
|
|
353
|
+
- [ ] `node scripts/ci/validate-skills.js` passes
|
|
354
|
+
|
|
355
|
+
### For New Hooks
|
|
356
|
+
|
|
357
|
+
- [ ] Script is in `scripts/hooks/` with `.js` extension
|
|
358
|
+
- [ ] Entry is added to `hooks/hooks.json` under the correct lifecycle event
|
|
359
|
+
- [ ] Hook uses `run-with-flags.js` wrapper with appropriate profile level
|
|
360
|
+
- [ ] `async: true` is set unless the hook must block execution
|
|
361
|
+
- [ ] `timeout` is set to a reasonable value
|
|
362
|
+
- [ ] Test file is created in `tests/hooks/`
|
|
363
|
+
- [ ] Cursor mirror is updated in `.cursor/hooks/` if applicable
|
|
364
|
+
- [ ] `node scripts/ci/validate-hooks.js` passes
|
|
365
|
+
- [ ] `node tests/hooks/my-hook.test.js` passes
|
|
366
|
+
|
|
367
|
+
### General
|
|
368
|
+
|
|
369
|
+
- [ ] `npm test` passes (runs all validators + test suite)
|
|
370
|
+
- [ ] `npm run lint` passes (ESLint + markdownlint)
|
|
371
|
+
- [ ] No hardcoded personal paths (`node scripts/ci/validate-no-personal-paths.js`)
|
|
372
|
+
- [ ] CLAUDE.md counts are updated if content counts changed (agents, skills)
|
|
373
|
+
- [ ] Commit message uses conventional format: `feat: add sf-my-content description`
|