A spec-driven CLI tool for creating consistent, on-brand marketing materials using AI assistants.
MarketSpec helps marketing teams define specifications for their content, then use those specs to generate and validate materials with AI assistants like Claude Code.
- Brand Foundation: Centralize your brand voice, messaging, audience profiles, and guidelines
- Campaign Management: Organize marketing materials by campaign with briefs and specs
- Spec Templates: Pre-built templates for emails, landing pages, social posts, and more
- AI-Ready Prompts: Generate context-rich prompts for AI content generation
- Content Validation: Validate generated content against specs and brand guidelines
- Claude Code Integration: Slash commands for seamless AI workflow
- Node.js >= 20.19.0
- pnpm (recommended) or npm
git clone https://github.com/your-org/marketspec.git
cd marketspec
pnpm install
pnpm build# After building
npm link
# Now you can use 'marketspec' from anywheremarketspec initThis creates the following structure:
marketspec/
├── brand/
│ ├── voice.md # Brand voice characteristics
│ ├── messaging.md # Key messaging framework
│ ├── audience.md # Target audience profiles
│ ├── guidelines.md # Brand guidelines
│ └── glossary.md # Approved terms and terms to avoid
├── campaigns/ # Your marketing campaigns
├── templates/ # Spec templates
├── output/ # Generated content
├── AGENTS.md # AI assistant instructions
└── project.md # Project overview
.claude/
└── commands/ # Claude Code slash commands
Edit the brand documents to define your brand:
# Validate brand documents are complete
marketspec brand validate
# View brand summary
marketspec brand show
# View specific document
marketspec brand show voicemarketspec campaign create product-launchThis creates:
marketspec/campaigns/product-launch/
├── brief.md # Campaign objectives and context
├── materials.md # List of required materials
├── specs/ # Material specifications
└── assets/ # Campaign assets
# Create an email spec
marketspec spec create product-launch welcome-email --template email
# Create a landing page spec
marketspec spec create product-launch main-landing --template landing-page
# List specs in campaign
marketspec spec list product-launch# Generate a prompt for AI content creation
marketspec generate product-launch welcome-email
# Generate prompts for all materials
marketspec generate product-launch --all
# Generate with A/B variations
marketspec generate product-launch welcome-email --variations 3# Validate a single material
marketspec validate product-launch welcome-email
# Validate all materials in campaign
marketspec validate product-launch --all
# Generate validation report
marketspec validate product-launch --reportmarketspec init # Initialize new project
marketspec init --force # Overwrite existing filesmarketspec brand validate # Validate brand documents
marketspec brand show # Show brand summary
marketspec brand show <document> # Show specific document (voice, messaging, audience, guidelines, glossary)
marketspec brand check <file> # Check content against brand guidelinesmarketspec campaign create <name> # Create new campaign
marketspec campaign list # List all campaigns
marketspec campaign show <name> # Show campaign details
marketspec campaign clone <source> <target> # Clone campaign as template
marketspec campaign archive <name> # Archive completed campaign
marketspec campaign archive <name> --yes # Archive without confirmationmarketspec spec create <campaign> <name> --template <type> # Create spec from template
marketspec spec list <campaign> # List specs in campaign
marketspec spec show <campaign> <name> # Show spec details
marketspec spec validate <campaign> <name> # Validate single spec
marketspec spec validate <campaign> --all # Validate all specsAvailable Templates:
email- Marketing emailslanding-page- Landing pagessocial-post- Social media postsblog-post- Blog articlesad-copy- Advertising copyvideo-script- Video scriptscase-study- Case studiesone-pager- One-page documentspress-release- Press releases
marketspec generate <campaign> <material> # Generate prompt
marketspec generate <campaign> --all # Generate all prompts
marketspec generate <campaign> <material> --variations 3 # Generate with variations
marketspec generate <campaign> <material> --feedback "text" # Regenerate with feedbackmarketspec validate <campaign> <material> # Validate single material
marketspec validate <campaign> --all # Validate all materials
marketspec validate <campaign> --report # Generate validation reportmarketspec view # Show project dashboard
marketspec view <campaign> # Show campaign details
marketspec export <campaign> # Export to JSON
marketspec export <campaign> --format md # Export to Markdown
marketspec export <campaign> --output path # Custom output pathmarketspec config # Show effective configuration
marketspec config --json # Show configuration as JSONmarketspec update # Regenerate AGENTS.md and slash commands
marketspec update --commands # Update only slash commands
marketspec completion bash # Generate bash completions
marketspec completion zsh # Generate zsh completions
marketspec completion fish # Generate fish completions
marketspec completion --install # Show installation instructionsMarketSpec uses a layered configuration system:
- Default values (built-in)
- User config (
~/.marketspec/config.yaml) - Project config (
./marketspec.config.yaml) - Environment variables (highest priority)
# marketspec.config.yaml
version: 1
brand:
path: ./marketspec/brand
required:
- voice.md
- messaging.md
- audience.md
campaigns:
path: ./marketspec/campaigns
archive_path: ./marketspec/campaigns/archive
output:
path: ./marketspec/output
format: markdown # or 'json'
validation:
strict: true
fail_on_warnings: false
ai:
default: claude
context_limit: 100000
include_examples: true
templates:
path: ./marketspec/templates
custom: trueOverride any configuration with environment variables:
# Override validation strictness
export MARKETSPEC_VALIDATION_STRICT=false
# Override output format
export MARKETSPEC_OUTPUT_FORMAT=json
# Override AI context limit
export MARKETSPEC_AI_CONTEXT_LIMIT=50000MarketSpec installs slash commands for use with Claude Code:
| Command | Description |
|---|---|
/ms-generate <campaign> [material] |
Generate content from spec |
/ms-validate <campaign> [material] |
Validate content against spec |
/ms-brand-check |
Check content against brand guidelines |
/ms-variations <n> |
Generate content variations |
/ms-brief <campaign> |
Display campaign brief |
/ms-spec <campaign> <material> |
Display material spec |
/ms-voice |
Display brand voice guidelines |
/ms-status <campaign> |
Display campaign progress |
- Open your project in Claude Code
- Use
/ms-brief product-launchto review the campaign - Use
/ms-spec product-launch welcome-emailto see requirements - Ask Claude to generate content based on the spec
- Use
/ms-validate product-launch welcome-emailto check the result
# 1. Initialize project (first time only)
marketspec init
# 2. Set up brand foundation
# Edit marketspec/brand/*.md files
marketspec brand validate
# 3. Create campaign
marketspec campaign create spring-sale
# 4. Define campaign brief
# Edit marketspec/campaigns/spring-sale/brief.md
# 5. Create material specs
marketspec spec create spring-sale promo-email --template email
marketspec spec create spring-sale sale-page --template landing-page
marketspec spec create spring-sale social-announcement --template social-post
# 6. Fill in spec requirements
# Edit each spec file in marketspec/campaigns/spring-sale/specs/
# 7. Validate specs
marketspec spec validate spring-sale --all
# 8. Generate AI prompts
marketspec generate spring-sale --all
# 9. Create content using AI (Claude Code or copy prompts)
# 10. Validate content
marketspec validate spring-sale --all --report
# 11. View progress
marketspec view spring-sale
# 12. Export when complete
marketspec export spring-sale
# 13. Archive campaign
marketspec campaign archive spring-sale# Check any content file against brand guidelines
marketspec brand check path/to/content.md
# This checks for:
# - Prohibited terms from glossary
# - Brand voice compliance
# - Terminology consistency# Generate multiple variations
marketspec generate spring-sale promo-email --variations 3
# AI will produce labeled variations:
# - Variation 1: [approach A]
# - Variation 2: [approach B]
# - Variation 3: [approach C]- BRAND-001: Content MUST NOT use terms from "avoid" list in glossary
- CAMP-001: Campaign MUST have brief.md
- CAMP-002: Campaign MUST have materials.md
- CAMP-003: Each material in checklist MUST have a spec
- CAMP-004: Campaign brief MUST have Objective section
- CAMP-005: Campaign brief SHOULD have Success Metrics
- SPEC-001: Spec MUST have an Objective section
- SPEC-002: Spec MUST have at least one Key Message
- SPEC-003: Spec MUST have at least one Requirement with SHALL/MUST
- SPEC-004: Spec MUST have at least one Acceptance Criteria scenario
- SPEC-005: Spec SHOULD have Target Audience defined
- SPEC-006: Spec SHOULD reference brand foundation documents
- SPEC-007: Requirements MUST have unique IDs (REQ-XXX)
- SPEC-008: CTA requirements MUST specify destination
- CONT-001: Content MUST satisfy all SHALL/MUST requirements
- CONT-002: Content MUST include all Key Messages marked MUST
- CONT-003: Content MUST pass all Acceptance Criteria scenarios
- CONT-004: Content SHOULD satisfy all SHOULD requirements
- CONT-005: Content MUST NOT contain prohibited terms from glossary
- CONT-006: Content MUST match specified format requirements
- CONT-007: Content SHOULD match brand voice characteristics
- CONT-008: CTAs MUST match specified CTA requirements
your-project/
├── marketspec/
│ ├── brand/
│ │ ├── voice.md # Brand voice characteristics
│ │ ├── messaging.md # Core messaging and value props
│ │ ├── audience.md # Target audience profiles
│ │ ├── guidelines.md # Visual and content guidelines
│ │ └── glossary.md # Approved terms and terms to avoid
│ │
│ ├── campaigns/
│ │ ├── [campaign-name]/
│ │ │ ├── brief.md # Campaign objectives
│ │ │ ├── materials.md # Required materials checklist
│ │ │ ├── specs/ # Material specifications
│ │ │ │ ├── email.md
│ │ │ │ └── landing-page.md
│ │ │ └── assets/ # Campaign-specific assets
│ │ │
│ │ └── archive/ # Archived campaigns
│ │
│ ├── output/
│ │ └── [campaign-name]/
│ │ └── [material]/
│ │ ├── prompt.md # Generated AI prompt
│ │ ├── content.md # Generated content
│ │ └── validation.md # Validation results
│ │
│ ├── templates/ # Custom spec templates
│ ├── AGENTS.md # AI assistant instructions
│ └── project.md # Project overview
│
├── .claude/
│ └── commands/ # Claude Code slash commands
│
└── marketspec.config.yaml # Project configuration
Install shell completions for better CLI experience:
marketspec completion bash > ~/.marketspec-completion.bash
echo 'source ~/.marketspec-completion.bash' >> ~/.bashrc
source ~/.bashrcmarketspec completion zsh > ~/.marketspec-completion.zsh
echo 'source ~/.marketspec-completion.zsh' >> ~/.zshrc
source ~/.zshrcmarketspec completion fish > ~/.config/fish/completions/marketspec.fish# Install dependencies
pnpm install
# Build
pnpm build
# Run tests
pnpm test
# Watch mode for tests
pnpm test:watch
# Type checking
pnpm lint| Component | Technology |
|---|---|
| Runtime | Node.js >= 20.19.0 |
| Language | TypeScript 5.x |
| CLI Framework | Commander.js |
| Prompts | @inquirer/prompts |
| Styling | Chalk |
| Spinners | Ora |
| Schema Validation | Zod |
| Markdown | marked, gray-matter |
| Testing | Vitest |
| Package Manager | pnpm |
MIT