credential-switch
Switch brand credentials. Use when: activating the correct API keys for MCP servers in multi-client workflows.
What this skill does
# /digital-marketing-pro:credential-switch
## Purpose
Switch the active credential profile to a different brand for multi-client agency management. Validates all platform connections and reports which services are available for the target brand. Ensures the correct API keys, tokens, and environment variables are active before executing any platform operations — preventing cross-client data leakage, misrouted ad spend, or accidental operations on the wrong account.
## Input Required
The user must provide (or will be prompted for):
- **Target brand slug**: The brand slug to switch credentials to — must match a configured brand in `~/.claude-marketing/brands/` with a corresponding credential profile in `~/.claude-marketing/credentials/`
- **Validation depth (optional)**: One of:
- Quick: Check that env vars exist and are non-empty — fast, no API calls
- Full: Test live API connectivity and token validity for each configured platform — slower but confirms actual access
- Defaults to quick for faster switching
- **Force switch (optional)**: If the target profile has missing or expired credentials, whether to switch anyway with warnings or abort entirely — defaults to abort on missing critical credentials (ad platforms, analytics)
- **Reason (optional)**: Brief note for the switch log — helps with audit trail when multiple team members share the system (e.g., "Starting monthly reporting for Acme Corp")
- **Platforms to validate (optional)**: Specific platforms to validate instead of all — useful when you only need certain integrations for the current task (e.g., "google-ads, google-analytics" for a paid media session)
## Process
1. **Check current context**: Read `~/.claude-marketing/brands/_active-brand.json` to identify the currently active brand, and `~/.claude-marketing/credentials/_active-profile.json` for the current credential profile. Display current state before switching.
2. **Verify target brand exists**: Confirm the target brand slug has a configured profile at `~/.claude-marketing/brands/{slug}/profile.json`. If not found, list all available brands from `~/.claude-marketing/brands/` and suggest `/digital-marketing-pro:brand-setup` for new brands or `/digital-marketing-pro:client-onboarding` for new client setup
3. **Check credential profile exists**: Run `credential-manager.py --action get-profile --id {slug}` to verify a credential profile exists for the target brand. If missing, explain how to create one with the required platform credentials and abort with setup instructions
4. **Validate credential profile**: Run `credential-manager.py --action validate-profile --id {slug}` to check each platform's credentials — verify API keys are present and non-empty, OAuth tokens are not expired, and required environment variables are set for all MCP servers configured in `.mcp.json`
5. **Present validation summary**: Display a platform-by-platform validation report — for each configured service:
- Platform name and type (ad platform, analytics, CRM, social, email)
- Credential status: configured / not configured / expired
- Required env vars: set or missing (with specific variable names)
- Token expiry date if applicable
- Last successful connection timestamp if available
6. **Check for active operations**: Before switching, scan `execution-tracker.py --action list --status in-progress` for any in-progress executions, scheduled deliveries, or queued operations running under the current profile that could be disrupted by a context switch. Warn with specific operation details if any are found
7. **Confirm switch intent**: If validation passed cleanly, proceed automatically. If warnings exist (missing non-critical credentials, expiring tokens within 7 days), present the warnings and ask for confirmation. If critical credentials are missing and force is not set, abort with specific guidance on what needs to be configured
8. **Execute credential switch**: Run `credential-manager.py --action switch-profile --id {slug}` to activate the target brand's credential profile. This updates the active profile reference and loads the corresponding environment variables for all MCP servers
9. **Switch active brand**: Update `~/.claude-marketing/brands/_active-brand.json` to set the target brand as the active brand context — ensuring brand profile and credentials are aligned so all subsequent commands use the correct client
10. **Verify switch success**: Re-read both `_active-brand.json` and `_active-profile.json` to confirm the switch completed successfully. If full validation was requested, run a quick connectivity test on critical platforms (Google Ads, Analytics, CRM) to confirm live access works
11. **Log the switch**: Record the switch event with timestamp, previous brand, new brand, validation result, any warnings, and reason (if provided) in `~/.claude-marketing/credentials/switch-log.json` for audit trail purposes
12. **Report new active context**: Display the new active brand name, slug, industry, business model, configured platforms with their validation status, and any warnings for missing or expiring credentials. Suggest relevant next steps based on common post-switch workflows
## Output
A credential switch confirmation containing:
- **Previous context**: Brand name, slug, and credential profile that was active before the switch — so the user can verify what they switched away from and return if needed
- **New active context**: Brand name, slug, industry, business model, primary marketing channels, engagement type, and contract status now active
- **Platform validation report**: Per-platform status table — platform name, configured (yes/no), env vars (set/missing with specific var names listed), token status (valid/expired/N/A with expiry date if applicable), and connectivity result (verified/not tested/failed with error detail)
- **Missing credential warnings**: Any platforms configured in the brand profile but missing API keys or tokens, with specific instructions for adding them — which env var to set, where to obtain the credential, and whether the platform is critical or optional for current workflows
- **Expiring credential alerts**: Any tokens or keys approaching expiration within 7 days, with renewal instructions, urgency level (informational/action-needed/critical), and impact if not renewed
- **Active operations check**: Confirmation that no in-progress operations were disrupted, or detailed warnings listing any operations that may need attention after the switch
- **Switch log entry**: Timestamp, previous brand, new brand, validation summary, warnings count, and reason — recorded for audit and troubleshooting purposes
- **Next steps**: Confirmation message — "All operations will now use [brand_name]'s credentials. Configured platforms: [list]. Use `/digital-marketing-pro:agency-dashboard` to see this client's status, `/digital-marketing-pro:client-report` to generate a performance report, or `/digital-marketing-pro:credential-switch` again to return to the previous brand."
## Agents Used
- **agency-operations** — Credential profile management, platform validation logic, active operations safety check, switch execution, context alignment verification, audit logging, and post-switch recommendation engine
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".