|
| 1 | +--- |
| 2 | +name: create-project |
| 3 | +description: >- |
| 4 | + Create a Diffy project with the diffy CLI from user-provided project details. Use when the user asks to |
| 5 | + create a Diffy project, set up a new project in Diffy, or turn a base URL, pages, and breakpoints into a |
| 6 | + new Diffy project. Requires the user to provide base_url and returns the created project ID. |
| 7 | +allowed-tools: Bash, Read, Write |
| 8 | +--- |
| 9 | + |
| 10 | +# create-project |
| 11 | + |
| 12 | +Create Diffy projects only. Do not update existing project settings, upload screenshots, create diffs, or |
| 13 | +summarize diff results in this skill. |
| 14 | + |
| 15 | +Always generate a fresh JSON config from the user's input. Do not use the repo's example JSON or YAML files |
| 16 | +as the project creation input. |
| 17 | + |
| 18 | +## Preflight |
| 19 | + |
| 20 | +1. Resolve the CLI: |
| 21 | + - Prefer `diffy` from `PATH`. |
| 22 | + - Else, if `./vendor/bin/diffy` exists in the current repo, use that. |
| 23 | + - Else, ask the user to install it and stop until it is available. Suggested install (pick a bin |
| 24 | + directory the user can write to — `/usr/local/bin` may need `sudo`; Homebrew on Apple Silicon uses |
| 25 | + `/opt/homebrew/bin`): |
| 26 | + `wget -O /usr/local/bin/diffy https://github.com/diffywebsite/diffy-cli/releases/latest/download/diffy.phar && chmod a+x /usr/local/bin/diffy` |
| 27 | +2. Check authentication: `~/.diffy-cli/diffy-cli.yaml` must exist. If it does not, run |
| 28 | + `diffy auth:login <API_KEY>` after the user provides the key (key from https://app.diffy.website/#/keys). |
| 29 | + |
| 30 | +## Inputs |
| 31 | + |
| 32 | +Required: |
| 33 | +- `base_url`: the production/base URL for the new project, for example `https://www.example.com`. This is |
| 34 | + written to the config as the `production` field (same field name `update-project-settings` uses). |
| 35 | + |
| 36 | +If `base_url` is missing, ask the user for it before creating the config. Do not infer it from examples. |
| 37 | + |
| 38 | +Optional: |
| 39 | +- `name`: default to the hostname from `base_url` if omitted. |
| 40 | +- `pages` or `urls`: default to only the homepage path `/` if omitted. |
| 41 | +- `breakpoints`: default to `[640, 1024, 1200]` if omitted. |
| 42 | +- `staging`: default to an empty string if omitted. |
| 43 | +- `development`: default to an empty string if omitted. |
| 44 | +- `schedule`: omit by default (no monitoring schedule). The create endpoint expects a schedule *string* |
| 45 | + such as `"mon:false, tue:false, wed:false, thu:false, fri:false, sat:false, sun:false"`, so only add this |
| 46 | + field when the user asks for a schedule. |
| 47 | + |
| 48 | +Create a JSON config in `.diffy-skills/project-create/<safe-name>.json`. Do not overwrite an existing |
| 49 | +config unless the user asked for that exact file to be replaced. |
| 50 | + |
| 51 | +Generated JSON shape: |
| 52 | + |
| 53 | +```json |
| 54 | +{ |
| 55 | + "name": "Project name", |
| 56 | + "breakpoints": [640, 1024, 1200], |
| 57 | + "production": "https://www.example.com", |
| 58 | + "staging": "https://staging.example.com", |
| 59 | + "development": "", |
| 60 | + "urls": [ |
| 61 | + "https://www.example.com/", |
| 62 | + "https://www.example.com/about" |
| 63 | + ] |
| 64 | +} |
| 65 | +``` |
| 66 | + |
| 67 | +Rules: |
| 68 | +- Keep `urls` absolute by resolving each page path against `base_url`. |
| 69 | +- Do not create from example/sample config files. |
| 70 | +- This skill creates one project per run unless the user explicitly provides several `base_url` values. |
| 71 | + |
| 72 | +## Create |
| 73 | + |
| 74 | +Run: |
| 75 | + |
| 76 | +```bash |
| 77 | +diffy project:create <generated-config.json> |
| 78 | +``` |
| 79 | + |
| 80 | +The command prints created IDs in this form: |
| 81 | + |
| 82 | +```text |
| 83 | +[12345] created. |
| 84 | +``` |
| 85 | + |
| 86 | +Parse and report the numeric project ID(s). Then verify each project: |
| 87 | + |
| 88 | +```bash |
| 89 | +diffy project:get <PROJECT_ID> |
| 90 | +``` |
| 91 | + |
| 92 | +Return a concise result with: |
| 93 | +- project ID |
| 94 | +- project name |
| 95 | +- production/base URL |
| 96 | +- pages count |
| 97 | +- breakpoints |
| 98 | +- config file path used |
| 99 | + |
| 100 | +If creation fails, show the exact CLI error and the config path. Do not retry by changing project settings; |
| 101 | +that belongs to `update-project-settings`. |
| 102 | + |
| 103 | +This skill writes its generated config under `.diffy-skills/`; offer to add `.diffy-skills/` to the repo's |
| 104 | +`.gitignore` if it is not already ignored. |
0 commit comments