Skip to content

poll-poll134/android-blackbox-analysis-skill

android-app-blackbox-competitive-analysis

Verified

Use when users request Android competitor research, systematic feature or interface mapping, evidence screenshots, interaction coverage, comparison-ready product dossiers, or Android system-boundary verification without APK decompilation.

FileKindSize
SKILL.mdskill md3.2 KB
examples/sanitized-complete-example/README.en.mdmarkdown2.0 KB
examples/sanitized-complete-example/README.mdmarkdown1.8 KB
examples/sanitized-complete-example/analysis/capability-matrix.csvother1.3 KB
examples/sanitized-complete-example/analysis/system-interface-evidence.csvother1.2 KB
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0001_empty-home.mdmarkdown254 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0002_app-picker.mdmarkdown253 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0003_instance-created.mdmarkdown254 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0004_instance-menu.mdmarkdown249 B
examples/sanitized-complete-example/evidence/screen-summaries/DEMO-0005_permission-diagnostics.mdmarkdown463 B
examples/sanitized-complete-example/indexes/control_coverage.csvother1.7 KB
examples/sanitized-complete-example/indexes/coverage_gaps.csvother1.2 KB
examples/sanitized-complete-example/indexes/interface_index.csvother1.1 KB
examples/sanitized-complete-example/indexes/screenshot_index.csvother1.4 KB
examples/sanitized-complete-example/input/capture-plan.csvother638 B
examples/sanitized-complete-example/input/scope.en.mdmarkdown849 B
examples/sanitized-complete-example/input/scope.mdmarkdown760 B
examples/sanitized-complete-example/reports/final-report.en.mdmarkdown3.6 KB
examples/sanitized-complete-example/reports/final-report.mdmarkdown3.1 KB
references/analysis-guide.mdmarkdown2.0 KB
references/evidence-model.mdmarkdown1.9 KB
scripts/build_indexes.mjsexecutablescript6.8 KB
scripts/capture_evidence.shexecutablescript4.8 KB
scripts/image_info.pyexecutablescript1.3 KB
scripts/init_case.shexecutablescript1.3 KB
scripts/package_release.pyexecutablescript2.6 KB
scripts/redact_check.mjsexecutablescript3.1 KB
scripts/scroll_sweep.shexecutablescript2.5 KB
scripts/smoke_test.shexecutablescript1.8 KB
scripts/tap_ui.shexecutablescript1.3 KB
scripts/ui_pick.pyexecutablescript1.9 KB
scripts/validate_example.mjsexecutablescript12.2 KB
scripts/validate_skill.mjsexecutablescript2.6 KB
templates/capability-matrix.csvother126 B
templates/report-template.mdmarkdown1.2 KB
templates/system-interface-evidence.csvother120 B

scripts/build_indexes.mjs

View on GitHub
#!/usr/bin/env node
import crypto from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';

function parseArgs(argv) {
  const args = {};
  for (let i = 0; i < argv.length; i++) {
    if (argv[i] === '--case-root') args.caseRoot = argv[++i];
    else throw new Error(`unknown argument: ${argv[i]}`);
  }
  if (!args.caseRoot) throw new Error('usage: build_indexes.mjs --case-root DIR');
  return args;
}

function csv(value) {
  let text = String(value ?? '');
  // Quoting does not stop spreadsheet applications from evaluating formulas.
  // Preserve the visible evidence while forcing formula-like cells to text.
  if (/^[=+\-@\t\r]/.test(text)) text = `'${text}`;
  return `"${text.replaceAll('"', '""')}"`;
}

function writeCsv(file, headers, rows) {
  const content = [headers, ...rows].map(row => row.map(csv).join(',')).join('\n');
  fs.writeFileSync(file, `\uFEFF${content}\n`);
}

function sha256(file) {
  return crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
}

function imageInfo(file) {
  const data = fs.readFileSync(file);
  if (data.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) && data.length >= 24) {
    return ['PNG', data.readUInt32BE(16), data.readUInt32BE(20)];
  }
  if (data[0] === 0xff && data[1] === 0xd8) {
    let offset = 2;
    while (offset + 9 <= data.length) {
      if (data[offset] !== 0xff) { offset++; continue; }
      const marker = data[offset + 1];
      offset += 2;
      if (marker === 0xd8 || marker === 0xd9) continue;
      if (offset + 2 > data.length) break;
      const length = data.readUInt16BE(offset);
      if (marker >= 0xc0 && marker <= 0xc3 && offset + 7 < data.length) {
        return ['JPEG', data.readUInt16BE(offset + 5), data.readUInt16BE(offset + 3)];
      }
      offset += Math.max(length, 2);
    }
  }
  return ['UNKNOWN', '', ''];
}

function decodeXml(text) {
  return text
    .replaceAll('&quot;', '"')
    .replaceAll('&apos;', "'")
    .replaceAll('&lt;', '<')
    .replaceAll('&gt;', '>')
    .replaceAll('&amp;', '&');
}

function parseNodes(xmlText) {
  const nodes = [];
  for (const match of xmlText.matchAll(/<node\b([^>]*)>/g)) {
    const attrs = {};
    for (const attr of match[1].matchAll(/([\w:-]+)="([^"]*)"/g)) attrs[attr[1]] = decodeXml(attr[2]);
    nodes.push(attrs);
  }
  return nodes;
}

