# Doctor

> Preflight-check konfiguracji JDG przed wysyłką faktur / JPK do sandboxów. Sprawdza dane sprzedawcy, KSeF, bramkę MF, SMTP, OCR, Google Calendar. Użyj gdy user pyta "czy wszystko skonfigurowane", "diagnostyka", "preflight", "co mam brak", "czy działa konfiguracja", "audyt setupu".

- **Type:** Skill
- **Install:** `agentstack add skill-dithiothreitol-jdg-ksiegowy-doctor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dithiothreitol](https://agentstack.voostack.com/s/dithiothreitol)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dithiothreitol](https://github.com/dithiothreitol)
- **Source:** https://github.com/dithiothreitol/jdg-ksiegowy/tree/main/.claude/skills/doctor

## Install

```sh
agentstack add skill-dithiothreitol-jdg-ksiegowy-doctor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Doctor — sprawdzanie konfiguracji

Waliduje `.env` i obecność plików (certyfikaty, klucze) przed wysyłką do KSeF/MF. Nie dotyka sieci.

## Wywołanie

```bash
# Raport tekstowy
python3 skills/doctor/scripts/check.py

# Format JSON
python3 skills/doctor/scripts/check.py --format json

# Exit code != 0 gdy są błędy (do CI)
python3 skills/doctor/scripts/check.py --fail-on-error
```

## Co sprawdza

**[SELLER]** — dane sprzedawcy z `.env`:
- `SELLER_NIP` (z walidacją sumy kontrolnej)
- `SELLER_NAME`, `SELLER_ADDRESS`, `SELLER_BANK_ACCOUNT/NAME`
- `SELLER_EMAIL`, `SELLER_FIRST_NAME/LAST_NAME`, `SELLER_BIRTH_DATE`, `SELLER_TAX_OFFICE_CODE` (dla JPK)

**[KSEF]**:
- `KSEF_ENV` (test/demo/prod), pochodny URL API
- `KSEF_NIP` + `KSEF_TOKEN`

**[MF]** (bramka JPK):
- `MF_ENV` (test/prod), pochodny URL
- `MF_PESEL` (z walidacją), `MF_CERT_PATH`/`MF_CERT_URL`

**[SMTP]** — wysyłka email (opcjonalne):
- `SMTP_HOST`, `SMTP_USERNAME`, `SMTP_PASSWORD`

**[OCR]** — provider i klucze:
- `OCR_PROVIDER` (auto/ollama/claude), `ANTHROPIC_API_KEY` jeśli claude

## Poziomy

- **OK** — obszar gotowy
- **WARN** — brak nieblokujący (np. SMTP) — część funkcjonalności niedostępna
- **ERROR** — krytyczny — wysyłka zadziała dopiero po naprawie

## Flow po doctor

Jeśli wszystko OK → możesz ruszać z wysyłkami:
```bash
# Dry-run na sandboxie KSeF
python3 skills/ksef/scripts/submit.py --dry-run --invoice-file faktury/A1.xml

# Dry-run JPK (sandbox MF)
python3 skills/jpk-submit/scripts/submit.py --dry-run data/jpk/JPK_V7M_04_2026.xml
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dithiothreitol](https://github.com/dithiothreitol)
- **Source:** [dithiothreitol/jdg-ksiegowy](https://github.com/dithiothreitol/jdg-ksiegowy)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** yes
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dithiothreitol-jdg-ksiegowy-doctor
- Seller: https://agentstack.voostack.com/s/dithiothreitol
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
