Skip to content

Commit fb8f02f

Browse files
committed
Update context config
1 parent 8a9e357 commit fb8f02f

File tree

3 files changed

+167
-28
lines changed

3 files changed

+167
-28
lines changed

context.yaml

+1-28
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,7 @@ $schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/mai
22

33
import:
44
- path: src/**/context.yaml
5-
6-
variables:
7-
name: Context Generator
8-
9-
tools:
10-
- id: run-tests
11-
description: Run unit tests
12-
env:
13-
COMPOSER_ALLOW_SUPERUSER: 'true'
14-
commands:
15-
- cmd: composer
16-
args:
17-
- test
18-
19-
- id: code-quality
20-
description: Run code quality checks
21-
env:
22-
COMPOSER_ALLOW_SUPERUSER: 'true'
23-
commands:
24-
- cmd: composer
25-
args:
26-
- cs-fix
27-
- cmd: composer
28-
args:
29-
- refactor
30-
- cmd: composer
31-
args:
32-
- psalm
5+
- path: prompts.yaml
336

347
documents:
358
- description: 'Project structure overview'

json-schema.json

+131
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@
188188
}
189189
}
190190
}
191+
},
192+
"gitlab": {
193+
"type": "object",
194+
"description": "Settings for GitLab integration",
195+
"properties": {
196+
"servers": {
197+
"type": "object",
198+
"description": "Pre-defined GitLab server configurations",
199+
"additionalProperties": {
200+
"$ref": "#/definitions/gitlabServerConfig"
201+
}
202+
}
203+
}
191204
}
192205
}
193206
},
@@ -607,6 +620,7 @@
607620
"url",
608621
"text",
609622
"github",
623+
"gitlab",
610624
"git_diff",
611625
"tree",
612626
"mcp",
@@ -678,6 +692,18 @@
678692
"$ref": "#/definitions/githubSource"
679693
}
680694
},
695+
{
696+
"if": {
697+
"properties": {
698+
"type": {
699+
"const": "gitlab"
700+
}
701+
}
702+
},
703+
"then": {
704+
"$ref": "#/definitions/gitlabSource"
705+
}
706+
},
681707
{
682708
"if": {
683709
"properties": {
@@ -981,6 +1007,111 @@
9811007
}
9821008
}
9831009
},
1010+
"gitlabSource": {
1011+
"required": [
1012+
"repository",
1013+
"sourcePaths"
1014+
],
1015+
"properties": {
1016+
"repository": {
1017+
"type": "string",
1018+
"description": "GitLab repository in format group/project",
1019+
"pattern": "^[\\w.-]+/[\\w.-]+$"
1020+
},
1021+
"sourcePaths": {
1022+
"$ref": "#/definitions/sourcePaths"
1023+
},
1024+
"branch": {
1025+
"type": "string",
1026+
"description": "Branch or tag to fetch from",
1027+
"default": "main"
1028+
},
1029+
"filePattern": {
1030+
"$ref": "#/definitions/filePattern",
1031+
"default": "*.*"
1032+
},
1033+
"excludePatterns": {
1034+
"type": "array",
1035+
"description": "Patterns to exclude files (alias for notPath)",
1036+
"items": {
1037+
"type": "string"
1038+
},
1039+
"default": []
1040+
},
1041+
"notPath": {
1042+
"type": "array",
1043+
"description": "Patterns to exclude files by path",
1044+
"items": {
1045+
"type": "string"
1046+
},
1047+
"default": []
1048+
},
1049+
"path": {
1050+
"$ref": "#/definitions/patternConstraint"
1051+
},
1052+
"contains": {
1053+
"$ref": "#/definitions/patternConstraint"
1054+
},
1055+
"notContains": {
1056+
"$ref": "#/definitions/patternConstraint"
1057+
},
1058+
"showTreeView": {
1059+
"type": "boolean",
1060+
"description": "Whether to show directory tree",
1061+
"default": true
1062+
},
1063+
"treeView": {
1064+
"oneOf": [
1065+
{
1066+
"type": "boolean",
1067+
"description": "Whether to show the tree view"
1068+
},
1069+
{
1070+
"$ref": "#/definitions/treeViewConfig"
1071+
}
1072+
],
1073+
"description": "Tree view configuration"
1074+
},
1075+
"server": {
1076+
"oneOf": [
1077+
{
1078+
"type": "string",
1079+
"description": "Reference to a pre-defined server in settings.gitlab.servers"
1080+
},
1081+
{
1082+
"$ref": "#/definitions/gitlabServerConfig"
1083+
}
1084+
],
1085+
"description": "GitLab server configuration or reference to a pre-defined server"
1086+
},
1087+
"modifiers": {
1088+
"$ref": "#/definitions/modifiers"
1089+
}
1090+
}
1091+
},
1092+
"gitlabServerConfig": {
1093+
"type": "object",
1094+
"required": [
1095+
"url"
1096+
],
1097+
"properties": {
1098+
"url": {
1099+
"type": "string",
1100+
"description": "GitLab server URL"
1101+
},
1102+
"token": {
1103+
"type": "string",
1104+
"description": "GitLab API token for authentication (can use env var pattern ${TOKEN_NAME})"
1105+
},
1106+
"headers": {
1107+
"type": "object",
1108+
"description": "Custom HTTP headers to send with requests",
1109+
"additionalProperties": {
1110+
"type": "string"
1111+
}
1112+
}
1113+
}
1114+
},
9841115
"gitDiffSource": {
9851116
"properties": {
9861117
"repository": {

prompts.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
$schema: 'https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json'
2+
3+
prompts:
4+
- id: json-schema-update
5+
description: 'Update JSON Schema for new feature'
6+
messages:
7+
- role: user
8+
content: |
9+
You are an expert in JSON Schema development tasked with updating an existing schema to support new
10+
functionality.
11+
12+
I'll provide you with:
13+
1. The current JSON schema file
14+
2. Source code for a new feature implementation
15+
3. Example configuration files using the new feature
16+
17+
Your job is to:
18+
1. Analyze the provided context carefully to understand the new feature's structure and requirements
19+
2. Identify all necessary additions to the schema to properly validate the new feature
20+
3. Create appropriate JSON Schema definitions that match the implementation's capabilities
21+
4. Update all relevant sections of the schema (types, enums, definitions, properties, etc.)
22+
5. Ensure backward compatibility with existing schema validation
23+
6. Provide only the necessary changes as precise JSON fragments that can be integrated into the schema
24+
25+
Important guidelines:
26+
- Match the schema structure and naming conventions with the existing code
27+
- Create reusable definitions for complex components when appropriate
28+
- Include proper validation patterns, required fields, and defaults based on the implementation
29+
- Do not modify unrelated parts of the schema
30+
- Provide clear explanations of your changes and how they support the new feature
31+
32+
After analyzing the provided context, explain your approach briefly, then provide the exact JSON fragments
33+
needed to update the schema with clear indications of where each fragment should be inserted.
34+
35+

0 commit comments

Comments
 (0)