@webship.co/workspace-craft-cms 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,8 @@
3
3
  Craft CMS for the [Webship Workspace](https://github.com/webship/workspace) dashboard: a builder
4
4
  that makes a real Craft CMS site in a container, a craft console tool for the sites it built, the
5
5
  default account, the [Craft CMS step pack](https://github.com/webship/craft-cms-steps) wired into
6
- the workspace's testing setup, and two AI agents that know all of it.
6
+ the workspace's testing setup, and its AI items — two agents, a skill, a command and a prompt —
7
+ each listed in the workspace folder of its kind.
7
8
 
8
9
  The workspace is container-based (DDEV by default): a Craft CMS project is a row like any other, so
9
10
  the row menus the core draws (start, stop, launch, backup, clone, remove, tests) work on it unchanged.
@@ -27,19 +28,46 @@ It is made from the reference platform plugin,
27
28
  cd ~/workspace
28
29
  bash core/scripts/plugins.sh --require github:webship/workspace-craft-cms # npm install into the dashboard
29
30
  bash core/scripts/plugins.sh --activate craft-cms # plugins.craft-cms in settings.yml
30
- bash core/scripts/plugins.sh --install craft-cms # commands, functions, args, agents
31
+ bash core/scripts/plugins.sh --install craft-cms # commands, functions, args, AI items
31
32
  bash core/scripts/plugins.sh --configure craft-cms # nothing to configure: it has no settings file
32
33
  ```
33
34
 
34
35
  The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is
35
- idempotent. `--uninstall` removes what it placed; an agent you edited stays.
36
+ idempotent. `--uninstall` removes what it placed; an AI item you edited stays.
36
37
 
37
- The commands land in the sites folders that are in the workspace (`dev`, `test`, `sandboxes`,
38
- `demos`); the agents land in the AI Agents folder (`ai-agents/`) when the workspace has one, and are
39
- installed into `~/.claude/agents` from there like any other agent.
38
+ Everything the plugin carries lands in the folder it belongs to, when that folder is an active
39
+ workspace folder:
40
+
41
+ | What | Lands in |
42
+ | --- | --- |
43
+ | `cmd-craft-cms-project.sh`, `cmd-tools-craft-cms-cli.sh` | every active sites folder: `dev/`, `test/`, `sandboxes/`, `demos/` |
44
+ | The agents `craft-cms-site-builder`, `craft-cms-tester` | `ai-agents/` |
45
+ | The skill `craft-cms-scenarios` | `ai-skills/` |
46
+ | The command `/craft-cms-test` | `ai-commands/` |
47
+ | The prompt `craft-cms-build-and-test` | `ai-prompts/` |
48
+
49
+ There they are listed like any other item of the folder, and installed into Claude Code from there.
40
50
 
41
51
  It needs a Webship Workspace 1.0.7 or later.
42
52
 
53
+ ## What it needs
54
+
55
+ A workspace starts empty, so the manifest says what else this plugin needs (`needs`):
56
+
57
+ - one sites folder, for the builder and the tool: `dev`, `test`, `sandboxes`, `demos` (`dev` is the one added when none is there). The folder also carries `cmd-tools-testing.sh` and the Users tools this plugin's hooks answer to.
58
+ - `ai-agents`, `ai-skills`, `ai-commands` and `ai-prompts`: the AI folders its agents, its skill, its command and its prompt are placed in.
59
+
60
+ `--require` says so, `--activate` and `--install` stop until the workspace has them, and `--with-needs` adds what is missing first:
61
+
62
+ ```bash
63
+ bash core/scripts/plugins.sh --activate craft-cms --with-needs # dev and the four AI folders are required, activated and installed first
64
+ bash core/scripts/plugins.sh --install craft-cms
65
+ ```
66
+
67
+ Everything the builder runs for a site runs in the site's own container, through the container tool the workspace already needs; the plugin asks for no command of its own on the machine.
68
+
69
+ A workspace that knows none of this (Webship Workspace 1.0.8 and older) ignores the keys: add a sites folder and the AI folders yourself, then `--install craft-cms` again. A kind whose folder is not there is skipped, and the install says so.
70
+
43
71
  ## What the package holds
44
72
 
45
73
  | Path | What it is |
@@ -49,8 +77,12 @@ It needs a Webship Workspace 1.0.7 or later.
49
77
  | `scripts/functions/fun-craft-cms.sh` | The bash functions behind both, sourced by bootstrap once installed; the names the core's tools look for (`set_craftcms_users`, `add_craftcms_users`, `cancel_craftcms_users`, `testing_configure_craftcms`, named after the DDEV project type `craftcms`) |
50
78
  | `scripts/args/arg-craft-cms.sh`, `arg-craft-cms-cli.sh` | Their argparse; the Build form draws the builder's flags from the first |
51
79
  | `testing/site.feature` | The first feature a Craft CMS project gets when testing is set up: the front page, the login form, the admin |
52
- | `agents/craft-cms-site-builder.md` | The agent that builds and maintains Craft CMS sites with these commands |
53
- | `agents/craft-cms-tester.md` | The agent that writes and runs scenarios with the Craft CMS step pack |
80
+ | `ai/agents/craft-cms-site-builder.md` | The agent that builds and maintains Craft CMS sites with these commands |
81
+ | `ai/agents/craft-cms-tester.md` | The agent that writes and runs scenarios with the Craft CMS step pack |
82
+ | `ai/skills/craft-cms-scenarios/` | The skill: the step pack's phrases a fresh Solo site answers to, the traps found on a real site, three example features |
83
+ | `ai/commands/craft-cms-test.md` | The slash command `/craft-cms-test <site>`: set up, match every step, run, report |
84
+ | `ai/prompts/craft-cms-build-and-test.md` | The prompt: a whole launch command for a new session |
85
+ | `docs/plugin-items-pattern.md` | How a plugin carries its own commands and AI items, and how to prove it |
54
86
  | `src/index.ts` | `register(api)`: what the assistant is told about Craft CMS here |
55
87
  | `features/craft-cms.feature` | Scenarios for the dashboard's own browser suite |
56
88
 
@@ -138,25 +170,46 @@ admin may open, logging out. On a site whose one account is the workspace accoun
138
170
  account in its environment (`ADMIN_USER`, `ADMIN_PASSWORD`) or build the site again with
139
171
  `--add-users`.
140
172
 
141
- ## The agents
173
+ ## The AI items
142
174
 
143
- | Agent | Use it to |
144
- | --- | --- |
145
- | `craft-cms-site-builder` | Build, update, maintain or remove a Craft CMS site with the commands above, in containers only and on the Solo edition only |
146
- | `craft-cms-tester` | Set the testing stack up, look at the site in the Playwright MCP browser first, write scenarios from the pack's steps and run them; it never creates an account in a suite and never writes a platform name into a step phrase |
175
+ `ai/` in the package holds one folder per kind, the manifest's `ai` block names each item, and
176
+ `--install` places it in the workspace folder of that kind.
147
177
 
148
- After `--install` they are in the AI Agents folder of the dashboard; **Install** there puts one into
149
- `~/.claude/agents`, or from the command line:
178
+ | Kind | Item | Use it to |
179
+ | --- | --- | --- |
180
+ | Agent | `craft-cms-site-builder` | Build, update, maintain or remove a Craft CMS site with the commands above, in containers only and on the Solo edition only |
181
+ | Agent | `craft-cms-tester` | Set the testing stack up, look at the site in the Playwright MCP browser first, write scenarios from the pack's steps and run them; it never creates an account in a suite and never writes a platform name into a step phrase |
182
+ | Skill | `craft-cms-scenarios` | Write a scenario from phrases that exist: the pack's steps for the control panel session, its navigation and its settings pages, the one handle of the users registry, the traps found on a real site (no content model on a fresh site, one account), and three features that pass on a fresh site |
183
+ | Command | `/craft-cms-test <site> [feature or @tag]` | Run the suite of a site from inside a session: set up when missing, match every step, run, report what failed and why |
184
+ | Prompt | `craft-cms-build-and-test` | Start a session that builds a site on the free Solo edition, says what it is, sets the testing stack up and runs the first feature |
185
+
186
+ After `--install` each is in its folder on the dashboard. **Install** there puts an agent, a skill
187
+ or a command into Claude Code (`~/.claude/agents`, `~/.claude/skills`, `~/.claude/commands`), or
188
+ from the command line:
150
189
 
151
190
  ```bash
152
- cd ~/workspace/ai-agents
153
- bash cmd-tools-ai-items.sh craft-cms-tester --install
191
+ cd ~/workspace/ai-agents && bash cmd-tools-ai-items.sh craft-cms-tester --install
192
+ cd ~/workspace/ai-skills && bash cmd-tools-ai-items.sh craft-cms-scenarios --install
193
+ cd ~/workspace/ai-commands && bash cmd-tools-ai-items.sh craft-cms-test --install
154
194
  ```
155
195
 
196
+ A prompt is not installed: it is the whole `claude …` launch command of a new session, and the
197
+ dashboard's **New screen** form lists it as a template. By hand, fill the placeholders in and run
198
+ the command of the file from the folder it names.
199
+
200
+ The items are written for any AI CLI, with Claude Code as the default shape: the frontmatter and
201
+ the file layout are Claude Code's, the body of each item is plain Markdown that names no tool or
202
+ feature of one CLI, a command says in words what its arguments are, and the text between the
203
+ triple quotes of a prompt can be given to another AI CLI as it is.
204
+
205
+ Every step phrase the items show is checked against the definitions of the step pack and of
206
+ webship-js (`tests/fixtures/step-definitions.txt`), and every command and flag against the
207
+ plugin's own. The shape is the reference's: [`docs/plugin-items-pattern.md`](docs/plugin-items-pattern.md).
208
+
156
209
  ## Develop it
157
210
 
158
211
  ```bash
159
212
  npm install # builds dist/ (TypeScript)
160
213
  npm run lint
161
- npm test # the manifest, the commands, the agents, the functions against a scaffolded project
214
+ npm test # the manifest, the commands, the AI items, the functions against a scaffolded project
162
215
  ```
@@ -110,3 +110,11 @@ project (`stop` takes no `-y`), `bash cmd-tools-backup-<folder>.sh <name>`,
110
110
  | `this site's is not administrator` from `--add-users` | The site's one account is the workspace account, and the edition has no second: build it again with `--install --add-users` if it is to be tested with the default account. |
111
111
  | A template change does not show | The caches: `bash cmd-tools-craft-cms-cli.sh <name> --flush`. |
112
112
  | `is not a Craft CMS project` from the CLI tool | The project's `.ddev/config.yaml` does not say `type: craftcms`: it was not built by this builder. |
113
+
114
+ ## What comes with you
115
+
116
+ The Craft CMS plugin places these beside you, each in the workspace folder of its kind: the agent
117
+ `craft-cms-tester` (`ai-agents/`), the skill `craft-cms-scenarios` (`ai-skills/`), the command
118
+ `/craft-cms-test <site>` (`ai-commands/`) and the prompt `craft-cms-build-and-test` (`ai-prompts/`), which is
119
+ this agent's whole first job as a launch command: build, say what the site is, set the testing
120
+ stack up, run the first feature.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: craft-cms-tester
3
- description: Use this agent to test a Craft CMS site of the Webship Workspace with webship-js and the Craft CMS step pack (`@webship-js/craft-cms-steps`) — set the testing stack up with `cmd-tools-testing.sh`, explore the site in the Playwright MCP browser first, write Gherkin scenarios from the pack's own steps, run them in the project's container and read the report. The site is the free Solo edition with one account, the admin: it logs in by the handle `admin` of the users registry, never creates an account in a suite, and never writes a platform name into a step phrase. Invoke for "test this Craft CMS site", "write scenarios for the entries", "why does this scenario fail", or "run the suite on <site>". For building or changing the site itself, hand over to `craft-cms-site-builder`.
3
+ description: Use this agent to test a Craft CMS site of the Webship Workspace with webship-js and the Craft CMS step pack (`@webship-js/craft-cms-steps`) — set the testing stack up with `cmd-tools-testing.sh`, explore the site in the Playwright MCP browser first, write Gherkin scenarios from the pack's own steps, run them in the project's container and read the report. The site is the free Solo edition with one account, the admin — it logs in by the handle `admin` of the users registry, never creates an account in a suite, and never writes a platform name into a step phrase. Invoke for "test this Craft CMS site", "write scenarios for the entries", "why does this scenario fail", or "run the suite on <site>". For building or changing the site itself, hand over to `craft-cms-site-builder`.
4
4
  model: fable
5
5
  tools:
6
6
  - Bash
@@ -20,8 +20,8 @@ tools:
20
20
 
21
21
  # craft-cms-tester
22
22
 
23
- You test Craft CMS sites in a Webship Workspace (`~/workspace`) with
24
- [webship-js](https://github.com/webship/webship-js) (Playwright and Cucumber) and its Craft CMS step
23
+ You test Craft CMS sites in a Webship Workspace (`~/workspace`), a container-based workspace (DDEV
24
+ by default), with [webship-js](https://github.com/webship/webship-js) (Playwright and Cucumber) and its Craft CMS step
25
25
  pack, [`@webship-js/craft-cms-steps`](https://github.com/webship/craft-cms-steps). The suite lives in
26
26
  the project (`cucumber.js`, `tests/features/`, `tests/step-definitions/`) and runs in the project's
27
27
  container.
@@ -127,3 +127,13 @@ Feature: The admin reaches the settings
127
127
 
128
128
  Check every phrase against the installed definitions before you run it: the pack moves, and a phrase
129
129
  from memory is a guess.
130
+
131
+ ## What comes with you
132
+
133
+ The Craft CMS plugin places these beside you, each in the workspace folder of its kind:
134
+
135
+ | Item | Where | What it is for |
136
+ | --- | --- | --- |
137
+ | `craft-cms-scenarios` (skill) | `ai-skills/` | The pack's phrases by area, the traps found on a real site, and three example features that pass on a fresh site |
138
+ | `/craft-cms-test <site>` (command) | `ai-commands/` | The run itself: set up when missing, match every step, run, report |
139
+ | `craft-cms-build-and-test` (prompt) | `ai-prompts/` | A new session that builds a site and runs its first feature |
@@ -0,0 +1,90 @@
1
+ ---
2
+ description: Test a Craft CMS site of the Webship Workspace with webship-js and the Craft CMS step pack — set the testing stack up when it is missing, match every step, run the suite (or one feature, or one tag) in the site's container, and report what failed and why.
3
+ argument-hint: '<site> [tests/features/<name>.feature | @tag]'
4
+ ---
5
+
6
+ # /craft-cms-test
7
+
8
+ Test the Craft CMS site named in: `$ARGUMENTS`
9
+
10
+ `$ARGUMENTS` stands for what was typed after the command. An AI CLI that does not fill it in
11
+ reads the same from the request: the name of the site, then, if anything, one feature path or one
12
+ tag.
13
+
14
+ The first word is the site (its folder name in a sites folder of the workspace). What follows, if
15
+ anything, narrows the run: a path that starts with `tests/features/` is one feature (or one
16
+ folder of features), a word that starts with `@` is a tag expression. With nothing after the site,
17
+ the whole suite runs. With no site at all, stop and ask for one: list the candidates with
18
+ `grep -lE '^type: *"?craftcms"?' ~/workspace/*/*/.ddev/config.yaml`.
19
+
20
+ The workspace is container-based (DDEV by default) and everything below runs in the site's
21
+ container through the workspace's own command. Never run `npx cucumber-js`, `npx playwright`,
22
+ `craft`, `composer` or `npm` on the host for a site.
23
+
24
+ ## 1. Find the site
25
+
26
+ ```bash
27
+ ls -d ~/workspace/*/<site>/.ddev/config.yaml
28
+ grep -E '^type:' ~/workspace/<folder>/<site>/.ddev/config.yaml
29
+ ```
30
+
31
+ `<folder>` is the sites folder the site is in (`dev`, `test`, `sandboxes`, `demos`). If the type is
32
+ not `craftcms`, stop: this command is for a site built with `cmd-craft-cms-project.sh`. If `<folder>` has no `cmd-tools-testing.sh`, stop and say that the folder
33
+ is not a sites folder of this workspace.
34
+
35
+ ## 2. Make sure the testing stack is there
36
+
37
+ ```bash
38
+ cd ~/workspace/<folder>
39
+ grep -c "@webship-js/craft-cms-steps" <site>/cucumber.js
40
+ ```
41
+
42
+ If `cucumber.js` is missing or does not name the step pack, set the stack up (it adds what is
43
+ missing and keeps what was changed):
44
+
45
+ ```bash
46
+ bash cmd-tools-testing.sh <site>
47
+ ```
48
+
49
+ ## 3. Match every step, without a browser
50
+
51
+ ```bash
52
+ bash cmd-tools-testing.sh <site> --dry-run # the whole suite
53
+ bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<name>.feature # one feature
54
+ bash cmd-tools-testing.sh <site> --dry-run --tags "@critical" # one tag
55
+ ```
56
+
57
+ Use the form that matches what was asked. An `Undefined` or `Ambiguous` step is a finding: name
58
+ the feature, the line and the phrase, show the closest phrase the pack defines
59
+ (`grep -hE "^(Given|When|Then)\(" <site>/node_modules/@webship-js/craft-cms-steps/tests/step-definitions/*.steps.js`),
60
+ and stop before the real run.
61
+
62
+ ## 4. Run
63
+
64
+ ```bash
65
+ bash cmd-tools-testing.sh <site> --run # the whole suite
66
+ bash cmd-tools-testing.sh <site> --run --path tests/features/<name>.feature # one feature
67
+ bash cmd-tools-testing.sh <site> --run --tags "@critical" # one tag
68
+ ```
69
+
70
+ Run it once. Do not add `--retry`, do not tag a scenario `@wip` and do not change a feature to
71
+ make the run pass.
72
+
73
+ ## 5. Report
74
+
75
+ Say, in this order:
76
+
77
+ 1. The site, its address (`https://<site>.ddev.site`) and what was run (suite, feature or tag).
78
+ 2. The totals the run printed: scenarios and steps, passed and failed, and the time.
79
+ 3. For each failed scenario: the feature and line, the step that failed, the message with its
80
+ `Why` and `Hint` lines, and what it means for the site — a defect of the site, a scenario that
81
+ asserts something the site never did (an entry or a section on a site that has no content
82
+ model yet, a second account on the Solo edition), or the environment
83
+ (the site was stopped, the one account of the site is not the default account:
84
+ `bash cmd-tools-craft-cms-cli.sh <site> --add-users` says whether it is).
85
+ 4. Where the report is: `~/workspace/<folder>/<site>/tests/reports/`.
86
+
87
+ A failing suite is a result: report it as it is. Never create an account for a scenario, never
88
+ write a password into a feature file, and never write a platform name into a step phrase. For
89
+ writing or fixing scenarios, use the `craft-cms-scenarios` skill or hand over to the `craft-cms-tester`
90
+ agent; for changing the site, to `craft-cms-site-builder`.
@@ -0,0 +1,27 @@
1
+ Build a Craft CMS site in a sites folder and prove it with its first webship-js feature.
2
+
3
+ The launch command below is for Claude Code, the default; the text between the triple quotes can be given to another AI CLI as it is.
4
+
5
+ ```
6
+ claude --permission-mode bypassPermissions """
7
+ Build a Craft CMS site named <name> in this sites folder and test it with webship-js
8
+ # ~/workspace/<dev|test|sandboxes|demos> · https://<name>.ddev.site · container-based (DDEV by default)
9
+ # the builder deletes a project of the same name first: stop if <name> is a site somebody still needs
10
+ # nothing on the host: no craft, composer, npm or mysql outside the site's container
11
+ # the free Solo edition only: enter no licence, switch no edition on, sign in to no store
12
+
13
+ 1. bash cmd-craft-cms-project.sh <name> --install --add-users
14
+ (--add-users makes the one account of the site the default account the scenarios log in as;
15
+ add --version <x> for another release)
16
+ 2. bash cmd-tools-craft-cms-cli.sh <name>
17
+ tell me the version, the address, the edition, the account and the plugins it lists
18
+ 3. bash cmd-tools-testing.sh <name>
19
+ webship-js, the step pack, the users registry and tests/features/site.feature
20
+ 4. bash cmd-tools-testing.sh <name> --dry-run --path tests/features/site.feature
21
+ 5. bash cmd-tools-testing.sh <name> --run --path tests/features/site.feature
22
+
23
+ If a command fails, show the line that failed and stop. Do not retry with other flags.
24
+ When the feature is green: the address, the version, how many scenarios and steps passed.
25
+ Then ask me whether to keep the site or remove it with: bash cmd-tools-remove.sh <name>
26
+ """
27
+ ```
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: craft-cms-scenarios
3
+ description: Write and run webship-js scenarios for a Craft CMS site of the Webship Workspace with the Craft CMS step pack (`@webship-js/craft-cms-steps`) — the phrases of the pack that a fresh site of the free Solo edition answers to (the control panel session, its navigation, its settings pages, what the admin may open, the public site), the one handle of the users registry, and the workspace command that runs them in the site's container. Use when asked to "write a scenario for this Craft site", "test the control panel login", "which step is there for the control panel navigation", "add a feature for the settings pages", or when a `.feature` file of a Craft CMS project is being written or fixed.
4
+ argument-hint: '<site> [what to cover]'
5
+ ---
6
+
7
+ # craft-cms-scenarios
8
+
9
+ Scenarios for a Craft CMS site of a Webship Workspace (`~/workspace`, container-based, DDEV by
10
+ default), written from the steps of [`@webship-js/craft-cms-steps`](https://github.com/webship/craft-cms-steps)
11
+ and of [webship-js](https://github.com/webship/webship-js) itself, and run in the site's container
12
+ by the workspace's own command. It comes with the Craft CMS plugin
13
+ (`@webship.co/workspace-craft-cms`), like the builder (`cmd-craft-cms-project.sh`), the console
14
+ tool (`cmd-tools-craft-cms-cli.sh`) and the agents `craft-cms-site-builder` and
15
+ `craft-cms-tester`.
16
+
17
+ ## Where everything is
18
+
19
+ | What | Where |
20
+ | --- | --- |
21
+ | The site | `~/workspace/<folder>/<site>`, at `https://<site>.ddev.site`, the control panel at `/admin` (`<folder>` is a sites folder: `dev`, `test`, `sandboxes`, `demos`) |
22
+ | The suite's configuration | `<site>/cucumber.js`: the step definitions it loads and the users registry (`worldParameters.users`) |
23
+ | The features | `<site>/tests/features/*.feature` (`site.feature` is the first one the setup wrote) |
24
+ | The pack's steps | `<site>/node_modules/@webship-js/craft-cms-steps/tests/step-definitions/*.steps.js` |
25
+ | webship-js's steps | `<site>/node_modules/webship-js/tests/step-definitions/*.js` |
26
+ | The reports | `<site>/tests/reports/` |
27
+
28
+ ## The order of work
29
+
30
+ 1. **Make sure the testing stack is there.** From the sites folder:
31
+ ```bash
32
+ cd ~/workspace/<folder>
33
+ bash cmd-tools-testing.sh <site>
34
+ ```
35
+ It adds webship-js, the step pack, the users registry and `tests/features/site.feature`. It is
36
+ safe to run again: it adds what is missing and keeps what was changed.
37
+ 2. **Read the installed steps before writing a phrase.** They are the source of truth: the pack
38
+ moves, and a phrase from memory is a guess.
39
+ ```bash
40
+ cd ~/workspace/<folder>/<site>
41
+ grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/craft-cms-steps/tests/step-definitions/*.steps.js
42
+ ```
43
+ Every step carries a comment block with examples above it; open the file when a phrase is not
44
+ obvious.
45
+ 3. **Look at the page first** (the Playwright MCP browser, a tab of your own) when the scenario
46
+ is about a screen you have not seen. A scenario written without having seen the page asserts
47
+ what you imagine.
48
+ 4. **Write the feature** in `<site>/tests/features/`, from phrases that exist (the lists below).
49
+ 5. **Match every step without a browser**, then run the feature, then the suite:
50
+ ```bash
51
+ cd ~/workspace/<folder>
52
+ bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<name>.feature
53
+ bash cmd-tools-testing.sh <site> --run --path tests/features/<name>.feature
54
+ bash cmd-tools-testing.sh <site> --run --tags "@critical"
55
+ bash cmd-tools-testing.sh <site> --run
56
+ ```
57
+ A dry run says `Undefined` for a phrase no definition matches: fix the phrase, do not write a
58
+ step for it.
59
+
60
+ ## The account: one handle, never a password
61
+
62
+ A site built by the plugin is on the free Solo edition, which has one account, an admin, and no
63
+ user groups. The users registry has one handle for it:
64
+
65
+ | Handle | Account | Role |
66
+ | --- | --- | --- |
67
+ | `admin` | `administrator` | admin, the only account of the site |
68
+
69
+ ```gherkin
70
+ Given I am logged in to the control panel as "admin"
71
+ Then I should be logged in to the control panel as "admin"
72
+ ```
73
+
74
+ `bash cmd-tools-craft-cms-cli.sh <site> --add-users` says whether the one account of the site is
75
+ that default account; it creates none.
76
+
77
+ ## The phrases, by area
78
+
79
+ Each line is a phrase the pack defines, and each one passed on a site built with
80
+ `bash cmd-craft-cms-project.sh <site> --install --add-users` (Craft CMS 5, the Solo edition; the
81
+ names in quotes are that site's).
82
+
83
+ ### The control panel session
84
+
85
+ ```gherkin
86
+ Given I am logged in to the control panel as "admin"
87
+ When I log in to the control panel with the username "nobody" and the password "wrong-password"
88
+ When I log out of the control panel
89
+ Then I should be logged in to the control panel as "admin"
90
+ Then I should not be logged in to the control panel
91
+ Then I should see the control panel login form
92
+ Then I should see the login error "Invalid username or password."
93
+ When I ask for a password reset for "nobody@example.com"
94
+ Then I should see the password reset confirmation
95
+ ```
96
+
97
+ The wrong login above is the one place a password stands in a scenario: it is the subject, and it
98
+ is nobody's.
99
+
100
+ ### The control panel: navigation, pages, settings
101
+
102
+ ```gherkin
103
+ Then the control panel heading should be "Dashboard"
104
+ Then the control panel navigation item "Dashboard" should be selected
105
+ Then I should see "Settings" in the control panel navigation
106
+ Then I should not see "Entries" in the control panel navigation
107
+ When I click "Settings" in the control panel navigation
108
+ When I go to the control panel page "settings/sections"
109
+ Then the control panel breadcrumb should be "Settings"
110
+ Then I should be allowed to open the control panel page "utilities"
111
+ Then I should not see an error notification
112
+ ```
113
+
114
+ ### The public site
115
+
116
+ `I am an anonymous user`, `I am on the homepage`, `I go to "<path>"`,
117
+ `the page should have a title` and `the response status code should be 200` (or `404`) are
118
+ webship-js's own steps; its status codes, classes, landmarks and accessibility audits are used as
119
+ they are and never redefined for this platform.
120
+
121
+ ## Traps found on a real site
122
+
123
+ - **A fresh site has no content model.** No section, no entry type, no field, no volume: the
124
+ control panel navigation has no `Entries`, and the pack's steps for entries, indexes, the edit
125
+ form, fields and assets have nothing to work on. They are not listed above because they were
126
+ not run on a site as built. The content model is made first, in Settings, by a person; the
127
+ console does not make one unattended:
128
+ `bash cmd-tools-craft-cms-cli.sh <site> --run "sections/create --name=Notes --handle=notes --type=channel"`
129
+ answers `Entry Types cannot be blank`.
130
+ - **One account.** The Solo edition has no second account and no user group: there is no `Users`
131
+ item in the navigation, no role to be refused a page, and a scenario about permissions has
132
+ nothing to log in as. The `should not be allowed to open` form of the step needs an edition
133
+ this plugin does not build.
134
+ - **The system name is `<folder> <site>`** after a build (`dev mysite`), not the site's name
135
+ alone: `the "System Name" field should have the value "mysite"` fails.
136
+ - **A password reset answers the same for any address**: the confirmation is shown for an address
137
+ nobody has, and no account is touched.
138
+ - A page of the control panel is named by its path after `/admin/` (`"settings/sections"`,
139
+ `"myaccount"`), and the breadcrumb is the trail above the page (`Settings`), without the page
140
+ itself.
141
+
142
+ ## Rules
143
+
144
+ - **No account is created in a suite**, and on the Solo edition none can be. A second account is
145
+ asked for (it needs another edition), not made.
146
+ - **Never the workspace account in a feature.** With `--add-users` the one account of the site is
147
+ the default account, and its password is in no feature file.
148
+ - **No password in a feature file**, except where a wrong password is the subject.
149
+ - **No platform name in a step phrase**: `I am logged in to the control panel as "admin"`, never
150
+ a phrase that names the platform. The same holds for a custom step.
151
+ - **No selector when a step says it**: `the control panel heading`, `the control panel
152
+ navigation`, not their classes.
153
+ - **What a scenario creates, it removes** in the same scenario, under a title nobody else uses.
154
+ - **No licence, no paid edition, no plugin store** in a scenario: the site stays on the free Solo
155
+ edition.
156
+ - **A custom step is the last resort**: look in the pack and in webship-js first, write it in
157
+ `<site>/tests/step-definitions/` with a comment block and examples, and say it may belong in
158
+ the pack.
159
+ - **Everything runs in the container**, through `cmd-tools-testing.sh`. Never `npx cucumber-js`
160
+ or `npx playwright` on the host.
161
+ - **A failing scenario is a result.** No `@wip`, no longer timeout, no looser assertion to turn a
162
+ run green: say what the site did.
163
+
164
+ ## Examples that run
165
+
166
+ `examples/` holds three features that pass on a site built with
167
+ `bash cmd-craft-cms-project.sh <site> --install --add-users`. Copy one into the suite and run it:
168
+
169
+ ```bash
170
+ cp ~/workspace/ai-skills/craft-cms-scenarios/examples/control-panel-session.feature ~/workspace/<folder>/<site>/tests/features/
171
+ cd ~/workspace/<folder>
172
+ bash cmd-tools-testing.sh <site> --run --path tests/features/control-panel-session.feature
173
+ ```
174
+
175
+ | Feature | What it shows |
176
+ | --- | --- |
177
+ | `examples/control-panel-session.feature` | The admin logging in and out, a wrong login refused, a password reset, a visitor sent to the login form |
178
+ | `examples/control-panel-navigation.feature` | The navigation of a fresh Solo site, the settings pages with their heading and breadcrumb, the pages an admin may open |
179
+ | `examples/front-page.feature` | The front page served to a visitor, and an unknown address answered with 404 |
@@ -0,0 +1,34 @@
1
+ Feature: The control panel of a fresh site has the navigation of the Solo edition
2
+ As the owner of the site
3
+ I want the navigation, the settings and the pages an admin may open checked
4
+ So that a change of edition or of permissions is caught by the suite
5
+
6
+ Scenario: The navigation lists what a fresh Solo site has
7
+ Given I am logged in to the control panel as "admin"
8
+ Then the control panel navigation item "Dashboard" should be selected
9
+ And I should see "Settings" in the control panel navigation
10
+ And I should see "Utilities" in the control panel navigation
11
+ And I should not see "Entries" in the control panel navigation
12
+ And I should not see "Users" in the control panel navigation
13
+
14
+ Scenario: The navigation leads to the settings and the utilities
15
+ Given I am logged in to the control panel as "admin"
16
+ When I click "Settings" in the control panel navigation
17
+ Then the control panel heading should be "Settings"
18
+ And the control panel navigation item "Settings" should be selected
19
+ When I click "Utilities" in the control panel navigation
20
+ Then the control panel navigation item "Utilities" should be selected
21
+
22
+ Scenario: A settings page has its heading and its breadcrumb
23
+ Given I am logged in to the control panel as "admin"
24
+ When I go to the control panel page "settings/sections"
25
+ Then the control panel heading should be "Sections"
26
+ And the control panel breadcrumb should be "Settings"
27
+ When I go to the control panel page "settings/general"
28
+ Then the control panel heading should be "General Settings"
29
+
30
+ Scenario: The admin may open every page of an admin
31
+ Given I am logged in to the control panel as "admin"
32
+ Then I should be allowed to open the control panel page "settings"
33
+ And I should be allowed to open the control panel page "utilities"
34
+ And I should be allowed to open the control panel page "myaccount"
@@ -0,0 +1,31 @@
1
+ Feature: The control panel lets the admin in, and nobody else
2
+ As the owner of the site
3
+ I want the admin to log in and out, and a wrong login to be refused
4
+ So that a broken login is caught before anything else is tested
5
+
6
+ # The site is on the free Solo edition: one account, the admin. A scenario logs in by the
7
+ # "admin" handle of the users registry.
8
+
9
+ Scenario: The admin logs in and out
10
+ Given I am logged in to the control panel as "admin"
11
+ Then I should be logged in to the control panel as "admin"
12
+ And the control panel heading should be "Dashboard"
13
+ And I should not see an error notification
14
+ When I log out of the control panel
15
+ Then I should not be logged in to the control panel
16
+ And I should see the control panel login form
17
+
18
+ Scenario: An account nobody has is refused
19
+ When I log in to the control panel with the username "nobody" and the password "wrong-password"
20
+ Then I should see the login error "Invalid username or password."
21
+ And I should not be logged in to the control panel
22
+
23
+ Scenario: A password reset answers the same for an address nobody has
24
+ When I ask for a password reset for "nobody@example.com"
25
+ Then I should see the password reset confirmation
26
+
27
+ Scenario: A visitor is sent to the login form
28
+ Given I am an anonymous user
29
+ When I go to "/admin/settings"
30
+ Then I should see the control panel login form
31
+ And I should not be logged in to the control panel
@@ -0,0 +1,15 @@
1
+ Feature: The site answers a visitor
2
+ As a visitor
3
+ I want the front page served and an unknown address refused
4
+ So that a broken template or routing is caught by the suite
5
+
6
+ Scenario: The front page is served
7
+ Given I am an anonymous user
8
+ And I am on the homepage
9
+ Then the response status code should be 200
10
+ And the page should have a title
11
+
12
+ Scenario: An address nobody made is not found
13
+ Given I am an anonymous user
14
+ When I go to "/no-such-page-anywhere"
15
+ Then the response status code should be 404
@@ -3,8 +3,10 @@
3
3
  *
4
4
  * What the package carries is placed by the installer from the manifest: the builder and the
5
5
  * craft console tool in the sites folders, their functions and argparse under core/scripts/plugins/craft-cms/,
6
- * the agents in the AI Agents folder. The dashboard needs nothing drawn for it: the builder is in the
7
- * Build list because it is a cmd-*-project.sh, the row menus are the core's, the agents are listed
6
+ * its AI items (ai/ in this package) in the folder of their kind:
7
+ * the agents in AI Agents, the skill in AI Skills, the command in AI Commands, the prompt in AI Prompts.
8
+ * The dashboard needs nothing drawn for it: the builder is in the
9
+ * Build list because it is a cmd-*-project.sh, the row menus are the core's, the AI items are listed
8
10
  * like any other. What register() adds is what the assistant is told.
9
11
  *
10
12
  * Everything the dashboard is asked for goes through `api`; this package requires nothing from the
@@ -19,6 +21,12 @@ export declare const PROJECT_TYPE = "craftcms";
19
21
  export declare const COMMANDS: string[];
20
22
  /** The agents the installer places in the AI Agents folder. */
21
23
  export declare const AGENTS: string[];
24
+ /** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
25
+ export declare const SKILLS: string[];
26
+ /** The slash command the installer places in the AI Commands folder. */
27
+ export declare const AI_COMMANDS: string[];
28
+ /** The prompt the installer places in the AI Prompts folder: each a whole launch command for a new session. */
29
+ export declare const PROMPTS: string[];
22
30
  /** What the assistant is told about Craft CMS in this workspace. */
23
31
  export declare function assistantContext(): string;
24
32
  export declare function register(api: PluginApi): void;
package/dist/src/index.js CHANGED
@@ -4,15 +4,17 @@
4
4
  *
5
5
  * What the package carries is placed by the installer from the manifest: the builder and the
6
6
  * craft console tool in the sites folders, their functions and argparse under core/scripts/plugins/craft-cms/,
7
- * the agents in the AI Agents folder. The dashboard needs nothing drawn for it: the builder is in the
8
- * Build list because it is a cmd-*-project.sh, the row menus are the core's, the agents are listed
7
+ * its AI items (ai/ in this package) in the folder of their kind:
8
+ * the agents in AI Agents, the skill in AI Skills, the command in AI Commands, the prompt in AI Prompts.
9
+ * The dashboard needs nothing drawn for it: the builder is in the
10
+ * Build list because it is a cmd-*-project.sh, the row menus are the core's, the AI items are listed
9
11
  * like any other. What register() adds is what the assistant is told.
10
12
  *
11
13
  * Everything the dashboard is asked for goes through `api`; this package requires nothing from the
12
14
  * dashboard's own files, so it can be installed from npm and removed without a trace.
13
15
  */
14
16
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.AGENTS = exports.COMMANDS = exports.PROJECT_TYPE = exports.PLATFORM = void 0;
17
+ exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.COMMANDS = exports.PROJECT_TYPE = exports.PLATFORM = void 0;
16
18
  exports.assistantContext = assistantContext;
17
19
  exports.register = register;
18
20
  /** The plugin's name: what --activate and --install take, and the folder under core/scripts/plugins/. */
@@ -23,6 +25,12 @@ exports.PROJECT_TYPE = 'craftcms';
23
25
  exports.COMMANDS = ['cmd-craft-cms-project.sh', 'cmd-tools-craft-cms-cli.sh'];
24
26
  /** The agents the installer places in the AI Agents folder. */
25
27
  exports.AGENTS = ['craft-cms-site-builder', 'craft-cms-tester'];
28
+ /** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
29
+ exports.SKILLS = ['craft-cms-scenarios'];
30
+ /** The slash command the installer places in the AI Commands folder. */
31
+ exports.AI_COMMANDS = ['craft-cms-test'];
32
+ /** The prompt the installer places in the AI Prompts folder: each a whole launch command for a new session. */
33
+ exports.PROMPTS = ['craft-cms-build-and-test'];
26
34
  /** What the assistant is told about Craft CMS in this workspace. */
27
35
  function assistantContext() {
28
36
  return [
@@ -35,6 +43,8 @@ function assistantContext() {
35
43
  '`--update` updates Craft CMS and its plugins, `--flush` clears the caches.',
36
44
  '`bash cmd-tools-testing.sh <name>` sets up webship-js with the Craft CMS step pack; `--run` runs the suite.',
37
45
  `For Craft CMS work, hand over to the agents ${exports.AGENTS.map((a) => `\`${a}\``).join(' and ')}.`,
46
+ `The plugin also places the skill ${exports.SKILLS.map((a) => `\`${a}\``).join(', ')} (the step pack's phrases, by area) in ai-skills/,`,
47
+ `the command ${exports.AI_COMMANDS.map((a) => `\`/${a} <site>\``).join(', ')} in ai-commands/ and the prompt ${exports.PROMPTS.map((a) => `\`${a}\``).join(' and ')} in ai-prompts/.`,
38
48
  'Never run php, composer, npm or mysql on the host for a project.',
39
49
  ].join(' ');
40
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAiBH,4CAaC;AAED,4BAEC;AA9BD,yGAAyG;AAC5F,QAAA,QAAQ,GAAG,WAAW,CAAC;AAEpC,2GAA2G;AAC9F,QAAA,YAAY,GAAG,UAAU,CAAC;AAEvC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAAC;AAEnF,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AAErE,oEAAoE;AACpE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,yFAAyF;QACzF,qGAAqG;QACrG,qGAAqG;QACrG,yKAAyK;QACzK,sIAAsI;QACtI,+HAA+H;QAC/H,4EAA4E;QAC5E,6GAA6G;QAC7G,+CAA+C,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;QAC7F,kEAAkE;KACnE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA0BH,4CAeC;AAED,4BAEC;AAzCD,yGAAyG;AAC5F,QAAA,QAAQ,GAAG,WAAW,CAAC;AAEpC,2GAA2G;AAC9F,QAAA,YAAY,GAAG,UAAU,CAAC;AAEvC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAAC;AAEnF,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AAErE,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAE9C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAE9C,+GAA+G;AAClG,QAAA,OAAO,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAEpD,oEAAoE;AACpE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,yFAAyF;QACzF,qGAAqG;QACrG,qGAAqG;QACrG,yKAAyK;QACzK,sIAAsI;QACtI,+HAA+H;QAC/H,4EAA4E;QAC5E,6GAA6G;QAC7G,+CAA+C,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;QAC7F,oCAAoC,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,oDAAoD;QAChI,eAAe,mBAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,mCAAmC,eAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB;QACrK,kEAAkE;KACnE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAgB,QAAQ,CAAC,GAAc;IACrC,GAAG,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,150 @@
1
+ # A plugin carries its own items
2
+
3
+ Every `@webship.co/workspace-<name>` plugin manages what belongs to it: its `cmd-*.sh` commands and
4
+ its AI items (agents, skills, commands, prompts). The package holds them, the manifest names them,
5
+ and `plugins.sh --install <name>` lists each one in the workspace folder of its kind, when that
6
+ folder is an active workspace folder. `--uninstall` takes them away again. The reference is
7
+ [`@webship.co/workspace-wordpress`](https://github.com/webship/workspace-wordpress), and this plugin
8
+ follows it; below, `<p>` is the plugin's name.
9
+
10
+ ## The layout
11
+
12
+ ```text
13
+ commands/cmd-<p>-project.sh cmd-*.sh scripts only: builders and tools, placed in workspace folders
14
+ commands/cmd-tools-<p>-cli.sh
15
+ ai/agents/<p>-<role>.md one file per agent
16
+ ai/skills/<p>-<topic>/SKILL.md one folder per skill; every file in it is placed (examples/, references/)
17
+ ai/commands/<p>-<verb>.md one file per slash command
18
+ ai/prompts/<p>-<task>.md one file per prompt
19
+ tests/items.test.ts the shape of every item, and that it names nothing that does not exist
20
+ tests/fixtures/step-definitions.txt the step definitions the items' phrases are checked against (a plugin with a step pack)
21
+ ```
22
+
23
+ `commands/` is taken by the `cmd-*.sh` scripts, so the AI items live under `ai/`, one folder per
24
+ kind, named like the manifest's `ai` keys. The installer places an item by the last part of its
25
+ path, whatever folder the package keeps it in, so a plugin that kept its agents in `agents/` moves
26
+ them with `git mv agents ai/agents` and changes two lines of its manifest.
27
+
28
+ ## The manifest
29
+
30
+ ```json
31
+ "files": ["dist/src", "ai", "commands", "docs", "features", "scripts", "testing", "README.md"],
32
+ "workspacePlugin": {
33
+ "name": "<p>",
34
+ "needs": [["dev", "test", "sandboxes", "demos"], "ai-agents", "ai-skills", "ai-commands", "ai-prompts"],
35
+ "commands": { "types": ["sites"], "workspaces": ["dev", "test", "sandboxes", "demos"],
36
+ "files": ["commands/cmd-<p>-project.sh", "commands/cmd-tools-<p>-cli.sh"] },
37
+ "ai": {
38
+ "agents": ["ai/agents/<p>-site-builder.md", "ai/agents/<p>-tester.md"],
39
+ "skills": ["ai/skills/<p>-scenarios"],
40
+ "commands": ["ai/commands/<p>-test.md"],
41
+ "prompts": ["ai/prompts/<p>-build-and-test.md"]
42
+ }
43
+ }
44
+ ```
45
+
46
+ - `ai` is in `files`, or the items are not in the published package.
47
+ - A skill is named by its folder, with no `/SKILL.md` and no trailing slash.
48
+ - `needs` names the folder of every kind the plugin ships, after the folder its commands need. A
49
+ plugin with no `cmd-*.sh` for a sites folder leaves the first entry out; a kind it does not ship
50
+ is left out of `ai` and of `needs`.
51
+
52
+ | Kind | Lands in | Claude Code reads it from |
53
+ | --- | --- | --- |
54
+ | `commands.files` | every active folder `commands.workspaces` names, else every active folder of `commands.types` | the folder itself: `bash cmd-….sh` |
55
+ | `ai.agents` | `ai-agents/<name>.md` | `~/.claude/agents`, after Install |
56
+ | `ai.skills` | `ai-skills/<name>/` | `~/.claude/skills`, after Install |
57
+ | `ai.commands` | `ai-commands/<name>.md` | `~/.claude/commands`, after Install: `/<name>` |
58
+ | `ai.prompts` | `ai-prompts/<name>.md` | nothing: the New screen form lists it as a template for a new session |
59
+
60
+ ## The shape of each kind
61
+
62
+ | Kind | Shape |
63
+ | --- | --- |
64
+ | Agent | Frontmatter `name` (the file's name), `description` (when to use it, with the phrases a person says), `model: fable`, `tools`; then what it does, the commands it runs, its rules |
65
+ | Skill | `SKILL.md` with frontmatter `name` (the folder's name) and `description` (what it does, then `Use when …`); files beside it for what is too long or is meant to be copied |
66
+ | Command | Frontmatter `description` and `argument-hint`, no `name` (the file names it); the body reads what was typed from `$ARGUMENTS` |
67
+ | Prompt | No frontmatter. One sentence that says what it is for, then a fenced block holding the whole launch command: `claude --permission-mode bypassPermissions """` … `"""`, with `<placeholders>` to fill in and a `#` line that says where it runs |
68
+
69
+ Names start with the plugin's name (`<p>-…`): an item that is already in the folder under the same
70
+ name is kept, so a name another plugin could also choose would never be placed. A command and a
71
+ prompt never share a name: both end in `~/.claude/commands`.
72
+
73
+ ## What an item may say
74
+
75
+ Nothing generic and nothing invented. An item is about what this plugin does in the workspace, and
76
+ every command, flag, path and step phrase in it exists:
77
+
78
+ - commands and flags: the plugin's own (`scripts/args/*.sh`) and the workspace's (`cmd-tools-testing.sh`
79
+ and its flags, `cmd-tools-remove.sh`, `cmd-tools-clone.sh --to`, `cmd-tools-ai-items.sh --install`);
80
+ - step phrases: the plugin's step pack and webship-js, as installed in a real project;
81
+ - the body is for any AI CLI, Claude Code being the default shape: plain Markdown ("run this
82
+ command", "read this file", "the AI assistant") that names no tool or feature of one CLI; the
83
+ frontmatter and a prompt's `claude …` launch line stay, with one line saying that the text between
84
+ the quotes can be given to another AI CLI as it is; a command keeps `$ARGUMENTS` and says in
85
+ words what the arguments are;
86
+ - the workspace is container-based (DDEV by default); no platform name in a step phrase; no
87
+ account created by a scenario; no password, no personal path, addresses at `example.com`.
88
+
89
+ Run every command an item tells its reader to run, and every scenario it shows, on a real site
90
+ before it is pushed. Two of the three example features of the reference failed on their first real
91
+ run, each on a phrase that exists and matched in a dry run.
92
+
93
+ ## The tests to copy
94
+
95
+ `tests/items.test.ts` checks, with no site and no network:
96
+
97
+ 1. the manifest: one list per kind, each item under `ai/<kind>/`, in the package, named `<p>-…`,
98
+ `ai` in `files`, the folder of each kind in `needs`, no command and prompt of the same name;
99
+ 2. the shape of each kind (the table above; the two expressions the dashboard reads a prompt with);
100
+ 3. every `cmd-*.sh` an item names is the plugin's or the workspace's, with flags that exist;
101
+ 4. every step in a `gherkin` block or a `.feature` file matches a definition in
102
+ `tests/fixtures/step-definitions.txt`, names no platform and carries no password;
103
+ 5. the words: container-based, no personal value, the README lists every item.
104
+
105
+ Refresh the fixture from a project whose testing stack is set up, whenever the pack's release
106
+ line changes (`<pack>` is the plugin's step pack):
107
+
108
+ ```bash
109
+ cd ~/workspace/<folder>/<site>
110
+ { echo "# <pack> <version> and webship-js <version>" ;
111
+ grep -hE "^(Given|When|Then)\(/" node_modules/<pack>/tests/step-definitions/*.steps.js node_modules/webship-js/tests/step-definitions/*.steps.js \
112
+ | sed -nE 's/^(Given|When|Then)\(\/(.*)\/, (\{[^}]*\}, )?(async )?function.*/\2/p' | sort -u ; } > step-definitions.txt
113
+ ```
114
+
115
+ `tests/needs.test.ts` holds the exact `needs` list, and `tests/plugin.test.ts` that every file the
116
+ manifest names ships.
117
+
118
+ ## Prove it on a fresh workspace
119
+
120
+ Never in a workspace somebody works in. `webship-workspace init <folder>` makes an empty one.
121
+
122
+ ```bash
123
+ npm pack # in the plugin: the tarball of the branch
124
+ cd <the fresh workspace>
125
+ bash core/scripts/plugins.sh --require <path>/webship.co-workspace-<p>-<version>.tgz # says what it needs
126
+ bash core/scripts/plugins.sh --activate <p> # stops: lists what is not here, changes nothing
127
+ bash core/scripts/plugins.sh --activate <p> --with-needs # adds the folders, then activates
128
+ bash core/scripts/plugins.sh --install <p> # "placed …" once per file
129
+ ls dev ai-agents ai-skills ai-commands ai-prompts # each item in its folder
130
+ bash core/scripts/plugins.sh --list # needs: … met by …
131
+ bash core/scripts/plugins.sh --uninstall <p> # "removed …" once per file
132
+ grep -c "<p>" core/config/plugins.installed.yml # 0: the record is gone
133
+ ```
134
+
135
+ Then, installed again: build one site with the builder, run each command the items name, copy the
136
+ skill's examples into the suite and run them, look at the four AI folders on the dashboard, and
137
+ remove the site with `cmd-tools-remove.sh`.
138
+
139
+ ## What was found on the way
140
+
141
+ - A phrase that matches in a dry run can still fail: a step may need another one before it
142
+ (`I should see the page title` needs `Given I am on a page`), or assert something the site does
143
+ not do as built. Only a real run tells.
144
+ - Content a failed scenario created stays on the site. Name it so it is found, and remove it
145
+ through the CLI tool before the next run (an entry in the trash is not in a list of every status).
146
+ - A folder that is not active gets nothing: the install says `skipped <n> <kind>` for it, and
147
+ places the items when the folder is added. With the folder in `needs`, `--activate` and
148
+ `--install` stop before that and offer to add it.
149
+ - An item a person edited in its folder is kept by `--install` and by `--uninstall`: the record
150
+ holds the hash of what was placed.
@@ -1,6 +1,7 @@
1
1
  Feature: The Craft CMS plugin on the dashboard
2
- Once the plugin is activated and installed, the sites folders offer the Craft CMS builder, the
3
- AI Agents folder lists the Craft CMS agents, and the Plugins page lists the plugin with its steps.
2
+ Once the plugin is activated and installed, the sites folders offer the Craft CMS builder, each
3
+ AI folder lists the items of its kind the plugin ships, and the Plugins page lists the plugin
4
+ with its steps.
4
5
 
5
6
  Scenario: The plugin is listed on the Plugins page
6
7
  Given I am on "/settings/plugins"
@@ -15,3 +16,15 @@ Feature: The Craft CMS plugin on the dashboard
15
16
  Given I am on "/ai-agents"
16
17
  Then I should see "craft-cms-site-builder"
17
18
  And I should see "craft-cms-tester"
19
+
20
+ Scenario: The AI Skills folder lists the skill the plugin ships
21
+ Given I am on "/ai-skills"
22
+ Then I should see "craft-cms-scenarios"
23
+
24
+ Scenario: The AI Commands folder lists the command the plugin ships
25
+ Given I am on "/ai-commands"
26
+ Then I should see "craft-cms-test"
27
+
28
+ Scenario: The AI Prompts folder lists the prompt the plugin ships
29
+ Given I am on "/ai-prompts"
30
+ Then I should see "craft-cms-build-and-test"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@webship.co/workspace-craft-cms",
3
- "version": "1.0.7",
4
- "description": "Craft CMS for Webship Workspace: the builder (`cmd-craft-cms-project.sh`) and the craft console tool in every sites folder, the default account of the free Solo edition, the Craft CMS step pack wired into the testing setup, and two AI agents in the AI Agents folder.",
3
+ "version": "1.0.9",
4
+ "description": "Craft CMS for Webship Workspace: the builder (`cmd-craft-cms-project.sh`) and the craft console tool in every sites folder, the default account of the free Solo edition, the Craft CMS step pack wired into the testing setup, and its AI items in their folders: two agents, a skill, a command and a prompt.",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
7
7
  "license": "ISC",
@@ -11,8 +11,9 @@
11
11
  },
12
12
  "files": [
13
13
  "dist/src",
14
- "agents",
14
+ "ai",
15
15
  "commands",
16
+ "docs",
16
17
  "features",
17
18
  "scripts",
18
19
  "testing",
@@ -27,6 +28,18 @@
27
28
  "workspacePlugin": {
28
29
  "name": "craft-cms",
29
30
  "label": "Craft CMS",
31
+ "needs": [
32
+ [
33
+ "dev",
34
+ "test",
35
+ "sandboxes",
36
+ "demos"
37
+ ],
38
+ "ai-agents",
39
+ "ai-skills",
40
+ "ai-commands",
41
+ "ai-prompts"
42
+ ],
30
43
  "commands": {
31
44
  "types": [
32
45
  "sites"
@@ -56,8 +69,17 @@
56
69
  },
57
70
  "ai": {
58
71
  "agents": [
59
- "agents/craft-cms-site-builder.md",
60
- "agents/craft-cms-tester.md"
72
+ "ai/agents/craft-cms-site-builder.md",
73
+ "ai/agents/craft-cms-tester.md"
74
+ ],
75
+ "skills": [
76
+ "ai/skills/craft-cms-scenarios"
77
+ ],
78
+ "commands": [
79
+ "ai/commands/craft-cms-test.md"
80
+ ],
81
+ "prompts": [
82
+ "ai/prompts/craft-cms-build-and-test.md"
61
83
  ]
62
84
  },
63
85
  "features": [