abapgit-agent 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -133
- package/abap/.github/copilot-instructions.slim.md +114 -0
- package/abap/CLAUDE.md +90 -25
- package/abap/CLAUDE.slim.md +42 -0
- package/abap/guidelines/abapgit.md +9 -47
- package/abap/guidelines/cds-testing.md +4 -1
- package/abap/guidelines/cds.md +38 -10
- package/abap/guidelines/testing.md +46 -2
- package/bin/abapgit-agent +1 -0
- package/package.json +3 -1
- package/src/commands/guide.js +276 -0
- package/src/commands/help.js +15 -0
- package/src/commands/init.js +132 -65
- package/src/commands/pull.js +69 -20
- package/src/utils/abap-reference.js +254 -118
package/README.md
CHANGED
|
@@ -49,138 +49,49 @@ See [Creating New ABAP Projects](INSTALL.md#creating-new-abap-projects) to set u
|
|
|
49
49
|
|
|
50
50
|
## CLI Commands
|
|
51
51
|
|
|
52
|
-
### Setup
|
|
52
|
+
### Setup
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
# Initialize local
|
|
56
|
-
abapgit-agent
|
|
57
|
-
|
|
58
|
-
#
|
|
59
|
-
abapgit-agent init --package ZMY_PACKAGE --folder /abap/
|
|
60
|
-
|
|
61
|
-
# With custom folder logic (default: PREFIX)
|
|
62
|
-
abapgit-agent init --package ZMY_PACKAGE --folder-logic FULL
|
|
63
|
-
|
|
64
|
-
# Create online repository in ABAP
|
|
65
|
-
abapgit-agent create
|
|
66
|
-
|
|
67
|
-
# Delete online repository from ABAP (keeps local files)
|
|
68
|
-
abapgit-agent delete
|
|
69
|
-
|
|
70
|
-
# Import objects from ABAP package to git
|
|
71
|
-
abapgit-agent import
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Development Commands
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Pull and activate (auto-detects git remote and branch)
|
|
78
|
-
abapgit-agent pull
|
|
79
|
-
|
|
80
|
-
# Pull with specific branch
|
|
81
|
-
abapgit-agent pull --branch develop
|
|
82
|
-
|
|
83
|
-
# Pull specific files only (fast iteration)
|
|
84
|
-
abapgit-agent pull --files src/zcl_my_class.clas.abap,src/zif_my_intf.intf.abap
|
|
85
|
-
|
|
86
|
-
# Override git URL if needed
|
|
87
|
-
abapgit-agent pull --url https://github.com/user/repo --branch main
|
|
88
|
-
|
|
89
|
-
# Pull with a specific transport request
|
|
90
|
-
abapgit-agent pull --transport DEVK900001
|
|
91
|
-
|
|
92
|
-
# Import objects from ABAP package to git
|
|
93
|
-
abapgit-agent import
|
|
94
|
-
|
|
95
|
-
# Import with custom commit message
|
|
96
|
-
abapgit-agent import --message "feat: add new feature"
|
|
55
|
+
abapgit-agent init --package ZMY_PACKAGE # Initialize local config
|
|
56
|
+
abapgit-agent create # Create online repo in ABAP
|
|
57
|
+
abapgit-agent import # Import objects from ABAP to git
|
|
58
|
+
abapgit-agent delete # Delete repo from ABAP
|
|
97
59
|
```
|
|
98
60
|
|
|
99
|
-
###
|
|
61
|
+
### Development
|
|
100
62
|
|
|
101
63
|
```bash
|
|
102
|
-
#
|
|
103
|
-
|
|
104
|
-
abapgit-agent syntax --files src/zcl_my_class.clas.abap
|
|
105
|
-
abapgit-agent
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
abapgit-agent syntax --files src/zcl_my_class.clas.abap --cloud
|
|
109
|
-
|
|
110
|
-
# Syntax check multiple files
|
|
111
|
-
abapgit-agent syntax --files src/zcl_class.clas.abap,src/zc_view.ddls.asddls
|
|
112
|
-
|
|
113
|
-
# Inspect source file for issues (after activation)
|
|
114
|
-
abapgit-agent inspect --files src/zcl_my_class.clas.abap
|
|
115
|
-
|
|
116
|
-
# Run AUnit tests for test classes
|
|
117
|
-
abapgit-agent unit --files src/zcl_my_test.clas.testclasses.abap
|
|
118
|
-
|
|
119
|
-
# Run tests for multiple test classes
|
|
120
|
-
abapgit-agent unit --files src/zcl_test1.clas.testclasses.abap,src/zcl_test2.clas.testclasses.abap
|
|
64
|
+
abapgit-agent pull # Pull and activate
|
|
65
|
+
abapgit-agent pull --files src/zcl_my_class.clas.abap # Pull specific files
|
|
66
|
+
abapgit-agent syntax --files src/zcl_my_class.clas.abap # Check syntax before commit
|
|
67
|
+
abapgit-agent inspect --files src/zcl_my_class.clas.abap # Code Inspector after pull
|
|
68
|
+
abapgit-agent unit --files src/zcl_my_test.clas.testclasses.abap # Run AUnit tests
|
|
69
|
+
abapgit-agent run --class ZCL_MY_RUNNER # Execute class headlessly
|
|
121
70
|
```
|
|
122
71
|
|
|
123
|
-
### Explore
|
|
72
|
+
### Explore
|
|
124
73
|
|
|
125
74
|
```bash
|
|
126
|
-
|
|
127
|
-
abapgit-agent
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
abapgit-agent
|
|
131
|
-
abapgit-agent
|
|
132
|
-
abapgit-agent
|
|
133
|
-
|
|
134
|
-
# Preview table or CDS view data
|
|
135
|
-
abapgit-agent preview --objects SFLIGHT
|
|
136
|
-
abapgit-agent preview --objects ZC_MY_CDS_VIEW --type DDLS
|
|
137
|
-
abapgit-agent preview --objects SFLIGHT --limit 20
|
|
138
|
-
abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
139
|
-
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,PRICE
|
|
140
|
-
abapgit-agent preview --objects SFLIGHT --vertical
|
|
141
|
-
abapgit-agent preview --objects SFLIGHT --compact
|
|
142
|
-
|
|
143
|
-
# Find where-used (objects using a specific object)
|
|
144
|
-
abapgit-agent where --objects ZCL_MY_CLASS
|
|
145
|
-
abapgit-agent where --objects ZIF_MY_INTERFACE
|
|
146
|
-
abapgit-agent where --objects ZCL_MY_CLASS --type CLAS
|
|
147
|
-
|
|
148
|
-
# Query short dumps (ST22)
|
|
149
|
-
abapgit-agent dump --date TODAY
|
|
150
|
-
abapgit-agent dump --user DEVELOPER --date TODAY --detail 1
|
|
75
|
+
abapgit-agent tree --package '$MY_PACKAGE' # Package hierarchy
|
|
76
|
+
abapgit-agent list --package '$MY_PACKAGE' # List objects
|
|
77
|
+
abapgit-agent view --objects ZCL_MY_CLASS # View object definition
|
|
78
|
+
abapgit-agent preview --objects SFLIGHT # Preview table data
|
|
79
|
+
abapgit-agent where --objects ZCL_MY_CLASS # Where-used list
|
|
80
|
+
abapgit-agent dump --date TODAY # Query short dumps (ST22)
|
|
81
|
+
abapgit-agent debug set --files abap/zcl_my_class.clas.abap:42 # Set breakpoint
|
|
151
82
|
```
|
|
152
83
|
|
|
153
|
-
###
|
|
84
|
+
### Utility
|
|
154
85
|
|
|
155
86
|
```bash
|
|
156
|
-
#
|
|
157
|
-
abapgit-agent
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
abapgit-agent
|
|
161
|
-
|
|
162
|
-
#
|
|
163
|
-
abapgit-agent debug attach --json
|
|
164
|
-
|
|
165
|
-
# Step, inspect variables, call stack (no --session needed)
|
|
166
|
-
abapgit-agent debug step --type over --json
|
|
167
|
-
abapgit-agent debug vars --json
|
|
168
|
-
abapgit-agent debug stack --json
|
|
169
|
-
|
|
170
|
-
# Always release the frozen work process when done
|
|
171
|
-
abapgit-agent debug step --type continue --json
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Utility Commands
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
# Health check
|
|
178
|
-
abapgit-agent health
|
|
179
|
-
|
|
180
|
-
# Check integration status
|
|
181
|
-
abapgit-agent status
|
|
87
|
+
abapgit-agent guide # Read full ABAP development guide
|
|
88
|
+
abapgit-agent ref "CORRESPONDING" # Search ABAP reference
|
|
89
|
+
abapgit-agent ref --topic sql # Browse by topic
|
|
90
|
+
abapgit-agent transport list # List transport requests
|
|
91
|
+
abapgit-agent upgrade # Upgrade CLI and ABAP backend
|
|
92
|
+
abapgit-agent status # Check configuration
|
|
93
|
+
abapgit-agent health # Verify ABAP connection
|
|
182
94
|
```
|
|
183
|
-
Note: All ABAP commands automatically check CLI/ABAP API version compatibility.
|
|
184
95
|
|
|
185
96
|
## Local Development
|
|
186
97
|
|
|
@@ -200,25 +111,11 @@ npm run pull -- --url <git-url> --branch main
|
|
|
200
111
|
|
|
201
112
|
| Topic | File |
|
|
202
113
|
|-------|------|
|
|
114
|
+
| Full Documentation | [https://sylvoscai.github.io/abapgit-agent/](https://sylvoscai.github.io/abapgit-agent/) |
|
|
203
115
|
| Installation & Setup | [INSTALL.md](INSTALL.md) |
|
|
204
|
-
|
|
|
205
|
-
| create Command | [docs/create-command.md](docs/create-command.md) |
|
|
206
|
-
| delete Command | [docs/delete-command.md](docs/delete-command.md) |
|
|
207
|
-
| import Command | [docs/import-command.md](docs/import-command.md) |
|
|
208
|
-
| pull Command | [docs/pull-command.md](docs/pull-command.md) |
|
|
209
|
-
| syntax Command | [docs/syntax-command.md](docs/syntax-command.md) |
|
|
210
|
-
| inspect Command | [docs/inspect-command.md](docs/inspect-command.md) |
|
|
211
|
-
| unit Command | [docs/unit-command.md](docs/unit-command.md) |
|
|
212
|
-
| tree Command | [docs/tree-command.md](docs/tree-command.md) |
|
|
213
|
-
| view Command | [docs/view-command.md](docs/view-command.md) |
|
|
214
|
-
| preview Command | [docs/preview-command.md](docs/preview-command.md) |
|
|
215
|
-
| where Command | [docs/where-command.md](docs/where-command.md) |
|
|
216
|
-
| dump Command | [docs/dump-command.md](docs/dump-command.md) |
|
|
217
|
-
| debug Command | [docs/debug-command.md](docs/debug-command.md) |
|
|
218
|
-
| ref Command | [docs/ref-command.md](docs/ref-command.md) |
|
|
116
|
+
| All Commands Overview | [docs/commands.md](docs/commands.md) |
|
|
219
117
|
| REST API Reference | [API.md](API.md) |
|
|
220
118
|
| Error Handling | [ERROR_HANDLING.md](ERROR_HANDLING.md) |
|
|
221
|
-
| ABAP Coding Guidelines | [abap/CLAUDE.md](abap/CLAUDE.md) |
|
|
222
119
|
|
|
223
120
|
## Dependent Projects
|
|
224
121
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# ABAP Development with abapGit
|
|
2
|
+
|
|
3
|
+
You are working on an ABAP project using abapGit for version control.
|
|
4
|
+
|
|
5
|
+
> **Full guide:** https://sylvoscai.github.io/abapgit-agent/pages/abap-coding-guidelines.html
|
|
6
|
+
> **Agent mode:** Run `abapgit-agent guide` for the complete guide with all rules.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Critical Rules
|
|
11
|
+
|
|
12
|
+
### 1. Use `ref` Command for Unfamiliar Topics
|
|
13
|
+
|
|
14
|
+
**When starting to work on ANY unfamiliar ABAP topic, syntax, or pattern, use the `ref` command BEFORE writing any code.**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
abapgit-agent ref "CORRESPONDING" # search by pattern
|
|
18
|
+
abapgit-agent ref --topic exceptions # browse by topic
|
|
19
|
+
abapgit-agent ref --topic debug-session # read full guideline file
|
|
20
|
+
abapgit-agent ref --topic workflow-detailed
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Read `.abapGitAgent` for Folder Location and Naming Conventions
|
|
24
|
+
|
|
25
|
+
**Before creating ANY ABAP object file, read `.abapGitAgent` to determine the correct folder.**
|
|
26
|
+
|
|
27
|
+
The folder is configured in `.abapGitAgent` (property: `folder`):
|
|
28
|
+
- If `folder` is `/src/` → files go in `src/` (e.g., `src/zcl_my_class.clas.abap`)
|
|
29
|
+
- If `folder` is `/abap/` → files go in `abap/` (e.g., `abap/zcl_my_class.clas.abap`)
|
|
30
|
+
|
|
31
|
+
**Check naming conventions before creating any new object:**
|
|
32
|
+
1. `guidelines/objects.local.md` ← project-specific overrides (if file exists)
|
|
33
|
+
2. `abapgit-agent ref --topic objects` ← default Z/Y prefix conventions
|
|
34
|
+
|
|
35
|
+
### 3. Create XML Metadata / Local Classes
|
|
36
|
+
|
|
37
|
+
Each ABAP object needs an XML metadata file. Local helper/test-double classes use separate `.locals_def.abap` / `.locals_imp.abap` files.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
abapgit-agent ref --topic object-creation # XML templates and local class setup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 4. Use Syntax Command Before Commit (for CLAS, INTF, PROG, DDLS)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
abapgit-agent syntax --files src/zcl_my_class.clas.abap
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For dependent files (interface + class), skip `syntax` and go straight to `pull`.
|
|
50
|
+
|
|
51
|
+
### 5. Use `ref`, `view` and `where` to Learn About Unknown Classes/Methods
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
abapgit-agent where --objects ZIF_UNKNOWN_INTERFACE
|
|
55
|
+
abapgit-agent view --objects ZCL_UNKNOWN_CLASS
|
|
56
|
+
abapgit-agent view --objects ZCL_UNKNOWN_CLASS --full --lines # with line numbers for debugging
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 6. Troubleshooting
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
abapgit-agent dump --date TODAY --detail 1 # inspect last crash (ST22)
|
|
63
|
+
abapgit-agent debug set --objects ZCL_FOO:42 # set breakpoint then attach
|
|
64
|
+
abapgit-agent ref --topic debug-session # full debug guide
|
|
65
|
+
abapgit-agent ref --topic debug-dump # dump analysis guide
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Development Workflow
|
|
71
|
+
|
|
72
|
+
### Project-Level Config (`.abapgit-agent.json`)
|
|
73
|
+
|
|
74
|
+
Checked into the repository — applies to all developers. **Read this file at the start of every session.**
|
|
75
|
+
|
|
76
|
+
| Setting | Effect |
|
|
77
|
+
|---------|--------|
|
|
78
|
+
| `safeguards.requireFilesForPull: true` | Always include `--files` in every `pull` |
|
|
79
|
+
| `safeguards.disablePull: true` | Do not run `abapgit-agent pull` at all |
|
|
80
|
+
| `conflictDetection.mode: "abort"` | Abort pull on conflict — inform user |
|
|
81
|
+
| `transports.allowCreate/allowRelease: false` | Blocked — inform user |
|
|
82
|
+
|
|
83
|
+
### Workflow Mode (`.abapGitAgent` → `workflow.mode`)
|
|
84
|
+
|
|
85
|
+
| Mode | Branch Strategy | Rebase Before Pull | Create PR |
|
|
86
|
+
|------|----------------|-------------------|-----------|
|
|
87
|
+
| `"branch"` | Feature branches | ✓ Always | ✓ Yes (squash merge) |
|
|
88
|
+
| `"trunk"` / not set | Direct to default branch | ✗ No | ✗ No |
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# branch mode — read full guide:
|
|
92
|
+
abapgit-agent ref --topic branch-workflow
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Quick Decision Tree
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Modified ABAP files?
|
|
99
|
+
├─ CLAS/INTF/PROG/DDLS files?
|
|
100
|
+
│ ├─ Independent files? → syntax → commit → push → pull
|
|
101
|
+
│ └─ Dependent files? → skip syntax → commit → push → pull
|
|
102
|
+
└─ Other types (FUGR, TABL, etc.)?
|
|
103
|
+
→ skip syntax → commit → push → pull → (if errors: inspect)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
abapgit-agent ref --topic workflow-detailed # full workflow decision tree
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Project-Specific Naming Conventions
|
|
113
|
+
|
|
114
|
+
See `guidelines/objects.local.md` for this project's naming convention overrides.
|
package/abap/CLAUDE.md
CHANGED
|
@@ -9,20 +9,26 @@ parent: ABAP Development
|
|
|
9
9
|
|
|
10
10
|
This file provides guidelines for **generating ABAP code** in abapGit repositories.
|
|
11
11
|
|
|
12
|
-
**Use this file as a template**: Copy it to your ABAP repository root when setting up new projects with Claude Code.
|
|
13
|
-
|
|
14
12
|
---
|
|
15
13
|
|
|
16
14
|
## Critical Rules
|
|
17
15
|
|
|
18
|
-
### 1. Use `ref`
|
|
16
|
+
### 1. Use `guide` and `ref` Commands for Unfamiliar Topics
|
|
19
17
|
|
|
20
|
-
**When starting
|
|
18
|
+
**When starting a new session or working on ANY unfamiliar ABAP topic, syntax, or pattern:**
|
|
21
19
|
|
|
22
20
|
```
|
|
23
21
|
❌ WRONG: Start writing code immediately based on assumptions
|
|
24
|
-
✅ CORRECT: Run
|
|
22
|
+
✅ CORRECT: Run guide first, then ref for specific topics
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Step 1 — Read the full dev guide at session start:**
|
|
26
|
+
```bash
|
|
27
|
+
abapgit-agent guide
|
|
25
28
|
```
|
|
29
|
+
Covers the complete workflow, all critical rules, object naming, unit testing, debugging, and the full guidelines index.
|
|
30
|
+
|
|
31
|
+
**Step 2 — Look up specific syntax or topics with ref:**
|
|
26
32
|
|
|
27
33
|
**Why**: ABAP syntax is strict. Guessing leads to activation errors that waste time.
|
|
28
34
|
|
|
@@ -81,7 +87,7 @@ The folder is configured in `.abapGitAgent` (property: `folder`):
|
|
|
81
87
|
### 3. Create XML Metadata / Local Classes
|
|
82
88
|
|
|
83
89
|
Each ABAP object needs an XML metadata file. Local helper/test-double classes use separate `.locals_def.abap` / `.locals_imp.abap` files.
|
|
84
|
-
→ See `guidelines/object-creation.md`
|
|
90
|
+
→ See `guidelines/object-creation.md` — run: `abapgit-agent ref --topic object-creation`
|
|
85
91
|
|
|
86
92
|
---
|
|
87
93
|
|
|
@@ -133,18 +139,19 @@ abapgit-agent pull --files src/zif_my_intf.intf.abap,src/zcl_my_class.clas.abap
|
|
|
133
139
|
|
|
134
140
|
### 5. Local Helper / Test-Double Classes
|
|
135
141
|
|
|
136
|
-
→ See `guidelines/object-creation.md`
|
|
142
|
+
→ See `guidelines/object-creation.md` — run: `abapgit-agent ref --topic object-creation`
|
|
137
143
|
|
|
138
144
|
---
|
|
139
145
|
|
|
140
|
-
### 6. Use `ref`, `view` and `where` Commands to Learn About Unknown Classes/Methods
|
|
146
|
+
### 6. Use `guide`, `ref`, `view` and `where` Commands to Learn About Unknown Classes/Methods
|
|
141
147
|
|
|
142
148
|
**When working with unfamiliar ABAP classes or methods, follow this priority:**
|
|
143
149
|
|
|
144
150
|
```
|
|
145
151
|
1. First: Check local git repo for usage examples
|
|
146
|
-
2. Second:
|
|
147
|
-
3. Third: Use
|
|
152
|
+
2. Second: Run abapgit-agent guide for the full ABAP dev guide
|
|
153
|
+
3. Third: Use ref for specific syntax/topic details
|
|
154
|
+
4. Fourth: Use view/where commands to query ABAP system (if needed)
|
|
148
155
|
```
|
|
149
156
|
|
|
150
157
|
#### Priority 1: Check Local Git Repository
|
|
@@ -154,7 +161,16 @@ abapgit-agent pull --files src/zif_my_intf.intf.abap,src/zcl_my_class.clas.abap
|
|
|
154
161
|
- Check how similar classes are implemented
|
|
155
162
|
- This gives the most relevant context for your project
|
|
156
163
|
|
|
157
|
-
#### Priority 2:
|
|
164
|
+
#### Priority 2: Read the ABAP Development Guide
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Read the full bundled ABAP dev guide (workflow, patterns, guidelines index)
|
|
168
|
+
abapgit-agent guide
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
This covers the complete development workflow, coding guidelines, object naming, unit testing patterns, and debugging guide. Always up-to-date with the installed package version.
|
|
172
|
+
|
|
173
|
+
#### Priority 3: Check ABAP References
|
|
158
174
|
|
|
159
175
|
```bash
|
|
160
176
|
# Search in ABAP cheat sheets and guidelines
|
|
@@ -163,7 +179,7 @@ abapgit-agent ref "INTERFACE"
|
|
|
163
179
|
abapgit-agent ref --topic classes
|
|
164
180
|
```
|
|
165
181
|
|
|
166
|
-
#### Priority
|
|
182
|
+
#### Priority 4: Use `where` and `view` Commands (Query ABAP System)
|
|
167
183
|
|
|
168
184
|
**If local/references don't have the answer, query the ABAP system:**
|
|
169
185
|
|
|
@@ -180,6 +196,13 @@ abapgit-agent view --objects ZCL_UNKNOWN_CLASS
|
|
|
180
196
|
|
|
181
197
|
# View specific METHOD implementation
|
|
182
198
|
abapgit-agent view --objects ZCL_UNKNOWN_CLASS=============CM001
|
|
199
|
+
|
|
200
|
+
# View FULL source (definition + all method implementations)
|
|
201
|
+
abapgit-agent view --objects ZCL_UNKNOWN_CLASS --full
|
|
202
|
+
|
|
203
|
+
# View FULL source with dual line numbers (for setting breakpoints)
|
|
204
|
+
# G [N] code — G = global line for debug set, [N] = include-relative
|
|
205
|
+
abapgit-agent view --objects ZCL_UNKNOWN_CLASS --full --lines
|
|
183
206
|
```
|
|
184
207
|
|
|
185
208
|
**Example workflow for AI:**
|
|
@@ -188,9 +211,9 @@ User: "How do I use ZCL_ABGAGT_AGENT?"
|
|
|
188
211
|
|
|
189
212
|
AI thought process:
|
|
190
213
|
1. Search local repo for ZCL_ABGAGT_AGENT usage
|
|
191
|
-
2.
|
|
192
|
-
3.
|
|
193
|
-
4.
|
|
214
|
+
2. Run: abapgit-agent guide ← check if covered in the dev guide
|
|
215
|
+
3. Run: abapgit-agent ref "ZCL_ABGAGT_AGENT" ← search guidelines
|
|
216
|
+
4. Still unclear? Run: abapgit-agent view --objects ZCL_ABGAGT_AGENT
|
|
194
217
|
```
|
|
195
218
|
|
|
196
219
|
**Key differences:**
|
|
@@ -202,7 +225,7 @@ AI thought process:
|
|
|
202
225
|
### 7. CDS Unit Tests
|
|
203
226
|
|
|
204
227
|
Use `CL_CDS_TEST_ENVIRONMENT` for unit tests that read CDS views.
|
|
205
|
-
→ See `guidelines/cds-testing.md`
|
|
228
|
+
→ See `guidelines/cds-testing.md` — run: `abapgit-agent ref --topic cds-testing`
|
|
206
229
|
|
|
207
230
|
---
|
|
208
231
|
|
|
@@ -237,7 +260,7 @@ After activating a class, stop and tell the user: `"Class is activated. Run with
|
|
|
237
260
|
|
|
238
261
|
By default, probe/throwaway classes may be created in the current project. When `disableProbeClasses: true` is set in `.abapgit-agent.json`, they must go to `scratchWorkspace` instead. If `scratchWorkspace` is also not configured, refuse and guide the user to set it up.
|
|
239
262
|
|
|
240
|
-
→ See `guidelines/run-probe-classes.md`
|
|
263
|
+
→ See `guidelines/run-probe-classes.md` — run: `abapgit-agent ref --topic run-probe-classes`
|
|
241
264
|
|
|
242
265
|
---
|
|
243
266
|
|
|
@@ -248,14 +271,43 @@ By default, probe/throwaway classes may be created in the current project. When
|
|
|
248
271
|
| HTTP 500 / runtime crash (ST22) | `dump` | Error already occurred |
|
|
249
272
|
| Wrong output, no crash | `debug` | Need to trace logic |
|
|
250
273
|
|
|
251
|
-
|
|
274
|
+
→ See `guidelines/debug-dump.md` — run: `abapgit-agent ref --topic debug-dump`
|
|
275
|
+
|
|
276
|
+
**Critical rules for `debug` sessions:**
|
|
277
|
+
|
|
278
|
+
1. **Always use `--json`** for all debug commands (`attach`, `vars`, `stack`, `step`) — human output is not machine-parseable
|
|
279
|
+
2. **Attach BEFORE trigger** — start `debug attach --json` in background first, wait for `"Listener active"`, THEN fire the trigger (`unit`/`pull`/`run`)
|
|
280
|
+
3. **Never pull to trigger** if a simpler trigger works — use `unit` when a test exists, `run` for a class runner; use `pull` only when the bug is specifically in the pull flow
|
|
281
|
+
4. **Never pass `--session`** to `step/vars/stack` — it bypasses the daemon and causes errors
|
|
282
|
+
5. **Always finish with `step --type continue --json`** — releases the frozen ABAP work process
|
|
283
|
+
|
|
284
|
+
**Finding the right line number for a breakpoint:**
|
|
285
|
+
|
|
286
|
+
Use `view --full --lines` to get assembled-source global line numbers (the `G` column) — these are the coordinates ADT accepts for breakpoints:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
abapgit-agent view --objects ZCL_FOO --full --lines
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Output format: `G [N] code` where `G` = global line (use with `debug set`) and `[N]` = include-relative (for navigation only).
|
|
293
|
+
|
|
252
294
|
```bash
|
|
253
|
-
|
|
254
|
-
abapgit-agent debug set --objects ZCL_FOO:
|
|
255
|
-
abapgit-agent run --class ZCL_MY_RUNNER # execute and inspect output
|
|
295
|
+
# Example: METHOD do_something. starts at global line 87
|
|
296
|
+
abapgit-agent debug set --objects ZCL_FOO:90 # set BP a few lines after METHOD statement
|
|
256
297
|
```
|
|
257
|
-
|
|
258
|
-
|
|
298
|
+
|
|
299
|
+
Minimal correct sequence:
|
|
300
|
+
```bash
|
|
301
|
+
abapgit-agent debug set --objects ZCL_FOO:42 # 1. set breakpoint
|
|
302
|
+
abapgit-agent debug attach --json > /tmp/a.json 2>&1 & # 2. attach (background)
|
|
303
|
+
until grep -q "Listener active" /tmp/a.json 2>/dev/null; do sleep 0.3; done
|
|
304
|
+
abapgit-agent unit --files src/zcl_foo.clas.testclasses.abap > /tmp/t.json 2>&1 & # 3. trigger
|
|
305
|
+
# poll for session, then inspect
|
|
306
|
+
abapgit-agent debug vars --json
|
|
307
|
+
abapgit-agent debug step --type continue --json # 4. release
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
→ See `guidelines/debug-session.md` — run: `abapgit-agent ref --topic debug-session`
|
|
259
311
|
|
|
260
312
|
---
|
|
261
313
|
|
|
@@ -294,7 +346,7 @@ See **AI Tool Guidelines** below for how to react to each setting.
|
|
|
294
346
|
### Branch Workflow (`"mode": "branch"`)
|
|
295
347
|
|
|
296
348
|
Always work on feature branches. Before every `pull`: rebase to default branch. On completion: create PR with squash merge.
|
|
297
|
-
→ See `guidelines/branch-workflow.md`
|
|
349
|
+
→ See `guidelines/branch-workflow.md` — run: `abapgit-agent ref --topic branch-workflow`
|
|
298
350
|
|
|
299
351
|
### Trunk Workflow (`"mode": "trunk"`)
|
|
300
352
|
|
|
@@ -363,6 +415,12 @@ abapgit-agent pull --files src/zcl_auth_handler.clas.abap
|
|
|
363
415
|
1. ✗ Do not run `abapgit-agent transport create`
|
|
364
416
|
2. ✓ Inform the user that transport creation is disabled for this project
|
|
365
417
|
|
|
418
|
+
**When pull result contains `missing_abapgit_xml: true` (JSON mode) or warning about `.abapgit.xml`:**
|
|
419
|
+
1. ✓ Inform the user that `.abapgit.xml` is missing from the repository root
|
|
420
|
+
2. ✓ Suggest running `abapgit-agent init --package <PACKAGE>` to create it
|
|
421
|
+
3. ✓ If `ACTIVATED_COUNT=0` with an empty log, suspect this as the cause
|
|
422
|
+
4. ✗ Do not retry the pull — fix the missing file first
|
|
423
|
+
|
|
366
424
|
**When `transports.allowRelease = false`:**
|
|
367
425
|
1. ✗ Do not run `abapgit-agent transport release`
|
|
368
426
|
2. ✓ Inform the user that transport release is disabled for this project
|
|
@@ -384,12 +442,19 @@ Modified ABAP files?
|
|
|
384
442
|
└─ ✅ Use: skip syntax → commit → push → pull → (if errors: inspect)
|
|
385
443
|
```
|
|
386
444
|
|
|
387
|
-
→ See `guidelines/workflow-detailed.md`
|
|
445
|
+
→ See `guidelines/workflow-detailed.md` — run: `abapgit-agent ref --topic workflow-detailed`
|
|
388
446
|
|
|
389
447
|
---
|
|
390
448
|
|
|
391
449
|
## Guidelines Index
|
|
392
450
|
|
|
451
|
+
> **Note:** If the `guidelines/` folder doesn't exist in your repo, the `ref` command
|
|
452
|
+
> automatically uses bundled guidelines from the package. Access them with:
|
|
453
|
+
> ```bash
|
|
454
|
+
> abapgit-agent ref --topic <topic> # e.g. ref --topic sql
|
|
455
|
+
> abapgit-agent ref "<pattern>" # e.g. ref "SELECT"
|
|
456
|
+
> ```
|
|
457
|
+
|
|
393
458
|
Detailed guidelines are available in the `guidelines/` folder:
|
|
394
459
|
|
|
395
460
|
| File | Topic |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ABAP Development
|
|
2
|
+
|
|
3
|
+
This project uses [abapgit-agent](https://github.com/SylvosCai/abapgit-agent) for ABAP development.
|
|
4
|
+
|
|
5
|
+
## IMPORTANT: Before Writing Any ABAP Code
|
|
6
|
+
|
|
7
|
+
Read the full ABAP development guide by running:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
abapgit-agent guide
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This guide covers: development workflow, ABAP syntax guidelines, object naming, unit testing, and debugging.
|
|
14
|
+
|
|
15
|
+
> **Humans:** Full guide online at https://sylvoscai.github.io/abapgit-agent/pages/abap-coding-guidelines.html
|
|
16
|
+
|
|
17
|
+
## Accessing Guidelines
|
|
18
|
+
|
|
19
|
+
Search by keyword to find which file covers a topic, then read the full file with `--topic`:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Find files matching a keyword
|
|
23
|
+
abapgit-agent ref "debug session"
|
|
24
|
+
|
|
25
|
+
# Read a full guideline file by filename stem
|
|
26
|
+
abapgit-agent ref --topic debug-session # guidelines/debug-session.md
|
|
27
|
+
abapgit-agent ref --topic workflow-detailed # guidelines/workflow-detailed.md
|
|
28
|
+
abapgit-agent ref --topic object-creation # guidelines/object-creation.md
|
|
29
|
+
abapgit-agent ref --topic branch-workflow # guidelines/branch-workflow.md
|
|
30
|
+
abapgit-agent ref --topic debug-dump # guidelines/debug-dump.md
|
|
31
|
+
abapgit-agent ref --topic run-probe-classes # guidelines/run-probe-classes.md
|
|
32
|
+
abapgit-agent ref --topic cds-testing # guidelines/cds-testing.md
|
|
33
|
+
|
|
34
|
+
# Also available: sql, cds, exceptions, json, testing, objects, abapgit, classes, ...
|
|
35
|
+
abapgit-agent ref --list-topics
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The `ref` command uses bundled guidelines automatically — no local `guidelines/` folder needed.
|
|
39
|
+
|
|
40
|
+
## Project-Specific Naming Conventions
|
|
41
|
+
|
|
42
|
+
See `guidelines/objects.local.md` for this project's naming convention overrides.
|
|
@@ -20,8 +20,7 @@ Test Class | zcl_*.clas.testclasses.abap | zcl_*.clas.xml
|
|
|
20
20
|
Interface | zif_*.intf.abap | zif_*.intf.xml
|
|
21
21
|
Program | z*.prog.abap | z*.prog.xml
|
|
22
22
|
Table | z*.tabl.abap | z*.tabl.xml
|
|
23
|
-
CDS View
|
|
24
|
-
CDS Entity | ze_*.ddlx.asddlx | ze_*.ddlx.xml
|
|
23
|
+
CDS View (DDLS) | zc_*.ddls.asddls | zc_*.ddls.xml
|
|
25
24
|
Data Element | z*.dtel.abap | z*.dtel.xml
|
|
26
25
|
Structure | z*.stru.abap | z*.stru.xml
|
|
27
26
|
Table Type | z*.ttyp.abap | z*.ttyp.xml
|
|
@@ -33,7 +32,7 @@ Key XML Settings:
|
|
|
33
32
|
Class STATE: 1=Active
|
|
34
33
|
Table TABCLASS: TRANSP, POOL, CLUSTER
|
|
35
34
|
Table DELIVERY: A=Application, C=Customizing
|
|
36
|
-
CDS SOURCE_TYPE:
|
|
35
|
+
CDS SOURCE_TYPE: W=View Entity (modern), V=View (legacy)
|
|
37
36
|
Test Class XML: <WITH_UNIT_TESTS>X</WITH_UNIT_TESTS>
|
|
38
37
|
Local Classes: <CLSCCINCL>X</CLSCCINCL>
|
|
39
38
|
```
|
|
@@ -175,44 +174,12 @@ abapGit needs XML files to:
|
|
|
175
174
|
|
|
176
175
|
---
|
|
177
176
|
|
|
178
|
-
### CDS View Entity (DDLS)
|
|
179
|
-
|
|
180
|
-
**Use by default when user says "create CDS view"**
|
|
181
|
-
|
|
182
|
-
**Filename**: `src/zc_my_entity.ddls.xml`
|
|
183
|
-
|
|
184
|
-
```xml
|
|
185
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
186
|
-
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DDLS" serializer_version="v1.0.0">
|
|
187
|
-
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
|
188
|
-
<asx:values>
|
|
189
|
-
<DDLS>
|
|
190
|
-
<DDLNAME>ZC_MY_ENTITY</DDLNAME>
|
|
191
|
-
<DDLANGUAGE>E</DDLANGUAGE>
|
|
192
|
-
<DDTEXT>My CDS View Entity</DDTEXT>
|
|
193
|
-
<SOURCE_TYPE>W</SOURCE_TYPE>
|
|
194
|
-
</DDLS>
|
|
195
|
-
</asx:values>
|
|
196
|
-
</asx:abap>
|
|
197
|
-
</abapGit>
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**Key Points for CDS View Entities**:
|
|
201
|
-
1. **ABAP file extension**: Use `.ddls.asddls` (NOT `.ddls.abap`)
|
|
202
|
-
2. **XML file**: Use `.ddls.xml`
|
|
203
|
-
3. **DDLNAME**: Must match the CDS view entity name in the source
|
|
204
|
-
4. **SOURCE_TYPE**: `W` = View Entity (modern, recommended)
|
|
205
|
-
5. **Serializer**: Use `LCL_OBJECT_DDLS`
|
|
206
|
-
6. **Source file**: Use `define view entity` (no `@AbapCatalog.sqlViewName`)
|
|
207
|
-
|
|
208
|
-
---
|
|
209
|
-
|
|
210
|
-
### CDS View (DDLS) - Legacy Only
|
|
211
|
-
|
|
212
|
-
**Only use when explicitly requested (e.g., "create legacy CDS view")**
|
|
177
|
+
### CDS View / View Entity (DDLS)
|
|
213
178
|
|
|
214
179
|
**Filename**: `src/zc_my_view.ddls.xml`
|
|
215
180
|
|
|
181
|
+
The XML format is identical for both types — only `SOURCE_TYPE` differs:
|
|
182
|
+
|
|
216
183
|
```xml
|
|
217
184
|
<?xml version="1.0" encoding="utf-8"?>
|
|
218
185
|
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DDLS" serializer_version="v1.0.0">
|
|
@@ -222,22 +189,17 @@ abapGit needs XML files to:
|
|
|
222
189
|
<DDLNAME>ZC_MY_VIEW</DDLNAME>
|
|
223
190
|
<DDLANGUAGE>E</DDLANGUAGE>
|
|
224
191
|
<DDTEXT>My CDS View</DDTEXT>
|
|
225
|
-
<SOURCE_TYPE>
|
|
192
|
+
<SOURCE_TYPE>W</SOURCE_TYPE>
|
|
226
193
|
</DDLS>
|
|
227
194
|
</asx:values>
|
|
228
195
|
</asx:abap>
|
|
229
196
|
</abapGit>
|
|
230
197
|
```
|
|
231
198
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
2. **XML file**: Use `.ddls.xml`
|
|
235
|
-
3. **DDLNAME**: Must match the CDS view name in the source
|
|
236
|
-
4. **SOURCE_TYPE**: `V` = View (legacy)
|
|
237
|
-
5. **Serializer**: Use `LCL_OBJECT_DDLS`
|
|
238
|
-
6. **Source file**: Must include `@AbapCatalog.sqlViewName` annotation
|
|
199
|
+
- `SOURCE_TYPE W` → View Entity (`define view entity`, modern, **use by default**)
|
|
200
|
+
- `SOURCE_TYPE V` → View (`define view` + `@AbapCatalog.sqlViewName`, legacy — only if explicitly requested)
|
|
239
201
|
|
|
240
|
-
|
|
202
|
+
→ For DDL source syntax and full guidance: `abapgit-agent ref --topic cds-abapgit`
|
|
241
203
|
|
|
242
204
|
---
|
|
243
205
|
|