alicloud-ai-text-document-mind

cinience/alicloud-skills · updated Apr 8, 2026

$npx skills add https://github.com/cinience/alicloud-skills --skill alicloud-ai-text-document-mind
0 commentsdiscussion
summary

Category: provider

skill.md

Category: provider

Document Mind (DocMind) — Node.js SDK

Use DocMind to extract document structure, text, and layout with async jobs.

Prerequisites

  • Install SDKs:
    • npm install @alicloud/docmind-api20220711 @alicloud/tea-util @alicloud/credentials
  • Provide credentials via standard Alibaba Cloud env vars:
    • ALICLOUD_ACCESS_KEY_ID
    • ALICLOUD_ACCESS_KEY_SECRET
    • ALICLOUD_REGION_ID (optional default; if unset, choose the most reasonable region for the task or ask the user)

Quickstart (submit + poll)

const Client = require('@alicloud/docmind-api20220711');
const Credential = require('@alicloud/credentials');
const Util = require('@alicloud/tea-util');

const cred = new Credential.default();
const regionId = process.env.ALICLOUD_REGION_ID || 'cn-hangzhou'; // Example default; choose/ask if unset.
const client = new Client.default({
  endpoint: `docmind-api.${regionId}.aliyuncs.com`,
  accessKeyId: cred.credential.accessKeyId,
  accessKeySecret: cred.credential.accessKeySecret,
  type: 'access_key',
  regionId,
});

async function submitByUrl(fileUrl, fileName) {
  const req = new Client.SubmitDocStructureJobRequest();
  req.fileUrl = fileUrl;
  req.fileName = fileName;
  const resp = await client.submitDocStructureJob(req);
  return resp.body.data.id;
}

async function pollResult(jobId) {
  const req = new Client.GetDocStructureResultRequest();
  req.id = jobId;
  const resp = await client.getDocStructureResult(req);
  return resp.body;
}

(async () => {
  const jobId = await submitByUrl('https://example.com/example.pdf', 'example.pdf');
  console.log('jobId:', jobId);

  // Poll every 10s until completed.
  for (;;) {
    const result = await pollResult(jobId);
    if (result.completed) {
      console.log(result.status, result.data || result.message);
      break;
    }
    await new Promise((r) => setTimeout(r, 10000));
  }
})();

Script quickstart

DOCMIND_FILE_URL="https://example.com/example.pdf" \\
node skills/ai/text/alicloud-ai-text-document-mind/scripts/quickstart.js

Environment variables:

  • DOCMIND_FILE_URL
  • DOCMIND_FILE_NAME (optional)
  • DOCMIND_POLL_INTERVAL_MS (optional, default 10000)
  • DOCMIND_MAX_POLLS (optional, default 120)

Local file upload

const fs = require('fs');
const advanceReq = new Client.SubmitDocStructureJobAdvanceRequest();
advanceReq.fileUrlObject = fs.createReadStream('./example.pdf');
advanceReq.fileName = 'example.pdf';
const runtime = new Util.RuntimeOptions({});
const resp = await client.submitDocStructureJobAdvance(advanceReq, runtime);

Notes for Claude Code/Codex

  • DocMind is async: submit a job, then poll until completed=true.
  • Poll every ~10s; max processing window is 120 minutes.
  • Keep files publicly accessible when using URL submission.

Error handling

  • UrlNotLegal: URL not publicly accessible or malformed.
  • DocProcessing: job still running; keep polling.
  • Fail: check message and error code for root cause.

Validation

mkdir -p output/alicloud-ai-text-document-mind
for f in skills/ai/text/alicloud-ai-text-document-mind/scripts/*.py; do
  python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/alicloud-ai-text-document-mind/validate.txt

Pass criteria: command exits 0 and output/alicloud-ai-text-document-mind/validate.txt is generated.

Output And Evidence

  • Save artifacts, command outputs, and API response summaries under output/alicloud-ai-text-document-mind/.
  • Include key parameters (region/resource id/time range) in evidence files for reproducibility.

Workflow

  1. Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
  2. Run one minimal read-only query first to verify connectivity and permissions.
  3. Execute the target operation with explicit parameters and bounded scope.
  4. Verify results and save output/evidence files.

References

  • DocMind Node.js SDK: @alicloud/docmind-api20220711

  • Source list: references/sources.md

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.645 reviews
  • Diego Smith· Dec 28, 2024

    alicloud-ai-text-document-mind is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Charlotte Desai· Dec 28, 2024

    Useful defaults in alicloud-ai-text-document-mind — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Diego Johnson· Dec 16, 2024

    alicloud-ai-text-document-mind has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Mateo Sharma· Dec 4, 2024

    alicloud-ai-text-document-mind fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Charlotte Gupta· Nov 23, 2024

    Registry listing for alicloud-ai-text-document-mind matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Carlos Smith· Nov 19, 2024

    Solid pick for teams standardizing on skills: alicloud-ai-text-document-mind is focused, and the summary matches what you get after install.

  • Kiara Park· Nov 7, 2024

    Keeps context tight: alicloud-ai-text-document-mind is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sakshi Patil· Nov 3, 2024

    Registry listing for alicloud-ai-text-document-mind matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Diego Kim· Oct 26, 2024

    alicloud-ai-text-document-mind is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Chaitanya Patil· Oct 22, 2024

    alicloud-ai-text-document-mind reduced setup friction for our internal harness; good balance of opinion and flexibility.

showing 1-10 of 45

1 / 5