Skip to content

feat: sap-discovery-tutorial-sync skill (Discovery Center → platform converter) - #2705

Merged
jung-thomas merged 11 commits into
DEVfrom
worktree-discovery-tutorial-sync-spec
Oct 9, 2026
Merged

jung-thomas merged 11 commits into
DEVfrom
worktree-discovery-tutorial-sync-spec

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

What

Adds sap-discovery-tutorial-sync — a Claude Code skill that converts SAP Discovery Center tutorials (e.g. SAP-samples/btp-developer-guide-cap/documentation/tutorials) into our sap-tutorials v2-parser platform format, validates them against the real build, and opens a PR. Goal: make maintaining the sap-tutorials copy cheap enough that teams keep both current instead of dropping ours.

Why

Several teams maintain the same tutorials in two formats — Discovery Center (plain markdown, <details> variants, no frontmatter) and our platform (required YAML frontmatter, [OPTION BEGIN] tabs, slug-named images, optional rules.vr). The format gap is systematic and mechanical; this skill automates it with a judgment layer for the parts that need review.

What's in the PR

  • .claude/skills/sap-discovery-tutorial-sync/ — self-contained shareable skill:
    • SKILL.md — two-phase procedure (draft locally → mandatory human-review STOP → optional PR), frontmatter prompting with a taxonomy hard-gate, 3-way merge (preserve our enrichments on update), per-tutorial rules.vr prompt.
    • scripts/convert-body.mjs + __tests__/ — deterministic converter (H2→H1, <details>→OPTION, image-path/layout-comment normalization, fence lint, precheck, CLI). 12 unit tests, wired into the repo vitest unit project via a new .claude/skills/**/__tests__/** include glob.
    • references/format-mapping.md, references/taxonomy-check.md.
  • package.json — discovery-sync:convert convenience script.
  • docs/superpowers/specs/ + plans/ — design spec + implementation plan.

Validation

  • 12/12 converter unit tests green on the DEV-rebased tree.
  • E2E dry run: build-cap-app converts cleanly — 8 balanced OPTION tabs from <details>, 8 images fetched, precheck clean, and the real composeTutorial parser accepts it (stepCount: 5, parser: v2).
  • All six parser contracts (OPTION regex, /build/tags, fail-open validate-tutorials quarantine, TUTORIAL_SLUG, frontmatter discriminator, description marker) confirmed against source file:line in the final review.

Deferred follow-ups (non-blocking)

  • Idempotency guard if a source body already contains a <!-- description --> line (Discovery Center sources don't per design).
  • Unit assertion for the NO_PARSER_V2 precheck string (runtime-confirmed, assertion absent).

🤖 Generated with Claude Code

Extend the convert-body.mjs CLI so that:

  node convert-body.mjs --precheck <full.md> <slug> <imagesDir>

reads <full.md>, scans <imagesDir> with readdirSync, and prints the
JSON array returned by precheck() — empty array means clean.  The
existing (non-precheck) CLI branch is unchanged.

Also add the smoke test:
  'CLI --precheck is reachable' — asserts typeof precheck === 'function'

SKILL.md (user-global) documents the exact one-liner for the two-stage
validation procedure (Task 6B, not committed here).
- Add discovery-sync:convert npm script (node scripts/discovery-sync/convert-body.mjs)
- Add .sync-draft/ to .gitignore (local working drafts, never committed)
- E2E verified: build-cap-app converts with 8 balanced OPTION blocks (4x Node.js/Java pairs),
  8 images fetched, precheck [], composeTutorial returns 5 steps on Node v26/Windows
…tained)

Move convert-body.mjs + tests + fixtures from scripts/discovery-sync/ into
.claude/skills/sap-discovery-tutorial-sync/scripts/ so the skill is fully
self-contained. Update vitest.config.ts include glob, package.json
discovery-sync:convert script, and SKILL.md path references accordingly.
@jung-thomas
jung-thomas merged commit 05a5fc3 into DEV Oct 9, 2026
6 checks passed
@jung-thomas
jung-thomas deleted the worktree-discovery-tutorial-sync-spec branch October 9, 2026 21:20
jung-thomas added a commit that referenced this pull request Oct 9, 2026
Resolves the 1.37.0 vs 1.37.1 overlap on the two release-managed files:
- .deploy/mta.yaml: keep 1.37.1 (supersedes main's 1.37.0 bump).
- hugo/data/whats_new.json: keep the 757-entry digest, which already
  incorporates main's 752-entry 1.37.0 digest (rebased onto it) plus the
  4 new 1.37.1 PRs (#2700/#2701/#2704/#2705). Verified superset: all
  1.37.0 entries retained, 4 new entries added, no duplicates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant