Back to Playbooks

Pipeline Hygiene Pack

BlueprintMaintain
~30 min

Deploy stage-gating validations, required fields per stage, and stale-deal automation. Discovery identifies pipeline bottlenecks and missing validations. AI generates bounded validation rules and automation triggers within safety limits.

The Prompt

Our pipeline is leaking. Deals sit in stages with missing fields, close dates get pushed silently, and stale opportunities never get cleaned up.

Goal: stage-gating validations (required fields per stage), close-date push tracking, and stale deal flagging. All deployed through sandbox first.

Use the Pipeline Hygiene blueprint. Discover current pipeline health, then propose bounded fixes.

Discovery-Driven Hygiene

Architect doesn't apply generic best practices — it discovers your pipeline's actual bottlenecks: which stages leak, which fields are empty, how often close dates get pushed. Bounded specs are generated from real data, with safety limits enforced on the number of validation rules and custom fields.

How Architect Handles This

1

Discover Pipeline Health

Query opportunity stages, field completeness rates, close-date push frequency, and stale deal counts.

2

Generate Bounded Specs

AI generates validation rules for stage gates, tracking fields for close-date pushes, and stale-deal automation — within safety limits.

3

Review Proposal

PROPOSAL.md with validation rules, tracking fields, and automation logic. Proposal hash locks the spec.

4

Deploy Sandbox

Approval token required. Validation rules and fields deployed to sandbox org.

5

Verify

Scouts confirm validation rules active, stage gates enforced, tracking fields populated.

After you paste this prompt, Claude Code:

"Pipeline hygiene issues — missing fields, stale deals, pushed close dates. Let me discover the current state before proposing fixes."

Running
$ g-gremlin autopilot architect init pipeline_hygiene --variant salesforce -p target_sandbox=dev -p prod_org_alias=prod
[Architect] Project arch_p4x8 created from blueprint: pipeline_hygiene (salesforce)
Running
$ g-gremlin autopilot architect discover arch_p4x8
[Architect] Querying pipeline stages, field completeness, close-date history... [Architect] 6 stages found, 23% of deals missing Amount at Negotiation [Architect] 41 deals with close date pushed 3+ times [Architect] 67 deals with no activity in 60+ days ✓ Discovery complete: discovery/discovery.json written

"Discovery shows significant pipeline leakage: 23% field gaps at Negotiation, 41 pushed deals, 67 stale deals. Proposing bounded validation rules."

Running
$ g-gremlin autopilot architect propose arch_p4x8
[Architect] Generating bounded specs from discovery data... [Architect] Safety limits: max_custom_fields=10, max_validation_rules=8 ✓ Proposal: 2 custom fields, 4 validation rules ✓ Written: proposal/PROPOSAL.md + proposal/metadata_pack/

Proposal includes bounded pipeline hygiene specs

Custom fields:
- Opportunity.Close_Date_Push_Count__c (Number) — Tracks how many times close date changed
- Opportunity.Last_Activity_Age__c (Formula) — Days since last activity
Validation rules:
- Require_Amount_At_Negotiation — Amount required at Negotiation stage
- Require_Contact_Role_At_Proposal — Contact role required at Proposal
- Block_Excessive_Push — Block close date change if push count > 3
- Flag_Stale_At_Discovery — Warning if no activity in 45+ days at Discovery
Running
$ g-gremlin autopilot architect deploy arch_p4x8 --sandbox
[Architect] Approval token required. Posting to Slack... [Architect] Token received (ttl: 600s) [Architect] Deploying to sandbox: dev ✓ Sandbox deploy complete. Receipt: receipts/arch_p4x8/deploy_sandbox.json
Running
$ g-gremlin autopilot architect verify arch_p4x8
[Architect] Running verification scouts... ✓ Verification passed: 4 validation rules active, 2 tracking fields present

Pipeline Hygiene Pack deployed to sandbox. 2 tracking fields, 4 validation rules. Verified and receipted.

Output Artifacts

CRM Changes

  • Close date push counter — Tracks how many times close date changed
  • Activity age formula — Days since last activity (real-time)
  • 4 validation rules — Stage gates, push blocking, stale flagging

Local Artifacts

  • PROPOSAL.md — Pipeline analysis with validation rule rationale
  • metadata_pack/ — SFDX-format validation rules and fields
  • deploy receipts — Before/after evidence with verification results

Cross-CRM: Available for both Salesforce (Opportunity stages) and HubSpot (Deal pipeline stages). Use --variant hubspot at init.

Results

2
Custom fields
4
Validation rules
67
Stale deals flagged
Pass
Verification

Try This Blueprint

Deploy pipeline hygiene rules with confidence — sandbox-first, always.

Blueprint: Pipeline Hygiene Pack | Deal Desk | FoundryOps