@webship.co/workspace-ghost 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 +208 -2
- package/ai/agents/ghost-site-builder.md +131 -0
- package/ai/agents/ghost-tester.md +144 -0
- package/ai/commands/ghost-test.md +87 -0
- package/ai/prompts/ghost-build-and-test.md +27 -0
- package/ai/skills/ghost-scenarios/SKILL.md +288 -0
- package/ai/skills/ghost-scenarios/examples/front-end.feature +32 -0
- package/ai/skills/ghost-scenarios/examples/post-lifecycle.feature +24 -0
- package/ai/skills/ghost-scenarios/examples/roles-and-screens.feature +31 -0
- package/commands/cmd-ghost-project.sh +33 -0
- package/commands/cmd-tools-ghost-cli.sh +26 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/index.js +50 -0
- package/dist/src/index.js.map +1 -0
- package/docs/plugin-items-pattern.md +145 -0
- package/features/ghost.feature +30 -0
- package/package.json +96 -4
- package/scripts/args/arg-ghost-cli.sh +25 -0
- package/scripts/args/arg-ghost.sh +21 -0
- package/scripts/functions/fun-ghost.sh +464 -0
- package/scripts/ghost-accounts.js +175 -0
- package/testing/site.feature +47 -0
|
@@ -0,0 +1,145 @@
|
|
|
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 workspace is container-based (DDEV by default); no platform name in a step phrase; no
|
|
82
|
+
account created by a scenario; no password, no personal path, addresses at `example.com`.
|
|
83
|
+
|
|
84
|
+
Run every command an item tells its reader to run, and every scenario it shows, on a real site
|
|
85
|
+
before it is pushed. Two of the three example features of the reference failed on their first real
|
|
86
|
+
run, each on a phrase that exists and matched in a dry run.
|
|
87
|
+
|
|
88
|
+
## The tests to copy
|
|
89
|
+
|
|
90
|
+
`tests/items.test.ts` checks, with no site and no network:
|
|
91
|
+
|
|
92
|
+
1. the manifest: one list per kind, each item under `ai/<kind>/`, in the package, named `<p>-…`,
|
|
93
|
+
`ai` in `files`, the folder of each kind in `needs`, no command and prompt of the same name;
|
|
94
|
+
2. the shape of each kind (the table above; the two expressions the dashboard reads a prompt with);
|
|
95
|
+
3. every `cmd-*.sh` an item names is the plugin's or the workspace's, with flags that exist;
|
|
96
|
+
4. every step in a `gherkin` block or a `.feature` file matches a definition in
|
|
97
|
+
`tests/fixtures/step-definitions.txt`, names no platform and carries no password;
|
|
98
|
+
5. the words: container-based, no personal value, the README lists every item.
|
|
99
|
+
|
|
100
|
+
Refresh the fixture from a project whose testing stack is set up, whenever the pack's release
|
|
101
|
+
line changes (`<pack>` is the plugin's step pack):
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cd ~/workspace/<folder>/<site>
|
|
105
|
+
{ echo "# <pack> <version> and webship-js <version>" ;
|
|
106
|
+
grep -hE "^(Given|When|Then)\(/" node_modules/<pack>/tests/step-definitions/*.steps.js node_modules/webship-js/tests/step-definitions/*.steps.js \
|
|
107
|
+
| sed -nE 's/^(Given|When|Then)\(\/(.*)\/, (async )?function.*/\2/p' | sort -u ; } > step-definitions.txt
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`tests/needs.test.ts` holds the exact `needs` list, and `tests/plugin.test.ts` that every file the
|
|
111
|
+
manifest names ships.
|
|
112
|
+
|
|
113
|
+
## Prove it on a fresh workspace
|
|
114
|
+
|
|
115
|
+
Never in a workspace somebody works in. `webship-workspace init <folder>` makes an empty one.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm pack # in the plugin: the tarball of the branch
|
|
119
|
+
cd <the fresh workspace>
|
|
120
|
+
bash core/scripts/plugins.sh --require <path>/webship.co-workspace-<p>-<version>.tgz # says what it needs
|
|
121
|
+
bash core/scripts/plugins.sh --activate <p> # stops: lists what is not here, changes nothing
|
|
122
|
+
bash core/scripts/plugins.sh --activate <p> --with-needs # adds the folders, then activates
|
|
123
|
+
bash core/scripts/plugins.sh --install <p> # "placed …" once per file
|
|
124
|
+
ls dev ai-agents ai-skills ai-commands ai-prompts # each item in its folder
|
|
125
|
+
bash core/scripts/plugins.sh --list # needs: … met by …
|
|
126
|
+
bash core/scripts/plugins.sh --uninstall <p> # "removed …" once per file
|
|
127
|
+
grep -c "<p>" core/config/plugins.installed.yml # 0: the record is gone
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Then, installed again: build one site with the builder, run each command the items name, copy the
|
|
131
|
+
skill's examples into the suite and run them, look at the four AI folders on the dashboard, and
|
|
132
|
+
remove the site with `cmd-tools-remove.sh`.
|
|
133
|
+
|
|
134
|
+
## What was found on the way
|
|
135
|
+
|
|
136
|
+
- A phrase that matches in a dry run can still fail: a step may need another one before it
|
|
137
|
+
(`I should see the page title` needs `Given I am on a page`), or assert something the site does
|
|
138
|
+
not do as built. Only a real run tells.
|
|
139
|
+
- Content a failed scenario created stays on the site. Name it so it is found, and remove it
|
|
140
|
+
through the CLI tool before the next run (an entry in the trash is not in a list of every status).
|
|
141
|
+
- A folder that is not active gets nothing: the install says `skipped <n> <kind>` for it, and
|
|
142
|
+
places the items when the folder is added. With the folder in `needs`, `--activate` and
|
|
143
|
+
`--install` stop before that and offer to add it.
|
|
144
|
+
- An item a person edited in its folder is kept by `--install` and by `--uninstall`: the record
|
|
145
|
+
holds the hash of what was placed.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Feature: The Ghost plugin on the dashboard
|
|
2
|
+
Once the plugin is activated and installed, the sites folders offer the Ghost 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.
|
|
5
|
+
|
|
6
|
+
Scenario: The plugin is listed on the Plugins page
|
|
7
|
+
Given I am on "/settings/plugins"
|
|
8
|
+
Then I should see "Ghost"
|
|
9
|
+
And I should see "@webship.co/workspace-ghost"
|
|
10
|
+
|
|
11
|
+
Scenario: A sites folder offers the Ghost builder
|
|
12
|
+
Given I am on "/dev"
|
|
13
|
+
Then "option[value='cmd-ghost-project.sh']" should be attached
|
|
14
|
+
|
|
15
|
+
Scenario: The AI Agents folder lists the agents the plugin ships
|
|
16
|
+
Given I am on "/ai-agents"
|
|
17
|
+
Then I should see "ghost-site-builder"
|
|
18
|
+
And I should see "ghost-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 "ghost-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 "ghost-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 "ghost-build-and-test"
|
package/package.json
CHANGED
|
@@ -1,6 +1,98 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webship.co/workspace-ghost",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "Ghost for Webship Workspace: the builder (`cmd-ghost-project.sh`) and the Ghost-CLI tool in every sites folder, the default staff accounts, the Ghost step pack wired into the testing setup, and its AI items in their folders: two agents, a skill, a command and a prompt.",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/webship/workspace-ghost.git"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/src",
|
|
14
|
+
"ai",
|
|
15
|
+
"commands",
|
|
16
|
+
"docs",
|
|
17
|
+
"features",
|
|
18
|
+
"scripts",
|
|
19
|
+
"testing",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"prepare": "npm run build",
|
|
25
|
+
"test": "npm run build && node --test dist/tests/*.test.js",
|
|
26
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
27
|
+
},
|
|
28
|
+
"workspacePlugin": {
|
|
29
|
+
"name": "ghost",
|
|
30
|
+
"label": "Ghost",
|
|
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
|
+
],
|
|
43
|
+
"commands": {
|
|
44
|
+
"types": [
|
|
45
|
+
"sites"
|
|
46
|
+
],
|
|
47
|
+
"workspaces": [
|
|
48
|
+
"dev",
|
|
49
|
+
"test",
|
|
50
|
+
"sandboxes",
|
|
51
|
+
"demos"
|
|
52
|
+
],
|
|
53
|
+
"files": [
|
|
54
|
+
"commands/cmd-ghost-project.sh",
|
|
55
|
+
"commands/cmd-tools-ghost-cli.sh"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"functions": [
|
|
60
|
+
"scripts/functions/fun-ghost.sh"
|
|
61
|
+
],
|
|
62
|
+
"args": [
|
|
63
|
+
"scripts/args/arg-ghost.sh",
|
|
64
|
+
"scripts/args/arg-ghost-cli.sh"
|
|
65
|
+
],
|
|
66
|
+
"machine": [
|
|
67
|
+
"scripts/ghost-accounts.js",
|
|
68
|
+
"testing/site.feature"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"ai": {
|
|
72
|
+
"agents": [
|
|
73
|
+
"ai/agents/ghost-site-builder.md",
|
|
74
|
+
"ai/agents/ghost-tester.md"
|
|
75
|
+
],
|
|
76
|
+
"skills": [
|
|
77
|
+
"ai/skills/ghost-scenarios"
|
|
78
|
+
],
|
|
79
|
+
"commands": [
|
|
80
|
+
"ai/commands/ghost-test.md"
|
|
81
|
+
],
|
|
82
|
+
"prompts": [
|
|
83
|
+
"ai/prompts/ghost-build-and-test.md"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"features": [
|
|
87
|
+
"features/ghost.feature"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@types/node": "^24.0.0",
|
|
92
|
+
"@webship.co/workspace-plugin-api": "^1.0.7",
|
|
93
|
+
"typescript": "^5.9.0"
|
|
94
|
+
},
|
|
95
|
+
"publishConfig": {
|
|
96
|
+
"access": "public"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
argparse "$@" <<ARGEOF || exit 1
|
|
4
|
+
parser.add_argument('PROJECT_NAME',
|
|
5
|
+
help='The Ghost project in this workspace.')
|
|
6
|
+
parser.add_argument('-r', '--run',
|
|
7
|
+
default="_none_",
|
|
8
|
+
help='A Ghost-CLI command to run in the project, without the leading ghost. Example: --run "doctor"')
|
|
9
|
+
parser.add_argument('-u', '--update',
|
|
10
|
+
action='store_true',
|
|
11
|
+
default=False,
|
|
12
|
+
help='Update Ghost to the latest release and start it again.')
|
|
13
|
+
parser.add_argument('-s', '--restart',
|
|
14
|
+
action='store_true',
|
|
15
|
+
default=False,
|
|
16
|
+
help='Start Ghost again, and wait until it answers.')
|
|
17
|
+
parser.add_argument('-a', '--add-users',
|
|
18
|
+
action='store_true',
|
|
19
|
+
default=False,
|
|
20
|
+
help='Add the default staff accounts, one per role. An account that is already there is left as it is.')
|
|
21
|
+
parser.add_argument('-c', '--cancel-users',
|
|
22
|
+
action='store_true',
|
|
23
|
+
default=False,
|
|
24
|
+
help='Delete the default staff accounts and what they wrote.')
|
|
25
|
+
ARGEOF
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
argparse "$@" <<ARGEOF || exit 1
|
|
4
|
+
parser.add_argument('PROJECT_NAME',
|
|
5
|
+
help='The name of the project: its folder, its DDEV project and its host name.')
|
|
6
|
+
parser.add_argument('-v', '--version',
|
|
7
|
+
default="${site_version}",
|
|
8
|
+
help='The Ghost release to install: latest, or a version number. Example: --version 6.77.0 [default %(default)s]')
|
|
9
|
+
parser.add_argument('-i', '--install',
|
|
10
|
+
action='store_true',
|
|
11
|
+
default=False,
|
|
12
|
+
help='Set the site up, with the workspace account as its owner.')
|
|
13
|
+
parser.add_argument('-a', '--add-users',
|
|
14
|
+
action='store_true',
|
|
15
|
+
default=False,
|
|
16
|
+
help='With --install, add the default staff accounts: one per role, the ones the test scenarios sign in as.')
|
|
17
|
+
parser.add_argument('-l', '--launch',
|
|
18
|
+
action='store_true',
|
|
19
|
+
default=False,
|
|
20
|
+
help='Open the site in a browser when it is ready.')
|
|
21
|
+
ARGEOF
|