@esotech/contextuate 2.1.0 → 2.1.1
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/install.js +8 -24
- package/package.json +2 -2
- 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
- /package/dist/templates/{skills → commands}/consult.md +0 -0
- /package/dist/templates/{skills → commands}/orchestrate.md +0 -0
|
@@ -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
|
-
```
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# Quickref Generation Tool
|
|
2
|
-
|
|
3
|
-
> **Type:** AI Tool Guide
|
|
4
|
-
> **Purpose:** Instructions for generating AI-friendly quick references from documentation
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## When to Use This Tool
|
|
9
|
-
|
|
10
|
-
Use this tool when:
|
|
11
|
-
- Full documentation exceeds ~200 lines
|
|
12
|
-
- A condensed reference would help AI assistants
|
|
13
|
-
- Methods/APIs are frequently looked up
|
|
14
|
-
- User requests a quickref be generated
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Input
|
|
19
|
-
|
|
20
|
-
**Required:** Path to source documentation file
|
|
21
|
-
|
|
22
|
-
**Example request:**
|
|
23
|
-
> "Generate a quickref for docs/classes/user-service.md"
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Process
|
|
28
|
-
|
|
29
|
-
### Step 1: Read the Source Documentation
|
|
30
|
-
|
|
31
|
-
Read the full documentation file to understand:
|
|
32
|
-
- What the class/service/API does
|
|
33
|
-
- All public methods and their signatures
|
|
34
|
-
- Properties and their types
|
|
35
|
-
- Common usage patterns
|
|
36
|
-
|
|
37
|
-
### Step 2: Extract Key Information
|
|
38
|
-
|
|
39
|
-
For each **method**, capture:
|
|
40
|
-
- Method name
|
|
41
|
-
- Full parameter signature with types
|
|
42
|
-
- One-line description (max 10 words)
|
|
43
|
-
|
|
44
|
-
For each **property**, capture:
|
|
45
|
-
- Property name
|
|
46
|
-
- Type
|
|
47
|
-
- One-line description
|
|
48
|
-
|
|
49
|
-
For **common usage**, capture:
|
|
50
|
-
- The single most common usage pattern
|
|
51
|
-
- Keep it to 3-5 lines of code max
|
|
52
|
-
|
|
53
|
-
### Step 3: Organize by Category
|
|
54
|
-
|
|
55
|
-
Group methods logically:
|
|
56
|
-
- By functionality (CRUD, validation, transformation)
|
|
57
|
-
- By access pattern (getters, setters, actions)
|
|
58
|
-
- By frequency of use (common first)
|
|
59
|
-
|
|
60
|
-
### Step 4: Generate Quickref
|
|
61
|
-
|
|
62
|
-
Write to `docs/ai/quickrefs/{name}.quickref.md` using the template below.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Output Template
|
|
67
|
-
|
|
68
|
-
```markdown
|
|
69
|
-
# {Name} - Quick Reference
|
|
70
|
-
|
|
71
|
-
> **Source:** [{source-filename}](../../{path-to-source})
|
|
72
|
-
> **Generated:** {YYYY-MM-DD}
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Methods
|
|
77
|
-
|
|
78
|
-
### {Category 1}
|
|
79
|
-
|
|
80
|
-
| Method | Description |
|
|
81
|
-
|--------|-------------|
|
|
82
|
-
| `methodName( param: type )` | Brief description |
|
|
83
|
-
| `methodName( a: type, b: type ): returnType` | Brief description |
|
|
84
|
-
|
|
85
|
-
### {Category 2}
|
|
86
|
-
|
|
87
|
-
| Method | Description |
|
|
88
|
-
|--------|-------------|
|
|
89
|
-
| `methodName( param: type )` | Brief description |
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Properties
|
|
94
|
-
|
|
95
|
-
| Property | Type | Description |
|
|
96
|
-
|----------|------|-------------|
|
|
97
|
-
| `propertyName` | type | Brief description |
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Common Usage
|
|
102
|
-
|
|
103
|
-
\`\`\`{language}
|
|
104
|
-
// Most common pattern - keep brief
|
|
105
|
-
\`\`\`
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
*See [full documentation](../../{path-to-source}) for details.*
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## Guidelines
|
|
115
|
-
|
|
116
|
-
### Keep It Scannable
|
|
117
|
-
- One line per method/property
|
|
118
|
-
- No verbose explanations
|
|
119
|
-
- Tables for structured data
|
|
120
|
-
- Max 100 lines total
|
|
121
|
-
|
|
122
|
-
### Method Signatures
|
|
123
|
-
- Include all parameters with types
|
|
124
|
-
- Include return type if not void
|
|
125
|
-
- Use consistent formatting:
|
|
126
|
-
```
|
|
127
|
-
methodName( param1: type, param2: type ): returnType
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Descriptions
|
|
131
|
-
- Max 10 words per description
|
|
132
|
-
- Start with verb: "Gets...", "Sets...", "Returns...", "Creates..."
|
|
133
|
-
- No periods at end
|
|
134
|
-
|
|
135
|
-
### Categories
|
|
136
|
-
- 2-5 categories typically
|
|
137
|
-
- Use clear, short category names
|
|
138
|
-
- Most-used methods first
|
|
139
|
-
|
|
140
|
-
### Common Usage
|
|
141
|
-
- Single most common pattern
|
|
142
|
-
- 3-5 lines of code max
|
|
143
|
-
- Must be copy-paste ready
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Example
|
|
148
|
-
|
|
149
|
-
**Source:** `docs/classes/cache-service.md` (300 lines)
|
|
150
|
-
|
|
151
|
-
**Generated quickref:**
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
154
|
-
# Cache Service - Quick Reference
|
|
155
|
-
|
|
156
|
-
> **Source:** [cache-service.class.md](../../classes/cache-service.class.md)
|
|
157
|
-
> **Generated:** 2024-01-15
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Methods
|
|
162
|
-
|
|
163
|
-
### Core Operations
|
|
164
|
-
|
|
165
|
-
| Method | Description |
|
|
166
|
-
|--------|-------------|
|
|
167
|
-
| `get( key: string ): mixed` | Gets cached value by key |
|
|
168
|
-
| `set( key: string, value: mixed, ttl?: int )` | Sets value with optional TTL |
|
|
169
|
-
| `delete( key: string ): bool` | Removes key from cache |
|
|
170
|
-
| `has( key: string ): bool` | Checks if key exists |
|
|
171
|
-
| `clear()` | Removes all cached values |
|
|
172
|
-
|
|
173
|
-
### Batch Operations
|
|
174
|
-
|
|
175
|
-
| Method | Description |
|
|
176
|
-
|--------|-------------|
|
|
177
|
-
| `getMultiple( keys: array ): array` | Gets multiple values at once |
|
|
178
|
-
| `setMultiple( items: array, ttl?: int )` | Sets multiple values |
|
|
179
|
-
| `deleteMultiple( keys: array ): bool` | Removes multiple keys |
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Properties
|
|
184
|
-
|
|
185
|
-
| Property | Type | Description |
|
|
186
|
-
|----------|------|-------------|
|
|
187
|
-
| `defaultTtl` | int | Default time-to-live in seconds |
|
|
188
|
-
| `prefix` | string | Key prefix for namespacing |
|
|
189
|
-
|
|
190
|
-
---
|
|
191
|
-
|
|
192
|
-
## Common Usage
|
|
193
|
-
|
|
194
|
-
\`\`\`php
|
|
195
|
-
$value = $cache->get( 'user:123' );
|
|
196
|
-
if( !$value ){
|
|
197
|
-
$value = $this->loadUser( 123 );
|
|
198
|
-
$cache->set( 'user:123', $value, 3600 );
|
|
199
|
-
}
|
|
200
|
-
\`\`\`
|
|
201
|
-
|
|
202
|
-
---
|
|
203
|
-
|
|
204
|
-
*See [full documentation](../../classes/cache-service.class.md) for details.*
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## Naming Convention
|
|
210
|
-
|
|
211
|
-
- **File:** `{source-name}.quickref.md`
|
|
212
|
-
- **Location:** `docs/ai/quickrefs/`
|
|
213
|
-
|
|
214
|
-
Examples:
|
|
215
|
-
- `docs/classes/user-service.md` → `docs/ai/quickrefs/user-service.quickref.md`
|
|
216
|
-
- `docs/api/auth-endpoints.md` → `docs/ai/quickrefs/auth-endpoints.quickref.md`
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Tool: spawn_agent
|
|
2
|
-
|
|
3
|
-
> **Status:** EXPERIMENTAL
|
|
4
|
-
|
|
5
|
-
The `spawn_agent` tool allows you to launch a specialized sub-agent to perform a specific task in an isolated context.
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
8
|
-
|
|
9
|
-
Use this tool when you need to:
|
|
10
|
-
1. Perform a risky operation that should be sandboxed (e.g. "Refactor auth module").
|
|
11
|
-
2. Delegate a large task to a specialized persona (e.g. "Ask documentation-expert to write docs").
|
|
12
|
-
|
|
13
|
-
## Arguments
|
|
14
|
-
|
|
15
|
-
| Argument | Type | Description |
|
|
16
|
-
| :----------- | :------- | :--------------------------------------------------------------------- |
|
|
17
|
-
| `agent_name` | `string` | The name of the agent to spawn (must exist in `docs/ai/agents/`). |
|
|
18
|
-
| `goal` | `string` | Specific instructions for what the agent should achieve. |
|
|
19
|
-
| `isolation` | `string` | Isolation mode `worktree` (recommended) or `none`. Default `worktree`. |
|
|
20
|
-
|
|
21
|
-
## Example
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
contextuate run coder-agent --goal "Fix the bug in login.ts" --isolation=worktree
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Behavior
|
|
28
|
-
|
|
29
|
-
1. **Isolation:** The agent creates a new git worktree (branch).
|
|
30
|
-
2. **Execution:** The agent runs independently in that directory.
|
|
31
|
-
3. **Result:** The agent commits changes to its branch. You must then merge or review these changes.
|