@rubytech/create-maxy-code 0.1.167 → 0.1.170
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/package.json +1 -1
- package/payload/platform/config/brand.json +1 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +0 -5
- package/payload/platform/plugins/docs/references/platform.md +1 -1
- package/payload/premium-plugins/.claude-plugin/marketplace.json +10 -0
- package/payload/premium-plugins/teaching/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/teaching/PLUGIN.md +58 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/SKILL.md +59 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/assessment.md +70 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +43 -0
- package/payload/premium-plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +83 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/SKILL.md +48 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/references/context-gathering.md +41 -0
- package/payload/premium-plugins/teaching/skills/lesson-planner/references/plan-structure.md +94 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/SKILL.md +52 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/references/disaggregation.md +49 -0
- package/payload/premium-plugins/teaching/skills/study-pack-builder/references/materials.md +116 -0
- package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +17 -0
- package/payload/premium-plugins/writer-craft/PLUGIN.md +130 -0
- package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +96 -0
- package/payload/premium-plugins/writer-craft/mcp/package.json +19 -0
- package/payload/premium-plugins/writer-craft/mcp/scripts/smoke.mjs +152 -0
- package/payload/premium-plugins/writer-craft/mcp/src/index.ts +289 -0
- package/payload/premium-plugins/writer-craft/mcp/src/lib/neo4j.ts +56 -0
- package/payload/premium-plugins/writer-craft/mcp/src/lib/voice-corpus.ts +54 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +303 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +114 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +145 -0
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +117 -0
- package/payload/premium-plugins/writer-craft/mcp/tsconfig.json +8 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/SKILL.md +94 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +77 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/citation-rules.md +103 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/journal-article-models.md +74 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/other-source-models.md +146 -0
- package/payload/premium-plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +70 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/SKILL.md +108 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/copyediting.md +73 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +85 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +78 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/line-editing.md +55 -0
- package/payload/premium-plugins/writer-craft/skills/editorial-practice/references/self-editing.md +89 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +114 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +73 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +76 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +67 -0
- package/payload/premium-plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +86 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/SKILL.md +97 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +72 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +91 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +71 -0
- package/payload/premium-plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +85 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/SKILL.md +100 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +72 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/repetition.md +71 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +64 -0
- package/payload/premium-plugins/writer-craft/skills/prose-craft/references/word-economy.md +93 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/SKILL.md +100 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +79 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +81 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +67 -0
- package/payload/premium-plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +94 -0
- package/payload/premium-plugins/writer-craft/skills/review-manuscript/SKILL.md +111 -0
- package/payload/premium-plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +119 -0
- package/payload/premium-plugins/writer-craft/skills/review-prose/SKILL.md +99 -0
- package/payload/premium-plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +112 -0
- package/payload/premium-plugins/writer-craft/skills/review-scene/SKILL.md +99 -0
- package/payload/premium-plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +95 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/SKILL.md +106 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +118 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +66 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +87 -0
- package/payload/premium-plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +82 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/SKILL.md +133 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +118 -0
- package/payload/premium-plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +128 -0
- package/payload/premium-plugins/writer-craft/skills/voice-mirror/SKILL.md +166 -0
- package/payload/server/{chunk-3TRIXQSJ.js → chunk-L2YK2VK3.js} +17 -29
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/server.js +1 -1
- package/payload/platform/plugins/venture-studio/.claude-plugin/plugin.json +0 -8
- package/payload/platform/plugins/venture-studio/PLUGIN.md +0 -119
- package/payload/platform/plugins/venture-studio/bin/scaffold.sh +0 -116
- package/payload/platform/plugins/venture-studio/skills/brand-pack/SKILL.md +0 -256
- package/payload/platform/plugins/venture-studio/skills/brand-pack/references/color-psychology.md +0 -118
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/SKILL.md +0 -376
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/business-plan-template.md +0 -64
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/compliance-research-checklist.md +0 -53
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/data-room-structure.md +0 -88
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/deck-blueprint-template.md +0 -39
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/design-tokens-application.md +0 -79
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/html-pdf-pipeline.md +0 -236
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/internal-workings-scrub.md +0 -33
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/references/termsheet-template.md +0 -88
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/templates/prospectus/index.html +0 -1565
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/templates/prospectus/render-pdf.mjs +0 -91
- package/payload/platform/plugins/venture-studio/skills/investor-data-room/templates/prospectus/term_sheet.html +0 -715
- package/payload/platform/plugins/venture-studio/skills/office-hours/SKILL.md +0 -587
- package/payload/platform/plugins/venture-studio/skills/prototype-host/SKILL.md +0 -179
- package/payload/platform/plugins/venture-studio/skills/prototype-host/references/cloudflared-ingress-edit.md +0 -81
- package/payload/platform/plugins/venture-studio/skills/prototype-host/references/scaffold-frameworks.md +0 -60
- package/payload/platform/plugins/venture-studio/skills/prototype-host/references/systemd-user-service.md +0 -104
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/SKILL.md +0 -336
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/aarrr-metrics.md +0 -275
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/assumption-testing.md +0 -93
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/boolean-search.md +0 -308
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/build-measure-learn.md +0 -262
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/business-model-canvas.md +0 -171
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/commitment-signals.md +0 -246
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/design-thinking.md +0 -183
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/earlyvangelist.md +0 -190
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/first-principles.md +0 -58
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/fishbone.md +0 -114
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/five-whys.md +0 -43
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/ice-scoring.md +0 -237
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/innovation-accounting.md +0 -290
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/jtbd.md +0 -105
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/landing-page.md +0 -361
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/market-type.md +0 -167
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/mom-test.md +0 -193
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/mvp-types.md +0 -200
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/og-images.md +0 -239
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/pareto.md +0 -103
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/persona-development.md +0 -291
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/pivot-types.md +0 -225
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/positioning-statement.md +0 -179
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/prd.md +0 -363
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/pre-mortem.md +0 -74
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/problem-validation.md +0 -253
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/product-market-fit.md +0 -256
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/research-synthesis.md +0 -276
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/three-engines-of-growth.md +0 -248
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/validation-tests.md +0 -89
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/value-proposition-canvas.md +0 -121
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/win-loss-analysis.md +0 -242
- package/payload/platform/plugins/venture-studio/skills/zero-to-prototype/references/workflow-mapping.md +0 -271
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: voice-mirror
|
|
3
|
+
description: "Capture the operator's authorial voice from their own writing and apply it to agent-drafted content. Activate when the operator asks to tag historical content as human-authored, to distil a style profile, to retrieve voice exemplars for a drafting task, or to record their edit on an agent draft as feedback. Other drafting skills (email composition, Postiz publisher, property-brochure, prospectus) call `voice-retrieve-conditioning` transparently — `voiceMirror: false` in the calling skill's frontmatter opts out."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Voice Mirror
|
|
7
|
+
|
|
8
|
+
Distil the operator's own voice from the content they have actually written, and condition agent drafts on it so generated copy reads as theirs. Anthropic models cannot be fine-tuned; voice mimicry comes from in-context conditioning — a style card plus a handful of real exemplars. The 1M context window makes this affordable.
|
|
9
|
+
|
|
10
|
+
The skill is built on four deterministic MCP tools served by the `writer-craft` plugin's MCP server (`premium-plugins/writer-craft/mcp/`):
|
|
11
|
+
|
|
12
|
+
| Tool | Purpose |
|
|
13
|
+
|------|---------|
|
|
14
|
+
| `voice-tag-content` | Stamp historical or new content nodes with `authorshipMode`. Bulk-tags arrays of node ids. |
|
|
15
|
+
| `voice-distil-profile` | Walk the operator's `human-only` corpus and produce a `:VoiceProfile {styleCard, generatedAt, corpusSize, feedbackEntries}` node. |
|
|
16
|
+
| `voice-retrieve-conditioning` | Return `{styleCard, exemplars[]}` for a drafting brief. K=5 for short-form, K=15 for long-form. Token-budget bounded. |
|
|
17
|
+
| `voice-record-feedback` | When the operator edits an agent draft, write a `:VoiceEdit {originalText, editedText, intent, occurredAt}-[:FEEDBACK_FOR]->(:VoiceProfile)` node. The `intent` field is a Haiku-summarised diff. |
|
|
18
|
+
|
|
19
|
+
## When to activate
|
|
20
|
+
|
|
21
|
+
Activate when the operator says any of:
|
|
22
|
+
|
|
23
|
+
- **"Tag this as me" / "I wrote that" / "mark these as human-only".** Drives `voice-tag-content`.
|
|
24
|
+
- **"Build my voice profile" / "distil my style" / "rebuild the voice mirror".** Drives `voice-distil-profile`.
|
|
25
|
+
- **"Read my writing first" / "draft this in my voice" — when the operator is asking for a hand-written-quality draft, not a generic AI reply.** Drives `voice-retrieve-conditioning`; the calling drafting skill is the actual surface, this skill is the conditioning input.
|
|
26
|
+
- **"Use my edit as a teaching example" / "remember how I changed that".** Drives `voice-record-feedback`.
|
|
27
|
+
- **"Review my historical writing and tag it" / "start the backfill".** Drives the interactive backfill flow described below.
|
|
28
|
+
|
|
29
|
+
Do **not** activate for:
|
|
30
|
+
|
|
31
|
+
- Writing-craft review tasks (`prose-craft`, `review-prose`, etc.). Those are critique skills, not voice-capture.
|
|
32
|
+
- Public-figure voice mimicry. Out of scope — see the `## Out of scope` section.
|
|
33
|
+
- Audio voice cloning. Different domain entirely.
|
|
34
|
+
|
|
35
|
+
## Flow — backfill review (one-shot session)
|
|
36
|
+
|
|
37
|
+
Run when the operator first installs voice-mirror, then whenever they want to refresh the corpus.
|
|
38
|
+
|
|
39
|
+
### 1. Pick a corpus stream
|
|
40
|
+
|
|
41
|
+
The operator's authored content lives in two stream shapes that the backfill UX handles differently:
|
|
42
|
+
|
|
43
|
+
- **Discrete documents and posts** — `:KnowledgeDocument` (covers email threads via `source:'email'` since Task 321), `:SocialPost`, and one-off `:Message` nodes. Per-item tagging with previews.
|
|
44
|
+
- **Chat archives** — conversation-document `:KnowledgeDocument` nodes (those carrying `conversationIdentity`) with their child `:Section` chunks. Per-conversation tagging because chunking happens server-side and the operator owns whole conversations, not individual chunks. Chat is the highest-leverage corpus — the unguarded voice that email rarely captures.
|
|
45
|
+
|
|
46
|
+
Ask the operator which stream to backfill first. Default to chat archives when the account has any conversation-document `:KnowledgeDocument` nodes, because that's where voice signal is strongest.
|
|
47
|
+
|
|
48
|
+
### 2a. Discrete documents — paginate in batches of 10
|
|
49
|
+
|
|
50
|
+
Query for `:KnowledgeDocument | :SocialPost | :Message` nodes belonging to this operator's account whose `authorshipMode` is `unknown`. Order by `dateSent | datePublished | dateCreated` descending — most recent first. For each batch, surface a numbered list with: source label, date, recipient or topic, and a one-line preview (first ~120 chars of body). Offer bulk shortcuts:
|
|
51
|
+
|
|
52
|
+
- `1-10 human-only` — tag every item in the batch as `human-only`.
|
|
53
|
+
- `1,3,7 human-only` — tag a subset.
|
|
54
|
+
- `2 human-led-agent-assisted` — single-item mode override.
|
|
55
|
+
- `5 agent-led-human-reviewed` — single-item mode override.
|
|
56
|
+
- `skip` — leave the batch as `unknown` and advance.
|
|
57
|
+
- `stop` — exit the backfill; the next session resumes from where the operator left off.
|
|
58
|
+
|
|
59
|
+
Bulk-tag via `voice-tag-content` once per operator response. Emit `[voice-tag] mode=<mode> count=<n>` per write.
|
|
60
|
+
|
|
61
|
+
### 2b. Chat archives — paginate per conversation-document parent
|
|
62
|
+
|
|
63
|
+
For each conversation-document `:KnowledgeDocument` (with `conversationIdentity` set) that has at least one `:Section` chunk whose `authorshipMode` is `unknown`, surface: source file, participant names, message count, date range, and a one-line summary. Offer:
|
|
64
|
+
|
|
65
|
+
- `human-only` — tag every child `:Section` chunk in this conversation as `human-only`.
|
|
66
|
+
- `mixed` — open the conversation for per-chunk tagging (rare; only when the archive contains multiple authors on the operator's side).
|
|
67
|
+
- `not me` — tag every chunk as `agent-only` (e.g. a Slack channel where the operator only forwarded other people's messages).
|
|
68
|
+
- `skip` / `stop` — same semantics as 2a.
|
|
69
|
+
|
|
70
|
+
Bulk-tag via `voice-tag-content` with the list of `:Section` element IDs the conversation-document contains. The skill emits `[voice-tag] mode=<mode> count=<chunk-count>` once per conversation.
|
|
71
|
+
|
|
72
|
+
Authorship at conversation granularity is a deliberate UX trade-off: chunks within a conversation almost always share the same operator's voice, and per-chunk tagging at archive scale would burn the operator's attention. The `mixed` opt-in covers the rare case where it matters.
|
|
73
|
+
|
|
74
|
+
### 3. Distil when the corpus crosses threshold
|
|
75
|
+
|
|
76
|
+
After each backfill batch, check whether the qualifying corpus (`authorshipMode IN ['human-only', 'human-led-agent-assisted']`) has grown ≥20% since the last `:VoiceProfile.corpusSize` (or ≥1 entry if no profile exists). If yes, offer to run `voice-distil-profile` immediately. The operator can defer; the next scheduled distillation will pick it up.
|
|
77
|
+
|
|
78
|
+
## Flow — drafting-time conditioning
|
|
79
|
+
|
|
80
|
+
Drafting skills (email composition, Postiz, property-brochure, prospectus) call `voice-retrieve-conditioning` transparently before assembling their prompt. The skill takes a brief — `{topic, format, register}` — and returns:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
styleCard: |
|
|
84
|
+
sentenceLengthDistribution: short-heavy (median 12 words)
|
|
85
|
+
register: warm-professional, British, contraction-friendly
|
|
86
|
+
favoured: ["properly", "the right thing", "happy to"]
|
|
87
|
+
avoided: ["circle back", "synergy", "leverage"]
|
|
88
|
+
taboos: ["per my last email", "kind regards"]
|
|
89
|
+
opening: drop the salutation if the thread is mid-flow; otherwise "Hi <name>,"
|
|
90
|
+
closing: "Best, Neo" — no signature block
|
|
91
|
+
exemplars:
|
|
92
|
+
- source: Email to Sarah Knight, 2026-04-12, re: lease draft
|
|
93
|
+
body: "…actual operator-written paragraph…"
|
|
94
|
+
- source: SocialPost on LinkedIn, 2026-03-30
|
|
95
|
+
body: "…"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Drafting skills inject both blocks into their prompt. Opt-out is per-skill: declare `voiceMirror: false` in the skill's frontmatter and the calling site skips the fetch. Default is on.
|
|
99
|
+
|
|
100
|
+
If the `:VoiceProfile` does not yet exist (corpus too small, or distillation never run), the tool returns `{styleCard: null, exemplars: []}` and the calling skill falls back to its existing default register. No error, no draft refusal.
|
|
101
|
+
|
|
102
|
+
Emit `[voice-retrieve] task=<brief> styleCardBytes=<n> exemplarCount=<k> tokenBudget=<n>` per call.
|
|
103
|
+
|
|
104
|
+
## Flow — feedback capture
|
|
105
|
+
|
|
106
|
+
When the operator edits an agent draft (in the email composer's edit loop, or in any drafting skill that supports inline edits), capture the diff:
|
|
107
|
+
|
|
108
|
+
1. The calling skill passes `{originalText, editedText}` to `voice-record-feedback`.
|
|
109
|
+
2. The tool runs a Haiku diff summarisation to produce an `intent` field — a one-sentence description of what the operator changed and why. Example intents: "shorter and dropped the apology", "switched to first person", "removed sign-off", "added a specific date".
|
|
110
|
+
3. The tool writes `(:VoiceEdit {originalText, editedText, intent, occurredAt, adminUserId, accountId})-[:FEEDBACK_FOR]->(:VoiceProfile)` for the operator's profile.
|
|
111
|
+
|
|
112
|
+
Feedback accumulates between distillations. The next `voice-distil-profile` run reads every `:VoiceEdit` linked to the profile and feeds the intents into the style-card refinement.
|
|
113
|
+
|
|
114
|
+
Emit `[voice-record-feedback] adminUser=<id> intent="<haiku-summary>" diffBytes=<n>`.
|
|
115
|
+
|
|
116
|
+
## Distillation cadence
|
|
117
|
+
|
|
118
|
+
`voice-distil-profile` re-runs when **either**:
|
|
119
|
+
|
|
120
|
+
- the `human-only` corpus has grown ≥20% since the last `:VoiceProfile.corpusSize`, OR
|
|
121
|
+
- 30 days have passed since `:VoiceProfile.generatedAt`.
|
|
122
|
+
|
|
123
|
+
A re-run within the 30-day window with <20% growth is a no-op — the tool returns the existing profile unchanged and emits `[voice-distil] skip reason=below-threshold`.
|
|
124
|
+
|
|
125
|
+
The triggering surface is the skill, not a scheduled job. Distillation runs on demand: at the end of a backfill batch, when the email composer notices stale-profile narration, or when the operator says "rebuild my voice profile".
|
|
126
|
+
|
|
127
|
+
## Per-operator scope
|
|
128
|
+
|
|
129
|
+
One `:VoiceProfile` per `:AdminUser`. Multi-author accounts (an agency with several operators) get one profile per person. Identity is the `(accountId, adminUserId)` pair, enforced by the schema constraint.
|
|
130
|
+
|
|
131
|
+
## Observability
|
|
132
|
+
|
|
133
|
+
| Tag | When |
|
|
134
|
+
|-----|------|
|
|
135
|
+
| `[voice-tag] mode=<mode> nodeId=<id> count=<n>` | Every tag write. |
|
|
136
|
+
| `[voice-distil] adminUser=<id> corpusSize=<n> generatedAt=<iso> feedbackEntries=<n>` | Each distillation. |
|
|
137
|
+
| `[voice-distil] skip reason=<below-threshold\|recent>` | When the cadence guard fires. |
|
|
138
|
+
| `[voice-retrieve] task=<topic\|format> styleCardBytes=<n> exemplarCount=<k> tokenBudget=<n>` | Each retrieval. |
|
|
139
|
+
| `[voice-record-feedback] adminUser=<id> intent="<haiku-summary>" diffBytes=<n>` | Each feedback write. |
|
|
140
|
+
|
|
141
|
+
**Confirms working:** `[voice-retrieve] exemplarCount≥1` precedes every drafting-skill prompt assembly when the calling skill has not opted out. `[voice-distil]` appears at least once per 30-day window per active `:AdminUser`.
|
|
142
|
+
|
|
143
|
+
**Indicates failure:** `[voice-retrieve] exemplarCount=0` with non-empty corpus → similarity index broken; `[voice-distil] error …` → corpus walk or LLM call failed; absence of `[voice-record-feedback]` after an operator-edit-then-send flow → feedback loop is dead.
|
|
144
|
+
|
|
145
|
+
**Diagnostic path:**
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
journalctl -u maxy-code | grep -E '\[voice-(tag|distil|retrieve|record-feedback)\]'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Filter by `adminUser=<id>` for per-operator drill-down.
|
|
152
|
+
|
|
153
|
+
## Out of scope
|
|
154
|
+
|
|
155
|
+
- Voice blending across multiple authors (no "Joel + Neo combined voice").
|
|
156
|
+
- Style transfer from public-figure corpora — voice-mirror only learns from the operator's own writing.
|
|
157
|
+
- Audio voice cloning / speech synthesis — different domain.
|
|
158
|
+
- Auto-tagging legacy content via heuristics — backfill is operator-driven only; the agent never guesses authorship.
|
|
159
|
+
- Register-segmented profiles (one profile per author, not one per formality level).
|
|
160
|
+
- Admin-UI editing of the `styleCard` — operator edits via `database-operator` for now. Surfacing this in a dedicated UI is a follow-up task.
|
|
161
|
+
|
|
162
|
+
## Dependencies
|
|
163
|
+
|
|
164
|
+
- **Memory plugin's graph-write gate** is the single write boundary; new tools route through it, never bypass.
|
|
165
|
+
- **Haiku LLM call path** (already used by `memory-classify`) is reused for diff-intent summarisation.
|
|
166
|
+
- **`:AdminUser` must exist** for the operator before distillation runs. Personal-mode operators with `Person {role: "admin-personal"}` need to be promoted to an `:AdminUser` first — out of scope here.
|
|
@@ -3818,7 +3818,6 @@ import {
|
|
|
3818
3818
|
readdirSync as readdirSync2,
|
|
3819
3819
|
existsSync as existsSync5,
|
|
3820
3820
|
statSync as statSync2,
|
|
3821
|
-
cpSync,
|
|
3822
3821
|
rmSync
|
|
3823
3822
|
} from "fs";
|
|
3824
3823
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -3903,59 +3902,48 @@ function walkPremiumBundlesOnDisk() {
|
|
|
3903
3902
|
function reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir) {
|
|
3904
3903
|
const TAG = "[premium-auto-deliver]";
|
|
3905
3904
|
for (const { bundle, subs } of bundles) {
|
|
3905
|
+
const isBundle = existsSync5(join3(stagingRoot, bundle, "BUNDLE.md"));
|
|
3906
3906
|
for (const sub of subs) {
|
|
3907
|
-
const premiumManifest = resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md");
|
|
3907
|
+
const premiumManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(stagingRoot, bundle, "PLUGIN.md");
|
|
3908
3908
|
const flatDir = resolve4(pluginsDir, sub);
|
|
3909
3909
|
const flatManifest = resolve4(flatDir, "PLUGIN.md");
|
|
3910
3910
|
if (!existsSync5(premiumManifest) || !existsSync5(flatManifest)) continue;
|
|
3911
3911
|
const premiumSha = createHash2("sha256").update(readFileSync5(premiumManifest)).digest("hex");
|
|
3912
3912
|
const flatSha = createHash2("sha256").update(readFileSync5(flatManifest)).digest("hex");
|
|
3913
|
-
if (
|
|
3913
|
+
if (isBundle) {
|
|
3914
|
+
if (premiumSha === flatSha) {
|
|
3915
|
+
try {
|
|
3916
|
+
rmSync(flatDir, { recursive: true });
|
|
3917
|
+
console.log(`${TAG} reaped sub=${sub} reason=duplicate-of-premium-tree`);
|
|
3918
|
+
} catch (err) {
|
|
3919
|
+
console.log(`${TAG} reap-failed sub=${sub} err=${err instanceof Error ? err.message : String(err)}`);
|
|
3920
|
+
}
|
|
3921
|
+
} else {
|
|
3922
|
+
console.log(`${TAG} flat-copy-divergent sub=${sub} action=skip-keep`);
|
|
3923
|
+
}
|
|
3924
|
+
} else {
|
|
3914
3925
|
try {
|
|
3915
3926
|
rmSync(flatDir, { recursive: true });
|
|
3916
|
-
console.log(`${TAG} reaped
|
|
3927
|
+
console.log(`${TAG} reaped standalone=${sub} matches-source=${flatSha === premiumSha}`);
|
|
3917
3928
|
} catch (err) {
|
|
3918
|
-
console.log(`${TAG} reap-failed
|
|
3929
|
+
console.log(`${TAG} reap-failed standalone=${sub} err=${err instanceof Error ? err.message : String(err)}`);
|
|
3919
3930
|
}
|
|
3920
|
-
} else {
|
|
3921
|
-
console.log(`${TAG} flat-copy-divergent sub=${sub} action=skip-keep`);
|
|
3922
3931
|
}
|
|
3923
3932
|
}
|
|
3924
3933
|
}
|
|
3925
3934
|
}
|
|
3926
3935
|
function autoDeliverPremiumPlugins() {
|
|
3927
|
-
const TAG = "[premium-auto-deliver]";
|
|
3928
3936
|
const bundles = walkPremiumBundles();
|
|
3929
3937
|
if (bundles.length === 0) return;
|
|
3930
3938
|
const stagingRoot = resolve4(PLATFORM_ROOT2, "../premium-plugins");
|
|
3931
3939
|
const pluginsDir = resolve4(PLATFORM_ROOT2, "plugins");
|
|
3932
3940
|
reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir);
|
|
3933
|
-
for (const { bundle, subs: _subs } of bundles) {
|
|
3934
|
-
const stagingDir = resolve4(stagingRoot, bundle);
|
|
3935
|
-
const bundlePath = join3(stagingDir, "BUNDLE.md");
|
|
3936
|
-
const isBundle = existsSync5(bundlePath);
|
|
3937
|
-
if (isBundle) {
|
|
3938
|
-
continue;
|
|
3939
|
-
}
|
|
3940
|
-
const target = resolve4(pluginsDir, bundle);
|
|
3941
|
-
if (existsSync5(resolve4(target, "PLUGIN.md"))) {
|
|
3942
|
-
console.log(`${TAG} ${bundle}: already present, skipping`);
|
|
3943
|
-
} else {
|
|
3944
|
-
try {
|
|
3945
|
-
cpSync(stagingDir, target, { recursive: true });
|
|
3946
|
-
console.log(`${TAG} ${bundle} (standalone): delivered`);
|
|
3947
|
-
} catch (err) {
|
|
3948
|
-
console.log(`${TAG} ${bundle}: copy failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
3949
|
-
}
|
|
3950
|
-
}
|
|
3951
|
-
}
|
|
3952
3941
|
}
|
|
3953
3942
|
function reconcileEnabledPlugins(accountDir, config, accountId) {
|
|
3954
3943
|
const TAG = "[premium-auto-deliver]";
|
|
3955
3944
|
if (!accountDir || !config) return;
|
|
3956
3945
|
const bundles = walkPremiumBundles();
|
|
3957
3946
|
const stagingRoot = resolve4(PLATFORM_ROOT2, "../premium-plugins");
|
|
3958
|
-
const pluginsDir = resolve4(PLATFORM_ROOT2, "plugins");
|
|
3959
3947
|
const bundleNames = [];
|
|
3960
3948
|
const allSubs = [];
|
|
3961
3949
|
for (const { bundle, subs } of bundles) {
|
|
@@ -3963,7 +3951,7 @@ function reconcileEnabledPlugins(accountDir, config, accountId) {
|
|
|
3963
3951
|
const bundlePath = join3(stagingRoot, bundle, "BUNDLE.md");
|
|
3964
3952
|
const isBundle = existsSync5(bundlePath);
|
|
3965
3953
|
for (const sub of subs) {
|
|
3966
|
-
const subManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(
|
|
3954
|
+
const subManifest = isBundle ? resolve4(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve4(stagingRoot, bundle, "PLUGIN.md");
|
|
3967
3955
|
if (!existsSync5(subManifest)) continue;
|
|
3968
3956
|
allSubs.push(sub);
|
|
3969
3957
|
}
|
package/payload/server/server.js
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "venture-studio",
|
|
3
|
-
"description": "Founding-a-business agent. Drives an operator from raw idea to fundraise-ready deliverables: validated wedge, branded identity, prototyped product, structured data room, business plan, prospectus + term sheet, deck. Every artefact slots into a tracked Project + Task graph so nothing gets forgotten.",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Rubytech LLC"
|
|
7
|
-
}
|
|
8
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: venture-studio
|
|
3
|
-
description: "Founding-a-business agent. Drives an operator from raw idea to fundraise-ready deliverables: validated wedge, branded identity, prototyped product, structured data room, business plan, prospectus + term sheet, deck. Every artefact slots into a tracked Project + Task graph so nothing gets forgotten."
|
|
4
|
-
requires:
|
|
5
|
-
- projects
|
|
6
|
-
- work
|
|
7
|
-
- cloudflare
|
|
8
|
-
- deep-research
|
|
9
|
-
metadata: {"platform":{"always":false,"embed":["admin"],"pluginKey":"venture-studio","optional":true,"recommended":true}}
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# Venture Studio
|
|
13
|
-
|
|
14
|
-
You are the founding-a-business agent. The operator has a business they want to start; your job is to take them from idea to a fundraise-ready pack — without losing track of any artefact along the way.
|
|
15
|
-
|
|
16
|
-
## Operating principle: data-room first
|
|
17
|
-
|
|
18
|
-
Every business this agent founds produces the same set of artefacts: a discovery design doc, a brand pack, a validated wedge with a landing page and PRD, a structured data room, a business plan, a prospectus, a term sheet, a deck. The operator does not have to remember any of this. The agent's job is to ensure every artefact has a tracked Task before any artefact is produced.
|
|
19
|
-
|
|
20
|
-
Outcome (binding):
|
|
21
|
-
|
|
22
|
-
- **Every artefact has a tracked Task** in a `Project` named for this business, before that artefact's skill is invoked.
|
|
23
|
-
- **Section order is preserved.** Artefacts are produced in the data-room's section order (`01-narrative` → `02-corporate-legal` → ... → `10-supporting`), with the `html/<artefact>/` rendered outputs landing as the section's content matures.
|
|
24
|
-
- **Nothing is forgotten.** The Project's Task list IS the operator's view of what is done, what is in flight, what is outstanding.
|
|
25
|
-
|
|
26
|
-
Constraint (binding): **No downstream venture-studio skill (`brand-pack`, `zero-to-prototype`, `investor-data-room` Stages 3+, etc.) is invoked before the data-room scaffold + Project + per-artefact Tasks exist on disk and in the graph.** If the operator asks you to skip straight to a deliverable ("just write me a business plan"), restate the scaffold-first principle and offer to scaffold the data room first, then jump straight to that artefact's task. The principle is the outcome contract; the scaffold proves it.
|
|
27
|
-
|
|
28
|
-
### Deterministic pre-flight gate
|
|
29
|
-
|
|
30
|
-
Before invoking any downstream skill, both checks below must pass. Both are deterministic — exit-code on `ls`, structured output on `project-list`. Neither check depends on LLM judgement.
|
|
31
|
-
|
|
32
|
-
1. **Directory check:** `[ -d "${PROJECT_ROOT}/.docs/data-room/01-narrative" ]` returns exit 0.
|
|
33
|
-
2. **Graph check:** the `project-list` tool returns a Project whose `name` matches the business's working name.
|
|
34
|
-
|
|
35
|
-
If either check fails, run the scaffolding script (see below) before the skill fires. If the script fails, surface the literal stderr error to the operator — do not narrate around it (memory: [[feedback_no_stdout_parsing_for_control_flow]]).
|
|
36
|
-
|
|
37
|
-
### Scaffolding script
|
|
38
|
-
|
|
39
|
-
`bin/scaffold.sh` is the deterministic enforcement layer. It creates the Project + nine artefact Tasks (via the work plugin's `project-create-cli` bridge) and materialises the ten-section directory tree plus the `prototype/` top-level for hosted surfaces. Graph write first, directories second; idempotent re-run if any partial state lands.
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
ACCOUNT_ID="${ACCOUNT_ID}" \
|
|
43
|
-
premium-plugins/venture-studio/bin/scaffold.sh \
|
|
44
|
-
"${PROJECT_ROOT}" \
|
|
45
|
-
"${BUSINESS_NAME}"
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The script is the binding check, not the prose principle above. The prose explains why; the script is what makes it true.
|
|
49
|
-
|
|
50
|
-
## First-conversation routing
|
|
51
|
-
|
|
52
|
-
When the operator first invokes this agent, confirm the intent ("Are we founding a new business, or working on an existing one?") and run the scaffolding script — it does steps 1–3 below in a single atomic invocation:
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
ACCOUNT_ID="${ACCOUNT_ID}" \
|
|
56
|
-
premium-plugins/venture-studio/bin/scaffold.sh \
|
|
57
|
-
"${PROJECT_ROOT}" \
|
|
58
|
-
"${BUSINESS_NAME}"
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
The script's three effects:
|
|
62
|
-
|
|
63
|
-
1. **Scaffolds the data room.** Materialises the ten-section directory tree under `<project-root>/.docs/data-room/`. Every artefact has a slot to land in before any artefact is produced.
|
|
64
|
-
2. **Creates the `Project` node.** Tier `full` (data-room work is multi-phase). Project name is the business's working name; description references the data-room root path.
|
|
65
|
-
3. **Enumerates the nine artefact Tasks** in section order — one transaction, atomic with the Project. The work-item list the script pre-seeds:
|
|
66
|
-
- **Stage 1 — Office-hours design doc** → produces `01-narrative/office-hours-design.md` (skill: `office-hours`)
|
|
67
|
-
- **Stage 2 — Wedge validation + landing page + PRD** → produces `01-narrative/{PMF, LANDING, PRD}.md` (skill: `zero-to-prototype`)
|
|
68
|
-
- **Brand pack** → produces brand guidelines + summary + color palette + typography system + tone-of-voice (voice/messaging/copy) + logo guidelines into `06-product-ip/brand/` (skill: `brand-pack`)
|
|
69
|
-
- **Prototype host** → public URL for the landing page and/or wedge prototype via cloudflared ingress + systemd-managed dev server (skill: `prototype-host`)
|
|
70
|
-
- **Stage 3 — Business plan** → produces `01-narrative/business-plan.md` (skill: `investor-data-room` Stage 3)
|
|
71
|
-
- **Stage 3b — Term sheet** → produces `html/prospectus/term_sheet.html` (skill: `investor-data-room` Stage 3b)
|
|
72
|
-
- **Stage 4 — Deck blueprint** → produces `01-narrative/deck-blueprint.md` (skill: `investor-data-room` Stage 4)
|
|
73
|
-
- **Stage 4b — Prospectus** → produces `html/prospectus/index.html` (skill: `investor-data-room` Stage 4b)
|
|
74
|
-
- **Stage 5 — Rendered PDFs** → produces `html/{business-plan,prospectus,deck}/*.pdf` (skill: `investor-data-room` Stage 5)
|
|
75
|
-
|
|
76
|
-
After these three steps land, the operator sees the project + task list before any skill produces output. Subsequent turns execute the tasks one at a time, calling the relevant venture-studio skill to produce that section's artefact.
|
|
77
|
-
|
|
78
|
-
## Skill routing
|
|
79
|
-
|
|
80
|
-
The following intent phrases route to specific skills. These calls are gated by the scaffold-first principle: refuse to fire any of them until the data-room scaffold + Project + Tasks exist.
|
|
81
|
-
|
|
82
|
-
| Operator says | Skill |
|
|
83
|
-
|---|---|
|
|
84
|
-
| "I want to think this through" / "office hours" / "is this worth building" | `office-hours` |
|
|
85
|
-
| "let's brand this" / "tokens for the brand" / "logo and palette" | `brand-pack` |
|
|
86
|
-
| "validate this idea" / "let's find PMF" / "draft the landing page" / "write the PRD" | `zero-to-prototype` |
|
|
87
|
-
| "host the landing" / "host the prototype" / "deploy this" / "give me a public URL" | `prototype-host` |
|
|
88
|
-
| "build me a data room" / "scaffold the data room" | `investor-data-room` (Stage 2) |
|
|
89
|
-
| "draft the business plan" | `investor-data-room` (Stage 3) |
|
|
90
|
-
| "draft the term sheet" | `investor-data-room` (Stage 3b) |
|
|
91
|
-
| "draft the deck blueprint" / "build the deck" | `investor-data-room` (Stage 4) |
|
|
92
|
-
| "draft the prospectus" / "investment prospectus" | `investor-data-room` (Stage 4b) |
|
|
93
|
-
| "render the PDFs" / "print-ready deliverables" | `investor-data-room` (Stage 5) |
|
|
94
|
-
|
|
95
|
-
When the operator's intent matches a row but the scaffold does not yet exist, run the first-conversation routing sequence above before the skill fires.
|
|
96
|
-
|
|
97
|
-
## Project & Task hygiene during execution
|
|
98
|
-
|
|
99
|
-
- Before starting any artefact's task, mark its Task `in_progress` via the `work` plugin (or the `projects` plugin's helpers). When the artefact is on disk and verified, mark it `completed`.
|
|
100
|
-
- If a section reveals a new artefact the operator wants (e.g. a competitor-claims-rebuttal in `08-market/`), `work-create` a new Task under the same Project, then proceed.
|
|
101
|
-
- The Project's health signal (green/amber/red) is computed from Task state. Use `project-get` at the start of each turn to surface what's outstanding.
|
|
102
|
-
|
|
103
|
-
## Research routing
|
|
104
|
-
|
|
105
|
-
Every structured-research task — market sizing (TAM/SAM/SOM + CAGR), compliance research (DMCC / ICO ADM / EU AI Act), competitor scans, comparable rounds and exit comparables, named-acquirer enumeration — routes through the `research-assistant` specialist with the five `deep-research` skills (`deep-research`, `book-mirror`, `strategic-reading`, `academic-verify`, `data-research`). Dispatch the specialist; do not call `WebSearch` or `WebFetch` directly from a venture-studio skill. The specialist returns structured findings with citations the data-room artefacts can quote verbatim.
|
|
106
|
-
|
|
107
|
-
## Tone
|
|
108
|
-
|
|
109
|
-
Founder-facing. Direct, evidence-based, no flattery. You are the chief of staff for a one-person founding team — your job is to keep every artefact tracked and every deadline visible, while the operator focuses on the parts only they can do (customer conversations, founder signal, vision).
|
|
110
|
-
|
|
111
|
-
## References
|
|
112
|
-
|
|
113
|
-
The five skills shipped under this plugin carry their own SKILL.md detail:
|
|
114
|
-
|
|
115
|
-
- `skills/office-hours/SKILL.md` — YC office-hours forcing questions in startup + builder modes; outputs the design-doc substrate every later artefact derives from.
|
|
116
|
-
- `skills/brand-pack/SKILL.md` — brand identity (palette, typography, tone, logo) tokenised for the data-room artefacts to consume.
|
|
117
|
-
- `skills/zero-to-prototype/SKILL.md` — 31 frameworks for customer discovery, validation, positioning, PMF measurement, landing page, PRD.
|
|
118
|
-
- `skills/prototype-host/SKILL.md` — scaffolds the landing page or wedge prototype, allocates a port, edits the brand's cloudflared ingress, runs the dev server under a systemd-user unit, and verifies the public URL returns HTTP 200.
|
|
119
|
-
- `skills/investor-data-room/SKILL.md` — full seed-raise pack: data room scaffold, business plan, term sheet, deck blueprint, prospectus, A4 print pipeline.
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Venture-studio data-room scaffold — deterministic enforcement of the
|
|
3
|
-
# scaffold-first principle (Task 286 + feedback_doctrine_paragraph_is_not_a_gate).
|
|
4
|
-
#
|
|
5
|
-
# Creates exactly one Project (with nine pre-seeded artefact Tasks) in
|
|
6
|
-
# the graph, then materialises the ten-section data-room directory tree
|
|
7
|
-
# on disk. The venture-studio agent's downstream skills are gated on
|
|
8
|
-
# both signals existing — see venture-studio/PLUGIN.md.
|
|
9
|
-
#
|
|
10
|
-
# Order of operations: graph write first, directories second. The CLI's
|
|
11
|
-
# duplicate-name guard makes the script safely re-runnable after any
|
|
12
|
-
# partial failure: a second run finds the existing Project, returns its
|
|
13
|
-
# id, and retries the mkdir step.
|
|
14
|
-
#
|
|
15
|
-
# Usage:
|
|
16
|
-
# ACCOUNT_ID=<uuid> scaffold.sh <project-root> <business-name>
|
|
17
|
-
#
|
|
18
|
-
# Exit codes:
|
|
19
|
-
# 0 scaffold complete (or already existed)
|
|
20
|
-
# 2 bad arguments / missing ACCOUNT_ID
|
|
21
|
-
# 1 graph write failed, directory mkdir failed, or CLI binary missing
|
|
22
|
-
|
|
23
|
-
set -euo pipefail
|
|
24
|
-
|
|
25
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
26
|
-
# Deployed layout per packages/create-maxy-code/scripts/bundle.js:
|
|
27
|
-
# <install>/premium-plugins/venture-studio/bin/scaffold.sh
|
|
28
|
-
# <install>/platform/plugins/work/mcp/dist/cli/project-create-cli.js
|
|
29
|
-
CLI_BIN="${SCRIPT_DIR}/../../../platform/plugins/work/mcp/dist/cli/project-create-cli.js"
|
|
30
|
-
|
|
31
|
-
if [[ $# -ne 2 ]]; then
|
|
32
|
-
echo "scaffold.sh: usage: ACCOUNT_ID=<uuid> $0 <project-root> <business-name>" >&2
|
|
33
|
-
exit 2
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
PROJECT_ROOT="$1"
|
|
37
|
-
BUSINESS_NAME="$2"
|
|
38
|
-
|
|
39
|
-
if [[ -z "${ACCOUNT_ID:-}" ]]; then
|
|
40
|
-
echo "scaffold.sh: ACCOUNT_ID env var required" >&2
|
|
41
|
-
exit 2
|
|
42
|
-
fi
|
|
43
|
-
|
|
44
|
-
if [[ ! -d "$PROJECT_ROOT" ]]; then
|
|
45
|
-
echo "scaffold.sh: project root does not exist: $PROJECT_ROOT" >&2
|
|
46
|
-
exit 2
|
|
47
|
-
fi
|
|
48
|
-
|
|
49
|
-
if [[ ! -f "$CLI_BIN" ]]; then
|
|
50
|
-
echo "scaffold.sh: project-create CLI not built or missing at: $CLI_BIN" >&2
|
|
51
|
-
exit 1
|
|
52
|
-
fi
|
|
53
|
-
|
|
54
|
-
DATA_ROOM="${PROJECT_ROOT}/.docs/data-room"
|
|
55
|
-
|
|
56
|
-
# Nine pre-seeded artefact tasks — order and names match
|
|
57
|
-
# premium-plugins/venture-studio/PLUGIN.md § First-conversation routing.
|
|
58
|
-
# Section order is preserved so the agent can walk them sequentially.
|
|
59
|
-
# Prototype-host is slotted between Stage 2 (wedge + landing copy) and
|
|
60
|
-
# Stage 3 (business plan): brand-pack and wedge are hard prerequisites
|
|
61
|
-
# (the skill consumes 06-product-ip/brand/ tokens and 01-narrative/LANDING.md);
|
|
62
|
-
# hosting before business plan keeps the founder's wedge-validation loop
|
|
63
|
-
# (live URL) ahead of investor-pack work.
|
|
64
|
-
PAYLOAD=$(cat <<JSON
|
|
65
|
-
{
|
|
66
|
-
"accountId": "${ACCOUNT_ID}",
|
|
67
|
-
"name": "${BUSINESS_NAME}",
|
|
68
|
-
"description": "Venture-studio data room for ${BUSINESS_NAME}. Root: ${DATA_ROOM}",
|
|
69
|
-
"tier": "full",
|
|
70
|
-
"workItems": [
|
|
71
|
-
{"name": "Stage 1 — Office-hours design doc", "description": "Produces 01-narrative/office-hours-design.md via the office-hours skill."},
|
|
72
|
-
{"name": "Stage 2 — Wedge validation + landing page + PRD", "description": "Produces 01-narrative/{PMF,LANDING,PRD}.md via the zero-to-prototype skill."},
|
|
73
|
-
{"name": "Brand pack", "description": "Produces brand guidelines + summary + color palette + typography system + tone-of-voice (voice/messaging/copy) + logo guidelines into 06-product-ip/brand/ via the brand-pack skill."},
|
|
74
|
-
{"name": "Prototype host", "description": "Public URL for the landing page and/or wedge prototype via cloudflared ingress + systemd-managed dev server (skill: prototype-host)."},
|
|
75
|
-
{"name": "Stage 3 — Business plan", "description": "Produces 01-narrative/business-plan.md via investor-data-room Stage 3."},
|
|
76
|
-
{"name": "Stage 3b — Term sheet", "description": "Produces html/prospectus/term_sheet.html via investor-data-room Stage 3b."},
|
|
77
|
-
{"name": "Stage 4 — Deck blueprint", "description": "Produces 01-narrative/deck-blueprint.md via investor-data-room Stage 4."},
|
|
78
|
-
{"name": "Stage 4b — Prospectus", "description": "Produces html/prospectus/index.html via investor-data-room Stage 4b."},
|
|
79
|
-
{"name": "Stage 5 — Rendered PDFs", "description": "Produces html/{business-plan,prospectus,deck}/*.pdf via investor-data-room Stage 5."}
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
JSON
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
# Graph write first. CLI returns {projectId, existing:bool} on stdout;
|
|
86
|
-
# on any failure it exits non-zero with a literal stderr message that
|
|
87
|
-
# propagates here verbatim — no prose-parsing for control flow
|
|
88
|
-
# (memory: feedback_no_stdout_parsing_for_control_flow).
|
|
89
|
-
RESULT=$(node "$CLI_BIN" "$PAYLOAD")
|
|
90
|
-
echo "scaffold.sh: project-create CLI returned: $RESULT"
|
|
91
|
-
|
|
92
|
-
# Directories second. The agent's pre-flight gate keys on the existence
|
|
93
|
-
# of 01-narrative/ (it AND-checks with project-list); creating it last
|
|
94
|
-
# means partial state (graph-only) is naturally invisible to the gate
|
|
95
|
-
# until mkdir succeeds.
|
|
96
|
-
for section in \
|
|
97
|
-
01-narrative \
|
|
98
|
-
02-corporate-legal \
|
|
99
|
-
03-cap-table \
|
|
100
|
-
04-financials \
|
|
101
|
-
05-team \
|
|
102
|
-
06-product-ip \
|
|
103
|
-
07-customers \
|
|
104
|
-
08-market \
|
|
105
|
-
09-traction-metrics \
|
|
106
|
-
10-supporting; do
|
|
107
|
-
mkdir -p "${DATA_ROOM}/${section}"
|
|
108
|
-
done
|
|
109
|
-
|
|
110
|
-
# Hosted-prototype source roots live alongside the numbered sections under
|
|
111
|
-
# data-room/. The prototype-host skill populates this with one subdir per
|
|
112
|
-
# surface (landing/, prototype/, etc.); creating the parent here so the
|
|
113
|
-
# directory exists before the first invocation.
|
|
114
|
-
mkdir -p "${DATA_ROOM}/prototype"
|
|
115
|
-
|
|
116
|
-
echo "scaffold.sh: data-room scaffolded at ${DATA_ROOM}"
|