@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.
Files changed (48) hide show
  1. package/dist/commands/doctor.d.ts +6 -0
  2. package/dist/commands/doctor.js +131 -0
  3. package/dist/commands/init.d.ts +0 -2
  4. package/dist/commands/init.js +164 -228
  5. package/dist/commands/install.js +8 -24
  6. package/dist/index.js +7 -0
  7. package/dist/templates/agents/aegis.md +1 -1
  8. package/dist/templates/agents/archon.md +116 -8
  9. package/dist/templates/agents/atlas.md +17 -17
  10. package/dist/templates/agents/canvas.md +1 -1
  11. package/dist/templates/agents/chronicle.md +1 -1
  12. package/dist/templates/agents/chronos.md +1 -1
  13. package/dist/templates/agents/cipher.md +1 -1
  14. package/dist/templates/agents/crucible.md +1 -1
  15. package/dist/templates/agents/echo.md +1 -1
  16. package/dist/templates/agents/forge.md +1 -1
  17. package/dist/templates/agents/ledger.md +34 -3
  18. package/dist/templates/agents/meridian.md +1 -1
  19. package/dist/templates/agents/nexus.md +1 -1
  20. package/dist/templates/agents/pythia.md +1 -1
  21. package/dist/templates/agents/scribe.md +1 -1
  22. package/dist/templates/agents/sentinel.md +1 -1
  23. package/dist/templates/agents/thoth.md +1 -1
  24. package/dist/templates/agents/unity.md +1 -1
  25. package/dist/templates/agents/vox.md +1 -1
  26. package/dist/templates/agents/weaver.md +1 -1
  27. package/dist/templates/{skills → commands}/consult.md +1 -1
  28. package/dist/templates/commands/orchestrate.md +49 -0
  29. package/dist/templates/framework-agents/documentation-expert.md +3 -3
  30. package/dist/templates/framework-agents/tools-expert.md +3 -3
  31. package/dist/templates/templates/contextuate.md +1 -1
  32. package/dist/templates/tools/agent-creator.md +4 -4
  33. package/dist/templates/tools/standards-detector.md +1 -1
  34. package/dist/utils/tools.d.ts +60 -0
  35. package/dist/utils/tools.js +260 -0
  36. package/package.json +2 -2
  37. package/dist/templates/skills/orchestrate.md +0 -173
  38. package/dist/templates/skills/pythia.md +0 -37
  39. package/dist/templates/templates/standards/go.standards.md +0 -167
  40. package/dist/templates/templates/standards/java.standards.md +0 -167
  41. package/dist/templates/templates/standards/javascript.standards.md +0 -292
  42. package/dist/templates/templates/standards/php.standards.md +0 -181
  43. package/dist/templates/templates/standards/python.standards.md +0 -175
  44. package/dist/templates/tools/agent-creator.tool.md +0 -252
  45. package/dist/templates/tools/quickref.tool.md +0 -216
  46. package/dist/templates/tools/spawn.tool.md +0 -31
  47. package/dist/templates/tools/standards-detector.tool.md +0 -301
  48. package/dist/templates/version.json +0 -8
