Skip to content

Commit 0abee41

Browse files
felickzCopilot
andauthored
Docs: Add model development to readme (#51)
* [UPDATE README] Enhance issue templates for CodeQL queries and data extensions Co-authored-by: Copilot <copilot@github.com> * [UPDATE README] Standardize issue template formatting and support non unix shells in npm package.json Co-authored-by: Copilot <copilot@github.com> * [ADD] Create .gitattributes to enforce LF line endings and define binary file types - matches .prettierrc sets "endOfLine": "lf" --------- Co-authored-by: Copilot <copilot@github.com>
1 parent 2e1d6c1 commit 0abee41

3 files changed

Lines changed: 47 additions & 30 deletions

File tree

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Enforce LF line endings for text files on all platforms.
2+
# Prettier config sets `endOfLine: lf`, so checkout must match.
3+
* text=auto eol=lf
4+
5+
# Binary files - do not touch
6+
*.png binary
7+
*.jpg binary
8+
*.jpeg binary
9+
*.gif binary
10+
*.ico binary
11+
*.zip binary
12+
*.pdf binary

README.md

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,18 @@ This uses `codeql pack ls` to discover all packs in the workspace and runs `code
4646

4747
> **Note:** The generated `codeql-pack.lock.yml` files should be committed to your repository to ensure reproducible dependency resolution across your team.
4848
49-
### Step 3: Create an Issue for the CodeQL query you want to develop
49+
### Step 3: Create an Issue for the CodeQL query or data extension you want to develop
5050

5151
1. **Navigate to Issues** in your new repository
5252
2. **Click "New Issue"**
53-
3. **Select "Request new CodeQL Query"** template
54-
4. **Fill in the details:**
55-
- Choose target language (e.g., Java, Python, JavaScript)
56-
- Describe what the query should detect
57-
- Provide code examples (optional but recommended)
58-
- Specify severity level
53+
3. **Select a template:**
54+
- **"Request new CodeQL Query"** for custom query development
55+
- **"Request new CodeQL Data Extension"** for modeling an unmodeled library via YAML (models-as-data)
56+
4. **Fill in the template fields** — each template will guide you, but at minimum:
57+
- **Target language**
58+
- **Description** of what to detect or which library to model
59+
- **Library URL** (data extensions) or **Severity level** (queries)
60+
- **Code Examples** (recommended — helps Copilot generate better results)
5961
5. **Submit the issue**
6062

6163
### Step 4: Assign Issue to `@copilot`
@@ -68,7 +70,7 @@ This uses `codeql pack ls` to discover all packs in the workspace and runs `code
6870

6971
1. **Navigate to the generated Pull Request**
7072
2. **Review the changes:**
71-
- Query implementation (`.ql` files)
73+
- Query implementation (`.ql` files) or data extensions (`.model.yml` files)
7274
- Test cases (in `test/` directories)
7375
- Query documentation (`.md` and `.qhelp` files)
7476
3. **Check CI/CD results:**
@@ -80,11 +82,12 @@ This uses `codeql pack ls` to discover all packs in the workspace and runs `code
8082

8183
## 📋 Available Issue Templates
8284

83-
| Template | Purpose |
84-
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
85-
| [Request new CodeQL Query](.github/ISSUE_TEMPLATE/query-create.yml) | Create a new CodeQL query to detect specific code patterns or vulnerabilities |
86-
| [Update existing CodeQL Query](.github/ISSUE_TEMPLATE/query-update.yml) | Modify an existing query to improve accuracy or add new detection capabilities |
87-
| [Improve Prompts/Instructions](.github/ISSUE_TEMPLATE/prompt-update.yml) | Contribute improvements to the AI guidance system |
85+
| Template | Purpose |
86+
| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
87+
| [Request new CodeQL Query](.github/ISSUE_TEMPLATE/query-create.yml) | Create a new CodeQL query to detect specific code patterns or vulnerabilities |
88+
| [Update existing CodeQL Query](.github/ISSUE_TEMPLATE/query-update.yml) | Modify an existing query to improve accuracy or add new detection capabilities |
89+
| [Request new CodeQL Data Extension](.github/ISSUE_TEMPLATE/data-extension-create.yml) | Create a data extension (models-as-data YAML) to model an unmodeled library or framework |
90+
| [Improve Prompts/Instructions](.github/ISSUE_TEMPLATE/prompt-update.yml) | Contribute improvements to the AI guidance system |
8891

8992
## Repository Structure
9093

@@ -117,7 +120,7 @@ codeql-development-template/
117120

118121
This template implements a **hierarchical prompt system** that maximizes GitHub Copilot's effectiveness:
119122

120-
1. **Issue Templates** provide structured input for query requirements
123+
1. **Issue Templates** provide structured input for query and model requirements
121124
2. **Language-Specific Instructions** guide Copilot with relevant context
122125
3. **High-Level Prompts** break down complex CodeQL workflows
123126
4. **Tool-Specific Resources** provide CLI usage examples and patterns
@@ -135,18 +138,20 @@ See [PROMPTS.md](PROMPTS.md) for details on the prompt hierarchy system.
135138

136139
## Supported Languages
137140

138-
The template supports CodeQL query development for:
139-
140-
| Language | CodeQL Library |
141-
| --------------------- | -------------- |
142-
| GitHub Actions | `actions` |
143-
| C/C++ | `cpp` |
144-
| C# | `csharp` |
145-
| Go | `go` |
146-
| Java | `java` |
147-
| JavaScript/TypeScript | `javascript` |
148-
| Python | `python` |
149-
| Ruby | `ruby` |
141+
CodeQL supports the following languages. This template provides query development and/or data extension (models-as-data) guidance for each:
142+
143+
| Language | CodeQL Library | Query Development | Model Development |
144+
| --------------------- | -------------- | :---------------: | :---------------: |
145+
| C/C++ | `cpp` |||
146+
| C# | `csharp` |||
147+
| GitHub Actions | `actions` || |
148+
| Go | `go` |||
149+
| Java/Kotlin | `java` |||
150+
| JavaScript/TypeScript | `javascript` |||
151+
| Python | `python` |||
152+
| Ruby | `ruby` |||
153+
| Rust | `rust` | | |
154+
| Swift | `swift` | | |
150155

151156
## License
152157

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"yaml-eslint-parser": "^2.0.0"
2626
},
2727
"scripts": {
28-
"format": "prettier --write '**/*.{yml,yaml,md}'",
29-
"format:check": "prettier --check '**/*.{yml,yaml,md}'",
28+
"format": "prettier --write \"**/*.{yml,yaml,md}\"",
29+
"format:check": "prettier --check \"**/*.{yml,yaml,md}\"",
3030
"lint": "npm run lint:markdown && npm run lint:yaml",
3131
"lint:fix": "npm run lint:markdown:fix && npm run lint:yaml:fix",
32-
"lint:markdown": "eslint '**/README.md'",
33-
"lint:markdown:fix": "eslint '**/README.md' --fix",
32+
"lint:markdown": "eslint \"**/README.md\"",
33+
"lint:markdown:fix": "eslint \"**/README.md\" --fix",
3434
"lint:yaml": "eslint --ext .yml,.yaml .github/workflows/ .github/ISSUE_TEMPLATE/",
3535
"lint:yaml:fix": "eslint --ext .yml,.yaml .github/workflows/ .github/ISSUE_TEMPLATE/ --fix",
3636
"test:lint": "npm run lint:yaml && npm run lint:markdown && npm run format:check",

0 commit comments

Comments
 (0)