agentsclimarketplace

Program to spec

Skill vigneshbarani24/sap-superpowers/skills/development/program-to-spec

Use when reverse-engineering an existing ABAP program into a functional or technical specification. Reads code and produces structured documentation — not a code dump, a proper spec document that a consultant can hand to a client.From its SKILL.md

Install
npx -y skills add vigneshbarani24/sap-superpowers --skill program-to-spec

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 6 stars6 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

7.5 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it

Program-to-Spec — Reverse Engineering

This skill reads existing ABAP code and produces a structured specification document — either a Functional Specification (what it does from a business perspective) or a Technical Specification (how it works from a developer perspective). The output is client-ready, not a code comment dump.

Iron Laws

  1. NEVER PRODUCE A CODE WALKTHROUGH DISGUISED AS A SPEC. A spec explains business logic, data flows, and decisions — not line-by-line code commentary. If your output reads like "Line 42 calls BAPI_SALESORDER_CREATEFROMDAT2", you are producing a walkthrough, not a spec.

  2. ALWAYS IDENTIFY THE BUSINESS PROCESS. Every program exists to support a business process. Identify it. Name it. Map the program's logic to process steps. If you cannot identify the business process, state the gap — do not invent one.

  3. ALWAYS DOCUMENT ASSUMPTIONS AND GAPS. Reverse-engineered specs have blind spots — hardcoded values without explanation, dead code paths, unclear business rules. Document these explicitly as "Assumptions" and "Gaps for Clarification."

  4. ALWAYS PRODUCE BOTH VIEWS. Generate both the functional spec (for business stakeholders) and the technical spec (for developers). They serve different audiences and neither is complete alone.

  5. NEVER FABRICATE BUSINESS JUSTIFICATIONS. If the code does something without clear business reason, say "Business justification unclear — clarify with process owner." Do not invent justifications.

Rationalization Table

Agent Will Try To...Why It Seems ReasonableWhy It FailsCounter
Describe code instead of business logic"The code IS the specification"Code is implementation, not specification. Specs describe WHAT and WHY. Code describes HOW.Iron Law 1. Translate code into business terms.
Skip dead code analysis"Dead code doesn't matter"Dead code in SAP is often conditionally active (different plants, company codes, or periods). Document it.Analyze all code paths. Flag potentially dead code as "Conditional — verify activation criteria."
Invent business reasons for hardcoded values"This must be for tax calculation"Guessing business logic from hardcoded values is how wrong specs get written.Iron Law 5. Document as: "Hardcoded value [X] — business justification needed."
Produce one combined document"One document is simpler"Business users won't read technical details. Developers don't need business context.Iron Law 4. Two separate docs.
<HARD-GATE> Before producing the specification: 1. The source code must be fully read (all includes, function modules, classes) 2. The program type must be identified (report, module pool, function group, class, interface, CDS view) 3. All external dependencies must be cataloged (BAPIs, FMs, RFC destinations, CDS views) If the code cannot be fully read (missing includes, broken references), document the gaps explicitly. </HARD-GATE>

Analysis Process

Step 1 — Code Inventory

Read the complete program and produce an inventory:

  • Program type and technical name
  • All includes with purposes
  • All classes/methods with signatures
  • All function module calls
  • All database access (tables/views/CDS entities)
  • All external interfaces (RFC, HTTP, file I/O)
  • All screen elements (Dynpros, ALV, selection screen)
  • All text elements and message classes

Step 2 — Business Process Mapping

Map the code logic to business process steps:

  • Identify the trigger (user action, batch job, event)
  • Trace the main execution path
  • Identify branching logic and its business meaning
  • Map database operations to business entities
  • Identify output (reports, documents, updates, messages)

Step 3 — Data Flow Analysis

Document how data moves through the program:

  • Input sources (selection screen, file, API, database)
  • Transformations (calculations, validations, enrichments)
  • Output destinations (database updates, files, APIs, UI)
  • Error handling paths

Step 4 — Produce Functional Specification

# Functional Specification: [Program Name]

## Overview
**Program:** [Technical name]
**Business Process:** [Process name]
**Module:** [SAP module]
**Purpose:** [1-2 sentence business description]

