@webship.co/workspace-typo3 1.0.7 → 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 +71 -18
- package/{agents → ai/agents}/typo3-site-builder.md +8 -0
- package/{agents → ai/agents}/typo3-tester.md +12 -2
- 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/dist/src/index.d.ts +10 -2
- package/dist/src/index.js +13 -3
- package/dist/src/index.js.map +1 -1
- package/docs/plugin-items-pattern.md +150 -0
- package/features/typo3.feature +15 -2
- package/package.json +27 -5
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
TYPO3 for the [Webship Workspace](https://github.com/webship/workspace) dashboard: a builder
|
|
4
4
|
that makes a real TYPO3 site in a container, a typo3 console tool for the sites it built, the default
|
|
5
5
|
accounts, the [TYPO3 step pack](https://github.com/webship/typo3-steps) wired into the
|
|
6
|
-
workspace's testing setup, and
|
|
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.
|
|
7
8
|
|
|
8
9
|
The workspace is container-based (DDEV by default): a TYPO3 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.
|
|
@@ -17,19 +18,46 @@ It is made from the reference platform plugin,
|
|
|
17
18
|
cd ~/workspace
|
|
18
19
|
bash core/scripts/plugins.sh --require github:webship/workspace-typo3 # npm install into the dashboard
|
|
19
20
|
bash core/scripts/plugins.sh --activate typo3 # plugins.typo3 in settings.yml
|
|
20
|
-
bash core/scripts/plugins.sh --install typo3 # commands, functions, args,
|
|
21
|
+
bash core/scripts/plugins.sh --install typo3 # commands, functions, args, AI items
|
|
21
22
|
bash core/scripts/plugins.sh --configure typo3 # nothing to configure: it has no settings file
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
The same four steps are buttons on the dashboard's **Settings → Plugins** page. `--install` is
|
|
25
|
-
idempotent. `--uninstall` removes what it placed; an
|
|
26
|
+
idempotent. `--uninstall` removes what it placed; an AI item you edited stays.
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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.
|
|
30
40
|
|
|
31
41
|
It needs a Webship Workspace 1.0.7 or later.
|
|
32
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
|
+
|
|
33
61
|
## What the package holds
|
|
34
62
|
|
|
35
63
|
| Path | What it is |
|
|
@@ -39,8 +67,12 @@ It needs a Webship Workspace 1.0.7 or later.
|
|
|
39
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`) |
|
|
40
68
|
| `scripts/args/arg-typo3.sh`, `arg-typo3-cli.sh` | Their argparse; the Build form draws the builder's flags from the first |
|
|
41
69
|
| `testing/site.feature` | The first feature a TYPO3 project gets when testing is set up |
|
|
42
|
-
| `agents/typo3-site-builder.md` | The agent that builds and maintains TYPO3 sites with these commands |
|
|
43
|
-
| `agents/typo3-tester.md` | The agent that writes and runs scenarios with the TYPO3 step pack |
|
|
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 |
|
|
44
76
|
| `src/index.ts` | `register(api)`: what the assistant is told about TYPO3 here |
|
|
45
77
|
| `features/typo3.feature` | Scenarios for the dashboard's own browser suite |
|
|
46
78
|
|
|
@@ -121,25 +153,46 @@ webship-js's own, writes the users registry (the handles above, overridable with
|
|
|
121
153
|
project has none, and makes sure the default accounts are on the site. Run it again and it adds what
|
|
122
154
|
is missing and keeps what you changed.
|
|
123
155
|
|
|
124
|
-
## The
|
|
156
|
+
## The AI items
|
|
125
157
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
| `typo3-site-builder` | Build, update, maintain or remove a TYPO3 site with the commands above, in containers only |
|
|
129
|
-
| `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 |
|
|
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.
|
|
130
160
|
|
|
131
|
-
|
|
132
|
-
|
|
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:
|
|
133
172
|
|
|
134
173
|
```bash
|
|
135
|
-
cd ~/workspace/ai-agents
|
|
136
|
-
bash cmd-tools-ai-items.sh typo3-
|
|
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
|
|
137
177
|
```
|
|
138
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
|
+
|
|
139
192
|
## Develop it
|
|
140
193
|
|
|
141
194
|
```bash
|
|
142
195
|
npm install # builds dist/ (TypeScript)
|
|
143
196
|
npm run lint
|
|
144
|
-
npm test # the manifest, the commands, the
|
|
197
|
+
npm test # the manifest, the commands, the AI items, the functions against a scaffolded project
|
|
145
198
|
```
|
|
@@ -104,3 +104,11 @@ stack, with the TYPO3 step pack).
|
|
|
104
104
|
| A page shows old content | The caches: `bash cmd-tools-typo3-cli.sh <name> --flush`. |
|
|
105
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
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.
|
|
@@ -20,8 +20,8 @@ tools:
|
|
|
20
20
|
|
|
21
21
|
# typo3-tester
|
|
22
22
|
|
|
23
|
-
You test TYPO3 sites in a Webship Workspace (`~/workspace`)
|
|
24
|
-
[webship-js](https://github.com/webship/webship-js) (Playwright and Cucumber) and its TYPO3 step
|
|
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
25
|
pack, [`@webship-js/typo3-steps`](https://github.com/webship/typo3-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.
|
|
@@ -123,3 +123,13 @@ Feature: An editor works in the page module
|
|
|
123
123
|
|
|
124
124
|
Check every phrase against the installed definitions before you run it: the pack moves, and a phrase
|
|
125
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
|
+
```
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typo3-scenarios
|
|
3
|
+
description: Write and run webship-js scenarios for a TYPO3 site of the Webship Workspace with the TYPO3 step pack (`@webship-js/typo3-steps`) — the phrases of the pack by area (the backend session and its modules, the page tree, records and content elements, the public site with its menus, breadcrumb, languages and search), the handles 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 TYPO3 site", "test the editor account", "which step is there for the page tree", "add a feature for creating a page", or when a `.feature` file of a TYPO3 project is being written or fixed.
|
|
4
|
+
argument-hint: '<site> [what to cover]'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# typo3-scenarios
|
|
8
|
+
|
|
9
|
+
Scenarios for a TYPO3 site of a Webship Workspace (`~/workspace`, container-based, DDEV by
|
|
10
|
+
default), written from the steps of [`@webship-js/typo3-steps`](https://github.com/webship/typo3-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 TYPO3 plugin (`@webship.co/workspace-typo3`),
|
|
13
|
+
like the builder (`cmd-typo3-project.sh`), the console tool (`cmd-tools-typo3-cli.sh`) and the
|
|
14
|
+
agents `typo3-site-builder` and `typo3-tester`.
|
|
15
|
+
|
|
16
|
+
## Where everything is
|
|
17
|
+
|
|
18
|
+
| What | Where |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| The site | `~/workspace/<folder>/<site>`, at `https://<site>.ddev.site`, the backend at `/typo3` (`<folder>` is a sites folder: `dev`, `test`, `sandboxes`, `demos`) |
|
|
21
|
+
| The suite's configuration | `<site>/cucumber.js`: the step definitions it loads and the users registry (`worldParameters.users`) |
|
|
22
|
+
| The features | `<site>/tests/features/*.feature` (`site.feature` is the first one the setup wrote) |
|
|
23
|
+
| The pack's steps | `<site>/node_modules/@webship-js/typo3-steps/tests/step-definitions/*.steps.js` |
|
|
24
|
+
| The pack's own features | `<site>/node_modules/@webship-js/typo3-steps/tests/features/*.feature`: written for the same Introduction package, worth reading before writing one |
|
|
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`, and
|
|
36
|
+
makes sure the default accounts are on the site. It is safe to run again: it adds what is
|
|
37
|
+
missing and keeps what was changed.
|
|
38
|
+
2. **Read the installed steps before writing a phrase.** They are the source of truth: the pack
|
|
39
|
+
moves, and a phrase from memory is a guess.
|
|
40
|
+
```bash
|
|
41
|
+
cd ~/workspace/<folder>/<site>
|
|
42
|
+
grep -hE "^(Given|When|Then)\(" node_modules/@webship-js/typo3-steps/tests/step-definitions/*.steps.js
|
|
43
|
+
```
|
|
44
|
+
Every step carries a comment block with examples above it; open the file when a phrase is not
|
|
45
|
+
obvious.
|
|
46
|
+
3. **Look at the page first** (the Playwright MCP browser, a tab of your own) when the scenario
|
|
47
|
+
is about a screen you have not seen. A scenario written without having seen the page asserts
|
|
48
|
+
what you imagine.
|
|
49
|
+
4. **Write the feature** in `<site>/tests/features/`, from phrases that exist (the lists below).
|
|
50
|
+
5. **Match every step without a browser**, then run the feature, then the suite:
|
|
51
|
+
```bash
|
|
52
|
+
cd ~/workspace/<folder>
|
|
53
|
+
bash cmd-tools-testing.sh <site> --dry-run --path tests/features/<name>.feature
|
|
54
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/<name>.feature
|
|
55
|
+
bash cmd-tools-testing.sh <site> --run --tags "@critical"
|
|
56
|
+
bash cmd-tools-testing.sh <site> --run
|
|
57
|
+
```
|
|
58
|
+
A dry run says `Undefined` for a phrase no definition matches: fix the phrase, do not write a
|
|
59
|
+
step for it.
|
|
60
|
+
|
|
61
|
+
## Accounts: a handle, never a password
|
|
62
|
+
|
|
63
|
+
A scenario logs in to the backend by a handle of the users registry. The default accounts are on
|
|
64
|
+
the site already (`bash cmd-tools-typo3-cli.sh <site> --add-users` adds them again if they were
|
|
65
|
+
removed):
|
|
66
|
+
|
|
67
|
+
| Handle | Account | Role |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `admin` | `administrator` | administrator (not a system maintainer) |
|
|
70
|
+
| `editor` | `editor` | the backend group "Advanced editors" of the Introduction package |
|
|
71
|
+
|
|
72
|
+
```gherkin
|
|
73
|
+
Given I am a logged in user with the "editor" user
|
|
74
|
+
Then I should be logged in as "editor"
|
|
75
|
+
```
|
|
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-typo3-project.sh <site> --install --add-users` (TYPO3 with the Introduction package; the
|
|
81
|
+
names in quotes are that site's). Most `should` steps also take the negative: `should not see`,
|
|
82
|
+
`should not be`.
|
|
83
|
+
|
|
84
|
+
### The backend: session and modules
|
|
85
|
+
|
|
86
|
+
```gherkin
|
|
87
|
+
Given I am a logged in user with the "editor" user
|
|
88
|
+
Given I am not logged in
|
|
89
|
+
When I log out
|
|
90
|
+
Then I should be logged in as "editor"
|
|
91
|
+
Then I should not be logged in
|
|
92
|
+
Then I should not see a login error
|
|
93
|
+
When I open the "Page" module
|
|
94
|
+
Then the "Page" module should be active
|
|
95
|
+
Then I should see the "List" module
|
|
96
|
+
Then I should not see the "Backend Users" module
|
|
97
|
+
Then the module heading should be "Create new Page"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### The page tree
|
|
101
|
+
|
|
102
|
+
```gherkin
|
|
103
|
+
Then I should see the "Congratulations" page in the page tree
|
|
104
|
+
When I search the page tree for "Rich Text"
|
|
105
|
+
When I select the "Congratulations > 404" page in the page tree
|
|
106
|
+
When I choose "New subpage" from the context menu of the "Congratulations > 404" page
|
|
107
|
+
When I choose "Enable" from the context menu of the "Congratulations > 404 > A new page" page
|
|
108
|
+
When I choose "Delete" from the context menu of the "Congratulations > 404 > A new page" page
|
|
109
|
+
Then the "Congratulations > 404 > A new page" page should be hidden in the page tree
|
|
110
|
+
Then I should not see the "Congratulations > 404 > A new page" page in the page tree
|
|
111
|
+
Given there is no "Congratulations > 404 > A new page" page
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Records and content elements
|
|
115
|
+
|
|
116
|
+
```gherkin
|
|
117
|
+
When I fill in the "Page Title" record field with "A new page"
|
|
118
|
+
When I save the record
|
|
119
|
+
When I close the record
|
|
120
|
+
Then I should see the notification "Record saved"
|
|
121
|
+
Then the "Page Title" record field should be marked as invalid
|
|
122
|
+
When I confirm the dialog
|
|
123
|
+
When I add a "Header Only" content element to the "Normal" column
|
|
124
|
+
When I fill in the "Header" record field with "A header written by a scenario"
|
|
125
|
+
Then I should see the "A header written by a scenario" content element in the page module
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### The public site
|
|
129
|
+
|
|
130
|
+
```gherkin
|
|
131
|
+
Then I should see the "Features" menu item
|
|
132
|
+
When I open the "Features" menu item
|
|
133
|
+
Then the "Features" menu item should be active
|
|
134
|
+
Then I should see the "Search" subnavigation item
|
|
135
|
+
When I open the "Search" subnavigation item
|
|
136
|
+
Then I should be viewing the "Search" page
|
|
137
|
+
Then I should see the breadcrumb
|
|
138
|
+
Then the breadcrumb should contain "Content Examples"
|
|
139
|
+
Then the "Deutsch" language should be available
|
|
140
|
+
When I switch to the "Deutsch" language
|
|
141
|
+
When I search the site for "zzzqqqxyz"
|
|
142
|
+
Then I should see no search results
|
|
143
|
+
Then I should be on the 404 page
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`I am an anonymous user`, `I am on the homepage`, `I am on "<path>"`, `I should be on "<path>"`,
|
|
147
|
+
`the page language should be "<code>"`, `I should see "<text>"` and
|
|
148
|
+
`the response status code should be 200` are webship-js's own steps; its status codes, classes,
|
|
149
|
+
landmarks and accessibility audits are used as they are and never redefined for this platform.
|
|
150
|
+
|
|
151
|
+
## Traps found on a real site
|
|
152
|
+
|
|
153
|
+
- **A page is named by its path in the page tree**, from the root: `"Congratulations > 404 > A
|
|
154
|
+
new page"`. A title alone finds only a page that is already shown.
|
|
155
|
+
- **The page tree steps need the backend and a module of the Web group.**
|
|
156
|
+
`Given there is no "<path>" page` before the login, or before `I open the "Page" module`, fails:
|
|
157
|
+
log in, open the module, then clear.
|
|
158
|
+
- **A new page is hidden**, and a logged in backend user previews hidden pages. Enable the page
|
|
159
|
+
from its context menu, and drop the session (`Given I am not logged in`) before asserting what a
|
|
160
|
+
visitor sees.
|
|
161
|
+
- **`I should be viewing the "<title>" page` reads the `h1`.** On a landing page of the
|
|
162
|
+
Introduction package the `h1` is a slogan, not the page title: after
|
|
163
|
+
`I open the "Features" menu item` assert `I should be on "/features"` and
|
|
164
|
+
`the "Features" menu item should be active`. On a content page (`"Search"`) the step works.
|
|
165
|
+
- **The start page has no breadcrumb**: `I should not see the breadcrumb` passes there.
|
|
166
|
+
- **The pages, the menu and the translations are the Introduction package's.** A site built with
|
|
167
|
+
`--bare` has a backend and no page: the public-site phrases and every page path above fail
|
|
168
|
+
there.
|
|
169
|
+
- **`admin` is an administrator and not a system maintainer**: no Extensions module and no Admin
|
|
170
|
+
Tools. A scenario about those needs another account, asked for, not made.
|
|
171
|
+
- **One phrase of the pack names the platform** (the "running" check). It breaks the rule below:
|
|
172
|
+
leave it out of a suite, and read the version with `bash cmd-tools-typo3-cli.sh <site>`.
|
|
173
|
+
- A scenario that failed after it created a page left it behind: start the scenario with
|
|
174
|
+
`Given there is no "<path>" page`, so the next run clears it.
|
|
175
|
+
|
|
176
|
+
## Rules
|
|
177
|
+
|
|
178
|
+
- **No account is created in a suite.** No `backend:user:create` in a hook, no step that adds an
|
|
179
|
+
account. A role the registry does not have is asked for, not made.
|
|
180
|
+
- **Never the workspace account.** The site's own administrator is not in the registry; `admin`
|
|
181
|
+
is the `administrator` default account.
|
|
182
|
+
- **No password in a feature file**, except where a wrong password is the subject.
|
|
183
|
+
- **No platform name in a step phrase**: `I open the "Page" module`, never a phrase that names
|
|
184
|
+
the platform. The same holds for a custom step.
|
|
185
|
+
- **No selector when a step says it**: `the "Page" module`, `the "Header" record field`, not
|
|
186
|
+
their classes.
|
|
187
|
+
- **What a scenario creates, it removes** in the same scenario, under a title nobody else uses.
|
|
188
|
+
- **A custom step is the last resort**: look in the pack and in webship-js first, write it in
|
|
189
|
+
`<site>/tests/step-definitions/` with a comment block and examples, and say it may belong in
|
|
190
|
+
the pack.
|
|
191
|
+
- **Everything runs in the container**, through `cmd-tools-testing.sh`. Never `npx cucumber-js`
|
|
192
|
+
or `npx playwright` on the host.
|
|
193
|
+
- **A failing scenario is a result.** No `@wip`, no longer timeout, no looser assertion to turn a
|
|
194
|
+
run green: say what the site did.
|
|
195
|
+
|
|
196
|
+
## Examples that run
|
|
197
|
+
|
|
198
|
+
`examples/` holds three features that pass on a site built with
|
|
199
|
+
`bash cmd-typo3-project.sh <site> --install --add-users`. Copy one into the suite and run it:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cp ~/workspace/ai-skills/typo3-scenarios/examples/modules-and-accounts.feature ~/workspace/<folder>/<site>/tests/features/
|
|
203
|
+
cd ~/workspace/<folder>
|
|
204
|
+
bash cmd-tools-testing.sh <site> --run --path tests/features/modules-and-accounts.feature
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
| Feature | What it shows |
|
|
208
|
+
| --- | --- |
|
|
209
|
+
| `examples/modules-and-accounts.feature` | The modules of the editor and of the administrator, a search of the page tree, the end of a session |
|
|
210
|
+
| `examples/page-lifecycle.feature` | A page created, enabled, given a content element, seen by a visitor and deleted; a page refused without a title |
|
|
211
|
+
| `examples/site-navigation.feature` | The main menu, the subnavigation, the breadcrumb, a translation, the 404 page and an empty search |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Feature: Each account gets the backend modules of its role
|
|
2
|
+
As the owner of the site
|
|
3
|
+
I want the administrator and the editor to log in and to see their own modules
|
|
4
|
+
So that a change of backend groups is caught by the suite
|
|
5
|
+
|
|
6
|
+
# The accounts are the default ones; a scenario logs in by a handle of the users registry.
|
|
7
|
+
|
|
8
|
+
Scenario: The editor works in the Page module and has no administration module
|
|
9
|
+
Given I am a logged in user with the "editor" user
|
|
10
|
+
Then I should be logged in as "editor"
|
|
11
|
+
When I open the "Page" module
|
|
12
|
+
Then the "Page" module should be active
|
|
13
|
+
And I should see the "Congratulations" page in the page tree
|
|
14
|
+
And I should see the "List" module
|
|
15
|
+
And I should not see the "Backend Users" module
|
|
16
|
+
And I should not see the "Log" module
|
|
17
|
+
|
|
18
|
+
Scenario: The administrator has the administration modules
|
|
19
|
+
Given I am a logged in user with the "admin" user
|
|
20
|
+
Then I should see the "Backend Users" module
|
|
21
|
+
And I should see the "Log" module
|
|
22
|
+
When I open the "List" module
|
|
23
|
+
Then the "List" module should be active
|
|
24
|
+
|
|
25
|
+
Scenario: The page tree finds a page by its title
|
|
26
|
+
Given I am a logged in user with the "editor" user
|
|
27
|
+
When I open the "Page" module
|
|
28
|
+
And I search the page tree for "Rich Text"
|
|
29
|
+
Then I should see the "Rich Text" page in the page tree
|
|
30
|
+
|
|
31
|
+
Scenario: Logging out ends the session
|
|
32
|
+
Given I am a logged in user with the "editor" user
|
|
33
|
+
When I log out
|
|
34
|
+
Then I should not be logged in
|
|
35
|
+
And I should not see a login error
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Feature: A page is made in the backend and taken away again
|
|
2
|
+
As an administrator
|
|
3
|
+
I want to create a page, give it content, show it to visitors and delete it
|
|
4
|
+
So that the suite proves the backend works and leaves the site as it found it
|
|
5
|
+
|
|
6
|
+
# A page is named by its path in the page tree. A new page is hidden until it is enabled, and a
|
|
7
|
+
# logged in backend user previews hidden pages: the visitor steps drop the session first.
|
|
8
|
+
|
|
9
|
+
Scenario: The administrator makes a page with a header, shows it and deletes it
|
|
10
|
+
Given I am a logged in user with the "admin" user
|
|
11
|
+
And I open the "Page" module
|
|
12
|
+
And there is no "Congratulations > 404 > A page written by a scenario" page
|
|
13
|
+
When I choose "New subpage" from the context menu of the "Congratulations > 404" page
|
|
14
|
+
And I fill in the "Page Title" record field with "A page written by a scenario"
|
|
15
|
+
And I save the record
|
|
16
|
+
Then I should see the notification "Record saved"
|
|
17
|
+
When I close the record
|
|
18
|
+
Then the "Congratulations > 404 > A page written by a scenario" page should be hidden in the page tree
|
|
19
|
+
When I choose "Enable" from the context menu of the "Congratulations > 404 > A page written by a scenario" page
|
|
20
|
+
Then the "Congratulations > 404 > A page written by a scenario" page should not be hidden in the page tree
|
|
21
|
+
When I select the "Congratulations > 404 > A page written by a scenario" page in the page tree
|
|
22
|
+
And I add a "Header Only" content element to the "Normal" column
|
|
23
|
+
And I fill in the "Header" record field with "A header written by a scenario"
|
|
24
|
+
And I save the record
|
|
25
|
+
And I close the record
|
|
26
|
+
Then I should see the "A header written by a scenario" content element in the page module
|
|
27
|
+
Given I am not logged in
|
|
28
|
+
And I am on "/404/a-page-written-by-a-scenario"
|
|
29
|
+
Then I should not be on the 404 page
|
|
30
|
+
And I should see "A header written by a scenario"
|
|
31
|
+
Given I am a logged in user with the "admin" user
|
|
32
|
+
And I open the "Page" module
|
|
33
|
+
When I choose "Delete" from the context menu of the "Congratulations > 404 > A page written by a scenario" page
|
|
34
|
+
And I confirm the dialog
|
|
35
|
+
Then I should not see the "Congratulations > 404 > A page written by a scenario" page in the page tree
|
|
36
|
+
|
|
37
|
+
Scenario: A page needs a title
|
|
38
|
+
Given I am a logged in user with the "admin" user
|
|
39
|
+
And I open the "Page" module
|
|
40
|
+
When I choose "New subpage" from the context menu of the "Congratulations > 404" page
|
|
41
|
+
Then the module heading should be "Create new Page"
|
|
42
|
+
When I save the record
|
|
43
|
+
Then the "Page Title" record field should be marked as invalid
|
|
44
|
+
And I should not see the notification "Record saved"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Feature: A visitor finds their way around the site
|
|
2
|
+
As a visitor
|
|
3
|
+
I want the menu, the breadcrumb, the languages and the search to work
|
|
4
|
+
So that a broken template is caught by the suite
|
|
5
|
+
|
|
6
|
+
# For a site built with the Introduction package (the builder's default; not with --bare):
|
|
7
|
+
# the pages, the menu and the translations are the package's.
|
|
8
|
+
|
|
9
|
+
Scenario: The main menu leads to a page
|
|
10
|
+
Given I am an anonymous user
|
|
11
|
+
And I am on the homepage
|
|
12
|
+
Then the response status code should be 200
|
|
13
|
+
And I should see the "Features" menu item
|
|
14
|
+
And I should not see the breadcrumb
|
|
15
|
+
When I open the "Features" menu item
|
|
16
|
+
Then I should be on "/features"
|
|
17
|
+
And the "Features" menu item should be active
|
|
18
|
+
|
|
19
|
+
Scenario: A content page has its subnavigation and its breadcrumb
|
|
20
|
+
Given I am on "/content-examples/form-elements/forms"
|
|
21
|
+
Then I should see the "Search" subnavigation item
|
|
22
|
+
And I should see the breadcrumb
|
|
23
|
+
And the breadcrumb should contain "Content Examples"
|
|
24
|
+
When I open the "Search" subnavigation item
|
|
25
|
+
Then I should be viewing the "Search" page
|
|
26
|
+
|
|
27
|
+
Scenario: A translated page offers its translations
|
|
28
|
+
Given I am on "/content-examples/and-more/any-language-any-character"
|
|
29
|
+
Then the "Deutsch" language should be available
|
|
30
|
+
When I switch to the "Deutsch" language
|
|
31
|
+
Then the page language should be "de-DE"
|
|
32
|
+
|
|
33
|
+
Scenario: An address nobody made is the 404 page
|
|
34
|
+
Given I am on "/no-such-page-anywhere"
|
|
35
|
+
Then I should be on the 404 page
|
|
36
|
+
|
|
37
|
+
Scenario: A search for a word nobody wrote finds nothing
|
|
38
|
+
Given I am on "/content-examples/form-elements/search"
|
|
39
|
+
When I search the site for "zzzqqqxyz"
|
|
40
|
+
Then I should see no search results
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
* typo3 console tool in the sites folders, their functions and argparse under core/scripts/plugins/typo3/,
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
@@ -17,6 +19,12 @@ export declare const PLATFORM = "typo3";
|
|
|
17
19
|
export declare const COMMANDS: string[];
|
|
18
20
|
/** The agents the installer places in the AI Agents folder. */
|
|
19
21
|
export declare const AGENTS: string[];
|
|
22
|
+
/** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
|
|
23
|
+
export declare const SKILLS: string[];
|
|
24
|
+
/** The slash command the installer places in the AI Commands folder. */
|
|
25
|
+
export declare const AI_COMMANDS: string[];
|
|
26
|
+
/** The prompt the installer places in the AI Prompts folder: each a whole launch command for a new session. */
|
|
27
|
+
export declare const PROMPTS: string[];
|
|
20
28
|
/** What the assistant is told about TYPO3 in this workspace. */
|
|
21
29
|
export declare function assistantContext(): string;
|
|
22
30
|
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
|
* typo3 console tool in the sites folders, their functions and argparse under core/scripts/plugins/typo3/,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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.PLATFORM = void 0;
|
|
17
|
+
exports.PROMPTS = exports.AI_COMMANDS = exports.SKILLS = exports.AGENTS = exports.COMMANDS = exports.PLATFORM = void 0;
|
|
16
18
|
exports.assistantContext = assistantContext;
|
|
17
19
|
exports.register = register;
|
|
18
20
|
/** The plugin's name, which is also the DDEV project type its functions are named after. */
|
|
@@ -21,6 +23,12 @@ exports.PLATFORM = 'typo3';
|
|
|
21
23
|
exports.COMMANDS = ['cmd-typo3-project.sh', 'cmd-tools-typo3-cli.sh'];
|
|
22
24
|
/** The agents the installer places in the AI Agents folder. */
|
|
23
25
|
exports.AGENTS = ['typo3-site-builder', 'typo3-tester'];
|
|
26
|
+
/** The skill the installer places in the AI Skills folder (a folder each, with its SKILL.md). */
|
|
27
|
+
exports.SKILLS = ['typo3-scenarios'];
|
|
28
|
+
/** The slash command the installer places in the AI Commands folder. */
|
|
29
|
+
exports.AI_COMMANDS = ['typo3-test'];
|
|
30
|
+
/** The prompt the installer places in the AI Prompts folder: each a whole launch command for a new session. */
|
|
31
|
+
exports.PROMPTS = ['typo3-build-and-test'];
|
|
24
32
|
/** What the assistant is told about TYPO3 in this workspace. */
|
|
25
33
|
function assistantContext() {
|
|
26
34
|
return [
|
|
@@ -32,6 +40,8 @@ function assistantContext() {
|
|
|
32
40
|
'`--update` updates the Composer packages, `--flush` flushes the caches, `--add-users` adds the default accounts (an administrator and an editor).',
|
|
33
41
|
'`bash cmd-tools-testing.sh <name>` sets up webship-js with the TYPO3 step pack; `--run` runs the suite.',
|
|
34
42
|
`For TYPO3 work, hand over to the agents ${exports.AGENTS.map((a) => `\`${a}\``).join(' and ')}.`,
|
|
43
|
+
`The plugin also places the skill ${exports.SKILLS.map((a) => `\`${a}\``).join(', ')} (the step pack's phrases, by area) in ai-skills/,`,
|
|
44
|
+
`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/.`,
|
|
35
45
|
'Never run php, composer, npm or mysql on the host for a project.',
|
|
36
46
|
].join(' ');
|
|
37
47
|
}
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAuBH,4CAcC;AAED,4BAEC;AArCD,4FAA4F;AAC/E,QAAA,QAAQ,GAAG,OAAO,CAAC;AAEhC,+DAA+D;AAClD,QAAA,QAAQ,GAAG,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAE3E,+DAA+D;AAClD,QAAA,MAAM,GAAG,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAC;AAE7D,iGAAiG;AACpF,QAAA,MAAM,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAE1C,wEAAwE;AAC3D,QAAA,WAAW,GAAG,CAAC,YAAY,CAAC,CAAC;AAE1C,+GAA+G;AAClG,QAAA,OAAO,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEhD,gEAAgE;AAChE,SAAgB,gBAAgB;IAC9B,OAAO;QACL,2EAA2E;QAC3E,6GAA6G;QAC7G,gIAAgI;QAChI,gGAAgG;QAChG,kIAAkI;QAClI,mJAAmJ;QACnJ,yGAAyG;QACzG,2CAA2C,cAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;QACzF,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.
|
package/features/typo3.feature
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Feature: The TYPO3 plugin on the dashboard
|
|
2
|
-
Once the plugin is activated and installed, the sites folders offer the TYPO3 builder,
|
|
3
|
-
AI
|
|
2
|
+
Once the plugin is activated and installed, the sites folders offer the TYPO3 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 TYPO3 plugin on the dashboard
|
|
|
15
16
|
Given I am on "/ai-agents"
|
|
16
17
|
Then I should see "typo3-site-builder"
|
|
17
18
|
And I should see "typo3-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 "typo3-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 "typo3-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 "typo3-build-and-test"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-typo3",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "TYPO3 for Webship Workspace: the builder (`cmd-typo3-project.sh`) and the typo3 console tool in every sites folder, the default accounts, the TYPO3 step pack wired into the testing setup, and
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "TYPO3 for Webship Workspace: the builder (`cmd-typo3-project.sh`) and the typo3 console tool in every sites folder, the default accounts, the TYPO3 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
|
-
"
|
|
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": "typo3",
|
|
29
30
|
"label": "TYPO3",
|
|
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/typo3-site-builder.md",
|
|
60
|
-
"agents/typo3-tester.md"
|
|
72
|
+
"ai/agents/typo3-site-builder.md",
|
|
73
|
+
"ai/agents/typo3-tester.md"
|
|
74
|
+
],
|
|
75
|
+
"skills": [
|
|
76
|
+
"ai/skills/typo3-scenarios"
|
|
77
|
+
],
|
|
78
|
+
"commands": [
|
|
79
|
+
"ai/commands/typo3-test.md"
|
|
80
|
+
],
|
|
81
|
+
"prompts": [
|
|
82
|
+
"ai/prompts/typo3-build-and-test.md"
|
|
61
83
|
]
|
|
62
84
|
},
|
|
63
85
|
"features": [
|