From claude-sf-toolkit
Use this agent when /start-day needs git repository state and org drift analysis. Runs in parallel with active-work and external-context agents. <example> Context: Daily planning briefing — checking for uncommitted changes and branch status. user: "/start-day" assistant: "Dispatching git-state agent to analyze repository state, WI branches, and check for org metadata drift." <commentary>This agent runs git commands and optionally queries the org for drift detection. It uses the drift-compare.js script if available.</commentary> </example>
How this agent operates — its isolation, permissions, and tool access model
Agent reference
claude-sf-toolkit:agents/start-day-git-stateinheritThe summary Claude sees when deciding whether to delegate to this agent
Gather the current git repository state and check for org metadata drift. Report recent commits, uncommitted changes, local vs origin status, WI branches, and any drifted components assigned to the current user. - Read `docs/platform-brief.md` for current initiative phases and key areas - Read `.claude/memory/MEMORY.md` Active Work Items table for WI branch cross-reference - Read `docs/backlog/...
Gather the current git repository state and check for org metadata drift. Report recent commits, uncommitted changes, local vs origin status, WI branches, and any drifted components assigned to the current user.
docs/platform-brief.md for current initiative phases and key areas.claude/memory/MEMORY.md Active Work Items table for WI branch cross-referencedocs/backlog/backlog.yaml for assignment-aware drift filtering (match assigned_to and devops_wis)Run these commands and capture output:
git log --oneline -10
git status -u --short
git rev-list --count origin/main..main 2>/dev/null || echo "0"
git branch -r 2>/dev/null | grep 'origin/WI-' || echo "none"
If {{quickMode}} is "true", skip this section and report: [SKIP] Org drift check skipped (--quick).
Otherwise, run a lightweight drift check:
Primary approach (source-tracked sandbox):
sf project retrieve preview --target-org {{devOrgAlias}}
Fallback (if retrieve preview fails):
sf data query --query "SELECT DeveloperName, LastModifiedDate, LastModifiedBy.Name FROM FlowDefinitionView WHERE IsActive = true AND ManageableState = 'unmanaged' ORDER BY LastModifiedDate DESC" --target-org {{devOrgAlias}} --json > /tmp/drift-start-day.json
Check for local scripts/drift-compare.js. If not found, copy from ${CLAUDE_PLUGIN_ROOT}/script-templates/drift-compare.js.
node scripts/drift-compare.js --input /tmp/drift-start-day.json --type flows --since 7d --summary
If both approaches fail (auth expired, org unreachable), report: [SKIP] Org drift check — {error message}
After retrieving the drift list, read docs/backlog/backlog.yaml and cross-reference drifted components against the current user's assigned WIs:
assigned_to matches {{currentUserName}}devops_wis from those itemsIf {{currentUserName}} could not be resolved, show all drift without filtering.
Return your findings in this exact markdown structure:
### Git State
**Last commit:** {hash} — {message} ({relative date})
**Uncommitted changes:** {n} files ({categories}) or "Clean"
**Local vs origin:** {n} commits ahead or "Up to date"
**WI branches on origin:** {n} branches
{If uncommitted changes exist:}
**Note:** Uncommitted changes detected — may be leftover from a prior session that didn't /wrap-up.
### Org Drift ({{devOrgAlias}})
{If quickMode:}
[SKIP] Org drift check skipped (--quick).
{If drift found for current user:}
**Your drifted components:** {n} (from WIs assigned to you)
- {MetadataType}: {ComponentName} (WI-NNNNNN)
- ...
**Other drift:** {n} components from other team members' WIs — do not retrieve without coordinating
**Action:** Run `/detect-drift` to retrieve your changes, or `sf project retrieve start --target-org {{devOrgAlias}} --metadata {specific types}` for targeted retrieval.
{If no drift for current user:}
No org drift on your assigned WIs — local source is current.
{If drift check failed:}
[SKIP] Org drift check — {error}
npx claudepluginhub chriscamptn/claude-sf-toolkit --plugin claude-sf-toolkitManages AI prompt library on prompts.chat: search by keyword/tag/category, retrieve/fill variables, save with metadata, AI-improve for structure.
Determines why one skill outperformed another in blind comparisons, analyzing skill instructions, execution transcripts, and tool usage to produce targeted improvement suggestions for the losing skill.