@shahmarasy/prodo 0.1.3 → 0.1.5
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/README.md +201 -97
- package/bin/prodo.cjs +6 -6
- package/dist/agents/agent-registry.d.ts +13 -0
- package/dist/agents/agent-registry.js +79 -0
- package/dist/agents/anthropic/index.d.ts +9 -0
- package/dist/agents/anthropic/index.js +55 -0
- package/dist/agents/base.d.ts +25 -0
- package/dist/agents/base.js +71 -0
- package/dist/agents/google/index.d.ts +9 -0
- package/dist/agents/google/index.js +53 -0
- package/dist/agents/mock/index.d.ts +11 -0
- package/dist/agents/mock/index.js +26 -0
- package/dist/agents/openai/index.d.ts +9 -0
- package/dist/agents/openai/index.js +57 -0
- package/dist/agents/system-prompts.d.ts +3 -0
- package/dist/agents/system-prompts.js +32 -0
- package/dist/agents.js +4 -2
- package/dist/artifacts.d.ts +1 -0
- package/dist/artifacts.js +265 -31
- package/dist/cli/agent-command-installer.d.ts +4 -0
- package/dist/cli/agent-command-installer.js +148 -0
- package/dist/cli/agent-ids.d.ts +15 -0
- package/dist/cli/agent-ids.js +49 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +144 -0
- package/dist/cli/fix-tui.d.ts +4 -0
- package/dist/cli/fix-tui.js +79 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +465 -0
- package/dist/cli/init-tui.d.ts +23 -0
- package/dist/cli/init-tui.js +176 -0
- package/dist/cli/init.d.ts +11 -0
- package/dist/cli/init.js +334 -0
- package/dist/cli/normalize-interactive.d.ts +8 -0
- package/dist/cli/normalize-interactive.js +167 -0
- package/dist/cli/preset-loader.d.ts +4 -0
- package/dist/cli/preset-loader.js +210 -0
- package/dist/cli.js +80 -3
- package/dist/core/artifact-registry.d.ts +11 -0
- package/dist/core/artifact-registry.js +49 -0
- package/dist/core/artifacts.d.ts +10 -0
- package/dist/core/artifacts.js +892 -0
- package/dist/core/clean.d.ts +10 -0
- package/dist/core/clean.js +74 -0
- package/dist/core/consistency.d.ts +8 -0
- package/dist/core/consistency.js +328 -0
- package/dist/core/constants.d.ts +7 -0
- package/dist/core/constants.js +64 -0
- package/dist/core/errors.d.ts +3 -0
- package/dist/core/errors.js +10 -0
- package/dist/core/fix.d.ts +31 -0
- package/dist/core/fix.js +188 -0
- package/dist/core/hook-executor.d.ts +1 -0
- package/dist/core/hook-executor.js +175 -0
- package/dist/core/markdown.d.ts +16 -0
- package/dist/core/markdown.js +81 -0
- package/dist/core/normalize.d.ts +8 -0
- package/dist/core/normalize.js +125 -0
- package/dist/core/normalized-brief.d.ts +48 -0
- package/dist/core/normalized-brief.js +182 -0
- package/dist/core/output-index.d.ts +13 -0
- package/dist/core/output-index.js +55 -0
- package/dist/core/paths.d.ts +17 -0
- package/dist/core/paths.js +80 -0
- package/dist/core/project-config.d.ts +14 -0
- package/dist/core/project-config.js +69 -0
- package/dist/core/registry.d.ts +13 -0
- package/dist/core/registry.js +115 -0
- package/dist/core/settings.d.ts +7 -0
- package/dist/core/settings.js +35 -0
- package/dist/core/template-engine.d.ts +3 -0
- package/dist/core/template-engine.js +43 -0
- package/dist/core/template-resolver.d.ts +15 -0
- package/dist/core/template-resolver.js +46 -0
- package/dist/core/templates.d.ts +33 -0
- package/dist/core/templates.js +440 -0
- package/dist/core/terminology.d.ts +21 -0
- package/dist/core/terminology.js +143 -0
- package/dist/core/tracing.d.ts +21 -0
- package/dist/core/tracing.js +74 -0
- package/dist/core/types.d.ts +35 -0
- package/dist/core/types.js +5 -0
- package/dist/core/utils.d.ts +7 -0
- package/dist/core/utils.js +66 -0
- package/dist/core/validate.d.ts +10 -0
- package/dist/core/validate.js +226 -0
- package/dist/core/validator.d.ts +5 -0
- package/dist/core/validator.js +76 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +30 -0
- package/dist/core/workflow-commands.d.ts +7 -0
- package/dist/core/workflow-commands.js +29 -0
- package/dist/i18n/en.json +45 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.js +63 -0
- package/dist/i18n/tr.json +45 -0
- package/dist/init-tui.d.ts +3 -0
- package/dist/init-tui.js +28 -1
- package/dist/init.d.ts +1 -0
- package/dist/init.js +9 -3
- package/dist/normalize.js +55 -7
- package/dist/providers/index.d.ts +2 -1
- package/dist/providers/index.js +20 -6
- package/dist/providers/mock-provider.d.ts +1 -1
- package/dist/providers/mock-provider.js +7 -6
- package/dist/providers/openai-provider.d.ts +1 -1
- package/dist/providers/openai-provider.js +3 -2
- package/dist/settings.d.ts +1 -0
- package/dist/settings.js +2 -1
- package/dist/skills/engine.d.ts +10 -0
- package/dist/skills/engine.js +75 -0
- package/dist/skills/fix-skill.d.ts +2 -0
- package/dist/skills/fix-skill.js +38 -0
- package/dist/skills/generate-artifact-skill.d.ts +2 -0
- package/dist/skills/generate-artifact-skill.js +32 -0
- package/dist/skills/generate-pipeline-skill.d.ts +2 -0
- package/dist/skills/generate-pipeline-skill.js +45 -0
- package/dist/skills/normalize-skill.d.ts +2 -0
- package/dist/skills/normalize-skill.js +29 -0
- package/dist/skills/types.d.ts +28 -0
- package/dist/skills/types.js +2 -0
- package/dist/skills/validate-skill.d.ts +2 -0
- package/dist/skills/validate-skill.js +29 -0
- package/dist/templates.d.ts +1 -1
- package/dist/templates.js +2 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +13 -0
- package/dist/validator.js +0 -4
- package/dist/workflow-commands.js +2 -1
- package/package.json +74 -45
- package/presets/fintech/preset.json +48 -1
- package/presets/fintech/prompts/prd.md +99 -2
- package/presets/marketplace/preset.json +51 -1
- package/presets/marketplace/prompts/prd.md +140 -2
- package/presets/saas/preset.json +53 -1
- package/presets/saas/prompts/prd.md +150 -2
- package/src/agents/agent-registry.ts +93 -0
- package/src/agents/anthropic/index.ts +86 -0
- package/src/agents/anthropic/manifest.json +7 -0
- package/src/agents/base.ts +77 -0
- package/src/agents/google/index.ts +79 -0
- package/src/agents/google/manifest.json +7 -0
- package/src/agents/mock/index.ts +32 -0
- package/src/agents/mock/manifest.json +7 -0
- package/src/agents/openai/index.ts +83 -0
- package/src/agents/openai/manifest.json +7 -0
- package/src/agents/system-prompts.ts +35 -0
- package/src/{agent-command-installer.ts → cli/agent-command-installer.ts} +164 -164
- package/src/{agents.ts → cli/agent-ids.ts} +58 -56
- package/src/{doctor.ts → cli/doctor.ts} +157 -137
- package/src/cli/fix-tui.ts +111 -0
- package/src/{cli.ts → cli/index.ts} +459 -319
- package/src/{init-tui.ts → cli/init-tui.ts} +208 -179
- package/src/{init.ts → cli/init.ts} +398 -391
- package/src/cli/normalize-interactive.ts +241 -0
- package/src/{preset-loader.ts → cli/preset-loader.ts} +237 -237
- package/src/{artifact-registry.ts → core/artifact-registry.ts} +69 -69
- package/src/{artifacts.ts → core/artifacts.ts} +1081 -777
- package/src/core/clean.ts +88 -0
- package/src/{consistency.ts → core/consistency.ts} +374 -303
- package/src/{constants.ts → core/constants.ts} +72 -72
- package/src/{errors.ts → core/errors.ts} +7 -7
- package/src/core/fix.ts +253 -0
- package/src/{hook-executor.ts → core/hook-executor.ts} +196 -196
- package/src/{markdown.ts → core/markdown.ts} +93 -73
- package/src/core/normalize.ts +145 -0
- package/src/{normalized-brief.ts → core/normalized-brief.ts} +227 -206
- package/src/{output-index.ts → core/output-index.ts} +59 -59
- package/src/{paths.ts → core/paths.ts} +75 -71
- package/src/{project-config.ts → core/project-config.ts} +78 -78
- package/src/{registry.ts → core/registry.ts} +119 -119
- package/src/{settings.ts → core/settings.ts} +35 -34
- package/src/core/template-engine.ts +45 -0
- package/src/{template-resolver.ts → core/template-resolver.ts} +54 -54
- package/src/{templates.ts → core/templates.ts} +452 -450
- package/src/core/terminology.ts +177 -0
- package/src/core/tracing.ts +110 -0
- package/src/{types.ts → core/types.ts} +46 -46
- package/src/{utils.ts → core/utils.ts} +64 -50
- package/src/{validate.ts → core/validate.ts} +252 -246
- package/src/{validator.ts → core/validator.ts} +92 -96
- package/src/{version.ts → core/version.ts} +24 -24
- package/src/{workflow-commands.ts → core/workflow-commands.ts} +32 -31
- package/src/i18n/en.json +45 -0
- package/src/i18n/index.ts +58 -0
- package/src/i18n/tr.json +45 -0
- package/src/providers/index.ts +29 -12
- package/src/providers/mock-provider.ts +200 -199
- package/src/providers/openai-provider.ts +88 -87
- package/src/skills/engine.ts +94 -0
- package/src/skills/fix-skill.ts +38 -0
- package/src/skills/generate-artifact-skill.ts +32 -0
- package/src/skills/generate-pipeline-skill.ts +49 -0
- package/src/skills/normalize-skill.ts +29 -0
- package/src/skills/types.ts +36 -0
- package/src/skills/validate-skill.ts +29 -0
- package/templates/commands/prodo-fix.md +46 -0
- package/templates/commands/prodo-normalize.md +118 -23
- package/templates/commands/prodo-prd.md +138 -17
- package/templates/commands/prodo-stories.md +153 -17
- package/templates/commands/prodo-techspec.md +167 -17
- package/templates/commands/prodo-validate.md +184 -26
- package/templates/commands/prodo-wireframe.md +188 -17
- package/templates/commands/prodo-workflow.md +200 -17
- package/src/normalize.ts +0 -89
|
@@ -1,3 +1,141 @@
|
|
|
1
|
-
Preset
|
|
1
|
+
# Marketplace Preset - PRD Generation Context
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Preset Overview
|
|
4
|
+
**Domain**: Multi-Sided Marketplace
|
|
5
|
+
**Focus**: Trust & safety, multi-stakeholder coordination, sustainable growth, community health
|
|
6
|
+
**Target Models**: B2C, C2C, Gig Economy, Subscription, SaaS Marketplaces
|
|
7
|
+
|
|
8
|
+
## Critical Requirements for Marketplace Products
|
|
9
|
+
|
|
10
|
+
### 1. Multi-Stakeholder Coordination
|
|
11
|
+
- **Buyers**: Search, discovery, purchasing, reviews, ratings
|
|
12
|
+
- **Sellers**: Listing creation, inventory management, order fulfillment
|
|
13
|
+
- **Platform**: Commission structure, dispute resolution, policy enforcement
|
|
14
|
+
- **Moderators**: Content review, policy compliance, community health
|
|
15
|
+
- **Support**: Buyer/seller support, dispute handling, escalations
|
|
16
|
+
|
|
17
|
+
### 2. Trust & Safety Mechanisms
|
|
18
|
+
- **Identity Verification**: Seller verification, buyer profiles, trust scoring
|
|
19
|
+
- **Review System**: Authentic reviews, review moderation, rating accuracy
|
|
20
|
+
- **Dispute Resolution**: Clear process, fair arbitration, appeal mechanisms
|
|
21
|
+
- **Fraud Prevention**: Transaction monitoring, chargeback protection, seller vetting
|
|
22
|
+
- **Community Standards**: Content policies, community guidelines, enforcement
|
|
23
|
+
|
|
24
|
+
### 3. Commission & Payment Systems
|
|
25
|
+
- **Revenue Model**: Commission % for platform sustainability
|
|
26
|
+
- **Payment Processing**: Buyer payments, seller payouts, tax handling
|
|
27
|
+
- **Pricing Strategy**: Dynamic pricing, surge pricing, discounts
|
|
28
|
+
- **Seller Incentives**: Top performer rewards, quality bonuses
|
|
29
|
+
- **Payout Timing**: Immediate, delayed, or tiered payout options
|
|
30
|
+
|
|
31
|
+
### 4. Seller Quality Assurance
|
|
32
|
+
- **Onboarding**: Seller verification, document collection, quality baseline
|
|
33
|
+
- **Performance Metrics**: Response rate, cancellation rate, rating average
|
|
34
|
+
- **Quality Enforcement**: Warnings, suspensions, bans for policy violations
|
|
35
|
+
- **Support**: Seller success resources, training, API documentation
|
|
36
|
+
- **Tiering**: Seller levels (new, standard, gold, platinum) with benefits
|
|
37
|
+
|
|
38
|
+
### 5. Discovery & Matching
|
|
39
|
+
- **Search**: Full-text search, filters, sorting
|
|
40
|
+
- **Recommendations**: ML-based recommendations, personalization
|
|
41
|
+
- **Trending**: What's hot, seasonal items, category trending
|
|
42
|
+
- **Supply/Demand**: Balancing supply scarcity with buyer demand
|
|
43
|
+
- **Ranking Algorithm**: Fair ranking, preventing gaming, transparency
|
|
44
|
+
|
|
45
|
+
### 6. Community Moderation
|
|
46
|
+
- **Content Review**: Image verification, description moderation
|
|
47
|
+
- **Review Management**: Review authenticity, spam detection, manipulation prevention
|
|
48
|
+
- **User Behavior**: Community standards, suspension/ban procedures
|
|
49
|
+
- **Appeal Process**: Fair appeals, transparency, communication
|
|
50
|
+
- **Transparency**: Clear policies, community guidelines, moderation appeals
|
|
51
|
+
|
|
52
|
+
### 7. User Personas (Marketplace Specific)
|
|
53
|
+
|
|
54
|
+
#### Buyer Persona
|
|
55
|
+
- Goals: Find best products, competitive prices, fast delivery
|
|
56
|
+
- Pain Points: Counterfeit items, long delivery, poor service
|
|
57
|
+
- Concerns: Trust in seller, payment security, return policies
|
|
58
|
+
|
|
59
|
+
#### Seller Persona
|
|
60
|
+
- Goals: Reach customers, maximize revenue, sustainable growth
|
|
61
|
+
- Pain Points: Finding customers, competition, payment processing
|
|
62
|
+
- Concerns: Commission rates, policy changes, fair treatment
|
|
63
|
+
|
|
64
|
+
#### Platform Operator
|
|
65
|
+
- Goals: Sustainable growth, healthy marketplace, stakeholder satisfaction
|
|
66
|
+
- Pain Points: Balancing buyer/seller interests, fraud, legal compliance
|
|
67
|
+
- Concerns: GMV growth, trust metrics, user satisfaction
|
|
68
|
+
|
|
69
|
+
#### Support Agent
|
|
70
|
+
- Goals: Resolve disputes fairly, maintain trust, reduce escalations
|
|
71
|
+
- Pain Points: Complex disputes, policy ambiguity, seller/buyer conflicts
|
|
72
|
+
- Concerns: Fair resolution, quick closure, customer satisfaction
|
|
73
|
+
|
|
74
|
+
#### Community Moderator
|
|
75
|
+
- Goals: Maintain community standards, prevent abuse, engage users
|
|
76
|
+
- Pain Points: Volume of content, policy interpretation, false positives
|
|
77
|
+
- Concerns: Bias, false negatives, user resentment
|
|
78
|
+
|
|
79
|
+
### 8. Success Metrics (Marketplace Specific)
|
|
80
|
+
- **Gross Merchandise Volume (GMV)**: Total transaction value
|
|
81
|
+
- **Seller Growth**: New sellers, active sellers, seller satisfaction
|
|
82
|
+
- **Customer Retention**: Repeat purchase rate, churn rate
|
|
83
|
+
- **Review Authenticity**: % of authentic reviews (fraud detection rate)
|
|
84
|
+
- **Dispute Rate**: Disputes as % of transactions (lower is better)
|
|
85
|
+
- **Trust Score**: Buyer trust in platform, Net Promoter Score (NPS)
|
|
86
|
+
- **Seller Health**: Average seller rating, suspension rate, appeal rate
|
|
87
|
+
- **Community Health**: Content removal rate, user suspension rate, community satisfaction
|
|
88
|
+
|
|
89
|
+
### 9. Key Constraints
|
|
90
|
+
- **Commission Structure**: Sustainable for platform, fair to sellers
|
|
91
|
+
- **Payout Timing**: Fast enough for seller satisfaction, safe for platform
|
|
92
|
+
- **Dispute Deadlines**: Quick resolution, legal time requirements
|
|
93
|
+
- **Content Policies**: Clear standards, consistent enforcement
|
|
94
|
+
- **Data Privacy**: PII protection, transaction privacy, seller anonymity options
|
|
95
|
+
- **Regulatory**: Tax collection, consumer protection, local regulations
|
|
96
|
+
|
|
97
|
+
## PRD Generation Guidelines
|
|
98
|
+
|
|
99
|
+
### Multi-Stakeholder Perspective
|
|
100
|
+
Always consider impact on:
|
|
101
|
+
- ✅ Buyers: Is this feature valuable and trustworthy?
|
|
102
|
+
- ✅ Sellers: Is this feature fair and sustainable?
|
|
103
|
+
- ✅ Platform: Does this drive growth and profitability?
|
|
104
|
+
- ✅ Community: Does this maintain or improve community health?
|
|
105
|
+
|
|
106
|
+
### Trust-First Approach
|
|
107
|
+
- Every feature must enhance or maintain trust
|
|
108
|
+
- Transparency over features
|
|
109
|
+
- Fair treatment over growth hacks
|
|
110
|
+
- Community health over short-term metrics
|
|
111
|
+
|
|
112
|
+
### Commission & Pricing
|
|
113
|
+
- Make commission % explicit in documentation
|
|
114
|
+
- Justify pricing to both buyers and sellers
|
|
115
|
+
- Show how platform uses commissions
|
|
116
|
+
- Consider seller profitability models
|
|
117
|
+
|
|
118
|
+
### Dispute Resolution
|
|
119
|
+
- Clear escalation paths
|
|
120
|
+
- Fair arbitration criteria
|
|
121
|
+
- Appeal mechanisms
|
|
122
|
+
- Transparent timeline
|
|
123
|
+
|
|
124
|
+
### Seller Success
|
|
125
|
+
- Onboarding clear and supportive
|
|
126
|
+
- Performance metrics transparent
|
|
127
|
+
- Success resources available
|
|
128
|
+
- Fair quality enforcement
|
|
129
|
+
|
|
130
|
+
## Validation Checklist
|
|
131
|
+
Before finalizing PRD, verify:
|
|
132
|
+
- ✅ All stakeholders considered (buyer, seller, platform, moderator, support)
|
|
133
|
+
- ✅ Trust mechanisms clearly defined
|
|
134
|
+
- ✅ Commission structure documented
|
|
135
|
+
- ✅ Dispute resolution process outlined
|
|
136
|
+
- ✅ Seller quality criteria explicit
|
|
137
|
+
- ✅ Community guidelines clear
|
|
138
|
+
- ✅ Payment flow documented (buyer → platform → seller)
|
|
139
|
+
- ✅ Moderation policies defined
|
|
140
|
+
- ✅ Fairness across stakeholders assessed
|
|
141
|
+
- ✅ Scalability for growth considered
|
package/presets/saas/preset.json
CHANGED
|
@@ -1 +1,53 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "saas",
|
|
3
|
+
"display_name": "Software as a Service (SaaS)",
|
|
4
|
+
"description": "Comprehensive preset for SaaS products with subscription models, enterprise integration, scalability, customer success focus, and API-first architecture",
|
|
5
|
+
"category": "domain-specific",
|
|
6
|
+
"priority": 1,
|
|
7
|
+
"min_prodo_version": "0.1.0",
|
|
8
|
+
"version": "1.0.0",
|
|
9
|
+
"metadata": {
|
|
10
|
+
"domain": "Software as a Service",
|
|
11
|
+
"industry_focus": ["Enterprise Software", "Business Tools", "Workflow Automation", "Analytics", "Vertical SaaS"],
|
|
12
|
+
"business_model": ["subscription", "per-seat", "usage-based", "hybrid"],
|
|
13
|
+
"deployment_model": ["multi-tenant", "single-tenant", "hybrid"],
|
|
14
|
+
"key_complexity": "enterprise scale, integration requirements, customer success"
|
|
15
|
+
},
|
|
16
|
+
"preset_features": {
|
|
17
|
+
"domain_expertise": [
|
|
18
|
+
"Subscription billing & recurring revenue",
|
|
19
|
+
"Enterprise integration (SSO, SAML, APIs)",
|
|
20
|
+
"Customer success & retention strategies",
|
|
21
|
+
"Scalability & multi-tenancy",
|
|
22
|
+
"API design & developer experience",
|
|
23
|
+
"Compliance & data governance (SOC 2, HIPAA, GDPR)",
|
|
24
|
+
"Usage analytics & metering",
|
|
25
|
+
"Self-serve onboarding & product-led growth"
|
|
26
|
+
],
|
|
27
|
+
"templates_included": ["prd"],
|
|
28
|
+
"context_enrichment": {
|
|
29
|
+
"user_personas": ["End User", "Admin/IT", "Finance Lead", "Customer Success Manager", "Developer"],
|
|
30
|
+
"success_metrics": ["Monthly Recurring Revenue (MRR)", "Customer Acquisition Cost (CAC)", "Lifetime Value (LTV)", "Churn rate", "NPS"],
|
|
31
|
+
"constraints": ["Uptime SLA", "Integration requirements", "Compliance standards", "Data residency", "Support tiers"]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"agent_requirements": {
|
|
35
|
+
"required_expertise": [
|
|
36
|
+
"SaaS business model understanding",
|
|
37
|
+
"Enterprise customer needs",
|
|
38
|
+
"Subscription economics",
|
|
39
|
+
"Integration architecture",
|
|
40
|
+
"Customer success strategies",
|
|
41
|
+
"Scalability planning"
|
|
42
|
+
],
|
|
43
|
+
"recommended_agents": ["SaaS PM", "Enterprise Architect", "Customer Success Lead", "DevOps/Infrastructure Lead"],
|
|
44
|
+
"critical_validation": ["Pricing model", "Uptime SLA", "Integration roadmap", "Churn prevention strategy"]
|
|
45
|
+
},
|
|
46
|
+
"prompt_configuration": {
|
|
47
|
+
"tone": "Professional, enterprise-focused, customer-success-oriented",
|
|
48
|
+
"pricing_strategy": "transparent-value-based",
|
|
49
|
+
"customer_journey": "onboarding → adoption → expansion → retention",
|
|
50
|
+
"integration_first": "API-first, extensibility-critical",
|
|
51
|
+
"documentation_level": "comprehensive (API docs, admin guides, playbooks)"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,3 +1,151 @@
|
|
|
1
|
-
Preset
|
|
1
|
+
# SaaS Preset - PRD Generation Context
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Preset Overview
|
|
4
|
+
**Domain**: Software as a Service (SaaS)
|
|
5
|
+
**Focus**: Subscription economics, customer success, enterprise integration, scalability, recurring revenue
|
|
6
|
+
**Target Models**: Enterprise Software, Business Tools, Vertical SaaS, Workflow Automation, Analytics
|
|
7
|
+
|
|
8
|
+
## Critical Requirements for SaaS Products
|
|
9
|
+
|
|
10
|
+
### 1. Subscription Business Model
|
|
11
|
+
- **Pricing Tiers**: Free/Freemium, Starter, Professional, Enterprise
|
|
12
|
+
- **Billing Cycle**: Monthly, annual, or usage-based
|
|
13
|
+
- **Per-Seat vs. Fixed**: User-based vs. flat-rate pricing
|
|
14
|
+
- **Feature Gating**: Which features per tier
|
|
15
|
+
- **Contract Terms**: Auto-renewal, cancellation terms, trial periods
|
|
16
|
+
|
|
17
|
+
### 2. Customer Onboarding & Adoption
|
|
18
|
+
- **Self-Serve Onboarding**: Guided setup, templates, presets
|
|
19
|
+
- **Product-Led Growth**: Feature discoverability, in-app education
|
|
20
|
+
- **User Training**: Tutorials, help center, webinars, documentation
|
|
21
|
+
- **Activation**: Time to first value, key engagement metrics
|
|
22
|
+
- **Expansion Path**: Upsell opportunities, feature education
|
|
23
|
+
|
|
24
|
+
### 3. Enterprise Integration
|
|
25
|
+
- **SSO/SAML**: Single sign-on for corporate users
|
|
26
|
+
- **APIs**: REST/GraphQL APIs for custom integrations
|
|
27
|
+
- **Webhooks**: Real-time event notifications
|
|
28
|
+
- **Data Export**: Export capabilities, compliance
|
|
29
|
+
- **Native Integrations**: Slack, Salesforce, HubSpot, Jira, etc.
|
|
30
|
+
|
|
31
|
+
### 4. Scalability & Multi-Tenancy
|
|
32
|
+
- **Tenant Isolation**: Data separation and security
|
|
33
|
+
- **Performance**: Sub-second response times
|
|
34
|
+
- **Availability**: 99.9% or 99.99% uptime SLA
|
|
35
|
+
- **Disaster Recovery**: Backup, replication, failover
|
|
36
|
+
- **Geographic Distribution**: Multi-region support
|
|
37
|
+
|
|
38
|
+
### 5. Customer Success & Retention
|
|
39
|
+
- **Onboarding Support**: Dedicated CSM for enterprise accounts
|
|
40
|
+
- **Health Scoring**: Identify at-risk customers proactively
|
|
41
|
+
- **Usage Analytics**: Monitor feature adoption and user behavior
|
|
42
|
+
- **Support Tiers**: Community, email, chat, phone, 24/7
|
|
43
|
+
- **Renewal Playbook**: Steps to improve retention
|
|
44
|
+
|
|
45
|
+
### 6. Compliance & Data Governance
|
|
46
|
+
- **SOC 2**: Security, availability, confidentiality standards
|
|
47
|
+
- **HIPAA**: For healthcare SaaS
|
|
48
|
+
- **GDPR/CCPA**: Data privacy and right to deletion
|
|
49
|
+
- **Data Residency**: Geographic data storage requirements
|
|
50
|
+
- **Audit Trails**: Logging for compliance audits
|
|
51
|
+
|
|
52
|
+
### 7. User Personas (SaaS Specific)
|
|
53
|
+
|
|
54
|
+
#### End User
|
|
55
|
+
- Goals: Solve their job efficiently, learn easily
|
|
56
|
+
- Pain Points: Complex workflows, context-switching, training
|
|
57
|
+
- Concerns: Time investment, productivity gain
|
|
58
|
+
|
|
59
|
+
#### Admin/IT
|
|
60
|
+
- Goals: Secure deployment, central management, compliance
|
|
61
|
+
- Pain Points: User management overhead, security config
|
|
62
|
+
- Concerns: Data security, compliance, integration complexity
|
|
63
|
+
|
|
64
|
+
#### Finance Lead
|
|
65
|
+
- Goals: ROI justification, cost optimization, budgeting
|
|
66
|
+
- Pain Points: License management, usage visibility
|
|
67
|
+
- Concerns: TCO, renewal negotiations, cost per user
|
|
68
|
+
|
|
69
|
+
#### Customer Success Manager
|
|
70
|
+
- Goals: Customer adoption, expansion, retention
|
|
71
|
+
- Pain Points: Health scoring accuracy, expansion opportunities
|
|
72
|
+
- Concerns: Churn prevention, engagement metrics, renewal success
|
|
73
|
+
|
|
74
|
+
#### Developer (if applicable)
|
|
75
|
+
- Goals: Easy integration, extensibility, good documentation
|
|
76
|
+
- Pain Points: API limitations, rate limits, debugging
|
|
77
|
+
- Concerns: Developer experience, SDK quality, support
|
|
78
|
+
|
|
79
|
+
### 8. Success Metrics (SaaS Specific)
|
|
80
|
+
- **Monthly Recurring Revenue (MRR)**: Predictable revenue base
|
|
81
|
+
- **Annual Recurring Revenue (ARR)**: Annualized MRR
|
|
82
|
+
- **Customer Acquisition Cost (CAC)**: Cost to acquire customer
|
|
83
|
+
- **Lifetime Value (LTV)**: Total revenue per customer
|
|
84
|
+
- **LTV:CAC Ratio**: Should be 3:1 or higher (industry standard)
|
|
85
|
+
- **Churn Rate**: Monthly % of customers leaving
|
|
86
|
+
- **Net Revenue Retention (NRR)**: Retention + expansion
|
|
87
|
+
- **Customer Health Score**: Predictive churn indicator
|
|
88
|
+
- **Net Promoter Score (NPS)**: Customer satisfaction
|
|
89
|
+
- **Time to Value (TTV)**: Days to first value realization
|
|
90
|
+
|
|
91
|
+
### 9. Key Constraints
|
|
92
|
+
- **Uptime SLA**: 99.9% minimum (often 99.99% expected)
|
|
93
|
+
- **Data Residency**: Specific geographic regions required
|
|
94
|
+
- **Integration Requirements**: Must support popular tools
|
|
95
|
+
- **Pricing Sensitivity**: Competitive pricing pressure
|
|
96
|
+
- **Contract Terms**: Annual vs. monthly, lock-in periods
|
|
97
|
+
- **Support Costs**: Scale with customer base and tier
|
|
98
|
+
- **Regulatory Requirements**: Compliance obligations
|
|
99
|
+
|
|
100
|
+
## PRD Generation Guidelines
|
|
101
|
+
|
|
102
|
+
### Subscription-First Thinking
|
|
103
|
+
- Every feature → How does it impact retention?
|
|
104
|
+
- Every feature → Expansion opportunity or anti-churn?
|
|
105
|
+
- Every feature → Which tier includes it?
|
|
106
|
+
- Pricing change → Impact on LTV and churn?
|
|
107
|
+
|
|
108
|
+
### Customer Success Playbook
|
|
109
|
+
- How do we onboard customers?
|
|
110
|
+
- How do we measure adoption?
|
|
111
|
+
- How do we identify expansion opportunities?
|
|
112
|
+
- How do we prevent churn?
|
|
113
|
+
- What's the health scoring model?
|
|
114
|
+
|
|
115
|
+
### Enterprise Requirements
|
|
116
|
+
- What integrations are table-stakes?
|
|
117
|
+
- What compliance is required?
|
|
118
|
+
- What's the uptime SLA?
|
|
119
|
+
- What's the support model?
|
|
120
|
+
- What's the pricing model for enterprise?
|
|
121
|
+
|
|
122
|
+
### API-First Design
|
|
123
|
+
- What's exposed via API?
|
|
124
|
+
- What data can be exported?
|
|
125
|
+
- What webhooks/events exist?
|
|
126
|
+
- Rate limiting strategy?
|
|
127
|
+
- Documentation quality?
|
|
128
|
+
|
|
129
|
+
### Scalability Considerations
|
|
130
|
+
- How does the system scale to 10k users?
|
|
131
|
+
- How does the system scale to 100k users?
|
|
132
|
+
- What's the performance baseline?
|
|
133
|
+
- What monitoring is needed?
|
|
134
|
+
- What's the disaster recovery plan?
|
|
135
|
+
|
|
136
|
+
## Validation Checklist
|
|
137
|
+
Before finalizing PRD, verify:
|
|
138
|
+
- ✅ Pricing model clearly defined (tiers, billing, trial)
|
|
139
|
+
- ✅ Onboarding flow documented (self-serve path)
|
|
140
|
+
- ✅ Key integrations listed
|
|
141
|
+
- ✅ SLA/uptime committed (99.9% minimum)
|
|
142
|
+
- ✅ Compliance requirements identified
|
|
143
|
+
- ✅ Customer success strategy outlined
|
|
144
|
+
- ✅ Health scoring model conceptualized
|
|
145
|
+
- ✅ Support tier structure defined
|
|
146
|
+
- ✅ Churn prevention strategy exists
|
|
147
|
+
- ✅ Expansion/upsell opportunities identified
|
|
148
|
+
- ✅ API strategy documented
|
|
149
|
+
- ✅ Multi-tenancy approach clear
|
|
150
|
+
- ✅ Disaster recovery plan outlined
|
|
151
|
+
- ✅ Geographic expansion strategy noted
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { AgentPlugin } from "./base";
|
|
2
|
+
import { UserError } from "../core/errors";
|
|
3
|
+
import type { LLMProvider } from "../core/types";
|
|
4
|
+
import { MockAgent } from "./mock";
|
|
5
|
+
import { OpenAIAgent } from "./openai";
|
|
6
|
+
import { AnthropicAgent } from "./anthropic";
|
|
7
|
+
import { GoogleAgent } from "./google";
|
|
8
|
+
|
|
9
|
+
const AGENT_ALIASES: Record<string, string> = {
|
|
10
|
+
mock: "mock",
|
|
11
|
+
openai: "openai",
|
|
12
|
+
anthropic: "anthropic",
|
|
13
|
+
claude: "anthropic",
|
|
14
|
+
google: "google",
|
|
15
|
+
gemini: "google"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export class AgentRegistry {
|
|
19
|
+
private agents = new Map<string, AgentPlugin>();
|
|
20
|
+
|
|
21
|
+
register(agent: AgentPlugin): void {
|
|
22
|
+
this.agents.set(agent.name, agent);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
list(): AgentPlugin[] {
|
|
26
|
+
return Array.from(this.agents.values());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get(name: string): AgentPlugin | undefined {
|
|
30
|
+
const normalized = AGENT_ALIASES[name.toLowerCase().trim()] ?? name.toLowerCase().trim();
|
|
31
|
+
return this.agents.get(normalized);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
async resolve(name?: string): Promise<AgentPlugin> {
|
|
35
|
+
const agentName = this.resolveAgentName(name);
|
|
36
|
+
const agent = this.get(agentName);
|
|
37
|
+
|
|
38
|
+
if (!agent) {
|
|
39
|
+
const available = this.list().map((a) => a.name).join(", ");
|
|
40
|
+
throw new UserError(
|
|
41
|
+
`Unknown agent: "${agentName}". Available agents: ${available}`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return agent;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
private resolveAgentName(override?: string): string {
|
|
49
|
+
if (override) return override;
|
|
50
|
+
|
|
51
|
+
const fromEnv = process.env.PRODO_AGENT;
|
|
52
|
+
if (fromEnv) return fromEnv;
|
|
53
|
+
|
|
54
|
+
const fromLegacy = process.env.PRODO_LLM_PROVIDER;
|
|
55
|
+
if (fromLegacy) return fromLegacy;
|
|
56
|
+
|
|
57
|
+
const isTest =
|
|
58
|
+
process.env.NODE_ENV === "test" ||
|
|
59
|
+
process.env.PRODO_TEST === "1";
|
|
60
|
+
if (isTest) return "mock";
|
|
61
|
+
|
|
62
|
+
return "mock";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
toProvider(agent: AgentPlugin): LLMProvider {
|
|
66
|
+
return {
|
|
67
|
+
generate: (prompt, inputContext, schemaHint) =>
|
|
68
|
+
agent.generate(prompt, inputContext, schemaHint)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
let globalRegistry: AgentRegistry | null = null;
|
|
74
|
+
|
|
75
|
+
function createDefaultRegistry(): AgentRegistry {
|
|
76
|
+
const registry = new AgentRegistry();
|
|
77
|
+
registry.register(new MockAgent());
|
|
78
|
+
registry.register(new OpenAIAgent());
|
|
79
|
+
registry.register(new AnthropicAgent());
|
|
80
|
+
registry.register(new GoogleAgent());
|
|
81
|
+
return registry;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function getGlobalRegistry(): AgentRegistry {
|
|
85
|
+
if (!globalRegistry) {
|
|
86
|
+
globalRegistry = createDefaultRegistry();
|
|
87
|
+
}
|
|
88
|
+
return globalRegistry;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function resetGlobalRegistry(): void {
|
|
92
|
+
globalRegistry = null;
|
|
93
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { BaseAgent, type AgentConfig } from "../base";
|
|
2
|
+
import { buildSystemPrompt, buildUserMessage } from "../system-prompts";
|
|
3
|
+
import { UserError } from "../../core/errors";
|
|
4
|
+
import type { GenerateResult, ProviderSchemaHint } from "../../core/types";
|
|
5
|
+
|
|
6
|
+
const dynamicImport = new Function("specifier", "return import(specifier)") as (
|
|
7
|
+
specifier: string
|
|
8
|
+
) => Promise<unknown>;
|
|
9
|
+
|
|
10
|
+
type ContentBlock = { type: string; text?: string };
|
|
11
|
+
|
|
12
|
+
export class AnthropicAgent extends BaseAgent {
|
|
13
|
+
readonly name = "anthropic";
|
|
14
|
+
readonly displayName = "Anthropic Claude";
|
|
15
|
+
readonly sdkRequired = "@anthropic-ai/sdk";
|
|
16
|
+
|
|
17
|
+
getConfig(): AgentConfig {
|
|
18
|
+
return {
|
|
19
|
+
name: this.name,
|
|
20
|
+
displayName: this.displayName,
|
|
21
|
+
sdkRequired: this.sdkRequired,
|
|
22
|
+
envVars: ["ANTHROPIC_API_KEY"],
|
|
23
|
+
defaultModel: "claude-sonnet-4-20250514"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async generate(
|
|
28
|
+
prompt: string,
|
|
29
|
+
inputContext: Record<string, unknown>,
|
|
30
|
+
schemaHint: ProviderSchemaHint
|
|
31
|
+
): Promise<GenerateResult> {
|
|
32
|
+
const apiKey = process.env.ANTHROPIC_API_KEY;
|
|
33
|
+
if (!apiKey) {
|
|
34
|
+
throw new UserError("ANTHROPIC_API_KEY is not set. Set it to use the Anthropic agent.");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const model = process.env.PRODO_ANTHROPIC_MODEL ?? "claude-sonnet-4-20250514";
|
|
38
|
+
|
|
39
|
+
const outputLanguage =
|
|
40
|
+
typeof inputContext.outputLanguage === "string" && inputContext.outputLanguage.trim()
|
|
41
|
+
? inputContext.outputLanguage.trim()
|
|
42
|
+
: "en";
|
|
43
|
+
|
|
44
|
+
const system = buildSystemPrompt(schemaHint, outputLanguage);
|
|
45
|
+
const user = buildUserMessage(prompt, inputContext);
|
|
46
|
+
|
|
47
|
+
let AnthropicConstructor: new (opts: { apiKey: string }) => {
|
|
48
|
+
messages: {
|
|
49
|
+
create: (params: Record<string, unknown>) => Promise<{
|
|
50
|
+
content: ContentBlock[];
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const mod = (await dynamicImport("@anthropic-ai/sdk")) as {
|
|
57
|
+
default: typeof AnthropicConstructor;
|
|
58
|
+
};
|
|
59
|
+
AnthropicConstructor = mod.default;
|
|
60
|
+
} catch {
|
|
61
|
+
throw new UserError(
|
|
62
|
+
"Anthropic SDK is not installed. Run: npm install @anthropic-ai/sdk"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const client = new AnthropicConstructor({ apiKey });
|
|
67
|
+
|
|
68
|
+
const response = await client.messages.create({
|
|
69
|
+
model,
|
|
70
|
+
max_tokens: 8192,
|
|
71
|
+
system,
|
|
72
|
+
messages: [{ role: "user", content: user }]
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const textBlock = response.content.find(
|
|
76
|
+
(block: ContentBlock) => block.type === "text"
|
|
77
|
+
);
|
|
78
|
+
const content = textBlock?.text?.trim() ?? "";
|
|
79
|
+
|
|
80
|
+
if (!content) {
|
|
81
|
+
throw new UserError("Anthropic agent returned an empty response.");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return { body: content };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { GenerateResult, ProviderSchemaHint } from "../core/types";
|
|
2
|
+
|
|
3
|
+
export type AgentConfig = {
|
|
4
|
+
name: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
sdkRequired: string | null;
|
|
7
|
+
envVars: string[];
|
|
8
|
+
defaultModel?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface AgentPlugin {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly displayName: string;
|
|
14
|
+
readonly sdkRequired: string | null;
|
|
15
|
+
|
|
16
|
+
generate(
|
|
17
|
+
prompt: string,
|
|
18
|
+
inputContext: Record<string, unknown>,
|
|
19
|
+
schemaHint: ProviderSchemaHint
|
|
20
|
+
): Promise<GenerateResult>;
|
|
21
|
+
|
|
22
|
+
isAvailable(): Promise<boolean>;
|
|
23
|
+
getConfig(): AgentConfig;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export abstract class BaseAgent implements AgentPlugin {
|
|
27
|
+
abstract readonly name: string;
|
|
28
|
+
abstract readonly displayName: string;
|
|
29
|
+
abstract readonly sdkRequired: string | null;
|
|
30
|
+
|
|
31
|
+
abstract generate(
|
|
32
|
+
prompt: string,
|
|
33
|
+
inputContext: Record<string, unknown>,
|
|
34
|
+
schemaHint: ProviderSchemaHint
|
|
35
|
+
): Promise<GenerateResult>;
|
|
36
|
+
|
|
37
|
+
abstract getConfig(): AgentConfig;
|
|
38
|
+
|
|
39
|
+
async isAvailable(): Promise<boolean> {
|
|
40
|
+
const config = this.getConfig();
|
|
41
|
+
|
|
42
|
+
if (config.sdkRequired) {
|
|
43
|
+
try {
|
|
44
|
+
await import(config.sdkRequired);
|
|
45
|
+
} catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
for (const envVar of config.envVars) {
|
|
51
|
+
if (!process.env[envVar]) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
availabilityHint(): string {
|
|
60
|
+
const config = this.getConfig();
|
|
61
|
+
const hints: string[] = [];
|
|
62
|
+
|
|
63
|
+
if (config.sdkRequired) {
|
|
64
|
+
hints.push(`SDK required: npm install ${config.sdkRequired}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (const envVar of config.envVars) {
|
|
68
|
+
if (!process.env[envVar]) {
|
|
69
|
+
hints.push(`Set environment variable: ${envVar}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return hints.length > 0
|
|
74
|
+
? `Agent "${config.displayName}" is not available.\n ${hints.join("\n ")}`
|
|
75
|
+
: `Agent "${config.displayName}" is available.`;
|
|
76
|
+
}
|
|
77
|
+
}
|