## Business Context
[Why this program exists, what business need it serves]

## Scope
### In Scope
- [Business function 1]
- [Business function 2]

### Out of Scope
- [Explicitly excluded functions]

## Process Flow
1. [Business step 1] — [What happens]
2. [Business step 2] — [What happens]
3. ...

## Business Rules
| Rule | Description | Implementation |
|------|-------------|----------------|
| BR-01 | [Rule description] | [How it's enforced] |

## Input/Output
### Inputs
| Input | Source | Format | Validation |
|-------|--------|--------|------------|

### Outputs
| Output | Destination | Format | Trigger |
|--------|------------|--------|---------|

## Authorization
| Auth Object | Field | Values | Business Role |
|-------------|-------|--------|--------------|

## Assumptions & Gaps
| # | Item | Type | Status |
|---|------|------|--------|
| 1 | [Item] | Assumption/Gap | Needs clarification |

Step 5 — Produce Technical Specification

# Technical Specification: [Program Name]

## Technical Overview
**Program:** [Name] | **Type:** [Report/Module Pool/Class]
**Package:** [Package] | **Transport:** [If known]
**ABAP Release:** [Minimum required]

## Architecture
[Class diagram or structure overview]

## Object Inventory
| Object | Type | Purpose |
|--------|------|---------|
| [Name] | Class/FM/Include | [Purpose] |

## Data Model
### Tables/Views Accessed
| Table/CDS | Access Type | Purpose |
|-----------|------------|---------|

### Internal Data Structures
| Structure | Fields | Purpose |
|-----------|--------|---------|

## Method/Function Documentation
### [Method Name]
- **Purpose:** [What it does]
- **Parameters:** [In/Out/Changing/Returning]
- **Exceptions:** [What can go wrong]
- **Dependencies:** [What it calls]

## External Interfaces
| Interface | Type | Direction | System |
|-----------|------|-----------|--------|

## Error Handling
| Error | Handler | User Message | Recovery |
|-------|---------|-------------|----------|

## Performance Considerations
- [Known performance patterns — indexed access, buffering, parallel processing]

## Technical Gaps
| # | Item | Impact | Recommendation |
|---|------|--------|---------------|

Verification

  • Complete code inventory produced (all includes, classes, FMs cataloged)
  • Business process identified and mapped
  • Functional specification produced in structured format
  • Technical specification produced in structured format
  • All assumptions explicitly documented
  • All gaps flagged for clarification
  • No fabricated business justifications
  • Both specs are independently readable by their target audience

Next Skill

After completing this skill, invoke: code-review (if the reverse-engineered code needs quality assessment) Or: s4hana-migration (if the spec is being produced for migration analysis)

Cross-References

  • code-review — Review the code quality during reverse engineering
  • s4hana-migration — Use spec output for migration compatibility analysis
  • solution-architecture — Use spec output for architecture documentation

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Gives 0 of the 12 instructions most docs writing skills give in ~1.6k tokens

Counted across 1,951 of the 3,904 authors here whose files we hold, read 2026-09-06

  • Use third-person for skill descriptionsin 54 of 1951, across 35 files
  • Start descriptions with Use whenin 43 of 1951, across 29 files
  • Run baseline scenarios before writing any skillin 40 of 1951, across 26 files
  • Use active voicein 40 of 1951, across 36 files
  • Map file responsibilities before defining tasksin 36 of 1951, across 29 files
  • Use checkbox syntax for tracking stepsin 35 of 1951, across 27 files
  • Ask one question at a timein 35 of 1951
  • Offer execution options after saving the planin 33 of 1951, across 24 files
  • Include complete code in every stepin 33 of 1951, across 27 files
  • Design units with clear boundaries and interfacesin 31 of 1951, across 23 files
  • Announce the skill usage at the startin 30 of 1951
  • Verify agent compliance after adding the skillin 29 of 1951, across 17 files

Said here and by no other author read

  • identify the business process supported by the program
  • map program logic to business process steps
  • generate both functional and technical specification documents
  • analyze all code paths including dead code
  • catalog all external dependencies and interfaces
  • read all includes function modules and classes

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.