ApiLogicServer 15.3.0__py3-none-any.whl → 15.3.6__py3-none-any.whl
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.
- api_logic_server_cli/api_logic_server.py +2 -1
- api_logic_server_cli/create_from_model/api_logic_server_utils.py +3 -1
- api_logic_server_cli/prototypes/base/.github/.copilot-instructions.md +60 -14
- api_logic_server_cli/prototypes/base/docs/training/MCP_Copilot_Integration.md +295 -0
- api_logic_server_cli/prototypes/base/logic/readme_logic.md +38 -25
- api_logic_server_cli/prototypes/base/readme.md +1 -1
- api_logic_server_cli/prototypes/basic_demo/.github/.copilot-instructions.md +201 -25
- api_logic_server_cli/prototypes/basic_demo/.github/welcome.md +26 -0
- api_logic_server_cli/prototypes/basic_demo/customizations/logic/declare_logic.py +5 -0
- api_logic_server_cli/prototypes/basic_demo/docs/system-creation-vibe.md +2 -2
- api_logic_server_cli/prototypes/basic_demo/readme.md +1 -1
- api_logic_server_cli/prototypes/manager/.github/.copilot-instructions.md +164 -9
- api_logic_server_cli/prototypes/manager/README.md +1 -1
- api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/docs/system-creation-vibe.md +2 -2
- api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/logic/logic_discovery/check_credit.py +4 -1
- api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/readme.md +1 -1
- api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/readme_standard.md +1 -1
- api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/readme_vibe.md +2 -2
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/METADATA +1 -1
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/RECORD +24 -22
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/WHEEL +0 -0
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/entry_points.txt +0 -0
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/licenses/LICENSE +0 -0
- {apilogicserver-15.3.0.dist-info → apilogicserver-15.3.6.dist-info}/top_level.txt +0 -0
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Copilot Instructions for
|
|
3
|
-
Description: Project-level instructions for
|
|
4
|
-
Source: ApiLogicServer-src/prototypes/
|
|
5
|
-
Propagation: CLI create command → created projects
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
title: Copilot Instructions for GenAI-Logic Projects
|
|
3
|
+
Description: Project-level instructions for working with generated projects
|
|
4
|
+
Source: ApiLogicServer-src/prototypes/base/.github/.copilot-instructions.md
|
|
5
|
+
Propagation: CLI create command → created projects (non-basic_demo)
|
|
6
|
+
Instrucions: Changes must be copied to api_logic_server_cli/prototypes/basic_demo/.github - see instructions there
|
|
7
|
+
Usage: AI assistants read this when user opens any created project
|
|
8
|
+
version: 2.4
|
|
8
9
|
changelog:
|
|
9
|
-
- 2.4
|
|
10
|
-
- 2.3 (
|
|
11
|
-
- 2.2 (Oct 2025
|
|
12
|
-
- 2.1 (Oct 2025) - Streamlined OBX
|
|
13
|
-
- 2.0 (Oct 2025) - Added
|
|
10
|
+
- 2.4 (Nov 05, 2025 - Added MCP Integration section, Copilot as MCP client capability)
|
|
11
|
+
- 2.3 (Nov 04, 2025 - Clear 1st message about reading Welcome section verbatim, again for non basic_demo)
|
|
12
|
+
- 2.2 (Oct 29, 2025 - Clear 1st message about reading Welcome section verbatim)
|
|
13
|
+
- 2.1 (Oct 2025) - Streamlined OBX for non-tutorial projects, friendly collaborative tone
|
|
14
|
+
- 2.0 (Oct 2025) - Added front matter, updated for OBX improvements
|
|
15
|
+
- 1.0 (Initial) - Comprehensive technical reference
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
# GitHub Copilot Instructions for GenAI-Logic (aka API Logic Server) Projects
|
|
17
19
|
|
|
18
|
-
**INSTRUCTION**: When the user asks you to
|
|
20
|
+
**INSTRUCTION**: When the user asks you to load these instructions, respond with the Welcome section content below as your greeting. Do not add preamble like "I've read the instructions" - just present the Welcome content directly. The Welcome section ends at the "---" marker before "🔑 Key Technical Points".
|
|
19
21
|
|
|
20
22
|
## Welcome
|
|
21
23
|
|
|
@@ -39,20 +41,94 @@ This is a complete, working microservice auto-generated from a database schema -
|
|
|
39
41
|
|
|
40
42
|
---
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
**DO NOT include the content below in the welcome greeting. It is reference material only.**
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
## Here are some things I can help you with
|
|
47
|
+
|
|
48
|
+
1. **Add business logic** - Describe your requirements in natural language, I'll generate declarative rules
|
|
49
|
+
2. **Customize the API** - Add custom endpoints for your specific needs
|
|
50
|
+
3. **Create custom UIs** - Build React apps with `genai-logic genai-add-app --vibe`
|
|
51
|
+
4. **Add security** - Set up role-based access control with `genai-logic add-auth`
|
|
52
|
+
5. **Test your logic** - Create Behave tests with requirements traceability
|
|
53
|
+
6. **Configure Admin UI** - Customize the auto-generated admin interface
|
|
54
|
+
7. **Query via natural language** - I can act as MCP client to read/update data (see `docs/training/MCP_Copilot_Integration.md`)
|
|
55
|
+
8. **Create B2B APIs** - Complex integration endpoints with partner systems
|
|
56
|
+
9. **Add events** - Integrate with Kafka, webhooks, or other event systems
|
|
57
|
+
10. **Customize models** - Add tables, attributes, or derived fields
|
|
58
|
+
11. **Discovery systems** - Auto-load logic and APIs from discovery folders
|
|
59
|
+
|
|
60
|
+
Want to get started? Press **F5** to start the server with debugger support, then open `http://localhost:5656`. (There are also run configurations for running tests and other tasks.) Or just ask me what you'd like to work on.
|
|
45
61
|
|
|
46
62
|
---
|
|
47
63
|
|
|
48
|
-
|
|
64
|
+
## 🔑 Key Technical Points
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**DO NOT create your own summary. DO NOT rephrase. Copy the text above exactly.**
|
|
49
68
|
|
|
50
|
-
|
|
51
|
-
If it's not already set, we can often find a `venv` in the GenAI-Logic Manager - a parent or grandparent directory.
|
|
69
|
+
The technical reference sections below are for later consultation when working on specific tasks.
|
|
52
70
|
|
|
53
|
-
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Welcome (Reference Copy)
|
|
74
|
+
|
|
75
|
+
| # | Service | Description |
|
|
76
|
+
|---|---------|-------------|
|
|
77
|
+
| 1️⃣ | **Add business logic** | Describe your requirements in natural language, I'll generate declarative rules |
|
|
78
|
+
| 2️⃣ | **Customize the API** | Add custom endpoints for your specific needs |
|
|
79
|
+
| 3️⃣ | **Create custom UIs** | Build React apps with `genai-logic genai-add-app --vibe` |
|
|
80
|
+
| 4️⃣ | **Add security** | Set up role-based access control with `genai-logic add-auth` |
|
|
81
|
+
| 5️⃣ | **Test your logic** | Create Behave tests with requirements traceability |
|
|
82
|
+
| 6️⃣ | **Configure Admin UI** | Customize the auto-generated admin interface |
|
|
83
|
+
| 7️⃣ | **Add MCP integration** | Enable Model Context Protocol for external AI access |
|
|
84
|
+
| 8️⃣ | **Create B2B APIs** | Complex integration endpoints with partner systems |
|
|
85
|
+
| 9️⃣ | **Add events** | Integrate with Kafka, webhooks, or other event systems |
|
|
86
|
+
| 🔟 | **Customize models** | Add tables, attributes, or derived fields |
|
|
87
|
+
| 1️⃣1️⃣ | **Discovery systems** | Auto-load logic and APIs from discovery folders |
|
|
88
|
+
|
|
89
|
+
---
|
|
54
90
|
|
|
55
|
-
|
|
91
|
+
Want to get started? Press **F5** to start the server with debugger support, then open `http://localhost:5656`. (There are also run configurations for running tests and other tasks.) Or just ask me what you'd like to work on.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## 🔑 Key Technical Points
|
|
96
|
+
|
|
97
|
+
**Critical Implementation Details:**
|
|
98
|
+
|
|
99
|
+
1. **Discovery Systems**:
|
|
100
|
+
- **Logic Discovery**: Business rules automatically loaded from `logic/logic_discovery/use_case.py` via `logic/logic_discovery/auto_discovery.py`
|
|
101
|
+
- **API Discovery**: Custom APIs automatically loaded from `api/api_discovery/[service_name].py` via `api/api_discovery/auto_discovery.py`
|
|
102
|
+
- Do NOT manually duplicate rule calls or API registrations
|
|
103
|
+
|
|
104
|
+
2. **API Record ID Pattern**: When creating records via custom APIs, use `session.flush()` before accessing the ID to ensure it's generated:
|
|
105
|
+
```python
|
|
106
|
+
session.add(sql_alchemy_row)
|
|
107
|
+
session.flush() # Ensures ID is generated
|
|
108
|
+
record_id = sql_alchemy_row.id
|
|
109
|
+
return {"message": "Success", "record_id": record_id}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
3. **Automatic Business Logic**: All APIs (standard and custom) automatically inherit LogicBank rules without additional code.
|
|
113
|
+
|
|
114
|
+
4. **CLI Commands**: Use `genai-logic --help` to see all available commands. When CLI commands exist for a task (e.g., `add-auth`, `genai-add-mcp-client`, `genai-add-app`), ALWAYS use them instead of manual configuration - they handle all setup correctly.
|
|
115
|
+
|
|
116
|
+
> **📋 Testing:** For comprehensive testing conventions, patterns, and examples, see `docs/training/testing.md` (555 lines - I'll read this before we create any tests)
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Detailed Service Documentation
|
|
121
|
+
|
|
122
|
+
The sections below provide complete details on each service. I'll reference these as needed when we work together.
|
|
123
|
+
|
|
124
|
+
### `venv` is required
|
|
125
|
+
|
|
126
|
+
To establish the virtual environment:
|
|
127
|
+
|
|
128
|
+
1. Attempt to find a `venv` folder in the parent or grandparent directory
|
|
129
|
+
2. Or, create it using requirements.txt
|
|
130
|
+
|
|
131
|
+
### Starting the server
|
|
56
132
|
|
|
57
133
|
```bash
|
|
58
134
|
python api_logic_server_run.py
|
|
@@ -182,6 +258,48 @@ When users provide natural language with multiple use cases like:
|
|
|
182
258
|
|
|
183
259
|
**NEVER put everything in `use_case.py`** - that defeats the discovery system purpose.
|
|
184
260
|
|
|
261
|
+
### MCP Integration - Acting as Database Client
|
|
262
|
+
|
|
263
|
+
**You (GitHub Copilot) can serve as an MCP client** to read and update database entities using natural language queries!
|
|
264
|
+
|
|
265
|
+
**Architecture**: This project implements **MCP Server Executor** - a business logic microservice that AI assistants interact with via authenticated REST API calls. See `docs/training/MCP_Copilot_Integration.md` for complete details.
|
|
266
|
+
|
|
267
|
+
**When users request database operations** (e.g., "list customers", "update credit limit", "what's the balance?"):
|
|
268
|
+
|
|
269
|
+
1. **Authenticate first** - Login to obtain JWT token:
|
|
270
|
+
```bash
|
|
271
|
+
curl -X POST http://localhost:5656/api/auth/login \
|
|
272
|
+
-H "Content-Type: application/json" \
|
|
273
|
+
-d '{"username":"admin","password":"p"}'
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
2. **Execute operations** - Use Bearer token for API calls:
|
|
277
|
+
```bash
|
|
278
|
+
# Read: List entities
|
|
279
|
+
curl -X GET http://localhost:5656/api/Customer/ \
|
|
280
|
+
-H "Authorization: Bearer {token}"
|
|
281
|
+
|
|
282
|
+
# Update: Change attributes (JSON:API format)
|
|
283
|
+
curl -X PATCH http://localhost:5656/api/Customer/ALFKI/ \
|
|
284
|
+
-H "Authorization: Bearer {token}" \
|
|
285
|
+
-H "Content-Type: application/vnd.api+json" \
|
|
286
|
+
-d '{"data": {"type": "Customer", "id": "ALFKI", "attributes": {"CreditLimit": 5000}}}'
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
3. **Handle constraint violations correctly** - Error code 2001 is SUCCESS!
|
|
290
|
+
- When LogicBank prevents invalid updates, report as: "✅ Business logic working - constraint prevented invalid operation"
|
|
291
|
+
- Example: "balance (2102.00) exceeds credit (1000.00)" = logic is protecting data integrity
|
|
292
|
+
|
|
293
|
+
**Natural Language Translation Examples**:
|
|
294
|
+
- "List customers" → `GET /api/Customer/`
|
|
295
|
+
- "Show customer ALFKI" → `GET /api/Customer/ALFKI/`
|
|
296
|
+
- "Set ALFKI credit to 5000" → `PATCH /api/Customer/ALFKI/` with CreditLimit
|
|
297
|
+
- "What's ALFKI's balance?" → `GET /api/Customer/ALFKI/` then extract Balance attribute
|
|
298
|
+
|
|
299
|
+
**Key Principle**: Constraint violations (code 2001) demonstrate that declarative business logic is working correctly - celebrate these as successes, not failures!
|
|
300
|
+
|
|
301
|
+
See `docs/training/MCP_Copilot_Integration.md` for comprehensive guide including JSON:API payload formats, authentication workflows, and architecture details.
|
|
302
|
+
|
|
185
303
|
### Automated Testing
|
|
186
304
|
|
|
187
305
|
**CRITICAL WORKFLOW - When User Says "Create Tests":**
|
|
@@ -398,20 +516,20 @@ Customize using CoPilot chat, with `docs/training`.
|
|
|
398
516
|
|
|
399
517
|
Configure:
|
|
400
518
|
```
|
|
401
|
-
|
|
402
|
-
|
|
519
|
+
genai-logic add-auth --provider-type=sql --db-url=
|
|
520
|
+
genai-logic add-auth --provider-type=sql --db_url=postgresql://postgres:p@localhost/authdb
|
|
403
521
|
|
|
404
|
-
|
|
405
|
-
|
|
522
|
+
genai-logic add-auth --provider-type=keycloak --db-url=localhost
|
|
523
|
+
genai-logic add-auth --provider-type=keycloak --db-url=hardened
|
|
406
524
|
|
|
407
|
-
|
|
525
|
+
genai-logic add-auth --provider-type=None # to disable
|
|
408
526
|
```
|
|
409
527
|
|
|
410
528
|
Keycloak quick start [(more information here:)](https://apilogicserver.github.io/Docs/Security-Keycloak/)
|
|
411
529
|
```bash
|
|
412
530
|
cd devops/keycloak
|
|
413
531
|
docker compose up
|
|
414
|
-
|
|
532
|
+
genai-logic add-auth --provider-type=keycloak --db-url=localhost
|
|
415
533
|
```
|
|
416
534
|
|
|
417
535
|
For more on KeyCloak: https://apilogicserver.github.io/Docs/Security-Keycloak/
|
|
@@ -422,6 +540,64 @@ Declaration:
|
|
|
422
540
|
Grant(on_entity=Customer, to_role=sales, filter=lambda: Customer.SalesRep == current_user())
|
|
423
541
|
```
|
|
424
542
|
|
|
543
|
+
|
|
544
|
+
#### Testing with Security Enabled
|
|
545
|
+
|
|
546
|
+
**CRITICAL:** When `SECURITY_ENABLED=True`, test code must obtain and include JWT authentication tokens.
|
|
547
|
+
|
|
548
|
+
**Pattern for test steps:**
|
|
549
|
+
```python
|
|
550
|
+
from pathlib import Path
|
|
551
|
+
import os
|
|
552
|
+
from dotenv import load_dotenv
|
|
553
|
+
|
|
554
|
+
# Load config to check SECURITY_ENABLED
|
|
555
|
+
config_path = Path(__file__).parent.parent.parent.parent.parent / 'config' / 'default.env'
|
|
556
|
+
load_dotenv(config_path)
|
|
557
|
+
|
|
558
|
+
# Cache for auth token (obtained once per test session)
|
|
559
|
+
_auth_token = None
|
|
560
|
+
|
|
561
|
+
def get_auth_token():
|
|
562
|
+
"""Login and get JWT token if security is enabled"""
|
|
563
|
+
global _auth_token
|
|
564
|
+
|
|
565
|
+
if _auth_token is not None:
|
|
566
|
+
return _auth_token
|
|
567
|
+
|
|
568
|
+
# Login with default admin credentials
|
|
569
|
+
login_url = f'{BASE_URL}/api/auth/login'
|
|
570
|
+
login_data = {'username': 'admin', 'password': 'p'}
|
|
571
|
+
|
|
572
|
+
response = requests.post(login_url, json=login_data)
|
|
573
|
+
if response.status_code == 200:
|
|
574
|
+
_auth_token = response.json().get('access_token')
|
|
575
|
+
return _auth_token
|
|
576
|
+
else:
|
|
577
|
+
raise Exception(f"Login failed: {response.status_code}")
|
|
578
|
+
|
|
579
|
+
def get_headers():
|
|
580
|
+
"""Get headers including auth token if security is enabled"""
|
|
581
|
+
security_enabled = os.getenv('SECURITY_ENABLED', 'false').lower() not in ['false', 'no']
|
|
582
|
+
|
|
583
|
+
headers = {'Content-Type': 'application/json'}
|
|
584
|
+
|
|
585
|
+
if security_enabled:
|
|
586
|
+
token = get_auth_token()
|
|
587
|
+
if token:
|
|
588
|
+
headers['Authorization'] = f'Bearer {token}'
|
|
589
|
+
|
|
590
|
+
return headers
|
|
591
|
+
|
|
592
|
+
# Use in all API requests
|
|
593
|
+
response = requests.post(url=api_url, json=data, headers=get_headers())
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
**Key points:**
|
|
597
|
+
- Tests DO NOT automatically include auth headers - you must code this pattern
|
|
598
|
+
- Token is cached to avoid repeated logins during test session
|
|
599
|
+
- Pattern works for both `SECURITY_ENABLED=True` and `SECURITY_ENABLED=False`
|
|
600
|
+
- See `test/api_logic_server_behave/features/steps/order_processing_steps.py` for complete example
|
|
425
601
|
### Adding Custom API Endpoints
|
|
426
602
|
|
|
427
603
|
For simple endpoints:
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
use: welcome for basic_demo - please start the tour
|
|
3
|
+
instuctions: copy api_logic_server_cli/prototypes/base/.github/.copilot-instructions.md, then paste as the Welcome section
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Welcome
|
|
7
|
+
|
|
8
|
+
**Welcome! This is your basic_demo project.**
|
|
9
|
+
|
|
10
|
+
This is a complete, working microservice auto-generated from a database schema - **uncustomized**, so you can see what to expect when you create projects from your own databases.
|
|
11
|
+
|
|
12
|
+
**What's already created from introspecting the database schema:**
|
|
13
|
+
- **Admin Web Application** - Live at `http://localhost:5656`
|
|
14
|
+
- **REST API Endpoints** - All database tables exposed at `/api/*`
|
|
15
|
+
- **Database Models** - Complete SQLAlchemy ORM in `database/models.py`
|
|
16
|
+
- **Authentication System** - JWT-based auth framework
|
|
17
|
+
- **Business Logic Engine** - Declarative rules system
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
**First, we'll briefly explore what's automatically created. Then I'll show you how I can help you customize it - adding logic, security, and API endpoints.**
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
**Ready to explore?** Open `tutor.md` and tell me "guide me through" to begin the interactive tutorial.
|
|
25
|
+
|
|
26
|
+
---
|
|
@@ -47,7 +47,12 @@ def declare_logic():
|
|
|
47
47
|
|
|
48
48
|
Use case: App Integration
|
|
49
49
|
1. Send the Order to Kafka topic 'order_shipping' if the date_shipped is not None.
|
|
50
|
+
|
|
50
51
|
Also, using logic/logic_discovery is a Best Practice - see logic/readme_logic.md
|
|
52
|
+
|
|
53
|
+
The 5 *declarative* lines below represent the same logic as 200 lines of *declarative* Python
|
|
54
|
+
1. To view the AI procedural/declarative comparison, [click here](https://github.com/ApiLogicServer/ApiLogicServer-src/blob/main/api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md)
|
|
55
|
+
2. Consider a 100 table system: 1,000 rules vs. 40,000 lines of code
|
|
51
56
|
'''
|
|
52
57
|
from database.models import Product, Order, Item, Customer, SysEmail
|
|
53
58
|
|
|
@@ -29,7 +29,7 @@ This is a record of how we created the system using CoPilot Chat (*Vibe*).
|
|
|
29
29
|
## Initialize CoPilot
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
Please
|
|
32
|
+
Please load `.github/.copilot-instructions.md`.
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
<br>
|
|
@@ -48,7 +48,7 @@ Create a database project from samples/dbs/basic_demo.sqlite
|
|
|
48
48
|
The project should automatically open a new window in VSCode. Again, open CoPilot and bootstrap it with: <br>
|
|
49
49
|
|
|
50
50
|
```bash title="Initialize CoPilot"
|
|
51
|
-
Please
|
|
51
|
+
Please load `.github/.copilot-instructions.md`**.
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Verify it as follows:
|
|
@@ -26,7 +26,7 @@ This illustrates basic [GenAI-Logic](https://www.genai-logic.com/product/key-fea
|
|
|
26
26
|
|
|
27
27
|
**Bootstrap Copilot:**
|
|
28
28
|
```bash title='🤖 Bootstrap Copilot by pasting the following into the chat'
|
|
29
|
-
Please
|
|
29
|
+
Please load `.github/.copilot-instructions.md`.
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<br>
|
|
@@ -4,8 +4,11 @@ Description: Manager-level instructions for creating projects
|
|
|
4
4
|
Source: ApiLogicServer-src/prototypes/manager/.github/.copilot-instructions.md
|
|
5
5
|
Propagation: BLT process → Manager workspace
|
|
6
6
|
Usage: AI assistants read this when user opens Manager workspace
|
|
7
|
-
|
|
7
|
+
User Activation: Say "What can I do here?" or "Help me get started"
|
|
8
|
+
version: 2.3
|
|
8
9
|
changelog:
|
|
10
|
+
- 2.3 (Nov 2025) - Added activation phrases, forcing welcome presentation
|
|
11
|
+
- 2.2 (Nov 2025) - Initial welcome instructions
|
|
9
12
|
- 2.1 (Oct 2025) - Added "What is the Project Manager?" orientation, friendly collaborative tone, conditional Quick Start for returning users
|
|
10
13
|
- 2.0 (Oct 2025) - OBX improvements, strengthen basic_demo as default path
|
|
11
14
|
- 1.0 (Initial) - Established project creation methods
|
|
@@ -13,11 +16,102 @@ changelog:
|
|
|
13
16
|
|
|
14
17
|
# GitHub Copilot Instructions for GenAI-Logic (aka API Logic Server) - Project Manager
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 👤 FOR USERS: How to Get Started
|
|
22
|
+
|
|
23
|
+
**When you open this workspace, say:**
|
|
24
|
+
- "What can I do here?"
|
|
25
|
+
- "Help me get started"
|
|
26
|
+
- "What is this workspace?"
|
|
27
|
+
|
|
28
|
+
This will trigger the appropriate welcome message based on whether you're new or returning.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## ⚠️ INSTRUCTION FOR AI ASSISTANTS
|
|
33
|
+
|
|
34
|
+
**When user says "Please load .github/.copilot-instructions.md" or similar:**
|
|
35
|
+
|
|
36
|
+
**IMMEDIATELY do this (silently, no commentary):**
|
|
37
|
+
|
|
38
|
+
1. Check if `basic_demo/` folder exists in workspace root
|
|
39
|
+
2. Present ONLY the appropriate welcome below - start your response with "Welcome!"
|
|
40
|
+
|
|
41
|
+
**CRITICAL - Your response must START with "Welcome!" - NO preamble allowed:**
|
|
42
|
+
- ❌ "I've loaded the instructions"
|
|
43
|
+
- ❌ "Let me check if basic_demo exists"
|
|
44
|
+
- ❌ "I'll read the file"
|
|
45
|
+
- ✅ Start directly with: "Welcome! This is the **Project Manager**..."
|
|
46
|
+
|
|
47
|
+
**Which welcome to show:**
|
|
48
|
+
- If NO basic_demo folder → Present "First Time Welcome"
|
|
49
|
+
- If basic_demo EXISTS → Present "Returning User Welcome"
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
# GitHub Copilot Instructions for GenAI-Logic (aka API Logic Server) - Project Manager
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## ⚠️ INSTRUCTION FOR AI ASSISTANTS
|
|
58
|
+
|
|
59
|
+
**User activation phrases:**
|
|
60
|
+
- "What can I do here?"
|
|
61
|
+
- "What is this workspace?"
|
|
62
|
+
- "Help me get started"
|
|
63
|
+
- "What should I work on?"
|
|
64
|
+
- OR when user first opens workspace and greets you
|
|
65
|
+
|
|
66
|
+
**When you see these phrases (or when reading these instructions), IMMEDIATELY:**
|
|
67
|
+
|
|
68
|
+
1. **Check if `basic_demo/` folder exists** in the workspace root (use list_dir or file_search)
|
|
69
|
+
2. **Present the appropriate welcome below** - NO preamble, NO summary
|
|
70
|
+
- If NO basic_demo folder → Present "First Time Welcome"
|
|
71
|
+
- If basic_demo EXISTS → Present "Returning User Welcome"
|
|
72
|
+
|
|
73
|
+
**CRITICAL - Do NOT:**
|
|
74
|
+
- Say "I've read the instructions"
|
|
75
|
+
- Say "Would you like me to check..."
|
|
76
|
+
- Summarize or describe the instructions
|
|
77
|
+
- Ask permission to check for basic_demo
|
|
78
|
+
|
|
79
|
+
**CRITICAL - DO:**
|
|
80
|
+
- Check for basic_demo folder immediately and silently
|
|
81
|
+
- Present the appropriate welcome content directly as your response
|
|
82
|
+
- Act like you're naturally greeting the user
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## First Time Welcome (NO basic_demo folder)
|
|
87
|
+
|
|
88
|
+
Welcome! This is the **Project Manager** - your workspace for creating and managing API Logic Server projects.
|
|
89
|
+
|
|
90
|
+
**What's here:**
|
|
91
|
+
- Sample databases you can use to create projects (`samples/dbs/`)
|
|
92
|
+
- Training materials and examples (`system/genai/examples/`)
|
|
93
|
+
- A shared virtual environment for all your projects (`venv/`)
|
|
94
|
+
- A place to create new projects (they'll appear as subdirectories)
|
|
95
|
+
|
|
96
|
+
> Note: Your virtual environment is automatically configured in most cases; verify it with `genai-logic` - if it's not there, activate the `venv` in this project.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
**Let's start with the 20-minute basic_demo tutorial - it's the best way to see what GenAI-Logic can do.**
|
|
17
101
|
|
|
18
|
-
|
|
102
|
+
Run this command:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
genai-logic create --project_name=basic_demo --db_url=basic_demo
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
After it runs, the project will auto-open with its own README and I'll guide you through a hands-on tour.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Returning User Welcome (basic_demo folder exists)
|
|
19
113
|
|
|
20
|
-
Welcome! This is the **Project Manager** -
|
|
114
|
+
Welcome! This is the **Project Manager** - your workspace for creating and managing API Logic Server projects.
|
|
21
115
|
|
|
22
116
|
**What's here:**
|
|
23
117
|
- Sample databases you can use to create projects (`samples/dbs/`)
|
|
@@ -25,14 +119,53 @@ Welcome! This is the **Project Manager** - think of it as your workspace for cre
|
|
|
25
119
|
- A shared virtual environment for all your projects (`venv/`)
|
|
26
120
|
- A place to create new projects (they'll appear as subdirectories)
|
|
27
121
|
|
|
28
|
-
|
|
29
|
-
|
|
122
|
+
> Note: Your virtual environment is automatically configured in most cases; verify it with `genai-logic` - if it's not there, activate the `venv` in this project.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
**Welcome back! Here's what I can help you with in the Manager workspace:**
|
|
127
|
+
|
|
128
|
+
**Creating New Projects:**
|
|
129
|
+
1. **Create from existing database** - Generate project from your database schema
|
|
130
|
+
2. **Create with GenAI** - Describe database + logic in natural language, get complete working system
|
|
131
|
+
3. **Create manually** - I'll help you design and build a database, then generate the project
|
|
132
|
+
|
|
133
|
+
**Working with Existing Projects:**
|
|
134
|
+
4. **Guide through basic_demo** - Take the interactive 30-45 min hands-on tour
|
|
135
|
+
5. **Customize projects** - Add logic, security, custom APIs, React apps, tests
|
|
136
|
+
6. **Review project structure** - Understand what was auto-generated
|
|
137
|
+
7. **Debug issues** - Help troubleshoot problems in your projects
|
|
138
|
+
|
|
139
|
+
**Learning & Examples:**
|
|
140
|
+
8. **Explore sample databases** - See what's in `samples/dbs/`
|
|
141
|
+
9. **Review GenAI examples** - Learn from `system/genai/examples/`
|
|
142
|
+
10. **Understand architecture** - Explain how the system works
|
|
143
|
+
|
|
144
|
+
**What would you like to work on?**
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Technical Reference (For AI - Do Not Present Unless Asked)
|
|
149
|
+
|
|
150
|
+
Welcome! This is the **Project Manager** - your workspace for creating and managing API Logic Server projects.
|
|
151
|
+
|
|
152
|
+
**What's here:**
|
|
153
|
+
- Sample databases you can use to create projects (`samples/dbs/`)
|
|
154
|
+
- Training materials and examples (`system/genai/examples/`)
|
|
155
|
+
- A shared virtual environment for all your projects (`venv/`)
|
|
156
|
+
- A place to create new projects (they'll appear as subdirectories)
|
|
30
157
|
|
|
31
158
|
> Note: Your virtual environment is automatically configured in most cases; verify it with `genai-logic` - if it's not there, activate the `venv` in this project.
|
|
32
159
|
|
|
33
|
-
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Getting Started
|
|
34
163
|
|
|
35
|
-
|
|
164
|
+
**🎯 ACTION REQUIRED**: Check if `basic_demo/` folder exists in this workspace, then respond appropriately:
|
|
165
|
+
|
|
166
|
+
### If NO basic_demo folder exists (First Time):
|
|
167
|
+
|
|
168
|
+
**Welcome! Let's start with the 20-minute basic_demo tutorial - it's the best way to see what GenAI-Logic can do.**
|
|
36
169
|
|
|
37
170
|
Run this command:
|
|
38
171
|
|
|
@@ -42,7 +175,29 @@ genai-logic create --project_name=basic_demo --db_url=basic_demo
|
|
|
42
175
|
|
|
43
176
|
After it runs, the project will auto-open with its own README and I'll guide you through a hands-on tour.
|
|
44
177
|
|
|
45
|
-
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### If basic_demo folder EXISTS (Returning User):
|
|
181
|
+
|
|
182
|
+
**Welcome back! Here's what I can help you with in the Manager workspace:**
|
|
183
|
+
|
|
184
|
+
**Creating New Projects:**
|
|
185
|
+
1. **Create from existing database** - Generate project from your database schema
|
|
186
|
+
2. **Create with GenAI** - Describe database + logic in natural language, get complete working system
|
|
187
|
+
3. **Create manually** - I'll help you design and build a database, then generate the project
|
|
188
|
+
|
|
189
|
+
**Working with Existing Projects:**
|
|
190
|
+
4. **Guide through basic_demo** - Take the interactive 30-45 min hands-on tour
|
|
191
|
+
5. **Customize projects** - Add logic, security, custom APIs, React apps, tests
|
|
192
|
+
6. **Review project structure** - Understand what was auto-generated
|
|
193
|
+
7. **Debug issues** - Help troubleshoot problems in your projects
|
|
194
|
+
|
|
195
|
+
**Learning & Examples:**
|
|
196
|
+
8. **Explore sample databases** - See what's in `samples/dbs/`
|
|
197
|
+
9. **Review GenAI examples** - Learn from `system/genai/examples/`
|
|
198
|
+
10. **Understand architecture** - Explain how the system works
|
|
199
|
+
|
|
200
|
+
**What would you like to work on?**
|
|
46
201
|
|
|
47
202
|
<br>
|
|
48
203
|
|
|
@@ -21,7 +21,7 @@ Instructions: Copy in Sample-Basic-Demo (Replace "This illustrates" up to "Explo
|
|
|
21
21
|
|
|
22
22
|
**Bootstrap Copilot by pasting the following into the chat:**
|
|
23
23
|
```
|
|
24
|
-
Please
|
|
24
|
+
Please load `.github/.copilot-instructions.md`.
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
<br>
|
api_logic_server_cli/prototypes/manager/samples/basic_demo_sample/docs/system-creation-vibe.md
CHANGED
|
@@ -29,7 +29,7 @@ This is a record of how we created the system using CoPilot Chat (*Vibe*).
|
|
|
29
29
|
## Initialize CoPilot
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
Please
|
|
32
|
+
Please load `.github/.copilot-instructions.md`.
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
<br>
|
|
@@ -48,7 +48,7 @@ Create a database project from samples/dbs/basic_demo.sqlite
|
|
|
48
48
|
The project should automatically open a new window in VSCode. Again, open CoPilot and bootstrap it with: <br>
|
|
49
49
|
|
|
50
50
|
```bash title="Initialize CoPilot"
|
|
51
|
-
Please
|
|
51
|
+
Please load `.github/.copilot-instructions.md`**.
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Verify it as follows:
|
|
@@ -11,7 +11,10 @@ app_logger = logging.getLogger(__name__)
|
|
|
11
11
|
|
|
12
12
|
def declare_logic():
|
|
13
13
|
"""
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
The 5 *declarative* lines below represent the same logic as 200 lines of *declarative* Python
|
|
16
|
+
1. To view the AI procedural/declarative comparison, [click here](https://github.com/ApiLogicServer/ApiLogicServer-src/blob/main/api_logic_server_cli/prototypes/basic_demo/logic/procedural/declarative-vs-procedural-comparison.md)
|
|
17
|
+
2. Consider a 100 table system: 1,000 rules vs. 40,000 lines of code
|
|
15
18
|
|
|
16
19
|
Natural Language Requirements:
|
|
17
20
|
1. The Customer's balance is less than the credit limit
|
|
@@ -21,7 +21,7 @@ This illustrates basic [GenAI-Logic](https://www.genai-logic.com/product/key-fea
|
|
|
21
21
|
|
|
22
22
|
**🤖 Bootstrap Copilot by pasting the following into the chat:**
|
|
23
23
|
```bash title='🤖 Bootstrap Copilot by pasting the following into the chat'
|
|
24
|
-
Please
|
|
24
|
+
Please load `.github/.copilot-instructions.md`.
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
<br>
|
|
@@ -20,7 +20,7 @@ This illustrates basic [GenAI-Logic](https://www.genai-logic.com/product/key-fea
|
|
|
20
20
|
|
|
21
21
|
> 🤖 **Bootstrap Copilot by pasting the following into the chat:**
|
|
22
22
|
```
|
|
23
|
-
Please
|
|
23
|
+
Please load `.github/.copilot-instructions.md`.
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
<br>
|
|
@@ -19,7 +19,7 @@ This illustrates [GenAI-Logic](https://apilogicserver.github.io/Docs/Sample-Basi
|
|
|
19
19
|
|
|
20
20
|
**🤖 Bootstrap Copilot by pasting the following into the chat:**
|
|
21
21
|
``` bash title='🤖 Bootstrap Copilot by pasting the following into the chat'
|
|
22
|
-
Please
|
|
22
|
+
Please load `.github/.copilot-instructions.md`.
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
<br>
|
|
@@ -102,7 +102,7 @@ The project should automatically open a new window in VSCode. <br>
|
|
|
102
102
|
|
|
103
103
|
**🤖 Again, bootstrap Copilot by pasting the following into the chat:**
|
|
104
104
|
``` bash title='🤖 Again, bootstrap Copilot by pasting the following into the chat'
|
|
105
|
-
Please
|
|
105
|
+
Please load `.github/.copilot-instructions.md`.
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Run it as follows:
|