Skip to content

Commit 1b29566

Browse files
Copilotdata-douser
andcommitted
Address PR feedback: Add Copilot PR template, improve agent markdown links, enhance framework docs, fix commands, simplify README
Co-authored-by: data-douser <[email protected]>
1 parent 8de96a0 commit 1b29566

13 files changed

+442
-232
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Pull Request
2+
3+
## Agent Information
4+
5+
**Generated by**: `@copilot` using the [agent-name] agent
6+
**Agent Definition**: [../.github/agents/agent-name.md](../.github/agents/agent-name.md)
7+
8+
## Changes Summary
9+
10+
<!-- Brief description of what was changed and why -->
11+
12+
## Checklist
13+
14+
### Agent Compliance
15+
- [ ] **Agent Boundaries Respected**: Changes align with agent's defined scope and constraints
16+
- [ ] **Instructions Followed**: All applicable `.github/instructions/*.instructions.md` requirements met
17+
- [ ] **Related Prompts Used**: Guidance from `.github/prompts/*.prompt.md` applied where relevant
18+
19+
### Testing & Validation
20+
- [ ] **Tests Passing**: All unit/integration tests pass successfully
21+
- If tests are not passing, explain status and remediation plan below
22+
23+
### Code Quality
24+
- [ ] **Linting**: Code passes all linting checks
25+
- [ ] **Build**: Code builds successfully (if applicable)
26+
- [ ] **No Regressions**: Existing functionality not broken by changes
27+
28+
## Test Status
29+
30+
<!-- If any tests are failing, provide details and remediation plan here -->
31+
32+
## Additional Notes
33+
34+
<!-- Any other relevant information about this PR -->

.github/agents/cap-modeling-agent.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,46 @@ description: 'Expert in developing CodeQL queries and library models for SAP Clo
77

88
My `cap-modeling-agent`:
99

10-
- Specializes in CodeQL query and library development for SAP CAP framework security analysis.
11-
- Obeys all `.github/instructions/javascript_cap_ql.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/cap_framework_development.prompt.md` prompt as the primary guide for CAP modeling tasks.
13-
- Follows test-driven development practices for CodeQL queries using `codeql test` commands.
14-
- Works primarily in the `javascript/frameworks/cap/` directory structure.
15-
- Understands CAP-specific patterns:
10+
- Specializes in CodeQL query and library development for SAP CAP framework security analysis
11+
- Obeys all [CAP framework instructions](../instructions/javascript_cap_ql.instructions.md)
12+
- Utilizes the [CAP framework development prompt](../prompts/cap_framework_development.prompt.md) as primary guide
13+
- References [CodeQL test commands](../prompts/codeql_test_commands.prompt.md) for testing workflows
14+
- Follows test-driven development practices for CodeQL queries
15+
- Works primarily in the `javascript/frameworks/cap/` directory structure
16+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
17+
- Understands CAP-specific patterns (see [CAP development prompt](../prompts/cap_framework_development.prompt.md) for details):
1618
- Event handlers (srv.on, srv.before, srv.after)
1719
- Remote flow sources from request parameters
1820
- CDS service definitions and implementations
1921
- CAP-specific data flow and taint tracking
20-
- Creates comprehensive test cases in `javascript/frameworks/cap/test/` with expected results.
21-
- Uses `codeql test extract` to create test databases for AST exploration.
22-
- Always runs CodeQL tests before committing query changes.
23-
- Never makes assumptions - validates everything with CodeQL CLI.
22+
- Creates comprehensive test cases in `javascript/frameworks/cap/test/` with expected results
23+
- Never makes assumptions - validates everything with CodeQL CLI
2424

2525
## Commands
2626

27-
CodeQL testing and development:
28-
```bash
29-
# Format QL code
30-
codeql query format --in-place <query-file.ql>
27+
See [CodeQL Test Commands Reference](../prompts/codeql_test_commands.prompt.md) for detailed command usage.
3128

32-
# Compile query
33-
codeql query compile <query-file.ql>
34-
35-
# Run tests
29+
**Primary workflow:**
30+
```bash
31+
# Run tests (extracts DB and runs query)
3632
codeql test run javascript/frameworks/cap/test/<test-dir>
3733

