seomd-cli 1.4.0 → 2.0.1

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.
Files changed (39) hide show
  1. package/PROVIDER_SPEC.md +125 -0
  2. package/README.md +54 -190
  3. package/SKILL.md +44 -0
  4. package/bin/seomd.js +79 -31
  5. package/package.json +11 -7
  6. package/src/commands/analyze.js +90 -90
  7. package/src/commands/check.js +301 -0
  8. package/src/commands/doctor.js +109 -0
  9. package/src/commands/generate.js +215 -0
  10. package/src/commands/init.js +170 -66
  11. package/src/commands/status.js +92 -76
  12. package/src/commands/sync.js +84 -70
  13. package/src/commands/validate.js +52 -25
  14. package/src/generators/directory.js +46 -114
  15. package/src/generators/reverse.js +46 -56
  16. package/src/generators/seomd.js +226 -44
  17. package/src/providers/http.js +67 -0
  18. package/src/providers/index.js +194 -0
  19. package/src/utils/agent-wiring.js +97 -0
  20. package/src/utils/api-client.js +14 -56
  21. package/src/utils/constants.js +110 -12
  22. package/src/utils/migrate.js +99 -0
  23. package/src/utils/parser.js +114 -25
  24. package/src/utils/placeholders.js +31 -0
  25. package/src/utils/repo-scanner.js +207 -0
  26. package/src/utils/writeback.js +171 -82
  27. package/src/validators/seomd.js +263 -93
  28. package/scripts/release-contributors.js +0 -196
  29. package/scripts/release-notes.js +0 -194
  30. package/src/templates/blog/SEO.REVERSE.md +0 -176
  31. package/src/templates/blog/SEO.md +0 -233
  32. package/src/templates/ecommerce/SEO.REVERSE.md +0 -199
  33. package/src/templates/ecommerce/SEO.md +0 -239
  34. package/src/templates/local/SEO.REVERSE.md +0 -222
  35. package/src/templates/local/SEO.md +0 -245
  36. package/src/templates/marketplace/SEO.REVERSE.md +0 -222
  37. package/src/templates/marketplace/SEO.md +0 -245
  38. package/src/templates/saas/SEO.REVERSE.md +0 -268
  39. package/src/templates/saas/SEO.md +0 -257