@@ -1,167 +0,0 @@
1
- # Go Coding Standards
2
-
3
- > **Language:** Go
4
- > **Generated:** {DATE}
5
-
6
- ---
7
-
8
- ## Formatting
9
-
10
- ### Tooling
11
- - **Required:** `gofmt` (or `goimports`) must be applied to all files.
12
-
13
- ### Indentation
14
- - **Style:** Tabs (Standard Go behavior)
15
-
16
- ### Line Length
17
- - **Guideline:** No strict limit, but prefer readability (80-120 chars).
18
-
19
- ---
20
-
21
- ## Naming Conventions
22
-
23
- ### General Rule
24
- - Use `MixedCaps` or `mixedCaps` (CamelCase).
25
- - Keep names short and concise.
26
-
27
- ### Packages
28
- - **Style:** lowercase, single word
29
- - **Avoid:** snake_case, camelCase in package names
30
- - **Example:** `package user`, not `package user_service`
31
-
32
- ### Interfaces
33
- - **Style:** Method name + "er" (if single method)
34
- - **Example:** `Reader`, `Writer`, `Formatter`
35
-
36
- ### Structs/Interfaces
37
- - **Exported:** PascalCase (`User`)
38
- - **Unexported:** camelCase (`userHelper`)
39
-
40
- ### Functions/Methods
41
- - **Exported:** PascalCase (`GetUser`)
42
- - **Unexported:** camelCase (`parseData`)
43
-
44
- ### Constants
45
- - **Style:** PascalCase (for exported) or camelCase
46
- - **Avoid:** UPPER_SNAKE_CASE (unlike other languages)
47
- - **Example:** `MaxRetries`, not `MAX_RETRIES`
48
-
49
- ---
50
-
51
- ## Structure
52
-
53
- ### File Organization
54
- ```go
55
- package main
56
-
57
- // 1. Imports (grouped: stdlib, third-party, local)
58
- import (
59
- "fmt"
60
- "os"
61
-
62
- "github.com/pkg/errors"
63
-
64
- "myproject/internal/user"
65
- )
66
-
67
- // 2. Constants
68
- const DefaultTimeout = 30
69
-
70
- // 3. Types (Structs/Interfaces)
71
- type Service interface {
72
- Do() error
73
- }
74
-
75
- // 4. Factory Functions
76
- func NewService() Service {
77
- return &serviceImpl{}
78
- }
79
-
80
- // 5. Methods
81
- func (s *serviceImpl) Do() error {
82
- return nil
83
- }
84
- ```
85
-
86
- ---
87
-
88
- ## Error Handling
89
-
90
- ### Pattern
91
- - **Style:** Check errors immediately. Avoid nesting.
92
-
93
- ```go
94
- // GOOD
95
- f, err := os.Open("file.txt")
96
- if err != nil {
97
- return err
98
- }
99
-
100
- // BAD
101
- if f, err := os.Open("file.txt"); err == nil {
102
- // ...
103
- }
104
- ```
105
-
106
- ### Wrapping
107
- - **Guideline:** Wrap errors with context when passing up the stack.
108
- - **Example:** `fmt.Errorf("failed to open config: %w", err)`
109
-
110
- ---
111
-
112
- ## Documentation
113
-
114
- ### Comments
115
- - **Exported identifiers:** MUST have a doc comment starting with the name.
116
- - **Format:** Complete sentences.
117
-
118
- ```go
119
- // User represents a system user.
120
- type User struct { ... }
121
-
122
- // Fetch retrieves the user by ID.
123
- func (u *User) Fetch(id int) error { ... }
124
- ```
125
-
126
- ---
127
-
128
- ## Common Patterns
129
-
130
- ### Options Pattern
131
- ```go
132
- // Preferred for complex constructors
133
- type Option func(*Server)
134
-
135
- func WithPort(port int) Option {
136
- return func(s *Server) { s.port = port }
137
- }
138
-
139
- func NewServer(opts ...Option) *Server { ... }
140
- ```
141
-
142
- ### Context
143
- - **Guideline:** Pass `context.Context` as the first argument to functions performing I/O.
144
-
145
- ```go
146
- func (s *Service) GetData(ctx context.Context, id string) error { ... }
147
- ```
148
-
149
- ---
150
-
151
- ## Anti-Patterns
152
-
153
- ```go
154
- // BAD: Panic in libraries
155
- func Parse() {
156
- if err != nil {
157
- panic(err) // Return error instead
158
- }
159
- }
160
-
161
- // BAD: Global state
162
- var db *sql.DB // Use dependency injection
163
- ```
164
-
165
- ---
166
-
167
- *This file should be customized for your project. Replace placeholders with actual values.*
@@ -1,167 +0,0 @@
1
- # Java Coding Standards
2
-
3
- > **Language:** Java
4
- > **Generated:** {DATE}
5
-
6
- ---
7
-
8
- ## Formatting
9
-
10
- ### Indentation
11
- - **Style:** {Spaces}
12
- - **Size:** {4} {spaces}
13
-
14
- ### Braces
15
- - **Style:** K&R (same line) for classes and methods.
16
-
17
- ### Line Length
18
- - **Max Length:** {100|120} chars
19
-
20
- ---
21
-
22
- ## Naming Conventions
23
-
24
- ### Classes/Interfaces
25
- - **Style:** PascalCase
26
- - **Example:** `UserManager`, `PaymentProcessor`
27
-
28
- ### Methods
29
- - **Style:** camelCase
30
- - **Example:** `calculateTotal()`, `findUserById()`
31
-
32
- ### Variables
33
- - **Style:** camelCase
34
- - **Example:** `firstName`, `orderCount`
35
-
36
- ### Constants (static final)
37
- - **Style:** UPPER_SNAKE_CASE
38
- - **Example:** `DEFAULT_TIMEOUT`, `MAX_USERS`
39
-
40
- ### Generics
41
- - **Style:** Single capital letter
42
- - **Example:** `E` (element), `T` (type), `K` (key), `V` (value)
43
-
44
- ---
45
-
46
- ## Structure
47
-
48
- ### File Organization
49
- ```java
50
- // 1. Package declaration
51
- package com.company.project.service;
52
-
53
- // 2. Imports (sorted alphabetically, no wildcards)
54
- import java.util.List;
55
- import org.springframework.stereotype.Service;
56
-
57
- // 3. Class definition
58
- @Service
59
- public class UserService {
60
-
61
- // 4. Constants
62
- private static final int MAX_AGE = 100;
63
-
64
- // 5. Fields
65
- private final UserRepository userRepository;
66
-
67
- // 6. Constructor
68
- public UserService(UserRepository userRepository) {
69
- this.userRepository = userRepository;
70
- }
71
-
72
- // 7. Public methods
73
- public User getUser(Long id) {
74
- // ...
75
- }
76
-
77
- // 8. Private methods
78
- private void validate(User user) {
79
- // ...
80
- }
81
- }
82
- ```
83
-
84
- ---
85
-
86
- ## Documentation (Javadoc)
87
-
88
- ### Required Elements
89
- - **Classes:** Purpose of the class.
90
- - **Public Methods:** Description, `@param`, `@return`, `@throws`.
91
-
92
- ```java
93
- /**
94
- * Processes payment transactions.
95
- */
96
- public class PaymentService {
97
-
98
- /**
99
- * Authorizes a transaction.
100
- *
101
- * @param amount The amount to authorize
102
- * @return true if successful
103
- * @throws PaymentException if connection fails
104
- */
105
- public boolean authorize(BigDecimal amount) throws PaymentException { ... }
106
- }
107
- ```
108
-
109
- ---
110
-
111
- ## Error Handling
112
-
113
- ### Exceptions
114
- - **Guideline:** Use unchecked exceptions (`RuntimeException`) for recoverable errors.
115
- - **Guideline:** Avoid swallowing exceptions.
116
-
117
- ```java
118
- // GOOD
119
- try {
120
- file.read();
121
- } catch (IOException e) {
122
- throw new UncheckedIOException("Failed to read config", e);
123
- }
124
-
125
- // BAD
126
- catch (Exception e) {
127
- e.printStackTrace(); // Use a logger
128
- }
129
- ```
130
-
131
- ---
132
-
133
- ## Common Patterns
134
-
135
- ### Optional
136
- - **Guideline:** Use `Optional<T>` for return types that may be null.
137
- - **Avoid:** Using `Optional` in parameters or fields.
138
-
139
- ```java
140
- public Optional<User> findByEmail(String email) { ... }
141
- ```
142
-
143
- ### Streams API
144
- - **Guideline:** Prefer Streams for collections processing.
145
-
146
- ```java
147
- List<String> names = users.stream()
148
- .filter(User::isActive)
149
- .map(User::getName)
150
- .collect(Collectors.toList());
151
- ```
152
-
153
- ---
154
-
155
- ## Anti-Patterns
156
-
157
- ```java
158
- // BAD: Public fields
159
- public String name; // Use private + getter
160
-
161
- // BAD: Magic numbers
162
- if (status == 4) // Use constant STATUS_ACTIVE
163
- ```
164
-
165
- ---
166
-
167
- *This file should be customized for your project. Replace placeholders with actual values.*
@@ -1,292 +0,0 @@
1
- # JavaScript/TypeScript Coding Standards
2
-
3
- > **Language:** JavaScript / TypeScript
4
- > **Generated:** {DATE}
5
-
6
- ---
7
-
8
- ## Formatting
9
-
10
- ### Indentation
11
- - **Style:** {tabs|spaces}
12
- - **Size:** {2|4} {spaces|tabs}
13
-
14
- ### Semicolons
15
- - **Required:** {yes|no}
16
-
17
- ### Quotes
18
- - **Strings:** {single|double|backticks for templates}
19
-
20
- ### Trailing Commas
21
- - **Style:** {none|es5|all}
22
-
23
- ---
24
-
25
- ## Naming Conventions
26
-
27
- ### Classes/Components
28
- - **Style:** PascalCase
29
- - **Example:** `UserService`, `PaymentForm`
30
-
31
- ### Functions/Methods
32
- - **Style:** camelCase
33
- - **Example:** `getUserById()`, `handleSubmit()`
34
-
35
- ### Variables
36
- - **Style:** camelCase
37
- - **Example:** `userName`, `isActive`
38
-
39
- ### Constants
40
- - **Style:** {UPPER_SNAKE_CASE|camelCase}
41
- - **Example:** `MAX_RETRIES` or `maxRetries`
42
-
43
- ### Private Members
44
- - **Style:** {underscore prefix|# prefix|none}
45
- - **Example:** `_privateMethod()` or `#privateField`
46
-
47
- ### File Names
48
- - **Style:** {kebab-case|camelCase|PascalCase}
49
- - **Example:** `user-service.js` or `UserService.js`
50
-
51
- ---
52
-
53
- ## Structure
54
-
55
- ### Module Organization
56
- ```javascript
57
- // 1. Imports - external
58
- import React from 'react';
59
- import axios from 'axios';
60
-
61
- // 2. Imports - internal
62
- import { UserService } from './services';
63
- import { formatDate } from './utils';
64
-
65
- // 3. Types/Interfaces (TypeScript)
66
- interface User {
67
- id: number;
68
- name: string;
69
- }
70
-
71
- // 4. Constants
72
- const API_URL = '/api/v1';
73
-
74
- // 5. Main export
75
- export class MyClass {
76
- // ...
77
- }
78
-
79
- // 6. Helper functions (if not exported separately)
80
- function helperFunction() {
81
- // ...
82
- }
83
- ```
84
-
85
- ### Function Length
86
- - **Guideline:** {max lines per function}
87
-
88
- ---
89
-
90
- ## Variable Declarations
91
-
92
- ### Preferred Keywords
93
- - **Immutable:** `const` (default)
94
- - **Mutable:** `let`
95
- - **Avoid:** `var`
96
-
97
- ```javascript
98
- // GOOD
99
- const user = getUser();
100
- let count = 0;
101
-
102
- // BAD
103
- var user = getUser();
104
- ```
105
-
106
- ---
107
-
108
- ## Functions
109
-
110
- ### Declaration Style
111
- ```javascript
112
- // Preferred: {function declaration|arrow function|mixed}
113
-
114
- // Function declaration
115
- function processData( data ) {
116
- // ...
117
- }
118
-
119
- // Arrow function
120
- const processData = ( data ) => {
121
- // ...
122
- };
123
- ```
124
-
125
- ### Parameters
126
- ```javascript
127
- // Destructuring: {preferred|optional}
128
- function createUser( { name, email, role = 'user' } ) {
129
- // ...
130
- }
131
-
132
- // Default values
133
- function greet( name = 'Guest' ) {
134
- // ...
135
- }
136
- ```
137
-
138
- ---
139
-
140
- ## Async/Await
141
-
142
- ### Preferred Style
143
- ```javascript
144
- // {async/await|promises|callbacks for specific cases}
145
-
146
- // GOOD
147
- async function fetchUser( id ) {
148
- try {
149
- const response = await api.get( `/users/${id}` );
150
- return response.data;
151
- } catch( error ) {
152
- handleError( error );
153
- }
154
- }
155
-
156
- // AVOID (unless necessary)
157
- function fetchUser( id ) {
158
- return api.get( `/users/${id}` )
159
- .then( response => response.data )
160
- .catch( handleError );
161
- }
162
- ```
163
-
164
- ---
165
-
166
- ## TypeScript Specific
167
-
168
- ### Type Annotations
169
- ```typescript
170
- // {Required|Inferred where possible}
171
-
172
- // Explicit
173
- function getUser( id: number ): Promise<User> {
174
- // ...
175
- }
176
-
177
- // Inferred (if allowed)
178
- const count = 0; // inferred as number
179
- ```
180
-
181
- ### Interfaces vs Types
182
- ```typescript
183
- // Preferred for objects: {interface|type}
184
- interface User {
185
- id: number;
186
- name: string;
187
- }
188
-
189
- // Use type for: unions, primitives, tuples
190
- type Status = 'active' | 'inactive';
191
- ```
192
-
193
- ### Strict Mode
194
- - **Enabled:** {yes|no}
195
- - **Null checks:** {strict|relaxed}
196
-
197
- ---
198
-
199
- ## Error Handling
200
-
201
- ### Try/Catch
202
- ```javascript
203
- try {
204
- await riskyOperation();
205
- } catch( error ) {
206
- if( error instanceof SpecificError ){
207
- // handle specific
208
- } else {
209
- // handle general
210
- }
211
- }
212
- ```
213
-
214
- ### Error Types
215
- ```typescript
216
- // Custom errors: {yes|no}
217
- class ValidationError extends Error {
218
- constructor( message: string, public field: string ){
219
- super( message );
220
- this.name = 'ValidationError';
221
- }
222
- }
223
- ```
224
-
225
- ---
226
-
227
- ## Imports/Exports
228
-
229
- ### Module Style
230
- ```javascript
231
- // Named exports (preferred for utilities)
232
- export function helper() {}
233
- export const CONSTANT = 'value';
234
-
235
- // Default export (for main class/component)
236
- export default class MainService {}
237
- ```
238
-
239
- ### Import Organization
240
- ```javascript
241
- // 1. External packages
242
- // 2. Internal absolute paths
243
- // 3. Internal relative paths
244
- // 4. Styles/assets
245
- ```
246
-
247
- ---
248
-
249
- ## Common Patterns
250
-
251
- ### Null/Undefined Handling
252
- ```javascript
253
- // Optional chaining
254
- const city = user?.address?.city;
255
-
256
- // Nullish coalescing
257
- const name = user.name ?? 'Anonymous';
258
-
259
- // Default parameters
260
- function greet( name = 'Guest' ) {}
261
- ```
262
-
263
- ### Object Manipulation
264
- ```javascript
265
- // Spread for copies
266
- const updated = { ...user, name: 'New Name' };
267
-
268
- // Destructuring
269
- const { id, name } = user;
270
- ```
271
-
272
- ---
273
-
274
- ## Anti-Patterns
275
-
276
- ```javascript
277
- // BAD: {description}
278
- {bad example}
279
-
280
- // GOOD: {description}
281
- {good example}
282
- ```
283
-
284
- ---
285
-
286
- ## Framework-Specific
287
-
288
- {Add any React/Vue/Node/etc. specific conventions here}
289
-
290
- ---
291
-
292
- *This file should be customized for your project. Replace placeholders with actual values.*