@warpgogol/forge 0.12.1 → 0.14.0

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.
Files changed (57) hide show
  1. package/AGENTS.md +11 -8
  2. package/dist/os/core/core.module.d.ts.map +1 -1
  3. package/dist/os/core/core.module.js +1 -0
  4. package/dist/os/core/core.module.js.map +1 -1
  5. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  6. package/dist/os/mission/handlers/archive.js +3 -1
  7. package/dist/os/mission/handlers/archive.js.map +1 -1
  8. package/dist/os/rfc/handlers/shared.d.ts.map +1 -1
  9. package/dist/os/rfc/handlers/shared.js +12 -6
  10. package/dist/os/rfc/handlers/shared.js.map +1 -1
  11. package/dist/os/rfc/index.d.ts +1 -1
  12. package/dist/os/rfc/index.d.ts.map +1 -1
  13. package/dist/os/rfc/index.js +1 -1
  14. package/dist/os/rfc/index.js.map +1 -1
  15. package/dist/os/rfc/types.d.ts +2 -1
  16. package/dist/os/rfc/types.d.ts.map +1 -1
  17. package/dist/os/rfc/types.js +2 -1
  18. package/dist/os/rfc/types.js.map +1 -1
  19. package/dist/os/session/handlers/save.d.ts.map +1 -1
  20. package/dist/os/session/handlers/save.js +16 -4
  21. package/dist/os/session/handlers/save.js.map +1 -1
  22. package/dist/os/spec/spec-materialize.d.ts.map +1 -1
  23. package/dist/os/spec/spec-materialize.js +4 -10
  24. package/dist/os/spec/spec-materialize.js.map +1 -1
  25. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.d.ts.map +1 -1
  26. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +6 -4
  27. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
  28. package/dist/src/migration-adapters/git-utils.d.ts.map +1 -1
  29. package/dist/src/migration-adapters/git-utils.js +14 -4
  30. package/dist/src/migration-adapters/git-utils.js.map +1 -1
  31. package/dist/src/onboarding/invariant-engine.d.ts.map +1 -1
  32. package/dist/src/onboarding/invariant-engine.js +45 -1
  33. package/dist/src/onboarding/invariant-engine.js.map +1 -1
  34. package/dist/src/profiles/profile-schema.d.ts +12 -1
  35. package/dist/src/profiles/profile-schema.d.ts.map +1 -1
  36. package/dist/src/profiles/profile-schema.js +14 -2
  37. package/dist/src/profiles/profile-schema.js.map +1 -1
  38. package/dist/src/profiles/stack-profile.d.ts +3 -0
  39. package/dist/src/profiles/stack-profile.d.ts.map +1 -1
  40. package/dist/src/utils/fs-trash-sync.d.ts +2 -0
  41. package/dist/src/utils/fs-trash-sync.d.ts.map +1 -0
  42. package/dist/src/utils/fs-trash-sync.js +34 -0
  43. package/dist/src/utils/fs-trash-sync.js.map +1 -0
  44. package/dist/src/utils/fs-trash.d.ts +2 -0
  45. package/dist/src/utils/fs-trash.d.ts.map +1 -0
  46. package/dist/src/utils/fs-trash.js +24 -0
  47. package/dist/src/utils/fs-trash.js.map +1 -0
  48. package/dist/src/utils/index.d.ts +2 -0
  49. package/dist/src/utils/index.d.ts.map +1 -1
  50. package/dist/src/utils/index.js +2 -0
  51. package/dist/src/utils/index.js.map +1 -1
  52. package/package.json +3 -2
  53. package/profiles/editframe-html-templates/composition-agents.md +34 -5
  54. package/profiles/editframe-html.yaml +51 -0
  55. package/skills/fo/ef-composition-review/SKILL.md +66 -0
  56. package/skills/fo/ef-onboard/SKILL.md +90 -0
  57. package/skills/fo/ef-render-verify/SKILL.md +56 -0
@@ -10,16 +10,45 @@ This workspace contains an Editframe video composition.
10
10
 
11
11
  ## Quality invariants
12
12
 
