@installagent/sdk 0.1.0 → 0.2.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.
- package/dist/agent-templates.d.ts +36 -2
- package/dist/agent-templates.js +173 -3
- package/dist/client-linear-create.d.ts +26 -0
- package/dist/client-linear-create.js +46 -0
- package/dist/client-linear.d.ts +28 -9
- package/dist/client-linear.js +36 -14
- package/dist/docs-search.d.ts +19 -6
- package/dist/docs-search.js +32 -11
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.js +126 -23
- package/dist/env-fill.d.ts +13 -0
- package/dist/env-fill.js +34 -9
- package/dist/env-push.d.ts +3 -0
- package/dist/env-push.js +11 -6
- package/dist/env-registry.d.ts +25 -0
- package/dist/env-registry.js +69 -7
- package/dist/exec.js +15 -2
- package/dist/index.d.ts +14 -6
- package/dist/index.js +14 -6
- package/dist/linear-project.d.ts +2 -2
- package/dist/linear-project.js +2 -2
- package/dist/log.d.ts +28 -0
- package/dist/log.js +73 -0
- package/dist/n8n-executions.d.ts +85 -0
- package/dist/n8n-executions.js +259 -0
- package/dist/op-cli.d.ts +29 -0
- package/dist/op-cli.js +52 -0
- package/dist/platform.d.ts +35 -0
- package/dist/platform.js +39 -0
- package/dist/portal-admin.d.ts +40 -0
- package/dist/portal-admin.js +30 -0
- package/dist/standup.d.ts +88 -0
- package/dist/standup.js +235 -0
- package/dist/sync-repos.d.ts +47 -0
- package/dist/sync-repos.js +80 -0
- package/dist/template-sync.d.ts +10 -0
- package/dist/template-sync.js +11 -0
- package/dist/wizard.d.ts +15 -0
- package/dist/wizard.js +35 -56
- package/dist/workspace-docs.d.ts +44 -0
- package/dist/workspace-docs.js +73 -0
- package/package.json +2 -2
- package/templates/env.example +33 -23
- package/templates/workspace-root/AGENT.md +7 -5
- package/templates/workspace-root/ONBOARDING.md +65 -8
- package/templates/workspace-root/skills/.github/workflows/pr-to-slack.yml +102 -0
- package/templates/workspace-root/skills/CLAUDE.md +24 -6
- package/templates/workspace-root/skills/README.md +156 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/SKILL.md +293 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/backtest-acceptance-gates-guide.pdf +0 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/references/evidence-record-template.md +128 -0
- package/templates/workspace-root/skills/backtest-acceptance-gates/references/harness-checklist.md +90 -0
- package/templates/workspace-root/skills/client-latest/SKILL.md +301 -0
- package/templates/workspace-root/skills/client-latest/catchup.command.md +17 -0
- package/templates/workspace-root/skills/cloud-devops/SKILL.md +235 -0
- package/templates/workspace-root/skills/email-triage-rollout/SKILL.md +181 -0
- package/templates/workspace-root/skills/gcloud-cli-setup/SKILL.md +100 -0
- package/templates/workspace-root/skills/google-chat-app-setup/SKILL.md +136 -0
- package/templates/workspace-root/skills/google-chat-app-setup/google-chat-app-setup-guide.pdf +0 -0
- package/templates/workspace-root/skills/house-voice/SKILL.md +80 -4
- package/templates/workspace-root/skills/ia-cli/SKILL.md +19 -6
- package/templates/workspace-root/skills/installagent-brand-kit/SKILL.md +59 -10
- package/templates/workspace-root/skills/installagent-brand-kit/assets/installagent-deck-template.pptx +0 -0
- package/templates/workspace-root/skills/installagent-brand-kit/references/deck-guide.md +181 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/deck.py +652 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/deck_lint.py +201 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/logo_raster.py +102 -0
- package/templates/workspace-root/skills/installagent-brand-kit/scripts/make_deck_template.py +290 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/SKILL.md +379 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/references/schema-discovery-soql.md +153 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/references/snapshot-storage.md +122 -0
- package/templates/workspace-root/skills/salesforce-api-snapshot/salesforce-api-snapshot-guide.pdf +0 -0
- package/templates/workspace-root/skills/slack-voice/SKILL.md +158 -0
- package/templates/workspace-root/skills/sso-gated-client-app/SKILL.md +337 -0
- package/templates/workspace-root/skills/sso-gated-client-app/sso-gated-client-app-guide.pdf +0 -0
- package/templates/workspace-root/skills/tech-call-prep/SKILL.md +146 -47
- package/templates/workspace-root/skills/vendor-feed-ingestion/SKILL.md +323 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/references/delivery-contract-template.md +110 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/references/feed-guards.md +134 -0
- package/templates/workspace-root/skills/vendor-feed-ingestion/vendor-feed-ingestion-guide.pdf +0 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Brand + geometry gate for a generated deck. Run it before you hand one over.
|
|
3
|
+
|
|
4
|
+
python deck_lint.py deck.pptx # errors and warnings
|
|
5
|
+
python deck_lint.py deck.pptx --render # also render every slide to PNG
|
|
6
|
+
|
|
7
|
+
Every check here exists because the mistake it catches actually shipped into a
|
|
8
|
+
draft once. It reads the raw OOXML rather than trusting the generator, because
|
|
9
|
+
the generator is the thing under suspicion.
|
|
10
|
+
|
|
11
|
+
Exit status: 0 clean (warnings allowed), 1 one or more errors, 2 bad usage.
|
|
12
|
+
|
|
13
|
+
Scope: brand and rendering only. It cannot tell you whether a slide's claims
|
|
14
|
+
are TRUE — check every number and status word against a source file yourself.
|
|
15
|
+
"""
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import collections
|
|
19
|
+
import re
|
|
20
|
+
import subprocess
|
|
21
|
+
import sys
|
|
22
|
+
import zipfile
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
from pptx.util import Inches
|
|
26
|
+
|
|
27
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
28
|
+
import brand # noqa: E402
|
|
29
|
+
|
|
30
|
+
APPROVED_HEX = {v.lstrip("#").upper() for k, v in vars(brand).items()
|
|
31
|
+
if isinstance(v, str) and re.fullmatch(r"#[0-9a-fA-F]{6}", v)}
|
|
32
|
+
APPROVED_FONTS = {"Hanken Grotesk", "JetBrains Mono"}
|
|
33
|
+
|
|
34
|
+
# Glyphs that silently vanish or box-out in common Slides/Office font stacks.
|
|
35
|
+
# Draw a shape instead. (✓ → ⚠ ✕ ● ★ ◌ ▸ are all safe.)
|
|
36
|
+
RISKY_GLYPHS = "▮▯▰▱◧◨⬛⬜⯀⯁⌀␣⎋⌘⏎␍"
|
|
37
|
+
|
|
38
|
+
SLIDE_W, SLIDE_H = 12192000, 6858000 # 13.333 x 7.5in in EMU
|
|
39
|
+
TOLERANCE = 9525 # 0.75pt of slop
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Report:
|
|
43
|
+
def __init__(self):
|
|
44
|
+
self.errors: list[str] = []
|
|
45
|
+
self.warnings: list[str] = []
|
|
46
|
+
|
|
47
|
+
def error(self, msg):
|
|
48
|
+
self.errors.append(msg)
|
|
49
|
+
|
|
50
|
+
def warn(self, msg):
|
|
51
|
+
self.warnings.append(msg)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def lint(path: Path, *, render: bool = False) -> Report:
|
|
55
|
+
from pptx import Presentation
|
|
56
|
+
|
|
57
|
+
r = Report()
|
|
58
|
+
prs = Presentation(str(path))
|
|
59
|
+
|
|
60
|
+
# ── slide size ────────────────────────────────────────────────────────
|
|
61
|
+
if (prs.slide_width, prs.slide_height) != (SLIDE_W, SLIDE_H):
|
|
62
|
+
r.error(f"slide size is {prs.slide_width}x{prs.slide_height} EMU; "
|
|
63
|
+
f"expected 13.333x7.5in ({SLIDE_W}x{SLIDE_H}) so Google Slides "
|
|
64
|
+
f"converts without rescaling")
|
|
65
|
+
|
|
66
|
+
# ── per-slide geometry, logo, density ─────────────────────────────────
|
|
67
|
+
for i, s in enumerate(prs.slides, 1):
|
|
68
|
+
words = 0
|
|
69
|
+
pics = 0
|
|
70
|
+
for sh in s.shapes:
|
|
71
|
+
if sh.shape_type == 13:
|
|
72
|
+
pics += 1
|
|
73
|
+
if sh.has_text_frame:
|
|
74
|
+
words += len(sh.text_frame.text.split())
|
|
75
|
+
if sh.left is None or sh.width is None:
|
|
76
|
+
continue
|
|
77
|
+
# A rule is a filled shape one dimension thin. Under 12700 EMU it
|
|
78
|
+
# renders on screen and vanishes on a projector — the gantt
|
|
79
|
+
# gridlines were invisible this way. Ignore genuinely empty frames.
|
|
80
|
+
thin = min(sh.width, sh.height)
|
|
81
|
+
if 0 < thin < 12700 and max(sh.width, sh.height) > Inches(0.2):
|
|
82
|
+
r.warn(f"slide {i}: rule only {thin} EMU thick — under 12700 "
|
|
83
|
+
f"it disappears on a projector")
|
|
84
|
+
if (sh.left < -TOLERANCE or sh.top < -TOLERANCE
|
|
85
|
+
or sh.left + sh.width > SLIDE_W + TOLERANCE
|
|
86
|
+
or sh.top + sh.height > SLIDE_H + TOLERANCE):
|
|
87
|
+
label = (sh.text_frame.text[:40].replace("\n", " ")
|
|
88
|
+
if sh.has_text_frame else str(sh.shape_type))
|
|
89
|
+
r.error(f"slide {i}: shape out of bounds — {label!r} "
|
|
90
|
+
f"(right={(sh.left + sh.width) / 914400:.2f}in, "
|
|
91
|
+
f"bottom={(sh.top + sh.height) / 914400:.2f}in)")
|
|
92
|
+
if pics == 0:
|
|
93
|
+
r.error(f"slide {i}: no logo — the cover carries the full lockup, "
|
|
94
|
+
f"every other slide the icon mark")
|
|
95
|
+
if words > 180:
|
|
96
|
+
r.warn(f"slide {i}: {words} words. A deck is presented, not read — "
|
|
97
|
+
f"push prose into the speaker's mouth or a diagram")
|
|
98
|
+
|
|
99
|
+
# ── raw XML: colour, type, line weight, glyphs, hard breaks ───────────
|
|
100
|
+
z = zipfile.ZipFile(path)
|
|
101
|
+
colours: collections.Counter = collections.Counter()
|
|
102
|
+
fonts: collections.Counter = collections.Counter()
|
|
103
|
+
for name in z.namelist():
|
|
104
|
+
if not re.fullmatch(r"ppt/slides/slide\d+\.xml", name):
|
|
105
|
+
continue
|
|
106
|
+
slide_no = re.search(r"slide(\d+)", name).group(1)
|
|
107
|
+
xml = z.read(name).decode("utf-8")
|
|
108
|
+
|
|
109
|
+
for hexval in re.findall(r'srgbClr val="([0-9A-Fa-f]{6})"', xml):
|
|
110
|
+
up = hexval.upper()
|
|
111
|
+
colours[up] += 1
|
|
112
|
+
if up not in APPROVED_HEX:
|
|
113
|
+
r.error(f"slide {slide_no}: off-brand colour #{up} — every "
|
|
114
|
+
f"colour must come from brand.py. Red is the only hue; "
|
|
115
|
+
f"carry semantics with glyphs and fill weight instead")
|
|
116
|
+
|
|
117
|
+
for face in re.findall(r'typeface="([^"]+)"', xml):
|
|
118
|
+
fonts[face] += 1
|
|
119
|
+
if face not in APPROVED_FONTS:
|
|
120
|
+
r.error(f"slide {slide_no}: off-brand typeface {face!r} — "
|
|
121
|
+
f"use Hanken Grotesk (body) or JetBrains Mono (labels)")
|
|
122
|
+
|
|
123
|
+
for text in re.findall(r"<a:t>(.*?)</a:t>", xml, re.S):
|
|
124
|
+
if "\n" in text or "\x0b" in text:
|
|
125
|
+
r.error(f"slide {slide_no}: hard line break inside a run "
|
|
126
|
+
f"({text[:30]!r}...) — renderers disagree on whether it "
|
|
127
|
+
f"breaks. Use a second paragraph or let it wrap")
|
|
128
|
+
for g in RISKY_GLYPHS:
|
|
129
|
+
if g in text:
|
|
130
|
+
r.error(f"slide {slide_no}: glyph {g!r} does not resolve in "
|
|
131
|
+
f"every font stack — draw a shape instead")
|
|
132
|
+
|
|
133
|
+
if not colours:
|
|
134
|
+
r.warn("no explicit colours found — is the deck actually styled?")
|
|
135
|
+
|
|
136
|
+
# ── optional: eyeball it, because geometry checks miss composition ────
|
|
137
|
+
if render:
|
|
138
|
+
_render(path, r, len(prs.slides))
|
|
139
|
+
|
|
140
|
+
return r
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def _render(path: Path, r: Report, count: int) -> None:
|
|
144
|
+
"""Render each slide to PNG via macOS Quick Look.
|
|
145
|
+
|
|
146
|
+
qlmanage only ever previews slide 1, so split the deck into one file per
|
|
147
|
+
slide first. This is the only local way to actually LOOK at a pptx without
|
|
148
|
+
LibreOffice, and it catches what no geometry check can: collisions,
|
|
149
|
+
unbalanced whitespace, a shape covering half the page.
|
|
150
|
+
"""
|
|
151
|
+
from pptx import Presentation
|
|
152
|
+
|
|
153
|
+
out = path.parent / f"{path.stem}-render"
|
|
154
|
+
out.mkdir(exist_ok=True)
|
|
155
|
+
tmp = out / "_split"
|
|
156
|
+
tmp.mkdir(exist_ok=True)
|
|
157
|
+
for i in range(count):
|
|
158
|
+
prs = Presentation(str(path))
|
|
159
|
+
lst = prs.slides._sldIdLst
|
|
160
|
+
for j, sld in enumerate(list(lst)):
|
|
161
|
+
if j != i:
|
|
162
|
+
lst.remove(sld)
|
|
163
|
+
one = tmp / f"s{i + 1:02d}.pptx"
|
|
164
|
+
prs.save(str(one))
|
|
165
|
+
try:
|
|
166
|
+
subprocess.run(["qlmanage", "-t", "-s", "1500", "-o", str(out),
|
|
167
|
+
str(one)], check=True, capture_output=True)
|
|
168
|
+
except (FileNotFoundError, subprocess.CalledProcessError):
|
|
169
|
+
r.warn("qlmanage unavailable — could not render slides for visual "
|
|
170
|
+
"review. Geometry is checked, composition is not")
|
|
171
|
+
return
|
|
172
|
+
print(f"rendered {count} slides → {out}")
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def main() -> int:
|
|
176
|
+
args = [a for a in sys.argv[1:]]
|
|
177
|
+
render = "--render" in args
|
|
178
|
+
args = [a for a in args if not a.startswith("--")]
|
|
179
|
+
if len(args) != 1:
|
|
180
|
+
print(__doc__)
|
|
181
|
+
return 2
|
|
182
|
+
path = Path(args[0])
|
|
183
|
+
if not path.exists():
|
|
184
|
+
print(f"no such file: {path}")
|
|
185
|
+
return 2
|
|
186
|
+
|
|
187
|
+
r = lint(path, render=render)
|
|
188
|
+
for w in r.warnings:
|
|
189
|
+
print(f" warn {w}")
|
|
190
|
+
for e in r.errors:
|
|
191
|
+
print(f" ERROR {e}")
|
|
192
|
+
if r.errors:
|
|
193
|
+
print(f"\n{len(r.errors)} error(s), {len(r.warnings)} warning(s) — "
|
|
194
|
+
f"do not ship this deck")
|
|
195
|
+
return 1
|
|
196
|
+
print(f"deck-lint: clean ({len(r.warnings)} warning(s))")
|
|
197
|
+
return 0
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
if __name__ == "__main__":
|
|
201
|
+
sys.exit(main())
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Rasterise the official logo SVGs to PNG for embedding in .pptx/.docx.
|
|
2
|
+
|
|
3
|
+
python-pptx cannot embed SVG, so any generated deck needs a raster copy of the
|
|
4
|
+
official marks. This module is the ONE place that conversion happens — so a
|
|
5
|
+
generator never re-draws the logo, and never ships a screenshot of it.
|
|
6
|
+
|
|
7
|
+
Output is cached in the system temp dir keyed by the SVG's mtime, so the skill
|
|
8
|
+
directory stays clean and a rebuild is instant.
|
|
9
|
+
|
|
10
|
+
Route notes (learned the hard way on macOS):
|
|
11
|
+
· reportlab's renderPM needs `rlPyCairo`/cairo, which is often absent — so we
|
|
12
|
+
try it, then fall back to SVG → PDF (renderPDF, pure python) → PNG (`sips`,
|
|
13
|
+
built into macOS).
|
|
14
|
+
· The logo is scaled 12x and padded before rasterising: the padding satisfies
|
|
15
|
+
the brand's clear-space rule, and the upscale keeps it crisp on a projector.
|
|
16
|
+
"""
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
import os
|
|
20
|
+
import subprocess
|
|
21
|
+
import tempfile
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
import brand
|
|
25
|
+
|
|
26
|
+
SCALE = 12 # render multiplier — a 1844px-wide lockup, crisp at any size
|
|
27
|
+
PAD_FRAC = 0.06 # clear space as a fraction of the artwork's longest edge
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _cache_dir() -> Path:
|
|
31
|
+
d = Path(tempfile.gettempdir()) / "installagent-brand-raster"
|
|
32
|
+
d.mkdir(parents=True, exist_ok=True)
|
|
33
|
+
return d
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _svg_to_png(svg: Path, out: Path) -> None:
|
|
37
|
+
from svglib.svglib import svg2rlg
|
|
38
|
+
from reportlab.graphics.shapes import Group, Drawing
|
|
39
|
+
|
|
40
|
+
art = svg2rlg(str(svg))
|
|
41
|
+
if art is None:
|
|
42
|
+
raise RuntimeError(f"svglib could not parse {svg}")
|
|
43
|
+
|
|
44
|
+
pad = PAD_FRAC * max(art.width, art.height)
|
|
45
|
+
g = Group(art)
|
|
46
|
+
g.translate(pad, pad)
|
|
47
|
+
g.scale(SCALE, SCALE)
|
|
48
|
+
# the Group's transform applies to the child, so the canvas must account
|
|
49
|
+
# for both the scale and the (unscaled) padding we translated by
|
|
50
|
+
d = Drawing((art.width + 2 * pad) * SCALE, (art.height + 2 * pad) * SCALE)
|
|
51
|
+
d.add(g)
|
|
52
|
+
|
|
53
|
+
try: # preferred: direct raster
|
|
54
|
+
from reportlab.graphics import renderPM
|
|
55
|
+
renderPM.drawToFile(d, str(out), fmt="PNG", bg=0xFFFFFF)
|
|
56
|
+
return
|
|
57
|
+
except Exception: # no cairo — go via PDF
|
|
58
|
+
pass
|
|
59
|
+
|
|
60
|
+
from reportlab.graphics import renderPDF
|
|
61
|
+
pdf = out.with_suffix(".pdf")
|
|
62
|
+
renderPDF.drawToFile(d, str(pdf))
|
|
63
|
+
if not _pdf_to_png(pdf, out):
|
|
64
|
+
raise RuntimeError(
|
|
65
|
+
"Could not rasterise the logo. renderPM has no cairo backend and no "
|
|
66
|
+
"PDF→PNG converter was found. Install `rlPyCairo` (pip install "
|
|
67
|
+
"rlPyCairo) or run on macOS where `sips` is available."
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _pdf_to_png(pdf: Path, out: Path) -> bool:
|
|
72
|
+
for cmd in (["sips", "-s", "format", "png", str(pdf), "--out", str(out)],
|
|
73
|
+
["pdftoppm", "-png", "-r", "300", "-singlefile",
|
|
74
|
+
str(pdf), str(out.with_suffix(""))]):
|
|
75
|
+
try:
|
|
76
|
+
subprocess.run(cmd, check=True, capture_output=True)
|
|
77
|
+
return out.exists()
|
|
78
|
+
except (FileNotFoundError, subprocess.CalledProcessError):
|
|
79
|
+
continue
|
|
80
|
+
return False
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _get(svg: Path, name: str) -> Path:
|
|
84
|
+
out = _cache_dir() / f"{name}-{int(svg.stat().st_mtime)}.png"
|
|
85
|
+
if not out.exists():
|
|
86
|
+
_svg_to_png(svg, out)
|
|
87
|
+
return out
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def lockup() -> Path:
|
|
91
|
+
"""Full wordmark + icon. Use once, on the cover."""
|
|
92
|
+
return _get(brand.LOGO_PATH, "lockup")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def mark() -> Path:
|
|
96
|
+
"""Icon only. Use in the running header of every other slide."""
|
|
97
|
+
return _get(brand.MARK_PATH, "mark")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if __name__ == "__main__":
|
|
101
|
+
for f in (lockup(), mark()):
|
|
102
|
+
print(f"{f} ({os.path.getsize(f) // 1024} KB)")
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Regenerate assets/installagent-deck-template.pptx.
|
|
3
|
+
|
|
4
|
+
The template is GENERATED, never hand-edited — that way it cannot drift from
|
|
5
|
+
theme.css. Run this after any change to brand.py or deck.py:
|
|
6
|
+
|
|
7
|
+
python make_deck_template.py && python deck_lint.py \\
|
|
8
|
+
../assets/installagent-deck-template.pptx
|
|
9
|
+
|
|
10
|
+
It produces one example slide per archetype (duplicate the one you want in
|
|
11
|
+
Google Slides and type over it) and patches the file's **theme** so the Slides
|
|
12
|
+
theme editor, and any new text box a human adds, inherits Install Agent type
|
|
13
|
+
and colour instead of Calibri and Office blue.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import re
|
|
18
|
+
import shutil
|
|
19
|
+
import sys
|
|
20
|
+
import zipfile
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
24
|
+
|
|
25
|
+
import brand # noqa: E402
|
|
26
|
+
from deck import (Deck, RED, RED_SIG, MUTED, INK, BODY, FAINT, # noqa: E402
|
|
27
|
+
WHITE, SOFT, L, CW, Inches)
|
|
28
|
+
|
|
29
|
+
OUT = Path(__file__).resolve().parent.parent / "assets" / "installagent-deck-template.pptx"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
33
|
+
# 1 · the example slides
|
|
34
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
35
|
+
def build(path: Path) -> None:
|
|
36
|
+
d = Deck(client="Client Name", date="1 Jan 2026", total=10)
|
|
37
|
+
|
|
38
|
+
# 1 · cover
|
|
39
|
+
d.cover("CLIENT NAME", "The one sentence this meeting has to settle",
|
|
40
|
+
"Attendees, comma separated 1 January 2026 · 60 minutes",
|
|
41
|
+
outcomes=[
|
|
42
|
+
("The first outcome", "what agreement looks like, in their words"),
|
|
43
|
+
("The second outcome", "a number they can plan against"),
|
|
44
|
+
("The third outcome", "what you need from them, with an owner"),
|
|
45
|
+
],
|
|
46
|
+
note="Replace every word on this slide — nothing here is real")
|
|
47
|
+
|
|
48
|
+
# 2 · how to use it
|
|
49
|
+
s = d.slide("00 · read me first", "How to use this template",
|
|
50
|
+
"Duplicate the slide whose shape fits your point. Delete the rest. Do not restyle anything.")
|
|
51
|
+
d.tiles(s, [
|
|
52
|
+
("→", "Duplicate, don't create",
|
|
53
|
+
"Build from scratch and you lose the type and spacing.",
|
|
54
|
+
"IN GOOGLE SLIDES", False),
|
|
55
|
+
("→", "One idea per slide",
|
|
56
|
+
"Two paragraphs means two slides — or the agenda.",
|
|
57
|
+
"WRITING RULE", False),
|
|
58
|
+
("⚠", "Red is the only hue",
|
|
59
|
+
"Never blue, green or amber. Meaning rides on ✓ → ⚠ ✕ and weight.",
|
|
60
|
+
"HARD RULE", True),
|
|
61
|
+
("⚠", "Deep red primary, signal red alarms",
|
|
62
|
+
"The brighter red means attention. It is not decoration.",
|
|
63
|
+
"HARD RULE", True),
|
|
64
|
+
("→", "Scripted decks import brand.py",
|
|
65
|
+
"Never type a hex. Starter script in the guide.",
|
|
66
|
+
"IF SCRIPTING", False),
|
|
67
|
+
("✓", "Lint before you send",
|
|
68
|
+
"deck_lint.py reads the XML, not your intentions.",
|
|
69
|
+
"EVERY TIME", False),
|
|
70
|
+
], cols=3, h=Inches(1.72))
|
|
71
|
+
d.callout(s, "This template governs brand and layout only.",
|
|
72
|
+
"Whether a slide's numbers and status words are TRUE is on you — "
|
|
73
|
+
"check each one against a source file before it leaves the building.")
|
|
74
|
+
|
|
75
|
+
# 3 · pipeline + progression
|
|
76
|
+
s = d.slide("01 · how it works", "A process, as four boxes",
|
|
77
|
+
"Use for anything sequential: a pipeline, a handoff, a lifecycle.")
|
|
78
|
+
d.pipeline(s, [
|
|
79
|
+
("stage", "First step", "One clause of detail"),
|
|
80
|
+
("stage", "Second step", "One clause of detail"),
|
|
81
|
+
("stage", "Third step", "One clause of detail"),
|
|
82
|
+
("stage", "Fourth step", "The one you want them to look at"),
|
|
83
|
+
], accent=3)
|
|
84
|
+
d.ladder(s, [("Earliest state", "date or phase", False),
|
|
85
|
+
("Middle state", "date or phase", False),
|
|
86
|
+
("Where we are now", "date or phase", True)],
|
|
87
|
+
label="Use the ladder for progressive autonomy or maturity")
|
|
88
|
+
d.callout(s, "The sentence you want them to repeat back to you.",
|
|
89
|
+
"One supporting clause, no more.")
|
|
90
|
+
|
|
91
|
+
# 4 · priority cards
|
|
92
|
+
s = d.slide("02 · the plan", "Ranked work, as cards",
|
|
93
|
+
"Four is the maximum. A fifth card makes every card unreadable.")
|
|
94
|
+
d.cards(s, [
|
|
95
|
+
("1", "First build", "What it does, in the client's language, in about "
|
|
96
|
+
"two lines of plain English.", "✓ STARTING TODAY", "active"),
|
|
97
|
+
("2", "Second build", "What it does. Say what it will NOT do, if that "
|
|
98
|
+
"is the thing they fear.", "BUILT · GATED", "neutral"),
|
|
99
|
+
("3", "Third build", "What it does, and the one condition it is "
|
|
100
|
+
"waiting on.", "✓ READY", "ready"),
|
|
101
|
+
("4", "Fourth build", "Unchanged, still in scope, sequenced behind "
|
|
102
|
+
"the above.", "QUEUED", "queued"),
|
|
103
|
+
])
|
|
104
|
+
d.question_band(s, "The one question on this slide:",
|
|
105
|
+
"phrase it so the answer is a decision, not a discussion")
|
|
106
|
+
|
|
107
|
+
# 5 · flow with a cut step + evidence
|
|
108
|
+
s = d.slide("03 · what changed", "A flow with one step removed",
|
|
109
|
+
"For a descope: show what survives, so the cut reads as focus rather than retreat.")
|
|
110
|
+
d.flow(s, [("step 1", "What starts it", "Trigger"),
|
|
111
|
+
("step 2", "What it finds", "Lookup"),
|
|
112
|
+
("step 3", "The part being cut", "Now: a person decides"),
|
|
113
|
+
("step 4", "What still happens", "Action + notify")], cut=2)
|
|
114
|
+
cy = s.y
|
|
115
|
+
d.card(s.s, L, cy, Inches(6.1), Inches(2.5), fill=SOFT, line=None)
|
|
116
|
+
d.kicker(s.s, L + Inches(0.28), cy + Inches(0.22), "Why", w=Inches(5.5))
|
|
117
|
+
tfw = d.tb(s.s, L + Inches(0.28), cy + Inches(0.56), Inches(5.54), Inches(1.8))
|
|
118
|
+
d.para(tfw, "“The quote that made the decision.”", 17, INK, bold=True,
|
|
119
|
+
italic=True, first=True, space_after=8)
|
|
120
|
+
d.para(tfw, "Two lines on the reasoning, in their terms rather than yours.",
|
|
121
|
+
11.5, BODY, space_after=0, line_spacing=1.02)
|
|
122
|
+
d.card(s.s, Inches(7.02), cy, Inches(5.6), Inches(2.5))
|
|
123
|
+
d.kicker(s.s, Inches(7.3), cy + Inches(0.22), "What survives", w=Inches(5.0))
|
|
124
|
+
for i, (big, small) in enumerate([("48", "tests green"),
|
|
125
|
+
("17/17", "cases correct"),
|
|
126
|
+
("0", "wrong actions")]):
|
|
127
|
+
d.stat(s.s, Inches(7.3) + i * Inches(1.78), cy + Inches(0.62),
|
|
128
|
+
Inches(1.7), big, small)
|
|
129
|
+
d.para(d.tb(s.s, Inches(7.3), cy + Inches(1.96), Inches(5.04), Inches(0.5)),
|
|
130
|
+
"Say what the numbers were measured against. A metric with no "
|
|
131
|
+
"stated basis is a liability.", 10.5, MUTED, first=True,
|
|
132
|
+
space_after=0)
|
|
133
|
+
|
|
134
|
+
# 6 · gantt
|
|
135
|
+
s = d.slide("04 · timelines", "Duration, not dates",
|
|
136
|
+
"Ranges beat dates when the dates depend on the client. Say what each stage produces.")
|
|
137
|
+
d.gantt(s, [("Design", "What they approve before you build", 0, 2, 4),
|
|
138
|
+
("Prototype", "On invented data — nothing real at risk", 2, 4, 8),
|
|
139
|
+
("Shadow", "It proposes, a person decides", 6, 5, 10),
|
|
140
|
+
("Production", "Live on the confident cases only", 11, 3, 5)],
|
|
141
|
+
days=20, attention="Shadow")
|
|
142
|
+
d.callout(s, "Translate the chart into one sentence per build.",
|
|
143
|
+
"“X: days after the gate. Y: weeks from signature. Z: starting now.”")
|
|
144
|
+
|
|
145
|
+
# 7 · tiles
|
|
146
|
+
s = d.slide("05 · what we need", "Asks, as a tile grid",
|
|
147
|
+
"Three or four columns. Tint and thicken the ones that are genuinely blocking.")
|
|
148
|
+
d.tiles(s, [
|
|
149
|
+
("⚠", "A blocking ask", "Why it blocks, in one line. Name what it "
|
|
150
|
+
"unlocks, not what it is.", "OWNER — VERB", True),
|
|
151
|
+
("⚠", "A second blocker", "Two or three blockers is credible. Six "
|
|
152
|
+
"means nothing is blocking.", "OWNER — VERB", True),
|
|
153
|
+
("→", "An in-flight item", "Who is on it and when it lands.",
|
|
154
|
+
"OWNER", False),
|
|
155
|
+
("→", "A question", "Asked, not yet answered.", "OWNER, TODAY", False),
|
|
156
|
+
("→", "A small ask", "Cheap to grant. Put it next to an expensive "
|
|
157
|
+
"one.", "OWNER", False),
|
|
158
|
+
("→", "Another question", "One line only.", "OWNER", False),
|
|
159
|
+
("→", "A decision you owe them", "Say so plainly when the ball is on "
|
|
160
|
+
"your side.", "WE PROPOSE", False),
|
|
161
|
+
("✓", "Something already agreed", "Closing on a ✓ leaves the grid "
|
|
162
|
+
"feeling tractable.", "DONE TODAY", False),
|
|
163
|
+
], cols=4)
|
|
164
|
+
|
|
165
|
+
# 8 · decisions
|
|
166
|
+
s = d.slide("06 · decisions", "Decisions, each with its default",
|
|
167
|
+
"The default is the point: it shows what happens through inaction, so silence stops being free.")
|
|
168
|
+
d.decisions(s, [
|
|
169
|
+
("A decision phrased as a question?", "What we do by ourselves."),
|
|
170
|
+
("A second decision?", "The default, stated without drama."),
|
|
171
|
+
("A third decision?", "Defaults should be true, not scary."),
|
|
172
|
+
("A fourth decision?", "If a default is fine, cut the decision."),
|
|
173
|
+
("A fifth decision?", "Six is the ceiling for one slide."),
|
|
174
|
+
("A sixth decision?", "Beyond six, split across two slides."),
|
|
175
|
+
])
|
|
176
|
+
|
|
177
|
+
# 9 · chat mock + side panel
|
|
178
|
+
s = d.slide("07 · a demo without a screenshot",
|
|
179
|
+
"Show the thing working, drawn not captured",
|
|
180
|
+
"A drawn mock stays legible on a projector and carries no real data. Label it as an example.")
|
|
181
|
+
rx = d.chat(s, channel="Surface · channel name",
|
|
182
|
+
question="“The question a real user would type.”",
|
|
183
|
+
answer="The answer, at the length it really comes back at. If "
|
|
184
|
+
"you invented it, the label in the corner says so.",
|
|
185
|
+
citation="SOURCE · PAGE 12",
|
|
186
|
+
fallback=("Not confident? ",
|
|
187
|
+
"What it does instead — never a dead end."))
|
|
188
|
+
rw = CW - (rx - L)
|
|
189
|
+
d.card(s.s, rx, s.y, rw, Inches(3.6), fill=SOFT, line=None)
|
|
190
|
+
d.stat(s.s, rx + Inches(0.3), s.y + Inches(0.26), rw - Inches(0.6), "25/25",
|
|
191
|
+
"what was measured · and what it means", size=32)
|
|
192
|
+
d.rule(s.s, rx + Inches(0.3), s.y + Inches(1.28), rw - Inches(0.6))
|
|
193
|
+
d.kicker(s.s, rx + Inches(0.3), s.y + Inches(1.46), "To switch it on",
|
|
194
|
+
w=rw - Inches(0.6))
|
|
195
|
+
tf2 = d.tb(s.s, rx + Inches(0.3), s.y + Inches(1.78), rw - Inches(0.6),
|
|
196
|
+
Inches(1.5))
|
|
197
|
+
for i, (lead, rest) in enumerate([
|
|
198
|
+
("First requirement", "and where it is granted"),
|
|
199
|
+
("Second requirement", "and who grants it"),
|
|
200
|
+
("Nothing else", "— say what you are NOT asking for")]):
|
|
201
|
+
d.runs(tf2, [(lead, INK, True), (" " + rest, BODY, False)], 12,
|
|
202
|
+
first=(i == 0), space_after=9, gap_glyph="✓", glyph_color=RED)
|
|
203
|
+
|
|
204
|
+
# 10 · kanban
|
|
205
|
+
s = d.slide("08 · next steps", "Commitments, bucketed by deadline",
|
|
206
|
+
"Buckets beat dates: nobody argues with “this week”. Every card carries a name.")
|
|
207
|
+
cols = d.kanban(s, [
|
|
208
|
+
("TODAY", RED, [
|
|
209
|
+
(1, "Something you will do before you log off", "US", False),
|
|
210
|
+
(2, "Something you will do with them, live", "US + THEM", False),
|
|
211
|
+
(3, "Something you owe in writing", "US", False),
|
|
212
|
+
(4, "Something to book while everyone is here", "US + THEM", True),
|
|
213
|
+
]),
|
|
214
|
+
("THIS WEEK", RED_SIG, [
|
|
215
|
+
(5, "Their most important action", "THEM", True),
|
|
216
|
+
(6, "Their second action", "THEM", True),
|
|
217
|
+
(7, "A question only they can answer", "THEM", False),
|
|
218
|
+
(8, "A file or export you need", "THEM", False),
|
|
219
|
+
]),
|
|
220
|
+
("LATER, BUT DATED", MUTED, [
|
|
221
|
+
(9, "Work with a real deadline further out", "US + THEM", False),
|
|
222
|
+
(10, "Something you owe a specific person", "US", False),
|
|
223
|
+
]),
|
|
224
|
+
])
|
|
225
|
+
zx, zy, colw = cols[2] # bottom of the shortest column
|
|
226
|
+
zy += Inches(0.1)
|
|
227
|
+
d.card(s.s, zx, zy, colw, Inches(1.86), fill=SOFT, line=None)
|
|
228
|
+
d.kicker(s.s, zx + Inches(0.26), zy + Inches(0.22),
|
|
229
|
+
"And from us, whatever happens", w=colw - Inches(0.52))
|
|
230
|
+
tfz = d.tb(s.s, zx + Inches(0.26), zy + Inches(0.54), colw - Inches(0.52),
|
|
231
|
+
Inches(1.3))
|
|
232
|
+
for i, t in enumerate(["A written recap, same day",
|
|
233
|
+
"A diagram before any build starts",
|
|
234
|
+
"A weekly note whether or not they ask"]):
|
|
235
|
+
d.runs(tfz, [(t, BODY, False)], 11.5, first=(i == 0), space_after=8,
|
|
236
|
+
gap_glyph="→", glyph_color=RED)
|
|
237
|
+
|
|
238
|
+
d.save(path)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
242
|
+
# 2 · patch the OOXML theme, so Slides' own theme editor is on-brand too
|
|
243
|
+
# ═══════════════════════════════════════════════════════════════════════════
|
|
244
|
+
def brand_the_theme(path: Path) -> None:
|
|
245
|
+
"""Rewrite ppt/theme/theme1.xml in place.
|
|
246
|
+
|
|
247
|
+
Without this, the file *looks* right but Google Slides still reports the
|
|
248
|
+
theme as Office/Calibri — so the first text box a human adds by hand comes
|
|
249
|
+
out Calibri in Office blue, and the mistake is back.
|
|
250
|
+
"""
|
|
251
|
+
accents = [brand.BRAND, brand.BRAND_BRIGHT, brand.INK, brand.MUTED,
|
|
252
|
+
brand.FAINT, brand.LINE]
|
|
253
|
+
tmp = path.with_suffix(".tmp.pptx")
|
|
254
|
+
src = zipfile.ZipFile(path)
|
|
255
|
+
with zipfile.ZipFile(tmp, "w", zipfile.ZIP_DEFLATED) as dst:
|
|
256
|
+
for item in src.infolist():
|
|
257
|
+
data = src.read(item.filename)
|
|
258
|
+
if item.filename == "ppt/theme/theme1.xml":
|
|
259
|
+
xml = data.decode("utf-8")
|
|
260
|
+
for i, hexval in enumerate(accents, start=1):
|
|
261
|
+
xml = re.sub(
|
|
262
|
+
rf'(<a:accent{i}>)<a:srgbClr val="[0-9A-Fa-f]{{6}}"/>',
|
|
263
|
+
rf'\g<1><a:srgbClr val="{hexval.lstrip("#").upper()}"/>',
|
|
264
|
+
xml)
|
|
265
|
+
xml = re.sub(r'(<a:dk2>)<a:srgbClr val="[0-9A-Fa-f]{6}"/>',
|
|
266
|
+
rf'\g<1><a:srgbClr val="{brand.INK.lstrip("#").upper()}"/>',
|
|
267
|
+
xml)
|
|
268
|
+
xml = re.sub(r'(<a:lt2>)<a:srgbClr val="[0-9A-Fa-f]{6}"/>',
|
|
269
|
+
rf'\g<1><a:srgbClr val="{brand.SOFT.lstrip("#").upper()}"/>',
|
|
270
|
+
xml)
|
|
271
|
+
for tag in ("hlink", "folHlink"):
|
|
272
|
+
xml = re.sub(
|
|
273
|
+
rf'(<a:{tag}>)<a:srgbClr val="[0-9A-Fa-f]{{6}}"/>',
|
|
274
|
+
rf'\g<1><a:srgbClr val="{brand.BRAND.lstrip("#").upper()}"/>',
|
|
275
|
+
xml)
|
|
276
|
+
xml = re.sub(r'<a:latin typeface="[^"]*"([^/]*)/>',
|
|
277
|
+
r'<a:latin typeface="Hanken Grotesk"\1/>', xml)
|
|
278
|
+
xml = xml.replace('name="Office"', 'name="Install Agent"')
|
|
279
|
+
data = xml.encode("utf-8")
|
|
280
|
+
dst.writestr(item, data)
|
|
281
|
+
src.close()
|
|
282
|
+
shutil.move(tmp, path)
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
if __name__ == "__main__":
|
|
286
|
+
OUT.parent.mkdir(parents=True, exist_ok=True)
|
|
287
|
+
build(OUT)
|
|
288
|
+
brand_the_theme(OUT)
|
|
289
|
+
print(f"wrote {OUT} ({OUT.stat().st_size // 1024} KB)")
|
|
290
|
+
print("now run: python deck_lint.py ../assets/installagent-deck-template.pptx")
|