@appeeky/spec 0.6.1 → 0.8.0
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 +56 -5
- package/agents/appeeky-aso.md +1 -1
- package/agents/cofounder.md +3 -3
- package/dist/alerts.d.ts +109 -0
- package/dist/alerts.js +469 -0
- package/dist/cli.js +94 -4
- package/dist/experiments.d.ts +4 -4
- package/dist/files.js +9 -0
- package/dist/reviews.d.ts +2 -2
- package/dist/schema.d.ts +216 -0
- package/dist/schema.js +35 -0
- package/dist/setup.js +42 -1
- package/dist/social.d.ts +4 -4
- package/dist/visibility-core.js +26 -26
- package/dist/visibility-local.d.ts +20 -0
- package/dist/visibility-local.js +25 -3
- package/dist/visibility.d.ts +43 -1
- package/dist/visibility.js +59 -3
- package/package.json +1 -1
- package/skills/appeeky-spec/SKILL.md +2 -1
- package/skills/appeeky-spec-automation/SKILL.md +17 -5
- package/skills/appeeky-spec-cofounder/SKILL.md +7 -5
- package/skills/appeeky-spec-server/SKILL.md +1 -0
- package/skills/appeeky-spec-server/files/env.example +3 -1
- package/skills/appeeky-spec-visibility/SKILL.md +12 -4
package/dist/visibility-core.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
function
|
|
1
|
+
var W=20,G=300;function M(e){let n=[],t=new Set;for(let o of e){if(typeof o!="string")continue;let s=o.trim().replace(/\s+/g," ").slice(0,G);if(!s)continue;let i=s.toLowerCase();if(!t.has(i)&&(t.add(i),n.push(s),n.length>=W))break}return n}function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function w(e){return Array.isArray(e)?e:[]}function y(e){return typeof e=="string"&&e.length>0?e:void 0}function _(e){return typeof e=="number"&&Number.isFinite(e)?e:0}function F(e){try{let n=new URL(e);n.hash="",n.searchParams.delete("utm_source");let t=n.toString();return t.endsWith("/")&&(t=t.slice(0,-1)),t.toLowerCase()}catch{return e.trim().toLowerCase()}}var C=class{list=[];index=new Map;add(n,t){if(!n)return null;let o=F(n),s=this.index.get(o);if(s!==void 0){let i=this.list[s];return!i.title&&t&&(i.title=t),s+1}return this.list.push(t?{url:n,title:t}:{url:n}),this.index.set(o,this.list.length-1),this.list.length}get citations(){return this.list}};function v(e){return Array.from(new Set(e)).sort((t,o)=>t-o).map(t=>` [${t}]`).join("")}function O(e){let n=h(e)?e:{},t=new C,o=[],s=[],i=0;for(let m of w(n.output))if(h(m)){if(m.type==="web_search_call"){i+=1;let l=h(m.action)?m.action:{};s.push(l.query,...w(l.queries));continue}if(m.type==="message")for(let l of w(m.content)){if(!h(l)||l.type!=="output_text")continue;let u=typeof l.text=="string"?l.text:"",a=[];for(let p of w(l.annotations)){if(!h(p)||p.type!=="url_citation")continue;let g=y(p.url),d=t.add(g,y(p.title));if(d===null||!g)continue;let f=J(u,p,g);f!==null&&a.push({at:f,n:d})}o.push(B(u,a))}}let r=o.join(`
|
|
2
2
|
|
|
3
|
-
`).trim();!
|
|
4
|
-
The user is in ${
|
|
3
|
+
`).trim();!r&&typeof n.output_text=="string"&&(r=n.output_text.trim());let c=h(n.usage)?n.usage:{};return{text:r,citations:t.citations,inputTokens:_(c.input_tokens),outputTokens:_(c.output_tokens),searchCalls:i,searchQueries:M(s)}}function J(e,n,t){let o=typeof n.start_index=="number"?n.start_index:null,s=typeof n.end_index=="number"?n.end_index:null,i="";try{i=new URL(t).hostname.replace(/^www\./,"")}catch{}if(o!==null&&s!==null&&s<=e.length&&o<s){let m=e.slice(o,s);if(m.includes(t)||i&&m.includes(i))return s}let r=e.indexOf(t);if(r===-1)return null;let c=r+t.length;for(;c<e.length&&e[c]===")";)c+=1;return c}function B(e,n){if(n.length===0)return e;let t=new Map;for(let{at:s,n:i}of n)t.set(s,[...t.get(s)??[],i]);let o=e;for(let s of Array.from(t.keys()).sort((i,r)=>r-i))o=o.slice(0,s)+v(t.get(s))+o.slice(s);return o}function T(e){let n=h(e)?e:{},t=new C,o=w(n.content).filter(h),s="",i=0,r=[];for(let u of o){if(u.type==="server_tool_use"&&u.name==="web_search"&&(i+=1,h(u.input)&&r.push(u.input.query)),u.type!=="text")continue;let a=typeof u.text=="string"?u.text:"",p=[];for(let g of w(u.citations)){if(!h(g)||g.type!==void 0&&g.type!=="web_search_result_location")continue;let d=t.add(y(g.url),y(g.title));d!==null&&p.push(d)}s+=p.length>0?Q(a,v(p)):a}for(let u of o)if(u.type==="web_search_tool_result")for(let a of w(u.content))h(a)&&(a.type!==void 0&&a.type!=="web_search_result"||t.add(y(a.url),y(a.title)));let c=h(n.usage)?n.usage:{},m=h(c.server_tool_use)?c.server_tool_use:{},l=_(m.web_search_requests);return{text:s.trim(),citations:t.citations,inputTokens:_(c.input_tokens),outputTokens:_(c.output_tokens),searchCalls:l>0?l:i,searchQueries:M(r)}}function Q(e,n){let t=/\s*$/.exec(e),o=t?t.index:e.length;return e.slice(0,o)+n+e.slice(o)}function N(e){let n=new C,t=h(e.groundingMetadata)?e.groundingMetadata:{},o=[];for(let r of w(t.groundingChunks)){let c=h(r)&&h(r.web)?r.web:h(r)&&h(r.retrievedContext)?r.retrievedContext:null;o.push(c?n.add(y(c.uri),y(c.title)):null)}for(let r of e.sources??[])n.add(y(r?.url),y(r?.title));let s=e.text;for(let r of w(t.groundingSupports)){if(!h(r))continue;let c=h(r.segment)?r.segment:{},m=y(c.text)??y(r.segment_text);if(!m)continue;let l=w(r.groundingChunkIndices).map(p=>typeof p=="number"?o[p]:null).filter(p=>typeof p=="number");if(l.length===0)continue;let u=s.indexOf(m);if(u===-1)continue;let a=u+m.length;s=s.slice(0,a)+v(l)+s.slice(a)}let i=M(w(t.webSearchQueries));return{text:s,citations:n.citations,searchCalls:i.length>0||n.citations.length>0?1:0,searchQueries:i}}var j=["chatgpt","claude","gemini","perplexity"],R={chatgpt:{model:"chatgpt",env:["OPENAI_API_KEY"],modelId:"gpt-4.1",estimateUsd:.035},claude:{model:"claude",env:["ANTHROPIC_API_KEY"],modelId:"claude-haiku-5-5",estimateUsd:.015},gemini:{model:"gemini",env:["GEMINI_API_KEY","GOOGLE_API_KEY","GOOGLE_GENERATIVE_AI_API_KEY"],modelId:"gemini-2.5-flash",estimateUsd:.04},perplexity:{model:"perplexity",env:["PERPLEXITY_API_KEY"],modelId:"sonar",estimateUsd:.008}},Y=[{model:"chatgpt",modelId:"gpt-4.1-mini",estimateUsd:.001},{model:"gemini",modelId:"gemini-2.5-flash",estimateUsd:.001},{model:"claude",modelId:"claude-haiku-5-5",estimateUsd:.002}];function L(e,n){for(let t of R[e].env)if(n[t]?.trim())return n[t].trim()}function re(e,n=j){return n.filter(t=>L(t,e))}function D(e){for(let n of Y){let t=L(n.model,e);if(t)return{...n,key:t}}return null}function ie(e,n,t){let o=D(t),s=n.reduce((i,r)=>i+R[r].estimateUsd+(o?.estimateUsd??0),0);return Math.round(e*s*100)/100}var H=e=>new Promise(n=>setTimeout(n,e));async function b(e,n,t,o,s=12e4){let i="";for(let r=0;r<4;r++){let c=await e(n,{method:"POST",headers:{"content-type":"application/json",...t},body:JSON.stringify(o),signal:AbortSignal.timeout(s)}),m=await c.text();if(c.ok)return JSON.parse(m);if(i=`${c.status} ${K(m)}`,c.status!==429&&c.status<500)break;let l=Number(c.headers.get("retry-after"));await H(Number.isFinite(l)&&l>0?Math.min(l*1e3,3e4):2e3*2**r)}throw new Error(i)}function K(e){try{let n=JSON.parse(e),t=Array.isArray(n)?n[0]?.error:n.error;return(typeof t=="string"?t:t?.message)??e.slice(0,200)}catch{return e.slice(0,200)}}var V={"gpt-4.1":{in:2,out:8},"gpt-4.1-mini":{in:.4,out:1.6},"claude-haiku-5-5":{in:.1,out:.5},"gemini-2.5-flash":{in:.3,out:2.5},sonar:{in:1,out:1}},S={chatgpt:.025,claude:.01,gemini:.035,perplexity:.005},x=(e,n,t)=>{let o=V[e];return o?(n*o.in+t*o.out)/1e6:0};function z(e,n){return`You are a helpful assistant recommending mobile apps.
|
|
4
|
+
The user is in ${e.toUpperCase()} and writes in ${n.toUpperCase()}.
|
|
5
5
|
When the user asks for an app, return a short ranked list (1\u20135) of real,
|
|
6
6
|
currently-available apps. For each app: state its name first, then a
|
|
7
7
|
one-sentence reason. Prefer iOS App Store apps. Be specific \u2014 name the
|
|
8
8
|
exact app, not a category. If you genuinely cannot recommend any app,
|
|
9
|
-
say so plainly.`}function
|
|
9
|
+
say so plainly.`}function X(e){let n=e.toLowerCase();return["i can't recommend","i cannot recommend","i'm unable to recommend","i am unable to recommend"].some(t=>n.includes(t))||n.startsWith("i'm sorry")||n.startsWith("sorry, i")}var q=e=>/claude-[a-z]+-5/.test(e)?{max_tokens:16e3}:{max_tokens:1500,temperature:.4};async function ae(e,n,t,o=fetch){let s=R[e].modelId,i=z(t.country,t.language);try{let r="",c=[],m=[],l=0;if(e==="chatgpt"){let u=await b(o,"https://api.openai.com/v1/responses",{authorization:`Bearer ${n}`},{model:s,instructions:i,input:t.prompt,temperature:.4,tools:[{type:"web_search_preview",search_context_size:"low"}]}),a=O(u);({text:r,citations:c}=a),m=a.searchQueries??[],l=x(s,a.inputTokens,a.outputTokens)+S.chatgpt*Math.max(1,a.searchCalls)}else if(e==="claude"){let u=await b(o,"https://api.anthropic.com/v1/messages",{"x-api-key":n,"anthropic-version":"2023-06-01"},{model:s,...q(s),system:i,messages:[{role:"user",content:t.prompt}],tools:[{type:"web_search_20250305",name:"web_search",max_uses:3}]}),a=T(u);({text:r,citations:c}=a),m=a.searchQueries??[],l=x(s,a.inputTokens,a.outputTokens)+S.claude*Math.max(1,a.searchCalls)}else if(e==="gemini"){let u=await b(o,`https://generativelanguage.googleapis.com/v1beta/models/${s}:generateContent`,{"x-goog-api-key":n},{systemInstruction:{parts:[{text:i}]},contents:[{role:"user",parts:[{text:t.prompt}]}],tools:[{google_search:{}}],generationConfig:{temperature:.4}}),a=u?.candidates?.[0],p=(a?.content?.parts??[]).map(f=>f.text??"").join(""),g=N({text:p,groundingMetadata:a?.groundingMetadata});({text:r,citations:c}=g),m=g.searchQueries??[];let d=u?.usageMetadata??{};l=x(s,d.promptTokenCount??0,(d.candidatesTokenCount??0)+(d.thoughtsTokenCount??0))+(g.searchCalls>0?S.gemini:0)}else{let u=await b(o,"https://api.perplexity.ai/chat/completions",{authorization:`Bearer ${n}`},{model:s,temperature:.4,messages:[{role:"system",content:i},{role:"user",content:t.prompt}]});r=u?.choices?.[0]?.message?.content??"",c=(Array.isArray(u?.search_results)&&u.search_results.length?u.search_results:Array.isArray(u?.citations)?u.citations:[]).map(p=>typeof p=="string"?{url:p}:p&&typeof p.url=="string"?{url:p.url,title:p.title}:null).filter(p=>p!==null),l=x(s,u?.usage?.prompt_tokens??0,u?.usage?.completion_tokens??0)+S.perplexity}return{model:e,modelId:s,status:X(r)?"refusal":"ok",text:r,citations:c,searches:m,costUsd:l}}catch(r){return{model:e,modelId:s,status:"error",text:"",citations:[],searches:[],costUsd:0,error:r.message}}}function E(e){let n=e.indexOf("{"),t=e.lastIndexOf("}");if(n===-1||t<=n)throw new Error("no JSON in the answer");return JSON.parse(e.slice(n,t+1))}async function P(e,n,t,o=fetch){if(e.model==="chatgpt"){let r=await b(o,"https://api.openai.com/v1/chat/completions",{authorization:`Bearer ${e.key}`},{model:e.modelId,temperature:t,response_format:{type:"json_object"},messages:[{role:"user",content:n}]});return{json:E(r?.choices?.[0]?.message?.content??""),costUsd:x(e.modelId,r?.usage?.prompt_tokens??0,r?.usage?.completion_tokens??0)}}if(e.model==="gemini"){let r=await b(o,`https://generativelanguage.googleapis.com/v1beta/models/${e.modelId}:generateContent`,{"x-goog-api-key":e.key},{contents:[{role:"user",parts:[{text:n}]}],generationConfig:{temperature:t,responseMimeType:"application/json"}}),c=(r?.candidates?.[0]?.content?.parts??[]).map(l=>l.text??"").join(""),m=r?.usageMetadata??{};return{json:E(c),costUsd:x(e.modelId,m.promptTokenCount??0,(m.candidatesTokenCount??0)+(m.thoughtsTokenCount??0))}}let s=await b(o,"https://api.anthropic.com/v1/messages",{"x-api-key":e.key,"anthropic-version":"2023-06-01"},{model:e.modelId,...q(e.modelId),messages:[{role:"user",content:`${n}
|
|
10
10
|
|
|
11
|
-
Answer with the JSON object only.`}]}),i=(
|
|
12
|
-
Known competitor apps: ${
|
|
11
|
+
Answer with the JSON object only.`}]}),i=(s?.content??[]).filter(r=>r.type==="text").map(r=>r.text).join("");return{json:E(i),costUsd:x(e.modelId,s?.usage?.input_tokens??0,s?.usage?.output_tokens??0)}}function Z(e){let n=e.competitors.length?`
|
|
12
|
+
Known competitor apps: ${e.competitors.slice(0,10).join(", ")}`:"",t=e.citations.length?`
|
|
13
13
|
|
|
14
14
|
Citations available (0-indexed):
|
|
15
|
-
${
|
|
15
|
+
${e.citations.slice(0,10).map((o,s)=>` [${s}] ${o.title??o.url}`).join(`
|
|
16
16
|
`)}`:"";return`You parse a recommendation answer from an AI assistant and extract
|
|
17
17
|
which mobile apps were mentioned, and in which position.
|
|
18
18
|
|
|
19
19
|
Original user prompt:
|
|
20
|
-
"""${
|
|
20
|
+
"""${e.prompt}"""
|
|
21
21
|
|
|
22
22
|
The user owns this app (recognise it even with minor spelling variants):
|
|
23
|
-
"${
|
|
23
|
+
"${e.owner}"${n}
|
|
24
24
|
|
|
25
25
|
Assistant's answer:
|
|
26
|
-
"""${
|
|
26
|
+
"""${e.answer.slice(0,8e3)}"""${t}
|
|
27
27
|
|
|
28
28
|
Return JSON: {"refusal": boolean, "apps": [{"appName": string, "position": number|null, "citationIndex": number|null}]}
|
|
29
29
|
|
|
@@ -40,21 +40,21 @@ Rules:
|
|
|
40
40
|
generic phrases like "an app for X" \u2014 only specific named apps.
|
|
41
41
|
- Strip explanatory parentheses from appName (return "Calm" not
|
|
42
42
|
"Calm (popular meditation app)").
|
|
43
|
-
- App names should be the brand the assistant used.`}async function
|
|
43
|
+
- App names should be the brand the assistant used.`}async function ce(e,n,t=fetch){let{json:o,costUsd:s}=await P(e,Z(n),0,t),r=(Array.isArray(o?.apps)?o.apps:[]).map(c=>c).filter(c=>typeof c.appName=="string"&&c.appName.trim()).map(c=>({name:c.appName.trim(),position:typeof c.position=="number"&&c.position>=1?Math.round(c.position):null,citation:typeof c.citationIndex=="number"&&c.citationIndex>=0?Math.round(c.citationIndex):null}));return{refusal:!!o?.refusal,mentions:r,costUsd:s}}var A=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]/gu,"");function $(e,n){let t=A(e);return t?n.some(o=>[o,o.split(/\s[:\-–—|]\s|:\s/)[0]??o].map(A).filter(i=>i.length>=3).some(i=>t===i||i.length>=4&&(t.includes(i)||i.includes(t)&&t.length>=i.length*.7))):!1}var ee=25,k=e=>Math.round(e*10)/10;function ue(e,n,t){return n.map(o=>{let s=e.filter(a=>a.intent===o&&(a.status==="ok"||a.status==="refusal")),i={};for(let a of j){let p=s.filter(f=>f.model===a);if(!p.length)continue;let g=p.map(f=>f.mentions.find(I=>$(I.name,t))).filter(f=>!!f),d=g.map(f=>f.position).filter(f=>f!==null);i[a]={pct:k(g.length/p.length*100),position:d.length?k(d.reduce((f,I)=>f+I,0)/d.length):null,prompts:p.length}}let r=Object.values(i),c=r.length?k(r.reduce((a,p)=>a+p.pct,0)/r.length):void 0,m=new Map;for(let a of s)for(let p of a.mentions){if($(p.name,t))continue;let g=A(p.name),d=m.get(g)??{name:p.name,count:0,models:new Set};d.count++,d.models.add(a.model),m.set(g,d)}let l=[...m.values()].sort((a,p)=>p.count-a.count||a.name.localeCompare(p.name)).slice(0,5).map(a=>({name:a.name,pct:s.length?Math.min(100,k(a.count/s.length*100)):0,models:[...a.models]})),u=c===void 0?"no_data":c>=ee?"winning":c>0?"weak":"missing";return{label:o,status:u,you:c,byModel:i,namedInstead:l}})}function le(e,n){let t=e.filter(l=>l.status==="ok"||l.status==="refusal"),o=new Map,s=0;for(let l of t){let u=new Set;for(let a of l.mentions){let p=$(a.name,n),g=p?"\0you":A(a.name);if(!g||u.has(g))continue;u.add(g);let d=o.get(g)??{name:p?n[0]:a.name,you:p,hits:0,firsts:0,positions:[]};d.hits++,s++,a.position===1&&d.firsts++,a.position!==null&&d.positions.push(a.position),o.set(g,d)}}let i=(l,u)=>u?k(l/u*100):0,r=l=>({name:l.name,...l.you?{you:!0}:{},visibility:i(l.hits,t.length),shareOfVoice:i(l.hits,s),winRate:i(l.firsts,t.length),position:l.positions.length?k(l.positions.reduce((u,a)=>u+a,0)/l.positions.length):null}),c=[...o.values()].sort((l,u)=>u.hits-l.hits||l.name.localeCompare(u.name)).map(r),m=c.find(l=>l.you)??{name:n[0]??"",you:!0,visibility:0,shareOfVoice:0,winRate:0,position:null};return{answers:t.length,you:m,apps:c}}function pe(e){let n=new Map;for(let t of e)for(let o of t.searches??[]){let s=o.toLowerCase().replace(/\s+/g," ").trim();if(!s)continue;let i=n.get(s)??{query:o.trim(),count:0,models:new Set};i.count++,i.models.add(t.model),n.set(s,i)}return[...n.values()].sort((t,o)=>o.count-t.count||t.query.localeCompare(o.query)).map(t=>({query:t.query,count:t.count,models:[...t.models]}))}function me(e,n){let t=n.map(s=>s.toLowerCase().replace(/^www\./,"")),o=new Map;for(let s of e)for(let i of s.citations){let r;try{r=new URL(i.url).hostname.toLowerCase().replace(/^www\./,"")}catch{continue}r.endsWith("vertexaisearch.cloud.google.com")&&i.title&&/^[\w.-]+\.[a-z]{2,}$/i.test(i.title)&&(r=i.title.toLowerCase().replace(/^www\./,""));let c=o.get(r)??{domain:r,count:0,url:i.url};c.count++,t.some(m=>r===m||r.endsWith(`.${m}`))&&(c.yours=!0),o.set(r,c)}return[...o.values()].sort((s,i)=>i.count-s.count||s.domain.localeCompare(i.domain))}function te(e,n,t){return`You map a mobile app to the *user intents* it serves \u2014 the goals
|
|
44
44
|
real users would ask an AI assistant (like ChatGPT, Gemini, or
|
|
45
45
|
Perplexity) about. Each intent is a short user-meaningful goal,
|
|
46
46
|
NOT an app feature.
|
|
47
47
|
|
|
48
|
-
App: ${
|
|
49
|
-
Subtitle: ${
|
|
50
|
-
Description (first 700 chars): ${
|
|
51
|
-
Target keywords: ${
|
|
48
|
+
App: ${e.title}${e.subtitle?`
|
|
49
|
+
Subtitle: ${e.subtitle}`:""}${e.description?`
|
|
50
|
+
Description (first 700 chars): ${e.description.slice(0,700)}`:""}${e.keywords?.length?`
|
|
51
|
+
Target keywords: ${e.keywords.slice(0,20).join(", ")}`:""}
|
|
52
52
|
|
|
53
|
-
Country: ${
|
|
54
|
-
Language: ${
|
|
53
|
+
Country: ${e.country.toUpperCase()}
|
|
54
|
+
Language: ${e.language.toUpperCase()}${t.length?`
|
|
55
55
|
|
|
56
56
|
ALREADY DEFINED (do NOT propose duplicates or near-duplicates):
|
|
57
|
-
- ${
|
|
57
|
+
- ${t.slice(0,30).join(`
|
|
58
58
|
- `)}`:""}
|
|
59
59
|
|
|
60
60
|
Return JSON: {"intents": [{"label": string, "description": string}]}
|
|
@@ -69,7 +69,7 @@ Rules:
|
|
|
69
69
|
problem-driven goals, and at least one comparison/alternative angle when applicable.
|
|
70
70
|
- Write labels in the storefront's language.
|
|
71
71
|
- Description (1 sentence, max 200 chars): what kind of user has this
|
|
72
|
-
intent and what they want the assistant to recommend.`}function
|
|
72
|
+
intent and what they want the assistant to recommend.`}function ne(e,n,t){return`You write realistic prompts that everyday users would type into an
|
|
73
73
|
AI assistant (ChatGPT, Gemini, Perplexity) when looking for a mobile app.
|
|
74
74
|
|
|
75
75
|
Intent to cover:
|
|
@@ -77,20 +77,20 @@ Intent to cover:
|
|
|
77
77
|
${n.description}`:""}
|
|
78
78
|
|
|
79
79
|
App context (the app whose visibility we're measuring):
|
|
80
|
-
Title: ${
|
|
81
|
-
Subtitle: ${
|
|
82
|
-
Known competitor apps (use in comparison prompts where natural): ${
|
|
80
|
+
Title: ${e.title}${e.subtitle?`
|
|
81
|
+
Subtitle: ${e.subtitle}`:""}${e.competitors?.length?`
|
|
82
|
+
Known competitor apps (use in comparison prompts where natural): ${e.competitors.slice(0,6).join(", ")}`:""}
|
|
83
83
|
|
|
84
|
-
Country: ${
|
|
85
|
-
Language: ${
|
|
84
|
+
Country: ${e.country.toUpperCase()}
|
|
85
|
+
Language: ${e.language.toUpperCase()}
|
|
86
86
|
|
|
87
87
|
Return JSON: {"prompts": [string]}
|
|
88
88
|
|
|
89
89
|
Rules:
|
|
90
|
-
- Produce ${
|
|
90
|
+
- Produce ${t} prompts that cover the intent from different angles:
|
|
91
91
|
a pure category query, a problem-first one ("I struggle with\u2026"),
|
|
92
92
|
a scenario ("an app for my morning routine"), and where natural an
|
|
93
93
|
"alternative to X" comparison. Never name the app being measured.
|
|
94
94
|
- Write the way a casual user types, in the storefront's language:
|
|
95
95
|
conversational, lower-case is fine. Length 8\u201335 words.
|
|
96
|
-
- Do NOT mention that you're an AI or test prompts. No emojis.`}var U=
|
|
96
|
+
- Do NOT mention that you're an AI or test prompts. No emojis.`}var U=e=>e.toLowerCase().replace(/[^\p{L}\p{N}\s]/gu," ").split(/\s+/).filter(Boolean).sort().join(" ");async function de(e,n,t={},o=fetch){let s=t.maxIntents??6,i=await P(e,te(n,s,t.exclude??[]),.7,o),r=i.costUsd,c=new Set((t.exclude??[]).map(U)),m=[];for(let u of Array.isArray(i.json?.intents)?i.json.intents:[]){if(typeof u?.label!="string"||u.label.trim().length<4)continue;let a=U(u.label);if(!c.has(a)&&(c.add(a),m.push({label:u.label.trim(),description:typeof u.description=="string"?u.description.trim():void 0}),m.length>=s))break}let l=[];for(let u of m){let a=await P(e,ne(n,u,t.promptsPerIntent??4),.8,o);r+=a.costUsd;let p=A(n.title.split(/[:\-–—|]/)[0]??n.title),g=[...new Set((Array.isArray(a.json?.prompts)?a.json.prompts:[]).filter(d=>typeof d=="string"&&d.trim().length>=15).map(d=>d.trim()))].filter(d=>p.length<4||!A(d).includes(p)).slice(0,t.promptsPerIntent??4);g.length&&l.push({...u,prompts:g})}return{intents:l,costUsd:r}}export{j as MODELS,R as PROVIDERS,ee as WINNING_PCT,ae as ask,re as availableModels,me as citedDomains,ce as extract,de as generateIntents,D as helperFor,P as helperJson,$ as isOwner,L as keyFor,le as overall,ie as quoteScan,ue as score,pe as searchQueries};
|
|
@@ -19,6 +19,7 @@ interface Answer {
|
|
|
19
19
|
status: "ok" | "refusal" | "error";
|
|
20
20
|
text: string;
|
|
21
21
|
citations: Citation[];
|
|
22
|
+
searches?: string[];
|
|
22
23
|
costUsd: number;
|
|
23
24
|
error?: string;
|
|
24
25
|
}
|
|
@@ -40,6 +41,15 @@ interface ScoredAnswer {
|
|
|
40
41
|
status: Answer["status"];
|
|
41
42
|
mentions: Mention[];
|
|
42
43
|
citations: Citation[];
|
|
44
|
+
searches?: string[];
|
|
45
|
+
}
|
|
46
|
+
interface AppShare {
|
|
47
|
+
name: string;
|
|
48
|
+
you?: true;
|
|
49
|
+
visibility: number;
|
|
50
|
+
shareOfVoice: number;
|
|
51
|
+
winRate: number;
|
|
52
|
+
position: number | null;
|
|
43
53
|
}
|
|
44
54
|
interface IntentScore {
|
|
45
55
|
label: string;
|
|
@@ -94,6 +104,16 @@ export interface VisibilityCore {
|
|
|
94
104
|
}>;
|
|
95
105
|
isOwner(name: string, titles: string[]): boolean;
|
|
96
106
|
score(answers: ScoredAnswer[], intents: string[], owner: string[]): IntentScore[];
|
|
107
|
+
overall(answers: ScoredAnswer[], owner: string[]): {
|
|
108
|
+
answers: number;
|
|
109
|
+
you: AppShare;
|
|
110
|
+
apps: AppShare[];
|
|
111
|
+
};
|
|
112
|
+
searchQueries(answers: ScoredAnswer[]): Array<{
|
|
113
|
+
query: string;
|
|
114
|
+
count: number;
|
|
115
|
+
models: Model[];
|
|
116
|
+
}>;
|
|
97
117
|
citedDomains(answers: ScoredAnswer[], ownDomains: string[]): Array<{
|
|
98
118
|
domain: string;
|
|
99
119
|
count: number;
|
package/dist/visibility-local.js
CHANGED
|
@@ -3,7 +3,7 @@ import { appendFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import YAML from "yaml";
|
|
5
5
|
import { indexedLocales, playLanguageFor } from "./storefronts.js";
|
|
6
|
-
import { languageFor, readVisibility, recordChanges, visibilityChanges, visibilityDir, visibilityPath, visibilityTarget } from "./visibility.js";
|
|
6
|
+
import { MAX_APPS, MAX_SEARCHES, MAX_SOURCES, languageFor, readVisibility, recordChanges, visibilityChanges, visibilityDir, visibilityPath, visibilityTarget } from "./visibility.js";
|
|
7
7
|
export const VISIBILITY_CORE_FILE = "./visibility-core.js";
|
|
8
8
|
export async function loadVisibilityCore(load = (s) => import(s)) {
|
|
9
9
|
try {
|
|
@@ -112,7 +112,7 @@ export async function scanLocal(core, project, plan, env, options = {}) {
|
|
|
112
112
|
}
|
|
113
113
|
if (status === "error")
|
|
114
114
|
failed.push({ model: job.model, error: answer.error ?? "no answer" });
|
|
115
|
-
const row = { ...job, status, mentions, citations: answer.citations };
|
|
115
|
+
const row = { ...job, status, mentions, citations: answer.citations, ...(answer.searches?.length ? { searches: answer.searches } : {}) };
|
|
116
116
|
scored.push(row);
|
|
117
117
|
raw.push({ ...row, text: answer.text, ...(answer.error ? { error: answer.error } : {}) });
|
|
118
118
|
done++;
|
|
@@ -122,6 +122,8 @@ export async function scanLocal(core, project, plan, env, options = {}) {
|
|
|
122
122
|
const labels = plan.intents.map((i) => i.label);
|
|
123
123
|
const scores = core.score(scored, labels, owner);
|
|
124
124
|
const sources = core.citedDomains(scored, ownDomains(project));
|
|
125
|
+
const all = core.overall(scored, owner);
|
|
126
|
+
const searches = core.searchQueries(scored);
|
|
125
127
|
const summary = { winning: 0, weak: 0, missing: 0, noData: 0 };
|
|
126
128
|
for (const s of scores) {
|
|
127
129
|
if (s.status === "no_data")
|
|
@@ -138,6 +140,25 @@ export async function scanLocal(core, project, plan, env, options = {}) {
|
|
|
138
140
|
store: target?.store ?? "app-store",
|
|
139
141
|
appId: target?.appId ?? project.spec.app.name,
|
|
140
142
|
summary,
|
|
143
|
+
...(all.answers
|
|
144
|
+
? {
|
|
145
|
+
overall: {
|
|
146
|
+
answers: all.answers,
|
|
147
|
+
visibility: Math.round(all.you.visibility),
|
|
148
|
+
shareOfVoice: Math.round(all.you.shareOfVoice),
|
|
149
|
+
winRate: Math.round(all.you.winRate),
|
|
150
|
+
...(all.you.position !== null ? { position: all.you.position } : {}),
|
|
151
|
+
...(all.apps.some((a) => a.you) ? { rank: all.apps.findIndex((a) => a.you) + 1 } : {}),
|
|
152
|
+
},
|
|
153
|
+
apps: all.apps.slice(0, MAX_APPS).map((a) => ({
|
|
154
|
+
name: a.name,
|
|
155
|
+
...(a.you ? { you: true } : {}),
|
|
156
|
+
visibility: Math.round(a.visibility),
|
|
157
|
+
shareOfVoice: Math.round(a.shareOfVoice),
|
|
158
|
+
...(a.position !== null ? { position: a.position } : {}),
|
|
159
|
+
})),
|
|
160
|
+
}
|
|
161
|
+
: {}),
|
|
141
162
|
intents: [...scores]
|
|
142
163
|
.sort((a, b) => order[a.status] - order[b.status] || (a.you ?? 0) - (b.you ?? 0))
|
|
143
164
|
.map((s) => {
|
|
@@ -150,7 +171,8 @@ export async function scanLocal(core, project, plan, env, options = {}) {
|
|
|
150
171
|
...(s.namedInstead.length ? { namedInstead: s.namedInstead.map((w) => `${w.name} (${Math.round(w.pct)}%)`) } : {}),
|
|
151
172
|
};
|
|
152
173
|
}),
|
|
153
|
-
sources: sources.slice(0,
|
|
174
|
+
sources: sources.slice(0, MAX_SOURCES).map((s) => ({ domain: s.domain, count: s.count, ...(s.yours ? { yours: true } : {}), url: s.url })),
|
|
175
|
+
...(searches.length ? { searches: searches.slice(0, MAX_SEARCHES).map((q) => ({ query: q.query, count: q.count })) } : {}),
|
|
154
176
|
fixes: [],
|
|
155
177
|
};
|
|
156
178
|
await mkdir(join(visibilityDir(project.root), "answers"), { recursive: true });
|
package/dist/visibility.d.ts
CHANGED
|
@@ -69,6 +69,32 @@ export interface VisibilityFile {
|
|
|
69
69
|
missing: number;
|
|
70
70
|
noData: number;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Across every answer of the last 30 days (of this scan with --local), 0–100: `visibility` is the share
|
|
74
|
+
* of answers that name the app, `shareOfVoice` its share of every app the answers name, `winRate` the
|
|
75
|
+
* share that put it first. `position` is its mean rank, `rank` its place among the apps named.
|
|
76
|
+
*/
|
|
77
|
+
overall?: {
|
|
78
|
+
answers: number;
|
|
79
|
+
visibility: number;
|
|
80
|
+
shareOfVoice: number;
|
|
81
|
+
winRate: number;
|
|
82
|
+
position?: number;
|
|
83
|
+
rank?: number;
|
|
84
|
+
previous?: {
|
|
85
|
+
visibility: number;
|
|
86
|
+
shareOfVoice: number;
|
|
87
|
+
winRate: number;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
/** The apps the assistants name most across every intent, the app itself included (`you: true`). */
|
|
91
|
+
apps?: Array<{
|
|
92
|
+
name: string;
|
|
93
|
+
you?: true;
|
|
94
|
+
visibility: number;
|
|
95
|
+
shareOfVoice: number;
|
|
96
|
+
position?: number;
|
|
97
|
+
}>;
|
|
72
98
|
intents: Array<{
|
|
73
99
|
label: string;
|
|
74
100
|
status: Opportunity["status"];
|
|
@@ -78,12 +104,23 @@ export interface VisibilityFile {
|
|
|
78
104
|
/** Who the assistants name instead. */
|
|
79
105
|
namedInstead?: string[];
|
|
80
106
|
}>;
|
|
81
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Pages the assistants cite, most cited first. From Appeeky: `type` is the kind of site, `names` the apps
|
|
109
|
+
* the answers citing it name, and `gap: true` a site they cite for other apps and never for this one.
|
|
110
|
+
*/
|
|
82
111
|
sources: Array<{
|
|
83
112
|
domain: string;
|
|
84
113
|
count: number;
|
|
85
114
|
yours?: true;
|
|
86
115
|
url: string;
|
|
116
|
+
type?: string;
|
|
117
|
+
gap?: true;
|
|
118
|
+
names?: string[];
|
|
119
|
+
}>;
|
|
120
|
+
/** What the assistants searched the web for before answering, most repeated first. */
|
|
121
|
+
searches?: Array<{
|
|
122
|
+
query: string;
|
|
123
|
+
count: number;
|
|
87
124
|
}>;
|
|
88
125
|
/** What Appeeky suggests changing, still open. */
|
|
89
126
|
fixes: Array<{
|
|
@@ -93,7 +130,12 @@ export interface VisibilityFile {
|
|
|
93
130
|
page?: string;
|
|
94
131
|
}>;
|
|
95
132
|
}
|
|
133
|
+
export declare const MAX_APPS = 8;
|
|
134
|
+
export declare const MAX_SOURCES = 15;
|
|
135
|
+
export declare const MAX_SEARCHES = 15;
|
|
96
136
|
export declare function fetchVisibility(api: AppeekyApi, target: VisibilityTarget, country: string, now?: Date): Promise<VisibilityFile>;
|
|
137
|
+
/** One line for the terminal: "named in 31% of 120 answers · 12% share of voice · first in 8%". */
|
|
138
|
+
export declare function overallLine(o: NonNullable<VisibilityFile["overall"]>): string;
|
|
97
139
|
export declare const visibilityPath: (root: string, country: string) => string;
|
|
98
140
|
export declare function readVisibility(root: string, country: string): Promise<VisibilityFile | null>;
|
|
99
141
|
/** What moved since the last pull: an intent the assistants started or stopped naming the app for. */
|
package/dist/visibility.js
CHANGED
|
@@ -40,16 +40,59 @@ export async function remotePrompts(api, appId, country, intentId) {
|
|
|
40
40
|
return (detail?.prompts ?? []).filter((p) => p.status !== "archived");
|
|
41
41
|
}
|
|
42
42
|
const pct = (n) => (n === null || n === undefined ? undefined : Math.round(n));
|
|
43
|
+
const round1 = (n) => (n === null || n === undefined ? undefined : Math.round(n * 10) / 10);
|
|
44
|
+
export const MAX_APPS = 8;
|
|
45
|
+
export const MAX_SOURCES = 15;
|
|
46
|
+
export const MAX_SEARCHES = 15;
|
|
43
47
|
export async function fetchVisibility(api, target, country, now = new Date()) {
|
|
44
48
|
const opp = await api.get(path(target.appId, "/opportunities"), { country, days: "30" });
|
|
45
49
|
const fixes = await api.get(path(target.appId, "/fixes"), { country }).catch(() => null);
|
|
50
|
+
const window = { country, days: "30" };
|
|
51
|
+
const [analytics, cited, searched] = await Promise.all([
|
|
52
|
+
api.get(path(target.appId, "/analytics"), window).catch(() => null),
|
|
53
|
+
api.get(path(target.appId, "/sources"), window).catch(() => null),
|
|
54
|
+
api.get(path(target.appId, "/searches"), window).catch(() => null),
|
|
55
|
+
]);
|
|
56
|
+
const overall = analytics?.totals?.answers
|
|
57
|
+
? strip({
|
|
58
|
+
answers: analytics.totals.answers,
|
|
59
|
+
visibility: pct(analytics.owner.visibilityPct),
|
|
60
|
+
shareOfVoice: pct(analytics.owner.sovPct),
|
|
61
|
+
winRate: pct(analytics.owner.winRatePct),
|
|
62
|
+
position: round1(analytics.owner.positionAvg),
|
|
63
|
+
rank: analytics.owner.rank ?? undefined,
|
|
64
|
+
previous: analytics.owner.previous
|
|
65
|
+
? { visibility: pct(analytics.owner.previous.visibilityPct), shareOfVoice: pct(analytics.owner.previous.sovPct), winRate: pct(analytics.owner.previous.winRatePct) }
|
|
66
|
+
: undefined,
|
|
67
|
+
})
|
|
68
|
+
: undefined;
|
|
69
|
+
const apps = overall
|
|
70
|
+
? (analytics.brands ?? []).slice(0, MAX_APPS).map((b) => strip({ name: b.name, you: b.isOwnerApp ? true : undefined, visibility: pct(b.visibilityPct), shareOfVoice: pct(b.sovPct), position: round1(b.positionAvg) }))
|
|
71
|
+
: undefined;
|
|
72
|
+
const domains = cited?.domains?.length
|
|
73
|
+
? [...cited.domains]
|
|
74
|
+
.sort((a, b) => b.citations - a.citations)
|
|
75
|
+
.slice(0, MAX_SOURCES)
|
|
76
|
+
.map((d) => strip({
|
|
77
|
+
domain: d.domain,
|
|
78
|
+
count: d.citations,
|
|
79
|
+
yours: d.type === "owner" ? true : undefined,
|
|
80
|
+
url: d.topUrls?.[0]?.url ?? `https://${d.domain}`,
|
|
81
|
+
type: d.type,
|
|
82
|
+
gap: d.isGap ? true : undefined,
|
|
83
|
+
names: d.apps?.length ? d.apps.slice(0, 5) : undefined,
|
|
84
|
+
}))
|
|
85
|
+
: undefined;
|
|
86
|
+
const searches = searched?.queries?.length ? searched.queries.slice(0, MAX_SEARCHES).map((q) => ({ query: q.query, count: q.occurrences })) : undefined;
|
|
46
87
|
const labels = new Map((opp?.intents ?? []).map((i) => [i.intentId, i.label]));
|
|
47
|
-
return {
|
|
88
|
+
return strip({
|
|
48
89
|
pulledAt: now.toISOString().slice(0, 10),
|
|
49
90
|
country,
|
|
50
91
|
store: target.store,
|
|
51
92
|
appId: target.appId,
|
|
52
93
|
summary: opp?.summary ?? { winning: 0, weak: 0, missing: 0, noData: 0 },
|
|
94
|
+
overall,
|
|
95
|
+
apps,
|
|
53
96
|
intents: (opp?.intents ?? []).map((i) => {
|
|
54
97
|
const byModel = Object.fromEntries(Object.entries(i.byModel).map(([m, s]) => [m, pct(s?.visibilityPct)]));
|
|
55
98
|
return strip({
|
|
@@ -60,11 +103,17 @@ export async function fetchVisibility(api, target, country, now = new Date()) {
|
|
|
60
103
|
namedInstead: i.winners.length ? i.winners.slice(0, 5).map((w) => `${w.name} (${Math.round(w.sharePct)}%)`) : undefined,
|
|
61
104
|
});
|
|
62
105
|
}),
|
|
63
|
-
sources: (opp?.sources.sources ?? []).slice(0,
|
|
106
|
+
sources: domains ?? (opp?.sources.sources ?? []).slice(0, MAX_SOURCES).map((s) => strip({ domain: s.domain, count: s.count, yours: s.citesOwner ? true : undefined, url: s.url })),
|
|
107
|
+
searches,
|
|
64
108
|
fixes: (fixes?.fixes ?? [])
|
|
65
109
|
.filter((f) => f.status === "open")
|
|
66
110
|
.map((f) => strip({ intent: labels.get(f.intentId) ?? f.intentId, title: f.title, why: f.rationale, page: f.targetUrl ?? undefined })),
|
|
67
|
-
};
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** One line for the terminal: "named in 31% of 120 answers · 12% share of voice · first in 8%". */
|
|
114
|
+
export function overallLine(o) {
|
|
115
|
+
const was = o.previous ? ` (was ${o.previous.visibility}%)` : "";
|
|
116
|
+
return `named in ${o.visibility}% of ${o.answers} answers${was} · ${o.shareOfVoice}% share of voice · first in ${o.winRate}%${o.rank ? ` · #${o.rank} among the apps named` : ""}`;
|
|
68
117
|
}
|
|
69
118
|
const strip = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== undefined));
|
|
70
119
|
export const visibilityPath = (root, country) => join(visibilityDir(root), `${country}.yaml`);
|
|
@@ -89,6 +138,13 @@ export function visibilityChanges(prev, next) {
|
|
|
89
138
|
out.push("the assistants now cite your own site");
|
|
90
139
|
if (cited(prev) && !cited(next))
|
|
91
140
|
out.push("the assistants stopped citing your own site");
|
|
141
|
+
// A site only counts as a new gap when the last pull already knew about gaps.
|
|
142
|
+
if (prev.sources.some((s) => s.type)) {
|
|
143
|
+
const had = new Set(prev.sources.filter((s) => s.gap).map((s) => s.domain));
|
|
144
|
+
const gaps = next.sources.filter((s) => s.gap && !had.has(s.domain)).map((s) => s.domain);
|
|
145
|
+
if (gaps.length)
|
|
146
|
+
out.push(`cited for other apps and not for yours: ${gaps.slice(0, 5).join(", ")}`);
|
|
147
|
+
}
|
|
92
148
|
return out;
|
|
93
149
|
}
|
|
94
150
|
export async function recordChanges(root, date, country, changes) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appeeky/spec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Your app's store listing as a spec: lint it, check keyword coverage, diff it against the live store and push it to App Store Connect and Google Play.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,6 +23,7 @@ The app's store listings live in files, and every push is recorded and measured.
|
|
|
23
23
|
| `appeeky/visibility/<country>.yaml` | whether ChatGPT, Claude, Gemini and Perplexity name the app per intent, who they name instead, the pages they cite, suggested fixes; `changes.md` beside it (`history.csv` and `answers/` with `--local` scans) |
|
|
24
24
|
| `appeeky/seo/` | Google Search Console for the app's website: `daily.csv`, `queries.csv`, `pages.csv`, `summary.md` (`seo pull`) |
|
|
25
25
|
| `appeeky/category.csv` | rank in the category chart (top 100), one row a day |
|
|
26
|
+
| `appeeky/alerts.json` | written by `alerts --record`: the alerts already reported (run `alerts --json` for what needs attention now) |
|
|
26
27
|
| `.appeeky/data/*.csv` (or `appeeky/data/`) | analytics, Search Ads, RevenueCat, Meta and TikTok per day; `README.md` says what each file holds |
|
|
27
28
|
|
|
28
29
|
Run commands as `npx @appeeky/spec <command> --json` (or `appeeky-spec` when installed). Add `-C <dir>` when the spec is not in the current folder.
|
|
@@ -98,7 +99,7 @@ For "what should we do this week" or a scheduled run, follow appeeky-spec-cofoun
|
|
|
98
99
|
| Pricing and other experiments | appeeky-spec-experiments |
|
|
99
100
|
| AI assistants and the category chart | appeeky-spec-visibility |
|
|
100
101
|
| The app's website in Google | appeeky-spec-seo |
|
|
101
|
-
| GitHub Actions, other CI, cron | appeeky-spec-automation |
|
|
102
|
+
| GitHub Actions, other CI, cron, alerts (the issue, the webhook) | appeeky-spec-automation |
|
|
102
103
|
| A VM or container host | appeeky-spec-server |
|
|
103
104
|
|
|
104
105
|
Docs: https://docs.appeeky.com/docs/spec
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: appeeky-spec-automation
|
|
3
|
-
description: Run Appeeky Spec unattended and fix it when a run fails. Covers `init --ci` and its three GitHub workflows (pull request check, push on merge, daily refresh), the repository secrets they need, the pull request report, cron or other CI, and scheduling the weekly co-founder review. Use when asked to set up CI or GitHub Actions for the listing, "push on merge", a daily job, run Spec with cron, GitLab or other CI, schedule the weekly review, which secrets to add, or why a listing workflow, push or daily run failed. For the review itself use appeeky-spec-cofounder; for a VM, Docker or Railway, Fly and Render use appeeky-spec-server; for first-time spec setup use appeeky-spec.
|
|
3
|
+
description: Run Appeeky Spec unattended and fix it when a run fails. Covers `init --ci` and its three GitHub workflows (pull request check, push on merge, daily refresh), the repository secrets they need, the pull request report, the daily alerts (one GitHub issue, a Slack webhook), cron or other CI, and scheduling the weekly co-founder review. Use when asked to set up CI or GitHub Actions for the listing, "push on merge", a daily job, alerts or a notification when ranks, ratings or the category drop, run Spec with cron, GitLab or other CI, schedule the weekly review, which secrets to add, or why a listing workflow, push or daily run failed. For the review itself use appeeky-spec-cofounder; for a VM, Docker or Railway, Fly and Render use appeeky-spec-server; for first-time spec setup use appeeky-spec.
|
|
4
4
|
metadata:
|
|
5
5
|
version: 1.0.0
|
|
6
6
|
---
|
|
@@ -28,7 +28,7 @@ Run commands as `npx @appeeky/spec <command>`. Start every setup or diagnosis wi
|
|
|
28
28
|
| --- | --- | --- |
|
|
29
29
|
| `listing-check.yml` | `pull_request` | the `appeeky/spec@v0` action: `report --base origin/<base>`, comments it, fails on check errors |
|
|
30
30
|
| `listing-push.yml` | push to `main` touching `appeeky/store/**`, `appeeky.spec.yaml`, `appeeky/reviews/replies/**`, `appeeky/social/drafts/**`, `appeeky/ugc/briefs/**` | `push --yes --note "<merge commit message>"`, `reviews push --yes`, `social push --yes`, `ugc generate --yes` (`--local` with `FAL_KEY`), then commits the release and sent markers |
|
|
31
|
-
| `listing-daily.yml` | `0 6 * * *` UTC and manual | `category pull`, `visibility pull`, `verify --playbook`, `reviews pull`, `competitors pull`, `social pull`, `ugc pull`; with keys also `seo pull`, `search-ads pull`, `seo ranks --every`, `visibility scan --local --every`; then commits |
|
|
31
|
+
| `listing-daily.yml` | `0 6 * * *` UTC and manual | `category pull`, `visibility pull`, `verify --playbook`, `reviews pull`, `competitors pull`, `social pull`, `ugc pull`; with keys also `seo pull`, `search-ads pull`, `seo ranks --every`, `visibility scan --local --every`; then `alerts --record`, commits, and keeps the alert issue (`issues: write`) |
|
|
32
32
|
|
|
33
33
|
2. Secrets: tell the user which to add under Settings → Secrets and variables → Actions. Never ask them to paste one into chat, and never write one into a file.
|
|
34
34
|
|
|
@@ -50,7 +50,19 @@ The push workflow reads `APPEEKY_API_KEY`, or your own store keys from secrets o
|
|
|
50
50
|
|
|
51
51
|
`listing-check.yml` (or any workflow using `appeeky/spec@v0` after `actions/checkout@v4` with `fetch-depth: 0`) posts one comment, edited on each run: listing changes, check results, coverage before → after, and the replies, posts and clips the merge sends out. Action inputs: `working-directory` (folder with the spec), `base`, `comment` (`"false"` to skip), `version`, `github-token`. The same Markdown locally: `report --base main` (`-o <file>` to save it). It needs `pull-requests: write`.
|
|
52
52
|
|
|
53
|
-
## 3.
|
|
53
|
+
## 3. Alerts
|
|
54
|
+
|
|
55
|
+
`alerts` turns the files the daily run wrote into what needs a person: `rank-drop` (from the ranks in `appeeky/releases/`), `release-lost`, `category-drop`, `low-ratings`, `competitor-change` (on targets only), `visibility-drop`, `search-drop` (`appeeky/seo/daily.csv`) and `late-check`. Each has `severity` (`warn`/`critical`), `numbers`, `window`, `source` and `next`. It makes no network call except the delivery flags.
|
|
56
|
+
|
|
57
|
+
- Read them: `alerts --json` (`--new` for the ones not reported yet). `--markdown -o <file>` writes an issue body; the file is empty when nothing is open.
|
|
58
|
+
- Dedupe: `--record` writes `appeeky/alerts.json`; the daily run commits it, so an alert is new once, again when it turns critical, and again only after it cleared and came back. Never hand-edit it; delete it to report everything again.
|
|
59
|
+
- Thresholds: `alerts:` in `appeeky.spec.yaml` (`rank-drop.places`, `category-drop.places`/`days`, `low-ratings.days`/`min`/`ratio`, `search-drop.days`/`drop`/`min`, `competitor-change.days`, `visibility-drop.days`, `release-lost.days`, `late-check.days`), `off: [<kind>]` to turn kinds off. Too noisy: raise a threshold or turn the kind off in a pull request, not by deleting the state file.
|
|
60
|
+
- GitHub: `listing-daily.yml` runs `alerts --new -o .appeeky/alerts-new.md` and `alerts --record -o .appeeky/alerts.md`, then with `gh` keeps one open issue labelled `appeeky-spec-alert` (body: every open alert; a comment with the new ones; closed when the file is empty). A `listing-daily.yml` from an older version has neither the steps nor `issues: write`: delete it and run `init --ci` again (doctor's `alerts` line says so).
|
|
61
|
+
- Docker `daily`: `alerts --record`, plus `--webhook` when `ALERT_WEBHOOK_URL` is set (Slack-compatible `{"text"}`, new alerts only) and `--issue` when `GITHUB_TOKEN` is set (same issue through the GitHub API; needs Issues: Read and write; `ALERT_ISSUE=0` skips it). A failed post is not recorded and is retried the next day. `! GitHub answered 403 … Issues: Read and write` in the log: add that permission to the token or set `ALERT_ISSUE=0`.
|
|
62
|
+
- Other CI or cron: `alerts --record --webhook` (and `--issue` with `GITHUB_TOKEN`) after the daily commands, then commit `appeeky/alerts.json`.
|
|
63
|
+
- The weekly agent may run `alerts --json` but never `--webhook` or `--issue`; the routines deny them.
|
|
64
|
+
|
|
65
|
+
## 4. The weekly co-founder review
|
|
54
66
|
|
|
55
67
|
1. `npx @appeeky/spec agents install` (`--for opencode` or `all`) writes `.claude/agents/appeeky-*.md` and `.claude/commands/appeeky-cofounder.md`; commit them. Or copy `github.com/appeeky/spec/examples/weekly/propose.md` to `.github/appeeky-propose.md` to keep an own version; the routines prefer it.
|
|
56
68
|
2. Pick the runner:
|
|
@@ -60,11 +72,11 @@ The push workflow reads `APPEEKY_API_KEY`, or your own store keys from secrets o
|
|
|
60
72
|
3. Agent credentials, one of: `CLAUDE_CODE_OAUTH_TOKEN` (the user runs `claude setup-token` once; billed to their Claude Pro or Max plan) or `ANTHROPIC_API_KEY` (per use). Optional: `PROPOSAL_TOKEN` (a fine-grained or GitHub App token with contents and pull requests write), because a PR opened with the default `GITHUB_TOKEN` does not trigger `listing-check.yml`; `ATTRIBUTION_TOKEN` for a self-hosted attribution server.
|
|
61
73
|
4. Each routine refreshes `data`, `reviews`, `competitors`, `social`, `ugc`, reads `status --json` for the free stores, runs the review with an allow-list (`appeeky-spec *`, `git log`, `git tag`, file tools) and a deny-list (`push`, `revert`, `reviews push`, `social push|reply|hide|like|delete-comment`, `ugc generate --yes`, paid `--yes` scans), then opens `listing/weekly-<date>` with `.appeeky/proposal.md` as the body. Never loosen those lists.
|
|
62
74
|
|
|
63
|
-
##
|
|
75
|
+
## 5. On a server
|
|
64
76
|
|
|
65
77
|
The same routines run from the Docker image on a VM or container host (daily, push, weekly, schedule; `.env`, `PUSH_DRY_RUN`, `HEALTHCHECK_URL`). Setting it up, operating it and its failures: see appeeky-spec-server. The failure messages below are the same there.
|
|
66
78
|
|
|
67
|
-
##
|
|
79
|
+
## 6. Diagnose a failed run
|
|
68
80
|
|
|
69
81
|
1. Read the log: `gh run view <id> --log-failed`, `docker compose logs`, or `.appeeky/weekly.log`. Run `doctor --json` with the same env.
|
|
70
82
|
2. Match the message:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: appeeky-spec-cofounder
|
|
3
|
-
description: Run the weekly growth review (the co-founder review) in an Appeeky Spec repo as one agent, without subagents, in Codex, Cursor, Gemini CLI, opencode or Claude Code. It checks which stores are free to change, refreshes reviews, competitors, data, social and UGC, works through the ASO, reviews, ads, releases, UGC and social checklists, picks at most one listing change, writes the brief to appeeky/briefs/, drafts posts and a UGC brief, and prepares the pull request. Use when asked "what should we do this week?", for the weekly growth or ASO review, the co-founder review, /appeeky-cofounder, a growth brief, or "propose this week's listing change". To schedule it, see appeeky-spec-automation; to judge one past release, see appeeky-spec-review; for a single listing edit, use appeeky-spec.
|
|
3
|
+
description: Run the weekly growth review (the co-founder review) in an Appeeky Spec repo as one agent, without subagents, in Codex, Cursor, Gemini CLI, opencode or Claude Code. It reads the open alerts first, checks which stores are free to change, refreshes reviews, competitors, data, social and UGC, works through the ASO, reviews, ads, releases, UGC and social checklists, picks at most one listing change, writes the brief to appeeky/briefs/, drafts posts and a UGC brief, and prepares the pull request. Use when asked "what should we do this week?", for the weekly growth or ASO review, the co-founder review, /appeeky-cofounder, a growth brief, or "propose this week's listing change". To schedule it, see appeeky-spec-automation; to judge one past release, see appeeky-spec-review; for a single listing edit, use appeeky-spec.
|
|
4
4
|
metadata:
|
|
5
5
|
version: 1.0.0
|
|
6
6
|
---
|
|
@@ -15,9 +15,10 @@ If the run starts with "Today is <date>. Stores free to change: …", a schedule
|
|
|
15
15
|
|
|
16
16
|
## 1. Where things stand
|
|
17
17
|
|
|
18
|
-
1. `
|
|
19
|
-
2.
|
|
20
|
-
3. `
|
|
18
|
+
1. `alerts --json` → `{ alerts }`: what needs attention now (rank, category, rating, Search Console and AI visibility drops, lost releases, competitor moves on targets, late checks), each with numbers, source file and next step. Read them first; every critical one goes into the brief under Where we stand, with its next step. Never run it with `--webhook`, `--issue` or `--record`; the daily run delivers them.
|
|
19
|
+
2. `status --json` → `{ loops, free }`. Only stores in `free` may get a listing change; the others have a release still being measured. It also rewrites `appeeky/loops.md`.
|
|
20
|
+
3. Read `appeeky/loops.md` (warnings name competitor moves inside a release's window), `appeeky/playbook.md` (what won and lost) and the newest file in `appeeky/briefs/`, if any.
|
|
21
|
+
4. `log --json` for recent releases and their notes.
|
|
21
22
|
|
|
22
23
|
## 2. Refresh what you read
|
|
23
24
|
|
|
@@ -65,6 +66,7 @@ Pick exactly one listing change for a store in `free`, the one with the stronges
|
|
|
65
66
|
```markdown
|
|
66
67
|
# Growth brief 2026-11-16
|
|
67
68
|
## Where we stand
|
|
69
|
+
<open alerts (critical first) and what each needs; what is being measured and when it is checked>
|
|
68
70
|
## What the specialists found
|
|
69
71
|
### ASO / Reviews / Ads / Releases / UGC / Social (a few lines each, with numbers and files)
|
|
70
72
|
## The change
|
|
@@ -108,7 +110,7 @@ After the merge, the push workflow (or the docker push routine) runs `push`, `re
|
|
|
108
110
|
|
|
109
111
|
## Never run
|
|
110
112
|
|
|
111
|
-
`push`, `revert`, `pull`, `reviews push`, `social push`, `social reply`, `social hide`, `social like`, `social delete-comment`, `ugc generate` without `--dry-run`, `visibility scan --local --yes`, `seo ranks|keywords|domain … --yes`, `experiment add` or `experiment close`. Never put keys or tokens in any file.
|
|
113
|
+
`push`, `revert`, `pull`, `reviews push`, `social push`, `social reply`, `social hide`, `social like`, `social delete-comment`, `ugc generate` without `--dry-run`, `visibility scan --local --yes`, `seo ranks|keywords|domain … --yes`, `alerts --webhook|--issue|--record`, `experiment add` or `experiment close`. Never put keys or tokens in any file.
|
|
112
114
|
|
|
113
115
|
## Mistakes to avoid
|
|
114
116
|
|
|
@@ -72,6 +72,7 @@ grep -oE '^[A-Z_]+=.' .env | cut -d= -f1 # names that have a value
|
|
|
72
72
|
| `DAILY_AT` (`0 6 * * *`), `PUSH_EVERY` (`*/15 * * * *`, `off` to push by hand), `WEEKLY_AT` (off, e.g. `0 7 * * 1`) | cron times, UTC |
|
|
73
73
|
| `PUSH_DRY_RUN=1` | `push` only shows what it would change, sends nothing |
|
|
74
74
|
| `HEALTHCHECK_URL` | e.g. a healthchecks.io ping URL; `daily` pings it on success, `<url>/fail` on failure |
|
|
75
|
+
| `ALERT_WEBHOOK_URL` | a Slack (or Slack-compatible) incoming webhook; `daily` posts new alerts to it once each. With `GITHUB_TOKEN` it also keeps one issue labelled `appeeky-spec-alert` (needs Issues: Read and write; `ALERT_ISSUE=0` turns that off) |
|
|
75
76
|
| `CLAUDE_CODE_OAUTH_TOKEN` or `ANTHROPIC_API_KEY` | `weekly` only: the person runs `claude setup-token` on their computer (Claude Pro/Max plan), or an API key billed per use |
|
|
76
77
|
| `APPEEKY_SPEC_IMAGE` | read by compose: `ghcr.io/appeeky/appeeky-spec:latest-agent` for `weekly`, or a pinned tag |
|
|
77
78
|
| `FAL_KEY` | render UGC clips on their own fal account instead of Appeeky credits |
|