@epiccontext/mcp 0.1.61 → 0.1.63
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/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +118 -64
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/push.d.ts.map +1 -1
- package/dist/cli/commands/push.js +24 -0
- package/dist/cli/commands/push.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +16 -0
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +105 -0
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/files.d.ts +7 -1
- package/dist/cli/files.d.ts.map +1 -1
- package/dist/cli/files.js +1160 -9
- package/dist/cli/files.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +6 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/create-block.d.ts.map +1 -1
- package/dist/mcp/tools/create-block.js +3 -3
- package/dist/mcp/tools/create-block.js.map +1 -1
- package/dist/mcp/tools/update-block.d.ts.map +1 -1
- package/dist/mcp/tools/update-block.js +2 -2
- package/dist/mcp/tools/update-block.js.map +1 -1
- package/dist/mcp/tools/validate.d.ts +10 -0
- package/dist/mcp/tools/validate.d.ts.map +1 -0
- package/dist/mcp/tools/validate.js +105 -0
- package/dist/mcp/tools/validate.js.map +1 -0
- package/package.json +1 -1
package/dist/cli/files.js
CHANGED
|
@@ -1,6 +1,1058 @@
|
|
|
1
1
|
import * as fs from "fs";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { getStorybookTemplateFiles } from "../templates/storybook.js";
|
|
4
|
+
// Example content for each block type - used to generate _example-*.md files during init
|
|
5
|
+
// These show AI agents the correct heading structure for each block type
|
|
6
|
+
// `frontmatterLinks` shows how to add schema refs and universal links in frontmatter
|
|
7
|
+
const BLOCK_TYPE_EXAMPLES = {
|
|
8
|
+
// Constitution
|
|
9
|
+
constraint: { body: `## No Third-Party Analytics
|
|
10
|
+
|
|
11
|
+
**Priority:** high
|
|
12
|
+
**Category:** privacy
|
|
13
|
+
|
|
14
|
+
### Description
|
|
15
|
+
|
|
16
|
+
All analytics must be first-party. No external tracking scripts allowed.
|
|
17
|
+
|
|
18
|
+
### Rationale
|
|
19
|
+
|
|
20
|
+
User privacy is a core value. Third-party scripts introduce data leakage risks.
|
|
21
|
+
|
|
22
|
+
### Implications
|
|
23
|
+
|
|
24
|
+
- Must build or self-host analytics
|
|
25
|
+
- No Google Analytics, Mixpanel, etc.
|
|
26
|
+
- Server-side event tracking only` },
|
|
27
|
+
glossary: { body: `## Product-Specific Terms
|
|
28
|
+
|
|
29
|
+
| Term | Definition |
|
|
30
|
+
|------|-----------|
|
|
31
|
+
| Workspace | Top-level container for projects and members |
|
|
32
|
+
| Block | A single piece of structured content |
|
|
33
|
+
| Section | A category grouping related blocks |` },
|
|
34
|
+
// Brand
|
|
35
|
+
brand_positioning: { body: `## Golden Circle
|
|
36
|
+
|
|
37
|
+
### WHY (Purpose)
|
|
38
|
+
We believe product teams deserve a single source of truth for all context.
|
|
39
|
+
|
|
40
|
+
### HOW (Process)
|
|
41
|
+
By combining structured documentation with AI-powered workflows.
|
|
42
|
+
|
|
43
|
+
### WHAT (Product)
|
|
44
|
+
A context management platform for product teams.
|
|
45
|
+
|
|
46
|
+
## Positioning Statement
|
|
47
|
+
|
|
48
|
+
**For** product teams **who** struggle with scattered documentation, **our product** is a context management platform **that** provides a single source of truth. **Unlike** traditional wikis, **we** structure content for both humans and AI agents.
|
|
49
|
+
|
|
50
|
+
## Brand Essence
|
|
51
|
+
|
|
52
|
+
**Tagline:** Context that works for everyone
|
|
53
|
+
**Brand Promise:** Never lose product context again` },
|
|
54
|
+
brand_visual_identity: { body: `## Colors
|
|
55
|
+
|
|
56
|
+
### Primary Palette
|
|
57
|
+
|
|
58
|
+
| Name | Hex | Usage |
|
|
59
|
+
|------|-----|-------|
|
|
60
|
+
| Brand Blue | #2563EB | Primary actions, links |
|
|
61
|
+
| Dark | #111827 | Text, headings |
|
|
62
|
+
| Light | #F9FAFB | Backgrounds |
|
|
63
|
+
|
|
64
|
+
## Typography
|
|
65
|
+
|
|
66
|
+
**Primary Font:** Inter
|
|
67
|
+
**Heading Font:** Inter
|
|
68
|
+
**Mono Font:** JetBrains Mono
|
|
69
|
+
|
|
70
|
+
## Logo
|
|
71
|
+
|
|
72
|
+
**Format:** SVG
|
|
73
|
+
**Minimum Size:** 24px height` },
|
|
74
|
+
brand_moodboard: { body: `## Mood & Inspiration
|
|
75
|
+
|
|
76
|
+
### Visual Direction
|
|
77
|
+
Clean, modern, developer-friendly aesthetic with subtle warmth.
|
|
78
|
+
|
|
79
|
+
### Reference Images
|
|
80
|
+
- Minimal SaaS dashboards
|
|
81
|
+
- Developer tool interfaces
|
|
82
|
+
- Clean data visualizations
|
|
83
|
+
|
|
84
|
+
### Color Mood
|
|
85
|
+
Professional blues with warm accent colors.` },
|
|
86
|
+
tone_of_voice: { body: `## Voice Archetype
|
|
87
|
+
|
|
88
|
+
**Primary:** The Expert Guide
|
|
89
|
+
**Secondary:** The Supportive Teammate
|
|
90
|
+
|
|
91
|
+
## Personality Traits
|
|
92
|
+
|
|
93
|
+
| Trait | Scale (1-10) |
|
|
94
|
+
|-------|-------------|
|
|
95
|
+
| Formal ↔ Casual | 4 |
|
|
96
|
+
| Serious ↔ Playful | 3 |
|
|
97
|
+
| Technical ↔ Simple | 6 |
|
|
98
|
+
|
|
99
|
+
## Vocabulary
|
|
100
|
+
|
|
101
|
+
### Preferred Terms
|
|
102
|
+
- "workspace" not "organization"
|
|
103
|
+
- "block" not "document"
|
|
104
|
+
- "sync" not "upload"
|
|
105
|
+
|
|
106
|
+
### Avoid
|
|
107
|
+
- Jargon without explanation
|
|
108
|
+
- Passive voice
|
|
109
|
+
- Marketing buzzwords` },
|
|
110
|
+
messaging_framework: { body: `## Elevator Pitch
|
|
111
|
+
|
|
112
|
+
A context management platform that gives product teams a single source of truth — structured for both humans and AI agents.
|
|
113
|
+
|
|
114
|
+
## Value Propositions
|
|
115
|
+
|
|
116
|
+
### For Developers
|
|
117
|
+
Write code with full product context. AI agents read structured docs, not scattered wikis.
|
|
118
|
+
|
|
119
|
+
### For Product Managers
|
|
120
|
+
Track documentation completeness across every section. Know what's missing at a glance.
|
|
121
|
+
|
|
122
|
+
## Key Messages
|
|
123
|
+
|
|
124
|
+
| Audience | Message |
|
|
125
|
+
|----------|---------|
|
|
126
|
+
| Developers | "Your AI coding assistant finally has context" |
|
|
127
|
+
| Product Managers | "See documentation gaps before they become problems" |` },
|
|
128
|
+
// Product
|
|
129
|
+
product_overview: { frontmatterLinks: `personas_ref: # Who this product is for
|
|
130
|
+
- _example-persona
|
|
131
|
+
features_ref: # Key features
|
|
132
|
+
- _example-feature
|
|
133
|
+
epics_ref: # Development epics
|
|
134
|
+
- _example-epic
|
|
135
|
+
links: # Universal links
|
|
136
|
+
- target: _example-competitor
|
|
137
|
+
label: inspired_by`, body: `### Vision
|
|
138
|
+
Become the standard way product teams manage context for both humans and AI.
|
|
139
|
+
|
|
140
|
+
### Mission
|
|
141
|
+
Make product documentation structured, complete, and consumable by any tool.
|
|
142
|
+
|
|
143
|
+
### Problem Statement
|
|
144
|
+
Product teams scatter context across wikis, docs, Slack, and spreadsheets. AI agents can't use unstructured information effectively.
|
|
145
|
+
|
|
146
|
+
### Target Users
|
|
147
|
+
- Product managers tracking documentation completeness
|
|
148
|
+
- Developers who need product context while coding
|
|
149
|
+
- AI coding agents that consume structured documentation` },
|
|
150
|
+
feature: { subfolder: "features", frontmatterLinks: `product_ref: _example-product-overview # Link to parent product
|
|
151
|
+
personas_ref: # Who benefits from this feature
|
|
152
|
+
- _example-persona
|
|
153
|
+
links: # Universal links
|
|
154
|
+
- target: _example-user-story
|
|
155
|
+
label: relates_to
|
|
156
|
+
- target: _example-competitor
|
|
157
|
+
label: inspired_by`, body: `## Smart Notifications
|
|
158
|
+
|
|
159
|
+
**Priority:** high
|
|
160
|
+
**Status:** planned
|
|
161
|
+
|
|
162
|
+
### Description
|
|
163
|
+
Intelligent notification system that only alerts users about changes relevant to their role and current work.
|
|
164
|
+
|
|
165
|
+
### User Story
|
|
166
|
+
As a developer, I want to be notified only about changes to blocks I'm working on, so I'm not overwhelmed by noise.
|
|
167
|
+
|
|
168
|
+
### Acceptance Criteria
|
|
169
|
+
- [ ] Users can set notification preferences per section
|
|
170
|
+
- [ ] AI determines relevance based on recent activity
|
|
171
|
+
- [ ] Daily digest option available
|
|
172
|
+
- [ ] Mute specific blocks` },
|
|
173
|
+
product_strategy_canvas: { body: `## Product Strategy Canvas
|
|
174
|
+
|
|
175
|
+
### Target Customer
|
|
176
|
+
Small-to-medium product teams (5-50 people) using multiple tools for documentation.
|
|
177
|
+
|
|
178
|
+
### Key Problem
|
|
179
|
+
Documentation is scattered, incomplete, and not consumable by AI coding tools.
|
|
180
|
+
|
|
181
|
+
### Solution Approach
|
|
182
|
+
Structured, block-based documentation with real-time sync to AI coding agents.
|
|
183
|
+
|
|
184
|
+
### Unique Value Proposition
|
|
185
|
+
The only documentation platform designed for both humans AND AI agents.
|
|
186
|
+
|
|
187
|
+
### Competitive Advantage
|
|
188
|
+
AI-native format, MCP integration, structured schemas for every content type.` },
|
|
189
|
+
feature_market_analysis: { body: `## AI-Assisted Documentation
|
|
190
|
+
|
|
191
|
+
### Market Opportunity
|
|
192
|
+
Growing demand for AI-integrated development tools. 68% of teams want AI help with documentation.
|
|
193
|
+
|
|
194
|
+
### Competitive Landscape
|
|
195
|
+
No current tool combines structured documentation with MCP-based AI agent integration.
|
|
196
|
+
|
|
197
|
+
### Differentiation
|
|
198
|
+
First-mover advantage in structured context for AI coding agents.` },
|
|
199
|
+
// Users
|
|
200
|
+
persona: { subfolder: "personas", frontmatterLinks: `jtbds_ref: # What jobs this persona has
|
|
201
|
+
- _example-jtbd
|
|
202
|
+
journeys_ref: # Journey maps for this persona
|
|
203
|
+
- _example-journey-map
|
|
204
|
+
links: # Universal links
|
|
205
|
+
- target: _example-product-overview
|
|
206
|
+
label: relates_to
|
|
207
|
+
- target: _example-user-story
|
|
208
|
+
label: relates_to`, body: `> "I need one place where all product context lives."
|
|
209
|
+
|
|
210
|
+
## Demographics
|
|
211
|
+
|
|
212
|
+
| Attribute | Value |
|
|
213
|
+
|-----------|-------|
|
|
214
|
+
| Role | Product Manager |
|
|
215
|
+
| Age | 28-40 |
|
|
216
|
+
| Experience | 3-8 years |
|
|
217
|
+
| Team Size | 5-20 |
|
|
218
|
+
|
|
219
|
+
## Goals
|
|
220
|
+
- Keep documentation complete and up-to-date
|
|
221
|
+
- Give developers the context they need
|
|
222
|
+
- Track what's documented and what's missing
|
|
223
|
+
|
|
224
|
+
## Frustrations
|
|
225
|
+
- Documentation scattered across tools
|
|
226
|
+
- Can't tell what's outdated
|
|
227
|
+
- Developers ask the same questions repeatedly
|
|
228
|
+
|
|
229
|
+
## Behaviors
|
|
230
|
+
- Checks documentation status weekly
|
|
231
|
+
- Creates user stories with acceptance criteria
|
|
232
|
+
- Reviews AI-generated summaries` },
|
|
233
|
+
jtbd: { subfolder: "jobs-to-be-done", frontmatterLinks: `persona_ref: _example-persona # Who has this job
|
|
234
|
+
links: # Universal links
|
|
235
|
+
- target: _example-user-story
|
|
236
|
+
label: relates_to
|
|
237
|
+
- target: _example-feature
|
|
238
|
+
label: relates_to`, body: `## Keep Product Context Accessible
|
|
239
|
+
|
|
240
|
+
### Job Statement
|
|
241
|
+
When I'm onboarding a new team member, I want to point them to one place with all product context, so they can ramp up quickly without asking everyone questions.
|
|
242
|
+
|
|
243
|
+
### Functional Job
|
|
244
|
+
- Find all product documentation in one place
|
|
245
|
+
- Verify documentation is complete and current
|
|
246
|
+
- Share context with new team members
|
|
247
|
+
|
|
248
|
+
### Emotional Job
|
|
249
|
+
- Feel confident the team has what they need
|
|
250
|
+
- Reduce anxiety about knowledge gaps
|
|
251
|
+
|
|
252
|
+
### Current Solutions
|
|
253
|
+
- Confluence wiki (messy, outdated)
|
|
254
|
+
- Google Docs (scattered, hard to find)
|
|
255
|
+
- Tribal knowledge (risky, doesn't scale)` },
|
|
256
|
+
journey_map: { subfolder: "journey-maps", frontmatterLinks: `persona_ref: _example-persona # REQUIRED: Whose journey is this?
|
|
257
|
+
links: # Universal links
|
|
258
|
+
- target: _example-feature
|
|
259
|
+
label: relates_to
|
|
260
|
+
- target: _example-user-story
|
|
261
|
+
label: implements`, body: `## New User Onboarding Journey
|
|
262
|
+
|
|
263
|
+
**Persona:** primary-user
|
|
264
|
+
|
|
265
|
+
### Stages
|
|
266
|
+
|
|
267
|
+
#### 1. Discovery
|
|
268
|
+
**Touchpoints:** Landing page, blog post
|
|
269
|
+
**Actions:** Reads about the product, watches demo
|
|
270
|
+
**Emotions:** Curious, skeptical
|
|
271
|
+
**Pain Points:** "Will this be another tool that gets abandoned?"
|
|
272
|
+
|
|
273
|
+
#### 2. Sign Up
|
|
274
|
+
**Touchpoints:** Registration form, email verification
|
|
275
|
+
**Actions:** Creates account, verifies email
|
|
276
|
+
**Emotions:** Hopeful, impatient
|
|
277
|
+
**Pain Points:** "I hope this is quick to set up"
|
|
278
|
+
|
|
279
|
+
#### 3. First Use
|
|
280
|
+
**Touchpoints:** Dashboard, guided tour
|
|
281
|
+
**Actions:** Creates first project, explores sections
|
|
282
|
+
**Emotions:** Engaged, slightly overwhelmed
|
|
283
|
+
**Pain Points:** "Where do I start?"
|
|
284
|
+
|
|
285
|
+
#### 4. Ongoing Use
|
|
286
|
+
**Touchpoints:** Editor, export API
|
|
287
|
+
**Actions:** Fills in blocks, syncs with AI tools
|
|
288
|
+
**Emotions:** Productive, satisfied
|
|
289
|
+
**Pain Points:** "Need better collaboration features"` },
|
|
290
|
+
// Research
|
|
291
|
+
competitor: { subfolder: "competitors", frontmatterLinks: `links: # Universal links to blocks this competitor analysis informs
|
|
292
|
+
- target: _example-feature
|
|
293
|
+
label: informs
|
|
294
|
+
- target: _example-product-overview
|
|
295
|
+
label: informs
|
|
296
|
+
- target: _example-decision
|
|
297
|
+
label: references`, body: `## Linear
|
|
298
|
+
|
|
299
|
+
**Website:** https://linear.app
|
|
300
|
+
**Category:** Project Management
|
|
301
|
+
|
|
302
|
+
### Description
|
|
303
|
+
Modern project management tool for software teams with fast UI and keyboard shortcuts.
|
|
304
|
+
|
|
305
|
+
### Target Market
|
|
306
|
+
Software development teams, startups to mid-market.
|
|
307
|
+
|
|
308
|
+
### Pricing
|
|
309
|
+
Free for small teams, $8/user/month for standard.
|
|
310
|
+
|
|
311
|
+
### Strengths
|
|
312
|
+
- Extremely fast and polished UI
|
|
313
|
+
- Great keyboard navigation
|
|
314
|
+
- GitHub integration
|
|
315
|
+
|
|
316
|
+
### Weaknesses
|
|
317
|
+
- Limited documentation features
|
|
318
|
+
- No AI agent integration
|
|
319
|
+
- No structured content export
|
|
320
|
+
|
|
321
|
+
### Our Differentiators
|
|
322
|
+
- Structured documentation, not just task tracking
|
|
323
|
+
- AI-native MCP integration
|
|
324
|
+
- Content consumable by coding agents` },
|
|
325
|
+
user_research: { body: `## User Research Interviews Q1
|
|
326
|
+
|
|
327
|
+
### Methodology
|
|
328
|
+
- 12 semi-structured interviews (45 min each)
|
|
329
|
+
- Participants: 6 developers, 4 PMs, 2 designers
|
|
330
|
+
- All from teams of 10-50 people
|
|
331
|
+
|
|
332
|
+
### Key Findings
|
|
333
|
+
|
|
334
|
+
#### Finding 1: Tool Fatigue
|
|
335
|
+
10 of 12 participants use 3+ tools for documentation. All want consolidation.
|
|
336
|
+
|
|
337
|
+
#### Finding 2: AI Integration is Critical
|
|
338
|
+
8 of 12 ranked AI integration as their top feature request.
|
|
339
|
+
|
|
340
|
+
#### Finding 3: Completeness Tracking
|
|
341
|
+
9 of 12 said they can't tell what documentation is missing.
|
|
342
|
+
|
|
343
|
+
### Recommendations
|
|
344
|
+
1. Prioritize documentation completeness tracking
|
|
345
|
+
2. Build AI agent integration from day one
|
|
346
|
+
3. Import from existing tools` },
|
|
347
|
+
research_data: { subfolder: "data-research", body: `## Market Size Research
|
|
348
|
+
|
|
349
|
+
### Key Data Points
|
|
350
|
+
|
|
351
|
+
| Metric | Value | Source |
|
|
352
|
+
|--------|-------|--------|
|
|
353
|
+
| Total Addressable Market | $7.6B | Gartner 2025 |
|
|
354
|
+
| Developer-focused segment | $1.2B | Internal estimate |
|
|
355
|
+
| Teams dissatisfied with PM tools | 42% | Stack Overflow Survey |
|
|
356
|
+
| Average tool spend | $12/user/month | Market research |
|
|
357
|
+
|
|
358
|
+
### Analysis
|
|
359
|
+
|
|
360
|
+
The developer documentation tool market is growing at 13% CAGR. Key growth driver is AI integration demand.` },
|
|
361
|
+
// Technical
|
|
362
|
+
tech_stack: { body: `## Technology Stack
|
|
363
|
+
|
|
364
|
+
### Frontend
|
|
365
|
+
| Technology | Purpose | Version |
|
|
366
|
+
|-----------|---------|---------|
|
|
367
|
+
| Next.js | Framework | 14+ |
|
|
368
|
+
| TypeScript | Language | 5.x |
|
|
369
|
+
| Tailwind CSS | Styling | 3.x |
|
|
370
|
+
|
|
371
|
+
### Backend
|
|
372
|
+
| Technology | Purpose | Version |
|
|
373
|
+
|-----------|---------|---------|
|
|
374
|
+
| Node.js | Runtime | 20+ |
|
|
375
|
+
| Supabase | Database | Latest |
|
|
376
|
+
| PostgreSQL | Database | 15+ |
|
|
377
|
+
|
|
378
|
+
### Infrastructure
|
|
379
|
+
| Technology | Purpose |
|
|
380
|
+
|-----------|---------|
|
|
381
|
+
| Vercel | Hosting |
|
|
382
|
+
| GitHub Actions | CI/CD |` },
|
|
383
|
+
architecture_diagram: { body: `## System Architecture
|
|
384
|
+
|
|
385
|
+
**Level:** container
|
|
386
|
+
**Notation:** C4
|
|
387
|
+
|
|
388
|
+
### Description
|
|
389
|
+
High-level system architecture showing main containers and their interactions.
|
|
390
|
+
|
|
391
|
+
### Diagram
|
|
392
|
+
\`\`\`
|
|
393
|
+
[User] --> [Web App (Next.js)]
|
|
394
|
+
[Web App] --> [Database (Supabase)]
|
|
395
|
+
[Web App] --> [Auth (Clerk)]
|
|
396
|
+
[AI Agent] --> [MCP Server]
|
|
397
|
+
[MCP Server] --> [API]
|
|
398
|
+
[API] --> [Database]
|
|
399
|
+
\`\`\`` },
|
|
400
|
+
integration: { subfolder: "integrations", frontmatterLinks: `decisions_ref: # Decisions related to this integration
|
|
401
|
+
- _example-decision
|
|
402
|
+
links: # Universal links
|
|
403
|
+
- target: _example-task
|
|
404
|
+
label: relates_to
|
|
405
|
+
- target: _example-epic
|
|
406
|
+
label: relates_to`, body: `## GitHub Integration
|
|
407
|
+
|
|
408
|
+
**Provider:** GitHub
|
|
409
|
+
**Type:** oauth
|
|
410
|
+
**Status:** planned
|
|
411
|
+
|
|
412
|
+
### Purpose
|
|
413
|
+
Connect GitHub repositories to sync PRs, issues, and code context.
|
|
414
|
+
|
|
415
|
+
### API Details
|
|
416
|
+
**Base URL:** https://api.github.com
|
|
417
|
+
**Auth Method:** OAuth 2.0
|
|
418
|
+
**Rate Limit:** 5000 requests/hour
|
|
419
|
+
|
|
420
|
+
### Data Flow
|
|
421
|
+
1. User connects GitHub account via OAuth
|
|
422
|
+
2. App reads repository metadata
|
|
423
|
+
3. PRs are linked to relevant blocks` },
|
|
424
|
+
dev_setup: { body: `## Local Development Setup
|
|
425
|
+
|
|
426
|
+
### Prerequisites
|
|
427
|
+
- Node.js 20+
|
|
428
|
+
- npm or pnpm
|
|
429
|
+
- Git
|
|
430
|
+
|
|
431
|
+
### Quick Start
|
|
432
|
+
\`\`\`bash
|
|
433
|
+
git clone <repo-url>
|
|
434
|
+
cd project
|
|
435
|
+
npm install
|
|
436
|
+
cp .env.example .env.local
|
|
437
|
+
npm run dev
|
|
438
|
+
\`\`\`
|
|
439
|
+
|
|
440
|
+
### Environment Variables
|
|
441
|
+
| Variable | Description | Required |
|
|
442
|
+
|----------|-------------|----------|
|
|
443
|
+
| DATABASE_URL | Supabase connection string | Yes |
|
|
444
|
+
| CLERK_SECRET_KEY | Auth provider key | Yes |` },
|
|
445
|
+
api_endpoint: { subfolder: "api", body: `## GET /api/blocks
|
|
446
|
+
|
|
447
|
+
**Method:** GET
|
|
448
|
+
**Auth:** Required (API key)
|
|
449
|
+
|
|
450
|
+
### Description
|
|
451
|
+
List all blocks for a project, optionally filtered by section.
|
|
452
|
+
|
|
453
|
+
### Parameters
|
|
454
|
+
| Parameter | Type | Required | Description |
|
|
455
|
+
|-----------|------|----------|-------------|
|
|
456
|
+
| section | string | No | Filter by section type |
|
|
457
|
+
| status | string | No | Filter by status |
|
|
458
|
+
|
|
459
|
+
### Response
|
|
460
|
+
\`\`\`json
|
|
461
|
+
{
|
|
462
|
+
"blocks": [
|
|
463
|
+
{ "key": "example", "type": "feature", "status": "draft" }
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
\`\`\`` },
|
|
467
|
+
api_spec: { body: `## API Specification
|
|
468
|
+
|
|
469
|
+
**Version:** v1
|
|
470
|
+
**Base URL:** /api/v1
|
|
471
|
+
**Auth:** API key via X-API-Key header
|
|
472
|
+
|
|
473
|
+
### Overview
|
|
474
|
+
RESTful API for managing project blocks and context.
|
|
475
|
+
|
|
476
|
+
### Authentication
|
|
477
|
+
All endpoints require an API key passed in the X-API-Key header.` },
|
|
478
|
+
data_model: { subfolder: "models", body: `## Block Model
|
|
479
|
+
|
|
480
|
+
### Fields
|
|
481
|
+
| Field | Type | Required | Description |
|
|
482
|
+
|-------|------|----------|-------------|
|
|
483
|
+
| id | UUID | Auto | Primary key |
|
|
484
|
+
| key | string | Yes | Unique identifier |
|
|
485
|
+
| type | string | Yes | Block type |
|
|
486
|
+
| value | JSONB | No | Content |
|
|
487
|
+
| status | string | Yes | draft/complete/empty |
|
|
488
|
+
|
|
489
|
+
### Relationships
|
|
490
|
+
- Belongs to Section (many-to-one)
|
|
491
|
+
- Has many Links (one-to-many)
|
|
492
|
+
|
|
493
|
+
### Indexes
|
|
494
|
+
- Unique: (section_id, key)
|
|
495
|
+
- Index: status` },
|
|
496
|
+
data_schema: { body: `## Database Schema
|
|
497
|
+
|
|
498
|
+
### Overview
|
|
499
|
+
PostgreSQL database with JSONB content storage for flexible block schemas.
|
|
500
|
+
|
|
501
|
+
### Tables Overview
|
|
502
|
+
| Table | Purpose | Row Count |
|
|
503
|
+
|-------|---------|-----------|
|
|
504
|
+
| blocks | Content storage | ~500 |
|
|
505
|
+
| sections | Section groupings | ~15 |
|
|
506
|
+
| projects | Project metadata | ~10 |
|
|
507
|
+
|
|
508
|
+
### Key Design Decisions
|
|
509
|
+
- JSONB for block values (flexible schema per type)
|
|
510
|
+
- UUID primary keys
|
|
511
|
+
- Row Level Security via Supabase` },
|
|
512
|
+
testing_strategy: { body: `## Testing Strategy
|
|
513
|
+
|
|
514
|
+
### Philosophy
|
|
515
|
+
Test behavior, not implementation. Focus on user-facing functionality.
|
|
516
|
+
|
|
517
|
+
### Test Types
|
|
518
|
+
| Type | Tool | Coverage Target |
|
|
519
|
+
|------|------|----------------|
|
|
520
|
+
| Unit | Vitest | 80% |
|
|
521
|
+
| Integration | Playwright | Critical paths |
|
|
522
|
+
| E2E | Playwright | Happy paths |
|
|
523
|
+
|
|
524
|
+
### What to Test
|
|
525
|
+
- API endpoint responses
|
|
526
|
+
- Block CRUD operations
|
|
527
|
+
- Export format correctness` },
|
|
528
|
+
cost_calculator: { body: `## Infrastructure Costs
|
|
529
|
+
|
|
530
|
+
### Monthly Breakdown
|
|
531
|
+
| Service | Tier | Monthly Cost |
|
|
532
|
+
|---------|------|-------------|
|
|
533
|
+
| Vercel | Pro | $20 |
|
|
534
|
+
| Supabase | Pro | $25 |
|
|
535
|
+
| Clerk | Starter | $0 |
|
|
536
|
+
| **Total** | | **$45/mo** |
|
|
537
|
+
|
|
538
|
+
### Scaling Projections
|
|
539
|
+
| Users | Monthly Cost |
|
|
540
|
+
|-------|-------------|
|
|
541
|
+
| 100 | $45 |
|
|
542
|
+
| 1,000 | $150 |
|
|
543
|
+
| 10,000 | $500 |` },
|
|
544
|
+
// Design System
|
|
545
|
+
storybook_link: { body: `## Component Library
|
|
546
|
+
|
|
547
|
+
**Storybook URL:** https://storybook.example.com
|
|
548
|
+
**Repository:** https://github.com/org/design-system
|
|
549
|
+
|
|
550
|
+
### Pages
|
|
551
|
+
- Components
|
|
552
|
+
- Tokens
|
|
553
|
+
- Patterns
|
|
554
|
+
|
|
555
|
+
### Access
|
|
556
|
+
Requires EpicContext authentication token.` },
|
|
557
|
+
figma_embed: { body: `## Main Design File
|
|
558
|
+
|
|
559
|
+
**Figma URL:** https://figma.com/file/example
|
|
560
|
+
**Last Updated:** 2025-01-15
|
|
561
|
+
|
|
562
|
+
### Pages
|
|
563
|
+
- Home Page
|
|
564
|
+
- Dashboard
|
|
565
|
+
- Settings
|
|
566
|
+
|
|
567
|
+
### Handoff Notes
|
|
568
|
+
Use Auto Layout for all new components. Follow 8px grid.` },
|
|
569
|
+
// Information Architecture
|
|
570
|
+
ia_tree: { body: `## Application Structure
|
|
571
|
+
|
|
572
|
+
### Description
|
|
573
|
+
Main navigation hierarchy for the web application.
|
|
574
|
+
|
|
575
|
+
\`\`\`
|
|
576
|
+
Home
|
|
577
|
+
├── Dashboard
|
|
578
|
+
│ ├── Overview
|
|
579
|
+
│ └── Activity
|
|
580
|
+
├── Projects
|
|
581
|
+
│ ├── Project Detail
|
|
582
|
+
│ │ ├── Sections
|
|
583
|
+
│ │ └── Settings
|
|
584
|
+
│ └── New Project
|
|
585
|
+
├── Settings
|
|
586
|
+
│ ├── Profile
|
|
587
|
+
│ └── Team
|
|
588
|
+
└── Help
|
|
589
|
+
\`\`\`` },
|
|
590
|
+
taxonomy: { subfolder: "taxonomies", body: `## Content Taxonomy
|
|
591
|
+
|
|
592
|
+
### Categories
|
|
593
|
+
| Category | Description | Examples |
|
|
594
|
+
|----------|-------------|----------|
|
|
595
|
+
| Brand | Identity and voice | Colors, typography, tone |
|
|
596
|
+
| Product | Features and vision | Overview, features, roadmap |
|
|
597
|
+
| Technical | Architecture and stack | APIs, data models, setup |
|
|
598
|
+
|
|
599
|
+
### Tags
|
|
600
|
+
- priority: high, medium, low
|
|
601
|
+
- status: draft, complete, empty
|
|
602
|
+
- audience: developer, designer, manager` },
|
|
603
|
+
// Metrics
|
|
604
|
+
metric: { body: `## Weekly Active Users
|
|
605
|
+
|
|
606
|
+
**Metric Type:** kpi
|
|
607
|
+
**Category:** activation
|
|
608
|
+
**Current Value:** 1,200
|
|
609
|
+
**Target:** 2,000
|
|
610
|
+
**Unit:** users
|
|
611
|
+
|
|
612
|
+
### Description
|
|
613
|
+
Number of unique users who perform at least one action per week.
|
|
614
|
+
|
|
615
|
+
### Measurement
|
|
616
|
+
Count distinct user IDs with any event in the last 7 days.
|
|
617
|
+
|
|
618
|
+
### Cadence
|
|
619
|
+
Measured weekly, reported in Monday standup.` },
|
|
620
|
+
north_star: { body: `## Blocks Completed Per Week
|
|
621
|
+
|
|
622
|
+
**Metric Type:** north_star
|
|
623
|
+
**Category:** activation
|
|
624
|
+
**Current Value:** 450
|
|
625
|
+
**Target:** 1,000
|
|
626
|
+
**Unit:** blocks
|
|
627
|
+
|
|
628
|
+
### Description
|
|
629
|
+
Total blocks marked as "complete" across all projects per week.
|
|
630
|
+
|
|
631
|
+
### Why This Metric
|
|
632
|
+
Blocks completed = documentation being actively maintained = product delivering value.` },
|
|
633
|
+
kpi: { body: `## Documentation Completeness
|
|
634
|
+
|
|
635
|
+
**Metric Type:** kpi
|
|
636
|
+
**Category:** activation
|
|
637
|
+
**Current Value:** 62%
|
|
638
|
+
**Target:** 80%
|
|
639
|
+
**Unit:** percent
|
|
640
|
+
|
|
641
|
+
### Description
|
|
642
|
+
Percentage of blocks with status "complete" across all sections.` },
|
|
643
|
+
analytics_event: { body: `## block_completed
|
|
644
|
+
|
|
645
|
+
**Category:** activation
|
|
646
|
+
**Trigger:** User marks a block as complete
|
|
647
|
+
|
|
648
|
+
### Properties
|
|
649
|
+
| Property | Type | Description |
|
|
650
|
+
|----------|------|-------------|
|
|
651
|
+
| block_type | string | Type of block completed |
|
|
652
|
+
| section | string | Section the block belongs to |
|
|
653
|
+
| time_to_complete | number | Seconds from creation to completion |` },
|
|
654
|
+
// Decisions
|
|
655
|
+
decision: { frontmatterLinks: `epics_ref: # Epics affected by this decision
|
|
656
|
+
- _example-epic
|
|
657
|
+
integrations_ref: # Integrations related to this decision
|
|
658
|
+
- _example-integration
|
|
659
|
+
links: # Universal links
|
|
660
|
+
- target: _example-feature
|
|
661
|
+
label: informs
|
|
662
|
+
- target: _example-competitor
|
|
663
|
+
label: references`, body: `## Use Supabase for Database
|
|
664
|
+
|
|
665
|
+
**Status:** accepted
|
|
666
|
+
**Date:** 2025-01-15
|
|
667
|
+
**Deciders:** Engineering team
|
|
668
|
+
|
|
669
|
+
### Context
|
|
670
|
+
Need a database solution that supports real-time, authentication, and JSONB storage.
|
|
671
|
+
|
|
672
|
+
### Options Considered
|
|
673
|
+
|
|
674
|
+
#### Option 1: Supabase
|
|
675
|
+
- **Pros:** Built-in auth, real-time, PostgreSQL, generous free tier
|
|
676
|
+
- **Cons:** Vendor lock-in, limited customization
|
|
677
|
+
|
|
678
|
+
#### Option 2: PlanetScale
|
|
679
|
+
- **Pros:** MySQL, great scaling
|
|
680
|
+
- **Cons:** No JSONB support, separate auth needed
|
|
681
|
+
|
|
682
|
+
### Decision
|
|
683
|
+
Choose Supabase for its combination of PostgreSQL, built-in auth, and real-time capabilities.
|
|
684
|
+
|
|
685
|
+
### Consequences
|
|
686
|
+
- Committed to PostgreSQL ecosystem
|
|
687
|
+
- Use Row Level Security for authorization
|
|
688
|
+
- Real-time updates available for free` },
|
|
689
|
+
meeting_notes: { body: `## Sprint Planning - Week 12
|
|
690
|
+
|
|
691
|
+
**Date:** 2025-03-15
|
|
692
|
+
**Attendees:** Engineering team
|
|
693
|
+
|
|
694
|
+
### Discussion Points
|
|
695
|
+
1. Review of completed work from last sprint
|
|
696
|
+
2. Prioritization of upcoming features
|
|
697
|
+
3. Technical debt items
|
|
698
|
+
|
|
699
|
+
### Decisions Made
|
|
700
|
+
- Prioritize export API for next sprint
|
|
701
|
+
- Defer dark mode to Q2
|
|
702
|
+
|
|
703
|
+
### Action Items
|
|
704
|
+
- [ ] Create export API epic
|
|
705
|
+
- [ ] Update roadmap` },
|
|
706
|
+
// Development
|
|
707
|
+
epic: { subfolder: "epics", frontmatterLinks: `product_ref: _example-product-overview # Link to parent product
|
|
708
|
+
stories_ref: # List user stories in this epic
|
|
709
|
+
- _example-user-story
|
|
710
|
+
links: # Universal links to related blocks across sections
|
|
711
|
+
- target: _example-persona
|
|
712
|
+
label: relates_to
|
|
713
|
+
- target: _example-decision
|
|
714
|
+
label: implements`, body: `## Context Export System
|
|
715
|
+
|
|
716
|
+
**Priority:** high
|
|
717
|
+
**Status:** planned
|
|
718
|
+
**Estimated Effort:** 3 sprints
|
|
719
|
+
|
|
720
|
+
### Goal
|
|
721
|
+
Enable teams to export their entire product context in multiple formats for AI agent consumption.
|
|
722
|
+
|
|
723
|
+
### Scope
|
|
724
|
+
- Markdown export (full project)
|
|
725
|
+
- llms.txt format
|
|
726
|
+
- JSON API endpoint
|
|
727
|
+
- MCP server integration
|
|
728
|
+
|
|
729
|
+
### Success Criteria
|
|
730
|
+
- [ ] Export generates valid markdown
|
|
731
|
+
- [ ] AI agents can consume exported context
|
|
732
|
+
- [ ] Export updates automatically on content change` },
|
|
733
|
+
user_story: { subfolder: "stories", frontmatterLinks: `epic_ref: _example-epic # REQUIRED: Link to parent epic
|
|
734
|
+
personas_ref: # Who this story is for
|
|
735
|
+
- _example-persona
|
|
736
|
+
links: # Universal links to related blocks
|
|
737
|
+
- target: _example-feature
|
|
738
|
+
label: implements
|
|
739
|
+
- target: _example-jtbd
|
|
740
|
+
label: relates_to`, body: `## Export Context as Markdown
|
|
741
|
+
|
|
742
|
+
**Priority:** high
|
|
743
|
+
**Status:** planned
|
|
744
|
+
**Story Points:** 5
|
|
745
|
+
|
|
746
|
+
### User Story
|
|
747
|
+
As a developer, I want to export my project context as markdown, so my AI coding agent can read it.
|
|
748
|
+
|
|
749
|
+
### Acceptance Criteria
|
|
750
|
+
- [ ] Export button on project settings page
|
|
751
|
+
- [ ] Generates valid markdown with frontmatter
|
|
752
|
+
- [ ] Includes all sections and blocks
|
|
753
|
+
- [ ] Downloads as .zip file` },
|
|
754
|
+
task: { subfolder: "tasks", frontmatterLinks: `story_ref: _example-user-story # REQUIRED: Link to parent user story
|
|
755
|
+
links: # Universal links to related blocks
|
|
756
|
+
- target: _example-integration
|
|
757
|
+
label: depends_on
|
|
758
|
+
- target: _example-decision
|
|
759
|
+
label: implements`, body: `## Implement Markdown Export API
|
|
760
|
+
|
|
761
|
+
**Priority:** high
|
|
762
|
+
**Status:** planned
|
|
763
|
+
**Estimated Hours:** 8
|
|
764
|
+
|
|
765
|
+
### Description
|
|
766
|
+
Create a GET endpoint at /api/projects/[id]/markdown that generates a full markdown export of all project blocks.
|
|
767
|
+
|
|
768
|
+
### Technical Approach
|
|
769
|
+
1. Query all blocks for project
|
|
770
|
+
2. Group by section
|
|
771
|
+
3. Apply markdown templates per block type
|
|
772
|
+
4. Return as downloadable zip
|
|
773
|
+
|
|
774
|
+
### Files to Modify
|
|
775
|
+
- \`lib/export/to-markdown.ts\`
|
|
776
|
+
- \`app/api/projects/[projectId]/markdown/route.ts\`` },
|
|
777
|
+
roadmap: { body: `## Q1 2025 Roadmap
|
|
778
|
+
|
|
779
|
+
**Planning Horizon:** quarterly
|
|
780
|
+
|
|
781
|
+
### Milestones
|
|
782
|
+
|
|
783
|
+
#### January: Foundation
|
|
784
|
+
- Core block editor
|
|
785
|
+
- Authentication system
|
|
786
|
+
- Basic sections
|
|
787
|
+
|
|
788
|
+
#### February: Export
|
|
789
|
+
- Markdown export
|
|
790
|
+
- llms.txt format
|
|
791
|
+
- API endpoints
|
|
792
|
+
|
|
793
|
+
#### March: Collaboration
|
|
794
|
+
- Team invites
|
|
795
|
+
- Activity log
|
|
796
|
+
- Comments` },
|
|
797
|
+
impact_effort_matrix: { body: `## Product Prioritization Matrix
|
|
798
|
+
|
|
799
|
+
### High Impact / Low Effort
|
|
800
|
+
- Smart notifications
|
|
801
|
+
- Keyboard shortcuts
|
|
802
|
+
- Export improvements
|
|
803
|
+
|
|
804
|
+
### High Impact / High Effort
|
|
805
|
+
- AI-assisted documentation
|
|
806
|
+
- Real-time collaboration
|
|
807
|
+
- Mobile app
|
|
808
|
+
|
|
809
|
+
### Low Impact / Low Effort
|
|
810
|
+
- Dark mode
|
|
811
|
+
- Custom themes
|
|
812
|
+
|
|
813
|
+
### Low Impact / High Effort
|
|
814
|
+
- Offline support
|
|
815
|
+
- Video embeds` },
|
|
816
|
+
kanban_board: { body: `## Sprint Board
|
|
817
|
+
|
|
818
|
+
### Backlog
|
|
819
|
+
- Implement search
|
|
820
|
+
- Add filtering
|
|
821
|
+
|
|
822
|
+
### In Progress
|
|
823
|
+
- Export API endpoint
|
|
824
|
+
- Block editor improvements
|
|
825
|
+
|
|
826
|
+
### Review
|
|
827
|
+
- Authentication flow
|
|
828
|
+
|
|
829
|
+
### Done
|
|
830
|
+
- Project creation
|
|
831
|
+
- Section navigation` },
|
|
832
|
+
// Business Strategy
|
|
833
|
+
ogsm: { body: `## Annual OGSM
|
|
834
|
+
|
|
835
|
+
### Objective
|
|
836
|
+
Become the leading context management platform for product teams.
|
|
837
|
+
|
|
838
|
+
### Goals
|
|
839
|
+
| Goal | Metric | Target |
|
|
840
|
+
|------|--------|--------|
|
|
841
|
+
| Growth | Monthly Active Users | 10,000 |
|
|
842
|
+
| Revenue | ARR | $1M |
|
|
843
|
+
| Quality | NPS | 50+ |
|
|
844
|
+
|
|
845
|
+
### Strategies
|
|
846
|
+
1. Focus on developer experience
|
|
847
|
+
2. Build AI-native integrations
|
|
848
|
+
3. Create viral onboarding loop
|
|
849
|
+
|
|
850
|
+
### Measures
|
|
851
|
+
- Weekly active users growth rate
|
|
852
|
+
- Conversion from free to paid
|
|
853
|
+
- Feature adoption rate` },
|
|
854
|
+
business_model_canvas: { body: `## Business Model Canvas
|
|
855
|
+
|
|
856
|
+
### Key Partners
|
|
857
|
+
- AI tool providers (Anthropic, OpenAI)
|
|
858
|
+
- Cloud providers (Vercel, Supabase)
|
|
859
|
+
|
|
860
|
+
### Key Activities
|
|
861
|
+
- Platform development
|
|
862
|
+
- AI integration partnerships
|
|
863
|
+
- Developer community building
|
|
864
|
+
|
|
865
|
+
### Value Propositions
|
|
866
|
+
- Single source of truth for product context
|
|
867
|
+
- AI-consumable documentation
|
|
868
|
+
|
|
869
|
+
### Customer Segments
|
|
870
|
+
- Small product teams (5-20)
|
|
871
|
+
- Mid-market teams (20-50)
|
|
872
|
+
|
|
873
|
+
### Revenue Streams
|
|
874
|
+
- SaaS subscription ($10-25/user/month)
|
|
875
|
+
- Enterprise tier` },
|
|
876
|
+
swot_analysis: { body: `## SWOT Analysis
|
|
877
|
+
|
|
878
|
+
### Strengths
|
|
879
|
+
- First-mover in AI-native documentation
|
|
880
|
+
- Strong technical foundation
|
|
881
|
+
- MCP integration
|
|
882
|
+
|
|
883
|
+
### Weaknesses
|
|
884
|
+
- Small team
|
|
885
|
+
- No brand recognition yet
|
|
886
|
+
- Limited funding
|
|
887
|
+
|
|
888
|
+
### Opportunities
|
|
889
|
+
- Growing AI tool adoption
|
|
890
|
+
- Developer tool market expanding
|
|
891
|
+
- Remote work driving documentation needs
|
|
892
|
+
|
|
893
|
+
### Threats
|
|
894
|
+
- Large players (Notion, Confluence) adding AI
|
|
895
|
+
- New entrants with similar vision
|
|
896
|
+
- Market downturn reducing tool budgets` },
|
|
897
|
+
porters_five_forces: { body: `## Porter's Five Forces Analysis
|
|
898
|
+
|
|
899
|
+
### Threat of New Entrants
|
|
900
|
+
**Rating:** Medium
|
|
901
|
+
New developer tools launch frequently, but our MCP integration creates a defensible moat.
|
|
902
|
+
|
|
903
|
+
### Bargaining Power of Suppliers
|
|
904
|
+
**Rating:** Low
|
|
905
|
+
Cloud infrastructure is commoditized with many providers.
|
|
906
|
+
|
|
907
|
+
### Bargaining Power of Buyers
|
|
908
|
+
**Rating:** High
|
|
909
|
+
Many alternatives exist; switching costs are moderate.
|
|
910
|
+
|
|
911
|
+
### Threat of Substitutes
|
|
912
|
+
**Rating:** Medium
|
|
913
|
+
Teams could use wikis, docs, or custom solutions.
|
|
914
|
+
|
|
915
|
+
### Competitive Rivalry
|
|
916
|
+
**Rating:** High
|
|
917
|
+
Crowded market with well-funded competitors.` },
|
|
918
|
+
strategic_group_map: { body: `## Market Positioning Map
|
|
919
|
+
|
|
920
|
+
### Dimensions
|
|
921
|
+
- **X-axis:** Target audience (Individual → Enterprise)
|
|
922
|
+
- **Y-axis:** Complexity (Simple → Complex)
|
|
923
|
+
|
|
924
|
+
### Our Position
|
|
925
|
+
We target the "developer sweet spot" — more powerful than Trello but simpler than Jira, with AI-native capabilities.
|
|
926
|
+
|
|
927
|
+
### Movement Strategy
|
|
928
|
+
1. **Launch:** Start with small teams
|
|
929
|
+
2. **Grow:** Move to mid-market
|
|
930
|
+
3. **Defend:** AI moat prevents commoditization` },
|
|
931
|
+
obeya_board: { body: `## Product Obeya Board
|
|
932
|
+
|
|
933
|
+
### Vision & Strategy (North Wall)
|
|
934
|
+
Platform vision: Make product context accessible to both humans and AI.
|
|
935
|
+
|
|
936
|
+
### Performance Metrics (East Wall)
|
|
937
|
+
| Metric | Current | Target |
|
|
938
|
+
|--------|---------|--------|
|
|
939
|
+
| WAU | 1,200 | 2,000 |
|
|
940
|
+
| Completion Rate | 62% | 80% |
|
|
941
|
+
|
|
942
|
+
### Problem Solving (South Wall)
|
|
943
|
+
- Issue: Slow import for large projects
|
|
944
|
+
- Root cause: Sequential file processing
|
|
945
|
+
- Solution: Parallel batch processing
|
|
946
|
+
|
|
947
|
+
### Improvement Activities (West Wall)
|
|
948
|
+
- Improve onboarding flow
|
|
949
|
+
- Add template library
|
|
950
|
+
- Build API documentation` },
|
|
951
|
+
// Marketing
|
|
952
|
+
marketing_campaign: { subfolder: "campaigns", body: `## Developer Launch Campaign
|
|
953
|
+
|
|
954
|
+
**Platform:** twitter
|
|
955
|
+
**Status:** planned
|
|
956
|
+
**Budget:** $5,000
|
|
957
|
+
**Start Date:** 2025-04-01
|
|
958
|
+
**End Date:** 2025-04-30
|
|
959
|
+
|
|
960
|
+
### Objective
|
|
961
|
+
Drive 1,000 sign-ups from the developer community.
|
|
962
|
+
|
|
963
|
+
### Target Audience
|
|
964
|
+
Software developers and product managers at small teams.
|
|
965
|
+
|
|
966
|
+
### Creative Assets
|
|
967
|
+
- Launch video (60s)
|
|
968
|
+
- Product screenshots
|
|
969
|
+
- Developer testimonials` },
|
|
970
|
+
seo_content: { subfolder: "seo", body: `## Product Context Management Guide
|
|
971
|
+
|
|
972
|
+
**Target Keyword:** product context management
|
|
973
|
+
**Search Intent:** informational
|
|
974
|
+
**Status:** planned
|
|
975
|
+
|
|
976
|
+
### Meta Title
|
|
977
|
+
Product Context Management: The Complete Guide for Teams
|
|
978
|
+
|
|
979
|
+
### Meta Description
|
|
980
|
+
Learn how product teams manage context documentation effectively. Discover tools and best practices for keeping your team aligned.
|
|
981
|
+
|
|
982
|
+
### Content Outline
|
|
983
|
+
1. What is product context?
|
|
984
|
+
2. Why documentation fails
|
|
985
|
+
3. Structured vs. unstructured approaches
|
|
986
|
+
4. Tools comparison
|
|
987
|
+
5. Getting started guide` },
|
|
988
|
+
// Environments
|
|
989
|
+
environment_link: { body: `## Production Environment
|
|
990
|
+
|
|
991
|
+
**URL:** https://app.example.com
|
|
992
|
+
**Environment Type:** production
|
|
993
|
+
**Status:** active
|
|
994
|
+
|
|
995
|
+
### Infrastructure
|
|
996
|
+
- Hosted on Vercel
|
|
997
|
+
- Database: Supabase (us-east-1)
|
|
998
|
+
- CDN: Vercel Edge Network
|
|
999
|
+
|
|
1000
|
+
### Monitoring
|
|
1001
|
+
- Uptime: Better Stack
|
|
1002
|
+
- Errors: Sentry
|
|
1003
|
+
- Analytics: PostHog` },
|
|
1004
|
+
release_note: { body: `## v1.2.0 - Export System
|
|
1005
|
+
|
|
1006
|
+
**Version:** 1.2.0
|
|
1007
|
+
**Date:** 2025-03-01
|
|
1008
|
+
**Type:** feature
|
|
1009
|
+
|
|
1010
|
+
### What's New
|
|
1011
|
+
- Markdown export for full projects
|
|
1012
|
+
- llms.txt format support
|
|
1013
|
+
- JSON API endpoint for AI agents
|
|
1014
|
+
|
|
1015
|
+
### Bug Fixes
|
|
1016
|
+
- Fixed block save race condition
|
|
1017
|
+
- Corrected section ordering
|
|
1018
|
+
|
|
1019
|
+
### Breaking Changes
|
|
1020
|
+
None` },
|
|
1021
|
+
// Reports
|
|
1022
|
+
one_pager: { subfolder: "one-pagers", body: `## Product Launch Brief
|
|
1023
|
+
|
|
1024
|
+
**Category:** business_case
|
|
1025
|
+
**Confidence:** high
|
|
1026
|
+
|
|
1027
|
+
### Executive Summary
|
|
1028
|
+
EpicContext is ready for public launch. Core features are complete, early users show strong engagement.
|
|
1029
|
+
|
|
1030
|
+
### Key Insights
|
|
1031
|
+
1. 62% documentation completion rate among active users
|
|
1032
|
+
2. AI agents consume context 10x faster than traditional docs
|
|
1033
|
+
3. Onboarding time reduced from 30min to 5min with templates
|
|
1034
|
+
|
|
1035
|
+
### Recommendation
|
|
1036
|
+
Proceed with public launch, focusing on developer community.` },
|
|
1037
|
+
// Section Guide (generic - used across all sections)
|
|
1038
|
+
section_guide: { body: `## Overview
|
|
1039
|
+
|
|
1040
|
+
This section contains [description of section content].
|
|
1041
|
+
|
|
1042
|
+
## Guidelines
|
|
1043
|
+
|
|
1044
|
+
### What Belongs Here
|
|
1045
|
+
- [List of content types for this section]
|
|
1046
|
+
|
|
1047
|
+
### Best Practices
|
|
1048
|
+
- Keep blocks focused on a single topic
|
|
1049
|
+
- Link related blocks using frontmatter references
|
|
1050
|
+
- Update status as content is completed
|
|
1051
|
+
|
|
1052
|
+
## Resources
|
|
1053
|
+
- See AI-GUIDE.md for format rules
|
|
1054
|
+
- See .ai-guides/ for detailed schemas` },
|
|
1055
|
+
};
|
|
4
1056
|
// Section metadata for modular AI guides
|
|
5
1057
|
// Note: "section_guide" is allowed in ALL sections but is a generic/admin type
|
|
6
1058
|
const SECTION_INFO = {
|
|
@@ -350,12 +1402,12 @@ updated: ${today}
|
|
|
350
1402
|
/**
|
|
351
1403
|
* Generate all section guides in the .ai-guides folder
|
|
352
1404
|
*/
|
|
353
|
-
function generateSectionGuides(aiGuidesDir) {
|
|
1405
|
+
function generateSectionGuides(aiGuidesDir, forceOverwrite) {
|
|
354
1406
|
for (const [sectionKey, info] of Object.entries(SECTION_INFO)) {
|
|
355
1407
|
const guideContent = generateSectionGuide(sectionKey);
|
|
356
1408
|
if (guideContent) {
|
|
357
1409
|
const guidePath = path.join(aiGuidesDir, `${info.folder}-guide.md`);
|
|
358
|
-
if (!fs.existsSync(guidePath)) {
|
|
1410
|
+
if (forceOverwrite || !fs.existsSync(guidePath)) {
|
|
359
1411
|
fs.writeFileSync(guidePath, guideContent, "utf-8");
|
|
360
1412
|
}
|
|
361
1413
|
}
|
|
@@ -381,9 +1433,9 @@ export function readContextFolder(contextPath) {
|
|
|
381
1433
|
}
|
|
382
1434
|
}
|
|
383
1435
|
else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
384
|
-
// Skip README
|
|
1436
|
+
// Skip README, AI-GUIDE, and _example-* files
|
|
385
1437
|
const lowerName = entry.name.toLowerCase();
|
|
386
|
-
if (lowerName !== "readme.md" && lowerName !== "ai-guide.md") {
|
|
1438
|
+
if (lowerName !== "readme.md" && lowerName !== "ai-guide.md" && !entry.name.startsWith("_example-")) {
|
|
387
1439
|
const content = fs.readFileSync(fullPath, "utf-8");
|
|
388
1440
|
files.push({
|
|
389
1441
|
path: relativePath,
|
|
@@ -548,7 +1600,104 @@ npx @epiccontext/mcp add-app ./apps/my-app --name "my-app"
|
|
|
548
1600
|
`, "utf-8");
|
|
549
1601
|
}
|
|
550
1602
|
}
|
|
551
|
-
|
|
1603
|
+
/**
|
|
1604
|
+
* Generate _example-*.md files for each block type in each section.
|
|
1605
|
+
* These show AI agents the correct heading structure and format.
|
|
1606
|
+
* They are skipped by readContextFolder, push, and import pipelines.
|
|
1607
|
+
*/
|
|
1608
|
+
/**
|
|
1609
|
+
* Check if a section directory has any real (non-example, non-README) markdown files
|
|
1610
|
+
*/
|
|
1611
|
+
function sectionHasRealBlocks(sectionDir) {
|
|
1612
|
+
function check(dir) {
|
|
1613
|
+
if (!fs.existsSync(dir))
|
|
1614
|
+
return false;
|
|
1615
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
1616
|
+
for (const entry of entries) {
|
|
1617
|
+
if (entry.isDirectory() && !entry.name.startsWith(".")) {
|
|
1618
|
+
if (check(path.join(dir, entry.name)))
|
|
1619
|
+
return true;
|
|
1620
|
+
}
|
|
1621
|
+
else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
1622
|
+
const lower = entry.name.toLowerCase();
|
|
1623
|
+
if (lower !== "readme.md" && !entry.name.startsWith("_example-")) {
|
|
1624
|
+
return true;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
return check(sectionDir);
|
|
1631
|
+
}
|
|
1632
|
+
function generateExampleFiles(contextPath, skipIfHasBlocks) {
|
|
1633
|
+
const today = new Date().toISOString().split("T")[0];
|
|
1634
|
+
// When upgrading, check which sections already have real blocks
|
|
1635
|
+
const sectionsWithBlocks = new Set();
|
|
1636
|
+
if (skipIfHasBlocks) {
|
|
1637
|
+
for (const [_key, info] of Object.entries(SECTION_INFO)) {
|
|
1638
|
+
const sectionDir = path.join(contextPath, info.folder);
|
|
1639
|
+
if (fs.existsSync(sectionDir)) {
|
|
1640
|
+
if (sectionHasRealBlocks(sectionDir)) {
|
|
1641
|
+
sectionsWithBlocks.add(info.folder);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
for (const [_sectionKey, info] of Object.entries(SECTION_INFO)) {
|
|
1647
|
+
// Skip sections that already have real blocks (upgrade mode)
|
|
1648
|
+
if (skipIfHasBlocks && sectionsWithBlocks.has(info.folder))
|
|
1649
|
+
continue;
|
|
1650
|
+
for (const blockType of info.blockTypes) {
|
|
1651
|
+
const example = BLOCK_TYPE_EXAMPLES[blockType];
|
|
1652
|
+
if (!example)
|
|
1653
|
+
continue;
|
|
1654
|
+
// Determine target folder (some block types use subfolders)
|
|
1655
|
+
let targetDir = path.join(contextPath, info.folder);
|
|
1656
|
+
if (example.subfolder) {
|
|
1657
|
+
targetDir = path.join(targetDir, example.subfolder);
|
|
1658
|
+
}
|
|
1659
|
+
// Ensure subfolder exists
|
|
1660
|
+
if (!fs.existsSync(targetDir)) {
|
|
1661
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
1662
|
+
}
|
|
1663
|
+
const filename = `_example-${blockType.replace(/_/g, "-")}.md`;
|
|
1664
|
+
const filePath = path.join(targetDir, filename);
|
|
1665
|
+
// Don't overwrite existing example files
|
|
1666
|
+
if (fs.existsSync(filePath))
|
|
1667
|
+
continue;
|
|
1668
|
+
// Use the section key that matches the folder (handle hyphen vs underscore)
|
|
1669
|
+
const sectionForFrontmatter = info.folder;
|
|
1670
|
+
// Build frontmatter with optional link examples
|
|
1671
|
+
const frontmatterLines = [
|
|
1672
|
+
`type: ${blockType}`,
|
|
1673
|
+
`section: ${sectionForFrontmatter}`,
|
|
1674
|
+
`key: _example-${blockType.replace(/_/g, "-")}`,
|
|
1675
|
+
`name: "Example ${blockType.split("_").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(" ")}"`,
|
|
1676
|
+
`status: draft`,
|
|
1677
|
+
`created: ${today}`,
|
|
1678
|
+
`updated: ${today}`,
|
|
1679
|
+
];
|
|
1680
|
+
// Add link examples if this block type has them
|
|
1681
|
+
if (example.frontmatterLinks) {
|
|
1682
|
+
frontmatterLines.push(example.frontmatterLinks);
|
|
1683
|
+
}
|
|
1684
|
+
const content = `---
|
|
1685
|
+
${frontmatterLines.join("\n")}
|
|
1686
|
+
---
|
|
1687
|
+
|
|
1688
|
+
# Example: ${blockType.split("_").map(w => w.charAt(0).toUpperCase() + w.slice(1)).join(" ")}
|
|
1689
|
+
|
|
1690
|
+
> **This is an example file.** Delete it after you've created your own ${blockType} block.
|
|
1691
|
+
> It shows the correct heading structure, format, and **how to link** for traceability.
|
|
1692
|
+
> Every block must trace back to what created it and forward to what it enables — see frontmatter above.
|
|
1693
|
+
|
|
1694
|
+
${example.body}
|
|
1695
|
+
`;
|
|
1696
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
export function ensureContextFolder(contextPath, options = {}) {
|
|
552
1701
|
if (!fs.existsSync(contextPath)) {
|
|
553
1702
|
fs.mkdirSync(contextPath, { recursive: true });
|
|
554
1703
|
}
|
|
@@ -639,11 +1788,11 @@ epicontext watch
|
|
|
639
1788
|
if (!fs.existsSync(aiGuidesDir)) {
|
|
640
1789
|
fs.mkdirSync(aiGuidesDir, { recursive: true });
|
|
641
1790
|
}
|
|
642
|
-
// Generate section-specific guides
|
|
643
|
-
generateSectionGuides(aiGuidesDir);
|
|
1791
|
+
// Generate section-specific guides (force overwrite on upgrade)
|
|
1792
|
+
generateSectionGuides(aiGuidesDir, options.forceRegenerateGuides);
|
|
644
1793
|
// Create AI-GUIDE.md (slim core version) with detailed format instructions
|
|
645
1794
|
const aiGuidePath = path.join(contextPath, "AI-GUIDE.md");
|
|
646
|
-
if (!fs.existsSync(aiGuidePath)) {
|
|
1795
|
+
if (options.forceRegenerateGuides || !fs.existsSync(aiGuidePath)) {
|
|
647
1796
|
const aiGuide = generateCoreAIGuide();
|
|
648
1797
|
fs.writeFileSync(aiGuidePath, aiGuide, "utf-8");
|
|
649
1798
|
}
|
|
@@ -853,7 +2002,7 @@ Reports should always reference source blocks (personas, journeys, research) for
|
|
|
853
2002
|
};
|
|
854
2003
|
for (const section of defaultSections) {
|
|
855
2004
|
const sectionReadmePath = path.join(contextPath, section, "README.md");
|
|
856
|
-
if (!fs.existsSync(sectionReadmePath)) {
|
|
2005
|
+
if (options.forceRegenerateGuides || !fs.existsSync(sectionReadmePath)) {
|
|
857
2006
|
const sectionInfo = sectionDescriptions[section];
|
|
858
2007
|
const description = sectionInfo?.description || section;
|
|
859
2008
|
const guidance = sectionInfo?.guidance || "Add blocks via the EpicContext app or create markdown files with proper frontmatter.";
|
|
@@ -883,6 +2032,8 @@ See \`AI-GUIDE.md\` in the root CONTEXT folder for detailed format instructions.
|
|
|
883
2032
|
fs.writeFileSync(sectionReadmePath, sectionReadme, "utf-8");
|
|
884
2033
|
}
|
|
885
2034
|
}
|
|
2035
|
+
// Generate example files for each block type (skipped by push/import)
|
|
2036
|
+
generateExampleFiles(contextPath, options.skipExamplesIfHasBlocks);
|
|
886
2037
|
}
|
|
887
2038
|
/**
|
|
888
2039
|
* Create a sample file with correct frontmatter if it doesn't exist
|