@esotech/contextuate 2.1.0 → 2.1.2
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.
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.js +131 -0
- package/dist/commands/init.d.ts +0 -2
- package/dist/commands/init.js +164 -228
- package/dist/commands/install.js +8 -24
- package/dist/index.js +7 -0
- package/dist/templates/agents/aegis.md +1 -1
- package/dist/templates/agents/archon.md +116 -8
- package/dist/templates/agents/atlas.md +17 -17
- package/dist/templates/agents/canvas.md +1 -1
- package/dist/templates/agents/chronicle.md +1 -1
- package/dist/templates/agents/chronos.md +1 -1
- package/dist/templates/agents/cipher.md +1 -1
- package/dist/templates/agents/crucible.md +1 -1
- package/dist/templates/agents/echo.md +1 -1
- package/dist/templates/agents/forge.md +1 -1
- package/dist/templates/agents/ledger.md +34 -3
- package/dist/templates/agents/meridian.md +1 -1
- package/dist/templates/agents/nexus.md +1 -1
- package/dist/templates/agents/pythia.md +1 -1
- package/dist/templates/agents/scribe.md +1 -1
- package/dist/templates/agents/sentinel.md +1 -1
- package/dist/templates/agents/thoth.md +1 -1
- package/dist/templates/agents/unity.md +1 -1
- package/dist/templates/agents/vox.md +1 -1
- package/dist/templates/agents/weaver.md +1 -1
- package/dist/templates/{skills → commands}/consult.md +1 -1
- package/dist/templates/commands/orchestrate.md +49 -0
- package/dist/templates/framework-agents/documentation-expert.md +3 -3
- package/dist/templates/framework-agents/tools-expert.md +3 -3
- package/dist/templates/templates/contextuate.md +1 -1
- package/dist/templates/tools/agent-creator.md +4 -4
- package/dist/templates/tools/standards-detector.md +1 -1
- package/dist/utils/tools.d.ts +60 -0
- package/dist/utils/tools.js +260 -0
- package/package.json +2 -2
- package/dist/templates/skills/orchestrate.md +0 -173
- package/dist/templates/skills/pythia.md +0 -37
- package/dist/templates/templates/standards/go.standards.md +0 -167
- package/dist/templates/templates/standards/java.standards.md +0 -167
- package/dist/templates/templates/standards/javascript.standards.md +0 -292
- package/dist/templates/templates/standards/php.standards.md +0 -181
- package/dist/templates/templates/standards/python.standards.md +0 -175
- package/dist/templates/tools/agent-creator.tool.md +0 -252
- package/dist/templates/tools/quickref.tool.md +0 -216
- package/dist/templates/tools/spawn.tool.md +0 -31
- package/dist/templates/tools/standards-detector.tool.md +0 -301
- package/dist/templates/version.json +0 -8
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
# PHP Coding Standards
|
|
2
|
-
|
|
3
|
-
> **Language:** PHP
|
|
4
|
-
> **Generated:** {DATE}
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Formatting
|
|
9
|
-
|
|
10
|
-
### Indentation
|
|
11
|
-
- **Style:** {tabs|spaces}
|
|
12
|
-
- **Size:** {2|4} {spaces|tabs}
|
|
13
|
-
|
|
14
|
-
### Braces
|
|
15
|
-
- **Classes/Functions:** {same-line|next-line}
|
|
16
|
-
- **Control structures:** {same-line|next-line}
|
|
17
|
-
|
|
18
|
-
### Spacing
|
|
19
|
-
- **Inside parentheses:** {yes|no} - `function( $param )` vs `function($param)`
|
|
20
|
-
- **After keywords:** {yes|no} - `if ( $x )` vs `if($x)`
|
|
21
|
-
- **Array brackets:** {no-spaces} - `$arr['key']`
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Naming Conventions
|
|
26
|
-
|
|
27
|
-
### Classes
|
|
28
|
-
- **Style:** PascalCase
|
|
29
|
-
- **Example:** `UserService`, `PaymentController`
|
|
30
|
-
|
|
31
|
-
### Methods
|
|
32
|
-
- **Style:** camelCase
|
|
33
|
-
- **Example:** `getUserById()`, `processPayment()`
|
|
34
|
-
|
|
35
|
-
### Variables
|
|
36
|
-
- **Style:** {camelCase|snake_case}
|
|
37
|
-
- **Example:** `$userName` or `$user_name`
|
|
38
|
-
|
|
39
|
-
### Constants
|
|
40
|
-
- **Style:** UPPER_SNAKE_CASE
|
|
41
|
-
- **Example:** `MAX_RETRY_COUNT`, `API_VERSION`
|
|
42
|
-
|
|
43
|
-
### Properties
|
|
44
|
-
- **Style:** {camelCase|snake_case}
|
|
45
|
-
- **Visibility prefix:** {none|underscore for private}
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Structure
|
|
50
|
-
|
|
51
|
-
### File Organization
|
|
52
|
-
```php
|
|
53
|
-
<?php
|
|
54
|
-
// 1. Strict types declaration (if used)
|
|
55
|
-
declare( strict_types=1 );
|
|
56
|
-
|
|
57
|
-
// 2. Namespace
|
|
58
|
-
namespace App\Services;
|
|
59
|
-
|
|
60
|
-
// 3. Use statements (alphabetized)
|
|
61
|
-
use App\Models\User;
|
|
62
|
-
use Exception;
|
|
63
|
-
|
|
64
|
-
// 4. Class definition
|
|
65
|
-
class UserService {
|
|
66
|
-
// 5. Constants
|
|
67
|
-
// 6. Properties
|
|
68
|
-
// 7. Constructor
|
|
69
|
-
// 8. Public methods
|
|
70
|
-
// 9. Protected methods
|
|
71
|
-
// 10. Private methods
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Method Length
|
|
76
|
-
- **Guideline:** {max lines per method}
|
|
77
|
-
- **Complexity:** {max cyclomatic complexity}
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Type Hints
|
|
82
|
-
|
|
83
|
-
### Parameters
|
|
84
|
-
```php
|
|
85
|
-
// {Required|Optional}
|
|
86
|
-
public function process( string $name, int $count ): void
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Return Types
|
|
90
|
-
```php
|
|
91
|
-
// {Required|Optional}
|
|
92
|
-
public function getData(): array
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Property Types (PHP 7.4+)
|
|
96
|
-
```php
|
|
97
|
-
// {Required|Optional}
|
|
98
|
-
private string $name;
|
|
99
|
-
private User|null $user = null;
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Documentation
|
|
105
|
-
|
|
106
|
-
### Class DocBlocks
|
|
107
|
-
```php
|
|
108
|
-
/**
|
|
109
|
-
* {Required|Optional}
|
|
110
|
-
* Brief description of the class.
|
|
111
|
-
*/
|
|
112
|
-
class MyClass
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Method DocBlocks
|
|
116
|
-
```php
|
|
117
|
-
/**
|
|
118
|
-
* {Required|Optional|Only for complex methods}
|
|
119
|
-
*
|
|
120
|
-
* @param string $name Description
|
|
121
|
-
* @return array Description
|
|
122
|
-
* @throws Exception When condition
|
|
123
|
-
*/
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
---
|
|
127
|
-
|
|
128
|
-
## Error Handling
|
|
129
|
-
|
|
130
|
-
### Exceptions
|
|
131
|
-
- **Custom exceptions:** {yes|no}
|
|
132
|
-
- **Base exception class:** {name if applicable}
|
|
133
|
-
|
|
134
|
-
### Try/Catch
|
|
135
|
-
```php
|
|
136
|
-
try {
|
|
137
|
-
// code
|
|
138
|
-
} catch( SpecificException $e ){
|
|
139
|
-
// handle
|
|
140
|
-
} catch( Exception $e ){
|
|
141
|
-
// fallback
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Common Patterns
|
|
148
|
-
|
|
149
|
-
### Dependency Injection
|
|
150
|
-
```php
|
|
151
|
-
// {Constructor injection|Setter injection|Container}
|
|
152
|
-
public function __construct( private UserRepository $repo )
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### Null Handling
|
|
156
|
-
```php
|
|
157
|
-
// Preferred: {null coalescing|ternary|early return}
|
|
158
|
-
$value = $data['key'] ?? 'default';
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Anti-Patterns
|
|
164
|
-
|
|
165
|
-
```php
|
|
166
|
-
// BAD: {description}
|
|
167
|
-
{bad example}
|
|
168
|
-
|
|
169
|
-
// GOOD: {description}
|
|
170
|
-
{good example}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Framework-Specific
|
|
176
|
-
|
|
177
|
-
{Add any framework-specific conventions here}
|
|
178
|
-
|
|
179
|
-
---
|
|
180
|
-
|
|
181
|
-
*This file should be customized for your project. Replace placeholders with actual values.*
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Python Coding Standards
|
|
2
|
-
|
|
3
|
-
> **Language:** Python
|
|
4
|
-
> **Generated:** {DATE}
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Formatting
|
|
9
|
-
|
|
10
|
-
### Indentation
|
|
11
|
-
- **Style:** {spaces}
|
|
12
|
-
- **Size:** {4} {spaces}
|
|
13
|
-
|
|
14
|
-
### Line Length
|
|
15
|
-
- **Max Length:** {88|100|120} chars
|
|
16
|
-
- **Docstrings:** {72} chars
|
|
17
|
-
|
|
18
|
-
### Imports
|
|
19
|
-
- **Sort Order:** {Standard Library} > {Third Party} > {Local Application}
|
|
20
|
-
- **Style:** {Absolute imports preferred}
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Naming Conventions
|
|
25
|
-
|
|
26
|
-
### Classes
|
|
27
|
-
- **Style:** PascalCase
|
|
28
|
-
- **Example:** `UserContext`, `PaymentProcessor`
|
|
29
|
-
|
|
30
|
-
### Functions/Methods
|
|
31
|
-
- **Style:** snake_case
|
|
32
|
-
- **Example:** `get_user_by_id()`, `process_payment()`
|
|
33
|
-
|
|
34
|
-
### Variables
|
|
35
|
-
- **Style:** snake_case
|
|
36
|
-
- **Example:** `user_name`, `is_active`
|
|
37
|
-
|
|
38
|
-
### Constants
|
|
39
|
-
- **Style:** UPPER_SNAKE_CASE
|
|
40
|
-
- **Example:** `MAX_RETRY_COUNT`, `API_VERSION`
|
|
41
|
-
|
|
42
|
-
### Private Members
|
|
43
|
-
- **Style:** {underscore prefix}
|
|
44
|
-
- **Example:** `_private_method()`, `_internal_var`
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Structure
|
|
49
|
-
|
|
50
|
-
### File Organization
|
|
51
|
-
```python
|
|
52
|
-
# 1. Shebang (if executable)
|
|
53
|
-
#!/usr/bin/env python3
|
|
54
|
-
|
|
55
|
-
# 2. Module Docstring
|
|
56
|
-
"""
|
|
57
|
-
Module description.
|
|
58
|
-
"""
|
|
59
|
-
|
|
60
|
-
# 3. Imports
|
|
61
|
-
import os
|
|
62
|
-
from typing import List, Optional
|
|
63
|
-
|
|
64
|
-
# 4. Constants
|
|
65
|
-
MAX_RETRIES = 3
|
|
66
|
-
|
|
67
|
-
# 5. Classes
|
|
68
|
-
class MyClass:
|
|
69
|
-
"""Class docstring."""
|
|
70
|
-
|
|
71
|
-
def __init__(self):
|
|
72
|
-
pass
|
|
73
|
-
|
|
74
|
-
# 6. Main execution
|
|
75
|
-
if __name__ == "__main__":
|
|
76
|
-
pass
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Type Hints (PEP 484)
|
|
82
|
-
|
|
83
|
-
### Parameters & Returns
|
|
84
|
-
```python
|
|
85
|
-
# {Required|Preferred}
|
|
86
|
-
def process(name: str, count: int = 0) -> None:
|
|
87
|
-
pass
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Variables (PEP 526)
|
|
91
|
-
```python
|
|
92
|
-
# {Optional|Preferred}
|
|
93
|
-
user_id: int = 123
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Documentation (Docstrings)
|
|
99
|
-
|
|
100
|
-
### Style
|
|
101
|
-
- **Format:** {Google|NumPy|Sphinx/reST}
|
|
102
|
-
|
|
103
|
-
#### Google Style Example
|
|
104
|
-
```python
|
|
105
|
-
def fetch_data(url: str) -> dict:
|
|
106
|
-
"""Fetches data from the API.
|
|
107
|
-
|
|
108
|
-
Args:
|
|
109
|
-
url: The endpoint URL.
|
|
110
|
-
|
|
111
|
-
Returns:
|
|
112
|
-
A dictionary containing the response data.
|
|
113
|
-
|
|
114
|
-
Raises:
|
|
115
|
-
ConnectionError: If the request fails.
|
|
116
|
-
"""
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## Error Handling
|
|
122
|
-
|
|
123
|
-
### Exceptions
|
|
124
|
-
```python
|
|
125
|
-
try:
|
|
126
|
-
process_data()
|
|
127
|
-
except ValueError as e:
|
|
128
|
-
logger.error(f"Validation error: {e}")
|
|
129
|
-
except Exception:
|
|
130
|
-
# Catch-all only if necessary
|
|
131
|
-
raise
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Common Patterns
|
|
137
|
-
|
|
138
|
-
### List Comprehensions
|
|
139
|
-
```python
|
|
140
|
-
# Preferred for simple transformations
|
|
141
|
-
names = [u.name for u in users if u.is_active]
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Context Managers
|
|
145
|
-
```python
|
|
146
|
-
# Preferred for resource management
|
|
147
|
-
with open("file.txt") as f:
|
|
148
|
-
content = f.read()
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Anti-Patterns
|
|
154
|
-
|
|
155
|
-
```python
|
|
156
|
-
# BAD: Mutable default arguments
|
|
157
|
-
def add_item(item, list=[]):
|
|
158
|
-
list.append(item)
|
|
159
|
-
|
|
160
|
-
# GOOD:
|
|
161
|
-
def add_item(item, list=None):
|
|
162
|
-
if list is None:
|
|
163
|
-
list = []
|
|
164
|
-
list.append(item)
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Framework-Specific
|
|
170
|
-
|
|
171
|
-
{Add Django/Flask/FastAPI specific conventions here}
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
*This file should be customized for your project. Replace placeholders with actual values.*
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
# Agent Creator Tool
|
|
2
|
-
|
|
3
|
-
> **Type:** AI Tool Guide
|
|
4
|
-
> **Purpose:** Create new AI agent definitions following Contextuate standards
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## When to Use This Tool
|
|
9
|
-
|
|
10
|
-
Use this tool when:
|
|
11
|
-
- User requests a new agent for a specific domain
|
|
12
|
-
- Project needs specialized AI expertise documented
|
|
13
|
-
- Onboarding AI to a new area of the codebase
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Input
|
|
18
|
-
|
|
19
|
-
**Required:**
|
|
20
|
-
- Domain/expertise area for the agent
|
|
21
|
-
- Primary responsibilities
|
|
22
|
-
|
|
23
|
-
**Optional:**
|
|
24
|
-
- Existing documentation to reference
|
|
25
|
-
- Specific file patterns the agent covers
|
|
26
|
-
- Related agents for delegation
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Process
|
|
31
|
-
|
|
32
|
-
### Step 1: Determine Agent Scope
|
|
33
|
-
|
|
34
|
-
Answer these questions:
|
|
35
|
-
- What domain/expertise does this agent cover?
|
|
36
|
-
- What files/patterns are in scope?
|
|
37
|
-
- Is there existing documentation to reference?
|
|
38
|
-
- Does a quickref need to be created first?
|
|
39
|
-
|
|
40
|
-
### Step 2: Create Supporting Documentation (if needed)
|
|
41
|
-
|
|
42
|
-
Before creating the agent, ensure documentation exists:
|
|
43
|
-
|
|
44
|
-
| Need | Create |
|
|
45
|
-
|------|--------|
|
|
46
|
-
| Comprehensive docs | `docs/{topic}.md` |
|
|
47
|
-
| API/method reference | `docs/ai/quickrefs/{name}.quickref.md` |
|
|
48
|
-
|
|
49
|
-
Use the [Quickref Generator](quickref.tool.md) if needed.
|
|
50
|
-
|
|
51
|
-
### Step 3: Create Agent File
|
|
52
|
-
|
|
53
|
-
**Location:** `docs/ai/agents/{domain}-expert.md`
|
|
54
|
-
|
|
55
|
-
**Naming conventions:**
|
|
56
|
-
- Use lowercase, hyphen-separated
|
|
57
|
-
- Be specific: `api-auth-expert` not just `api-expert`
|
|
58
|
-
- Pattern: `{domain}-expert.md`
|
|
59
|
-
|
|
60
|
-
### Step 4: Fill Template
|
|
61
|
-
|
|
62
|
-
Use the template below, replacing all `{placeholders}`.
|
|
63
|
-
|
|
64
|
-
### Step 5: Quality Check
|
|
65
|
-
|
|
66
|
-
Verify:
|
|
67
|
-
- [ ] Inherits from base configuration
|
|
68
|
-
- [ ] Required context lists only domain-specific docs
|
|
69
|
-
- [ ] Core competencies are specific and actionable
|
|
70
|
-
- [ ] Includes practical code examples
|
|
71
|
-
- [ ] Anti-patterns show real mistakes to avoid
|
|
72
|
-
- [ ] Decision framework helps with common choices
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Output Template
|
|
77
|
-
|
|
78
|
-
```markdown
|
|
79
|
-
# {Name} Expert Agent
|
|
80
|
-
|
|
81
|
-
> **Inherits:** [Base Agent Configuration](../.contextuate/agents/base.md)
|
|
82
|
-
> **Role:** {One-line description of expertise}
|
|
83
|
-
> **Domain:** `{file patterns covered}`
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## Agent Identity
|
|
88
|
-
|
|
89
|
-
You are an expert in {domain description}. Your role is to:
|
|
90
|
-
|
|
91
|
-
1. **{Primary responsibility}**
|
|
92
|
-
2. **{Secondary responsibility}**
|
|
93
|
-
3. **{Tertiary responsibility}**
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Required Context
|
|
98
|
-
|
|
99
|
-
In addition to base agent context, you MUST read:
|
|
100
|
-
|
|
101
|
-
1. **[{Primary Doc}]({path})** - {Why needed}
|
|
102
|
-
2. **[{Secondary Doc}]({path})** - {Why needed} *(if applicable)*
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Core Competencies
|
|
107
|
-
|
|
108
|
-
### {Competency Area 1}
|
|
109
|
-
- {Specific skill}
|
|
110
|
-
- {Specific skill}
|
|
111
|
-
|
|
112
|
-
### {Competency Area 2}
|
|
113
|
-
- {Specific skill}
|
|
114
|
-
- {Specific skill}
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Decision Framework
|
|
119
|
-
|
|
120
|
-
### {Key Decision Type}
|
|
121
|
-
|
|
122
|
-
{Decision tree or guidelines}
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Common Patterns
|
|
127
|
-
|
|
128
|
-
### {Pattern Name}
|
|
129
|
-
|
|
130
|
-
\`\`\`{language}
|
|
131
|
-
{code example}
|
|
132
|
-
\`\`\`
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Anti-Patterns
|
|
137
|
-
|
|
138
|
-
\`\`\`{language}
|
|
139
|
-
// BAD: {description}
|
|
140
|
-
{bad pattern}
|
|
141
|
-
|
|
142
|
-
// GOOD: {description}
|
|
143
|
-
{good pattern}
|
|
144
|
-
\`\`\`
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Quick Reference
|
|
149
|
-
|
|
150
|
-
| Task | Approach |
|
|
151
|
-
|------|----------|
|
|
152
|
-
| {common task} | {solution/method} |
|
|
153
|
-
| {common task} | {solution/method} |
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
---
|
|
157
|
-
|
|
158
|
-
## Example
|
|
159
|
-
|
|
160
|
-
**Request:** "Create an agent for database operations"
|
|
161
|
-
|
|
162
|
-
### Step 1: Assess Scope
|
|
163
|
-
- Domain: Database queries and schema management
|
|
164
|
-
- Files: `*.sql`, `migrations/`, database service files
|
|
165
|
-
- Existing docs: Check `docs/` for database documentation
|
|
166
|
-
|
|
167
|
-
### Step 2: Create Supporting Docs (if needed)
|
|
168
|
-
```
|
|
169
|
-
docs/
|
|
170
|
-
└── database.md # If comprehensive docs needed
|
|
171
|
-
docs/ai/quickrefs/
|
|
172
|
-
└── database.quickref.md # If large API needs summary
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Step 3: Create Agent File
|
|
176
|
-
|
|
177
|
-
File: `docs/ai/agents/database-expert.md`
|
|
178
|
-
|
|
179
|
-
```markdown
|
|
180
|
-
# Database Expert Agent
|
|
181
|
-
|
|
182
|
-
> **Inherits:** [Base Agent Configuration](../.contextuate/agents/base.md)
|
|
183
|
-
> **Role:** Expert in database operations, queries, and schema design
|
|
184
|
-
> **Domain:** `*.sql`, `migrations/`, `**/db/**`
|
|
185
|
-
|
|
186
|
-
## Agent Identity
|
|
187
|
-
|
|
188
|
-
You are an expert in database operations. Your role is to:
|
|
189
|
-
|
|
190
|
-
1. **Write efficient queries** following project conventions
|
|
191
|
-
2. **Design schemas** that are normalized and performant
|
|
192
|
-
3. **Create migrations** that are safe and reversible
|
|
193
|
-
|
|
194
|
-
## Required Context
|
|
195
|
-
|
|
196
|
-
1. **[Database Documentation](../../database.md)** - Schema and conventions
|
|
197
|
-
2. **[Database Quickref](../quickrefs/database.quickref.md)** - API reference
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## Agent Relationships
|
|
203
|
-
|
|
204
|
-
### Inheritance Hierarchy
|
|
205
|
-
```
|
|
206
|
-
base.md (framework - immutable)
|
|
207
|
-
└── {user-agents}.md (project-specific - in docs/ai/agents/)
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Delegation Pattern
|
|
211
|
-
Agents should delegate when task requires expertise outside their domain:
|
|
212
|
-
|
|
213
|
-
```markdown
|
|
214
|
-
## Delegation
|
|
215
|
-
|
|
216
|
-
| Situation | Delegate To |
|
|
217
|
-
|-----------|-------------|
|
|
218
|
-
| Need API design help | api-expert |
|
|
219
|
-
| Need testing help | testing-expert |
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
---
|
|
223
|
-
|
|
224
|
-
## When to Create Quickrefs
|
|
225
|
-
|
|
226
|
-
Create a quickref (`docs/ai/quickrefs/{name}.quickref.md`) when:
|
|
227
|
-
- Source documentation exceeds ~300 lines
|
|
228
|
-
- Methods/APIs are frequently looked up
|
|
229
|
-
- Agent needs awareness without full context load
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
## Reporting
|
|
234
|
-
|
|
235
|
-
After creating an agent, report:
|
|
236
|
-
|
|
237
|
-
1. Agent file created
|
|
238
|
-
2. Supporting docs created (if any)
|
|
239
|
-
3. Recommended next steps
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
Agent Created
|
|
243
|
-
=============
|
|
244
|
-
File: docs/ai/agents/database-expert.md
|
|
245
|
-
|
|
246
|
-
Supporting docs:
|
|
247
|
-
- Created: docs/ai/quickrefs/database.quickref.md
|
|
248
|
-
|
|
249
|
-
Next steps:
|
|
250
|
-
- Review and customize the agent file
|
|
251
|
-
- Add project-specific patterns and anti-patterns
|
|
252
|
-
```
|