@bataitools/agent-cli 0.1.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.
Binary file
@@ -0,0 +1,18 @@
1
+ {
2
+ "website": "https://example.com",
3
+ "logo": "https://example.com/logo.png",
4
+ "developerType": "team",
5
+ "developerCountry": "US",
6
+ "developerProvince": "CA",
7
+ "categorys": ["productivity"],
8
+ "tags": ["ai-writing"],
9
+ "audiences": ["developers"],
10
+ "links": {
11
+ "pricingUrl": "https://example.com/pricing"
12
+ },
13
+ "social": {
14
+ "email": "hello@example.com",
15
+ "github": "https://github.com/example"
16
+ },
17
+ "productMedia": []
18
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "Example Tool",
3
+ "tagline": "The best example tool for developers building AI apps",
4
+ "description": "Example Tool helps developers ship faster with a complete toolkit for building, testing, and deploying AI-powered applications at scale.",
5
+ "instruction": "Sign up, connect your API key, and start building in minutes.",
6
+ "developerName": "Example Inc",
7
+ "coreFeatures": [
8
+ { "title": "Fast setup", "description": "Get started in under five minutes with guided onboarding." },
9
+ { "title": "Multi-model", "description": "Switch between leading LLM providers from one dashboard." },
10
+ { "title": "Team collab", "description": "Share prompts and workflows across your organization." }
11
+ ],
12
+ "useCases": ["Prototype AI features", "Internal knowledge bots", "Customer support automation"],
13
+ "pricing": [
14
+ {
15
+ "chargeType": "free",
16
+ "price": "0",
17
+ "features": ["Up to 1000 requests/month", "Community support"]
18
+ }
19
+ ],
20
+ "faqs": [
21
+ { "question": "Is there a free plan?", "answer": "Yes, the free tier includes 1000 requests per month." },
22
+ { "question": "Which models are supported?", "answer": "We support all major commercial and open models." },
23
+ { "question": "Can I self-host?", "answer": "Enterprise plans include self-hosted deployment options." }
24
+ ],
25
+ "seo": {
26
+ "title": "Example Tool — AI Developer Toolkit",
27
+ "description": "Build and ship AI apps faster with Example Tool."
28
+ }
29
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "website": "https://example.com",
3
+ "logo": "https://example.com/logo.png",
4
+ "websiteScreenshot": "https://example.com/og.png",
5
+ "developerType": "team",
6
+ "developerCountry": "US",
7
+ "developerProvince": "CA",
8
+ "categorys": ["productivity"],
9
+ "tags": ["ai-writing"],
10
+ "audiences": ["developers"],
11
+ "links": {
12
+ "pricingUrl": "https://example.com/pricing"
13
+ },
14
+ "social": {
15
+ "email": "hello@example.com",
16
+ "github": "https://github.com/example"
17
+ },
18
+ "productMedia": [
19
+ {
20
+ "type": "youtube",
21
+ "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
22
+ }
23
+ ],
24
+ "i18n": {
25
+ "en": {
26
+ "name": "Example Tool",
27
+ "tagline": "The best example tool for developers building AI apps",
28
+ "description": "Example Tool helps developers ship faster with a complete toolkit for building, testing, and deploying AI-powered applications at scale.",
29
+ "instruction": "Sign up, connect your API key, and start building in minutes.",
30
+ "developerName": "Example Inc",
31
+ "coreFeatures": [
32
+ { "title": "Fast setup", "description": "Get started in under five minutes with guided onboarding." },
33
+ { "title": "Multi-model", "description": "Switch between leading LLM providers from one dashboard." },
34
+ { "title": "Team collab", "description": "Share prompts and workflows across your organization." }
35
+ ],
36
+ "useCases": ["Prototype AI features", "Internal knowledge bots", "Customer support automation"],
37
+ "pricing": [
38
+ {
39
+ "chargeType": "free",
40
+ "price": "0",
41
+ "features": ["Up to 1000 requests/month", "Community support"]
42
+ }
43
+ ],
44
+ "faqs": [
45
+ { "question": "Is there a free plan?", "answer": "Yes, the free tier includes 1000 requests per month." },
46
+ { "question": "Which models are supported?", "answer": "We support all major commercial and open models." },
47
+ { "question": "Can I self-host?", "answer": "Enterprise plans include self-hosted deployment options." }
48
+ ],
49
+ "seo": {
50
+ "title": "Example Tool — AI Developer Toolkit",
51
+ "description": "Build and ship AI apps faster with Example Tool."
52
+ }
53
+ }
54
+ }
55
+ }
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@bataitools/agent-cli",
3
+ "version": "0.1.0",
4
+ "description": "BAT AI Tools — Agent/Skill CLI for multi-language product submission",
5
+ "bin": {
6
+ "bat-agent": "./dist/cli.js"
7
+ },
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "files": [
11
+ "dist",
12
+ "skills",
13
+ "prompts",
14
+ "examples"
15
+ ],
16
+ "scripts": {
17
+ "build": "bun build ./src/cli.ts --outdir ./dist --target node",
18
+ "dev": "bun run src/cli.ts",
19
+ "typecheck": "tsc --noEmit"
20
+ },
21
+ "dependencies": {
22
+ "@bat/shared": "workspace:*",
23
+ "playwright": "^1.49.1"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^22.10.0",
27
+ "bun-types": "^1.3.14",
28
+ "typescript": "^5.7.2"
29
+ }
30
+ }
@@ -0,0 +1,48 @@
1
+ # Phase 1 — Generate English only
2
+
3
+ **Do NOT generate all languages in one step.** Only produce `base.json` + `i18n/en.json`.
4
+
5
+ ## Output files
6
+
7
+ ### `base.json` (shared, language-neutral)
8
+
9
+ ```json
10
+ {
11
+ "website": "https://example.com",
12
+ "logo": "https://example.com/logo.png",
13
+ "websiteScreenshot": "https://static.../screenshot/.../en/....png",
14
+ "screenshots": { "en": "https://static.../en/....png" },
15
+ "developerType": "team",
16
+ "developerCountry": "US",
17
+ "developerProvince": "CA",
18
+ "categorys": ["productivity"],
19
+ "tags": ["ai-writing"],
20
+ "audiences": ["developers"],
21
+ "links": { "pricingUrl": "https://example.com/pricing" },
22
+ "social": { "email": "hello@example.com" },
23
+ "productMedia": [{ "type": "youtube", "url": "https://www.youtube.com/watch?v=..." }]
24
+ }
25
+ ```
26
+
27
+ ### `i18n/en.json` (English text only)
28
+
29
+ ```json
30
+ {
31
+ "name": "...",
32
+ "tagline": "...",
33
+ "description": "...",
34
+ "instruction": "...",
35
+ "developerName": "...",
36
+ "coreFeatures": [{ "title": "...", "description": "..." }],
37
+ "useCases": ["...", "...", "..."],
38
+ "pricing": [{ "chargeType": "free", "price": "0", "features": ["..."] }],
39
+ "faqs": [{ "question": "...", "answer": "..." }],
40
+ "seo": { "title": "...", "description": "..." }
41
+ }
42
+ ```
43
+
44
+ ## Rules
45
+
46
+ - Fetch taxonomy from `bat-agent schema en` — never invent category/tag/audience codes
47
+ - Run `bat-agent capture-screenshot --website <url> --lang en --merge base.json` if no og:image
48
+ - Validate English content meets minimum lengths before Phase 2
@@ -0,0 +1,50 @@
1
+ # Phase 2 — Translate from English
2
+
3
+ Read **only** `i18n/en.json`. Translate text fields into other languages. Write **one file per language** under `i18n/`.
4
+
5
+ ## Target languages — all required (16 total)
6
+
7
+ `en` plus: `zh, es, ja, de, fr, pt, ko, tw, it, ru, ar, nl, tr, vi, id`
8
+
9
+ **Every language above must be present** before `bat-agent validate` / `submit` will pass.
10
+
11
+ ## Recommended batching (stability)
12
+
13
+ Translate in batches of **3–4 languages per LLM call**, not all 15 at once:
14
+
15
+ 1. Batch A: `zh`, `tw`, `ja`, `ko`
16
+ 2. Batch B: `de`, `fr`, `it`, `nl`
17
+ 3. Batch C: `es`, `pt`, `ru`, `tr`
18
+ 4. Batch D: `ar`, `vi`, `id`
19
+
20
+ Each batch output: separate files `i18n/zh.json`, `i18n/ja.json`, etc.
21
+
22
+ ## What to translate
23
+
24
+ Translate all string text in:
25
+
26
+ - `name`, `tagline`, `description`, `instruction`, `developerName`
27
+ - `coreFeatures[].title`, `coreFeatures[].description`
28
+ - `useCases[]` (if string items)
29
+ - `pricing[].features[]`, pricing labels if present
30
+ - `faqs[].question`, `faqs[].answer`
31
+ - `seo.title`, `seo.description`
32
+
33
+ ## What NOT to translate or change
34
+
35
+ - JSON keys
36
+ - Array lengths (must match `en.json` exactly)
37
+ - URLs, emails, product names that are proper nouns (keep brand name consistent)
38
+ - `chargeType` enum values in pricing
39
+
40
+ ## Per-file output shape
41
+
42
+ Each `i18n/<lang>.json` has the **same structure** as `i18n/en.json`, only with translated text.
43
+
44
+ ## After all languages
45
+
46
+ ```bash
47
+ bat-agent pack ./submit -o submit.bundle.json
48
+ bat-agent validate -f submit.bundle.json
49
+ bat-agent submit -f submit.bundle.json
50
+ ```
@@ -0,0 +1,7 @@
1
+ # Deprecated — use two-phase prompts
2
+
3
+ Do **not** generate all languages in one file.
4
+
5
+ 1. **Phase 1:** `01-generate-en.md` → `base.json` + `i18n/en.json`
6
+ 2. **Phase 2:** `02-translate-i18n.md` → `i18n/<lang>.json` (batched translation)
7
+ 3. **Phase 3:** `bat-agent pack ./submit -o submit.bundle.json`
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: bat-submit
3
+ description: Submit an AI tool to BAT AI Tools (bataitools.com) via bat-agent CLI. Use a 3-phase workflow — English first, then translate, then pack and submit.
4
+ ---
5
+
6
+ # BAT AI Tools — Agent Submit Skill
7
+
8
+ ## Prerequisites
9
+
10
+ 1. 用户在 https://bataitools.com/submit 登录后生成 API Key(`bat_…`),执行 `bat-agent login <api-key>` — API 默认 `https://api.bataitools.com`
11
+ 2. 仅本地开发时:`BAT_API_URL=https://api-dev.bataitools.com` 或 `bat-agent login <api-key> --api https://api-dev.bataitools.com`
12
+ 3. `bat-agent` CLI from the `bat-agent` package
13
+
14
+
15
+ ## Critical: do NOT generate all languages in one JSON
16
+
17
+ Large single-file JSON causes truncation and validation failures. Always use **3 phases**:
18
+
19
+ | Phase | What | Output |
20
+ |-------|------|--------|
21
+ | **1. English** | Read website, taxonomy, screenshot | `base.json` + `i18n/en.json` |
22
+ | **2. Translate** | Translate from `i18n/en.json` only | `i18n/zh.json`, `i18n/ja.json`, … |
23
+ | **3. Submit** | Merge and POST once | `bat-agent pack` → `submit` → `publish` |
24
+
25
+ Start with: `bat-agent init ./submit`
26
+
27
+ ---
28
+
29
+ ## Phase 1 — English only
30
+
31
+ 1. `bat-agent schema en`
32
+ 2. `bat-agent capture-screenshot --website <url> --lang en --merge ./submit/base.json`
33
+ 3. Read the user's website; write **only**:
34
+ - `submit/base.json` — shared fields (website, categorys, tags, screenshots, productMedia, …)
35
+ - `submit/i18n/en.json` — English text fields only
36
+
37
+ See `prompts/01-generate-en.md`. **Stop after en.** Do not write other language files yet.
38
+
39
+ ---
40
+
41
+ ## Phase 2 — Translate from English
42
+
43
+ 1. Read `submit/i18n/en.json` as the **sole source**
44
+ 2. Translate text fields into other languages
45
+ 3. Write **one file per language**: `submit/i18n/zh.json`, `submit/i18n/ja.json`, …
46
+ 4. Translate in **batches of 3–4 languages** per LLM call (not all 15 at once)
47
+
48
+ **All 16 languages are required** (en + 15). When BAT adds more site languages, requirements grow automatically — same LLM workflow, more global SEO for the listing owner.
49
+
50
+ - Keep array lengths identical to `en.json`
51
+ - Do not translate category/tag/audience slugs (they live in `base.json`)
52
+ - Do not translate URLs, emails, or `chargeType` values
53
+
54
+ See `prompts/02-translate-i18n.md`.
55
+
56
+ ---
57
+
58
+ ## Phase 3 — Pack and submit
59
+
60
+ `bat-agent submit` **auto-detects** new vs update by `website` in the bundle:
61
+ - not listed → `SUBMIT_AGENT` (new)
62
+ - already listed → `UPDATE_AGENT` (update)
63
+
64
+ Same commands for both:
65
+
66
+ ```bash
67
+ bat-agent pack ./submit -o submit.bundle.json
68
+ bat-agent validate -f submit.bundle.json
69
+ bat-agent submit -f submit.bundle.json
70
+ # after user confirms:
71
+ bat-agent publish --id <submitId>
72
+ bat-agent status --id <submitId>
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Screenshot rules
78
+
79
+ - **en required** — use `capture-screenshot` merged into `base.json`
80
+ - Other langs: optional `--merge base.json --lang zh`; missing langs use en URL at display time
81
+
82
+ ## Rules
83
+
84
+ - Taxonomy codes only from `bat-agent schema`
85
+ - `website` must not include query parameters
86
+ - Never skip Phase 1/2 and dump one giant `submit.json` with 16 languages
87
+
88
+ ## Prompt reference
89
+
90
+ - `prompts/01-generate-en.md` — Phase 1
91
+ - `prompts/02-translate-i18n.md` — Phase 2