@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.
@@ -60,10 +60,10 @@ async function discoverTemplates() {
60
60
  .filter(f => f.endsWith('.md'))
61
61
  .map(f => f.replace('.md', ''));
62
62
  }
63
- // Discover skills
64
- const skillsDir = path_1.default.join(templateSource, 'skills');
65
- if (fs_extra_1.default.existsSync(skillsDir)) {
66
- const files = await fs_extra_1.default.readdir(skillsDir);
63
+ // Discover skills (stored in commands/ directory)
64
+ const commandsDir = path_1.default.join(templateSource, 'commands');
65
+ if (fs_extra_1.default.existsSync(commandsDir)) {
66
+ const files = await fs_extra_1.default.readdir(commandsDir);
67
67
  result.skills = files
68
68
  .filter(f => f.endsWith('.md'))
69
69
  .map(f => f.replace('.md', ''));
@@ -188,7 +188,7 @@ async function installTools(names, force) {
188
188
  return installed;
189
189
  }
190
190
  // Install skills (slash commands)
191
- // Skills are installed to docs/ai/skills/ and symlinked to docs/ai/commands/ for Claude Code
191
+ // Skills are installed directly to docs/ai/commands/ for Claude Code
192
192
  async function installSkills(names, force) {
193
193
  const templateSource = getTemplateSource();
194
194
  const templates = await discoverTemplates();
@@ -197,26 +197,10 @@ async function installSkills(names, force) {
197
197
  const normalized = name.toLowerCase().trim().replace(/^\//, ''); // Remove leading slash if present
198
198
  const matched = templates.skills.find(s => s.toLowerCase() === normalized);
199
199
  if (matched) {
200
- const src = path_1.default.join(templateSource, 'skills', `${matched}.md`);
201
- const skillDest = path_1.default.join('docs/ai/skills', `${matched}.md`);
202
- const commandDest = path_1.default.join('docs/ai/commands', `${matched}.md`);
203
- // Install skill file to skills/
204
- if (await copyFile(src, skillDest, force)) {
200
+ const src = path_1.default.join(templateSource, 'commands', `${matched}.md`);
201
+ const dest = path_1.default.join('docs/ai/commands', `${matched}.md`);
202
+ if (await copyFile(src, dest, force)) {
205
203
  installed++;
206
- // Create symlink in commands/ for Claude Code to pick up
207
- await fs_extra_1.default.ensureDir(path_1.default.dirname(commandDest));
208
- const symlinkTarget = path_1.default.relative(path_1.default.dirname(commandDest), skillDest);
209
- if (fs_extra_1.default.existsSync(commandDest)) {
210
- if (force) {
211
- await fs_extra_1.default.remove(commandDest);
212
- }
213
- else {
214
- console.log(chalk_1.default.yellow(`[SKIP] Symlink already exists: ${commandDest}`));
215
- continue;
216
- }
217
- }
218
- await fs_extra_1.default.symlink(symlinkTarget, commandDest);
219
- console.log(chalk_1.default.green(`[OK] Symlinked: ${commandDest} -> ${symlinkTarget}`));
220
204
  }
221
205
  }
222
206
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esotech/contextuate",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "**Standardized AI Context for Software Projects**",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "scripts": {
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
- "build": "tsc && mkdir -p dist/templates && cp -r src/templates/* dist/templates/ && mkdir -p dist/monitor/hooks && cp src/monitor/hooks/emit-event.js dist/monitor/hooks/ && chmod +x dist/index.js dist/monitor/hooks/emit-event.js dist/monitor/daemon/cli.js dist/monitor/server/cli.js",
14
+ "build": "tsc && rm -rf dist/templates && mkdir -p dist/templates && cp -r src/templates/* dist/templates/ && mkdir -p dist/monitor/hooks && cp src/monitor/hooks/emit-event.js dist/monitor/hooks/ && chmod +x dist/index.js dist/monitor/hooks/emit-event.js dist/monitor/daemon/cli.js dist/monitor/server/cli.js",
15
15
  "build:monitor-ui": "cd src/monitor/ui && npm install && npm run build",
16
16
  "build:all": "npm run build && npm run build:monitor-ui",
17
17
  "prepublishOnly": "npm run build:all"
@@ -1,37 +0,0 @@
1
- # /pythia - Strategic Planning Oracle
2
-
3
- Alias for `/consult`. Activates the PYTHIA agent for strategic planning and research.
4
-
5
- ## Agent Invocation
6
-
7
- **IMPORTANT:** Before proceeding, read and adopt the PYTHIA agent persona:
8
-
9
- **Agent Definition:** [agents/pythia.md](../agents/pythia.md)
10
-
11
- Read the agent file above, then follow its guidelines for research, synthesis, and specification creation.
12
-
13
- ## Usage
14
-
15
- ```
16
- /pythia [topic or question]
17
- ```
18
-
19
- See [/consult](./consult.md) for full documentation and behavior details.
20
-
21
- ## Quick Reference
22
-
23
- | Command | Purpose |
24
- |---------|---------|
25
- | `/pythia [topic]` | Research and plan before implementation |
26
- | `/consult [topic]` | Same as `/pythia` |
27
- | `/orchestrate [task]` | Execute implementation with specialist agents |
28
-
29
- ## Example Flow
30
-
31
- ```
32
- /pythia How should we implement real-time notifications?
33
- |
34
- [PYTHIA produces specification]
35
- |
36
- /orchestrate Implement the notification system per spec
37
- ```
@@ -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.*