abapgit-agent 1.15.2 → 1.16.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.
@@ -1,264 +0,0 @@
1
- # ABAP Development with abapGit
2
-
3
- You are working on an ABAP project using abapGit for version control.
4
-
5
- ---
6
-
7
- ## Critical Rules
8
-
9
- ### 1. Use `ref` Command for Unfamiliar Topics
10
-
11
- **When starting to work on ANY unfamiliar ABAP topic, syntax, or pattern, you MUST use the `ref` command BEFORE writing any code.**
12
-
13
- ```
14
- ❌ WRONG: Start writing code immediately based on assumptions
15
- ✅ CORRECT: Run ref command first to look up the correct pattern
16
- ```
17
-
18
- **Why**: ABAP syntax is strict. Guessing leads to activation errors that waste time.
19
-
20
- | Scenario | Example |
21
- |----------|---------|
22
- | Implementing new ABAP feature | "How do I use FILTER operator?" |
23
- | Unfamiliar pattern | "What's the correct VALUE #() syntax?" |
24
- | SQL operations | "How to write a proper SELECT with JOIN?" |
25
- | CDS views | "How to define CDS view with associations?" |
26
- | Getting syntax errors | Check reference before trying approaches |
27
-
28
- ```bash
29
- # Search for a pattern
30
- abapgit-agent ref "CORRESPONDING"
31
- abapgit-agent ref "FILTER #"
32
-
33
- # Browse by topic
34
- abapgit-agent ref --topic exceptions
35
- abapgit-agent ref --topic sql
36
-
37
- # List all topics
38
- abapgit-agent ref --list-topics
39
- ```
40
-
41
- ### 2. Read `.abapGitAgent` for Folder Location and Naming Conventions
42
-
43
- **Before creating ANY ABAP object file, you MUST read `.abapGitAgent` to determine the correct folder.**
44
-
45
- ```
46
- ❌ WRONG: Assume files go in "abap/" folder
47
- ✅ CORRECT: Read .abapGitAgent to get the "folder" property value
48
- ```
49
-
50
- The folder is configured in `.abapGitAgent` (property: `folder`):
51
- - If `folder` is `/src/` → files go in `src/` (e.g., `src/zcl_my_class.clas.abap`)
52
- - If `folder` is `/abap/` → files go in `abap/` (e.g., `abap/zcl_my_class.clas.abap`)
53
-
54
- **Also check naming conventions before creating any new object:**
55
-
56
- ```
57
- 1. Check guidelines/objects.local.md ← project-specific overrides (if file exists)
58
- 2. Fall back to guidelines/objects.md ← default Z/Y prefix conventions
59
- ```
60
-
61
- `objects.local.md` is created by `abapgit-agent init` and is never overwritten by updates — it holds project-specific prefixes (e.g. `YCL_` instead of `ZCL_`).
62
-
63
- ### 3. Create XML Metadata / Local Classes
64
-
65
- Each ABAP object needs an XML metadata file. Local helper/test-double classes use separate `.locals_def.abap` / `.locals_imp.abap` files.
66
- → See `guidelines/object-creation.md` for XML templates and local class setup
67
-
68
- ### 4. Use Syntax Command Before Commit (for CLAS, INTF, PROG, DDLS)
69
-
70
- ```
71
- ❌ WRONG: Make changes → Commit → Push → Pull → Find errors → Fix → Repeat
72
- ✅ CORRECT: Make changes → Run syntax → Fix locally → Commit → Push → Pull → Done
73
- ```
74
-
75
- **For CLAS, INTF, PROG, DDLS files**: Run `syntax` command BEFORE commit to catch errors early.
76
-
77
- ```bash
78
- # Check syntax of local code (no commit/push needed)
79
- abapgit-agent syntax --files src/zcl_my_class.clas.abap
80
-
81
- # Check multiple INDEPENDENT files
82
- abapgit-agent syntax --files src/zcl_utils.clas.abap,src/zcl_logger.clas.abap
83
- ```
84
-
85
- **For dependent files, skip `syntax` and use `pull` instead:**
86
- ```bash
87
- # ❌ BAD - Interface and implementing class (may show false errors)
88
- abapgit-agent syntax --files src/zif_my_intf.intf.abap,src/zcl_my_class.clas.abap
89
-
90
- # ✅ GOOD - Use pull instead for dependent files
91
- git add . && git commit && git push
92
- abapgit-agent pull --files src/zif_my_intf.intf.abap,src/zcl_my_class.clas.abap
93
- ```
94
-
95
- ### 5. Local Helper / Test-Double Classes
96
-
97
- → See `guidelines/object-creation.md` for local class setup (`locals_def.abap` / `locals_imp.abap`)
98
-
99
- ### 6. Use `ref`, `view` and `where` Commands to Learn About Unknown Classes/Methods
100
-
101
- **When working with unfamiliar ABAP classes or methods, follow this priority:**
102
-
103
- ```
104
- 1. First: Check local git repo for usage examples
105
- 2. Second: Check ABAP reference/cheat sheets
106
- 3. Third: Use view/where commands to query ABAP system (if needed)
107
- ```
108
-
109
- ```bash
110
- # Find where a class/interface is USED
111
- abapgit-agent where --objects ZIF_UNKNOWN_INTERFACE
112
-
113
- # View CLASS DEFINITION
114
- abapgit-agent view --objects ZCL_UNKNOWN_CLASS
115
- ```
116
-
117
- ### 7. CDS Unit Tests
118
-
119
- Use `CL_CDS_TEST_ENVIRONMENT` for unit tests that read CDS views.
120
- → See `guidelines/cds-testing.md` for code examples
121
-
122
- ### 8. Use `unit` Command for Unit Tests
123
-
124
- **Use `abapgit-agent unit` to run ABAP unit tests (AUnit).**
125
-
126
- ```
127
- ❌ WRONG: Try to use SE24, SE37, or other transaction codes
128
- ✅ CORRECT: Use abapgit-agent unit --files src/zcl_test.clas.testclasses.abap
129
- ```
130
-
131
- ```bash
132
- # Run unit tests (after pulling to ABAP)
133
- abapgit-agent unit --files src/zcl_test.clas.testclasses.abap
134
-
135
- # Multiple test classes
136
- abapgit-agent unit --files src/zcl_test1.clas.testclasses.abap,src/zcl_test2.clas.testclasses.abap
137
- ```
138
-
139
- ### 9. Troubleshooting ABAP Issues
140
-
141
- | Symptom | Tool | When |
142
- |---|---|---|
143
- | HTTP 500 / runtime crash (ST22) | `dump` | Error already occurred |
144
- | Wrong output, no crash | `debug` | Need to trace logic |
145
-
146
- Quick start:
147
- ```bash
148
- abapgit-agent dump --date TODAY --detail 1 # inspect last crash
149
- abapgit-agent debug set --objects ZCL_FOO:42 # set breakpoint then attach
150
- ```
151
- → See `guidelines/debug-dump.md` for dump analysis workflow
152
- → See `guidelines/debug-session.md` for full debug session guide, breakpoint tips, and pull flow architecture
153
-
154
- ---
155
-
156
- ## Development Workflow
157
-
158
- This project's workflow mode is configured in `.abapGitAgent` under `workflow.mode`.
159
-
160
- ### Project-Level Config (`.abapgit-agent.json`)
161
-
162
- Checked into the repository — applies to all developers. **Read this file at the start of every session.**
163
-
164
- | Setting | Values | Default | Effect |
165
- |---------|--------|---------|--------|
166
- | `safeguards.requireFilesForPull` | `true`/`false` | `false` | Requires `--files` on every pull |
167
- | `safeguards.disablePull` | `true`/`false` | `false` | Disables pull entirely (CI/CD-only projects) |
168
- | `conflictDetection.mode` | `"abort"`/`"ignore"` | `"abort"` | Whether to abort pull on conflict |
169
- | `transports.allowCreate` | `true`/`false` | `true` | When `false`, `transport create` is blocked |
170
- | `transports.allowRelease` | `true`/`false` | `true` | When `false`, `transport release` is blocked |
171
-
172
- ### Workflow Modes
173
-
174
- | Mode | Branch Strategy | Rebase Before Pull | Create PR |
175
- |------|----------------|-------------------|-----------|
176
- | `"branch"` | Feature branches | ✓ Always | ✓ Yes (squash merge) |
177
- | `"trunk"` | Direct to default branch | ✗ No | ✗ No |
178
- | (not set) | Direct to default branch | ✗ No | ✗ No |
179
-
180
- ### Trunk Workflow (`"mode": "trunk"`)
181
-
182
- ```bash
183
- git checkout main
184
- git pull origin main
185
- edit src/zcl_auth_handler.clas.abap
186
- abapgit-agent syntax --files src/zcl_auth_handler.clas.abap
187
- git add . && git commit -m "feat: add authentication handler"
188
- git push origin main
189
- abapgit-agent pull --files src/zcl_auth_handler.clas.abap
190
- ```
191
-
192
- ### Branch Workflow (`"mode": "branch"`)
193
-
194
- → See `guidelines/branch-workflow.md` for step-by-step commands and examples
195
-
196
- ### AI Tool Guidelines
197
-
198
- **When `workflow.mode = "branch"`:**
199
- 1. ✓ Create feature branches (naming: `feature/description`)
200
- 2. ✓ Always `git fetch origin <default> && git rebase origin/<default>` before `pull` command
201
- 3. ✓ Use `--force-with-lease` after rebase (never `--force`)
202
- 4. ✓ Create PR with squash merge when feature complete
203
- 5. ✗ Never commit directly to default branch
204
-
205
- **When `workflow.mode = "trunk"` or not set:**
206
- 1. ✓ Commit directly to default branch
207
- 2. ✓ `git pull origin <default>` before push
208
- 3. ✗ Don't create feature branches
209
-
210
- **When `safeguards.requireFilesForPull = true`:** always include `--files` in every `pull` command
211
-
212
- **When `safeguards.disablePull = true`:** do not run `abapgit-agent pull` at all
213
-
214
- **When `conflictDetection.mode = "abort"`:** if pull aborts with conflict error, inform user and suggest `--conflict-mode ignore` to override for that run
215
-
216
- ### Quick Decision Tree
217
-
218
- ```
219
- Modified ABAP files?
220
- ├─ CLAS/INTF/PROG/DDLS files?
221
- │ ├─ Independent files (no cross-dependencies)?
222
- │ │ └─ ✅ Use: syntax → commit → push → pull
223
- │ └─ Dependent files (interface + class, class uses class)?
224
- │ └─ ✅ Use: skip syntax → commit → push → pull
225
- └─ Other types (FUGR, TABL, etc.)?
226
- └─ ✅ Use: skip syntax → commit → push → pull → (if errors: inspect)
227
- ```
228
-
229
- → See `guidelines/workflow-detailed.md` for full workflow decision tree, error indicators, and complete command reference
230
-
231
- ---
232
-
233
- ## Guidelines Index
234
-
235
- Detailed guidelines are available in the `guidelines/` folder:
236
-
237
- | File | Topic |
238
- |------|-------|
239
- | `guidelines/sql.md` | ABAP SQL Best Practices |
240
- | `guidelines/exceptions.md` | Exception Handling |
241
- | `guidelines/testing.md` | Unit Testing (including CDS) |
242
- | `guidelines/cds.md` | CDS Views |
243
- | `guidelines/classes.md` | ABAP Classes and Objects |
244
- | `guidelines/objects.md` | Object Naming Conventions (defaults) |
245
- | `guidelines/objects.local.md` | **Project** Naming Conventions — overrides `objects.md` (never overwritten) |
246
- | `guidelines/json.md` | JSON Handling |
247
- | `guidelines/abapgit.md` | abapGit XML Metadata Templates |
248
- | `guidelines/unit-testable-code.md` | Unit Testable Code Guidelines (Dependency Injection) |
249
- | `guidelines/common-errors.md` | Common ABAP Errors - Quick Fixes |
250
- | `guidelines/debug-session.md` | Debug Session Guide |
251
- | `guidelines/debug-dump.md` | Dump Analysis Guide |
252
- | `guidelines/branch-workflow.md` | Branch Workflow |
253
- | `guidelines/workflow-detailed.md` | Development Workflow (Detailed) |
254
- | `guidelines/object-creation.md` | Object Creation (XML metadata, local classes) |
255
- | `guidelines/cds-testing.md` | CDS Testing (Test Double Framework) |
256
-
257
- These guidelines are automatically searched by the `ref` command.
258
-
259
- ---
260
-
261
- ## For More Information
262
-
263
- - [SAP ABAP Cheat Sheets](https://github.com/SAP-samples/abap-cheat-sheets)
264
- - [ABAP Keyword Documentation](https://help.sap.com/doc/abapdocu_cp_index_htm/CLOUD/en-US/index.htm)