13
- - **VIDEO-01**: Composition filenames must use kebab-case (lowercase letters, digits, hyphens only). This ensures consistent naming across the project. Severity: error.
14
- - **VIDEO-02**: Scene durations must use `contain` fit mode by default to avoid unexpected cropping of video content. Use `cover` or `fill` only when intentionally overriding the default. Severity: warning.
15
- - **VIDEO-03**: All speech audio elements (`ef-audio` with speech content) must have corresponding `ef-captions` elements for accessibility. Severity: error.
13
+ | ID | Description | Severity |
14
+ | --- | --- | --- |
15
+ | VIDEO-01 | Composition filenames must use kebab-case (lowercase letters, digits, hyphens only). | error |
16
+ | VIDEO-02 | Scene durations must use `contain` fit mode by default to avoid unexpected cropping. Use `cover` or `fill` only when intentionally overriding. | warning |
17
+ | VIDEO-03 | All speech audio elements (`ef-audio` with speech content) must have corresponding `ef-captions` elements for accessibility. | error |
18
+
19
+ Additional time model invariants (VIDEO-04 through VIDEO-09) may be available. Run `forge doctor` to check the full invariant set enforced by the active profile.
20
+
21
+ ## Time model concepts
22
+
23
+ Editframe compositions use a time model based on `ef-timegroup` elements:
24
+
25
+ - **`ef-timegroup`** — a container that groups scenes and controls timing. The root timegroup defines the composition's total duration.
26
+ - **`mode`** — timing behavior for children: `sequence` (play one after another), `fixed` (play at absolute offset), `contain` (fit within parent duration), `fit` (scale to fit).
27
+ - **`duration`** — CSS time string (e.g. `5s`, `300ms`, `2.5s`) defining how long the element plays.
28
+ - **`offset`** — CSS time string defining when the element starts relative to its parent.
29
+ - **`fps`** — positive integer defining frames per second (e.g. `30`, `60`).
30
+ - **`loop`** — boolean, only on the root timegroup. Nested timegroups should not loop.
16
31
 
17
32
  ## Workflow
18
33
 
19
34
  1. Create a `.html` file with Editframe custom elements (`ef-timegroup`, `ef-video`, `ef-audio`, `ef-text`, `ef-captions`).
20
35
  2. Run `editframe preview` to preview the composition in the browser.
21
- 3. Run `editframe check` to validate the composition structure.
22
- 4. Run `editframe render -o dist/<name>.mp4` to produce the final video output.
36
+ 3. Run `ef-composition-review` to review the composition for time model correctness, accessibility, and best practices.
37
+ 4. Run `editframe check` to validate the composition structure.
38
+ 5. Run `editframe render -o dist/<name>.mp4` to produce the final video output.
39
+ 6. Run `ef-render-verify` to verify the render — validation, build, determinism, output inspection.
40
+
41
+ ## Skills
42
+
43
+ - **ef-onboard** — onboard a new project: prerequisites, discovery, scaffold, preview. Trigger: "create a new video project".
44
+ - **ef-composition-review** — review a composition for time model correctness, accessibility, and best practices before rendering. Trigger: "review this composition".
45
+ - **ef-render-verify** — verify a render: validate, build, check determinism, inspect output. Trigger: "render and verify".
46
+
47
+ ## External resources
48
+
49
+ - [Editframe llms.txt](https://editframe.com/llms.txt) — machine-readable index of Editframe domain skills
50
+ - [Editframe composition skill](https://editframe.com/skills/composition.md) — full reference for time model, elements, and rendering
51
+ - [Editframe getting started](https://editframe.com/getting-started) — step-by-step guide and agent prompt
23
52
 
24
53
  ## Reference template
25
54
 
@@ -55,6 +55,7 @@ workspaceTypes:
55
55
  contains: ef-timegroup
56
56
  packageJsonDep: "@editframe/cli"
57
57
  skills:
58
+ - ef-onboard
58
59
  - ef-composition-review
59
60
  - ef-render-verify
60
61
  agentsMdTemplate: editframe-html-templates/composition-agents.md
@@ -80,6 +81,56 @@ invariants:
80
81
  kind: file-contains
81
82
  glob: "compositions/**/*.html"
82
83
  pattern: ef-captions
84
+ - id: VIDEO-04
85
+ rule: 'Root ef-timegroup must declare duration or use mode="contain" or mode="fit"'
86
+ severity: error
87
+ check:
88
+ kind: file-contains
89
+ glob: "compositions/**/*.html"
90
+ pattern: 'ef-timegroup[^>]*(duration|mode="contain"|mode="fit")[^>]*>'
91
+ - id: VIDEO-05
92
+ rule: All duration values must be valid CSS time strings (e.g. 5s, 500ms, 2.5s)
93
+ severity: error
94
+ check:
95
+ kind: html-attribute-pattern
96
+ glob: "compositions/**/*.html"
97
+ element: "ef-timegroup"
98
+ attribute: "duration"
99
+ pattern: "^\\d+(\\.\\d+)?(s|ms)$"
100
+ - id: VIDEO-06
101
+ rule: "mode attribute must be one of: sequence, fixed, contain, fit"
102
+ severity: error
103
+ check:
104
+ kind: html-attribute-pattern
105
+ glob: "compositions/**/*.html"
106
+ element: "ef-timegroup"
107
+ attribute: "mode"
108
+ pattern: "^(sequence|fixed|contain|fit)$"
109
+ - id: VIDEO-07
110
+ rule: fps must be a positive integer (default 30)
111
+ severity: warning
112
+ check:
113
+ kind: html-attribute-pattern
114
+ glob: "compositions/**/*.html"
115
+ element: "ef-timegroup"
116
+ attribute: "fps"
117
+ pattern: "^[1-9]\\d*$"
118
+ - id: VIDEO-08
119
+ rule: loop attribute should only be used on the root ef-timegroup (no effect on render for nested groups)
120
+ severity: warning
121
+ check:
122
+ kind: file-not-contains
123
+ glob: "compositions/**/*.html"
124
+ negatedPattern: "<ef-timegroup[^>]*loop[^>]*>[\\s\\S]*<ef-timegroup[^>]*loop"
125
+ - id: VIDEO-09
126
+ rule: offset values must be valid CSS time strings (e.g. 0.5s, 3s, 500ms)
127
+ severity: warning
128
+ check:
129
+ kind: html-attribute-pattern
130
+ glob: "compositions/**/*.html"
131
+ element: "ef-timegroup"
132
+ attribute: "offset"
133
+ pattern: "^\\d+(\\.\\d+)?(s|ms)$"
83
134
  workspace:
84
135
  dirs:
85
136
  - compositions
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: ef-composition-review
3
+ description: Review an Editframe HTML composition for time model correctness, accessibility, and best practices
4
+ invocation: user
5
+ category: fo
6
+ concerns: read-only
7
+ dependsOn: []
8
+ languagePolicy: ref(PREFERENCES.md)
9
+ ---
10
+
11
+ <!-- skill-lint-disable SKILL-17 -->
12
+
13
+ # ef-composition-review
14
+
15
+ Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
16
+
17
+ A read-only review of an Editframe HTML composition file. The skill checks time model correctness, accessibility, asset references, automated invariants, and manual best practices. It does **not** modify any file — it produces a structured report and stops.
18
+
19
+ ## Scope
20
+
21
+ This skill reviews `.html` composition files that use Editframe custom elements (`ef-timegroup`, `ef-video`, `ef-audio`, `ef-text`, `ef-captions`). It is designed for projects using the `editframe-html` stack profile.
22
+
23
+ ## Process
24
+
25
+ ### 1. Empty state check
26
+
27
+ Scan the `compositions/` directory for `.html` files. If no compositions are found, report "No compositions found — nothing to review" and stop. Do not report false positives on an empty project.
28
+
29
+ ### 2. Time model review
30
+
31
+ For each composition file:
32
+
33
+ - Check that the root `ef-timegroup` declares a `duration` attribute or uses `mode="contain"` / `mode="fit"`.
34
+ - Check that all `duration` and `offset` values are valid CSS time strings (e.g. `5s`, `300ms`, `2.5s`).
35
+ - Check that `mode` values are one of: `sequence`, `fixed`, `contain`, `fit`.
36
+ - Check that `fps` is a positive integer (e.g. `30`, `60`).
37
+ - Check that `loop` is only present on the root `ef-timegroup` — nested timegroups should not loop.
38
+
39
+ ### 3. Accessibility review
40
+
41
+ - Check that all `ef-audio` elements with speech content have corresponding `ef-captions` elements.
42
+ - Check that `ef-text` elements have sufficient contrast between foreground and background colors (if declared via inline styles or CSS classes).
43
+
44
+ ### 4. Asset reference review
45
+
46
+ - Check that all `src` attributes in `ef-video`, `ef-audio`, and `ef-image` elements point to files that exist in the `assets/` directory.
47
+ - Check that asset filenames use kebab-case (lowercase letters, digits, hyphens only).
48
+
49
+ ### 5. Invariant check
50
+
51
+ Run `forge doctor` to check all profile invariants automatically. For the `editframe-html` profile, this covers VIDEO-01 through VIDEO-09 (filename conventions, scene fit modes, captions, and time model invariants). Review the output and include any violations in the report.
52
+
53
+ ### 6. Manual best practices
54
+
55
+ Review aspects not covered by automated invariants:
56
+
57
+ - Scene composition quality — are scenes well-structured with clear transitions?
58
+ - Narrative pacing — does the timing flow naturally?
59
+ - Visual hierarchy — are text elements readable and well-positioned?
60
+ - Asset reuse — are assets reused efficiently across scenes?
61
+
62
+ Do not duplicate checks that `forge doctor` already performs.
63
+
64
+ ### 7. Report
65
+
66
+ Summarize findings organized by category (time model, accessibility, assets, invariants, best practices). For each finding, include the file path, line number (if applicable), severity (error / warning / info), and a specific recommendation.
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: ef-onboard
3
+ description: Onboard a new Editframe video project — check prerequisites, discover requirements, scaffold, and start preview. Use when the operator asks to create a new video project.
4
+ invocation: user
5
+ category: fo
6
+ concerns: content-mutation
7
+ dependsOn: []
8
+ languagePolicy: ref(PREFERENCES.md)
9
+ triggers:
10
+ - "create a new editframe project"
11
+ - "start a new video project"
12
+ - "build a video with editframe"
13
+ - "create a video composition"
14
+ ---
15
+
16
+ <!-- skill-lint-disable SKILL-17 -->
17
+
18
+ # ef-onboard
19
+
20
+ Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
21
+
22
+ Guide the operator through creating a new Editframe video project within a Forge-managed workspace. The skill covers prerequisites check, discovery, scaffold, Editframe domain skills installation, domain knowledge reading, and build + preview.
23
+
24
+ ## Process
25
+
26
+ ### 1. Prerequisites check
27
+
28
+ - **Node.js 18+**: Run `node --version`. If missing or below 18, direct the operator to `https://nodejs.org/en/download/` or install via the system package manager.
29
+ - **FFmpeg**: Run `ffmpeg -version`. If missing, direct the operator to `https://ffmpeg.org/download.html` or install via the system package manager (`apt install ffmpeg`, `brew install ffmpeg`).
30
+ - If either prerequisite is missing and cannot be installed automatically, stop and ask the operator to install it manually.
31
+
32
+ ### 2. Discovery
33
+
34
+ Ask the operator:
35
+
36
+ 1. **Project type**:
37
+ - Single video (product demo, social media video, personal project)
38
+ - Video template (reusable with different assets — birthday card, wedding announcement)
39
+ - Video editing tool (custom editor built with Editframe as the engine)
40
+ - Video workflow automation (script that generates videos from triggers)
41
+ - Something else (ask them to describe it)
42
+
43
+ 2. **Existing assets**:
44
+ - Video clips, images, or audio files (file paths or URLs)
45
+ - Website URLs to use as content source — if provided, download and cache all relevant assets locally before building
46
+ - No existing assets — start from scratch
47
+
48
+ 3. **Stack preference**:
49
+ - Vanilla HTML/CSS/JS (simpler, no build step beyond Vite)
50
+ - React + TypeScript (component-based, type-safe)
51
+ - No preference — recommend HTML for single videos, React for templates and editors
52
+
53
+ 4. **Node.js/React libraries**: Ask if the operator has any libraries in mind (e.g. AnimeJS for animations, Tailwind for styling).
54
+
55
+ Prioritize getting all answers before starting to build. This minimizes wait time for the operator.
56
+
57
+ ### 3. Scaffold
58
+
59
+ Run `forge create --profile editframe-html` to scaffold the project with Forge governance (invariants, AGENTS.md templates, forge skills).
60
+
61
+ The `editframe-html` profile currently targets HTML compositions only — it does not support a `--template react` flag. If the operator chose React, scaffold with `forge create --profile editframe-html`, then instruct the agent to install `@editframe/react` manually (`pnpm add @editframe/react`) after scaffold.
62
+
63
+ If `forge create` fails (missing profile, network error, permission issue), report the error to the operator and stop. Do not proceed to subsequent steps without a scaffolded project.
64
+
65
+ ### 4. Install Editframe domain skills
66
+
67
+ Editframe publishes domain skills via `npm create @editframe`. To make them available alongside forge skills:
68
+
69
+ 1. Run `npm create @editframe@latest` in the project directory. This installs Editframe's domain skills to `.agents/skills/editframe-*/`.
70
+ 2. Report which skills were installed.
71
+ 3. If the command fails (network issues, npm errors, unsupported flags), fall back to referencing the online documentation: direct the agent to read `https://editframe.com/llms.txt` and `https://editframe.com/skills/composition.md` before building. Do not use unverified CLI flags — if `npm create @editframe` prompts interactively, answer the prompts based on the operator's discovery answers from Step 2.
72
+
73
+ ### 5. Read domain knowledge
74
+
75
+ Before building, the agent MUST read the `editframe-composition` skill (either from `.agents/skills/editframe-composition/SKILL.md` if installed, or from `https://editframe.com/skills/composition.md`). This provides domain knowledge about:
76
+
77
+ - Time model (`ef-timegroup`, modes, duration, offset)
78
+ - Media elements (`ef-video`, `ef-audio`, `ef-image`, `ef-text`, `ef-captions`)
79
+ - CSS animations and transitions
80
+ - Rendering pipeline
81
+
82
+ The agent should also read `editframe-dev-server` if the project uses the dev server.
83
+
84
+ ### 6. Build and preview
85
+
86
+ 1. Build the initial composition based on the operator's answers from Step 2. Use the discovery answers (project type, assets, stack preference, libraries) to determine composition structure, asset placement, and optional dependencies.
87
+ 2. Run `forge dev` to start the preview server (delegates to `editframe preview` per the `editframe-html` profile's `devServer.command`).
88
+ 3. Report the localhost URL to the operator.
89
+ 4. Run `forge doctor` to check all profile invariants on the initial composition. For the `editframe-html` profile, this covers VIDEO-01 through VIDEO-09.
90
+ 5. Report any invariant violations and suggest fixes.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: ef-render-verify
3
+ description: Verify an Editframe render — validate, build, check determinism, inspect output
4
+ invocation: user
5
+ category: fo
6
+ concerns: read-only
7
+ dependsOn: []
8
+ languagePolicy: ref(PREFERENCES.md)
9
+ ---
10
+
11
+ <!-- skill-lint-disable SKILL-17 -->
12
+
13
+ # ef-render-verify
14
+
15
+ Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
16
+
17
+ A read-only verification of an Editframe render pipeline. The skill runs validation, build, determinism check, and output inspection, then reports pass/fail for each step. It does **not** modify any file.
18
+
19
+ ## Scope
20
+
21
+ This skill verifies render output for `.html` composition files using the `editframe-html` stack profile. It uses `forge validate`, `forge build`, and `forge determinism check` — all profile-driven commands.
22
+
23
+ ## Process
24
+
25
+ ### 1. Pre-render validation
26
+
27
+ Run `forge validate` to check the composition with the profile's validate command (typically `editframe check`). Review the output for any validation errors. If validation fails, report the errors and stop — do not proceed to render.
28
+
29
+ ### 2. Render
30
+
31
+ Run `forge build` to produce the MP4 output. Review the output for any build errors. If the build fails, report the errors and stop.
32
+
33
+ ### 3. Determinism check
34
+
35
+ Run `forge determinism check` to verify the render is reproducible — two builds produce identical output. Review the output hash comparison. If the hashes differ, report the mismatch and stop.
36
+
37
+ ### 4. Output inspection
38
+
39
+ Check the render output:
40
+
41
+ - Verify the output MP4 file exists at the expected path (`dist/{composition}.mp4`).
42
+ - Check that the file size is non-zero.
43
+ - Check that the duration matches the root `ef-timegroup`'s `duration` attribute (if ffprobe or equivalent is available).
44
+
45
+ ### 5. Report
46
+
47
+ Summarize the verification results — pass/fail for each step:
48
+
49
+ | Step | Status | Details |
50
+ | ----------------- | ----------- | -------------------------------------- |
51
+ | Validation | pass / fail | <error details or "all checks passed"> |
52
+ | Build | pass / fail | <error details or "build completed"> |
53
+ | Determinism | pass / fail | <hash comparison result> |
54
+ | Output inspection | pass / fail | <file exists, size, duration check> |
55
+
56
+ If all steps pass, the render is verified. If any step fails, provide specific recommendations for fixing the issue.