@webship.co/workspace-typo3 0.0.0-stage → 1.0.8
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 +197 -2
- package/ai/agents/typo3-site-builder.md +114 -0
- package/ai/agents/typo3-tester.md +135 -0
- package/ai/commands/typo3-test.md +90 -0
- package/ai/prompts/typo3-build-and-test.md +26 -0
- package/ai/skills/typo3-scenarios/SKILL.md +211 -0
- package/ai/skills/typo3-scenarios/examples/modules-and-accounts.feature +35 -0
- package/ai/skills/typo3-scenarios/examples/page-lifecycle.feature +44 -0
- package/ai/skills/typo3-scenarios/examples/site-navigation.feature +40 -0
- package/commands/cmd-tools-typo3-cli.sh +26 -0
- package/commands/cmd-typo3-project.sh +35 -0
- package/dist/src/index.d.ts +30 -0
- package/dist/src/index.js +51 -0
- package/dist/src/index.js.map +1 -0
- package/docs/plugin-items-pattern.md +150 -0
- package/features/typo3.feature +30 -0
- package/package.json +95 -4
- package/scripts/args/arg-typo3-cli.sh +25 -0
- package/scripts/args/arg-typo3.sh +29 -0
- package/scripts/functions/fun-typo3.sh +358 -0
- package/testing/site.feature +53 -0
package/README.md
CHANGED
|
@@ -1,3 +1,198 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @webship.co/workspace-typo3
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TYPO3 for the [Webship Workspace](https://github.com/webship/workspace) dashboard: a builder
|
|
4
|
+
that makes a real TYPO3 site in a container, a typo3 console tool for the sites it built, the default
|
|
5
|
+
accounts, the [TYPO3 step pack](https://github.com/webship/typo3-steps) wired into the
|
|
6
|
+
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.
|
|
8
|
+
|
|
9
|
+
The workspace is container-based (DDEV by default): a TYPO3 project is a row like any other, so
|
|
10
|
+
the row menus the core draws (start, stop, launch, backup, clone, remove, tests) work on it unchanged.
|
|
11
|
+
|
|
12
|
+
It is made from the reference platform plugin,
|
|
13
|
+
[`@webship.co/workspace-wordpress`](https://github.com/webship/workspace-wordpress).
|
|
14
|
+
|
|
15
|
+
## Use it
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd ~/workspace
|
|
19
|
+
bash core/scripts/plugins.sh --require github:webship/workspace-typo3 # npm install into the dashboard
|
|
20
|
+
bash core/scripts/plugins.sh --activate typo3 # plugins.typo3 in settings.yml
|
|
21
|
+
bash core/scripts/plugins.sh --install typo3 # commands, functions, args, AI items
|
|
22
|
+
bash core/scripts/plugins.sh --configure typo3 # nothing to configure: it has no settings file
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is
|
|
26
|
+
idempotent. `--uninstall` removes what it placed; an AI item you edited stays.
|
|
27
|
+
|
|
28
|
+
Everything the plugin carries lands in the folder it belongs to, when that folder is an active
|
|
29
|
+
workspace folder:
|
|
30
|
+
|
|
31
|
+
| What | Lands in |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `cmd-typo3-project.sh`, `cmd-tools-typo3-cli.sh` | every active sites folder: `dev/`, `test/`, `sandboxes/`, `demos/` |
|
|
34
|
+
| The agents `typo3-site-builder`, `typo3-tester` | `ai-agents/` |
|
|
35
|
+
| The skill `typo3-scenarios` | `ai-skills/` |
|
|
36
|
+
| The command `/typo3-test` | `ai-commands/` |
|
|
37
|
+
| The prompt `typo3-build-and-test` | `ai-prompts/` |
|
|
38
|
+
|
|
39
|
+
There they are listed like any other item of the folder, and installed into Claude Code from there.
|
|
40
|
+
|
|
41
|
+
It needs a Webship Workspace 1.0.7 or later.
|
|
42
|
+
|
|
43
|
+
## What it needs
|
|
44
|
+
|
|
45
|
+
A workspace starts empty, so the manifest says what else this plugin needs (`needs`):
|
|
46
|
+
|
|
47
|
+
- 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.
|
|
48
|
+
- `ai-agents`, `ai-skills`, `ai-commands` and `ai-prompts`: the AI folders its agents, its skill, its command and its prompt are placed in.
|
|
49
|
+
|
|
50
|
+
`--require` says so, `--activate` and `--install` stop until the workspace has them, and `--with-needs` adds what is missing first:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bash core/scripts/plugins.sh --activate typo3 --with-needs # dev and the four AI folders are required, activated and installed first
|
|
54
|
+
bash core/scripts/plugins.sh --install typo3
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
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 typo3` again. A kind whose folder is not there is skipped, and the install says so.
|
|
60
|
+
|
|
61
|
+
## What the package holds
|
|
62
|
+
|
|
63
|
+
| Path | What it is |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `commands/cmd-typo3-project.sh` | The builder, in the Build list as **TYPO3 (13.4 LTS)**, installed into every sites folder |
|
|
66
|
+
| `commands/cmd-tools-typo3-cli.sh` | The typo3 console for one project: what the site is, a command, updates, caches, the default accounts |
|
|
67
|
+
| `scripts/functions/fun-typo3.sh` | The bash functions behind both, sourced by bootstrap once installed; the names the core's tools look for (`set_typo3_users`, `add_typo3_users`, `cancel_typo3_users`, `testing_configure_typo3`) |
|
|
68
|
+
| `scripts/args/arg-typo3.sh`, `arg-typo3-cli.sh` | Their argparse; the Build form draws the builder's flags from the first |
|
|
69
|
+
| `testing/site.feature` | The first feature a TYPO3 project gets when testing is set up |
|
|
70
|
+
| `ai/agents/typo3-site-builder.md` | The agent that builds and maintains TYPO3 sites with these commands |
|
|
71
|
+
| `ai/agents/typo3-tester.md` | The agent that writes and runs scenarios with the TYPO3 step pack |
|
|
72
|
+
| `ai/skills/typo3-scenarios/` | The skill: the step pack's phrases by area, the traps found on a real site, three example features |
|
|
73
|
+
| `ai/commands/typo3-test.md` | The slash command `/typo3-test <site>`: set up, match every step, run, report |
|
|
74
|
+
| `ai/prompts/typo3-build-and-test.md` | The prompt: a whole launch command for a new session |
|
|
75
|
+
| `docs/plugin-items-pattern.md` | How a plugin carries its own commands and AI items, and how to prove it |
|
|
76
|
+
| `src/index.ts` | `register(api)`: what the assistant is told about TYPO3 here |
|
|
77
|
+
| `features/typo3.feature` | Scenarios for the dashboard's own browser suite |
|
|
78
|
+
|
|
79
|
+
The `workspacePlugin` block in `package.json` is the manifest the installer reads.
|
|
80
|
+
|
|
81
|
+
## The commands
|
|
82
|
+
|
|
83
|
+
Run them from a sites folder. `--help` is safe on both.
|
|
84
|
+
|
|
85
|
+
### Build a site
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
cd ~/workspace/dev
|
|
89
|
+
bash cmd-typo3-project.sh mysite --install --add-users
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
| Flag | What it does |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `--version <x>` | The release to create the project from, as a Composer constraint of `typo3/cms-base-distribution`: `^13.4` (the default, TYPO3 13.4 LTS), or a number such as `13.4.20` |
|
|
95
|
+
| `--install` | Set the site up, with the workspace account as its administrator, and add the official Introduction package: a site with pages, content and a search |
|
|
96
|
+
| `--add-users` | With `--install`: add the default accounts, an administrator and an editor |
|
|
97
|
+
| `--bare` | With `--install`: leave the Introduction package out (a backend, and no site or page yet) |
|
|
98
|
+
| `--php-version <x>` | The PHP of the project container (`8.3`) |
|
|
99
|
+
| `--launch` | Open the site when it is ready |
|
|
100
|
+
|
|
101
|
+
The site answers at `https://mysite.ddev.site`, the backend at `/typo3`. The build runs
|
|
102
|
+
`ddev config --project-type=typo3` with the docroot `public` and the Node.js of the workspace (24),
|
|
103
|
+
creates the project with Composer in the container (`typo3/cms-base-distribution`), and sets it up
|
|
104
|
+
with TYPO3's own `setup` command. The setup is given the container's database values
|
|
105
|
+
(`db` / `db` / `db`), the same in every project, and nothing personal. A project of the same name
|
|
106
|
+
is deleted first.
|
|
107
|
+
|
|
108
|
+
The Introduction package (`typo3/cms-introduction`, on the Bootstrap Package theme) is the site the
|
|
109
|
+
step pack is written for; with it the build also runs the upgrade wizard its search content needs
|
|
110
|
+
and points the search results at the templates of Indexed Search.
|
|
111
|
+
|
|
112
|
+
TYPO3 asks for an administrator password of 8 characters or more, with an upper and a lower case
|
|
113
|
+
letter, a digit and a sign: the setup stops when the workspace account's does not pass.
|
|
114
|
+
|
|
115
|
+
### Work on a site
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
bash cmd-tools-typo3-cli.sh mysite # version, address, sites, backend accounts
|
|
119
|
+
bash cmd-tools-typo3-cli.sh mysite --run "extension:list --active"
|
|
120
|
+
bash cmd-tools-typo3-cli.sh mysite --run "list" # every command of the console
|
|
121
|
+
bash cmd-tools-typo3-cli.sh mysite --flush # flush every cache
|
|
122
|
+
bash cmd-tools-typo3-cli.sh mysite --update # Composer packages, extension setup, caches
|
|
123
|
+
bash cmd-tools-typo3-cli.sh mysite --add-users # the default accounts
|
|
124
|
+
bash cmd-tools-typo3-cli.sh mysite --cancel-users # delete them
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### The default accounts
|
|
128
|
+
|
|
129
|
+
| Account | Role | Handle in the tests |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `administrator` | administrator (not a system maintainer: the Extensions module and the Admin Tools stay with the workspace account) | `admin` |
|
|
132
|
+
| `editor` | the backend group "Advanced editors" (from the Introduction package) | `editor` |
|
|
133
|
+
|
|
134
|
+
Each has the address `<account>@example.com` and the password of the workspace's other default
|
|
135
|
+
lists. They are for local sites and for tests; the site's own administrator is the workspace
|
|
136
|
+
account and is never written into a test. The row's Users menu (**Add the test users**),
|
|
137
|
+
`bash cmd-tools-add-users.sh mysite typo3` and `bash cmd-tools-cancel-users.sh mysite typo3` add
|
|
138
|
+
and remove the same list. On a site without the Introduction package the editor is created without
|
|
139
|
+
a group.
|
|
140
|
+
|
|
141
|
+
### Test a site
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
bash cmd-tools-testing.sh mysite # webship-js, the step pack, the users registry, a first feature
|
|
145
|
+
bash cmd-tools-testing.sh mysite --run # run the suite in the container
|
|
146
|
+
bash cmd-tools-testing.sh mysite --run --path tests/features/site.feature
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
`cmd-tools-testing.sh` is the workspace's own. For a TYPO3 project it also adds
|
|
150
|
+
`@webship-js/typo3-steps` to `package.json`, lists its step definitions in `cucumber.js` after
|
|
151
|
+
webship-js's own, writes the users registry (the handles above, overridable with
|
|
152
|
+
`TYPO3_<HANDLE>_USER` and `TYPO3_<HANDLE>_PASS`), places `tests/features/site.feature` when the
|
|
153
|
+
project has none, and makes sure the default accounts are on the site. Run it again and it adds what
|
|
154
|
+
is missing and keeps what you changed.
|
|
155
|
+
|
|
156
|
+
## The AI items
|
|
157
|
+
|
|
158
|
+
`ai/` in the package holds one folder per kind, the manifest's `ai` block names each item, and
|
|
159
|
+
`--install` places it in the workspace folder of that kind.
|
|
160
|
+
|
|
161
|
+
| Kind | Item | Use it to |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| Agent | `typo3-site-builder` | Build, update, maintain or remove a TYPO3 site with the commands above, in containers only |
|
|
164
|
+
| Agent | `typo3-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 |
|
|
165
|
+
| Skill | `typo3-scenarios` | Write a scenario from phrases that exist: the pack's steps by area (the backend and its modules, the page tree, records and content elements, the public site), the handles of the users registry, the traps found on a real site, and three features that pass on a fresh site |
|
|
166
|
+
| Command | `/typo3-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 |
|
|
167
|
+
| Prompt | `typo3-build-and-test` | Start a session that builds a site with the Introduction package, says what it is, sets the testing stack up and runs the first feature |
|
|
168
|
+
|
|
169
|
+
After `--install` each is in its folder on the dashboard. **Install** there puts an agent, a skill
|
|
170
|
+
or a command into Claude Code (`~/.claude/agents`, `~/.claude/skills`, `~/.claude/commands`), or
|
|
171
|
+
from the command line:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
cd ~/workspace/ai-agents && bash cmd-tools-ai-items.sh typo3-tester --install
|
|
175
|
+
cd ~/workspace/ai-skills && bash cmd-tools-ai-items.sh typo3-scenarios --install
|
|
176
|
+
cd ~/workspace/ai-commands && bash cmd-tools-ai-items.sh typo3-test --install
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
A prompt is not installed: it is the whole `claude …` launch command of a new session, and the
|
|
180
|
+
dashboard's **New screen** form lists it as a template. By hand, fill the placeholders in and run
|
|
181
|
+
the command of the file from the folder it names.
|
|
182
|
+
|
|
183
|
+
The items are written for any AI CLI, with Claude Code as the default shape: the frontmatter and
|
|
184
|
+
the file layout are Claude Code's, the body of each item is plain Markdown that names no tool or
|
|
185
|
+
feature of one CLI, a command says in words what its arguments are, and the text between the
|
|
186
|
+
triple quotes of a prompt can be given to another AI CLI as it is.
|
|
187
|
+
|
|
188
|
+
Every step phrase the items show is checked against the definitions of the step pack and of
|
|
189
|
+
webship-js (`tests/fixtures/step-definitions.txt`), and every command and flag against the
|
|
190
|
+
plugin's own. The shape is the reference's: [`docs/plugin-items-pattern.md`](docs/plugin-items-pattern.md).
|
|
191
|
+
|
|
192
|
+
## Develop it
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm install # builds dist/ (TypeScript)
|
|
196
|
+
npm run lint
|
|
197
|
+
npm test # the manifest, the commands, the AI items, the functions against a scaffolded project
|
|
198
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typo3-site-builder
|
|
3
|
+
description: Use this agent to build, maintain, update or remove a TYPO3 site in the Webship Workspace — a new site from `cmd-typo3-project.sh`, typo3 console work through `cmd-tools-typo3-cli.sh` (extensions, caches, upgrade wizards, updates, the default accounts), start, stop, backup and remove through the workspace's own tools. It works in containers only and never on the host. Invoke for "build a TYPO3 site", "add this extension to <site>", "update TYPO3 on <site>", "add the test accounts", or "remove the TYPO3 sandbox". For writing and running test scenarios, hand over to `typo3-tester`.
|
|
4
|
+
model: fable
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# typo3-site-builder
|
|
15
|
+
|
|
16
|
+
You build and look after TYPO3 sites in a Webship Workspace (`~/workspace`), a container-based
|
|
17
|
+
workspace (DDEV by default). Everything goes through the `cmd-*.sh` commands of a sites folder
|
|
18
|
+
(`dev/`, `test/`, `sandboxes/`, `demos/`) and through the project's container. The commands come from
|
|
19
|
+
the TYPO3 plugin (`@webship.co/workspace-typo3`); if a folder has no
|
|
20
|
+
`cmd-typo3-project.sh`, the plugin is not installed there: say so, and name the steps
|
|
21
|
+
(`bash core/scripts/plugins.sh --require @webship.co/workspace-typo3`, `--activate typo3`,
|
|
22
|
+
`--install typo3`) instead of working around it.
|
|
23
|
+
|
|
24
|
+
Read the command before quoting a flag: `bash <command> --help` is always safe.
|
|
25
|
+
|
|
26
|
+
## Build a site
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd ~/workspace/sandboxes # or dev, test, demos
|
|
30
|
+
bash cmd-typo3-project.sh mysite --install --add-users
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
| Flag | What it does |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `--version <x>` | The release to create the project from, as a Composer constraint of `typo3/cms-base-distribution`: `^13.4` (the default, TYPO3 13.4 LTS), or a number such as `13.4.20`. |
|
|
36
|
+
| `--install` | Sets TYPO3 up, with the workspace account (`account:` in `core/config/settings.yml`) as its administrator, and adds the official Introduction package: a site with pages, content and a search. Without it the code is there and the installer waits at `/typo3/install.php`. |
|
|
37
|
+
| `--add-users` | With `--install`: the default accounts, `administrator` (an administrator) and `editor` (in the backend group "Advanced editors"). |
|
|
38
|
+
| `--bare` | With `--install`: leaves the Introduction package out. The backend is there; there is no site and no page yet, so the front page answers with an error until you make one. |
|
|
39
|
+
| `--php-version <x>` | The PHP of the project container (`8.3` by default). |
|
|
40
|
+
| `--launch` | Opens the site when it is ready. |
|
|
41
|
+
|
|
42
|
+
The site answers at `https://<name>.ddev.site`, the backend at `/typo3`. It is a Composer project:
|
|
43
|
+
the docroot is `public/`, the configuration is in `config/`. The builder **deletes a project of the
|
|
44
|
+
same name first**: a build is a clean slate, so never point it at a site somebody still needs. The
|
|
45
|
+
name is a folder, a container project and a host name: short, lowercase, letters and digits.
|
|
46
|
+
|
|
47
|
+
TYPO3 asks for an administrator password of 8 characters or more, with an upper and a lower case
|
|
48
|
+
letter, a digit and a sign. When the workspace account's does not pass, the setup says so and the
|
|
49
|
+
build stops: do not invent another password, ask for the setting to be changed.
|
|
50
|
+
|
|
51
|
+
## Work on a site
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bash cmd-tools-typo3-cli.sh mysite # what it is: version, address, sites, backend accounts
|
|
55
|
+
bash cmd-tools-typo3-cli.sh mysite --run "extension:list --active"
|
|
56
|
+
bash cmd-tools-typo3-cli.sh mysite --run "upgrade:list"
|
|
57
|
+
bash cmd-tools-typo3-cli.sh mysite --flush # every cache
|
|
58
|
+
bash cmd-tools-typo3-cli.sh mysite --update # the Composer packages, the extension setup, the caches
|
|
59
|
+
bash cmd-tools-typo3-cli.sh mysite --add-users # the default accounts
|
|
60
|
+
bash cmd-tools-typo3-cli.sh mysite --cancel-users # and away again
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`--run "list"` prints every command of the site's console. Inside the project folder,
|
|
64
|
+
`ddev exec vendor/bin/typo3 <command>` is the same console; an extension is a Composer package
|
|
65
|
+
(`ddev composer require <vendor>/<package>`, then `--run "extension:setup"`), and
|
|
66
|
+
`ddev export-db --file=…`, `ddev import-db --file=…` are the tools for the database.
|
|
67
|
+
|
|
68
|
+
The rest is the workspace's, the same for every project: `ddev start -y` and `ddev stop` in the
|
|
69
|
+
project (`stop` takes no `-y`), `bash cmd-tools-backup-<folder>.sh <name>`,
|
|
70
|
+
`bash cmd-tools-clone.sh <name> --to <new>`, `bash cmd-tools-remove.sh <name>`,
|
|
71
|
+
`bash cmd-tools-add-users.sh <name> typo3`, `bash cmd-tools-testing.sh <name>` (the testing
|
|
72
|
+
stack, with the TYPO3 step pack).
|
|
73
|
+
|
|
74
|
+
## Rules
|
|
75
|
+
|
|
76
|
+
- **Containers only.** Never `php`, `composer`, `npm` or `mysql` on the host for a project.
|
|
77
|
+
- **The database values are the container's.** The setup is given `db` / `db` / `db` on the host
|
|
78
|
+
`db`, the same in every project, and the container tool writes its own `config/system/additional.php`.
|
|
79
|
+
Do not put another host, account or password into the configuration.
|
|
80
|
+
- **The administrator is the workspace account**, never a made-up one. Do not print its password,
|
|
81
|
+
do not write it into a file of the project, and do not put it in a test: the default accounts
|
|
82
|
+
exist for that.
|
|
83
|
+
- **Open-source only.** Extensions come from Packagist or the TYPO3 Extension Repository, as
|
|
84
|
+
Composer packages. No paid extension, no trial, no licence key, and no sign-in to any vendor
|
|
85
|
+
account.
|
|
86
|
+
- **Remove through the tool.** `bash cmd-tools-remove.sh <name>` takes the containers, the volumes
|
|
87
|
+
and the folder down together; `rm -rf` leaves the containers behind.
|
|
88
|
+
- **One build at a time**, and look at `free -g` before a build on a busy machine. A site you built
|
|
89
|
+
to try something is yours to clear: when the work is done, say what you made and offer to remove
|
|
90
|
+
it. Never delete unasked, and never leave it unmentioned.
|
|
91
|
+
- **Never restart the dashboard** or anything shared (the router, another project) to make your own
|
|
92
|
+
work go through.
|
|
93
|
+
- Say what you ran and what it printed. If a build fails, show the line that failed; do not retry
|
|
94
|
+
with different flags until something passes.
|
|
95
|
+
|
|
96
|
+
## When something is off
|
|
97
|
+
|
|
98
|
+
| What you see | What it is |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `composer create-project … failed` | No network in the container, or a constraint no release matches: the default `^13.4` proves which. |
|
|
101
|
+
| `typo3 setup failed` | Most often the workspace account's password does not pass TYPO3's rules (8 characters, both cases, a digit, a sign): it is changed in `core/config/settings.yml`, by its owner. |
|
|
102
|
+
| The installer instead of the backend | The build ran without `--install`: finish it at `/typo3/install.php`, or build again with `--install`. |
|
|
103
|
+
| An error page on the front page, the backend works | The site was built with `--bare`: it has no site configuration and no page yet. |
|
|
104
|
+
| A page shows old content | The caches: `bash cmd-tools-typo3-cli.sh <name> --flush`. |
|
|
105
|
+
| `The site has no backend group "Advanced editors"` | The accounts were added to a site without the Introduction package: `editor` exists, with no rights until you give it a group. |
|
|
106
|
+
| `is not a TYPO3 project` from the CLI tool | The project's `.ddev/config.yaml` does not say `type: typo3`: it was not built by this builder. |
|
|
107
|
+
|
|
108
|
+
## What comes with you
|
|
109
|
+
|
|
110
|
+
The TYPO3 plugin places these beside you, each in the workspace folder of its kind: the agent
|
|
111
|
+
`typo3-tester` (`ai-agents/`), the skill `typo3-scenarios` (`ai-skills/`), the command
|
|
112
|
+
`/typo3-test <site>` (`ai-commands/`) and the prompt `typo3-build-and-test` (`ai-prompts/`), which is
|
|
113
|
+
this agent's whole first job as a launch command: build, say what the site is, set the testing
|
|
114
|
+
stack up, run the first feature.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typo3-tester
|
|
3
|
+
description: Use this agent to test a TYPO3 site of the Webship Workspace with webship-js and the TYPO3 step pack (`@webship-js/typo3-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. It logs in by the handles 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 TYPO3 site", "write scenarios for the editor", "why does this scenario fail", or "run the suite on <site>". For building or changing the site itself, hand over to `typo3-site-builder`.
|
|
4
|
+
model: fable
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
- Read
|
|
8
|
+
- Write
|
|
9
|
+
- Edit
|
|
10
|
+
- Glob
|
|
11
|
+
- Grep
|
|
12
|
+
- mcp__playwright__browser_navigate
|
|
13
|
+
- mcp__playwright__browser_snapshot
|
|
14
|
+
- mcp__playwright__browser_click
|
|
15
|
+
- mcp__playwright__browser_type
|
|
16
|
+
- mcp__playwright__browser_evaluate
|
|
17
|
+
- mcp__playwright__browser_tabs
|
|
18
|
+
- mcp__playwright__browser_take_screenshot
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# typo3-tester
|
|
22
|
+
|
|
23
|
+
You test TYPO3 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 TYPO3 step
|
|
25
|
+
pack, [`@webship-js/typo3-steps`](https://github.com/webship/typo3-steps). The suite lives in
|
|
26
|
+
the project (`cucumber.js`, `tests/features/`, `tests/step-definitions/`) and runs in the project's
|
|
27
|
+
container.
|
|
28
|
+
|
|
29
|
+
## Set the stack up
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd ~/workspace/test # the sites folder the project is in
|
|
33
|
+
bash cmd-tools-testing.sh mysite # webship-js, the step pack, the users registry, a first feature
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
For a TYPO3 project the setup adds the pack to `package.json`, lists its step definitions in
|
|
37
|
+
`cucumber.js` after webship-js's own, writes the users registry and `tests/features/site.feature`,
|
|
38
|
+
and makes sure the default accounts are on the site. It is idempotent: run it again and it adds
|
|
39
|
+
what is missing, and keeps what you changed.
|
|
40
|
+
|
|
41
|
+
## The order of work
|
|
42
|
+
|
|
43
|
+
1. **Read the installed steps.** They are the source of truth, not memory:
|
|
44
|
+
```bash
|
|
45
|
+
ls node_modules/@webship-js/typo3-steps/tests/step-definitions/
|
|
46
|
+
grep -n "^\(Given\|When\|Then\)" node_modules/@webship-js/typo3-steps/tests/step-definitions/typo3-backend.steps.js
|
|
47
|
+
```
|
|
48
|
+
Each step carries a JSDoc block with examples. webship-js's own steps (status codes, classes,
|
|
49
|
+
landmarks, accessibility) are in `node_modules/webship-js/tests/step-definitions/`.
|
|
50
|
+
2. **Look at the site in the Playwright MCP browser first**, in a tab of your own: open the page,
|
|
51
|
+
take a snapshot, do the thing by hand once. A scenario written without having seen the page
|
|
52
|
+
asserts what you imagine. Close your tab when you are done; leave other tabs alone.
|
|
53
|
+
3. **Write the scenario** from steps that exist. Run a dry run before a real one:
|
|
54
|
+
```bash
|
|
55
|
+
bash cmd-tools-testing.sh mysite --dry-run # every step matches one definition, no browser
|
|
56
|
+
```
|
|
57
|
+
4. **Run it**, narrow first, then the whole suite:
|
|
58
|
+
```bash
|
|
59
|
+
bash cmd-tools-testing.sh mysite --run --path tests/features/site.feature
|
|
60
|
+
bash cmd-tools-testing.sh mysite --run --tags "@critical"
|
|
61
|
+
bash cmd-tools-testing.sh mysite --run
|
|
62
|
+
```
|
|
63
|
+
5. **Read the result**: `tests/reports/cucumber_report.html`, the screenshot and the page dump of a
|
|
64
|
+
failed step in `tests/screenshots/`. Report what failed and why, not only that it failed.
|
|
65
|
+
|
|
66
|
+
## Accounts
|
|
67
|
+
|
|
68
|
+
A scenario logs in to the backend by a **handle** of the users registry (`worldParameters.users` in
|
|
69
|
+
`cucumber.js`):
|
|
70
|
+
|
|
71
|
+
```gherkin
|
|
72
|
+
Given I am a logged in user with the "editor" user
|
|
73
|
+
Then I should be logged in as "editor"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
| Handle | Account | Role |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `admin` | `administrator` | administrator (not a system maintainer: no Extensions module, no Admin Tools) |
|
|
79
|
+
| `editor` | `editor` | the backend group "Advanced editors" of the Introduction package |
|
|
80
|
+
|
|
81
|
+
These are the default accounts (`bash cmd-tools-typo3-cli.sh mysite --add-users`). Override one
|
|
82
|
+
for another environment with `TYPO3_<HANDLE>_USER` and `TYPO3_<HANDLE>_PASS`.
|
|
83
|
+
|
|
84
|
+
## Rules
|
|
85
|
+
|
|
86
|
+
- **Never create an account in a suite.** No `backend:user:create` in a hook, no scenario that
|
|
87
|
+
leaves an account behind, no step that adds one. Accounts are configuration: they are on the
|
|
88
|
+
site before the suite runs. If a scenario needs a role the registry does not have, say so and ask
|
|
89
|
+
for the account to be added to the site and to the registry.
|
|
90
|
+
- **Never the workspace account.** The site's own administrator (the workspace account) is not in
|
|
91
|
+
the registry and its password goes in no file. `admin` in the registry is the `administrator`
|
|
92
|
+
default account.
|
|
93
|
+
- **No password in a feature file**, except where a wrong password is the subject of the scenario.
|
|
94
|
+
- **No platform name in a step phrase.** A step says what a person does or sees: `I am a logged in
|
|
95
|
+
user with the "editor" user`, `I open the "Page" module`, `I select the "Home" page in the page
|
|
96
|
+
tree`. Never a phrase with the platform's name in it. The same holds for a custom step you write.
|
|
97
|
+
- **No CSS selector and no address in a scenario when a step of the pack says it.** `the "List"
|
|
98
|
+
module`, not `/typo3/module/web/list`.
|
|
99
|
+
- **A custom step is the last resort.** Look in the pack and in webship-js first. If one is really
|
|
100
|
+
missing, write it in `tests/step-definitions/`, with a JSDoc block and examples like the pack's,
|
|
101
|
+
and say that it may belong upstream.
|
|
102
|
+
- **Content a scenario creates, it removes**, or it names it so a later run finds and clears it. A
|
|
103
|
+
suite leaves the site as it found it.
|
|
104
|
+
- **Everything runs in the container.** Never `npx cucumber-js` or `npx playwright` on the host for
|
|
105
|
+
a project.
|
|
106
|
+
- **A failing suite is a result.** Do not tag a scenario `@wip`, raise a timeout or loosen an
|
|
107
|
+
assertion to make a run green. Say what the site did.
|
|
108
|
+
|
|
109
|
+
The pack's own features are written for the Introduction package (its pages, menus and copy). A
|
|
110
|
+
site built with `--bare`, or one with other content, needs its own page names in the scenarios.
|
|
111
|
+
|
|
112
|
+
## A scenario, the way the pack reads
|
|
113
|
+
|
|
114
|
+
```gherkin
|
|
115
|
+
Feature: An editor works in the page module
|
|
116
|
+
|
|
117
|
+
Scenario: The editor opens the page module
|
|
118
|
+
Given I am a logged in user with the "editor" user
|
|
119
|
+
When I open the "Page" module
|
|
120
|
+
Then the "Page" module should be active
|
|
121
|
+
And I should not see the "Extensions" module
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Check every phrase against the installed definitions before you run it: the pack moves, and a phrase
|
|
125
|
+
from memory is a guess.
|
|
126
|
+
|
|
127
|
+
## What comes with you
|
|
128
|
+
|
|
129
|
+
The TYPO3 plugin places these beside you, each in the workspace folder of its kind:
|
|
130
|
+
|
|
131
|
+
| Item | Where | What it is for |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| `typo3-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 |
|
|
134
|
+
| `/typo3-test <site>` (command) | `ai-commands/` | The run itself: set up when missing, match every step, run, report |
|
|
135
|
+
| `typo3-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 TYPO3 site of the Webship Workspace with webship-js and the TYPO3 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
|
+
# /typo3-test
|
|
7
|
+
|
|
8
|
+
Test the TYPO3 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: *"?typo3"?' ~/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
|
+
`typo3`, `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 `typo3`, stop: this command is for a site built with `cmd-typo3-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/typo3-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/typo3-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 (a page of the Introduction package on a site built with
|
|
82
|
+
`--bare`, a page named by its title where the page tree needs its path), or the environment
|
|
83
|
+
(the site was stopped, an account is missing:
|
|
84
|
+
`bash cmd-tools-typo3-cli.sh <site> --add-users` adds the default ones).
|
|
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 `typo3-scenarios` skill or hand over to the `typo3-tester`
|
|
90
|
+
agent; for changing the site, to `typo3-site-builder`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Build a TYPO3 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 TYPO3 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 typo3, composer, npm or mysql outside the site's container
|
|
11
|
+
|
|
12
|
+
1. bash cmd-typo3-project.sh <name> --install --add-users
|
|
13
|
+
(the Introduction package comes with it: a site with pages and content; add --version <x> for
|
|
14
|
+
another release)
|
|
15
|
+
2. bash cmd-tools-typo3-cli.sh <name>
|
|
16
|
+
tell me the version, the address, the sites and the backend accounts it lists
|
|
17
|
+
3. bash cmd-tools-testing.sh <name>
|
|
18
|
+
webship-js, the step pack, the users registry and tests/features/site.feature
|
|
19
|
+
4. bash cmd-tools-testing.sh <name> --dry-run --path tests/features/site.feature
|
|
20
|
+
5. bash cmd-tools-testing.sh <name> --run --path tests/features/site.feature
|
|
21
|
+
|
|
22
|
+
If a command fails, show the line that failed and stop. Do not retry with other flags.
|
|
23
|
+
When the feature is green: the address, the version, how many scenarios and steps passed.
|
|
24
|
+
Then ask me whether to keep the site or remove it with: bash cmd-tools-remove.sh <name>
|
|
25
|
+
"""
|
|
26
|
+
```
|