Skip to content

Commit 0278dc1

Browse files
committed
docs: added imports, prompts, envs
1 parent 895f3c6 commit 0278dc1

File tree

4 files changed

+87
-37
lines changed

4 files changed

+87
-37
lines changed

docs/configuration.md

+55-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ If you prefer YAML syntax, you can use the following format.
2222
Create a `context.yaml` file in your project root:
2323

2424
```yaml
25+
$schema: https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json
26+
2527
documents:
2628
- description: API Documentation
2729
outputPath: docs/api.md
@@ -62,6 +64,7 @@ Create a `context.json` file in your project root:
6264

6365
```json
6466
{
67+
"$schema": "https://raw.githubusercontent.com/context-hub/generator/refs/heads/main/json-schema.json",
6568
"documents": [
6669
{
6770
"description": "API Documentation",
@@ -114,12 +117,51 @@ As you can see it's pretty simple.
114117
For large projects with multiple components or services, you can split your configuration across multiple files using
115118
the import functionality.
116119

117-
- Import paths are resolved relative to the importing file
118-
- You can apply path prefixes to source paths in imported configurations
119-
- Imports can be nested (configurations can import other configurations)
120-
- Circular imports are automatically detected and prevented
120+
### Key Features
121+
122+
* Import paths are resolved relative to the importing file
123+
* You can apply path prefixes to source paths in imported configurations
124+
* Imports can be nested (configurations can import other configurations)
125+
* Circular imports are automatically detected and prevented
126+
127+
### Import Formats
128+
129+
The `import` section supports several formats:
130+
131+
#### String Format (Simplest)
132+
133+
```yaml
134+
import:
135+
- "services/api/context.yaml"
136+
```
137+
138+
#### Object Format with Path
139+
140+
```yaml
141+
import:
142+
- path: services/api/context.yaml
143+
```
144+
145+
#### Object Format with Path and Prefix
146+
147+
```yaml
148+
import:
149+
- path: services/api/context.yaml
150+
pathPrefix: /api
151+
```
152+
153+
#### Explicit Type Format
121154

122-
### Import Example in YAML
155+
```yaml
156+
import:
157+
- type: file
158+
path: services/api/context.yaml
159+
pathPrefix: /api
160+
- type: url
161+
url: https://example.com/shared-config.json
162+
```
163+
164+
### Example in YAML
123165

124166
```yaml
125167
import:
@@ -136,7 +178,7 @@ documents:
136178
This is the main project documentation.
137179
```
138180

139-
### Import Example in JSON
181+
### Example in JSON
140182

141183
```json
142184
{
@@ -160,6 +202,13 @@ documents:
160202
}
161203
```
162204

205+
### Import Types
206+
207+
| Type | Description | Required Fields |
208+
|--------|-------------------------------------------------------------|-----------------|
209+
| `file` | Imports configuration from a local file | `path` |
210+
| `url` | Imports configuration (`prompts` section) from a remote URL | `url` |
211+
163212
## Using Environment Variables
164213

165214
Context Generator supports configuration via environment variables, which provides a flexible way to override settings

docs/mcp-server.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ You can configure the MCP server using environment variables.
161161
You can customize how document names appear in Claude's interface.
162162

163163
```dotenv
164-
CTX_DOCUMENT_NAME_FORMAT="{description} ({tags}) - {path}"
164+
MCP_DOCUMENT_NAME_FORMAT="{description} ({tags}) - {path}"
165165
```
166166

167167
Available placeholders:
@@ -170,4 +170,14 @@ Available placeholders:
170170
- `{description}` - The document description
171171
- `{tags}` - Comma-separated list of document tags
172172

173-
By default, the format is: `[{path}] {description}`
173+
By default, the format is: `[{path}] {description}`
174+
175+
### Configuring File Read/Write
176+
177+
You can turn off file read/write operations in the MCP server.
178+
179+
```dotenv
180+
MCP_FILE_OPERATIONS=false
181+
```
182+
183+
By default, file operations are enabled. Set this to `false` to disable them.

docs/mcp/prompts.md

+12-29
Original file line numberDiff line numberDiff line change
@@ -80,53 +80,36 @@ projects and teams. This creates an ecosystem where:
8080
- Specialized domain knowledge can be packaged into reusable templates
8181
- The community can collaborate on high-quality prompt libraries
8282

83-
Context Generator currently supports basic configuration imports from local filesystem sources.
83+
Context Generator supports configuration imports from multiple sources to enable modular configuration management:
8484

85-
**Coming soon**, we're extending this functionality to include remote sources, with a particular focus on making MCP
86-
prompts more accessible and shareable:
85+
### Import Capabilities
8786

88-
### Upcoming Import Capabilities
89-
90-
- **GitHub Repositories**: Import prompts directly from public or private GitHub repos
91-
- **Composer Packages**: Leverage prompts bundled in PHP Composer packages
92-
- **Remote URLs**: Reference prompt configurations via direct URLs
87+
- **Local Files**: Import prompts from local filesystem files
88+
- **URL Sources**: Import prompts directly from remote URLs
9389
- **Selective Imports**: Import only specific prompts from any source
9490

95-
This will transform how teams work with AI by enabling:
91+
This transforms how teams work with AI by enabling:
9692

9793
- **Reusability**: Create prompt repositories once, use them across multiple projects
9894
- **Community Sharing**: Participate in an ecosystem of community-maintained prompt libraries
9995
- **Standardization**: Promote best practices through shared prompt configurations
10096
- **Version Control**: Reference specific versions of remote prompt repositories
10197

102-
### Example Remote Import Configuration
98+
### Example Import Configuration
10399

104100
```yaml
105101
import:
106-
# Local import (current implementation)
102+
# Local import
107103
- path: services/api/context.yaml
108104
type: local # default, can be omitted
109105
110-
# GitHub import (coming soon)
111-
- path: butschster/ctx-prompts/prompts/refactoring.yaml
112-
type: github
113-
ref: main # optional, defaults to main/master
114-
token: ${GITHUB_TOKEN} # optional, for private repos
115-
116-
# Composer package import (coming soon)
117-
- path: vendor/butschster/ctx-prompts/prompts/refactoring.yaml
118-
type: composer
119-
120-
# URL import (coming soon)
121-
- path: https://example.com/context-configs/api-prompts.yaml
106+
# URL import
107+
- url: https://example.com/context-configs/api-prompts.yaml
122108
type: url
123109
headers: # optional HTTP headers
124110
Authorization: "Bearer ${API_TOKEN}"
125111
126-
# Selective import (coming soon, works with any source type)
127-
- path: butschster/ctx-prompts/prompts/all.yaml
128-
type: github
129-
docs:
130-
- refactoring/extract-method.md
131-
- refactoring/rename-class.md
112+
# GitHub Gist import (using URL)
113+
- url: https://gist.githubusercontent.com/butschster/1b7e597691cc1a6476b15dc120ecbddb/raw/8c0f9d0145dcd260b814f866ec130ec630c80ee8/prompts.yaml
114+
type: url
132115
```

docs/quick-start.md

+8
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ prompts:
130130

131131
> **Note:** Read more about [Prompts](/mcp/prompts) for detailed configuration options.
132132

133+
Import sharable prompts from the community or create your own to enhance your workflow.
134+
135+
```yaml
136+
import:
137+
- type: url
138+
path: https://gist.githubusercontent.com/butschster/1b7e597691cc1a6476b15dc120ecbddb/raw/8c0f9d0145dcd260b814f866ec130ec630c80ee8/prompts.yaml
139+
```
140+
133141
## JSON Schema
134142

135143
For better editing experience, Context Generator provides a JSON schema for autocompletion and validation in your IDE:

0 commit comments

Comments
 (0)