[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75BBHETCP7AF9W8CMTG5M8B":3,"skill-same:01M75BBHETCP7AF9W8CMTG5M8B":146},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":14,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":41,"install":42,"resources":55},"01M75BBHETCP7AF9W8CMTG5M8B","agilize-contabil-ops",null,"Agilize contábil platform operations: Keycloak\u002FOIDC PKCE authentication, finance transaction classification, NFS-e evidence linking, transaction splitting, pro-labore reconciliation, monthly close, and audit workflows. Company-agnostic — works for any Agilize tenant.","fmercurio\u002Fclawdia-custom-skills","fmercurio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F15571697?v=4","01M75B9TGVV3RPB40SY7AT0VNH","Felippe Mercurio","01M75B9THMAWYGFT755CR1PT9A",1,"MIT","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: agilize-contabil-ops\ndescription: \"Agilize contábil platform operations: Keycloak\u002FOIDC PKCE authentication, finance transaction classification, NFS-e evidence linking, transaction splitting, pro-labore reconciliation, monthly close, and audit workflows. Company-agnostic — works for any Agilize tenant.\"\nversion: 1.0.0\nauthor: Hermes Agent\nlicense: MIT\nmetadata:\n  hermes:\n    tags: [agilize, accounting, bookkeeping, reconciliation, nfse, pro-labore, brazilian-accounting]\n---\n\n# Agilize Contábil Platform Operations\n\nUse this skill when working with the **Agilize** online accounting platform: authenticating, reading\u002Fclassifying finance transactions, splitting transactions, linking NFS-e\u002Ftax\u002Finvoice evidence, reconciling pro-labore, running monthly close checks, and producing audit trails.\n\nThis skill is **company-agnostic**. All company-specific values (company ID, CNPJ, category IDs, partner UUIDs) must be supplied via configuration or runtime parameters — never hard-coded.\n\n## Prerequisites\n\nBefore using this skill, the following must be available:\n\n1. **Agilize credentials** — username, password, and TOTP (if 2FA is enabled), stored in a secure credential manager (KeePassXC, environment variables, or equivalent).\n2. **Company ID** — the Agilize UUID for the target company.\n3. **Company CNPJ** — required as the `key` header for most API calls.\n4. **Hermes profile** — ideally a dedicated finance\u002Fadmin profile with its own credential access.\n\nSee `references\u002Fagilize-api-access.md` for the full authentication pattern.\n\n## Core posture\n\n- Operate as a practical accounting\u002Ffinance specialist, not as a certified accountant.\n- Separate facts, assumptions, estimates, and recommendations.\n- Flag tax\u002Flegal\u002Faccounting uncertainty and recommend accountant validation when material.\n- Do not expose sensitive banking, tax, CPF\u002FCNPJ, account, contract, or supplier details in chat unless necessary and minimized.\n- **Never** execute payments, transfers, filings, account changes, month-close actions, or any irreversible operation without explicit user approval.\n\n## Security contract\n\n- **Never** print or log passwords, TOTP codes, cookies, bearer tokens, refresh tokens, or full DevTools curls in chat, memory, skills, or audit logs.\n- Treat bearer\u002Fcookie values as **ephemeral**: use in memory or a short-lived local temp file (mode 0600) only.\n- If a credential must be passed to a script, use stdin, environment variables, or a secure credential manager — never shell arguments.\n- If API calls return 401, ask the user for a fresh session artifact; do not persist stale tokens.\n\n## Agilize platform overview\n\nAgilize is a Brazilian online accounting\u002Ffinance platform accessed via `https:\u002F\u002Fapp.agilize.com.br\u002F`. Authentication uses **Keycloak\u002FOIDC with PKCE** (Authorization Code flow). The API is REST\u002FJSON under `\u002Fapi\u002Fv1\u002Fcompanies\u002F{company_id}\u002F...`.\n\n### Key endpoints\n\n| Purpose | Endpoint |\n|---|---|\n| Finance transactions | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions?from=...&to=...&sort=mainDate&direction=DESC&count=3000` |\n| Categories (root only) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transaction-categories` — returns only top-level (23 roots). Query params `?tree=true`, `?full=true`, `?includeChildren=true` are ignored. |\n| Categories (with children) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transaction-categories\u002F{rootId}` — returns the root category with full `categoriesChildren` array including sub-category UUIDs, codes, evidence types. Walk recursively to build the complete tree. |\n| Finance accounts | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-accounts` |\n| Closing periods | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Faccounting-closing-periods` |\n| NFS-e by competence | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` |\n| NFS-e XML\u002FZIP import | Working UI flow: `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fpreimportfromresource` → `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources` → `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fimportfromresource`; multipart fields are indexed as `resources[0]`, `resources[1]`, ...; see `references\u002Fagilize-nfse-xml-upload.md`. |\n| Imported NFS-e resource download | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources\u002F{resource_id}\u002Fdownload` — returns original imported package\u002Ffile. |\n| Taxes | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ftaxes?year=YYYY&closed=true&count=3000` |\n| Pro-labore annual | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabore-anual?anoReferencia=YYYY-01-01T00:00:00-0300` |\n| Pro-labore monthly | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabores?competence=YYYY-MM-01T00:00:00-0300&count=3000` |\n| Invoices (Agilize) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Finvoices?competence=...&closed=true&count=3000` |\n| Partners\u002Fpeople | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fpeople?type=partner&count=3000` |\n| Transaction split | `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}\u002Fsplit` |\n| Transaction update | `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}` with `X-HTTP-Method-Override: PUT` |\n| Evidence delete | `DELETE \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}\u002Fevidences\u002F{eid}` |\n| Pro-labore PDF | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabore-anual\u002Fdownload?competence=...&partner=...` |\n\n### Authentication: Keycloak PKCE flow\n\n```\nsso.agilize.com.br\u002Fauth\u002Frealms\u002FAgilizeAPPs\u002Fprotocol\u002Fopenid-connect\u002Fauth\n  → client_id=agilize-legacy-client\n  → redirect_uri=https:\u002F\u002Fapp.agilize.com.br\u002F...\n  → response_mode=fragment, response_type=code, scope=openid\n  → PKCE: code_challenge, code_challenge_method=S256\n\nToken exchange:\n  POST sso.agilize.com.br\u002F...\u002Fprotocol\u002Fopenid-connect\u002Ftoken\n  → grant_type=authorization_code\n  → client_id=agilize-legacy-client\n  → code + code_verifier + redirect_uri\n```\n\nAccess tokens expire in ~10 minutes. For repeated operations, re-authenticate or replay the PKCE flow with valid Keycloak session cookies.\n\nSee `references\u002Fagilize-api-access.md` for the full flow, script usage, and fallback patterns.\n\n### Required API headers\n\n```\nAuthorization: Bearer \u003Caccess_token>\nkey: \u003Ccompany_cnpj>\nReferer: https:\u002F\u002Fapp.agilize.com.br\u002F\nAccept: application\u002Fjson\n```\n\n## Default classification workflow\n\n1. **Authenticate** — run the login script or obtain a session artifact.\n2. **Fetch categories** — `\u002Ffinance-transaction-categories` to get the company's category tree (labels + UUIDs).\n3. **Fetch transactions** — `\u002Ffinance-transactions` for the target period.\n4. **Classify** — assign categories based on bank\u002Fcard descriptions, supplier patterns, and user rules.\n5. **Reconcile evidence** — link NFS-e, tax, invoice, or pro-labore evidence as required by each category.\n6. **Split if needed** — when a single transaction covers multiple expense categories.\n7. **Verify** — re-read transactions and confirm categories, evidence, and split children are correct.\n8. **Report** — produce audit notes with counts, totals, pending items, and rollback instructions.\n\n## NFS-e XML\u002FZIP import workflow\n\nWhen the user has already emitted NFS-e outside Agilize and asks to upload XMLs, use the **legacy 3-step resource flow** (not `importacao-lote-nfes`, which can silently fail with HTTP 201 + `quantidadeNotasProcessadas: 0`):\n\n1. Authenticate with Keycloak\u002FPKCE and extract `company_id` from the JWT `tenant` claim when not configured.\n2. Collect only explicit `.xml` or `.zip` files\u002Fdirectories supplied by the user; compute SHA-256 manifest before upload.\n3. **Upload via legacy resource flow:**\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fpreimportfromresource` with multipart `resources[0]`, `resources[1]`, ...\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources` to create the import resource\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fimportfromresource` with `{\"nfseImportResource\": \"\u003Cresource.__identity>\"}`\n4. Use the standard authenticated API headers documented above (`key`, `Referer`, and JSON `Accept`), keeping bearer tokens redacted in logs and reports.\n5. Verify import — re-read `\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` and confirm the NFS-e appears with correct number, valor, and competence.\n\nIf XMLs are in OneDrive\u002FFile Provider and not visible to the agent filesystem, do not claim access; ask the user for a local accessible path, synced folder, zip, or share link. Do not encode this as a permanent OneDrive limitation — it is usually TCC\u002FFile Provider\u002Faccount setup.\n\nSee `references\u002Fagilize-nfse-xml-upload.md` for exact request shape and discovery notes.\n\n### Post-emission import flow (NFS-e → Agilize)\n\nAfter emitting NFS-e via the municipal portal (or any external system), import the XML into Agilize so it appears in the platform and can be linked as evidence to finance transactions. This is the recommended end-to-end sequence:\n\n1. **Emit NFS-e externally** — use the municipal portal, automated script, or manual process. Confirm emission status (`cStat=100`).\n2. **Obtain the XML** — download from the portal, extract from email\u002FOneDrive, or have the user provide a local path. If the XML comes from OneDrive, use the OneDrive acquisition pattern (Playwright preview → capture `download.aspx` response).\n3. **Validate the XML** — parse each file, confirm root namespace is NFS-e (`http:\u002F\u002Fwww.sped.fazenda.gov.br\u002Fnfse`), emitted status is valid, and the file is not an HTML error page saved with `.xml` extension.\n4. **Authenticate on Agilize** — run the standard Keycloak\u002FPKCE login. Ensure `company_id` and `key` (CNPJ) are configured.\n5. **Upload via legacy resource flow** (preferred over `importacao-lote-nfes` alone):\n   - `POST \u002Fnfses\u002Fpreimportfromresource` with multipart `resources[0]`, `resources[1]`, ...\n   - `POST \u002Fnfseimportresources` to create the import resource\n   - `POST \u002Fnfses\u002Fimportfromresource` with `{\"nfseImportResource\": \"\u003Cresource.__identity>\"}`\n6. **Verify import** — re-read `\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` and confirm the NFS-e appears with correct number, valor, and competence.\n7. **Report results** — list imported NFS-e numbers, amounts, and any failures. Provide the SHA-256 manifest for audit trail.\n\n**When to run this:** typically monthly, after all NFS-e for the competence have been emitted. Can be run per-NF (right after emission) or in batch (all XMLs at once at month-end).\n\n**Pitfall:** `importacao-lote-nfes` may return HTTP 201 with `quantidadeNotasProcessadas: 0` — the legacy 3-step resource flow is more reliable. See `references\u002Fagilize-nfse-xml-upload.md` for details.\n\n## Transaction splitting\n\nWhen a single bank debit (e.g. a credit-card invoice payment) represents multiple underlying expenses, split the parent transaction into child transactions with independent categories and evidence.\n\nPayload shape:\n```json\n{\n  \"splitsDto\": [\n    {\"category\": \"\u003Ccat_uuid>\", \"description\": \"...\", \"amount\": 500.85},\n    {\"category\": \"\u003Ccat_uuid>\", \"description\": \"...\", \"amount\": 136.17}\n  ]\n}\n```\n\n**Important:** the UI sends **positive** split amounts even for expense parents. Child transactions are created with negative amounts when the parent is an expense. The sum of split amounts must equal `abs(parent.amount)`.\n\nSee `references\u002Fagilize-transaction-splitting.md` for the full workflow and verification pattern.\n\n## Evidence integrity rules\n\n### One NFS-e → one transaction\n\nA single NFS-e (`nfse.__identity`) must **never** be linked to more than one finance transaction. Before linking, scan the period for existing references to the same NFS-e.\n\n### Tax evidence\n\nTax-backed categories use `evidence[tax]=\u003Ccompany_tax_uuid>`. The field is **always** `evidence[tax]` regardless of the tax type (DAS, INSS, IRRF, etc.); the category's `allowedEvidenceType` determines the resulting evidence type label.\n\n### Invoice evidence\n\nCategories like `Contabilidade` require `agilizeInvoiceEvidence`. List closed invoices with `\u002Finvoices?competence=...&closed=true` and link the matching one.\n\n### Pro-labore evidence\n\nPro-labore categories (`personRequired=true`, `requiredPersonType=partner`) require both `person=\u003Cpartner_uuid>` and `evidence[prolabore]=\u003Cprolabore_uuid>`. Fetch from `\u002Fprolabores?competence=...` (not `\u002Fprolabore-anual`).\n\nSee `references\u002Fagilize-evidence-integrity.md` for the full pre-link checklist and duplicate-scan pattern.\n\n## Pro-labore vs profit distribution\n\nUse `\u002Fprolabore-anual` to classify owner\u002Fpartner transfers:\n\n1. Find the competence month and partner.\n2. Compare bank transfer to `valorLiquido` (net), not gross `valor`.\n3. If transfer exceeds `valorLiquido`: split → pró-labore (net) + adiantamento de lucro (excess).\n4. Keep INSS\u002FIRRF as separate tax obligations, not as cash paid to the partner.\n\nSee `references\u002Fagilize-prolabore-reconciliation.md` for the full rule set.\n\n## Monthly close checklist\n\nBefore marking a month as closed:\n\n- [ ] All transactions have a category assigned.\n- [ ] No transaction has `hasEvidence == false` when its category requires evidence.\n- [ ] No NFS-e is linked to more than one transaction.\n- [ ] All pro-labore transfers have partner + pro-labore evidence linked.\n- [ ] All tax payments have matching tax evidence.\n- [ ] Card invoice payments are split into individual expenses where applicable.\n- [ ] Totals reconcile (credits + debits + adjustments = expected balance).\n- [ ] No duplicate tax payments (Pix vs card) remain unresolved.\n\nSee `references\u002Fagilize-monthly-close.md` for the full close runbook.\n\n## Bruno API client fallback\n\nWhen bearer tokens expire and replays return 401, create Bruno request files so the user can run them in an authenticated browser context.\n\nSee `references\u002Fagilize-bruno-opencollection.md` and `templates\u002Fagilize-opencollection.yml` + `templates\u002Fagilize-bruno-request.yml`.\n\n## Common Pitfalls\n\n1. **`company_id` left as literal `\"uuid\"` or placeholder.** The verify endpoint returns HTTP 500 (HTML error page, not JSON 404) when the UUID is missing\u002Fmalformed because Agilize resolves the route pattern but fails on the missing entity. Always confirm the config file has the real UUID before running `--verify`. See `references\u002Fagilize-api-access.md` → \"Finding the company_id\".\n\n2. **No company discovery endpoint, but JWT has it.** Agilize does not expose `\u002Fcompanies`, `\u002Fusers\u002Fme\u002Fcompanies`, or any list endpoint — all 404. However, after a successful PKCE login, the JWT `access_token` contains a `tenant` claim (array of UUIDs) with the company ID. Decode the JWT payload (base64url middle segment) and extract `tenant[0]`. Only fall back to DevTools (Network tab) if the JWT claim is absent or the user has multiple companies and the wrong one is first. See `references\u002Fagilize-api-access.md` → \"Finding the company_id\".\n\n3. **Exhaust autonomous discovery before asking user for manual steps.** Before requesting DevTools inspection, cookie exports, or any browser-side action, try: (1) decode JWT claims from the token you already have, (2) probe likely API endpoints, (3) use browser tools to navigate and inspect. Users expect the agent to be self-sufficient — asking for manual browser work when the data is already in the JWT or accessible via script is a friction signal.\n\n4. **Analytics cookies ≠ auth cookies.** Browser cookie exports from `app.agilize.com.br` capture only `_ga_*`, `_hjSession*`, `_dd_s`, `_gid` — none authenticate. Auth cookies (`KEYCLOAK_IDENTITY`, `KEYCLOAK_SESSION`) live on `sso.agilize.com.br`. See `references\u002Fagilize-api-access.md` → \"Cookie pitfall\".\n\n5. **TOTP seed in JSON `null` vs missing.** If a config file has `\"totp_secret\": null`, the key is \"present\" in the JSON mapping but `generate_totp(None)` will crash. The installed script checks `cfg.get(\"totp_secret\")` (truthy, not key-existence) — if you vendor or fork the script, preserve this check.\n\n6. **Sensitive credentials must not be requested in chat.** When setting up the config file or any credential source, prefer asking the user to write the file themselves (or use 1Password \u002F KeePassXC), then signal \"pronto\" or \"atualizei\". Never paste passwords, TOTP seeds, or tokens into a multi-user chat channel.\n\n7. **\"Investimento anjo\" (BR.2.2) is frequently misused for grants and donations.** Angel investment strictly requires equity\u002Fownership counterpart. Grants from international foundations (LUMINATE, Pulitzer, ICFJ, etc.), donations from readers\u002Fsubscribers (Stripe, PIX), and project funding from tech companies (Microsoft, Google) are **not** angel investment — they are taxable revenue without equity. Correct classifications: BR.1.11 Projetos culturais (institutional grants, `genericEvidence`, no NFS-e), BR.1.10 Direito Autoral (reader\u002Fsubscriber donations, `genericEvidence`, no NFS-e), BR.1.2 Prestação de serviço pro exterior (only when there IS a service invoice\u002Fcontract). Always ask the user about the **nature** of the transaction (service vs donation vs grant) before proposing a category — do not assume international payments are service payments. See `references\u002Fagilize-category-classification.md`.\n\n8. **Closed periods block all transaction modifications.** When `isClosedPeriod: true` (visible on every transaction object as `canBeUpdated: false`), the Agilize UI shows \"Período encerrado\" and no creates\u002Fupdates\u002Fdeletes are possible via API or UI. Reclassifying historical data requires reopening the period first — a decision that belongs to the accountant, not the agent. Always check `canBeUpdated` before attempting batch operations on a date range.\n\n9. **Category creation is not exposed via API.** POST to `\u002Ffinance-transaction-categories` returns `PARENT_IS_REQUIRED` regardless of payload structure (`parent`, `parentCategory`, `parentId`, object wrappers, etc.). If a new category is needed (e.g., \"Doações recebidas\"), it must be created through the Agilize web UI manually. Do not waste time trying API variants — use existing categories or ask the user to create one in the UI.\n\n10. **NFS-e XML upload: use legacy 3-step resource flow, not `importacao-lote-nfes` directly.** The `importacao-lote-nfes` endpoint may return HTTP 201 with `quantidadeNotasProcessadas: 0` (silent failure). Instead, use the 3-step flow: `POST \u002Fnfses\u002Fpreimportfromresource` → `POST \u002Fnfseimportresources` → `POST \u002Fnfses\u002Fimportfromresource`. See `references\u002Fagilize-nfse-xml-upload.md` for details.\n\n## Spreadsheet reconciliation\n\nFor auditing Agilize categorization against an external cash-flow spreadsheet (Excel\u002FCSV), use the dedicated match + crosstab workflow. The script `scripts\u002Fagilize_match_spreadsheet.py` runs the full pipeline (download → parse → greedy match → crosstab → report). Full algorithm and pitfalls documented in `references\u002Fagilize-spreadsheet-reconciliation.md`.\n\n```bash\npython scripts\u002Fagilize_match_spreadsheet.py --xlsx ~\u002Fpath\u002Fto\u002Ffluxo.xlsx --year 2025\n```\n\nMatch strategy is greedy on `(month, abs_amount)` with description as tie-breaker; adjacent-month fallback handles consolidation lag. Output: matched\u002Funmatched JSON + crosstab + (optionally) Markdown report. **Diagnostic only** — never apply fixes during the diagnostic pass.\n\n## Output style\n\nFor this domain, respond with concise operational blocks:\n\n- **Diagnóstico** — what is true now.\n- **Arquivos\u002Fartefatos** — paths created\u002Fupdated.\n- **Conciliação** — totals and mismatches.\n- **Pendências** — only the decisions needed to proceed.\n- **Próximo passo** — 1–3 concrete actions.\n\n## References\n\n- `references\u002Fagilize-api-access.md` — Keycloak\u002FOIDC PKCE authentication flow, login script usage, credential manager integration, and fallback patterns.\n- `references\u002Fagilize-transaction-splitting.md` — Transaction split API, category mapping, evidence linking after split, and verification.\n- `references\u002Fagilize-evidence-integrity.md` — NFS-e\u002Ftax\u002Finvoice\u002Fpro-labore evidence rules, duplicate-scan pattern, and pre-link checklist.\n- `references\u002Fagilize-prolabore-reconciliation.md` — Pro-labore annual reference, partner transfer classification, and split rules.\n- `references\u002Fagilize-monthly-close.md` — Monthly close workflow, verification checklist, and audit trail.\n- `references\u002Fagilize-bruno-opencollection.md` — Bruno request format and conversion guide for non-replayable curls.\n- `references\u002Fagilize-nfse-xml-upload.md` — Upload emitted NFS-e XML\u002FZIP files into Agilize via the legacy 3-step resource flow, request shape, verification, and pitfalls.\n- `references\u002Fagilize-spreadsheet-reconciliation.md` — Read-only diagnostic workflow for matching cash-flow spreadsheets against Agilize transactions, with greedy match algorithm, crosstab analysis, and report structure.\n- `references\u002Fagilize-category-classification.md` — Full Agilize category tree (root + sub-categories), revenue classification guide for grants\u002Fdonations\u002Fservices, evidence requirements per category, and the \"Investimento anjo\" misuse pattern.\n- `references\u002Faudit-2025-06-review.md` — Audit findings and pending improvements from the June 2025 review. Includes repo sync status.\n\n## Scripts\n\n- `scripts\u002Fagilize_login.py` — Generic Agilize Keycloak\u002FOIDC PKCE login script. Reads credentials from KeePassXC, environment variables, or a config file. Prints only redacted status metadata. Supports `--verify` and `--api-get` for authenticated reads.\n- `scripts\u002Fagilize_match_spreadsheet.py` — Match a cash-flow spreadsheet (Excel\u002FCSV) against Agilize transactions for diagnostic reconciliation. Greedy `(month, abs_amount)` match with description-scored tie-breaker; outputs matched\u002Funmatched JSON + crosstab.\n- `scripts\u002Fdownload_onedrive_shared_xmls.py` — Download XML files from a public OneDrive shared folder by opening previews and saving the `download.aspx?...tempauth=...` XML responses; useful before NFS-e XML upload.\n\n## Templates\n\n- `templates\u002Fagilize-opencollection.yml` — Bruno OpenCollection root file.\n- `templates\u002Fagilize-bruno-request.yml` — Bruno request template with bearer auth and placeholder variables.\n","# Agilize Contábil Platform Operations\n\nUse this skill when working with the **Agilize** online accounting platform: authenticating, reading\u002Fclassifying finance transactions, splitting transactions, linking NFS-e\u002Ftax\u002Finvoice evidence, reconciling pro-labore, running monthly close checks, and producing audit trails.\n\nThis skill is **company-agnostic**. All company-specific values (company ID, CNPJ, category IDs, partner UUIDs) must be supplied via configuration or runtime parameters — never hard-coded.\n\n## Prerequisites\n\nBefore using this skill, the following must be available:\n\n1. **Agilize credentials** — username, password, and TOTP (if 2FA is enabled), stored in a secure credential manager (KeePassXC, environment variables, or equivalent).\n2. **Company ID** — the Agilize UUID for the target company.\n3. **Company CNPJ** — required as the `key` header for most API calls.\n4. **Hermes profile** — ideally a dedicated finance\u002Fadmin profile with its own credential access.\n\nSee `references\u002Fagilize-api-access.md` for the full authentication pattern.\n\n## Core posture\n\n- Operate as a practical accounting\u002Ffinance specialist, not as a certified accountant.\n- Separate facts, assumptions, estimates, and recommendations.\n- Flag tax\u002Flegal\u002Faccounting uncertainty and recommend accountant validation when material.\n- Do not expose sensitive banking, tax, CPF\u002FCNPJ, account, contract, or supplier details in chat unless necessary and minimized.\n- **Never** execute payments, transfers, filings, account changes, month-close actions, or any irreversible operation without explicit user approval.\n\n## Security contract\n\n- **Never** print or log passwords, TOTP codes, cookies, bearer tokens, refresh tokens, or full DevTools curls in chat, memory, skills, or audit logs.\n- Treat bearer\u002Fcookie values as **ephemeral**: use in memory or a short-lived local temp file (mode 0600) only.\n- If a credential must be passed to a script, use stdin, environment variables, or a secure credential manager — never shell arguments.\n- If API calls return 401, ask the user for a fresh session artifact; do not persist stale tokens.\n\n## Agilize platform overview\n\nAgilize is a Brazilian online accounting\u002Ffinance platform accessed via `https:\u002F\u002Fapp.agilize.com.br\u002F`. Authentication uses **Keycloak\u002FOIDC with PKCE** (Authorization Code flow). The API is REST\u002FJSON under `\u002Fapi\u002Fv1\u002Fcompanies\u002F{company_id}\u002F...`.\n\n### Key endpoints\n\n| Purpose | Endpoint |\n|---|---|\n| Finance transactions | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions?from=...&to=...&sort=mainDate&direction=DESC&count=3000` |\n| Categories (root only) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transaction-categories` — returns only top-level (23 roots). Query params `?tree=true`, `?full=true`, `?includeChildren=true` are ignored. |\n| Categories (with children) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transaction-categories\u002F{rootId}` — returns the root category with full `categoriesChildren` array including sub-category UUIDs, codes, evidence types. Walk recursively to build the complete tree. |\n| Finance accounts | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-accounts` |\n| Closing periods | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Faccounting-closing-periods` |\n| NFS-e by competence | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` |\n| NFS-e XML\u002FZIP import | Working UI flow: `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fpreimportfromresource` → `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources` → `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fimportfromresource`; multipart fields are indexed as `resources[0]`, `resources[1]`, ...; see `references\u002Fagilize-nfse-xml-upload.md`. |\n| Imported NFS-e resource download | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources\u002F{resource_id}\u002Fdownload` — returns original imported package\u002Ffile. |\n| Taxes | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ftaxes?year=YYYY&closed=true&count=3000` |\n| Pro-labore annual | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabore-anual?anoReferencia=YYYY-01-01T00:00:00-0300` |\n| Pro-labore monthly | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabores?competence=YYYY-MM-01T00:00:00-0300&count=3000` |\n| Invoices (Agilize) | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Finvoices?competence=...&closed=true&count=3000` |\n| Partners\u002Fpeople | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fpeople?type=partner&count=3000` |\n| Transaction split | `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}\u002Fsplit` |\n| Transaction update | `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}` with `X-HTTP-Method-Override: PUT` |\n| Evidence delete | `DELETE \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Ffinance-transactions\u002F{tid}\u002Fevidences\u002F{eid}` |\n| Pro-labore PDF | `GET \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fprolabore-anual\u002Fdownload?competence=...&partner=...` |\n\n### Authentication: Keycloak PKCE flow\n\n```\nsso.agilize.com.br\u002Fauth\u002Frealms\u002FAgilizeAPPs\u002Fprotocol\u002Fopenid-connect\u002Fauth\n  → client_id=agilize-legacy-client\n  → redirect_uri=https:\u002F\u002Fapp.agilize.com.br\u002F...\n  → response_mode=fragment, response_type=code, scope=openid\n  → PKCE: code_challenge, code_challenge_method=S256\n\nToken exchange:\n  POST sso.agilize.com.br\u002F...\u002Fprotocol\u002Fopenid-connect\u002Ftoken\n  → grant_type=authorization_code\n  → client_id=agilize-legacy-client\n  → code + code_verifier + redirect_uri\n```\n\nAccess tokens expire in ~10 minutes. For repeated operations, re-authenticate or replay the PKCE flow with valid Keycloak session cookies.\n\nSee `references\u002Fagilize-api-access.md` for the full flow, script usage, and fallback patterns.\n\n### Required API headers\n\n```\nAuthorization: Bearer \u003Caccess_token>\nkey: \u003Ccompany_cnpj>\nReferer: https:\u002F\u002Fapp.agilize.com.br\u002F\nAccept: application\u002Fjson\n```\n\n## Default classification workflow\n\n1. **Authenticate** — run the login script or obtain a session artifact.\n2. **Fetch categories** — `\u002Ffinance-transaction-categories` to get the company's category tree (labels + UUIDs).\n3. **Fetch transactions** — `\u002Ffinance-transactions` for the target period.\n4. **Classify** — assign categories based on bank\u002Fcard descriptions, supplier patterns, and user rules.\n5. **Reconcile evidence** — link NFS-e, tax, invoice, or pro-labore evidence as required by each category.\n6. **Split if needed** — when a single transaction covers multiple expense categories.\n7. **Verify** — re-read transactions and confirm categories, evidence, and split children are correct.\n8. **Report** — produce audit notes with counts, totals, pending items, and rollback instructions.\n\n## NFS-e XML\u002FZIP import workflow\n\nWhen the user has already emitted NFS-e outside Agilize and asks to upload XMLs, use the **legacy 3-step resource flow** (not `importacao-lote-nfes`, which can silently fail with HTTP 201 + `quantidadeNotasProcessadas: 0`):\n\n1. Authenticate with Keycloak\u002FPKCE and extract `company_id` from the JWT `tenant` claim when not configured.\n2. Collect only explicit `.xml` or `.zip` files\u002Fdirectories supplied by the user; compute SHA-256 manifest before upload.\n3. **Upload via legacy resource flow:**\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fpreimportfromresource` with multipart `resources[0]`, `resources[1]`, ...\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfseimportresources` to create the import resource\n   - `POST \u002Fapi\u002Fv1\u002Fcompanies\u002F{cid}\u002Fnfses\u002Fimportfromresource` with `{\"nfseImportResource\": \"\u003Cresource.__identity>\"}`\n4. Use the standard authenticated API headers documented above (`key`, `Referer`, and JSON `Accept`), keeping bearer tokens redacted in logs and reports.\n5. Verify import — re-read `\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` and confirm the NFS-e appears with correct number, valor, and competence.\n\nIf XMLs are in OneDrive\u002FFile Provider and not visible to the agent filesystem, do not claim access; ask the user for a local accessible path, synced folder, zip, or share link. Do not encode this as a permanent OneDrive limitation — it is usually TCC\u002FFile Provider\u002Faccount setup.\n\nSee `references\u002Fagilize-nfse-xml-upload.md` for exact request shape and discovery notes.\n\n### Post-emission import flow (NFS-e → Agilize)\n\nAfter emitting NFS-e via the municipal portal (or any external system), import the XML into Agilize so it appears in the platform and can be linked as evidence to finance transactions. This is the recommended end-to-end sequence:\n\n1. **Emit NFS-e externally** — use the municipal portal, automated script, or manual process. Confirm emission status (`cStat=100`).\n2. **Obtain the XML** — download from the portal, extract from email\u002FOneDrive, or have the user provide a local path. If the XML comes from OneDrive, use the OneDrive acquisition pattern (Playwright preview → capture `download.aspx` response).\n3. **Validate the XML** — parse each file, confirm root namespace is NFS-e (`http:\u002F\u002Fwww.sped.fazenda.gov.br\u002Fnfse`), emitted status is valid, and the file is not an HTML error page saved with `.xml` extension.\n4. **Authenticate on Agilize** — run the standard Keycloak\u002FPKCE login. Ensure `company_id` and `key` (CNPJ) are configured.\n5. **Upload via legacy resource flow** (preferred over `importacao-lote-nfes` alone):\n   - `POST \u002Fnfses\u002Fpreimportfromresource` with multipart `resources[0]`, `resources[1]`, ...\n   - `POST \u002Fnfseimportresources` to create the import resource\n   - `POST \u002Fnfses\u002Fimportfromresource` with `{\"nfseImportResource\": \"\u003Cresource.__identity>\"}`\n6. **Verify import** — re-read `\u002Fnfses?competencia=YYYY-MM-01T00:00:00&count=3000` and confirm the NFS-e appears with correct number, valor, and competence.\n7. **Report results** — list imported NFS-e numbers, amounts, and any failures. Provide the SHA-256 manifest for audit trail.\n\n**When to run this:** typically monthly, after all NFS-e for the competence have been emitted. Can be run per-NF (right after emission) or in batch (all XMLs at once at month-end).\n\n**Pitfall:** `importacao-lote-nfes` may return HTTP 201 with `quantidadeNotasProcessadas: 0` — the legacy 3-step resource flow is more reliable. See `references\u002Fagilize-nfse-xml-upload.md` for details.\n\n## Transaction splitting\n\nWhen a single bank debit (e.g. a credit-card invoice payment) represents multiple underlying expenses, split the parent transaction into child transactions with independent categories and evidence.\n\nPayload shape:\n```json\n{\n  \"splitsDto\": [\n    {\"category\": \"\u003Ccat_uuid>\", \"description\": \"...\", \"amount\": 500.85},\n    {\"category\": \"\u003Ccat_uuid>\", \"description\": \"...\", \"amount\": 136.17}\n  ]\n}\n```\n\n**Important:** the UI sends **positive** split amounts even for expense parents. Child transactions are created with negative amounts when the parent is an expense. The sum of split amounts must equal `abs(parent.amount)`.\n\nSee `references\u002Fagilize-transaction-splitting.md` for the full workflow and verification pattern.\n\n## Evidence integrity rules\n\n### One NFS-e → one transaction\n\nA single NFS-e (`nfse.__identity`) must **never** be linked to more than one finance transaction. Before linking, scan the period for existing references to the same NFS-e.\n\n### Tax evidence\n\nTax-backed categories use `evidence[tax]=\u003Ccompany_tax_uuid>`. The field is **always** `evidence[tax]` regardless of the tax type (DAS, INSS, IRRF, etc.); the category's `allowedEvidenceType` determines the resulting evidence type label.\n\n### Invoice evidence\n\nCategories like `Contabilidade` require `agilizeInvoiceEvidence`. List closed invoices with `\u002Finvoices?competence=...&closed=true` and link the matching one.\n\n### Pro-labore evidence\n\nPro-labore categories (`personRequired=true`, `requiredPersonType=partner`) require both `person=\u003Cpartner_uuid>` and `evidence[prolabore]=\u003Cprolabore_uuid>`. Fetch from `\u002Fprolabores?competence=...` (not `\u002Fprolabore-anual`).\n\nSee `references\u002Fagilize-evidence-integrity.md` for the full pre-link checklist and duplicate-scan pattern.\n\n## Pro-labore vs profit distribution\n\nUse `\u002Fprolabore-anual` to classify owner\u002Fpartner transfers:\n\n1. Find the competence month and partner.\n2. Compare bank transfer to `valorLiquido` (net), not gross `valor`.\n3. If transfer exceeds `valorLiquido`: split → pró-labore (net) + adiantamento de lucro (excess).\n4. Keep INSS\u002FIRRF as separate tax obligations, not as cash paid to the partner.\n\nSee `references\u002Fagilize-prolabore-reconciliation.md` for the full rule set.\n\n## Monthly close checklist\n\nBefore marking a month as closed:\n\n- [ ] All transactions have a category assigned.\n- [ ] No transaction has `hasEvidence == false` when its category requires evidence.\n- [ ] No NFS-e is linked to more than one transaction.\n- [ ] All pro-labore transfers have partner + pro-labore evidence linked.\n- [ ] All tax payments have matching tax evidence.\n- [ ] Card invoice payments are split into individual expenses where applicable.\n- [ ] Totals reconcile (credits + debits + adjustments = expected balance).\n- [ ] No duplicate tax payments (Pix vs card) remain unresolved.\n\nSee `references\u002Fagilize-monthly-close.md` for the full close runbook.\n\n## Bruno API client fallback\n\nWhen bearer tokens expire and replays return 401, create Bruno request files so the user can run them in an authenticated browser context.\n\nSee `references\u002Fagilize-bruno-opencollection.md` and `templates\u002Fagilize-opencollection.yml` + `templates\u002Fagilize-bruno-request.yml`.\n\n## Common Pitfalls\n\n1. **`company_id` left as literal `\"uuid\"` or placeholder.** The verify endpoint returns HTTP 500 (HTML error page, not JSON 404) when the UUID is missing\u002Fmalformed because Agilize resolves the route pattern but fails on the missing entity. Always confirm the config file has the real UUID before running `--verify`. See `references\u002Fagilize-api-access.md` → \"Finding the company_id\".\n\n2. **No company discovery endpoint, but JWT has it.** Agilize does not expose `\u002Fcompanies`, `\u002Fusers\u002Fme\u002Fcompanies`, or any list endpoint — all 404. However, after a successful PKCE login, the JWT `access_token` contains a `tenant` claim (array of UUIDs) with the company ID. Decode the JWT payload (base64url middle segment) and extract `tenant[0]`. Only fall back to DevTools (Network tab) if the JWT claim is absent or the user has multiple companies and the wrong one is first. See `references\u002Fagilize-api-access.md` → \"Finding the company_id\".\n\n3. **Exhaust autonomous discovery before asking user for manual steps.** Before requesting DevTools inspection, cookie exports, or any browser-side action, try: (1) decode JWT claims from the token you already have, (2) probe likely API endpoints, (3) use browser tools to navigate and inspect. Users expect the agent to be self-sufficient — asking for manual browser work when the data is already in the JWT or accessible via script is a friction signal.\n\n4. **Analytics cookies ≠ auth cookies.** Browser cookie exports from `app.agilize.com.br` capture only `_ga_*`, `_hjSession*`, `_dd_s`, `_gid` — none authenticate. Auth cookies (`KEYCLOAK_IDENTITY`, `KEYCLOAK_SESSION`) live on `sso.agilize.com.br`. See `references\u002Fagilize-api-access.md` → \"Cookie pitfall\".\n\n5. **TOTP seed in JSON `null` vs missing.** If a config file has `\"totp_secret\": null`, the key is \"present\" in the JSON mapping but `generate_totp(None)` will crash. The installed script checks `cfg.get(\"totp_secret\")` (truthy, not key-existence) — if you vendor or fork the script, preserve this check.\n\n6. **Sensitive credentials must not be requested in chat.** When setting up the config file or any credential source, prefer asking the user to write the file themselves (or use 1Password \u002F KeePassXC), then signal \"pronto\" or \"atualizei\". Never paste passwords, TOTP seeds, or tokens into a multi-user chat channel.\n\n7. **\"Investimento anjo\" (BR.2.2) is frequently misused for grants and donations.** Angel investment strictly requires equity\u002Fownership counterpart. Grants from international foundations (LUMINATE, Pulitzer, ICFJ, etc.), donations from readers\u002Fsubscribers (Stripe, PIX), and project funding from tech companies (Microsoft, Google) are **not** angel investment — they are taxable revenue without equity. Correct classifications: BR.1.11 Projetos culturais (institutional grants, `genericEvidence`, no NFS-e), BR.1.10 Direito Autoral (reader\u002Fsubscriber donations, `genericEvidence`, no NFS-e), BR.1.2 Prestação de serviço pro exterior (only when there IS a service invoice\u002Fcontract). Always ask the user about the **nature** of the transaction (service vs donation vs grant) before proposing a category — do not assume international payments are service payments. See `references\u002Fagilize-category-classification.md`.\n\n8. **Closed periods block all transaction modifications.** When `isClosedPeriod: true` (visible on every transaction object as `canBeUpdated: false`), the Agilize UI shows \"Período encerrado\" and no creates\u002Fupdates\u002Fdeletes are possible via API or UI. Reclassifying historical data requires reopening the period first — a decision that belongs to the accountant, not the agent. Always check `canBeUpdated` before attempting batch operations on a date range.\n\n9. **Category creation is not exposed via API.** POST to `\u002Ffinance-transaction-categories` returns `PARENT_IS_REQUIRED` regardless of payload structure (`parent`, `parentCategory`, `parentId`, object wrappers, etc.). If a new category is needed (e.g., \"Doações recebidas\"), it must be created through the Agilize web UI manually. Do not waste time trying API variants — use existing categories or ask the user to create one in the UI.\n\n10. **NFS-e XML upload: use legacy 3-step resource flow, not `importacao-lote-nfes` directly.** The `importacao-lote-nfes` endpoint may return HTTP 201 with `quantidadeNotasProcessadas: 0` (silent failure). Instead, use the 3-step flow: `POST \u002Fnfses\u002Fpreimportfromresource` → `POST \u002Fnfseimportresources` → `POST \u002Fnfses\u002Fimportfromresource`. See `references\u002Fagilize-nfse-xml-upload.md` for details.\n\n## Spreadsheet reconciliation\n\nFor auditing Agilize categorization against an external cash-flow spreadsheet (Excel\u002FCSV), use the dedicated match + crosstab workflow. The script `scripts\u002Fagilize_match_spreadsheet.py` runs the full pipeline (download → parse → greedy match → crosstab → report). Full algorithm and pitfalls documented in `references\u002Fagilize-spreadsheet-reconciliation.md`.\n\n```bash\npython scripts\u002Fagilize_match_spreadsheet.py --xlsx ~\u002Fpath\u002Fto\u002Ffluxo.xlsx --year 2025\n```\n\nMatch strategy is greedy on `(month, abs_amount)` with description as tie-breaker; adjacent-month fallback handles consolidation lag. Output: matched\u002Funmatched JSON + crosstab + (optionally) Markdown report. **Diagnostic only** — never apply fixes during the diagnostic pass.\n\n## Output style\n\nFor this domain, respond with concise operational blocks:\n\n- **Diagnóstico** — what is true now.\n- **Arquivos\u002Fartefatos** — paths created\u002Fupdated.\n- **Conciliação** — totals and mismatches.\n- **Pendências** — only the decisions needed to proceed.\n- **Próximo passo** — 1–3 concrete actions.\n\n## References\n\n- `references\u002Fagilize-api-access.md` — Keycloak\u002FOIDC PKCE authentication flow, login script usage, credential manager integration, and fallback patterns.\n- `references\u002Fagilize-transaction-splitting.md` — Transaction split API, category mapping, evidence linking after split, and verification.\n- `references\u002Fagilize-evidence-integrity.md` — NFS-e\u002Ftax\u002Finvoice\u002Fpro-labore evidence rules, duplicate-scan pattern, and pre-link checklist.\n- `references\u002Fagilize-prolabore-reconciliation.md` — Pro-labore annual reference, partner transfer classification, and split rules.\n- `references\u002Fagilize-monthly-close.md` — Monthly close workflow, verification checklist, and audit trail.\n- `references\u002Fagilize-bruno-opencollection.md` — Bruno request format and conversion guide for non-replayable curls.\n- `references\u002Fagilize-nfse-xml-upload.md` — Upload emitted NFS-e XML\u002FZIP files into Agilize via the legacy 3-step resource flow, request shape, verification, and pitfalls.\n- `references\u002Fagilize-spreadsheet-reconciliation.md` — Read-only diagnostic workflow for matching cash-flow spreadsheets against Agilize transactions, with greedy match algorithm, crosstab analysis, and report structure.\n- `references\u002Fagilize-category-classification.md` — Full Agilize category tree (root + sub-categories), revenue classification guide for grants\u002Fdonations\u002Fservices, evidence requirements per category, and the \"Investimento anjo\" misuse pattern.\n- `references\u002Faudit-2025-06-review.md` — Audit findings and pending improvements from the June 2025 review. Includes repo sync status.\n\n## Scripts\n\n- `scripts\u002Fagilize_login.py` — Generic Agilize Keycloak\u002FOIDC PKCE login script. Reads credentials from KeePassXC, environment variables, or a config file. Prints only redacted status metadata. Supports `--verify` and `--api-get` for authenticated reads.\n- `scripts\u002Fagilize_match_spreadsheet.py` — Match a cash-flow spreadsheet (Excel\u002FCSV) against Agilize transactions for diagnostic reconciliation. Greedy `(month, abs_amount)` match with description-scored tie-breaker; outputs matched\u002Funmatched JSON + crosstab.\n- `scripts\u002Fdownload_onedrive_shared_xmls.py` — Download XML files from a public OneDrive shared folder by opening previews and saving the `download.aspx?...tempauth=...` XML responses; useful before NFS-e XML upload.\n\n## Templates\n\n- `templates\u002Fagilize-opencollection.yml` — Bruno OpenCollection root file.\n- `templates\u002Fagilize-bruno-request.yml` — Bruno request template with bearer auth and placeholder variables.\n",{"name":5,"author":24,"license":15,"version":25,"metadata":26,"description":7},"Hermes Agent","1.0.0",{"hermes":27},{"tags":28},[29,30,31,32,33,34,35],"agilize","accounting","bookkeeping","reconciliation","nfse","pro-labore","brazilian-accounting","main","b5c05537c2a696d4f96f17b51e5e2951fcab8f5b","skills\u002Fproductivity\u002Fagilize-contabil-ops","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills","https:\u002F\u002Fgithub.com\u002Ffmercurio","2026-11-07 04:26:06",{"source":8,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add fmercurio\u002Fclawdia-custom-skills --skill agilize-contabil-ops",{"tool":48,"command":49},"bunx","bunx skills add fmercurio\u002Fclawdia-custom-skills --skill agilize-contabil-ops",{"tool":51,"command":52},"pnpm","pnpm dlx skills add fmercurio\u002Fclawdia-custom-skills --skill agilize-contabil-ops","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002FSKILL.md",true,[56,62,68,72,76,80,84,88,92,96,100,104,108,114,118,122,126,130,134,138,142],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},".gitignore","OTHER","其他",171,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002F.gitignore",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"CHANGELOG.md","REFERENCE","参考文档",798,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002FCHANGELOG.md",{"path":69,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fagilize-api-access.md",10602,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-api-access.md",{"path":73,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":74,"sourceHtmlUrl":75},"references\u002Fagilize-bruno-opencollection.md",2366,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-bruno-opencollection.md",{"path":77,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fagilize-category-classification.md",6071,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-category-classification.md",{"path":81,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fagilize-evidence-integrity.md",5853,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-evidence-integrity.md",{"path":85,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fagilize-monthly-close.md",4313,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-monthly-close.md",{"path":89,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fagilize-nfse-xml-upload.md",6372,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-nfse-xml-upload.md",{"path":93,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fagilize-prolabore-reconciliation.md",3652,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-prolabore-reconciliation.md",{"path":97,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fagilize-spreadsheet-reconciliation.md",7725,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-spreadsheet-reconciliation.md",{"path":101,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fagilize-transaction-splitting.md",5332,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Fagilize-transaction-splitting.md",{"path":105,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Faudit-2025-06-review.md",2225,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Freferences\u002Faudit-2025-06-review.md",{"path":109,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":112,"sourceHtmlUrl":113},"scripts\u002Fagilize_login.py","SCRIPT","脚本",23927,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Fscripts\u002Fagilize_login.py",{"path":115,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":116,"sourceHtmlUrl":117},"scripts\u002Fagilize_match_spreadsheet.py",25815,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Fscripts\u002Fagilize_match_spreadsheet.py",{"path":119,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":120,"sourceHtmlUrl":121},"scripts\u002Fdownload_onedrive_shared_xmls.py",14402,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Fscripts\u002Fdownload_onedrive_shared_xmls.py",{"path":123,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":124,"sourceHtmlUrl":125},"templates\u002Fagilize-bruno-request.yml",715,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftemplates\u002Fagilize-bruno-request.yml",{"path":127,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":128,"sourceHtmlUrl":129},"templates\u002Fagilize-opencollection.yml",127,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftemplates\u002Fagilize-opencollection.yml",{"path":131,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":132,"sourceHtmlUrl":133},"tests\u002Ftest_agilize_api_get.py",7944,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftests\u002Ftest_agilize_api_get.py",{"path":135,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":136,"sourceHtmlUrl":137},"tests\u002Ftest_bruno_reference_security.py",781,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftests\u002Ftest_bruno_reference_security.py",{"path":139,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":140,"sourceHtmlUrl":141},"tests\u002Ftest_reference_security_contracts.py",2025,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftests\u002Ftest_reference_security_contracts.py",{"path":143,"resourceType":110,"resourceTypeDesc":111,"sizeBytes":144,"sourceHtmlUrl":145},"tests\u002Ftest_sensitive_artifacts.py",21677,"https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fagilize-contabil-ops\u002Ftests\u002Ftest_sensitive_artifacts.py",[147,154,160,166,172,177],{"skillNo":148,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":19},"01M75BDD9N7RSFBWGDNTZK9NYT","overlay-skill","Fixture skill for deployment planner tests.","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fskills\u002Fproductivity\u002Foverlay-skill\u002FSKILL.md",[],[],{"skillNo":155,"name":156,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":19},"01M75BDAV2X86DYXADGV8B1ZCZ","candidate-skill","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fskills\u002Fproductivity\u002Fcandidate-skill\u002FSKILL.md",[],[],{"skillNo":161,"name":162,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"01M75BD9NPF9EKPHAZMBVDM8GN","builtin-collision","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fskills\u002Fproductivity\u002Fbuiltin-collision\u002FSKILL.md",[],[],{"skillNo":167,"name":168,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":19},"01M75BD7NV55ZMQVC0GY7FSG2F","approved-global","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fskills\u002Fproductivity\u002Fapproved-global\u002FSKILL.md",[],[],{"skillNo":173,"name":168,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":19},"01M75BD54973NF4BHPZR3F4Z8A","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fskills\u002Fproductivity\u002Fapproved-global-duplicate\u002FSKILL.md",[],[],{"skillNo":178,"name":149,"nameZh":6,"description":150,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":181,"publishedAt":19},"01M75BD2N1FJZ142MYPJ19R29Z","https:\u002F\u002Fgithub.com\u002Ffmercurio\u002Fclawdia-custom-skills\u002Fblob\u002Fmain\u002Ftools\u002Fskill_deploy\u002Ftests\u002Ffixtures\u002Fworkspace\u002Fruntime\u002Fskills\u002Fproductivity\u002Foverlay-skill\u002FSKILL.md",[],[]]