/sap-gen-code:sap-docs-estimate <work-folder> [--brief <path>] | --batch <folder-of-folders> | --ledger <findings_triaged.tsv> | record-actuals <estimate-id> --actual <hours> [--phase build|test|total]from sap-gen-code
Estimates SAP documentation effort from structural spec signals (DDIC/process/interface counts, ambiguity rows) using published weights and effort bands. Supports batch portfolio rollups, migration wave ledgers, and an actuals ledger for calibration.
Ships in sap-gen-code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Score effort from the spec pipeline's own structural signals instead of gut feel, and make every estimate falsifiable via an actuals ledger. Pure-local and read-only — no SAP access, no TR, no deploys in v1.
Task: $ARGUMENTS
Anti-anchoring rule (mandatory): every rendered estimate carries the header
STRUCTURAL BAND — not a quote; calibration=<NONE|n pairs>. An uncalibrated band is wide by
design and must never be presented as a commitment.
| File | Token / call | Purpose |
|---|---|---|
<SAP_DEV_CORE_SHARED_DIR>/rules/skill_operating_rules.md | (rule) | Mandatory operating rules — read-only here |
<SKILL_DIR>/references/sap_docs_estimate.ps1 | -Folder|-Batch|-Ledger … | Deterministic offline scorer → SIGNAL/SCORE/BAND lines |
<SKILL_DIR>/references/sap_estimate_ledger.ps1 | -Action record|list|pairs | Append-only estimate/actuals ledger |
<SKILL_DIR>/references/estimate_weights.tsv | weights | Per-signal complexity weights; override {custom_url}\estimate_weights.tsv |
<SKILL_DIR>/references/effort_bands.tsv | bands | (type×class) + (tier×object) bands + DECLARED uplifts; override {custom_url}\effort_bands.tsv |
<SKILL_DIR>/references/fixtures/ | fixtures | Offline test fixtures (spec_min, spec_max, findings_triaged.tsv) |
/sap-docs-check (Skill tool) | (suggested) | Suggested when check_result_*.txt are missing — improves the ambiguity signal |
/sap-log-analyze --builds (Skill tool) | (v1.5) | Refresh build KPIs before calibrate |
<SAP_DEV_CORE_SHARED_DIR>/scripts/sap_artifact_lib.ps1 | Step 5 | Artifact index for /sap-evidence-pack |
powershell -NoProfile -ExecutionPolicy Bypass -Command ". '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_settings_lib.ps1'; . '<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_connection_lib.ps1'; Write-Output ('WORK_DIR=' + (Get-SapWorkDir)); Write-Output ('CUSTOM_URL=' + (Get-SapSettingValue 'custom_url' ((Get-SapWorkDir) + '\custom'))); Write-Output ('RUN_TEMP=' + (Get-SapRunTemp))"
Ledger + calibration live at {work_dir}\metrics\ (stable cross-run path — NOT {RUN_TEMP}).
Set {RUN_TEMP} = the RUN_TEMP= value printed above (Get-SapRunTemp mints + creates the
per-run scratch dir holding the log state file) — for logging state only; mint it once here and
reuse (re-minting breaks the -Action end state-file lookup).
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action start -StateFile "{RUN_TEMP}\sap_docs_estimate_run.json" -Skill sap-docs-estimate -ParamsJson "{}"
<work-folder> → score; --batch <folder> → portfolio; --ledger <tsv|campaign-id>
→ wave banding; record-actuals <id> --actual <h> → ledger append.calibrate → v1.5: run sap_estimate_ledger.ps1 -Action pairs; if it returns
EST_CALIBRATION_INSUFFICIENT, print the honest cold-start message (need N more actuals)
and STOP. Writing adjusted multipliers ships in v1.5.--live-delta → v2: say NOT_YET_IMPLEMENTED — brownfield RFC credit ships in v2 and
continue with the offline score (never block).List which _*.txt / check_result_*.txt exist in the folder (the coverage matrix). If
check_result_* are missing, suggest /sap-docs-check (do not auto-run) so the ambiguity
signal is populated.
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File "<SKILL_DIR>\references\sap_docs_estimate.ps1" -Folder "<work-folder>" -WeightsFile "<SKILL_DIR>\references\estimate_weights.tsv" -BandsFile "<SKILL_DIR>\references\effort_bands.tsv" -CustomUrl "{custom_url}"
Use -Batch/-Ledger for those modes. Parse SIGNAL: (per-signal count/weight/contrib/
coverage), SCORE: raw=… class=… covered=c/t program_type=…, BAND: … total_low=… total_high=… calibration=…, and STATUS:. A signal with coverage=COULD_NOT_CHECK means its input file
was absent — the band is widened and confidence drops; never render it as low complexity.
No scoreable inputs → EST_INPUT_MISSING, exit 1, nothing written.
Write estimate_<doc>.md + .tsv into the work folder (batch: portfolio_estimate.* beside
the folders; ledger: wave_estimate.*). The report leads with the anti-anchoring header, then:
build band + total-with-uplift band, complexity class, named drivers, the coverage
matrix (every COULD_NOT_CHECK signal listed), and the assumptions register (every DECLARED
uplift factor + every missing signal is one row). Append an ESTIMATE row to the ledger:
… sap_estimate_ledger.ps1 -Action record -Id "<estimate-id>" -Kind ESTIMATE -ScopeKey "<PROG_…>" -Class <c> -BandLow <lo> -BandHigh <hi> -LedgerFile "{work_dir}\metrics\estimate_ledger.tsv"
Print the estimate-id and the exact record-actuals follow-up command.
… sap_estimate_ledger.ps1 -Action record -Id "<estimate-id>" -Kind ACTUAL -Phase <build|test|total> -Hours <n> -Source "<timesheet>" -Note "…" -LedgerFile "{work_dir}\metrics\estimate_ledger.tsv"
Unknown id → EST_ID_UNKNOWN (fail-loud, no silent new row). Corrupt ledger → EST_LEDGER_IO.
Echo the pairing status (how many actuals now recorded for the id).
Register each rendered file via Register-SapArtifact -Kind estimate -Coverage CHECKED|COULD_NOT_CHECK (no gate verdict — estimates are not gates). Then:
powershell -ExecutionPolicy Bypass -File "<SAP_DEV_CORE_SHARED_DIR>\scripts\sap_log_helper.ps1" -Action end -StateFile "{RUN_TEMP}\sap_docs_estimate_run.json" -Status SUCCESS -ExitCode 0
score (one folder), --batch (portfolio), --ledger (triage-wave
banding by tier×object type), record-actuals (append-only ledger). Deterministic and
pure-local — same inputs → identical score (verified). No SAP access.COULD_NOT_CHECK (band
widened, never a silent zero); every report is labelled UNCALIBRATED; uplift factors are
DECLARED (kept in the assumptions register, never folded silently into the band);
record-actuals on an unknown id is refused; calibrate below --min-pairs (default 8) is
refused with a cold-start message — no fake calibration.effort_bands.tsv until the
actuals ledger + calibrate (v1.5) tighten them. The value compounds: the ledger makes every
estimate measurable, so improvement is provable rather than asserted.--live-delta brownfield-credit
RFC mode is claimed for S/4HANA only.)calibrate writing adjusted multipliers (v1.5, joins the ledger to
/sap-log-analyze build KPIs); --live-delta RFC brownfield credit — objects the spec
defines that already exist score as UPDATE not CREATE (v2, read-only RFC_READ_TABLE).README.md (opens in a new tab)references/effort_bands.tsv (opens in a new tab)references/estimate_weights.tsv (opens in a new tab)references/fixtures/README.txt (opens in a new tab)references/fixtures/findings_triaged.tsv (opens in a new tab)references/fixtures/spec_max/_PGM_summary.txt (opens in a new tab)references/fixtures/spec_max/_dataElements.txt (opens in a new tab)references/fixtures/spec_max/_domains.txt (opens in a new tab)references/fixtures/spec_max/_errorMsgs.txt (opens in a new tab)references/fixtures/spec_max/_golden.txt (opens in a new tab)references/fixtures/spec_max/_interface.txt (opens in a new tab)references/fixtures/spec_max/_process.txt (opens in a new tab)references/fixtures/spec_max/_selection_definition.txt (opens in a new tab)references/fixtures/spec_max/_tables.txt (opens in a new tab)references/fixtures/spec_max/check_result_ddic.txt (opens in a new tab)references/fixtures/spec_min/_PGM_summary.txt (opens in a new tab)references/fixtures/spec_min/_process.txt (opens in a new tab)references/fixtures/spec_min/_tables.txt (opens in a new tab)references/sap_docs_estimate.ps1 (opens in a new tab)references/sap_estimate_ledger.ps1 (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/sap-docs-checkValidates an extracted design spec before ABAP code generation, across two
dimensions: `ddic` checks DDIC objects (domains / data elements / tables) —
naming, data-type validity, domain/DTEL/table cross-references, currency-ref
completeness, the primitive-as-data-element trap; `process` checks the
process-logic text for unclear/ambiguous steps, missing info, and logic /
type / cross-reference inconsistencies. Both optionally verify references
against the live system over RFC when a SAP logon is given. Runs BOTH by default
(whichever inputs exist); --dimension ddic|process forces one. Writes a
TAB-separated result file per dimension for Excel review. Replaces the former
/sap-docs-check-ddic and /sap-docs-check-process.
Input: work folder path; optional SAP Logon description enables the RFC checks.
/sap-docs-convertApplies customer-specific normalisation rules to the extracted spec files
in a work folder. Reads `spec_conversion_rules.tsv` (default at
sap-dev-core/shared/tables/, override at {custom_url}/spec_conversion_rules.tsv)
and rewrites the affected `_*.txt` files in place.
Three rule categories:
* field_rename — legacy field name → canonical name
* type_rename — legacy DDIC type token → canonical token
* flag_mapping — legacy flag value → one or more KEY=VALUE pairs
Plus optional schema migration (legacy customer YAML/TSV layout → Customer
Brief layout).
Input: work folder containing the extracted `_*.txt` files (output of /sap-docs-extract).
Output: same files rewritten in place; a `.pre-convert/` snapshot is taken first.
This skill is OPTIONAL — projects already authoring specs in Customer Brief
format can skip it entirely.
npx claudepluginhub sapdev-ai/sap-dev --plugin sap-gen-code