myaidev-method 0.2.16 → 0.2.17
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/CHANGELOG.md +33 -0
- package/README.md +56 -4
- package/USER_GUIDE.md +57 -2
- package/content-rules.example.md +239 -0
- package/package.json +3 -2
- package/src/lib/visual-generation-utils.js +38 -5
- package/src/templates/claude/agents/content-writer.md +49 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,39 @@ All notable changes to the MyAIDev Method package will be documented in this fil
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.17] - 2025-11-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Custom Content Rules**: content-rules.md support for customizable content generation
|
|
12
|
+
- content-writer agent now checks for `content-rules.md` in project root
|
|
13
|
+
- Apply custom brand voice, formatting, SEO guidelines without modifying agents
|
|
14
|
+
- Gracefully continues if file doesn't exist (backward compatible)
|
|
15
|
+
- Added comprehensive `content-rules.example.md` template with examples
|
|
16
|
+
- Includes brand voice, formatting preferences, SEO requirements, required elements
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **Content Writer Agent**: Enhanced with Phase 0 for loading custom rules
|
|
20
|
+
- Documented content-rules.md usage and examples
|
|
21
|
+
- Merged custom rules with default best practices
|
|
22
|
+
- Instructions for checking and applying custom rules
|
|
23
|
+
|
|
24
|
+
### Documentation
|
|
25
|
+
- **README.md**: Added "Content Writer Custom Rules" section with quick start
|
|
26
|
+
- **USER_GUIDE.md**: Added "Customizing Content Generation (Recommended)" best practices
|
|
27
|
+
- **package.json**: Added content-rules.example.md to published files
|
|
28
|
+
|
|
29
|
+
### Benefits
|
|
30
|
+
- ✅ No agent modification required for customization
|
|
31
|
+
- ✅ Preserves agent updates when upgrading MyAIDev Method
|
|
32
|
+
- ✅ Easy to version control (commit content-rules.md to git)
|
|
33
|
+
- ✅ Project-specific customization
|
|
34
|
+
- ✅ Backward compatible (works without file)
|
|
35
|
+
|
|
36
|
+
### Testing
|
|
37
|
+
- Verified with content-rules.md: Applied custom rules (emoji, Quick Takeaways, author signature)
|
|
38
|
+
- Verified without content-rules.md: Used default professional standards
|
|
39
|
+
- Both scenarios work correctly
|
|
40
|
+
|
|
8
41
|
## [0.2.16] - 2025-11-19
|
|
9
42
|
|
|
10
43
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1000,14 +1000,66 @@ When SSH access is available, the WordPress admin agent can perform:
|
|
|
1000
1000
|
|
|
1001
1001
|
You can customize agent behavior by editing their Markdown files after installation.
|
|
1002
1002
|
|
|
1003
|
+
### Content Writer Custom Rules (Recommended)
|
|
1004
|
+
|
|
1005
|
+
The content-writer agent supports custom content generation rules via a `content-rules.md` file. This is the **recommended approach** for customizing content creation without modifying the agent itself.
|
|
1006
|
+
|
|
1007
|
+
**Quick Start:**
|
|
1008
|
+
```bash
|
|
1009
|
+
# Copy the example template
|
|
1010
|
+
cp content-rules.example.md content-rules.md
|
|
1011
|
+
|
|
1012
|
+
# Edit with your preferences
|
|
1013
|
+
nano content-rules.md
|
|
1014
|
+
```
|
|
1015
|
+
|
|
1016
|
+
**What you can customize:**
|
|
1017
|
+
- Brand voice and tone
|
|
1018
|
+
- Writing style preferences
|
|
1019
|
+
- Formatting guidelines
|
|
1020
|
+
- SEO requirements
|
|
1021
|
+
- Required/optional content elements
|
|
1022
|
+
- Topics to avoid
|
|
1023
|
+
- Company-specific terminology
|
|
1024
|
+
|
|
1025
|
+
**Example content-rules.md:**
|
|
1026
|
+
```markdown
|
|
1027
|
+
# Content Generation Rules
|
|
1028
|
+
|
|
1029
|
+
## Brand Voice
|
|
1030
|
+
- Use conversational, friendly tone
|
|
1031
|
+
- Avoid jargon unless explaining technical concepts
|
|
1032
|
+
|
|
1033
|
+
## Formatting Preferences
|
|
1034
|
+
- Keep paragraphs under 3 sentences
|
|
1035
|
+
- Use numbered lists for sequential steps
|
|
1036
|
+
|
|
1037
|
+
## SEO Guidelines
|
|
1038
|
+
- Target keyword density: 1-2%
|
|
1039
|
+
- Include FAQ section for articles over 1000 words
|
|
1040
|
+
|
|
1041
|
+
## Required Elements
|
|
1042
|
+
- Author bio at the end
|
|
1043
|
+
- Call-to-action in conclusion
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
**Benefits:**
|
|
1047
|
+
- ✅ No agent modification required
|
|
1048
|
+
- ✅ Preserves agent updates when upgrading
|
|
1049
|
+
- ✅ Easy to version control
|
|
1050
|
+
- ✅ Project-specific customization
|
|
1051
|
+
- ✅ Agent continues working if file doesn't exist
|
|
1052
|
+
|
|
1003
1053
|
### Editing Agent Prompts
|
|
1004
1054
|
|
|
1055
|
+
For deeper customization, you can edit agent files directly:
|
|
1056
|
+
|
|
1005
1057
|
1. **Locate the agent file**:
|
|
1006
1058
|
```bash
|
|
1007
1059
|
# Content writer agent
|
|
1008
1060
|
.claude/agents/content-writer.md
|
|
1009
|
-
|
|
1010
|
-
# WordPress admin agent
|
|
1061
|
+
|
|
1062
|
+
# WordPress admin agent
|
|
1011
1063
|
.claude/agents/wordpress-admin.md
|
|
1012
1064
|
```
|
|
1013
1065
|
|
|
@@ -1018,9 +1070,9 @@ You can customize agent behavior by editing their Markdown files after installat
|
|
|
1018
1070
|
description: Your custom description
|
|
1019
1071
|
tools: Read, Write, Edit, WebSearch, WebFetch, Task
|
|
1020
1072
|
---
|
|
1021
|
-
|
|
1073
|
+
|
|
1022
1074
|
Your custom agent prompt goes here...
|
|
1023
|
-
|
|
1075
|
+
|
|
1024
1076
|
## Custom Instructions
|
|
1025
1077
|
- Add your specific requirements
|
|
1026
1078
|
- Modify the writing style
|
package/USER_GUIDE.md
CHANGED
|
@@ -1055,9 +1055,64 @@ ls -la .claude/commands/
|
|
|
1055
1055
|
cat .claude/commands/myai-content-writer.md
|
|
1056
1056
|
```
|
|
1057
1057
|
|
|
1058
|
-
### Customizing
|
|
1058
|
+
### Customizing Content Generation (Recommended)
|
|
1059
1059
|
|
|
1060
|
-
|
|
1060
|
+
**Best Practice:** Use `content-rules.md` for content customization instead of editing agents directly.
|
|
1061
|
+
|
|
1062
|
+
```bash
|
|
1063
|
+
# Copy the example template
|
|
1064
|
+
cp content-rules.example.md content-rules.md
|
|
1065
|
+
|
|
1066
|
+
# Edit with your preferences
|
|
1067
|
+
nano content-rules.md
|
|
1068
|
+
```
|
|
1069
|
+
|
|
1070
|
+
**Why use content-rules.md?**
|
|
1071
|
+
- ✅ No agent modification required
|
|
1072
|
+
- ✅ Preserves updates when upgrading MyAIDev Method
|
|
1073
|
+
- ✅ Easy to version control
|
|
1074
|
+
- ✅ Project-specific customization
|
|
1075
|
+
- ✅ Works even if file doesn't exist
|
|
1076
|
+
|
|
1077
|
+
**Example content-rules.md:**
|
|
1078
|
+
|
|
1079
|
+
```markdown
|
|
1080
|
+
# Content Generation Rules
|
|
1081
|
+
|
|
1082
|
+
## Brand Voice
|
|
1083
|
+
- Use conversational, friendly tone
|
|
1084
|
+
- Avoid jargon unless explaining technical concepts
|
|
1085
|
+
- Include real-world examples
|
|
1086
|
+
|
|
1087
|
+
## Formatting Preferences
|
|
1088
|
+
- Keep paragraphs under 3 sentences
|
|
1089
|
+
- Use numbered lists for sequential steps
|
|
1090
|
+
- Include code examples for technical content
|
|
1091
|
+
|
|
1092
|
+
## SEO Guidelines
|
|
1093
|
+
- Target keyword density: 1-2%
|
|
1094
|
+
- Include FAQ section for articles over 1000 words
|
|
1095
|
+
- Add "Related Resources" section at the end
|
|
1096
|
+
|
|
1097
|
+
## Required Elements
|
|
1098
|
+
- Author bio at the end
|
|
1099
|
+
- Call-to-action in conclusion
|
|
1100
|
+
- Technical accuracy verification
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
**What you can customize:**
|
|
1104
|
+
- Brand voice and tone
|
|
1105
|
+
- Writing style preferences
|
|
1106
|
+
- Formatting guidelines
|
|
1107
|
+
- SEO requirements
|
|
1108
|
+
- Required/optional content elements
|
|
1109
|
+
- Topics to avoid
|
|
1110
|
+
- Company-specific terminology
|
|
1111
|
+
- Content structure preferences
|
|
1112
|
+
|
|
1113
|
+
### Customizing Commands (Advanced)
|
|
1114
|
+
|
|
1115
|
+
For deeper customization, edit command files directly:
|
|
1061
1116
|
|
|
1062
1117
|
```bash
|
|
1063
1118
|
# Edit content writer command
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Content Generation Rules
|
|
2
|
+
|
|
3
|
+
This file contains custom rules and guidelines for the content-writer agent. Copy this file to `content-rules.md` in your project root and customize it for your specific content needs.
|
|
4
|
+
|
|
5
|
+
## Brand Voice & Tone
|
|
6
|
+
|
|
7
|
+
- **Primary Tone**: Professional yet approachable
|
|
8
|
+
- **Reading Level**: 8th-10th grade (accessible to broad audience)
|
|
9
|
+
- **Perspective**: Use "we" and "you" for engagement
|
|
10
|
+
- **Personality Traits**: Helpful, knowledgeable, encouraging
|
|
11
|
+
|
|
12
|
+
## Writing Style Guidelines
|
|
13
|
+
|
|
14
|
+
### Sentence Structure
|
|
15
|
+
- Keep sentences under 25 words when possible
|
|
16
|
+
- Vary sentence length for rhythm
|
|
17
|
+
- Use active voice (passive voice < 10% of content)
|
|
18
|
+
- One main idea per sentence
|
|
19
|
+
|
|
20
|
+
### Paragraph Guidelines
|
|
21
|
+
- Maximum 3-4 sentences per paragraph
|
|
22
|
+
- Start paragraphs with topic sentences
|
|
23
|
+
- Include white space for readability
|
|
24
|
+
- Break up long sections with subheadings
|
|
25
|
+
|
|
26
|
+
### Word Choice
|
|
27
|
+
- Prefer simple words over complex alternatives
|
|
28
|
+
- Avoid jargon unless necessary (then explain it)
|
|
29
|
+
- Use specific, concrete language
|
|
30
|
+
- Minimize adverbs and weak verbs
|
|
31
|
+
|
|
32
|
+
## Formatting Preferences
|
|
33
|
+
|
|
34
|
+
### Headings
|
|
35
|
+
- H1: Article title only
|
|
36
|
+
- H2: Main section headers (4-7 words)
|
|
37
|
+
- H3: Subsection headers (3-5 words)
|
|
38
|
+
- H4: Rarely used, only for deeply nested content
|
|
39
|
+
|
|
40
|
+
### Lists
|
|
41
|
+
- Use numbered lists for sequential steps or ranked items
|
|
42
|
+
- Use bullet points for non-sequential items
|
|
43
|
+
- Keep list items parallel in structure
|
|
44
|
+
- Include 3-7 items per list (optimal for comprehension)
|
|
45
|
+
|
|
46
|
+
### Emphasis
|
|
47
|
+
- **Bold** for key terms and important concepts
|
|
48
|
+
- *Italics* for emphasis and technical terms
|
|
49
|
+
- `Code formatting` for code, commands, file names
|
|
50
|
+
- > Blockquotes for important callouts or quotes
|
|
51
|
+
|
|
52
|
+
## SEO Requirements
|
|
53
|
+
|
|
54
|
+
### Keywords
|
|
55
|
+
- Primary keyword density: 1-2%
|
|
56
|
+
- Include primary keyword in: title, first paragraph, at least one H2, conclusion
|
|
57
|
+
- Natural keyword variations throughout
|
|
58
|
+
- LSI keywords to support topic relevance
|
|
59
|
+
|
|
60
|
+
### Meta Elements
|
|
61
|
+
- Meta description: 150-160 characters
|
|
62
|
+
- Title tag: 50-60 characters
|
|
63
|
+
- URL slug: lowercase, hyphens, primary keyword
|
|
64
|
+
- Alt text: descriptive, includes keyword when natural
|
|
65
|
+
|
|
66
|
+
### Internal Linking
|
|
67
|
+
- Link to 2-3 related internal articles
|
|
68
|
+
- Use descriptive anchor text
|
|
69
|
+
- Link from relevant context, not forced
|
|
70
|
+
|
|
71
|
+
### Featured Snippets
|
|
72
|
+
- Include FAQ section for informational content
|
|
73
|
+
- Use numbered lists for "how-to" content
|
|
74
|
+
- Create summary paragraphs for definitions
|
|
75
|
+
- Structure tables for comparison content
|
|
76
|
+
|
|
77
|
+
## Content Structure
|
|
78
|
+
|
|
79
|
+
### Introduction
|
|
80
|
+
- Hook reader within first 1-2 sentences
|
|
81
|
+
- State article value proposition
|
|
82
|
+
- Preview main points or sections
|
|
83
|
+
- Length: 100-150 words
|
|
84
|
+
|
|
85
|
+
### Body Content
|
|
86
|
+
- Use the inverted pyramid style (most important first)
|
|
87
|
+
- Include examples, data, or case studies
|
|
88
|
+
- Break up text with subheadings every 300-400 words
|
|
89
|
+
- Add images/visuals every 500-700 words
|
|
90
|
+
|
|
91
|
+
### Conclusion
|
|
92
|
+
- Summarize key takeaways (3-5 points)
|
|
93
|
+
- Include clear call-to-action
|
|
94
|
+
- Suggest next steps or related content
|
|
95
|
+
- Length: 100-200 words
|
|
96
|
+
|
|
97
|
+
## Required Elements
|
|
98
|
+
|
|
99
|
+
### Must Include
|
|
100
|
+
- [ ] Author attribution
|
|
101
|
+
- [ ] Publication date
|
|
102
|
+
- [ ] Reading time estimate
|
|
103
|
+
- [ ] Category/tags for organization
|
|
104
|
+
- [ ] Social sharing metadata
|
|
105
|
+
- [ ] Call-to-action (CTA)
|
|
106
|
+
|
|
107
|
+
### Optional Elements
|
|
108
|
+
- Table of contents (for 1500+ word articles)
|
|
109
|
+
- FAQ section (for informational content)
|
|
110
|
+
- Key takeaways box
|
|
111
|
+
- Related resources section
|
|
112
|
+
- Expert quotes or testimonials
|
|
113
|
+
|
|
114
|
+
## Content Types Specific Guidelines
|
|
115
|
+
|
|
116
|
+
### Blog Posts
|
|
117
|
+
- Length: 800-1500 words
|
|
118
|
+
- Conversational tone
|
|
119
|
+
- Include personal anecdotes or examples
|
|
120
|
+
- Strong opening hook
|
|
121
|
+
- Social sharing friendly
|
|
122
|
+
|
|
123
|
+
### Technical Articles
|
|
124
|
+
- Length: 1200-2500 words
|
|
125
|
+
- More formal, precise language
|
|
126
|
+
- Code examples with explanations
|
|
127
|
+
- Step-by-step instructions
|
|
128
|
+
- Prerequisites section
|
|
129
|
+
|
|
130
|
+
### Product Reviews
|
|
131
|
+
- Length: 1000-1800 words
|
|
132
|
+
- Balanced pros and cons
|
|
133
|
+
- Real-world testing experience
|
|
134
|
+
- Comparison tables
|
|
135
|
+
- Clear recommendation
|
|
136
|
+
|
|
137
|
+
### How-To Guides
|
|
138
|
+
- Length: 800-2000 words
|
|
139
|
+
- Numbered step-by-step instructions
|
|
140
|
+
- Screenshots or diagrams
|
|
141
|
+
- Prerequisites and materials list
|
|
142
|
+
- Troubleshooting section
|
|
143
|
+
|
|
144
|
+
## Topics & Restrictions
|
|
145
|
+
|
|
146
|
+
### Topics to Avoid
|
|
147
|
+
- Political opinions or endorsements
|
|
148
|
+
- Medical diagnoses or treatment advice
|
|
149
|
+
- Financial investment recommendations
|
|
150
|
+
- Legal advice
|
|
151
|
+
- Controversial or divisive subjects
|
|
152
|
+
|
|
153
|
+
### Topics to Handle Carefully
|
|
154
|
+
- Competitor mentions (factual only, no negativity)
|
|
155
|
+
- Statistics and data (always cite sources)
|
|
156
|
+
- Future predictions (use qualifiers like "may" or "could")
|
|
157
|
+
- Industry trends (acknowledge uncertainty)
|
|
158
|
+
|
|
159
|
+
## Quality Standards
|
|
160
|
+
|
|
161
|
+
### Fact-Checking
|
|
162
|
+
- Verify all statistics and data
|
|
163
|
+
- Link to original sources
|
|
164
|
+
- Use reputable sources only (.gov, .edu, industry leaders)
|
|
165
|
+
- Update outdated information
|
|
166
|
+
- Date-stamp time-sensitive content
|
|
167
|
+
|
|
168
|
+
### Originality
|
|
169
|
+
- 100% original content (no plagiarism)
|
|
170
|
+
- Unique perspective or insights
|
|
171
|
+
- Fresh examples, not recycled from competitors
|
|
172
|
+
- Add value beyond what already exists
|
|
173
|
+
|
|
174
|
+
### Accessibility
|
|
175
|
+
- Use descriptive link text (no "click here")
|
|
176
|
+
- Provide alt text for all images
|
|
177
|
+
- Ensure sufficient color contrast
|
|
178
|
+
- Structure content for screen readers
|
|
179
|
+
- Use simple language for complex topics
|
|
180
|
+
|
|
181
|
+
## Brand-Specific Requirements
|
|
182
|
+
|
|
183
|
+
### Company Information
|
|
184
|
+
- Company Name: [Your Company]
|
|
185
|
+
- Website: [Your Website]
|
|
186
|
+
- Industry: [Your Industry]
|
|
187
|
+
- Target Audience: [Your Audience]
|
|
188
|
+
|
|
189
|
+
### Preferred Terminology
|
|
190
|
+
- Use "client" instead of "customer"
|
|
191
|
+
- Use "platform" instead of "software"
|
|
192
|
+
- Use "solution" instead of "product"
|
|
193
|
+
- [Add your specific terms]
|
|
194
|
+
|
|
195
|
+
### Branding Elements
|
|
196
|
+
- Include company tagline when relevant
|
|
197
|
+
- Link to company blog or resources
|
|
198
|
+
- Mention company values or mission when appropriate
|
|
199
|
+
- Use consistent product/service names
|
|
200
|
+
|
|
201
|
+
### Call-to-Action Guidelines
|
|
202
|
+
- Primary CTA: [e.g., "Start Free Trial"]
|
|
203
|
+
- Secondary CTA: [e.g., "Contact Sales"]
|
|
204
|
+
- Placement: End of article, after value is demonstrated
|
|
205
|
+
- Style: Action-oriented, clear benefit
|
|
206
|
+
|
|
207
|
+
## Compliance & Legal
|
|
208
|
+
|
|
209
|
+
### Disclaimers
|
|
210
|
+
- Include disclaimers for advice content
|
|
211
|
+
- Note affiliate relationships if applicable
|
|
212
|
+
- Privacy policy compliance
|
|
213
|
+
- Cookie consent requirements
|
|
214
|
+
|
|
215
|
+
### Copyright
|
|
216
|
+
- Respect copyright for quotes (cite source)
|
|
217
|
+
- Obtain permission for extensive quotes
|
|
218
|
+
- Use Creative Commons images only
|
|
219
|
+
- Credit photographers/creators
|
|
220
|
+
|
|
221
|
+
## Review Checklist
|
|
222
|
+
|
|
223
|
+
Before submitting content, verify:
|
|
224
|
+
|
|
225
|
+
- [ ] Custom rules applied consistently
|
|
226
|
+
- [ ] All required elements included
|
|
227
|
+
- [ ] SEO optimized (title, meta, keywords)
|
|
228
|
+
- [ ] Factual accuracy verified
|
|
229
|
+
- [ ] No spelling or grammar errors
|
|
230
|
+
- [ ] Links working and relevant
|
|
231
|
+
- [ ] Images optimized and have alt text
|
|
232
|
+
- [ ] Mobile-friendly formatting
|
|
233
|
+
- [ ] Readability score meets target
|
|
234
|
+
- [ ] Brand voice consistent
|
|
235
|
+
- [ ] CTA clear and actionable
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
**Note**: These are template rules. Customize this file for your specific content needs, brand voice, and target audience. The content-writer agent will use these rules to guide content generation while maintaining its core quality standards.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "myaidev-method",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Comprehensive development framework with SPARC methodology for AI-assisted software development, AI visual content generation (Gemini, Imagen, DALL-E, Veo), multi-platform publishing (WordPress, PayloadCMS, Astro, Docusaurus, Mintlify), and Coolify deployment",
|
|
3
|
+
"version": "0.2.17",
|
|
4
|
+
"description": "Comprehensive development framework with SPARC methodology for AI-assisted software development, AI visual content generation (Gemini, Imagen, DALL-E, Veo, FLUX), multi-platform publishing (WordPress, PayloadCMS, Astro, Docusaurus, Mintlify), and Coolify deployment",
|
|
5
5
|
"mcpName": "io.github.myaione/myaidev-method",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -148,6 +148,7 @@
|
|
|
148
148
|
"CONTENT_CREATION_GUIDE.md",
|
|
149
149
|
"VISUAL_CONTENT_GENERATION_GUIDE.md",
|
|
150
150
|
"VISUAL_GENERATION_FILE_ORGANIZATION.md",
|
|
151
|
+
"content-rules.example.md",
|
|
151
152
|
"LICENSE",
|
|
152
153
|
".env.example",
|
|
153
154
|
"DEV_WORKFLOW_GUIDE.md",
|
|
@@ -80,9 +80,11 @@ const PRICING = {
|
|
|
80
80
|
export function validateAPIKeys() {
|
|
81
81
|
const googleKey = process.env.GOOGLE_API_KEY;
|
|
82
82
|
const openaiKey = process.env.OPENAI_API_KEY;
|
|
83
|
+
const falKey = process.env.FAL_KEY;
|
|
83
84
|
|
|
84
85
|
const hasGoogle = !!(googleKey && googleKey.length > 20);
|
|
85
86
|
const hasOpenAI = !!(openaiKey && openaiKey.length > 20);
|
|
87
|
+
const hasFal = !!(falKey && falKey.length > 20);
|
|
86
88
|
|
|
87
89
|
const availableServices = [];
|
|
88
90
|
if (hasGoogle) {
|
|
@@ -91,11 +93,15 @@ export function validateAPIKeys() {
|
|
|
91
93
|
if (hasOpenAI) {
|
|
92
94
|
availableServices.push('dalle');
|
|
93
95
|
}
|
|
96
|
+
if (hasFal) {
|
|
97
|
+
availableServices.push('flux', 'flux-pro', 'flux-dev', 'veo3');
|
|
98
|
+
}
|
|
94
99
|
|
|
95
100
|
return {
|
|
96
101
|
hasGoogle,
|
|
97
102
|
hasOpenAI,
|
|
98
|
-
|
|
103
|
+
hasFal,
|
|
104
|
+
hasAny: hasGoogle || hasOpenAI || hasFal,
|
|
99
105
|
availableServices
|
|
100
106
|
};
|
|
101
107
|
}
|
|
@@ -133,6 +139,17 @@ export function estimateCost(service, options = {}) {
|
|
|
133
139
|
case 'veo':
|
|
134
140
|
return PRICING.veo;
|
|
135
141
|
|
|
142
|
+
case 'flux':
|
|
143
|
+
case 'flux-pro':
|
|
144
|
+
return PRICING.flux_pro;
|
|
145
|
+
|
|
146
|
+
case 'flux-dev':
|
|
147
|
+
return PRICING.flux_dev;
|
|
148
|
+
|
|
149
|
+
case 'veo3':
|
|
150
|
+
case 'veo3-fast':
|
|
151
|
+
return PRICING.veo3; // per second, will multiply by duration
|
|
152
|
+
|
|
136
153
|
default:
|
|
137
154
|
return 0;
|
|
138
155
|
}
|
|
@@ -571,17 +588,33 @@ export async function generateImageFal(prompt, options = {}) {
|
|
|
571
588
|
logs: false
|
|
572
589
|
});
|
|
573
590
|
|
|
574
|
-
|
|
575
|
-
|
|
591
|
+
// Fal.ai can return images in different formats
|
|
592
|
+
let imageUrl;
|
|
593
|
+
let contentType = 'image/png';
|
|
594
|
+
|
|
595
|
+
if (result.data && result.data.images && result.data.images[0]) {
|
|
596
|
+
imageUrl = result.data.images[0].url;
|
|
597
|
+
contentType = result.data.images[0].content_type || 'image/png';
|
|
598
|
+
} else if (result.images && result.images[0]) {
|
|
599
|
+
imageUrl = result.images[0].url;
|
|
600
|
+
contentType = result.images[0].content_type || 'image/png';
|
|
601
|
+
} else if (result.image && result.image.url) {
|
|
602
|
+
imageUrl = result.image.url;
|
|
603
|
+
} else if (result.data && result.data[0] && result.data[0].url) {
|
|
604
|
+
imageUrl = result.data[0].url;
|
|
605
|
+
} else if (typeof result === 'string') {
|
|
606
|
+
imageUrl = result;
|
|
607
|
+
}
|
|
576
608
|
|
|
609
|
+
if (imageUrl) {
|
|
577
610
|
// Fal.ai returns URL, need to fetch and convert to base64
|
|
578
|
-
const imageResponse = await fetch(
|
|
611
|
+
const imageResponse = await fetch(imageUrl);
|
|
579
612
|
const imageBuffer = await imageResponse.arrayBuffer();
|
|
580
613
|
const base64Data = Buffer.from(imageBuffer).toString('base64');
|
|
581
614
|
|
|
582
615
|
return {
|
|
583
616
|
data: base64Data,
|
|
584
|
-
mimeType:
|
|
617
|
+
mimeType: contentType,
|
|
585
618
|
service: 'fal',
|
|
586
619
|
model: model,
|
|
587
620
|
cost: PRICING[`${model.replace('-', '_')}`] || PRICING.flux_pro
|
|
@@ -65,13 +65,62 @@ if (hasAnyAPIKeys()) {
|
|
|
65
65
|
- Understanding the target audience
|
|
66
66
|
- Competitive content analysis
|
|
67
67
|
|
|
68
|
+
## Custom Content Rules
|
|
69
|
+
|
|
70
|
+
The content-writer agent supports custom content generation rules via a `content-rules.md` file in your project root. If this file exists, the agent will incorporate your custom guidelines into the content generation process.
|
|
71
|
+
|
|
72
|
+
**To use custom rules:**
|
|
73
|
+
|
|
74
|
+
1. Create a `content-rules.md` file in your project directory
|
|
75
|
+
2. Define your content preferences, style guidelines, brand voice, or formatting requirements
|
|
76
|
+
3. The agent will automatically detect and apply these rules
|
|
77
|
+
|
|
78
|
+
**Example content-rules.md:**
|
|
79
|
+
```markdown
|
|
80
|
+
# Content Generation Rules
|
|
81
|
+
|
|
82
|
+
## Brand Voice
|
|
83
|
+
- Use conversational, friendly tone
|
|
84
|
+
- Avoid jargon unless explaining technical concepts
|
|
85
|
+
- Include real-world examples
|
|
86
|
+
|
|
87
|
+
## Formatting Preferences
|
|
88
|
+
- Keep paragraphs under 3 sentences
|
|
89
|
+
- Use numbered lists for sequential steps
|
|
90
|
+
- Use bullet points for non-sequential items
|
|
91
|
+
|
|
92
|
+
## SEO Guidelines
|
|
93
|
+
- Target keyword density: 1-2%
|
|
94
|
+
- Include FAQ section for articles over 1000 words
|
|
95
|
+
- Add "Related Resources" section at the end
|
|
96
|
+
|
|
97
|
+
## Topics to Avoid
|
|
98
|
+
- Political opinions
|
|
99
|
+
- Medical advice
|
|
100
|
+
- Financial recommendations
|
|
101
|
+
|
|
102
|
+
## Required Elements
|
|
103
|
+
- Author bio at the end
|
|
104
|
+
- Call-to-action in conclusion
|
|
105
|
+
- Social sharing snippet
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Note:** If `content-rules.md` doesn't exist, the agent will use its default professional content creation guidelines.
|
|
109
|
+
|
|
68
110
|
## Writing Process
|
|
69
111
|
|
|
112
|
+
### Phase 0: Load Custom Rules (if available)
|
|
113
|
+
- Check for `content-rules.md` in project root
|
|
114
|
+
- If found, read and incorporate custom guidelines
|
|
115
|
+
- Merge custom rules with default best practices
|
|
116
|
+
- Continue with standard process if file doesn't exist
|
|
117
|
+
|
|
70
118
|
### Phase 1: Understanding
|
|
71
119
|
- Identify the content purpose and goals
|
|
72
120
|
- Define the target audience
|
|
73
121
|
- Determine the desired tone and style
|
|
74
122
|
- Clarify key messages and takeaways
|
|
123
|
+
- **Apply custom content rules if available**
|
|
75
124
|
|
|
76
125
|
### Phase 2: Research
|
|
77
126
|
- Conduct thorough topic research using WebSearch
|