@bluealba/platform-cli 1.2.0-alpha.1 → 1.2.0-alpha.3
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/dist/index.js +299 -150
- package/package.json +1 -1
- package/skills/ba-platform/platform-add-feature-flag.skill.md +110 -0
- package/skills/ba-platform/platform-add-menu-item.skill.md +80 -0
- package/skills/ba-platform/platform-add-operation.skill.md +103 -0
- package/skills/ba-platform/platform-add-presence.skill.md +84 -0
- package/skills/ba-platform/platform-add-scheduled-job.skill.md +65 -0
- package/skills/ba-platform/platform-cli.skill.md +5 -0
- package/skills/ba-platform/platform-extend-shell.skill.md +78 -0
- package/skills/ba-platform/platform-scaffold-module.skill.md +70 -0
- package/skills/ba-platform/platform.skill.md +67 -16
- package/templates/application-monorepo-template/CLAUDE.md +36 -0
- package/templates/platform-init-template/{{platformName}}-core/CLAUDE.md +34 -0
|
@@ -1,10 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: platform
|
|
3
|
+
description: Blue Alba Platform orchestrator — routes to the correct specialized skill or answers general architecture questions. Use this skill for ANY platform-related request.
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# Blue Alba Platform — Skill Orchestrator
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
You are the entry point for all Blue Alba Platform tasks. Your first job is to **detect the project context**, then **route to the correct specialized skill** or answer directly for general knowledge questions.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
## Step 1 — Detect project context
|
|
11
|
+
|
|
12
|
+
Before doing anything else, determine what kind of directory you are in. Run these checks in order:
|
|
13
|
+
|
|
14
|
+
1. **Look for `CLAUDE.md`** in the current working directory. If it exists and mentions "Blue Alba Platform", read it for project context.
|
|
15
|
+
|
|
16
|
+
2. **Check if this is a platform workspace root.** Look for a subdirectory matching `*-core/` that contains `product.manifest.json`:
|
|
17
|
+
```
|
|
18
|
+
ls *-core/product.manifest.json
|
|
19
|
+
```
|
|
20
|
+
If found, read the manifest to learn the platform name, organization, and list of applications.
|
|
21
|
+
|
|
22
|
+
3. **Check if this is a core monorepo.** Look for `product.manifest.json` in the current directory:
|
|
23
|
+
```
|
|
24
|
+
ls product.manifest.json
|
|
25
|
+
```
|
|
26
|
+
If found, you are inside a `*-core/` directory. Read the manifest.
|
|
27
|
+
|
|
28
|
+
4. **Check if this is an application monorepo.** Look for `docker-compose.yml` at the root alongside `services/` and `ui/` directories, but no `product.manifest.json`. Also check if `*-bootstrap-service/` exists under `services/`.
|
|
29
|
+
|
|
30
|
+
5. **Check parent directories.** If none of the above matched, check one level up (`../`) for a `*-core/product.manifest.json` — you might be inside an application directory within a workspace.
|
|
31
|
+
|
|
32
|
+
Once you identify the context, briefly tell the user what you detected (e.g., "I detected this is the workspace root for the Acme platform with 2 applications.") and proceed to Step 2.
|
|
33
|
+
|
|
34
|
+
If no platform context is found, tell the user and still proceed — the skill catalog and documentation are still useful.
|
|
35
|
+
|
|
36
|
+
## Step 2 — Route to the correct skill
|
|
37
|
+
|
|
38
|
+
Check if the user's request matches one of these specialized skills. If it does, invoke it using the Skill tool.
|
|
39
|
+
|
|
40
|
+
| Skill | When to use | Trigger keywords |
|
|
41
|
+
|-------|-------------|------------------|
|
|
42
|
+
| `platform-add-operation` | User wants to add an authorization operation, permission, or RBAC guard to a route, endpoint, component, or menu item | operation, permission, guard, restrict, gate, protect, RBAC, authorize |
|
|
43
|
+
| `platform-add-feature-flag` | User wants to gate a feature behind a flag (on/off toggle, gradual rollout) | feature flag, toggle, flag, rollout, canary |
|
|
44
|
+
| `platform-add-scheduled-job` | User wants to run something on a cron schedule | scheduled job, cron, recurring task, timer, schedule |
|
|
45
|
+
| `platform-add-menu-item` | User wants to add a new page, route, or navigation entry to a UI module | menu item, page, route, navigation, sidebar |
|
|
46
|
+
| `platform-extend-shell` | User wants to inject a custom component into the shell (navbar, branding, user section) | shell extension, navbar, branding, header, inject into shell |
|
|
47
|
+
| `platform-add-presence` | User wants to show real-time presence (who is viewing) using the Rooms API | presence, rooms, live avatars, who is online, real-time awareness |
|
|
48
|
+
| `platform-scaffold-module` | User wants to create a new UI module or service module from scratch | scaffold, create module, new service, new UI module, generate |
|
|
49
|
+
| `platform-cli` | User asks about CLI commands, usage, installation, or headless mode | CLI, platform command, terminal, headless, interactive mode |
|
|
50
|
+
|
|
51
|
+
### Routing rules
|
|
52
|
+
|
|
53
|
+
1. **Be specific** — always prefer a specialized skill over answering yourself. If the request involves *doing* something (adding, creating, configuring), there is almost certainly a matching skill above.
|
|
54
|
+
2. **Compound requests** — if the user asks for multiple things (e.g., "add a page and restrict it to admins"), route to each skill sequentially: first `platform-add-menu-item`, then `platform-add-operation`.
|
|
55
|
+
3. **When in doubt** — if the request is close to a skill but not exact, route to the skill anyway. The specialized skill has deeper instructions and will handle edge cases better.
|
|
56
|
+
4. **Only answer directly** when the user is asking a pure knowledge question (e.g., "how does multi-tenancy work?", "explain the gateway architecture", "what auth strategies are supported?").
|
|
57
|
+
|
|
58
|
+
## General Knowledge (for direct answers only)
|
|
59
|
+
|
|
60
|
+
When answering general architecture or concepts questions, read the relevant documentation:
|
|
8
61
|
|
|
9
62
|
- `{{docsPath}}/getting-started/overview.mdx` — Platform overview and core concepts
|
|
10
63
|
- `{{docsPath}}/getting-started/core-concepts.mdx` — Core concepts explained in depth
|
|
@@ -17,19 +70,17 @@ Read these files for comprehensive platform knowledge:
|
|
|
17
70
|
- `{{docsPath}}/architecture/shell.mdx` — Shell UI architecture and extension points
|
|
18
71
|
- `{{docsPath}}/architecture/scheduler.mdx` — Job scheduling system
|
|
19
72
|
- `{{docsPath}}/development/workflow.mdx` — Development workflow, git branching, changesets, testing
|
|
20
|
-
- `{{docsPath}}/
|
|
73
|
+
- `{{docsPath}}/guides/using-feature-flags.mdx` — Feature flags system
|
|
74
|
+
- `{{docsPath}}/guides/working-with-rooms.mdx` — Real-time presence with Rooms API
|
|
75
|
+
- `{{docsPath}}/architecture/ui-extension-points.mdx` — Shell extension point mechanism
|
|
76
|
+
- `{{docsPath}}/platform-cli/overview.mdx` — Platform CLI tool overview
|
|
21
77
|
- `{{docsPath}}/platform-cli/commands.mdx` — All CLI commands reference
|
|
22
78
|
|
|
23
|
-
## When to Use This Knowledge
|
|
24
|
-
|
|
25
|
-
- When the user asks about the platform's architecture, services, or conventions
|
|
26
|
-
- When explaining how the gateway, microservices, or UI applications work
|
|
27
|
-
- When guiding development decisions that must align with platform patterns
|
|
28
|
-
- When reviewing code against platform conventions
|
|
29
|
-
|
|
30
79
|
## Instructions
|
|
31
80
|
|
|
32
|
-
1. Always
|
|
33
|
-
2.
|
|
34
|
-
3.
|
|
35
|
-
4. When
|
|
81
|
+
1. **Always run Step 1 (context detection) first** — even if the user's request seems simple
|
|
82
|
+
2. **Always check the skill catalog (Step 2)** before answering any platform-related request
|
|
83
|
+
3. If a specialized skill matches, invoke it — do not attempt to answer from the documentation references above
|
|
84
|
+
4. When routing to a specialized skill, pass along the project context you detected (platform name, org, directory paths) so the skill can use it
|
|
85
|
+
5. For general knowledge questions, read the relevant docs before answering
|
|
86
|
+
6. Reference specific sections from the docs when explaining concepts
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# {{platformName}}-{{applicationName}} — Application
|
|
2
|
+
|
|
3
|
+
This is an **application monorepo** for `{{applicationName}}` (`@{{organizationName}}`), built on the Blue Alba Platform.
|
|
4
|
+
|
|
5
|
+
For any platform-related task, use the `/platform` skill — it routes to the correct specialized skill automatically.
|
|
6
|
+
|
|
7
|
+
## Project Structure
|
|
8
|
+
|
|
9
|
+
- `services/` — Backend NestJS services
|
|
10
|
+
- `{{platformName}}-{{applicationName}}-bootstrap-service/` — App bootstrap service (registers this app's modules, operations, and menus with the gateway)
|
|
11
|
+
- Additional service modules may exist here
|
|
12
|
+
- `ui/` — React micro-frontend modules (single-spa)
|
|
13
|
+
- `docker-compose.yml` — Docker Compose for this application's services (at repo root)
|
|
14
|
+
|
|
15
|
+
## Docker Compose
|
|
16
|
+
|
|
17
|
+
The `docker-compose.yml` at the repo root defines this application's containers. It references environment variables (`PAE_GATEWAY_URL`, `PAE_GATEWAY_SERVICE_ACCESS_SECRET`) from the core monorepo's `local/.env`.
|
|
18
|
+
|
|
19
|
+
To run this app in isolation: `platform standalone`
|
|
20
|
+
|
|
21
|
+
## Common Commands
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install # Install dependencies
|
|
25
|
+
npm run dev # Start all services in dev mode
|
|
26
|
+
npm run build # Build all packages
|
|
27
|
+
npm run test # Run all tests
|
|
28
|
+
npm run changeset # Create a changeset before merging PRs
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Conventions
|
|
32
|
+
|
|
33
|
+
- Monorepo managed with Turborepo and npm workspaces
|
|
34
|
+
- NestJS services use `@bluealba/pae-service-nestjs-sdk`
|
|
35
|
+
- UI modules use `@bluealba/pae-ui-react-sdk` (webpack, single-spa)
|
|
36
|
+
- Tests: `*.spec.ts` for unit, `*.test.ts` for integration
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# {{platformTitle}} Platform — Core
|
|
2
|
+
|
|
3
|
+
This is the **core monorepo** for the `{{platformDisplayName}}` platform (`@{{organizationName}}`), built on the Blue Alba Platform.
|
|
4
|
+
|
|
5
|
+
For any platform-related task, use the `/platform` skill — it routes to the correct specialized skill automatically.
|
|
6
|
+
|
|
7
|
+
## Project Structure
|
|
8
|
+
|
|
9
|
+
- `services/` — Backend NestJS services
|
|
10
|
+
- `{{bootstrapServiceName}}/` — Core bootstrap service (registers modules, operations, and menus with the gateway)
|
|
11
|
+
- `ui/` — React micro-frontend modules (single-spa)
|
|
12
|
+
- `{{customizationUiName}}/` — Platform customization UI
|
|
13
|
+
- `local/` — Local development environment
|
|
14
|
+
- `.env` — Environment variables (secrets, DB credentials, gateway URLs)
|
|
15
|
+
- `platform-docker-compose.yml` — Platform infrastructure (nginx, postgres, gateway, shell-ui, admin-ui)
|
|
16
|
+
- `{{platformName}}-core-docker-compose.yml` — Core application services
|
|
17
|
+
- `ssl/` — Self-signed SSL certificates for local HTTPS
|
|
18
|
+
|
|
19
|
+
## Common Commands
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install # Install dependencies
|
|
23
|
+
npm run dev # Start all services in dev mode
|
|
24
|
+
npm run build # Build all packages
|
|
25
|
+
npm run test # Run all tests
|
|
26
|
+
npm run changeset # Create a changeset before merging PRs
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Conventions
|
|
30
|
+
|
|
31
|
+
- Monorepo managed with Turborepo and npm workspaces
|
|
32
|
+
- NestJS services use `@bluealba/pae-service-nestjs-sdk`
|
|
33
|
+
- UI modules use `@bluealba/pae-ui-react-sdk` (webpack, single-spa)
|
|
34
|
+
- Tests: `*.spec.ts` for unit, `*.test.ts` for integration
|