@@ -1,194 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { execSync } from 'child_process';
4
- import YAML from 'yaml';
5
-
6
- function parseArgs(argv) {
7
- const out = { tag: null, prev: null, outFile: null };
8
- for (let i = 2; i < argv.length; i += 1) {
9
- const arg = argv[i];
10
- const next = argv[i + 1];
11
- if (arg === '--tag' && next) {
12
- out.tag = next;
13
- i += 1;
14
- } else if (arg === '--prev' && next) {
15
- out.prev = next;
16
- i += 1;
17
- } else if (arg === '--out' && next) {
18
- out.outFile = next;
19
- i += 1;
20
- }
21
- }
22
- return out;
23
- }
24
-
25
- function git(repoRoot, args) {
26
- return execSync(`git ${args}`, { cwd: repoRoot, stdio: ['ignore', 'pipe', 'pipe'] }).toString('utf8');
27
- }
28
-
29
- function getRepoRoot() {
30
- return execSync('git rev-parse --show-toplevel', { stdio: ['ignore', 'pipe', 'pipe'] }).toString('utf8').trim();
31
- }
32
-
33
- function readContributorsMap(repoRoot) {
34
- const filePath = path.join(repoRoot, '.github', 'contributors.yml');
35
- if (!fs.existsSync(filePath)) {
36
- return { version: 1, contributors: [] };
37
- }
38
- const parsed = YAML.parse(fs.readFileSync(filePath, 'utf8')) || {};
39
- return {
40
- version: parsed.version || 1,
41
- contributors: Array.isArray(parsed.contributors) ? parsed.contributors : []
42
- };
43
- }
44
-
45
- function normalizeEmail(email) {
46
- return String(email || '').trim().toLowerCase();
47
- }
48
-
49
- function normalizeName(name) {
50
- return String(name || '').trim().toLowerCase();
51
- }
52
-
53
- function resolveHandle(map, { name, email }) {
54
- const nEmail = normalizeEmail(email);
55
- const nName = normalizeName(name);
56
-
57
- for (const c of map.contributors) {
58
- if (!c || typeof c !== 'object') continue;
59
- if (!c.github) continue;
60
- const emails = Array.isArray(c.emails) ? c.emails.map(normalizeEmail) : [];
61
- if (nEmail && emails.includes(nEmail)) return c.github;
62
- const names = Array.isArray(c.names) ? c.names.map(normalizeName) : [];
63
- if (nName && names.includes(nName)) return c.github;
64
- }
65
- return null;
66
- }
67
-
68
- function fmtHandle(handle) {
69
- if (!handle) return null;
70
- return handle.startsWith('@') ? handle : `@${handle}`;
71
- }
72
-
73
- function bumpCounter(map, key) {
74
- map.set(key, (map.get(key) || 0) + 1);
75
- }
76
-
77
- function extractCoAuthors(commitBody) {
78
- const out = [];
79
- const lines = String(commitBody || '').split('\n');
80
- for (const line of lines) {
81
- const m = line.match(/^Co-authored-by:\s*(.+?)\s*<(.+?)>\s*$/i);
82
- if (m) out.push({ name: m[1], email: m[2] });
83
- }
84
- return out;
85
- }
86
-
87
- function getCommitBodies(repoRoot, range) {
88
- const sepCommit = '\u001e';
89
- const sepField = '\u001f';
90
- const out = git(repoRoot, `log ${range} --no-color --format=%H${sepField}%an${sepField}%ae${sepField}%s${sepField}%B${sepCommit}`);
91
- const rawCommits = out.split(sepCommit).map(s => s.trim()).filter(Boolean);
92
- return rawCommits.map(entry => {
93
- const parts = entry.split(sepField);
94
- const [sha, authorName, authorEmail, subject] = parts;
95
- const body = parts.slice(4).join(sepField);
96
- return { sha, authorName, authorEmail, subject, body };
97
- });
98
- }
99
-
100
- function determinePrevTag(repoRoot, tag) {
101
- try {
102
- return git(repoRoot, `describe --tags --abbrev=0 ${tag}^`).trim();
103
- } catch {
104
- return null;
105
- }
106
- }
107
-
108
- function buildReleaseMarkdown({ tag, prev, commits, contributors }) {
109
- const lines = [];
110
-
111
- lines.push(`# ${tag}`);
112
- lines.push('');
113
-
114
- if (prev) {
115
- lines.push(`Changes since ${prev}`);
116
- lines.push('');
117
- }
118
-
119
- if (commits.length > 0) {
120
- lines.push(`## Changes`);
121
- lines.push('');
122
- for (const c of commits) {
123
- const sha = String(c.sha || '').slice(0, 7);
124
- lines.push(`- ${c.subject} (${sha})`);
125
- }
126
- lines.push('');
127
- }
128
-
129
- lines.push(`## Contributors`);
130
- lines.push('');
131
-
132
- const sorted = Array.from(contributors.entries())
133
- .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
134
-
135
- if (sorted.length === 0) {
136
- lines.push(`- None`);
137
- lines.push('');
138
- return lines.join('\n');
139
- }
140
-
141
- for (const [handle, count] of sorted) {
142
- lines.push(`- ${fmtHandle(handle)} (${count})`);
143
- }
144
- lines.push('');
145
-
146
- return lines.join('\n');
147
- }
148
-
149
- function main() {
150
- const args = parseArgs(process.argv);
151
- if (!args.tag) {
152
- process.stderr.write('Usage: node scripts/release-notes.js --tag <tag> [--prev <tag>] [--out <file>]\n');
153
- process.exit(1);
154
- }
155
-
156
- const repoRoot = getRepoRoot();
157
- const prev = args.prev || determinePrevTag(repoRoot, args.tag);
158
- const range = prev ? `${prev}..${args.tag}` : args.tag;
159
-
160
- const contribMap = readContributorsMap(repoRoot);
161
- const commits = getCommitBodies(repoRoot, range);
162
-
163
- const contributors = new Map();
164
-
165
- for (const c of commits) {
166
- const authorHandle = resolveHandle(contribMap, { name: c.authorName, email: c.authorEmail });
167
- if (authorHandle) bumpCounter(contributors, authorHandle);
168
-
169
- for (const co of extractCoAuthors(c.body)) {
170
- const coHandle = resolveHandle(contribMap, co);
171
- if (coHandle) bumpCounter(contributors, coHandle);
172
- }
173
- }
174
-
175
- const md = buildReleaseMarkdown({
176
- tag: args.tag,
177
- prev,
178
- commits,
179
- contributors
180
- });
181
-
182
- if (args.outFile) {
183
- const outPath = path.isAbsolute(args.outFile) ? args.outFile : path.join(repoRoot, args.outFile);
184
- fs.mkdirSync(path.dirname(outPath), { recursive: true });
185
- fs.writeFileSync(outPath, md, 'utf8');
186
- process.stdout.write(`${outPath}\n`);
187
- return;
188
- }
189
-
190
- process.stdout.write(md + '\n');
191
- }
192
-
193
- main();
194
-
@@ -1,176 +0,0 @@
1
- # SEO.REVERSE.md
2
-
3
- ## {{brand}}
4
-
5
- ### spec v1.0 | https://seomd.dev
6
-
7
- #### generated: {{date}}
8
-
9
- ## This file is generated by the {{brand}} platform.
10
- ### Do not edit manually — run `npx seomd analyze` to update.
11
- ### Run `npx seomd sync` to pull latest intelligence.
12
-
13
- ## Each page section contains a full reverse engineer analysis:
14
-
15
- ### why_page_won — what the top cited competitor does right
16
- ### citation_hooks — specific patterns to replicate
17
- ### gaps_for_brand — where your page falls short
18
- ### remediation_playbook — step by step fixes with effort/impact
19
- ### fastest_win — highest ROI action to take now
20
- ### suggested_content_outline — ready to use outline for your writer/AI
21
-
22
- domain: {{domain}}
23
- brand: "{{brand}}"
24
- primary_competitor: {{primary_competitor}}
25
- last_analyzed: null
26
- next_analysis: null
27
- source: null
28
-
29
- ## Pages
30
- ### Run `npx seomd analyze` to populate these sections
31
-
32
- pages:
33
-
34
- ### Homepage
35
-
36
- - id: homepage
37
- url: /
38
- status: planned
39
- citation_rate: null
40
- gap_score: null
41
- top_cited_competitor: null
42
-
43
- why_page_won: []
44
- citation_hooks: []
45
-
46
- gaps_for_{{brand_lower_snake}}: []
47
-
48
- remediation_playbook: []
49
-
50
- fastest_win:
51
- action: null
52
- estimated_gap_score_improvement: null
53
- effort: null
54
-
55
- suggested_content_outline: []
56
-
57
- ### Category
58
-
59
- - id: category
60
- url: /[category]
61
- status: planned
62
- citation_rate: null
63
- gap_score: null
64
- top_cited_competitor: null
65
-
66
- why_page_won: []
67
- citation_hooks: []
68
-
69
- gaps_for_{{brand_lower_snake}}: []
70
-
71
- remediation_playbook: []
72
-
73
- fastest_win:
74
- action: null
75
- estimated_gap_score_improvement: null
76
- effort: null
77
-
78
- suggested_content_outline: []
79
-
80
- ### Article
81
-
82
- - id: article
83
- url: /[category]/[slug]
84
- status: planned
85
- citation_rate: null
86
- gap_score: null
87
- top_cited_competitor: null
88
-
89
- why_page_won: []
90
- citation_hooks: []
91
-
92
- gaps_for_{{brand_lower_snake}}: []
93
-
94
- remediation_playbook: []
95
-
96
- fastest_win:
97
- action: null
98
- estimated_gap_score_improvement: null
99
- effort: null
100
-
101
- suggested_content_outline: []
102
-
103
- ### Author
104
-
105
- - id: author
106
- url: /author/[slug]
107
- status: planned
108
- citation_rate: null
109
- gap_score: null
110
- top_cited_competitor: null
111
-
112
- why_page_won: []
113
- citation_hooks: []
114
-
115
- gaps_for_{{brand_lower_snake}}: []
116
-
117
- remediation_playbook: []
118
-
119
- fastest_win:
120
- action: null
121
- estimated_gap_score_improvement: null
122
- effort: null
123
-
124
- suggested_content_outline: []
125
-
126
- ### About
127
-
128
- - id: about
129
- url: /about
130
- status: planned
131
- citation_rate: null
132
- gap_score: null
133
- top_cited_competitor: null
134
-
135
- why_page_won: []
136
- citation_hooks: []
137
-
138
- gaps_for_{{brand_lower_snake}}: []
139
-
140
- remediation_playbook: []
141
-
142
- fastest_win:
143
- action: null
144
- estimated_gap_score_improvement: null
145
- effort: null
146
-
147
- suggested_content_outline: []
148
-
149
- ### Newsletter
150
-
151
- - id: newsletter
152
- url: /newsletter
153
- status: planned
154
- citation_rate: null
155
- gap_score: null
156
- top_cited_competitor: null
157
-
158
- why_page_won: []
159
- citation_hooks: []
160
-
161
- gaps_for_{{brand_lower_snake}}: []
162
-
163
- remediation_playbook: []
164
-
165
- fastest_win:
166
- action: null
167
- estimated_gap_score_improvement: null
168
- effort: null
169
-
170
- suggested_content_outline: []
171
-
172
- ## Competitor Profiles
173
- ### Platform populated — competitor citation patterns
174
-
175
- competitors:
176
- {{reverse_competitors}}
@@ -1,233 +0,0 @@
1
- # SEO.md
2
-
3
- ## {{brand}}
4
-
5
- ### spec v1.0 | <https://seomd.dev>
6
-
7
- ## Site
8
-
9
- site:
10
- type: blog
11
- domain: {{domain}}
12
- canonical: https://{{domain}}
13
- locale: en-US
14
- launched: null # YYYY-MM-DD
15
-
16
- ## Identity
17
-
18
- identity:
19
- brand: "{{brand}}"
20
- tagline: null
21
- social:
22
- twitter: null
23
- linkedin: null
24
- github: null
25
- schema_org_type: Organization
26
-
27
- ## Keywords
28
-
29
- keywords:
30
-
31
- primary: "{{primary_keyword}}"
32
- secondary: [] # add your secondary keywords
33
- negative: # terms that dilute your intent signal
34
- - "free"
35
- - "tutorial"
36
- - "how to"
37
- competitor_terms:
38
- {{competitor_terms}}
39
- category_terms: # unbranded category queries
40
- - "best {{primary_keyword}}"
41
- - "top {{primary_keyword}} tools"
42
- long_tail: [] # add long-tail variations
43
- seasonal: null # add seasonal terms if applicable
44
-
45
- ## Intent
46
-
47
- intent:
48
-
49
- informational:
50
- priority: critical
51
- queries:
52
- - "what is {{primary_keyword}}"
53
- - "how does {{primary_keyword}} work"
54
-
55
- comparison:
56
- priority: medium
57
- queries:
58
- {{competitors_comparison_queries}}
59
- - "best {{primary_keyword}} for startups"
60
-
61
- transactional:
62
- priority: low
63
- queries:
64
- - "is {{brand_lower}} worth it"
65
- - "should I use {{brand_lower}}"
66
- - "{{brand_lower}} pricing"
67
-
68
- reputational:
69
- priority: medium
70
- queries:
71
- - "{{brand_lower}} reviews"
72
- - "is {{brand_lower}} legit"
73
- - "{{brand_lower}} problems"
74
-
75
- category:
76
- priority: high
77
- queries:
78
- - "best {{primary_keyword}}"
79
- - "top {{primary_keyword}} 2026"
80
-
81
- ## Pages
82
-
83
- pages:
84
- site_type: blog
85
-
86
- required:
87
- - id: homepage
88
- url: /
89
- primary_keyword: null
90
- status: planned
91
- priority: 1
92
-
93
- - id: category
94
- url: /[category]
95
- primary_keyword: null
96
- status: planned
97
- priority: 2
98
-
99
- - id: article
100
- url: /[category]/[slug]
101
- primary_keyword: null
102
- status: planned
103
- priority: 3
104
-
105
- - id: author
106
- url: /author/[slug]
107
- primary_keyword: null
108
- status: planned
109
- priority: 4
110
-
111
- - id: about
112
- url: /about
113
- primary_keyword: null
114
- status: planned
115
- priority: 5
116
-
117
- - id: newsletter
118
- url: /newsletter
119
- primary_keyword: null
120
- status: planned
121
- priority: 6
122
-
123
- ## Copy
124
-
125
- copy:
126
-
127
- h1_contains_primary_keyword: true
128
- meta_description_length: 150-160
129
- meta_description_includes_cta: true
130
- min_word_count:
131
- homepage: 800
132
- feature_page: 600
133
- blog_post: 1200
134
- comparison_page: 1500
135
- reading_level: 8 # grade level target
136
-
137
- ## Structure
138
-
139
- structure:
140
-
141
- answer_first: true # direct answer in first 50 words
142
- faq_section_required: true # on all key pages
143
- faq_minimum_questions: 6
144
- statistics_per_page: 2 # minimum data points with sources
145
- citations_required: true # link to primary sources
146
- short_paragraphs: true # max 3 sentences
147
- heading_hierarchy: strict # H1 > H2 > H3, no skipping
148
-
149
- ## Authority
150
-
151
- authority:
152
-
153
- cite_sources: true
154
- expert_quotes: false # set true when you have quotes
155
- eeat_signals:
156
- experience: null # describe your experience signal
157
- expertise: null # describe your expertise signal
158
- authority: null # describe your authority signal
159
- trust: null # describe your trust signal
160
-
161
- ## Schema
162
-
163
- schema:
164
-
165
- types:
166
- - Article
167
- - Person
168
- - FAQPage
169
- - BreadcrumbList
170
- faq_schema: true
171
- breadcrumb_schema: true
172
- organization_schema: true
173
-
174
- ## Crawl
175
-
176
- crawl:
177
-
178
- sitemap: /sitemap.xml
179
- robots_txt: /robots.txt
180
- allow_ai_bots: true
181
- allowed_bots:
182
- - Googlebot
183
- - Bingbot
184
- - PerplexityBot
185
- - ChatGPT-User
186
- - GPTBot
187
- - ClaudeBot
188
- - anthropic-ai
189
- - cohere-ai
190
- disallow:
191
- - /admin
192
- - /checkout
193
- - /user/*
194
- - /api/*
195
-
196
- ## Performance
197
-
198
- performance:
199
-
200
- lcp: 2.5s
201
- cls: 0.1
202
- fid: 100ms
203
- page_size: 500kb
204
- ttfb: 800ms
205
-
206
- ## AEO
207
-
208
- aeo:
209
-
210
- answer_first_format: true
211
- faq_on_all_key_pages: true
212
- structured_data_priority: high
213
- content_freshness_target: 30d # update key pages within 30 days
214
- competitors_to_monitor:
215
- {{competitors_to_monitor}}
216
-
217
- ## Monitoring
218
-
219
- monitoring:
220
-
221
- sync_schedule: monthly # monthly | weekly | on_demand
222
- auto_commit: false # platform commits directly to repo
223
- pr_mode: true # open PR instead of direct commit
224
- branch: main
225
- alert_on_gap_score_above: 80 # alert when gap score exceeds threshold
226
- alert_on_citation_drop: true # alert if citation rate drops
227
-
228
- ## Platform Connection
229
-
230
- platform:
231
- provider: null # foxcite | manual | ahrefs | semrush
232
- project_id: null
233
-