← Back to Playbooks
âš¡

Lead-to-Account Association Engine

Blueprint Build
⏱️ ~45 min

Design and deploy a complete lead-to-account matching configuration. Architect discovers your current Lead and Account schema, generates bounded specs for match scoring fields, domain-based matching rules, and permission sets — then deploys through sandbox verification.

The Prompt

Copy this prompt to Claude Code
We need to build out our lead-to-account matching from scratch. Current state: leads come in, nobody knows which account they belong to.

Goal: custom fields for domain matching, scoring rules, and permission sets — deployed safely through sandbox first.

Use the Architect blueprint for L2A association. Deploy to our dev sandbox, verify, then promote to production.
🏢

Bounded AI Output, Not Open-Ended Generation

Architect doesn't just "ask AI to design your org." It discovers your current state, generates bounded specs within enforced safety limits (max fields, max rules), and requires approval tokens before any deployment. Every proposal gets a SHA-256 hash — change the spec and the token invalidates.

How Architect Handles This

Six steps from schema discovery to production deployment.

1
🔍

Discover Schema

Query Lead, Account, and Contact objects. Pull existing custom fields, field counts, and current matching config

2
📄

Generate Bounded Specs

AI generates custom fields, validation rules, and permission sets — within safety limits (max fields, max rules enforced)

3
🛡️

Review Proposal

PROPOSAL.md with full spec: fields, rules, permissions. Proposal hash locks the spec for approval

4
🚀

Deploy Sandbox

Approval token required. Metadata pack planned and applied to sandbox org

5

Verify

Scouts re-run against sandbox to confirm all fields present, permissions assigned, no drift

6
🔒

Deploy Production

Second approval token. Same metadata pack applied to production org with receipt

How Claude Code Executes It

💭 thinking

Need to build L2A matching from scratch. Let me initialize an Architect project and discover the current org state first.

$ command
g-gremlin autopilot architect init l2a_association_engine --variant salesforce -p target_sandbox=dev -p prod_org_alias=prod

✓ Project arch_7f2k created from blueprint: l2a_association_engine (salesforce)

$ command
g-gremlin autopilot architect discover arch_7f2k

✓ Querying Lead, Account, Contact schema...
✓ Lead: 42 fields (8 custom), Account: 38 fields (5 custom)

📋 planning

Discovery shows 8 custom Lead fields and 5 custom Account fields. No existing L2A matching config detected. Safe to propose new fields.

$ command
g-gremlin autopilot architect propose arch_7f2k

✓ Proposal: 4 custom fields, 2 validation rules, 1 permission set
✓ Written: proposal/PROPOSAL.md + proposal/metadata_pack/

$ command
g-gremlin autopilot architect deploy arch_7f2k --sandbox

✓ Approval token received from [email protected]
✓ Sandbox deploy complete. Receipt: receipts/arch_7f2k/deploy_sandbox.json

$ command
g-gremlin autopilot architect verify arch_7f2k

✓ Verification passed: all components confirmed

✓ success

L2A Association Engine deployed. 4 fields, 2 rules, 1 permission set. Sandbox verified. Production receipted.

Results

4
Custom fields
2
Validation rules
1
Permission sets
Pass
Verification
Sandbox Verified

All components confirmed present with zero drift before production deployment

Cross-CRM Support

Available for both Salesforce (Lead → Account) and HubSpot (contacts → companies)

Try This Blueprint

Request beta access and run the L2A Association Engine on your own org.