From f5452f98a9039950f130144eaff8301546046f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ianar=C3=A9=20S=C3=A9vi?= Date: Thu, 25 Jun 2026 11:17:31 +0200 Subject: [PATCH 1/5] :memo: add SKILL file --- SKILL.md | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 SKILL.md diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 00000000..6f142a07 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,173 @@ +# Mindee PHP SDK + +Use this skill for Mindee V2 integrations with the official PHP SDK. + +## Scope + +- Use the official `mindee/mindee` PHP SDK. +- Focus on SDK-based integration patterns only. +- Do not suggest direct HTTP calls, cURL, or non-SDK integrations. +- Do not use undocumented SDK internals. + +## Primary documentation + +### SDK overview +- https://docs.mindee.com/integrations/client-libraries-sdk.md + +### Client setup +- https://docs.mindee.com/integrations/client-libraries-sdk/configure-the-client.md + +### Model parameters +- https://docs.mindee.com/integrations/client-libraries-sdk/basic-model-configuration.md + +### Load local files +- https://docs.mindee.com/integrations/client-libraries-sdk/load-and-adjust-a-file.md + +### Load remote URLs +- https://docs.mindee.com/integrations/client-libraries-sdk/load-an-url.md + +### Send files and URLs +- https://docs.mindee.com/integrations/client-libraries-sdk/send-a-file-or-url.md + +### Process responses +- https://docs.mindee.com/integrations/client-libraries-sdk/process-the-response.md + +### Handle errors +- https://docs.mindee.com/integrations/problem-database.md + +## Handling responses by model type + +### Extraction +- Use: https://docs.mindee.com/extraction-models/sdk-integration/extraction-result.md +- Use this page for accessing dynamic fields from `$response->inference->result->fields`. +- Use this page for examples of `SimpleField`, `ObjectField`, `ListField`, confidence, and locations. + +### Split +- Use: https://docs.mindee.com/split-models/sdk-integration/split-result.md +- Use this page for iterating over `$response->inference->result->splits`. +- Use this page for `documentType`, `pageRange`, and optional chained extraction results. + +### Crop +- Use: https://docs.mindee.com/crop-models/sdk-integration/crop-result.md +- Use this page for iterating over `$response->inference->result->crops`. +- Use this page for `objectType`, crop location, polygon data, and optional chained extraction results. + +### Classification +- Use: https://docs.mindee.com/classification-models/sdk-integration/classification-result.md +- Use this page for accessing `$response->inference->result->classification`. +- Use this page for `documentType` and optional chained extraction results. + +### OCR +- Use: https://docs.mindee.com/raw-text-ocr-models/sdk-integration/ocr-result.md +- Use this page for iterating over `$response->inference->result->pages`. +- Use this page for page text, words, and word polygon data. + +## Default workflow + +When answering questions, follow this order: + +1. Initialize the SDK client. +2. Configure `modelId` and other inference parameters. +3. Load the input source. +4. Optionally adjust the file before upload. +5. Send with polling or webhooks. +6. Process the response. +7. Handle errors and retries. + +## Answering rules + +- Base answers on the documentation above. +- Prefer documented SDK methods and patterns. +- Use environment variables for API keys in production. +- Reuse a client instance when possible. +- Prefer polling for simple examples. +- Prefer webhooks for production or high-volume workflows. +- If a feature is not documented, say it is not officially supported. +- If a user asks for code, keep examples minimal and working. + +## Code sample rules + +- Use PHP examples only. +- Use the official `mindee/mindee` Composer package. +- Show `use` imports explicitly. +- Include the exact documented class and method names. +- Use placeholders like `MY_API_KEY`, `MY_MODEL_ID`, and `/path/to/file.pdf`. +- Keep samples focused on one task. + +## Preferred example topics + +### Client initialization +Use: +- `new \Mindee\V2\Client($apiKey)` +- `new \Mindee\V2\Client()` with `MINDEE_V2_API_KEY` environment variable + +### Input loading +Use: +- `PathInput` — load from a local file path +- `BytesInput` — load from raw binary data (provide filename) +- `Base64Input` — load from a base64-encoded string (provide filename) +- `FileInput` — load from a PHP file resource/handle +- `UrlInputSource` — load from an HTTPS URL + +### Sending documents +Use: +- `$client->enqueueAndGetResult(ResponseClass::class, $inputSource, $params)` for polling +- `$client->enqueue($inputSource, $params)` for webhooks + +### Response handling +Use: +- `$response->inference` +- `$response->getRawHttp()` +- `LocalResponse` for webhook payloads +- HMAC signature validation via `$localResponse->isValidHMACSignature()` when relevant + +### File preparation +Use: +- `$inputSource->pageCount` (property, PDF only — requires Ghostscript) +- `$inputSource->compress(...)` +- `$inputSource->applyPageOptions(...)` +- `$inputSource->fixPdf()` + +## Avoid + +- Direct REST examples +- cURL examples +- Manual authentication header construction +- Bearer token examples for API keys +- Non-PHP examples +- V1 examples unless the user explicitly asks for V1 + +## If the user is unclear + +Ask for only what is needed: + +- input type: local file or URL +- delivery pattern: polling or webhook +- model ID +- runtime context: web app, CLI, or background worker + +## Output style + +- Be concise. +- Answer with runnable examples when code is requested. +- Link to the most relevant doc section. +- Do not overwhelm the user with every option. +- Start with the documented default path. + +--- + +# Agent Instructions: Querying The Documentation + +If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. + +Perform an HTTP GET request on the documentation URL with the `ask` query parameter. +Include `php+sdk+-+` at the beginning of the question to get answers specific to this library: + +``` +GET https://docs.mindee.com/integrations.md?ask=php+sdk+-+ +``` + +The question should be specific, self-contained, and written in natural language. +The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. + +Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. From 6db789155ebf39c87884c8355c4119ab2736c0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ianar=C3=A9?= <97107275+ianardee@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:32:53 +0200 Subject: [PATCH 2/5] Update SKILL.md Co-authored-by: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> --- SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index 6f142a07..92adf5fb 100644 --- a/SKILL.md +++ b/SKILL.md @@ -67,7 +67,7 @@ Use this skill for Mindee V2 integrations with the official PHP SDK. When answering questions, follow this order: 1. Initialize the SDK client. -2. Configure `modelId` and other inference parameters. +2. Configure `$modelId` and other inference parameters. 3. Load the input source. 4. Optionally adjust the file before upload. 5. Send with polling or webhooks. From 14ba1862e1ebd57339b696e7b5ca732c49d23dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ianar=C3=A9?= <97107275+ianardee@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:33:00 +0200 Subject: [PATCH 3/5] Update SKILL.md Co-authored-by: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> --- SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index 92adf5fb..85471930 100644 --- a/SKILL.md +++ b/SKILL.md @@ -55,7 +55,7 @@ Use this skill for Mindee V2 integrations with the official PHP SDK. ### Classification - Use: https://docs.mindee.com/classification-models/sdk-integration/classification-result.md - Use this page for accessing `$response->inference->result->classification`. -- Use this page for `documentType` and optional chained extraction results. +- Use this page for `$documentType` and optional chained extraction results. ### OCR - Use: https://docs.mindee.com/raw-text-ocr-models/sdk-integration/ocr-result.md From cb2b2c65eaf8e1014d0ac41eaa5de3c8b25b3e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ianar=C3=A9?= <97107275+ianardee@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:33:06 +0200 Subject: [PATCH 4/5] Update SKILL.md Co-authored-by: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> --- SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index 85471930..3d308202 100644 --- a/SKILL.md +++ b/SKILL.md @@ -50,7 +50,7 @@ Use this skill for Mindee V2 integrations with the official PHP SDK. ### Crop - Use: https://docs.mindee.com/crop-models/sdk-integration/crop-result.md - Use this page for iterating over `$response->inference->result->crops`. -- Use this page for `objectType`, crop location, polygon data, and optional chained extraction results. +- Use this page for `$objectType`, crop location, polygon data, and optional chained extraction results. ### Classification - Use: https://docs.mindee.com/classification-models/sdk-integration/classification-result.md From a034c5bed29d8f103b048b1c9f26b19e3f3bfbf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ianar=C3=A9?= <97107275+ianardee@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:33:12 +0200 Subject: [PATCH 5/5] Update SKILL.md Co-authored-by: sebastianMindee <130448732+sebastianMindee@users.noreply.github.com> --- SKILL.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SKILL.md b/SKILL.md index 3d308202..b96f2c1f 100644 --- a/SKILL.md +++ b/SKILL.md @@ -45,7 +45,7 @@ Use this skill for Mindee V2 integrations with the official PHP SDK. ### Split - Use: https://docs.mindee.com/split-models/sdk-integration/split-result.md - Use this page for iterating over `$response->inference->result->splits`. -- Use this page for `documentType`, `pageRange`, and optional chained extraction results. +- Use this page for `$documentType`, `$pageRange`, and optional chained extraction results. ### Crop - Use: https://docs.mindee.com/crop-models/sdk-integration/crop-result.md @@ -123,9 +123,9 @@ Use: ### File preparation Use: -- `$inputSource->pageCount` (property, PDF only — requires Ghostscript) -- `$inputSource->compress(...)` -- `$inputSource->applyPageOptions(...)` +- `$inputSource->pageCount` — property, requires Ghostscript +- `$inputSource->compress(...)` — compress before upload, requires Ghostscript +- `$inputSource->applyPageOptions(...)` — trim or remove pages - `$inputSource->fixPdf()` ## Avoid