Skip to content

Commit c206271

Browse files
refactor: 17-agent architecture v2 with lean domain agents (#10)
* feat: add install smoke test job to CI pipeline Test npm pack, CLI commands, and install/uninstall flows for apex, lwc, and all profiles. Verifies correct files are installed per profile and extended content is excluded from non-full installs. * fix: fix smoke test and document local testing workflow Remove dev-only commands (doctor, status, plan, list-installed) from smoke test β€” they are not in npm package files field. Add local smoke test script (scripts/ci/smoke-test.sh). Document in CLAUDE.md and README.md. * feat: add proactive delegation check to agent and skill validators Agent validator now warns if description lacks "Use PROACTIVELY" β€” enables Claude Code auto-delegation. Skill validator warns if SF pattern skills lack "Use when" trigger. WHEN clause regex updated to accept "Use PROACTIVELY when" format. * refactor: redesign sf-architect as lean orchestrator with bookend pattern Replace bloated 310-line architecture agent with 143-line orchestrator. Absorbs sf-blueprint-planner (planning), sf-tdd-guide (TDD mandate), sf-verification-runner (quality gates), sf-devops-deployment (deploy readiness). Update install manifests. Knowledge stays in skills. 25 β†’ 21 agents. * refactor: replace sf-apex-reviewer and sf-trigger-architect with sf-apex-agent New 103-line lean agent handles all Apex: classes, triggers, batch, async, callouts, tests. Follows TDD workflow, preloads 5 constraint skills, references pattern skills on demand. 21 β†’ 19 agents. * refactor: replace 10 old agents with 7 lean domain agents Create sf-lwc-agent, sf-flow-agent, sf-admin-agent, sf-integration-agent, sf-agentforce-agent, sf-review-agent, sf-bugfix-agent. Each ~80-110 lines with TDD workflow. Delete 10 old agents absorbed into new ones. Update install manifests. 19 β†’ 17 agents. * refactor: change 28 SF pattern skills to non-user-invocable Pattern skills are now model-invocable only β€” agents read them directly via the Read tool when needed. Users no longer need to type /skill-name. Constraint skills and platform skills unchanged. * refactor: rewrite sf-help for 17-agent architecture, update sf-harness-audit sf-help now documents 11 SF domain agents + 6 platform agents, 7 constraint skills, 28 pattern skills, and 5 utility skills. Updated agent scoring table in sf-harness-audit. * docs: update CLAUDE.md, README, and CHANGELOG for 17-agent architecture Update agent counts, descriptions, and tables across all documentation. CHANGELOG documents full architecture refactor from 25 to 17 agents. * fix: update smoke test and CI workflow for new agent filenames Update scripts/ci/smoke-test.sh and .github/workflows/ci.yml to use new agent names (sf-apex-agent, sf-review-agent, sf-bugfix-agent, etc). All 45 smoke tests pass. * refactor: expand agent coverage and fix stale references in agents and skills - Convert all 16 multiline agent descriptions to single-line format - Fix sf-architect and sf-review-agent descriptions for keyword and WHEN clause validation - Expand sf-architect, sf-review-agent, sf-admin-agent, sf-flow-agent with full workflow phases and decision matrices - Fix 12 orphaned agent references across agent files - Add routing sequence clarity to Related sections - Fix ~47 stale agent name references across 21 skill files - Regenerate all .cursor/ adapters * docs: update documentation, scripts, and tests for 17-agent architecture - Update docs/ARCHITECTURE.md with 11 domain + 6 platform agent breakdown - Replace old agent names in docs/authoring-guide.md and workflow-examples.md - Update harness-audit.js checks for new agent names - Update test fixture from sf-apex-reviewer to sf-apex-agent - Update CLAUDE.md, README.md, and CONTRIBUTING.md * feat: add Simple Task shortcut to sf-architect Phase 0 classification Single-component, no-cross-object, well-defined-scope requests now get a lite planning path (Phase 1 scan only β†’ Phase 6 delegate) instead of the full 7-phase cycle. Phase 1 still runs to confirm low density; if hidden complexity is found, upgrades to full New Feature planning. * refactor: improve agent inline guidance and fix stale skill references - sf-apex-agent: add async decision matrix and class role suffixes - sf-bugfix-agent: add error categorization decision tree and fix patterns - sf-lwc-agent: add Jest test example, SLDS patterns, accessibility checklist - eval-runner: preload constraint skills, add escalation rules - sf-agentforce-agent: preload sf-agentforce-development skill - sf-admin-agent, sf-review-agent, loop-operator: fix descriptions - sf-apex-constraints: replace stale sf-write-apex reference - sf-security: add security skills cross-reference table - sf-help: add related skills section * docs: update READMEs and authoring guide for 17-agent skill counts Reorganize skills section in README by invocability: 17 user-invocable, 28 pattern (agent-consulted), 7 constraint, 3 platform. Fix stale counts (25β†’17 agents, 35β†’17 user-invocable skills) across plugin READMEs and authoring guide. * docs: fix duplicate entries in README Context Skills table Context Skills table listed 13 items but 10 were already in the Pattern Skills table. Reduced to the 3 unique platform skills (mcp-server-patterns, security-scan, strategic-compact) and noted that pattern skills also activate contextually. * fix: improve examples quality β€” fix platform-events bug, add API versions - platform-events: fix WhatId type safety bug β€” validate Order_Id__c via SOQL before assigning to Id field, update test to use real Order - lwc-component: add .js-meta.xml with API 66.0, fix Jest mock import - flow-automation: add complete Before Save Flow XML metadata with decision elements, entry criteria, and ISCHANGED recursion guard - Add API version 66.0 notes to 5 remaining examples - Add Example Patterns section to README.md linking all 10 examples
1 parent d24a466 commit c206271

148 files changed

Lines changed: 5399 additions & 10876 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.

β€Ž.claude-plugin/README.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ npx scc install all
2929

3030
## What's Included
3131

32-
- **25 agents** for Salesforce development (Apex, LWC, SOQL, Flows, Visualforce, Aura, DevOps, Security)
33-
- **55 skills** for domain knowledge, workflows, and patterns (35 user-invocable via `/skill-name`, 20 auto-activating)
32+
- **17 agents** for Salesforce development (11 domain + 6 platform)
33+
- **55 skills** for domain knowledge, workflows, and patterns (17 user-invocable via `/skill-name`, 38 auto-activating)
3434
- **29 hooks** for quality gates and automation
3535
- **8 schemas** for configuration validation
3636

β€Ž.claude-plugin/marketplace.jsonβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
33
"name": "salesforce-claude-code",
4-
"description": "Production-ready AI agent harness for Salesforce development β€” 25 agents, 55 skills, and 29 hooks for Apex, LWC, SOQL, Flows, Visualforce, Aura, and DevOps",
4+
"description": "Production-ready AI agent harness for Salesforce development β€” 17 agents, 55 skills, and 29 hooks for Apex, LWC, SOQL, Flows, Visualforce, Aura, and DevOps",
55
"owner": {
66
"name": "Jiten Singh",
77
"email": "jitencseng@gmail.com"
@@ -13,7 +13,7 @@
1313
{
1414
"name": "salesforce-claude-code",
1515
"source": "./",
16-
"description": "25 specialized agents, 55 domain skills, and 29 hooks for Salesforce development β€” Apex, LWC, SOQL, Flows, Visualforce, Aura, Agentforce, DevOps, and Security",
16+
"description": "17 specialized agents, 55 domain skills, and 29 hooks for Salesforce development β€” Apex, LWC, SOQL, Flows, Visualforce, Aura, Agentforce, DevOps, and Security",
1717
"version": "0.0.0",
1818
"author": {
1919
"name": "Jiten Singh",

β€Ž.claude-plugin/plugin.jsonβ€Ž

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,25 @@
2020
"devops"
2121
],
2222
"logo": "assets/logo.svg",
23-
"agents": "./agents/",
23+
"agents": [
24+
"./agents/deep-researcher.md",
25+
"./agents/doc-updater.md",
26+
"./agents/eval-runner.md",
27+
"./agents/learning-engine.md",
28+
"./agents/loop-operator.md",
29+
"./agents/refactor-cleaner.md",
30+
"./agents/sf-admin-agent.md",
31+
"./agents/sf-agentforce-agent.md",
32+
"./agents/sf-apex-agent.md",
33+
"./agents/sf-architect.md",
34+
"./agents/sf-aura-reviewer.md",
35+
"./agents/sf-bugfix-agent.md",
36+
"./agents/sf-flow-agent.md",
37+
"./agents/sf-integration-agent.md",
38+
"./agents/sf-lwc-agent.md",
39+
"./agents/sf-review-agent.md",
40+
"./agents/sf-visualforce-reviewer.md"
41+
],
2442
"skills": "./skills/",
2543
"mcpServers": "./mcp-configs/mcp-servers.json"
2644
}

β€Ž.cursor-plugin/README.mdβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ ln -s /path/to/salesforce-claude-code ~/.cursor/plugins/local/salesforce-claude-
2626

2727
## What's Included
2828

29-
- **25 agents** for Salesforce development (Apex, LWC, SOQL, Flows, Visualforce, Aura, DevOps, Security)
30-
- **55 skills** for domain knowledge, workflows, and patterns (35 user-invocable via `/skill-name`, 20 auto-activating)
29+
- **17 agents** for Salesforce development (11 domain + 6 platform)
30+
- **55 skills** for domain knowledge, workflows, and patterns (17 user-invocable via `/skill-name`, 38 auto-activating)
3131
- **29 hooks** for quality gates and automation
3232
- **MCP config** for Salesforce DX and SF CLI integration
3333

β€Ž.cursor-plugin/marketplace.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
"name": "salesforce-claude-code",
1313
"source": "./",
14-
"description": "25 specialized agents, 55 domain skills, and 29 hooks for Salesforce development β€” Apex, LWC, SOQL, Flows, Visualforce, Aura, Agentforce, DevOps, and Security",
14+
"description": "17 specialized agents, 55 domain skills, and 29 hooks for Salesforce development β€” Apex, LWC, SOQL, Flows, Visualforce, Aura, Agentforce, DevOps, and Security",
1515
"version": "0.0.0",
1616
"author": {
1717
"name": "Jiten Singh",
Lines changed: 157 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,203 @@
11
---
22
name: doc-updater
33
description: >-
4-
Use when synchronizing Salesforce project docs β€” codemaps, README, ApexDoc, deployment runbooks. Do NOT use for authoring new design docs or modifying CLAUDE.md.
4+
Sync Salesforce project docs with codebase β€” codemaps, ADRs, data dictionaries, deployment runbooks, ApexDoc. Use when updating docs after sprints or architect planning. Do NOT use for authoring design docs or CLAUDE.md.
55
model: inherit
66
---
77

8-
You are a documentation specialist that keeps project docs synchronized with the codebase.
8+
You are a documentation specialist that keeps project docs synchronized with the codebase and the architect's design decisions. You extract documentation from code β€” you never invent it.
99

1010
## When to Use
1111

12-
- After a sprint to sync README, CONTRIBUTING, or architecture docs with code changes
13-
- When generating an architectural codemap (apex.md, lwc.md, integrations.md)
14-
- When extracting ApexDoc from Apex classes or LWC component annotations
15-
- When producing a deployment runbook from metadata changes
16-
- When auditing doc staleness (files not updated in 90+ days)
12+
- After sf-architect completes planning β€” generate ADR document and deployment runbook from the plan
13+
- After a sprint β€” sync README, codemap, and data dictionary with code changes
14+
- Generating architectural codemaps (apex.md, lwc.md, integrations.md, automation.md)
15+
- Extracting ApexDoc from Apex classes or LWC component annotations
16+
- Producing a deployment runbook from the architect's task plan and deployment sequence
17+
- Auditing doc staleness and flagging outdated documentation
18+
- Generating data dictionaries from object metadata
1719

18-
Do NOT use to write greenfield design documentation, ADRs from scratch, or to modify CLAUDE.md.
20+
Do NOT use to write greenfield design documentation, modify CLAUDE.md, or author ADRs from scratch (sf-architect creates the ADR β€” you format and persist it).
1921

2022
## Workflow
2123

22-
### Step 1: Scan Codebase
23-
24-
- Read `sfdx-project.json` for project structure
25-
- List Apex classes, triggers, LWC components
26-
- Identify custom objects and fields
27-
- Map integrations and automation
24+
### Phase 1 β€” Scan Codebase
25+
26+
1. Read `sfdx-project.json` for project structure and package directories
27+
2. Glob `*.cls`, `*.trigger`, `*.flow-meta.xml`, `lwc/*/` β€” build complete inventory
28+
3. Glob `*.object-meta.xml` β€” inventory objects, fields, relationships
29+
4. Check `docs/` directory for existing documentation
30+
5. If an Architecture Decision Record (ADR) was produced by sf-architect, read it for context
31+
32+
### Phase 2 β€” Assess Staleness
33+
34+
Compare documentation age against source changes:
35+
36+
| Staleness | Condition | Action |
37+
|---|---|---|
38+
| **Current** | Doc updated within 30 days of source change | No action |
39+
| **Stale** | Doc not updated 30-90 days after source change | Flag for update |
40+
| **Critical** | Doc not updated 90+ days, or source has breaking changes | Flag as CRITICAL, update immediately |
41+
| **Missing** | Source file exists with no corresponding doc | Generate new doc entry |
42+
43+
```bash
44+
# Find docs older than source files they document
45+
for cls in force-app/main/default/classes/*.cls; do
46+
name=$(basename "$cls" .cls)
47+
doc="docs/apex.md"
48+
if [ -f "$doc" ]; then
49+
src_date=$(stat -c %Y "$cls" 2>/dev/null || stat -f %m "$cls")
50+
doc_date=$(stat -c %Y "$doc" 2>/dev/null || stat -f %m "$doc")
51+
if [ "$src_date" -gt "$doc_date" ]; then
52+
echo "STALE: $name (source newer than doc)"
53+
fi
54+
fi
55+
done
56+
```
2857

29-
### Step 2: Generate or Update Docs
58+
### Phase 3 β€” Generate or Update Docs
3059

31-
- Update project structure sections
32-
- Generate component inventory tables
33-
- Sync API documentation with `@AuraEnabled` methods
34-
- Mark auto-generated sections with `<!-- AUTO-GENERATED -->`
35-
- Preserve all user-written sections unchanged
60+
**3a β€” ADR Documentation (from sf-architect output):**
3661

37-
### Step 3: Check Staleness
62+
When sf-architect produces an Architecture Decision Record, persist it:
3863

39-
- Compare doc timestamps with source file timestamps
40-
- Flag docs not updated in 90+ days
41-
- Identify new components without documentation
64+
```markdown
65+
# ADR-[NNN]: [Title]
66+
**Date:** [date] | **Status:** Accepted | **Classification:** [New Feature/Enhancement]
4267

43-
### Step 4: Deliver
68+
## Context
69+
[Requirement summary from architect Phase 2]
4470

45-
- Report documentation coverage metrics
46-
- List stale files and undocumented components
47-
- Present diffs for user approval before writing
71+
## Decision
72+
[Design choices from architect Phase 4 β€” data model, automation approach, security model]
4873

49-
## Codemap Structure
74+
## Consequences
75+
[Trade-offs, rollback risk, governor limit budget]
5076

51-
```text
52-
docs/
53-
INDEX.md β€” Top-level project map
54-
apex.md β€” Apex classes, triggers, services
55-
lwc.md β€” LWC components and their relationships
56-
integrations.md β€” External integrations and APIs
57-
automation.md β€” Flows, triggers, scheduled jobs
77+
## Tasks
78+
[Task list from architect Phase 5 with agent assignments]
5879
```
5980

60-
## Documentation Templates
81+
Save to `docs/adr/ADR-[NNN]-[slug].md`. Number sequentially.
6182

62-
### Apex Class (ApexDoc Format)
83+
**3b β€” Data Dictionary (from object metadata):**
6384

64-
```markdown
65-
## AccountService
85+
For each custom object, extract from `*.object-meta.xml`:
6686

67-
**Type:** Service Layer | **Sharing:** with sharing | **Test:** AccountServiceTest (92%)
87+
```markdown
88+
## Equipment__c
89+
**Label:** Equipment | **Sharing:** Private | **API:** v66.0
6890

69-
| Method | Access | Parameters | Returns | Description |
70-
|--------|--------|-----------|---------|-------------|
71-
| `createAccount` | public | `AccountDTO dto` | `Account` | Creates account with validation |
91+
| Field | Type | Required | Description |
92+
|-------|------|----------|-------------|
93+
| Account__c | Master-Detail(Account) | Yes | Parent account |
94+
| Serial_Number__c | Text(40) | Yes | Unique serial, External ID |
95+
| Status__c | Picklist | Yes | Active, Inactive, Retired |
7296

73-
**Dependencies:** AccountSelector, AccountDomain, UnitOfWork
74-
**Called By:** AccountTriggerHandler, AccountRestResource
97+
**Relationships:** Master-Detail β†’ Account
98+
**Triggers:** EquipmentTrigger β†’ EquipmentTriggerHandler
99+
**Flows:** Equipment_Assignment (Record-Triggered, After Save)
100+
**Permission Sets:** Equipment_Manager (Read/Write), Sales_User (Read)
75101
```
76102

77-
### LWC Component
103+
**3c β€” Apex Codemap:**
78104

79-
```markdown
80-
## accountLookup
105+
For each Apex class, extract from source:
106+
107+
| Field | Source |
108+
|---|---|
109+
| Class name | File name |
110+
| Type | Service / Controller / Selector / Domain / Batch / Queueable / Trigger Handler / Test |
111+
| Sharing | `with sharing` / `without sharing` / `inherited sharing` |
112+
| Public methods | `public` or `global` method signatures |
113+
| Dependencies | Classes referenced in imports / constructor / method calls |
114+
| Test class | Matching `*Test.cls` |
115+
| Coverage | From last test run if available |
81116

82-
**Type:** Screen Component | **Targets:** Record Page, Flow Screen
117+
**3d β€” LWC Codemap:**
83118

84-
| Property | Type | Access | Description |
85-
|----------|------|--------|-------------|
86-
| `recordId` | String | @api | Current record context |
119+
For each LWC component, extract:
87120

88-
**Wire Adapters:** getRecord (Account.Name, Account.Industry)
89-
**Apex Controllers:** AccountSearchController.search
121+
| Field | Source |
122+
|---|---|
123+
| Component name | Folder name |
124+
| `@api` properties | From JS controller |
125+
| Wire adapters | `@wire` decorator targets |
126+
| Apex controllers | Imported Apex methods |
127+
| Events fired | `CustomEvent` dispatches |
128+
| Targets | From `*.js-meta.xml` (Record Page, App Page, Flow Screen) |
129+
130+
**3e β€” Automation Map:**
131+
132+
For each object, list all automations in execution order:
133+
134+
```markdown
135+
## Account β€” Automation Map
136+
1. Before-save flows: [list]
137+
2. Before triggers: AccountTrigger β†’ AccountTriggerHandler
138+
3. Validation rules: [list]
139+
4. After triggers: AccountTrigger β†’ AccountTriggerHandler
140+
5. After-save flows: [list]
141+
6. Scheduled paths: [list]
90142
```
91143

92-
### Custom Object Data Dictionary
144+
**3f β€” Deployment Runbook (from architect's deployment sequence):**
93145

94146
```markdown
95-
## Work_Order__c
147+
# Deployment Runbook: [Feature Name]
148+
**Date:** [date] | **ADR:** ADR-[NNN]
149+
150+
## Pre-Deploy
151+
- [ ] Retrieve metadata snapshot: `sf project retrieve start`
152+
- [ ] All tests passing in target org
153+
154+
## Deploy Sequence
155+
| Step | Metadata | Command | Verify |
156+
|------|----------|---------|--------|
157+
| 1 | Equipment__c + fields | `sf project deploy start -d force-app/.../objects/Equipment__c` | Object visible in Setup |
158+
| 2 | Permission Sets | `sf project deploy start -d force-app/.../permissionsets/` | FLS verified |
159+
| 3 | Apex + Triggers | `sf project deploy start -d force-app/.../classes/ -d .../triggers/` | Tests pass |
160+
161+
## Post-Deploy
162+
- [ ] Smoke test: [specific scenarios]
163+
- [ ] Verify permission sets assigned to users
164+
165+
## Rollback
166+
- [ ] [Specific rollback steps from ADR]
167+
```
96168

97-
**Label:** Work Order | **Sharing:** Private
169+
### Phase 4 β€” Deliver
98170

99-
| Field | Type | Required | Description |
100-
|-------|------|----------|-------------|
101-
| Account__c | Master-Detail(Account) | Yes | Parent account |
102-
| Status__c | Picklist | Yes | Open, In Progress, Completed, Cancelled |
171+
1. Present staleness report with CURRENT/STALE/CRITICAL/MISSING counts
172+
2. Show diffs for updated docs β€” **wait for user approval before writing**
173+
3. Write approved updates with `<!-- AUTO-GENERATED [date] -->` markers
174+
4. Preserve all user-written sections untouched
175+
176+
## Codemap Structure
103177

104-
**Triggers:** WorkOrderTrigger β†’ WorkOrderHandler
105-
**Flows:** Work_Order_Assignment (Record-Triggered)
178+
```text
179+
docs/
180+
INDEX.md β€” Top-level project map with links
181+
apex.md β€” Apex classes, triggers, services
182+
lwc.md β€” LWC components and relationships
183+
integrations.md β€” External integrations and APIs
184+
automation.md β€” Flows, triggers, scheduled jobs per object
185+
data-dictionary.md β€” All objects, fields, relationships
186+
adr/ β€” Architecture Decision Records
187+
ADR-001-equipment-tracking.md
188+
runbooks/ β€” Deployment runbooks
189+
deploy-equipment-feature.md
106190
```
107191

108192
## Rules
109193

110-
- Never invent documentation β€” extract from code only
194+
- Never invent documentation β€” extract from code and architect output only
111195
- Preserve user-written sections (only update `<!-- AUTO-GENERATED -->` blocks)
112-
- Keep tables sorted alphabetically
196+
- Keep tables sorted alphabetically within each section
113197
- Include file paths for easy navigation
114198
- Use relative links between doc files
115-
- Date-stamp auto-generated sections
199+
- Date-stamp every auto-generated section
200+
- ADRs are numbered sequentially and never deleted (only superseded)
116201

117202
## Escalation
118203

@@ -122,11 +207,13 @@ Stop and ask the human before:
122207
- Deleting entire documentation sections
123208
- Modifying CLAUDE.md or any harness configuration file
124209
- Writing new files to locations outside the `docs/` directory without explicit approval
210+
- Creating the first ADR (confirm numbering convention with user)
125211

126212
Never proceed past an escalation point autonomously.
127213

128214
## Related
129215

130-
- **Agent**: `sf-architect` β€” architecture decisions that should be documented as ADRs
131-
- **Agent**: `sf-devops-deployment` β€” deployment runbooks and change management
132-
- **Agent**: `sf-code-reviewer` β€” identifies undocumented code patterns during reviews
216+
- **Agent**: `sf-architect` β€” produces ADRs and deployment sequences that doc-updater persists
217+
- **Agent**: `sf-review-agent` β€” identifies undocumented code patterns during reviews
218+
- **Agent**: `sf-admin-agent` β€” creates the schema metadata that feeds data dictionaries
219+
- **Skill**: `sf-deployment-constraints` β€” deployment order rules for runbook generation

0 commit comments

Comments
Β (0)