@jstn-sdk/ma 0.1.3 → 0.1.5
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/.codex/config.toml +2 -0
- package/.codex/hooks.json +1 -1
- package/.codex/prompts/enforcement.md +3 -3
- package/.codex/prompts/onboarding.md +14 -29
- package/README.md +129 -466
- package/bin/ma.js +103 -54
- package/docs/README.md +1 -2
- package/docs/getting-started.md +37 -402
- package/docs/mcp-setup.md +134 -3
- package/docs/onboarding.md +11 -41
- package/docs/qa/release-readiness-0.1.5.md +77 -0
- package/docs/release-spec.md +103 -74
- package/docs/skills-publishing.md +54 -187
- package/docs/skills.md +141 -78
- package/mcp/collections.json +1 -1
- package/mcp/fallback.json +1 -1
- package/mcp/servers.json +1 -1
- package/package.json +14 -16
- package/plugins/meta-architect/.app.json +1 -1
- package/plugins/meta-architect/.mcp.json +1 -1
- package/plugins/meta-architect/README.md +10 -23
- package/plugins/meta-architect/skills/meta-architect/SKILL.md +23 -17
- package/plugins/meta-architect/skills/meta-architect-arch/SKILL.md +24 -0
- package/plugins/meta-architect/skills/meta-architect-build/SKILL.md +25 -0
- package/plugins/meta-architect/skills/meta-architect-flow/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-sage/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-vet/SKILL.md +23 -0
- package/plugins/meta-architect/skills/meta-architect-vibe/SKILL.md +24 -0
- package/prompts/architect.md +216 -0
- package/prompts/builder.md +10 -0
- package/prompts/flow.md +9 -0
- package/prompts/release-manager.md +10 -0
- package/prompts/sage.md +10 -0
- package/prompts/security-reviewer.md +10 -0
- package/prompts/verifier.md +10 -0
- package/prompts/vibe.md +10 -0
- package/scripts/doctor.js +0 -8
- package/scripts/skills-install.js +36 -4
- package/scripts/skills-manifest.js +1 -1
- package/scripts/skills-validate.js +40 -78
- package/skills/index.json +22 -22
- package/skills/meta-architect/SKILL.md +23 -17
- package/skills/meta-architect/agents/openai.yaml +3 -3
- package/skills/meta-architect/references/core-release-rules.md +2 -2
- package/skills/meta-architect-arch/SKILL.md +24 -0
- package/skills/meta-architect-arch/agents/openai.yaml +4 -0
- package/skills/meta-architect-build/SKILL.md +25 -0
- package/skills/meta-architect-build/agents/openai.yaml +4 -0
- package/skills/meta-architect-flow/SKILL.md +23 -0
- package/skills/meta-architect-flow/agents/openai.yaml +4 -0
- package/skills/meta-architect-sage/SKILL.md +23 -0
- package/skills/meta-architect-sage/agents/openai.yaml +4 -0
- package/skills/meta-architect-vet/SKILL.md +23 -0
- package/skills/meta-architect-vet/agents/openai.yaml +4 -0
- package/skills/meta-architect-vibe/SKILL.md +24 -0
- package/skills/meta-architect-vibe/agents/openai.yaml +4 -0
- package/sprint/00-idea.md +1 -1
- package/sprint/01-architecture.md +1 -1
- package/sprint/02-oss-evidence.md +1 -1
- package/sprint/03-logic.md +1 -1
- package/sprint/04-security.md +2 -2
- package/sprint/05-dx-ux.md +1 -1
- package/src/decision-log.js +4 -4
- package/src/doctor.js +30 -0
- package/src/launcher.js +17 -21
- package/src/mcp-live-client.js +1 -1
- package/src/paths.js +32 -8
- package/src/release-state.js +3 -3
- package/src/setup.js +375 -0
- package/src/skills.js +166 -309
- package/templates/AGENTS.md +6 -6
- package/templates/model-instructions/core.md +1 -1
- package/.agents/plugins/marketplace.json +0 -20
- package/docs/assets/meta-architect-logo.png +0 -0
- package/docs/assets/meta-architect-logo.svg +0 -8
- package/docs/installed-sdk.md +0 -60
- package/docs/qa/release-readiness-0.1.3.md +0 -79
- package/plugins/meta-architect/.codex-plugin/plugin.json +0 -23
- package/plugins/meta-architect/skills/arch/SKILL.md +0 -27
- package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/build/SKILL.md +0 -24
- package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/flow/SKILL.md +0 -24
- package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/meta-architect/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/meta-architect/references/core-release-rules.md +0 -13
- package/plugins/meta-architect/skills/sage/SKILL.md +0 -24
- package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/vet/SKILL.md +0 -25
- package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -4
- package/plugins/meta-architect/skills/vibe/SKILL.md +0 -24
- package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -4
- package/scripts/plugin-sync.js +0 -92
- package/scripts/postinstall.js +0 -23
- package/scripts/release-metadata.js +0 -94
- package/scripts/release-sync.js +0 -348
- package/scripts/release-verify.js +0 -153
- package/scripts/setup-npmrc.js +0 -39
- package/skills/arch/SKILL.md +0 -27
- package/skills/arch/agents/openai.yaml +0 -4
- package/skills/build/SKILL.md +0 -24
- package/skills/build/agents/openai.yaml +0 -4
- package/skills/flow/SKILL.md +0 -24
- package/skills/flow/agents/openai.yaml +0 -4
- package/skills/sage/SKILL.md +0 -24
- package/skills/sage/agents/openai.yaml +0 -4
- package/skills/vet/SKILL.md +0 -25
- package/skills/vet/agents/openai.yaml +0 -4
- package/skills/vibe/SKILL.md +0 -24
- package/skills/vibe/agents/openai.yaml +0 -4
- package/src/runtime-artifacts.js +0 -363
- package/src/skill-installer.js +0 -198
package/docs/installed-sdk.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Installed Support Bundle
|
|
2
|
-
|
|
3
|
-
Meta-Architect installs two things into the active Codex home:
|
|
4
|
-
|
|
5
|
-
1. skills under `CODEX_HOME/skills/`
|
|
6
|
-
2. a support bundle under `CODEX_HOME/meta-architect-sdk/`
|
|
7
|
-
|
|
8
|
-
The support bundle exists so skills and helper paths can use relevant packaged files without guessing where they live.
|
|
9
|
-
|
|
10
|
-
## Canonical support bundle path
|
|
11
|
-
|
|
12
|
-
Default:
|
|
13
|
-
|
|
14
|
-
```text
|
|
15
|
-
~/.codex/meta-architect-sdk/
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
If `CODEX_HOME` is set, use:
|
|
19
|
-
|
|
20
|
-
```text
|
|
21
|
-
$CODEX_HOME/meta-architect-sdk/
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
You can print the exact active path with:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
ma sdk-path
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## What is installed there
|
|
31
|
-
|
|
32
|
-
- `mcp/`
|
|
33
|
-
- `sprint/`
|
|
34
|
-
- `prompts/`
|
|
35
|
-
- `scripts/`
|
|
36
|
-
- `plugins/meta-architect/`
|
|
37
|
-
- `templates/`
|
|
38
|
-
- `docs/README.md`
|
|
39
|
-
- `asset-manifest.json`
|
|
40
|
-
|
|
41
|
-
## Why this exists
|
|
42
|
-
|
|
43
|
-
- skills can rely on a standard installed asset root
|
|
44
|
-
- helper paths can repair missing support assets automatically
|
|
45
|
-
- packaged references do not depend on a source checkout
|
|
46
|
-
- the product can use relevant packaged files without path guessing
|
|
47
|
-
|
|
48
|
-
## Contract
|
|
49
|
-
|
|
50
|
-
When Meta-Architect needs packaged support files, prefer the installed support bundle first.
|
|
51
|
-
|
|
52
|
-
Examples:
|
|
53
|
-
- MCP starter files -> `meta-architect-sdk/mcp/`
|
|
54
|
-
- sprint references -> `meta-architect-sdk/sprint/`
|
|
55
|
-
- Codex prompt assets -> `meta-architect-sdk/prompts/`
|
|
56
|
-
- helper scripts -> `meta-architect-sdk/scripts/`
|
|
57
|
-
- plugin metadata -> `meta-architect-sdk/plugins/meta-architect/`
|
|
58
|
-
- templates -> `meta-architect-sdk/templates/`
|
|
59
|
-
|
|
60
|
-
The in-session skill flow is still primary. This bundle only standardizes packaged asset access.
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Release Readiness 0.1.3
|
|
2
|
-
|
|
3
|
-
## Production bar
|
|
4
|
-
|
|
5
|
-
`v0.1.3` is treated as production only when:
|
|
6
|
-
- the package installs cleanly from the canonical public install command
|
|
7
|
-
- the Codex-hosted runtime path works end to end
|
|
8
|
-
- the helper flow remains valid for scripted verification
|
|
9
|
-
- release docs, package metadata, and workflows all agree on `0.1.3`
|
|
10
|
-
|
|
11
|
-
Target release state:
|
|
12
|
-
- npm package: `@jstn-sdk/ma@0.1.3`
|
|
13
|
-
- npm registry state: pending publish
|
|
14
|
-
- publishability note: `0.1.2` is already published, so `0.1.3` is the next publishable package line
|
|
15
|
-
- git tag: `v0.1.3`
|
|
16
|
-
- GitHub release: pending publish for `v0.1.3`
|
|
17
|
-
|
|
18
|
-
## Production checklist
|
|
19
|
-
|
|
20
|
-
- skills-first product identity: PASS
|
|
21
|
-
- package/plugin identity aligned to `@jstn-sdk/ma`: PASS
|
|
22
|
-
- version/tag alignment `0.1.3` / `v0.1.3`: PASS
|
|
23
|
-
- install/uninstall docs aligned: PASS
|
|
24
|
-
- onboarding is concise and sequential: PASS
|
|
25
|
-
- helper command documented as secondary: PASS
|
|
26
|
-
- skills/prompts/manifests aligned: PASS
|
|
27
|
-
- packaging includes required assets: PASS
|
|
28
|
-
- tests pass: PASS
|
|
29
|
-
- package dry-run passes: PASS
|
|
30
|
-
- installed-package behavior passes: PASS
|
|
31
|
-
- workflow/release/provenance docs aligned: PASS
|
|
32
|
-
- no stale package names remain in tracked repo surfaces: PASS
|
|
33
|
-
- no conflicting CLI-first product story remains in tracked product docs: PASS
|
|
34
|
-
|
|
35
|
-
## Automated checks run
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm run release:check
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
That must cover:
|
|
42
|
-
- skills manifest generation
|
|
43
|
-
- skill validation
|
|
44
|
-
- skill bundle packaging
|
|
45
|
-
- repo checks
|
|
46
|
-
- automated tests
|
|
47
|
-
- npm package dry-run inspection
|
|
48
|
-
|
|
49
|
-
## Manual/behavioral checks run
|
|
50
|
-
|
|
51
|
-
Canonical launch:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
ma --madmax --high
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Helper-path validation:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
ma setup
|
|
61
|
-
ma idea "Build a demo app"
|
|
62
|
-
ma run '$arch'
|
|
63
|
-
ma run '$sage'
|
|
64
|
-
ma run '$flow'
|
|
65
|
-
ma run '$vet'
|
|
66
|
-
ma run '$vibe'
|
|
67
|
-
ma status
|
|
68
|
-
ma run '$build'
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Expected evidence:
|
|
72
|
-
- `.ma/release.json` remains the source of truth
|
|
73
|
-
- `.ma/decisions.json` records the helper-path activity
|
|
74
|
-
- `$build` stays blocked until upstream gates are green, then becomes ready
|
|
75
|
-
|
|
76
|
-
## Known limitations
|
|
77
|
-
|
|
78
|
-
- interactive Codex conversation quality depends on the installed Codex host
|
|
79
|
-
- release publication still depends on npm ownership/authorization for the target package name
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "meta-architect",
|
|
3
|
-
"version": "0.1.3",
|
|
4
|
-
"description": "Skills-first workflow layer for Codex with architecture, evidence, review, and gated build guidance.",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "JustineDevs",
|
|
7
|
-
"url": "https://github.com/JustineDevs"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://github.com/JustineDevs/meta-architect",
|
|
10
|
-
"repository": "https://github.com/JustineDevs/meta-architect.git",
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"keywords": ["codex", "skills", "architecture", "workflow", "review"],
|
|
13
|
-
"skills": "./skills/",
|
|
14
|
-
"mcpServers": "./.mcp.json",
|
|
15
|
-
"apps": "./.app.json",
|
|
16
|
-
"interface": {
|
|
17
|
-
"displayName": "Meta-Architect",
|
|
18
|
-
"shortDescription": "Architecture-first skill bundle for Codex workflows.",
|
|
19
|
-
"longDescription": "Meta-Architect packages reusable Codex skills plus plugin-scoped MCP and app metadata. The in-session skill workflow is primary. The ma helper command and .ma state only support setup, release gates, and optional local helper automation.",
|
|
20
|
-
"developerName": "JustineDevs",
|
|
21
|
-
"category": "Developer Tools"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: arch
|
|
3
|
-
description: "Use when the user wants architecture-first product and system design with explicit stack rationale, boundaries, tradeoffs, data model choices, and phased delivery planning."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Arch
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to turn a product idea into a concrete architecture brief.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- problem framing
|
|
14
|
-
- user and workload assumptions
|
|
15
|
-
- system architecture and subsystem boundaries
|
|
16
|
-
- stack recommendation with tradeoffs
|
|
17
|
-
- data model and storage choices
|
|
18
|
-
- auth, security, and operational concerns
|
|
19
|
-
- phased delivery plan
|
|
20
|
-
- top risks and open questions
|
|
21
|
-
- exact next trigger, usually `$sage`
|
|
22
|
-
|
|
23
|
-
## Rules
|
|
24
|
-
|
|
25
|
-
- Ask only for constraints that materially change the architecture.
|
|
26
|
-
- Keep the design biased toward the simplest system that can satisfy the stated requirements.
|
|
27
|
-
- Be explicit about tradeoffs, failure modes, and what should stay out of the first version.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: build
|
|
3
|
-
description: "Use when the user wants to decide whether implementation is ready, what remains blocked, and what the exact next build step should be."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Build
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to convert the earlier review lanes into an implementation-ready decision.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- current readiness verdict
|
|
14
|
-
- blockers that still prevent implementation
|
|
15
|
-
- the narrowest viable build slice
|
|
16
|
-
- branch or worktree suggestions when relevant
|
|
17
|
-
- test and verification expectations
|
|
18
|
-
- the exact next implementation step
|
|
19
|
-
|
|
20
|
-
## Rules
|
|
21
|
-
|
|
22
|
-
- Do not claim readiness if architecture, evidence, logic, security, or DX/UX gaps remain unresolved.
|
|
23
|
-
- Keep the recommended build slice small, testable, and reversible.
|
|
24
|
-
- If the user wants code immediately and the path is clear, end with a concrete implementation plan rather than more review prose.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: flow
|
|
3
|
-
description: "Use when the user wants logic validation: states, transitions, invariants, edge cases, dead ends, and blockers before implementation."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Flow
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to pressure-test how the system behaves, not just how it is structured.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- key actors and system states
|
|
14
|
-
- main flows and failure flows
|
|
15
|
-
- invariants and state transitions
|
|
16
|
-
- race conditions, dead ends, and consistency risks
|
|
17
|
-
- missing requirements or ambiguous behavior
|
|
18
|
-
- exact next trigger, usually `$vet`
|
|
19
|
-
|
|
20
|
-
## Rules
|
|
21
|
-
|
|
22
|
-
- Focus on behavior, not UI polish or low-level code details.
|
|
23
|
-
- Surface ambiguity aggressively when it affects correctness.
|
|
24
|
-
- Prefer simple state models over sprawling branching logic.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Core Release Rules
|
|
2
|
-
|
|
3
|
-
- Required status fields live in `.ma/decisions.json` and `.ma/release.json`.
|
|
4
|
-
- `$build` is blocked unless:
|
|
5
|
-
- `idea_status = CLEAR`
|
|
6
|
-
- `architecture_status = APPROVED`
|
|
7
|
-
- `evidence_status = VERIFIED`
|
|
8
|
-
- `logic_status = GREEN`
|
|
9
|
-
- `security_status = GREEN`
|
|
10
|
-
- `experience_status = GREEN` or `WAIVED`
|
|
11
|
-
- Feature work merges into `development`, never directly into `prod`.
|
|
12
|
-
- Release promotion is allowed only from `development` or approved `release/*`.
|
|
13
|
-
- Use the helper command path only when repo-local state automation is explicitly needed; otherwise stay inside Codex and carry the gate decisions in the session.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sage
|
|
3
|
-
description: "Use when the user wants evidence-backed technology choices, OSS evaluation, and source-grounded validation of the stack proposed in `$arch`."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Sage
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to verify or challenge stack choices with real sources.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- candidate tools, libraries, or services
|
|
14
|
-
- why each option fits or fails the architecture
|
|
15
|
-
- source-backed evidence from official docs, upstream repos, or approved GitMCP sources
|
|
16
|
-
- recommendation with tradeoffs
|
|
17
|
-
- unresolved gaps or missing evidence
|
|
18
|
-
- exact next trigger, usually `$flow`
|
|
19
|
-
|
|
20
|
-
## Rules
|
|
21
|
-
|
|
22
|
-
- Do not invent package capabilities or maturity claims.
|
|
23
|
-
- Prefer primary sources over summaries when validating technical details.
|
|
24
|
-
- If the evidence is weak or contradictory, say so clearly and keep the recommendation conditional.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: vet
|
|
3
|
-
description: "Use when the user wants a security and trust-boundary review of the current design before implementation or release."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Vet
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to review security posture before the build lane.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- trust boundaries
|
|
14
|
-
- authn/authz expectations
|
|
15
|
-
- sensitive data paths
|
|
16
|
-
- abuse cases and likely failure modes
|
|
17
|
-
- concrete mitigations
|
|
18
|
-
- release blockers vs acceptable risks
|
|
19
|
-
- exact next trigger, usually `$vibe`
|
|
20
|
-
|
|
21
|
-
## Rules
|
|
22
|
-
|
|
23
|
-
- Prioritize material risks over exhaustive but low-value checklists.
|
|
24
|
-
- Call out missing assumptions that affect security posture.
|
|
25
|
-
- Distinguish between must-fix blockers and documented accepted risk.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: vibe
|
|
3
|
-
description: "Use when the user wants a DX and UX review of the planned workflow before implementation proceeds."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Vibe
|
|
7
|
-
|
|
8
|
-
Use this skill inside Codex to review whether the system will feel coherent for both operators and end users.
|
|
9
|
-
|
|
10
|
-
## Output
|
|
11
|
-
|
|
12
|
-
Produce:
|
|
13
|
-
- developer workflow risks
|
|
14
|
-
- user workflow risks
|
|
15
|
-
- complexity hotspots
|
|
16
|
-
- onboarding or operability friction
|
|
17
|
-
- simplifications that improve clarity
|
|
18
|
-
- exact next trigger, usually `$build`
|
|
19
|
-
|
|
20
|
-
## Rules
|
|
21
|
-
|
|
22
|
-
- Focus on concrete friction, not aesthetics-only feedback.
|
|
23
|
-
- Prefer fewer surfaces, fewer steps, and clearer operator outcomes.
|
|
24
|
-
- Preserve the architecture and security constraints established earlier in the flow.
|
package/scripts/plugin-sync.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
|
|
7
|
-
const repoRoot = process.cwd();
|
|
8
|
-
const skillsRoot = path.join(repoRoot, "skills");
|
|
9
|
-
const pluginRoot = path.join(repoRoot, "plugins", "meta-architect");
|
|
10
|
-
const pluginSkillsRoot = path.join(pluginRoot, "skills");
|
|
11
|
-
|
|
12
|
-
function parseArgs(argv) {
|
|
13
|
-
return {
|
|
14
|
-
check: argv.includes("--check"),
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async function copyDir(src, dest) {
|
|
19
|
-
await fs.mkdir(dest, { recursive: true });
|
|
20
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
21
|
-
for (const entry of entries) {
|
|
22
|
-
const srcPath = path.join(src, entry.name);
|
|
23
|
-
const destPath = path.join(dest, entry.name);
|
|
24
|
-
if (entry.isDirectory()) {
|
|
25
|
-
await copyDir(srcPath, destPath);
|
|
26
|
-
} else {
|
|
27
|
-
await fs.copyFile(srcPath, destPath);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function listSkillDirs(root) {
|
|
33
|
-
const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
|
|
34
|
-
return entries
|
|
35
|
-
.filter((entry) => entry.isDirectory())
|
|
36
|
-
.map((entry) => entry.name)
|
|
37
|
-
.sort();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function syncPluginSkills() {
|
|
41
|
-
const skillDirs = await listSkillDirs(skillsRoot);
|
|
42
|
-
await fs.mkdir(pluginSkillsRoot, { recursive: true });
|
|
43
|
-
|
|
44
|
-
const existingPluginDirs = await listSkillDirs(pluginSkillsRoot);
|
|
45
|
-
for (const name of existingPluginDirs) {
|
|
46
|
-
if (!skillDirs.includes(name)) {
|
|
47
|
-
await fs.rm(path.join(pluginSkillsRoot, name), { recursive: true, force: true });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
for (const name of skillDirs) {
|
|
52
|
-
const src = path.join(skillsRoot, name);
|
|
53
|
-
const dest = path.join(pluginSkillsRoot, name);
|
|
54
|
-
await fs.rm(dest, { recursive: true, force: true });
|
|
55
|
-
await copyDir(src, dest);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return skillDirs;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async function verifyPluginSkills() {
|
|
62
|
-
const skillDirs = await listSkillDirs(skillsRoot);
|
|
63
|
-
const pluginDirs = await listSkillDirs(pluginSkillsRoot);
|
|
64
|
-
if (skillDirs.length !== pluginDirs.length) {
|
|
65
|
-
throw new Error("Plugin skill mirror drift: directory count mismatch");
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
for (let index = 0; index < skillDirs.length; index += 1) {
|
|
69
|
-
if (skillDirs[index] !== pluginDirs[index]) {
|
|
70
|
-
throw new Error(
|
|
71
|
-
`Plugin skill mirror drift: expected ${skillDirs[index]}, found ${pluginDirs[index]}`,
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function main() {
|
|
78
|
-
const args = parseArgs(process.argv.slice(2));
|
|
79
|
-
if (args.check) {
|
|
80
|
-
await verifyPluginSkills();
|
|
81
|
-
console.log(pluginSkillsRoot);
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
await syncPluginSkills();
|
|
86
|
-
console.log(pluginSkillsRoot);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
main().catch((error) => {
|
|
90
|
-
console.error(error.message);
|
|
91
|
-
process.exitCode = 1;
|
|
92
|
-
});
|
package/scripts/postinstall.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import process from "node:process";
|
|
4
|
-
import { installSkills, installSupportBundle } from "../src/skill-installer.js";
|
|
5
|
-
|
|
6
|
-
async function main() {
|
|
7
|
-
if (process.env.MA_SKIP_AUTO_INSTALL === "1") {
|
|
8
|
-
console.log("meta-architect: skipped Codex skill auto-install");
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const [
|
|
13
|
-
{ targetRoot: skillRoot, installed: skills },
|
|
14
|
-
{ targetRoot: bundleRoot, installed: assets },
|
|
15
|
-
] = await Promise.all([installSkills(), installSupportBundle()]);
|
|
16
|
-
console.log(`meta-architect: installed ${skills.length} Codex skills into ${skillRoot}`);
|
|
17
|
-
console.log(`meta-architect: installed ${assets.length} support assets into ${bundleRoot}`);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
main().catch((error) => {
|
|
21
|
-
console.error(`meta-architect: failed to install Codex skills: ${error.message}`);
|
|
22
|
-
process.exitCode = 1;
|
|
23
|
-
});
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import process from "node:process";
|
|
5
|
-
|
|
6
|
-
function loadPackageJson() {
|
|
7
|
-
return JSON.parse(fs.readFileSync("package.json", "utf8"));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function parseVersion(version) {
|
|
11
|
-
const match = version.match(
|
|
12
|
-
/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:-(?<prerelease>[0-9A-Za-z.-]+))?$/,
|
|
13
|
-
);
|
|
14
|
-
if (!match?.groups) {
|
|
15
|
-
throw new Error(`Invalid package.json version: ${version}`);
|
|
16
|
-
}
|
|
17
|
-
return match.groups;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function computeMetadata(version) {
|
|
21
|
-
const parsed = parseVersion(version);
|
|
22
|
-
const prerelease = parsed.prerelease ?? "";
|
|
23
|
-
const prereleaseIdentifiers = prerelease ? prerelease.split(".") : [];
|
|
24
|
-
const isPrerelease = prereleaseIdentifiers.length > 0;
|
|
25
|
-
const distTag = isPrerelease ? prereleaseIdentifiers[0] : "latest";
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
version,
|
|
29
|
-
gitTag: `v${version}`,
|
|
30
|
-
isPrerelease,
|
|
31
|
-
distTag,
|
|
32
|
-
prerelease,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function parseArgs(argv) {
|
|
37
|
-
const args = {
|
|
38
|
-
field: "",
|
|
39
|
-
githubOutput: "",
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
43
|
-
const token = argv[index];
|
|
44
|
-
if (token === "--field") {
|
|
45
|
-
args.field = argv[index + 1] ?? "";
|
|
46
|
-
index += 1;
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (token === "--github-output") {
|
|
50
|
-
args.githubOutput = argv[index + 1] ?? "";
|
|
51
|
-
index += 1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return args;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function writeGithubOutput(outputPath, metadata) {
|
|
59
|
-
const lines = [
|
|
60
|
-
`version=${metadata.version}`,
|
|
61
|
-
`git_tag=${metadata.gitTag}`,
|
|
62
|
-
`dist_tag=${metadata.distTag}`,
|
|
63
|
-
`is_prerelease=${metadata.isPrerelease}`,
|
|
64
|
-
];
|
|
65
|
-
fs.appendFileSync(outputPath, `${lines.join("\n")}\n`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function main() {
|
|
69
|
-
const args = parseArgs(process.argv.slice(2));
|
|
70
|
-
const pkg = loadPackageJson();
|
|
71
|
-
const metadata = computeMetadata(pkg.version);
|
|
72
|
-
|
|
73
|
-
if (args.githubOutput) {
|
|
74
|
-
writeGithubOutput(args.githubOutput, metadata);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (args.field) {
|
|
78
|
-
const value = metadata[args.field];
|
|
79
|
-
if (value === undefined) {
|
|
80
|
-
throw new Error(`Unknown metadata field: ${args.field}`);
|
|
81
|
-
}
|
|
82
|
-
console.log(value);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
console.log(JSON.stringify(metadata, null, 2));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
main();
|
|
91
|
-
} catch (error) {
|
|
92
|
-
console.error(error.message);
|
|
93
|
-
process.exitCode = 1;
|
|
94
|
-
}
|