Reflecting on the Metadata-First Approach
In our previous modules, we leveraged a powerful 'Good Pattern': Metadata-Driven Development. By working directly with Salesforce XML files and the SFDX CLI via Cursor, we bypassed the manual clicks of the Setup UI. This approach is highly effective because LLMs like Cursor are exceptionally good at reading, generating, and structured-editing XML and JSON. This allows for version-controllable changes and rapid deployment cycles that are far more scalable than traditional 'point-and-click' administration.
The Trap of Micromanagement
However, we also engaged in a 'Bad Pattern' that is common for beginners: Micromanaging the Agent. In the previous exercise, you likely gave Cursor specific, step-by-step instructions—telling it exactly which file to open, which line to edit, and which CLI command to run. While this works, it treats Cursor as a simple 'autocomplete' tool rather than a sophisticated engineering agent. When you micromanage, you become the bottleneck, spending more time thinking about the implementation details than the business solution.
Transitioning to Goal-Oriented Prompting
To truly unlock 'Agentic Engineering,' we must move from Imperative Prompting (telling it how) to Declarative Prompting (telling it what). Instead of saying 'Open the Account.field-meta.xml and add a picklist,' a better pattern is to say: 'Add a new picklist field called Industry Segment to the Account object with values X, Y, and Z, and ensure it is visible to the Standard User profile.' This allows Cursor to:
- Independently locate the correct metadata files.
- Identify necessary dependencies (like Permission Sets or Layouts).
- Execute the deployment commands automatically.