用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/nicolastakashi/skills --skill efaturas命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | efaturas |
| description | Auto-classify Portugal e-Fatura invoices using agent-browser with configurable debugging |
| compatibility | Requires internet access and agent-browser access to Portal das Finanças. |
| allowed-tools | agent-browser |
| metadata | {"author":"nicolastakashi","version":"1.0","last_updated":"2026-02-10"} |
I automate the classification of invoices in Portugal's e-Fatura portal (Portal das Finanças) to maximize tax deductions. I use agent-browser to navigate the portal, fetch pending invoices, classify them based on merchant history and optional CAE hints, and generate JSON reports.
Use this when you need to:
You must provide at runtime:
The agent MUST follow this skill exactly. Do not infer or invent steps.
Outro and set needs_review: true.merchant_profiles.json categories with CAE hints or UI heuristics.live-run unless the user explicitly requests it in the same session.efatura.confidence_thresholds.auto_classify, do not apply any classification in the UI.All settings must be under efatura.* in config.json. Use assets/config.example.json as a template.
{
"efatura": {
"url": "https://faturas.portaldasfinancas.gov.pt/home.action",
"mode": "dry-run",
"confidence_thresholds": {
"auto_classify": 80,
"flag_review": 60
},
"reports": {
"path": "reports/",
"include_low_confidence": true
},
"learning": {
"min_samples_for_confidence": 3,
"max_history_per_merchant": 10
},
"agent_browser": {
"headed": false,
url: Portal URLmode: dry-run (report only) or live-run (save classifications)confidence_thresholds.auto_classify: Minimum confidence to auto-apply classificationconfidence_thresholds.flag_review: Threshold below which items are flagged for reviewreports.path: Output directory for reports (relative to skill root)reports.include_low_confidence: Include low-confidence rows in report outputlearning.min_samples_for_confidence: Samples required before scoring confidencelearning.max_history_per_merchant: Max history entries to retain per merchantagent_browser.headed: Show browser window for debuggingagent_browser.debug: Enable debug outputagent_browser.trace_on_failure: Capture trace on erroragent_browser.profile_path: Optional persistent profile pathcae_hints: Map of CAE codes to categories (grows over time)Use this exact order and stop at the first match:
merchant_nif exists in merchant_profiles.json, use most_likely_category.cae_code exists and efatura.cae_hints contains it, use that category.Outro and set needs_review: true.Confidence rules:
Auto-apply rule:
confidence >= efatura.confidence_thresholds.auto_classify.needs_review: true, and include the candidate category in the report only.config.json: Runtime configurationmerchant_profiles.json: Authoritative merchant history and category mappingassets/config.example.json: Safe template configurationassets/merchant_profiles.sample.json: Minimal merchant profile templatereferences/REFERENCE.md: Examples, debug recipes, and reference materialUse exact category labels consistently across merchant_profiles.json, cae_hints, and report output. Do not change casing or accents.
OutroDespesas gerais familiaresDespesas VeterináriasAlojamento, restauração e similaresGinásiosSaúdeEducaçãoReparação automóveisIf the portal displays a different label, update all sources to match that exact UI label.
dry-run unless the user explicitly requests live-run in this session.agent-browser open <efatura.url>
efatura.agent_browser.headed is true, add --headed (otherwise omit it)efatura.agent_browser.debug is true, add --debug (otherwise omit it)efatura.confidence_thresholds.auto_classify, do not apply any UI classification for this invoiceSee references/REFERENCE.md for operational notes and portal behaviors.
When the portal prompts: "Pretende atribuir o mesmo setor (X) às faturas da página com o NIF emitente Y?"
Always click "Todas" (All) button to apply classification to all invoices from the same merchant at once.
Detection: Look for dialog with heading "Aviso" containing text about "NIF emitente" and buttons "Todas" / "Apenas esta".
Generate JSON report with:
{
"run_id": "timestamp",
"mode": "dry-run|live-run",
"period": "date-range",
"summary": {
"total_invoices": 0,
"auto_classified": 0,
"flagged_for_review": 0,
"batch_applied": 0
},
"invoices": [
{
"merchant_nif": "string",
"merchant_name": "string",
"cae_code": "string|null",
"date": "ISO-date",
"amount": 0.00,
"category"
When efatura.agent_browser.debug is true or on failure:
efatura.agent_browser.headed for whether the browser is visible
efatura.agent_browser.headed is false, temporarily set it to true (or add --headed when opening)agent-browser trace start <trace-path>agent-browser screenshot <screenshot-path>agent-browser consoleagent-browser errorsagent-browser trace stop <trace-path>Debug artifact checklist:
On any failure:
See references/REFERENCE.md for sample prompts, configuration examples, and report output.
See references/REFERENCE.md for common failures, selector drift handling, and debug workflows.