@easysociable/cli 0.1.17 → 0.1.19

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 (25) hide show
  1. package/README.md +2 -1
  2. package/dist/easysociable.js +11408 -9432
  3. package/dist/easysociable.js.map +1 -1
  4. package/package.json +20 -17
  5. package/skills/ONBOARDING.md +2 -3
  6. package/skills/easysociable-slideshow/SKILL.md +254 -152
  7. package/skills/easysociable-slideshow/references/CONTENT_PACK.md +12 -15
  8. package/skills/easysociable-slideshow/references/PLATFORM_CAPS.md +1 -1
  9. package/skills/easysociable-slideshow/references/REFERENCES.md +97 -0
  10. package/skills/easysociable-slideshow/scripts/check-pages.mjs +136 -0
  11. package/skills/easysociable-slideshow/workflows/CREATE_RUN.md +12 -43
  12. package/skills/easysociable-slideshow/workflows/MCP_FIRST.md +1 -3
  13. package/skills/easysociable-slideshow/workflows/OUT_OF_SCOPE.md +1 -1
  14. package/skills/easysociable-template/SKILL.md +14 -14
  15. package/skills/easysociable-template/references/CATALOG_METADATA.md +2 -2
  16. package/skills/easysociable-template/references/GATEWAY.md +1 -3
  17. package/skills/easysociable-template/references/PLATFORM_SPECS.md +7 -9
  18. package/skills/easysociable-template/scripts/generate-theme-from-hex.mjs +0 -0
  19. package/skills/easysociable-template/workflows/AUTHORING_FROM_BRIEF.md +4 -4
  20. package/skills/easysociable-template/workflows/AUTHORING_FROM_IMAGE.md +1 -1
  21. package/skills/easysociable-template/workflows/AUTHORING_STUDIO.md +4 -4
  22. package/skills/easysociable-template/workflows/BIND_FORMULA_LOOK.md +39 -0
  23. package/skills/easysociable-template/workflows/DESIGN_BRIEF.md +2 -3
  24. package/skills/easysociable-tweet-image/SKILL.md +57 -0
  25. package/skills/easysociable-template/workflows/MULTI_PLATFORM_FAMILY.md +0 -81
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: easysociable-tweet-image
3
+ description: >
4
+ Turn one or many X (Twitter) posts into clean PNG images with the `easysociable tweets render`
5
+ CLI. Use when the user pastes x.com / twitter.com status links (or tweet ids) and wants
6
+ images, screenshots or "cards" of them — e.g. "tweet to image", "turn these tweets into
7
+ pictures", "推文转图片", "把这几条推特做成图". One link → one PNG; never a carousel.
8
+ Do not use for writing new tweets, multi-slide carousels (use easysociable-slideshow), or
9
+ scraping profiles/timelines.
10
+ ---
11
+
12
+ # EasySociable Tweet Image
13
+
14
+ Renders each X post as its own PNG: avatar, display name, verified badge, @handle, text,
15
+ up to 4 media thumbnails, timestamp and reply/like counts on a gradient background.
16
+ Tweets are fetched through the EasySociable gateway (login required, free quota) and
17
+ rendered locally on this machine.
18
+
19
+ ## Run
20
+
21
+ ```bash
22
+ easysociable tweets render <link-or-id> [more links…] --json
23
+ easysociable tweets render --file links.txt --json # one link per line
24
+ ```
25
+
26
+ | Flag | Default | Values |
27
+ |---|---|---|
28
+ | `--size` | `auto` | `auto` (card height fits the tweet) · `4:5` · `3:4` · `9:16` · `1:1` |
29
+ | `--theme` | `light` | `light` · `dark` |
30
+ | `--background` | `plum-plate` | `none` · `#hex` · `plum-plate` `sunset` `oceanic` `hyper` `cotton-candy` `gotham-dark` `neon` `emerald` `night-fade` `midnight` |
31
+ | `--hide-metrics` | off | hide reply/like counts |
32
+ | `--out` | `./tweets` | output folder; files are `tweet-<handle>-<id>.png` |
33
+
34
+ If the command says `EASYSOCIABLE_API_KEY is required`, ask the user to run
35
+ `easysociable auth login` (opens the browser), then retry.
36
+
37
+ ## Rules
38
+
39
+ 1. **Never rewrite, translate, summarize or "fix" tweet text.** The image must show the post exactly as published. Same for author name, @handle and avatar — do not swap or hide them.
40
+ 2. **One link → one image.** Do not merge tweets, build threads or carousels. Duplicates are rendered once.
41
+ 3. **Do not ask about size, theme or background up front.** Use the defaults unless the user already said what they want (e.g. "for Instagram" → `--size 4:5`, "for Stories/TikTok" → `--size 9:16`, "dark mode" → `--theme dark`, "no background"/"transparent" → `--background none`).
42
+ 4. **Failures are final, not something to work around.** `TWEET_NOT_FOUND` (deleted), `TWEET_UNAVAILABLE` (protected, age-restricted, suspended) and `INVALID_TWEET_URL` must be reported as failed. Never reconstruct a tweet from memory, search results or another site.
43
+ 5. `RATE_LIMITED` is retried automatically; if it still fails, tell the user to rerun just the failed links in a minute. `UPSTREAM_UNAVAILABLE` → suggest retrying later.
44
+ 6. Pass every link the user gave in one command (batch); don't loop one call per link.
45
+
46
+ ## Report
47
+
48
+ Exit code 1 means at least one item failed; the others still rendered. Reply with a short
49
+ per-link table from the `--json` items:
50
+
51
+ | Link | Result |
52
+ |---|---|
53
+ | x.com/jack/status/20 | `./tweets/tweet-jack-20.png` |
54
+ | x.com/foo/status/123 | failed — deleted (`TWEET_NOT_FOUND`) |
55
+
56
+ Mention `warnings` only if present (e.g. avatar or media could not be downloaded, so a
57
+ placeholder was used). Repost and view counts are not available from X and are never shown.
@@ -1,81 +0,0 @@
1
- # Multi-platform Layout Family (default create path)
2
-
3
- **SoT for creating templates that ship on several platforms at once.**
4
- One user-facing **Layout Family**; one **master** canvas page; additional **variant** pages per aspect preset. Studio switches variants with platform chips — it does not resize one AST (ADR-0033).
5
-
6
- Single-page ≠ single-platform. Still never create slideshow/carousel packs (`OUT_OF_SCOPE.md`).
7
-
8
- ## Default when the user asks to create a template
9
-
10
- Unless they explicitly want **one platform only**:
11
-
12
- 1. Lock a **master** platform + recommended canvas (`PLATFORM_SPECS.md`).
13
- 2. Create the master draft (Family is created with it).
14
- 3. **Derive** missing vertical presets for the family.
15
- 4. **Hand-tune** each variant’s absolute layout (do not ship raw derive output for dense pages).
16
- 5. Visual-QA master + each variant, then hand off Studio with chip switching.
17
-
18
- ### Default vertical bucket (most social covers)
19
-
20
- | Role | Preset | Pixels | Platforms on that variant |
21
- |---|---|---|---|
22
- | Master (typical) | `3:4` | 1080×1440 | `xiaohongshu` |
23
- | Variant | `4:5` | 1080×1350 | `instagram` + `threads` (shared tree) |
24
- | Variant | `9:16` | 1080×1920 | `tiktok` |
25
- | Variant | `1:1` | 1080×1080 | `linkedin` |
26
-
27
- If the user’s primary platform is already `4:5` / `9:16` / `1:1`, that page is master; derive the other presets in the bucket (see Gateway `defaultDerivePolicyForPreset`).
28
-
29
- Skip or trim targets only when the user names a subset (“只要 IG 和 LinkedIn”).
30
-
31
- ## CLI
32
-
33
- ```bash
34
- # After create-draft, read familyId from the draft view (or families list)
35
- easysociable templates families get --id <familyId> --json
36
-
37
- # Create missing presets (idempotent; use --presets to limit)
38
- easysociable templates families derive --id <familyId> --presets 4:5,9:16,1:1 --json
39
-
40
- # Hand-tuned layout per variant pageId
41
- easysociable templates update-draft --id <variantPageId> --file ./variant-4x5.patch.json --json
42
- ```
43
-
44
- Gateway equivalents: `GET/POST /v1/template-families/:id`, `POST /v1/template-families/:id/derive`.
45
-
46
- If CLI `--json` fails Zod on new family fields (`familyId`, `variants`, …) but HTTP succeeded, re-fetch with `families get` / `list-drafts` or raw Gateway — do not assume create/derive failed.
47
-
48
- ## Hand-tune rules (required after derive)
49
-
50
- `derive` applies pin `v1_vertical` (scale + bottom/center corrections). That is a **starting point**, not shippable layout for dense covers.
51
-
52
- For **each** variant page:
53
-
54
- 1. Keep the **same slots / copy / icons** as master (same `data-variable` keys).
55
- 2. Rebuild absolute geometry for the target `canvas` (`width`/`height` + root Graphic size must match preset pixels).
56
- 3. Distribute vertical rhythm across the full board: even section gaps; **no** packed header + empty foot.
57
- 4. TikTok `9:16`: keep critical UI out of bottom ~120–160px chrome.
58
- 5. JSX styles must be `style={{ ... }}` (double braces). Python f-strings turn `{{` into `{` — validate with Babel/`validate-authoring-source.mjs` before update.
59
- 6. Per-variant `selectionMetadata.platforms` / `canvasPreset` / `canvas` must match that page only (IG+Threads both listed on the `4:5` page).
60
- 7. Theme/preview tokens stay on the **Family** (`preview_tokens` via `theme.create` on draft) — not a TemplateTheme row (`THEME_TOKENS.md`, ADR-0033).
61
-
62
- ```bash
63
- node scripts/validate-authoring-source.mjs ./variant-4x5.authoring.json
64
- easysociable templates update-draft --id <variantPageId> --file ./variant-4x5.patch.json --json
65
- ```
66
-
67
- ## Visual QA
68
-
69
- Run `VISUAL_QA.md` on the **master** and **each derived preset** (screenshot Studio at that draft URL / platform chip). Fail if any variant has clipped content, overlapping bands, or large empty voids with cramped clusters.
70
-
71
- ## Handoff
72
-
73
- After QA, open the **master** Studio URL and tell the user they can switch platforms with the top-bar chips (each chip is a real canvas variant). Save still applies to the active variant; Agent publish remains post-Save (`PUBLISH_FROM_DRAFT.md`). Include every variant `pageId` + preset in the handoff notes.
74
-
75
- ## Do not
76
-
77
- - Author one AST and claim it fits 3:4 + 9:16 + 1:1
78
- - Leave dense pages on raw derive output
79
- - Put Instagram and Threads on different presets when both are 4:5
80
- - Create a second Family for the same template identity
81
- - Treat multi-platform variants as a slideshow / carousel pack