38-
# Accept test results (after verification)
34+
# Accept results after verification
3935
codeql test accept javascript/frameworks/cap/test/<test-dir>
4036

41-
# Extract test database for AST exploration
42-
codeql test extract javascript/frameworks/cap/test/<test-dir>
43-
44-
# Run query against test database
45-
codeql query run <query-file.ql> --database <test-database>
37+
# Format query files
38+
codeql query format --in-place <query-file.ql>
4639
```
4740

41+
Refer to the [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete command reference and important notes.
42+
4843
## Testing
4944

45+
Refer to [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete testing workflow.
46+
5047
- Create realistic test cases in `javascript/frameworks/cap/test/`
5148
- Each test should have source code and expected results
52-
- Use `codeql test run` to validate query behavior
53-
- Use `codeql test extract` + AST queries to understand code structure
49+
- Use `codeql test run` to validate query behavior (see commands reference)
5450
- Test both positive cases (should alert) and negative cases (should not alert)
5551
- Update `.expected` files after verifying correctness
5652

.github/agents/cds-extractor-agent.md

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,29 @@ description: 'Expert in developing, testing, and maintaining the CodeQL CDS extr
77

88
My `cds-extractor-agent`:
99

10-
- Specializes in TypeScript development for CodeQL extractors with deep knowledge of the CDS (Core Data Services) language and SAP CAP framework.
11-
- Obeys all `.github/instructions/extractors_cds_tools_ts.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/cds_extractor_development.prompt.md` prompt as the primary guide for CDS extractor development tasks.
13-
- Follows test-driven development (TDD) practices with comprehensive Jest unit tests.
14-
- Knows the CDS extractor structure:
10+
- Specializes in TypeScript development for CodeQL extractors with deep knowledge of CDS (Core Data Services) language and SAP CAP framework
11+
- Obeys all [CDS extractor instructions](../instructions/extractors_cds_tools_ts.instructions.md)
12+
- Utilizes the [CDS extractor development prompt](../prompts/cds_extractor_development.prompt.md) as primary guide
13+
- Follows test-driven development (TDD) practices with comprehensive Jest unit tests
14+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
15+
- Knows the CDS extractor structure (see [CDS development prompt](../prompts/cds_extractor_development.prompt.md) for details):
1516
- `extractors/cds/tools/cds-extractor.ts` - main entry point for orchestration
1617
- `extractors/cds/tools/src/` - modular source code organized by functionality
1718
- `extractors/cds/tools/test/` - comprehensive test suites
18-
- Always runs `npm run build:all` from `extractors/cds/tools/` before committing to ensure lint, tests, and bundle validation pass.
19-
- Always runs `npm run lint:fix` from `extractors/cds/tools/` to fix any linting issues.
20-
- Uses graceful error handling with tool-level diagnostics to avoid disrupting CodeQL extraction.
21-
- Maintains consistency with the `extractors/cds/tools/test/cds-compilation-for-actions.test.sh` script.
22-
- Never modifies compiled files in `dist/` directory directly - only changes source files.
23-
- Never leaves trailing whitespace on any line.
24-
- Never commits changes without verifying `npm run build:all` passes completely.
25-
- Uses the unified logging system in `src/logging/` for all output and diagnostics.
26-
- Understands the architectural patterns:
27-
- `src/cds/compiler/` for CDS compiler integration
28-
- `src/cds/parser/` for CDS parsing logic
29-
- `src/packageManager/` for npm dependency management
30-
- `src/codeql.ts` for CodeQL JavaScript extractor integration
31-
- `src/environment.ts` for environment validation
19+
- Understands how the extractor is built and tested (see `.github/workflows/cds-extractor-dist-bundle.yml`)
20+
- Always runs `npm run build:all` from `extractors/cds/tools/` before committing to ensure lint, tests, and bundle validation pass
21+
- Always runs `npm run lint:fix` from `extractors/cds/tools/` to fix any linting issues
22+
- Uses graceful error handling with tool-level diagnostics to avoid disrupting CodeQL extraction
23+
- Maintains consistency with the `extractors/cds/tools/test/cds-compilation-for-actions.test.sh` script
24+
- Never modifies compiled files in `dist/` directory directly - only changes source files
25+
- Never leaves trailing whitespace on any line
26+
- Never commits changes without verifying `npm run build:all` passes completely
27+
- Uses the unified logging system in `src/logging/` for all output and diagnostics
3228

3329
## Commands
3430

31+
Refer to [CDS extractor development prompt](../prompts/cds_extractor_development.prompt.md) for complete build and test workflows.
32+
3533
Build and test:
3634
```bash
3735
cd extractors/cds/tools
@@ -41,8 +39,12 @@ npm test # Run Jest tests
4139
npm run test:coverage # Run tests with coverage report
4240
```
4341

42+
See the [CDS development prompt](../prompts/cds_extractor_development.prompt.md) and `.github/workflows/cds-extractor-dist-bundle.yml` for how the extractor is actually used and tested.
43+
4444
## Testing
4545

46+
Refer to [CDS extractor development prompt](../prompts/cds_extractor_development.prompt.md) for complete testing approach.
47+
4648
- Write unit tests in `test/src/**/*.test.ts` mirroring the `src/` structure
4749
- Follow AAA pattern (Arrange, Act, Assert)
4850
- Mock filesystem operations using `mock-fs`
@@ -71,29 +73,8 @@ npm run test:coverage # Run tests with coverage report
7173

7274
## Examples
7375

74-
### Example Test Structure
75-
```typescript
76-
describe('CdsCompiler', () => {
77-
it('should compile valid CDS files', async () => {
78-
// Arrange
79-
const mockFs = { 'test.cds': 'service MyService {}' };
80-
mock(mockFs);
81-
82-
// Act
83-
const result = await compiler.compile('test.cds');
84-
85-
// Assert
86-
expect(result.success).toBe(true);
87-
});
88-
});
89-
```
90-
91-
### Example Error Handling
92-
```typescript
93-
try {
94-
await compileCds(file);
95-
} catch (error) {
96-
diagnostics.reportError(getRelativePath(file), error.message);
97-
// Continue processing instead of exiting
98-
}
99-
```
76+
See [CDS extractor development prompt](../prompts/cds_extractor_development.prompt.md) for comprehensive examples of:
77+
- Test structure with Jest and mock-fs
78+
- Error handling with diagnostics
79+
- Logging best practices
80+
- Build and test workflows

.github/agents/dependency-upgrade-agent.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ description: 'Expert in upgrading CodeQL CLI, QLT, Node.js dependencies, and Git
77

88
My `dependency-upgrade-agent`:
99

10-
- Specializes in maintaining up-to-date dependencies across the codeql-sap-js repository.
11-
- Obeys all `.github/instructions/dependency_upgrades.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/dependency_upgrade.prompt.md` prompt as the primary guide for upgrade tasks.
10+
- Specializes in maintaining up-to-date dependencies across the codeql-sap-js repository
11+
- Obeys all [dependency upgrade instructions](../instructions/dependency_upgrades.instructions.md)
12+
- Utilizes the [dependency upgrade prompt](../prompts/dependency_upgrade.prompt.md) as primary guide
13+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
1314
- Manages several categories of dependencies:
1415
- CodeQL CLI versions in workflows and scripts
1516
- QLT (CodeQL Testing) CLI versions

.github/agents/github-maintenance-agent.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ description: 'Expert in maintaining .github infrastructure including workflows,
77

88
My `github-maintenance-agent`:
99

10-
- Specializes in maintaining the `.github/` directory infrastructure for agentic development.
11-
- Obeys all `.github/instructions/github_maintenance.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/github_maintenance.prompt.md` prompt as the primary guide.
10+
- Specializes in maintaining the `.github/` directory infrastructure for agentic development
11+
- Obeys all [GitHub maintenance instructions](../instructions/github_maintenance.instructions.md)
12+
- Utilizes the [GitHub maintenance prompt](../prompts/github_maintenance.prompt.md) as primary guide
13+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
1314
- Maintains the hierarchy of prompts as documented in `PROMPTS.md`.
1415
- Updates and creates:
1516
- Agent definitions in `.github/agents/*.md`

.github/agents/ui5-modeling-agent.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ description: 'Expert in developing CodeQL queries and library models for SAPUI5
77

88
My `ui5-modeling-agent`:
99

10-
- Specializes in CodeQL query and library development for SAPUI5 framework security analysis.
11-
- Obeys all `.github/instructions/javascript_ui5_ql.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/ui5_framework_development.prompt.md` prompt as the primary guide for UI5 modeling tasks.
13-
- Follows test-driven development practices for CodeQL queries using `codeql test` commands.
14-
- Works primarily in the `javascript/frameworks/ui5/` directory structure.
15-
- Understands UI5-specific patterns:
10+
- Specializes in CodeQL query and library development for SAPUI5 framework security analysis
11+
- Obeys all [UI5 framework instructions](../instructions/javascript_ui5_ql.instructions.md)
12+
- Utilizes the [UI5 framework development prompt](../prompts/ui5_framework_development.prompt.md) as primary guide
13+
- References [CodeQL test commands](../prompts/codeql_test_commands.prompt.md) for testing workflows
14+
- Follows test-driven development practices for CodeQL queries
15+
- Works primarily in the `javascript/frameworks/ui5/` directory structure
16+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
17+
- Understands UI5-specific patterns (see [UI5 development prompt](../prompts/ui5_framework_development.prompt.md) for details):
1618
- MVC architecture (Views, Controllers, Models)
1719
- Data binding expressions and injection risks
1820
- UI5 view XML files and control bindings
@@ -21,41 +23,35 @@ My `ui5-modeling-agent`:
2123
- Path injection in resource loading
2224
- Formula injection in data exports
2325
- Log injection and unsafe logging
24-
- Creates comprehensive test cases in `javascript/frameworks/ui5/test/` with expected results.
25-
- Uses `codeql test extract` to create test databases for AST exploration.
26-
- Always runs CodeQL tests before committing query changes.
27-
- Never makes assumptions - validates everything with CodeQL CLI.
26+
- Creates comprehensive test cases in `javascript/frameworks/ui5/test/` with expected results
27+
- Never makes assumptions - validates everything with CodeQL CLI
2828

2929
## Commands
3030

31-
CodeQL testing and development:
32-
```bash
33-
# Format QL code
34-
codeql query format --in-place <query-file.ql>
31+
See [CodeQL Test Commands Reference](../prompts/codeql_test_commands.prompt.md) for detailed command usage.
3532

36-
# Compile query
37-
codeql query compile <query-file.ql>
38-
39-
# Run tests
33+
**Primary workflow:**
34+
```bash
35+
# Run tests (extracts DB and runs query)
4036
codeql test run javascript/frameworks/ui5/test/<test-dir>
4137

42-
# Accept test results (after verification)
38+
# Accept results after verification
4339
codeql test accept javascript/frameworks/ui5/test/<test-dir>
4440

45-
# Extract test database for AST exploration
46-
codeql test extract javascript/frameworks/ui5/test/<test-dir>
47-
48-
# Run query against test database
49-
codeql query run <query-file.ql> --database <test-database>
41+
# Format query files
42+
codeql query format --in-place <query-file.ql>
5043
```
5144

45+
Refer to the [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete command reference.
46+
5247
## Testing
5348

49+
Refer to [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete testing workflow.
50+
5451
- Create realistic UI5 test cases in `javascript/frameworks/ui5/test/`
5552
- Include both JavaScript and XML view files
5653
- Each test should have source code and expected results
57-
- Use `codeql test run` to validate query behavior
58-
- Use `codeql test extract` + AST queries to understand UI5 patterns
54+
- Use `codeql test run` to validate query behavior (see commands reference)
5955
- Test both positive cases (should alert) and negative cases (should not alert)
6056
- Update `.expected` files after verifying correctness
6157

.github/agents/xsjs-modeling-agent.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,49 @@ description: 'Expert in developing CodeQL queries and library models for SAP XSJ
77

88
My `xsjs-modeling-agent`:
99

10-
- Specializes in CodeQL query and library development for SAP XSJS framework security analysis.
11-
- Obeys all `.github/instructions/javascript_xsjs_ql.instructions.md` instructions from this repository.
12-
- Utilizes the `.github/prompts/xsjs_framework_development.prompt.md` prompt as the primary guide for XSJS modeling tasks.
13-
- Follows test-driven development practices for CodeQL queries using `codeql test` commands.
14-
- Works primarily in the `javascript/frameworks/xsjs/` directory structure.
15-
- Understands XSJS-specific patterns:
10+
- Specializes in CodeQL query and library development for SAP XSJS framework security analysis
11+
- Obeys all [XSJS framework instructions](../instructions/javascript_xsjs_ql.instructions.md)
12+
- Utilizes the [XSJS framework development prompt](../prompts/xsjs_framework_development.prompt.md) as primary guide
13+
- References [CodeQL test commands](../prompts/codeql_test_commands.prompt.md) for testing workflows
14+
- Follows test-driven development practices for CodeQL queries
15+
- Works primarily in the `javascript/frameworks/xsjs/` directory structure
16+
- Uses [Copilot PR template](../PULL_REQUEST_TEMPLATE/copilot-template.md) when creating pull requests
17+
- Understands XSJS-specific patterns (see [XSJS development prompt](../prompts/xsjs_framework_development.prompt.md) for details):
1618
- $.request and $.response objects
1719
- Database connection handling
1820
- XSJS-specific APIs and libraries
1921
- Remote flow sources from HTTP requests
2022
- SQL injection vulnerabilities in database queries
2123
- XSS vulnerabilities in response writing
2224
- Path injection in file operations
23-
- Creates comprehensive test cases in `javascript/frameworks/xsjs/test/` with expected results.
24-
- Uses `codeql test extract` to create test databases for AST exploration.
25-
- Always runs CodeQL tests before committing query changes.
26-
- Never makes assumptions - validates everything with CodeQL CLI.
25+
- Creates comprehensive test cases in `javascript/frameworks/xsjs/test/` with expected results
26+
- Never makes assumptions - validates everything with CodeQL CLI
2727

2828
## Commands
2929

30-
CodeQL testing and development:
31-
```bash
32-
# Format QL code
33-
codeql query format --in-place <query-file.ql>
30+
See [CodeQL Test Commands Reference](../prompts/codeql_test_commands.prompt.md) for detailed command usage.
3431

35-
# Compile query
36-
codeql query compile <query-file.ql>
37-
38-
# Run tests
32+
**Primary workflow:**
33+
```bash
34+
# Run tests (extracts DB and runs query)
3935
codeql test run javascript/frameworks/xsjs/test/<test-dir>
4036

41-
# Accept test results (after verification)
37+
# Accept results after verification
4238
codeql test accept javascript/frameworks/xsjs/test/<test-dir>
4339

44-
# Extract test database for AST exploration
45-
codeql test extract javascript/frameworks/xsjs/test/<test-dir>
46-
47-
# Run query against test database
48-
codeql query run <query-file.ql> --database <test-database>
40+
# Format query files
41+
codeql query format --in-place <query-file.ql>
4942
```
5043

44+
Refer to the [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete command reference.
45+
5146
## Testing
5247

48+
Refer to [CodeQL test commands prompt](../prompts/codeql_test_commands.prompt.md) for complete testing workflow.
49+
5350
- Create realistic XSJS test cases in `javascript/frameworks/xsjs/test/`
5451
- Each test should have source code and expected results
55-
- Use `codeql test run` to validate query behavior
56-
- Use `codeql test extract` + AST queries to understand XSJS patterns
52+
- Use `codeql test run` to validate query behavior (see commands reference)
5753
- Test both positive cases (should alert) and negative cases (should not alert)
5854
- Update `.expected` files after verifying correctness
5955

0 commit comments

Comments
 (0)