grzmol/vibe-force/sf-project-structure
Claude Code and agent skill by grzmol/vibe-force
- community
Checking that the SKILL.md file is still in the repository.
Structuring a Salesforce DX repository — the full `sfdx-project.json` schema (packageDirectories, default, sourceApiVersion, namespace, sfdcLoginUrl, plugins, packageAliases, replacements, sourceBehaviorOptions, oauthLocalPort, pushPackageDirectoriesSequentially), source-format directory layout for every metadata type (`objects/<Obj>/fields`, `classes`, `triggers`, `lwc`, `aura`, `flows`, `permissionsets`, `layouts`, `flexipages`, `staticresources`, `labels`, `settings`), decomposed metadata types, multiple package directories and modularisation, `.forceignore` semantics and precedence, `package.xml` and `destructiveChangesPre/Post.xml` manifests with `sf project generate manifest`, the source-tracking model (`sf project deploy|retrieve start|preview`, `delete source`, `reset tracking`, `--ignore-conflicts`), source/metadata format conversion, team repo conventions, and the `.vibeforce/` layout. Use this skill when creating or reorganising a DX project, deciding where a metadata file belongs, writing or auditing `.forceignore` or a manifest, resolving source-tracking conflicts, splitting a monolith into package directories, or reviewing metadata XML diffs.
Install
npx vskill@latest install grzmol/vibe-force/sf-project-structureSKILL.md
The same SKILL.md was published earlier as grzmol/vibe-force/sf-project-structure.
Salesforce DX Project Structure
A directory is a Salesforce DX project because it contains sfdx-project.json. That file tells the CLI which directories hold source (packageDirectories), what metadata shape to speak (sourceApiVersion), and where to log in (sfdcLoginUrl).
When to use
| Situation | Action | |
|---|---|---|
| Creating a repo or adding a package directory | sfdx-project.json schema + multiple-package-directory rules below | |
| "Where does this metadata file go?" | `references/metadata-directory-map.md` | |
| Source keeps getting deployed that should not be | .forceignore precedence, pattern 4, and sf project list ignored | |
| Building a deployment or deletion manifest | sf project generate manifest, `references/forceignore-and-manifests.md` | |
sf project deploy start reports conflicts | Pattern 5 — resolve, then deploy or retrieve with --ignore-conflicts | |
| Importing an existing metadata-format repo | sf project convert mdapi (pattern 6) | |
| Setting team conventions, review rules, branch model | `references/repo-conventions.md` |
Related skills: sf-cli-operations (flags, config, API version resolution), sf-deployment-strategies (deploy/validate/quick-deploy mechanics and test levels), sf-scratch-orgs-sandboxes (org lifecycle, source tracking availability), sf-packaging-release (package directories becoming 2GP/unlocked packages), sf-security-model (profile vs permission-set policy).
Canonical layout
sfdx-project.json quick reference
| Property | Required | Purpose | |
|---|---|---|---|
packageDirectories | yes | Array of { "path": "...", "default": true }. Relative paths only. Exactly one default; with a single entry it is implied | |
sourceApiVersion | recommended | API version the metadata conforms to — becomes <version> in the generated manifest. vibe-force sets 67.0 | |
namespace | optional | Namespace applied to scratch orgs created from this project; must be linked to the Dev Hub | |
sfdcLoginUrl | optional | Login URL for sf org login *; default https://login.salesforce.com. Use the My Domain form for sandboxes | |
oauthLocalPort | optional | OAuth callback port; default 1717. Must match the connected app callback URL | |
packageAliases | optional | CLI-maintained map of readable names to 0Ho/04t package ids | |
plugins | optional | Per-plugin settings you want version-controlled | |
replacements | optional | Deploy-time string/regex substitution driven by env vars or files | |
sourceBehaviorOptions | optional (Beta) | Extra decomposed types. Never hand-edit — run sf project convert source-behavior | |
pushPackageDirectoriesSequentially | deprecated | Only affected the retired force:source:push; has no effect on sf project deploy start |
Full property tables, packaging fields, and replacements variants: `references/sfdx-project-schema.md`.
Core patterns
1. Start the project, pin the API version
Keep sourceApiVersion equal to the vibe-force apiVersion (config/vibe-force.defaults.json) and to org-api-version; sf doctor runs a sourceApiVersion matches apiVersion check and warns when they diverge. sourceApiVersion governs the shape of the metadata: deploying a file that contains a field introduced in a later API version fails if sourceApiVersion is older, and retrieving with an older value silently drops newer subelements.
2. Model the domain with multiple package directories
Each directory repeats the standard main/default/... tree, so MyObject__c can live in force-app while a new field on it lives in sales-ext/main/default/objects/MyObject__c/fields/. Facts that matter:
- The split is client-side only. Deploying does not associate a directory with a package in the org.
sf project deploy startwith no targeting flag deploys all package directories in one
transaction. Order is not guaranteed, so sequence explicitly when you need it:
- The default directory is the retrieve target and the default output directory for conversions.
- These directories are the natural boundary for later unlocked/2GP packages (skill
sf-packaging-release), and the natural ownership boundary for the vibe-force wave-1 agents.
3. Know the source format rules that surprise people
| Rule | Detail | |
|---|---|---|
| Custom objects and custom object translations are always decomposed | objects/<Object>/<Object>.object-meta.xml plus fields/, recordTypes/, listViews/, validationRules/, compactLayouts/, fieldSets/, businessProcesses/, indexes/, sharingReasons/, webLinks/ | |
| Optional decomposition is opt-in and beta | CustomLabels, PermissionSet, SharingRules, Workflow, ExternalServiceRegistration via sf project convert source-behavior --behavior <value> | |
| Bundles need exact directory names | lwc, aura, staticresources, experiences, documents, objects, objectTranslations, sites, emailservices, waveTemplates, lightningTypes, genAiFunctions, restrictionRules, bots, aiAuthoringBundles are strictDirectoryName types — a bundle in the wrong folder is invisible to the CLI | |
Static resources live only in <pkg>/main/default/staticresources | .zip/.jar archives are auto-expanded on retrieve; an archive that exists as a single file stays a single file. New resources use their MIME extension (.gif, .png); legacy .resource files keep that extension | |
| Content types have two files | ApexClass, ApexTrigger, ApexPage, ApexComponent, EmailTemplate, StaticResource ship a payload plus -meta.xml. Treat them as a pair in .forceignore and in reviews | |
| Names with special characters are URL-encoded on disk | Custom: Marketing Profile becomes Custom%3A Marketing Profile.profile-meta.xml, and .forceignore must use the encoded name | |
| Folder-based types nest one level | reports/<Folder>/<Report>.report-meta.xml, same for dashboards, documents, email |
4. Write .forceignore deliberately
.forceignore uses .gitignore syntax and is honoured by project deploy start, project retrieve start, project convert source, and project delete source.
Precedence: when the commands decide whether to exclude a file they walk up from that file until they find the first .forceignore, consult it, and stop. A .forceignore inside sales-ext/ therefore fully overrides the project-root one for files under sales-ext/. Put the primary file at the project root; a per-package file is legitimate but must be documented.
Independently of .forceignore, the project commands always skip dot-files and dot-directories, files ending in .dup, package2-descriptor.json, and package2-manifest.json.
Verify, never guess:
vf-check static fails when a changed file is silently ignored by .forceignore but expected to be part of the story, which is the common cause of "it works in my scratch org but not in UAT".
5. Operate source tracking honestly
| Org type | Source tracking | |
|---|---|---|
| Scratch org | Always available, on by default | |
| Developer / Developer Pro sandbox | Available when the production org has source tracking enabled | |
| Developer Edition, production, Partial Copy, Full sandbox | Not supported |
Conflict resolution: preview reports Conflicts [n]. Resolve the file, then overwrite one side deliberately and narrowly:
--ignore-conflicts silently discards the other side's work. Scope it to the component you decided about; never add it to a whole-project command "to make the error go away". vibe-force hooks warn on --ignore-conflicts in standard mode and block it against a production alias in strict mode.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/sf-project-structure/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grzmol/vibe-force/sf-project-structure)