add 3 dolibarr-* skills: tva-reconciliation, recurring-templates, data-snapshot #3

Merged
arcodange merged 1 commits from claude/dolibarr-tva-recurring-snapshot into main 2026-05-29 00:10:54 +02:00
Owner

Summary

V3 in the dolibarr-* family — three sibling skills bundled into one PR (they ship together: the snapshot consumes the same endpoints the others surface, and tva + recurring inform each other for the cohort review).

dolibarr-tva-reconciliation/

Monthly TVA basis preparation for CA3 / CA12 declarations.

  • tva-by-month.sh — HT + TVA grouped by (year-month × tva_tx), ready to transcribe.
  • tva-line-detail.sh — per-line audit trail with the country-based CA3 bucket assignment (A1 domestic / A4 intra-UE autoliquidation / E2 export hors UE).
  • Live baseline: every Arcodange line is E2 export hors UE, basis 8 160 €, TVA collectée 0 € — consistent with the autoliquidation 259-1° CGI posture for KissMetrics.

dolibarr-recurring-templates/

Inspect Dolibarr modèles de factures récurrentes.

  • list-templates.sh — probes /invoices/templates/{id} (no list endpoint exists) and stops after 5 consecutive empty responses.
  • inspect-template.sh — full audit with health checks.

Major finding to surface to the cohort review: the "Kiss Metrics Invoice" template has frequency=0 and nb_gen_done=0. It is NOT auto-firing. Every KM invoice today (FAC002, FAC003) was manually duplicated. The deferred 9-month cycle depends on Gabriel clicking "Generate" each month, not on a Dolibarr cron.

Health checks:
    [!!] frequency=0 — template is NOT auto-generating; every child was created manually
    [!!] nb_gen_done=0 but 2 child invoice(s) match by note — they were duplicated, not auto-generated

dolibarr-data-snapshot/

Point-in-time JSON dump of the read-only Dolibarr state.

  • snapshot.sh — bundles status + thirdparties + invoices + payments + recurring templates + products + bank accounts.
  • content_hash is sha256 of data only (excluding captured_at + metadata) → two snapshots of identical state hash identically → drift detection is one comparison.
  • V1 baseline: ~246 KB JSON, content_hash sha256:6b94cd31…, 10 thirdparties / 5 invoices / 1 template / 2 products / 3 bank accounts.
  • The actual JSON file is intentionally not committed (~246 KB, would bloat the repo); a structural summary lives at examples/snapshot-summary.txt.

Base skill changes

dolibarr/SKILL.md endpoint catalogue gains /invoices/templates/{id} (with the no-list-endpoint quirk and the id=null sentinel for missing ids) and a Pointers section pointing at all 3 new siblings.

Two new captured examples: invoice_template_km.json, products_list.json.

Test plan

  • tva-by-month.sh → 8 160 € basis, 0 € TVA, two months (2026-01 510 €, 2026-02 7 650 €).
  • tva-line-detail.sh → 5 lines all in E2 bucket.
  • list-templates.sh → finds 1 template (Kiss Metrics Invoice).
  • inspect-template.sh 1 → exit 1 with 2 health issues (frequency=0, manual duplications detected).
  • snapshot.sh --out /tmp/s1.json && snapshot.sh --out /tmp/s2.json && jq -r .content_hash /tmp/s*.json → both identical.
  • No credentials in the diff (git diff --cached | grep -F <api-key> empty).

What's next (V4 candidates)

  • dolibarr-thirdparty-completeness — generalize audit-km-thirdparty.sh for any socid.
  • dolibarr-tva-deductible — supplier-side TVA via /supplierinvoices once Arcodange logs them.
  • arcodange-k8s, arcodange-backups, arcodange-bank-reco — operational siblings outside the Dolibarr-API perimeter.
## Summary V3 in the `dolibarr-*` family — three sibling skills bundled into one PR (they ship together: the snapshot consumes the same endpoints the others surface, and tva + recurring inform each other for the cohort review). ### `dolibarr-tva-reconciliation/` Monthly TVA basis preparation for CA3 / CA12 declarations. - `tva-by-month.sh` — HT + TVA grouped by `(year-month × tva_tx)`, ready to transcribe. - `tva-line-detail.sh` — per-line audit trail with the country-based CA3 bucket assignment (**A1** domestic / **A4** intra-UE autoliquidation / **E2** export hors UE). - Live baseline: every Arcodange line is **E2 export hors UE**, basis 8 160 €, TVA collectée 0 € — consistent with the autoliquidation 259-1° CGI posture for KissMetrics. ### `dolibarr-recurring-templates/` Inspect Dolibarr modèles de factures récurrentes. - `list-templates.sh` — probes `/invoices/templates/{id}` (no list endpoint exists) and stops after 5 consecutive empty responses. - `inspect-template.sh` — full audit with health checks. **Major finding to surface to the cohort review**: the "Kiss Metrics Invoice" template has `frequency=0` and `nb_gen_done=0`. **It is NOT auto-firing.** Every KM invoice today (FAC002, FAC003) was manually duplicated. The deferred 9-month cycle depends on Gabriel clicking "Generate" each month, not on a Dolibarr cron. ``` Health checks: [!!] frequency=0 — template is NOT auto-generating; every child was created manually [!!] nb_gen_done=0 but 2 child invoice(s) match by note — they were duplicated, not auto-generated ``` ### `dolibarr-data-snapshot/` Point-in-time JSON dump of the read-only Dolibarr state. - `snapshot.sh` — bundles status + thirdparties + invoices + payments + recurring templates + products + bank accounts. - **`content_hash`** is sha256 of `data` only (excluding `captured_at` + metadata) → two snapshots of identical state hash identically → drift detection is one comparison. - V1 baseline: ~246 KB JSON, content_hash `sha256:6b94cd31…`, 10 thirdparties / 5 invoices / 1 template / 2 products / 3 bank accounts. - The actual JSON file is intentionally not committed (~246 KB, would bloat the repo); a structural summary lives at [examples/snapshot-summary.txt](.claude/skills/dolibarr-data-snapshot/examples/snapshot-summary.txt). ### Base skill changes `dolibarr/SKILL.md` endpoint catalogue gains `/invoices/templates/{id}` (with the no-list-endpoint quirk and the `id=null` sentinel for missing ids) and a Pointers section pointing at all 3 new siblings. Two new captured examples: `invoice_template_km.json`, `products_list.json`. ## Test plan - [ ] `tva-by-month.sh` → 8 160 € basis, 0 € TVA, two months (2026-01 510 €, 2026-02 7 650 €). - [ ] `tva-line-detail.sh` → 5 lines all in E2 bucket. - [ ] `list-templates.sh` → finds 1 template (Kiss Metrics Invoice). - [ ] `inspect-template.sh 1` → exit 1 with 2 health issues (`frequency=0`, manual duplications detected). - [ ] `snapshot.sh --out /tmp/s1.json && snapshot.sh --out /tmp/s2.json && jq -r .content_hash /tmp/s*.json` → both identical. - [ ] No credentials in the diff (`git diff --cached | grep -F <api-key>` empty). ## What's next (V4 candidates) - `dolibarr-thirdparty-completeness` — generalize `audit-km-thirdparty.sh` for any socid. - `dolibarr-tva-deductible` — supplier-side TVA via `/supplierinvoices` once Arcodange logs them. - `arcodange-k8s`, `arcodange-backups`, `arcodange-bank-reco` — operational siblings outside the Dolibarr-API perimeter.
arcodange added 1 commit 2026-05-29 00:10:47 +02:00
V3 bundle — three sibling skills under .claude/skills/, all read-only,
all depending on the dolibarr base skill.

dolibarr-tva-reconciliation:
- tva-by-month.sh: HT + TVA grouped by (year-month × tva_tx), ready
  for CA3 / CA12 transcription.
- tva-line-detail.sh: per-line audit trail with country-based bucket
  assignment (A1 domestic / A4 intra-UE autoliquidation / E2 export
  hors UE). Documents the French TVA mental model.
- Today every Arcodange line is E2 (KissMetrics, US, autoliquidation
  259-1° CGI). The skill scales for the day a French B2B is invoiced.

dolibarr-recurring-templates:
- list-templates.sh: probes /invoices/templates/{id} since there's no
  list endpoint. Stops after 5 consecutive empty responses.
- inspect-template.sh: full audit per template, with health checks.
- Surfaces that the "Kiss Metrics Invoice" template has frequency=0
  and nb_gen_done=0 — it is NOT auto-firing. Every KM invoice today
  was manually duplicated. Cohort-review implication: the deferred
  9-month cycle depends on Gabriel clicking "Generate" each month,
  not on a Dolibarr cron.

dolibarr-data-snapshot:
- snapshot.sh: bundles every read endpoint the dolibarr-* family uses
  into one JSON with a content_hash (sha256 of data only, excluding
  timestamp — so identical state hashes identically across runs).
- Use cases: cohort evidence packs, drift detection, archival before
  a known-risky UI change.
- V1 baseline summary captured at examples/snapshot-summary.txt
  (the ~246 KB snapshot file itself is intentionally not committed).

Also extends dolibarr/SKILL.md endpoint catalogue with
/invoices/templates/{id} (and its no-list-endpoint quirk + the
id-null sentinel for missing ids), plus links to the three new
sibling skills.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arcodange merged commit fe9e8274f1 into main 2026-05-29 00:10:54 +02:00
arcodange deleted branch claude/dolibarr-tva-recurring-snapshot 2026-05-29 00:10:55 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: arcodange-org/erp#3