function center(bounds = '') {
  const match = bounds.match(/^\[(\d+),(\d+)\]\[(\d+),(\d+)\]$/);
  if (!match) return ['', ''];
  return [Math.round((Number(match[1]) + Number(match[3])) / 2), Math.round((Number(match[2]) + Number(match[4])) / 2)];
}

const { caseRoot } = parseArgs(process.argv.slice(2));
const root = path.resolve(caseRoot);
const shotsDir = path.join(root, 'evidence', 'screenshots');
const treesDir = path.join(root, 'evidence', 'ui_tree');
const outDir = path.join(root, 'indexes');
fs.mkdirSync(outDir, { recursive: true });
if (!fs.existsSync(shotsDir)) throw new Error(`missing screenshots directory: ${shotsDir}`);

const imageFiles = fs.readdirSync(shotsDir).filter(name => /\.(png|jpe?g)$/i.test(name)).sort();
const screenshotRows = [];
const interfaceRows = [];
const controlRows = [];
const gapRows = [];
const seenIds = new Map();

for (const name of imageFiles) {
  const match = name.match(/^([A-Za-z0-9][A-Za-z0-9.-]*)_(.+)\.(png|jpe?g)$/i);
  if (!match) {
    gapRows.push(['', name, 'invalid-filename', 'Expected <ID>_<slug>.<png|jpg>']);
    continue;
  }
  const [, id, slug] = match;
  const shot = path.join(shotsDir, name);
  const base = name.replace(/\.(png|jpe?g)$/i, '');
  const completeXml = path.join(treesDir, `${base}.xml`);
  const incompleteXml = path.join(treesDir, `${base}.incomplete.xml`);
  const xml = fs.existsSync(completeXml) ? completeXml : (fs.existsSync(incompleteXml) ? incompleteXml : '');
  const uiStatus = xml ? (xml.endsWith('.incomplete.xml') ? 'incomplete' : 'complete') : 'missing';
  const [format, width, height] = imageInfo(shot);
  const relativeShot = path.relative(root, shot);
  const relativeXml = xml ? path.relative(root, xml) : '';
  const duplicate = seenIds.has(id) ? `duplicate ID; first seen in ${seenIds.get(id)}` : '';
  if (!seenIds.has(id)) seenIds.set(id, name);
  screenshotRows.push([id, name, slug, relativeShot, sha256(shot), format, width, height, fs.statSync(shot).size, relativeXml, uiStatus, duplicate]);
  if (format === 'UNKNOWN') gapRows.push([id, name, 'invalid-image', 'Unsupported or corrupt image']);
  if (uiStatus !== 'complete') gapRows.push([id, name, `ui-tree-${uiStatus}`, 'Screenshot remains valid; UI coverage is partial']);
  if (duplicate) gapRows.push([id, name, 'duplicate-id', duplicate]);

  let nodes = [];
  if (xml) {
    const xmlText = fs.readFileSync(xml, 'utf8');
    nodes = parseNodes(xmlText);
  }
  const visibleTexts = [];
  const controls = [];
  for (const attrs of nodes) {
    for (const value of [attrs.text, attrs['content-desc']]) {
      const cleaned = String(value ?? '').replace(/\s+/g, ' ').trim();
      if (cleaned && !visibleTexts.includes(cleaned)) visibleTexts.push(cleaned);
    }
    const className = attrs.class ?? '';
    const actionable = attrs.clickable === 'true' || attrs['long-clickable'] === 'true' || attrs.checkable === 'true' || /Button|Switch|EditText|CheckBox/.test(className);
    if (!actionable) continue;
    const label = attrs.text || attrs['content-desc'] || attrs['resource-id'] || className;
    if (label && !controls.includes(label)) controls.push(label);
    const [x, y] = center(attrs.bounds);
    controlRows.push([
      id, name, slug, className, attrs['resource-id'] ?? '', attrs.text ?? '', attrs['content-desc'] ?? '',
      attrs.clickable ?? '', attrs['long-clickable'] ?? '', attrs.checkable ?? '', attrs.checked ?? '',
      attrs.enabled ?? '', attrs.selected ?? '', attrs.bounds ?? '', x, y, uiStatus,
    ]);
  }
  interfaceRows.push([id, name, slug, visibleTexts.join(' | '), controls.join(' | '), relativeShot, relativeXml, uiStatus]);
}

writeCsv(path.join(outDir, 'screenshot_index.csv'), [
  'Evidence ID','File','Slug','Screenshot path','SHA-256','Format','Width','Height','Bytes','UI tree path','UI tree status','Notes',
], screenshotRows);
writeCsv(path.join(outDir, 'interface_index.csv'), [
  'Evidence ID','File','Slug','Visible text and descriptions','Actionable control summary','Screenshot path','UI tree path','UI tree status',
], interfaceRows);
writeCsv(path.join(outDir, 'control_coverage.csv'), [
  'Evidence ID','Screenshot','Slug','Class','Resource ID','Text','Content description','Clickable','Long-clickable','Checkable','Checked','Enabled','Selected','Bounds','Center X','Center Y','UI tree status',
], controlRows);
writeCsv(path.join(outDir, 'coverage_gaps.csv'), ['Evidence ID','File','Gap type','Recommended handling'], gapRows);

console.log(JSON.stringify({ screenshots: screenshotRows.length, interfaces: interfaceRows.length, controls: controlRows.length, gaps: gapRows.length, output: outDir }, null, 2));
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall