Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

phonebase-skill-creator电话基础技能创建者

Agent Skill

phonebase-skill-creator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

582

周安装

24

GitHub Stars

43

下载量

190
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:phonebase-skill-creator(电话基础技能创建者)
来源仓库:https://github.com/phonebase-cloud/phonebase-skills
仓库路径:skills/phonebase-skill-creator
安装命令:
npx skills add https://github.com/phonebase-cloud/phonebase-skills --skill phonebase-skill-creator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/phonebase-cloud/phonebase-skills --skill phonebase-skill-creator

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 npx 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。
  • 使用前建议核实是否会触发联网、命令执行或文件读写操作。
  • phonebase-skill-creator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

PhoneBase Skill Creator

Write app skills — scripted automation packages that turn an Android app into pb CLI subcommands. After installing a skill, the user gets commands like pb googleplay search "telegram" or pb gmail compose.

Workflow

Creating a skill is an iterative process:

  1. Research the app — figure out its package name, deeplink schemes, key screens, and UI patterns
  2. Scaffoldpb skills new <name> --package <pkg> to create the directory and extract the app icon
  3. Write scripts — start with open.js, close.js, state.js, then add business commands
  4. Test on a real device — run each command, check the output shape, try edge cases
  5. Iterate — fix issues, handle dialog interruptions, improve stability

Don't try to get it perfect in one pass. Write the simplest version first, test it, then improve based on what actually happens on the device. Real Android devices are messy — apps update, dialogs pop up, UI elements move.

Directory Layout

~/.phonebase/skills/<name>/
├── SKILL.md                    ← Required: frontmatter + docs
├── resources/
│   └── ic_launcher.webp        ← Required: app icon
└── scripts/                    ← One .js file = one command
    ├── _lib.js                 ← Shared utilities (underscore prefix = not a command)
    ├── open.js
    ├── close.js
    ├── state.js
    └── search.js

Rules:

  • Files starting with _ or . in scripts/ are not registered as commands
  • One file = one command. Filename becomes the command name (search.jspb <skill> search)
  • Skill name: lowercase [a-z0-9_-], 1–64 chars, start with letter or digit

SKILL.md Frontmatter

---
name: instagram
display_name: Instagram
description: Instagram automation — launch, search, close
package: com.instagram.android
category: social
requires:
  - googleservices
---
FieldRequiredDescription
nameYesMust match directory name
display_nameNoHuman-readable app name
descriptionNoOne-line description
packageNoAndroid package name
categoryNoCategory slug
requiresNoDependencies (auto-installed)

Below the frontmatter is free-form markdown documentation (not parsed by the scanner).

JSDoc Command Protocol

The first `/... */` block** in each script declares the command:

/**
 * @description 在应用内搜索
 * @description:en Search within the app
 * @arg keyword:string! 搜索关键词
 * @arg:en keyword Search keyword
 * @arg limit:int=20 最多返回几条
 * @arg tags:string* 过滤标签(可多个)
 */

@arg syntax

@arg <name>:<type>[modifier] [description]

TypeValues
Typesstring int float bool path
!Required
=<value>Optional with default
*Multi-value (--tags a --tags b)

Reading args in script

const { parseArgs } = require('node:util');
const { values } = parseArgs({
  options: {
    keyword: { type: 'string' },
    limit: { type: 'string' },
    tags: { type: 'string', multiple: true },
  },
});

SDK API

const pb = require('@phonebase-cloud/pb');

All methods return Promise. The SDK communicates with the pb daemon via Unix socket — PHONEBASE_DEVICE_ID is auto-injected.

Device Control

MethodPurpose
pb.tap(x, y)Tap at coordinates
pb.swipe(x1, y1, x2, y2)Swipe (Bézier trajectory)
pb.input(text)Type into focused field (appends, does not replace)
pb.keyevent(key)Send key by string name: HOME BACK ENTER DEL MENU etc.

App Management

MethodPurpose
pb.launch(pkg)Launch app's default Activity
pb.startActivity(opts)Send custom Intent (action, data, package_name, component, extras)
pb.forceStop(pkg)Kill app
pb.topActivity()Get foreground Activity → {package_name, class_name}
pb.packagesList()List installed packages
pb.installPackage(opts)Install APK: {uri: "https://..."} or {uri: "/sdcard/..."}
pb.uninstallPackage(pkg)Uninstall app

UI Observation

MethodPurpose
pb.dumpc()Compact UI tree (text, bounds, clickable) — preferred
pb.dump()Full XML hierarchy (when you need parent-child)
pb.screencap(opts?)Screenshot image
pb.findTextInDump(dumpStr, text)Find node → {bounds, center, line} or null
pb.waitText(text, opts?)Poll dumpc until text appears (default 10s, 0.5s interval)
pb.tapText(text)Find + tap in one call

Other

MethodPurpose
pb.browse(url, pkg?)Open URL in browser
pb.clipboardGet() / pb.clipboardSet(text)Clipboard
pb.displayInfo()Screen resolution, density, rotation
pb.shell(cmd)Raw shell → {stdout, stderr, code}
pb.pushFile(local, remote?) / pb.pullFile(path)File transfer
pb.listFiles(path)List directory
pb.run(path, args?)Generic capability passthrough

Output Format

Your script's stdout is only the business data JSON. pb automatically wraps it:

Script stdout:          pb returns to user:
{"x": 1, "y": 2}  →   {"code": 200, "data": {"x": 1, "y": 2}, "msg": "OK"}

Three rules:

  1. Never add status field — metadata belongs in pb's code field
  2. Use boolean / objects — not string status codes ({logged_in: false} not {status: "needs_login"})
  3. Failure = process.exit(1) + stderr — pb converts non-zero exit to error response

Helper functions (put in _lib.js):

function finish(data) {
  console.log(JSON.stringify(data));
  process.exit(0);
}

function fail(err, context) {
  console.error(`${context}: ${err.message}`);
  process.exit(1);
}

Standard Commands

Every app skill should provide at least open and close. state is strongly recommended.

CommandResponsibilityReturnsDoes NOT return
openLaunch only, return fasttop_activity, foregrounddump data, logged_in
stateFull introspectiontop_activity, foreground, logged_in, account, visible_texts
closeForce-stop onlytop_activityextra data

The reason for this separation: callers choose what they need. open is fast because it skips the dump. state is thorough because that's its job. Mixing them makes both slower and harder to reason about.

open.js

const pb = require('@phonebase-cloud/pb');
const { PACKAGE, sleep, isForeground, finish, fail } = require('./_lib.js');

async function main() {
  await pb.launch(PACKAGE);
  await sleep(2500);
  const top = await pb.topActivity();
  finish({ top_activity: top, foreground: isForeground(top) });
}

main().catch(err => fail(err, 'open'));

state.js

async function main() {
  const top = await pb.topActivity();
  const dumpStr = await pb.dumpc();
  const nodes = parseVisibleNodes(dumpStr);
  const login = detectLoginStatus(nodes);
  finish({
    top_activity: top,
    foreground: isForeground(top),
    logged_in: login.logged_in,
    account: login.account,
    visible_texts: nodes.map(n => n.text || n.content_desc).filter(Boolean).slice(0, 30),
  });
}

_lib.js Essentials

Every skill needs dump parsing utilities:

const PACKAGE = 'com.example.app';

function isForeground(top) {
  return top && top.package_name === PACKAGE;
}

function parseVisibleNodes(dumpStr) {
  if (typeof dumpStr !== 'string') return [];
  const nodes = [];
  for (const line of dumpStr.split('\n')) {
    const textMatch = line.match(/\btext="([^"]*)"/);
    const descMatch = line.match(/content-desc="([^"]*)"/);
    const text = textMatch ? textMatch[1] : '';
    const desc = descMatch ? descMatch[1] : '';
    if (!text && !desc) continue;
    const boundsMatch = line.match(/bounds=\[(\d+),(\d+)\]\[(\d+),(\d+)\]/);
    if (!boundsMatch) continue;
    const [x1, y1, x2, y2] = boundsMatch.slice(1, 5).map(v => parseInt(v, 10));
    nodes.push({
      text, content_desc: desc,
      bounds: [x1, y1, x2, y2],
      center: [Math.floor((x1 + x2) / 2), Math.floor((y1 + y2) / 2)],
      width: x2 - x1, height: y2 - y1,
      clickable: /\bclickable=true\b/.test(line),
    });
  }
  return nodes;
}

function parseScreenSize(dumpStr) {
  if (typeof dumpStr !== 'string') return null;
  const m = dumpStr.match(/Screen (\d+)x(\d+)/);
  return m ? { width: parseInt(m[1], 10), height: parseInt(m[2], 10) } : null;
}

function findClickableByText(nodes, candidates) {
  const normalized = candidates.map(c => c.toLowerCase());
  const clickable = nodes.filter(n => n.clickable);
  // exact → startsWith → contains (three-pass, most stable)
  for (const pass of ['exact', 'prefix', 'contains']) {
    for (const n of clickable) {
      const t = (n.text || '').toLowerCase();
      const d = (n.content_desc || '').toLowerCase();
      const match = pass === 'exact'
        ? normalized.includes(t) || normalized.includes(d)
        : pass === 'prefix'
        ? normalized.some(c => t.startsWith(c) || d.startsWith(c))
        : normalized.some(c => t.includes(c) || d.includes(c));
      if (match) return n;
    }
  }
  return null;
}

function sleep(ms) { return new Promise(r => setTimeout(r, ms)); }
function finish(data) { console.log(JSON.stringify(data)); process.exit(0); }
function fail(err, ctx) { console.error(`${ctx}: ${err.message}`); process.exit(1); }

module.exports = {
  PACKAGE, isForeground, parseVisibleNodes, parseScreenSize,
  findClickableByText, sleep, finish, fail,
};

Stability Patterns

1. Deeplinks over UI taps

Deeplinks are faster, more stable, and survive app version updates. Always check if the app supports them before writing tap sequences:

await pb.startActivity({
  action: 'android.intent.action.VIEW',
  data: 'market://search?q=WhatsApp&c=apps',
  package_name: 'com.android.vending',
});

Why this matters: a deeplink is one API call. The UI tap equivalent is "tap search icon → wait for keyboard → type text → tap search button" — four steps, each of which can fail if the UI layout changes.

2. Clear input before typing

pb.input() appends text. If the user runs the same search command twice, the second keyword gets appended to the first:

async function clearFocusedField(maxChars = 200) {
  await pb.shell('input keyevent KEYCODE_MOVE_END');
  await sleep(150);
  await pb.shell(`for i in $(seq 1 ${maxChars}); do input keyevent KEYCODE_DEL; done`);
  await sleep(300);
}

3. Handle dialog interruptions

Apps often interrupt with Google Sign-In, permission dialogs, or update prompts. Your script needs to handle these or it will get stuck:

async function dismissDialogs(targetPkg, maxAttempts = 3) {
  for (let i = 0; i < maxAttempts; i++) {
    const top = await pb.topActivity();
    if (top.package_name === targetPkg) return top;
    if (top.package_name === 'com.google.android.gms') {
      await pb.keyevent('BACK');
      await sleep(800);
      continue;
    }
    const nodes = parseVisibleNodes(await pb.dumpc());
    const dismiss = findClickableByText(nodes, [
      'Accept', 'Agree', 'Got it', 'OK', 'Continue',
      'Not now', 'Skip', 'No thanks', 'Maybe later',
    ]);
    if (dismiss) {
      await pb.tap(dismiss.center[0], dismiss.center[1]);
      await sleep(1000);
    } else {
      break;
    }
  }
  return pb.topActivity();
}

4. NAF (Not Accessibility Friendly) buttons

Icon-only buttons without text or content-desc can't be found by text. Use geometry instead — "the clickable element in the top-right corner":

function findTopRightIcon(clickableNodes, screenSize) {
  const candidates = clickableNodes.filter(n => {
    const [cx, cy] = n.center;
    return cy < screenSize.height * 0.15
        && cx > screenSize.width * 0.8
        && n.width < screenSize.width * 0.9;
  });
  candidates.sort((a, b) => b.center[0] - a.center[0]);
  return candidates[0] || null;
}

5. Polling with timeout

For long-running operations like app installation:

async function pollUntil(checkFn, { timeout = 30, interval = 2 } = {}) {
  const deadline = Date.now() + timeout * 1000;
  while (Date.now() < deadline) {
    const result = await checkFn();
    if (result) return result;
    await sleep(interval * 1000);
  }
  return null;
}

6. Login detection

Detect login pages via Activity class name + visible text:

const LOGIN_HINTS = ['SignUp', 'Login', 'Welcome', 'Auth', 'Onboard'];
const LOGIN_TEXTS = ['Log in', 'Sign up', 'Sign in', 'Create account',
  'Continue with Google', 'Continue with Facebook'];

function isLoginPage(topActivity, nodes) {
  const cls = (topActivity.class_name || '').toLowerCase();
  if (LOGIN_HINTS.some(h => cls.includes(h.toLowerCase()))) return true;
  return nodes.some(n => LOGIN_TEXTS.some(h => (n.text || '').startsWith(h)));
}

Writing Principles

  • Explain the why. Instead of "NEVER use resource-id", write "Don't rely on resource-id — apps like TikTok and Douyin obfuscate and change IDs every release. Use text, content-desc, or geometry instead." The model is smart; when it understands the reason, it makes better judgment calls in edge cases.
  • Generalize from examples. You're testing on one device with one app version, but the skill will run across many devices and versions. Don't overfit to a specific UI layout. Prefer text matching over coordinate matching, deeplinks over tap sequences.
  • Keep it lean. If a pattern isn't pulling its weight, remove it. Read the test run transcripts — if the script wastes time on something unproductive, cut that part.

Anti-Patterns

Don'tWhy
Add status field to outputpb's code field handles transport metadata
Put introspection in openopen = launch only, state = inspect
Rely on resource-idMany apps obfuscate and rotate IDs each release
Hardcode coordinatesPriority: pb.tapText() → geometry → hardcoded (last resort, with comment)
console.log() debug infostdout is JSON only. Debug goes to console.error() (stderr)
Use numeric key codespb.keyevent(4) fails. Use string names: pb.keyevent('BACK')
Skip clearing before inputpb.input() appends. Always clear in repeat scenarios
Multiple commands per fileOne file = one command

Testing

# Scaffold
pb skills new <name> --package <pkg>

# Validate structure + JSDoc
pb skills validate <name>

# Run on device
pb -s <device_id> <skill> <command> --keyword "test"

# Verify output shape
pb -s <device_id> <skill> state | python3 -c "
import sys, json
o = json.load(sys.stdin)
assert o['code'] == 200
assert 'status' not in o['data']
print('OK')
"

Always test on a real device. No mocks.

Reference Skills

When writing a new skill, study existing implementations in phonebase-skill-hub:

  • googleplay — deeplink-driven, login detection via email regex, install polling with timeout
  • gmail — complex dump parsing, mailto deeplink, compose page validation
  • tiktok — NAF button detection, login page double-check, Google Sign-In dismissal
  • googleservices — account login orchestration shared across Google apps

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.47%
按下载量换算64

Claude

31.62%
按下载量换算60

Cursor

18.69%
按下载量换算36

Gemini CLI

9.78%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills