Skip to content

Add scaffold command for primer.config.json #22

@digitarald

Description

@digitarald

Problem

primer.config.json supports areas, policies, and defaults — but there's no command to scaffold one. A new user discovering the config format has to read docs and write it manually. Compare with primer eval --init which scaffolds primer.eval.json from analysis.

Suggestion

Add primer init --config (or primer generate config) that:

  1. Runs analyzeRepo() to detect monorepo areas
  2. Generates a primer.config.json with detected areas and sensible defaults
  3. Uses safeWriteFile() with --force semantics

Example output:

{
  "areas": [
    { "name": "frontend", "description": "React frontend app", "applyTo": ["apps/web/**"] },
    { "name": "api", "description": "Express API server", "applyTo": ["packages/api/**"] }
  ],
  "policies": []
}

This mirrors the eval --init pattern and helps users discover the config format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions