clavix 5.2.1 → 5.3.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/README.md +3 -4
- package/dist/cli/commands/diagnose.js +1 -1
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.js +130 -24
- package/dist/cli/commands/update.js +1 -1
- package/dist/constants.d.ts +18 -0
- package/dist/constants.js +24 -0
- package/dist/core/adapter-registry.d.ts +39 -0
- package/dist/core/adapter-registry.js +208 -0
- package/dist/core/adapters/base-adapter.d.ts +1 -0
- package/dist/core/adapters/base-adapter.js +14 -1
- package/dist/core/adapters/universal-adapter.d.ts +49 -0
- package/dist/core/adapters/universal-adapter.js +88 -0
- package/dist/core/command-transformer.d.ts +11 -12
- package/dist/core/command-transformer.js +11 -12
- package/dist/core/doc-injector.d.ts +0 -4
- package/dist/core/doc-injector.js +5 -10
- package/dist/core/template-assembler.d.ts +1 -1
- package/dist/core/template-assembler.js +1 -1
- package/dist/templates/agents/agents.md +1 -2
- package/dist/templates/agents/copilot-instructions.md +1 -2
- package/dist/templates/agents/octo.md +1 -1
- package/dist/templates/agents/warp.md +2 -2
- package/dist/templates/instructions/core/file-operations.md +15 -11
- package/dist/templates/slash-commands/_canonical/plan.md +1 -2
- package/dist/templates/slash-commands/_components/MANIFEST.md +81 -0
- package/dist/templates/slash-commands/_components/agent-protocols/AGENT_MANUAL.md +1 -1
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +15 -17
- package/dist/types/adapter-config.d.ts +73 -0
- package/dist/types/adapter-config.js +24 -0
- package/dist/types/config.js +3 -2
- package/dist/utils/error-utils.d.ts +4 -0
- package/dist/utils/error-utils.js +6 -0
- package/dist/utils/file-system.js +7 -12
- package/dist/utils/legacy-command-cleanup.d.ts +14 -0
- package/dist/utils/legacy-command-cleanup.js +14 -0
- package/dist/utils/logger.d.ts +32 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/string-utils.d.ts +10 -0
- package/dist/utils/string-utils.js +12 -0
- package/dist/utils/version.d.ts +20 -0
- package/dist/utils/version.js +43 -0
- package/oclif.manifest.json +130 -0
- package/package.json +1 -1
- package/dist/cli/commands/config.d.ts +0 -28
- package/dist/cli/commands/config.js +0 -447
- package/dist/templates/slash-commands/_components/agent-protocols/decision-rules.md +0 -232
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +0 -177
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
## Handling Problems Gracefully
|
|
2
|
-
|
|
3
|
-
When something goes wrong, fix it yourself when possible. When you can't, explain simply and offer options.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
### Three Types of Problems
|
|
8
|
-
|
|
9
|
-
#### 1. Small Hiccups (Fix Yourself)
|
|
10
|
-
|
|
11
|
-
These are minor issues you can handle automatically. Fix them and move on - no need to bother the user.
|
|
12
|
-
|
|
13
|
-
| What Happened | What You Do | What You Say |
|
|
14
|
-
|---------------|-------------|--------------|
|
|
15
|
-
| Folder doesn't exist | Create it | "Setting things up..." (or nothing) |
|
|
16
|
-
| Index file missing | Create empty one | (Nothing - just continue) |
|
|
17
|
-
| No saved prompts yet | Normal state | "No prompts saved yet - let's create one!" |
|
|
18
|
-
| Old settings file | Still works | (Nothing - use it anyway) |
|
|
19
|
-
| Session not found | Start new one | (Nothing - create new) |
|
|
20
|
-
|
|
21
|
-
**Your approach:**
|
|
22
|
-
1. Fix the issue automatically
|
|
23
|
-
2. Maybe mention it briefly: "Setting things up..."
|
|
24
|
-
3. Continue with what you were doing
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
#### 2. Need User Input (Ask Nicely)
|
|
29
|
-
|
|
30
|
-
These need a decision from the user. Stop, explain simply, and offer clear choices.
|
|
31
|
-
|
|
32
|
-
| What Happened | What You Ask |
|
|
33
|
-
|---------------|--------------|
|
|
34
|
-
| Can't find that task | "I can't find task [X]. Let me show you what's available..." |
|
|
35
|
-
| Multiple projects found | "I found a few projects here. Which one should we work on?" |
|
|
36
|
-
| Not sure what you want | "I want to make sure I understand - is this about [A] or [B]?" |
|
|
37
|
-
| No plan exists yet | "I don't see a plan for this project. Want to create one first?" |
|
|
38
|
-
| Task is blocked | "This task needs [thing] first. Should I work on that, or skip for now?" |
|
|
39
|
-
| File already exists | "This file already exists. Should I replace it, rename the new one, or cancel?" |
|
|
40
|
-
|
|
41
|
-
**Your approach:**
|
|
42
|
-
1. Stop what you're doing
|
|
43
|
-
2. Explain the situation simply
|
|
44
|
-
3. Give 2-3 clear options
|
|
45
|
-
4. Wait for their answer
|
|
46
|
-
|
|
47
|
-
**Example:**
|
|
48
|
-
> "I found a few projects in this folder:
|
|
49
|
-
>
|
|
50
|
-
> 1. **todo-app** - 3 tasks done, 2 to go
|
|
51
|
-
> 2. **auth-feature** - Not started yet
|
|
52
|
-
>
|
|
53
|
-
> Which one should we work on?"
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
#### 3. Real Problems (Need Their Help)
|
|
58
|
-
|
|
59
|
-
These are issues you can't fix. Stop completely and explain what they need to do.
|
|
60
|
-
|
|
61
|
-
| What Happened | What You Say |
|
|
62
|
-
|---------------|--------------|
|
|
63
|
-
| Permission denied | "I can't write to that folder - it looks like a permissions issue. You might need to check the folder settings." |
|
|
64
|
-
| Config file broken | "One of the settings files got corrupted. You might need to delete it and start fresh, or try to fix it manually." |
|
|
65
|
-
| Git conflict | "There's a git conflict that needs your attention. Once you resolve it, we can continue." |
|
|
66
|
-
| Disk full | "Looks like the disk is full - I can't save anything. Once you free up some space, we can try again." |
|
|
67
|
-
| Connection timeout | "I'm having trouble connecting. Could be a network issue - want to try again?" |
|
|
68
|
-
| Invalid format | "That doesn't look quite right - [specific issue]. Could you check and try again?" |
|
|
69
|
-
|
|
70
|
-
**Your approach:**
|
|
71
|
-
1. Stop immediately
|
|
72
|
-
2. Explain what went wrong (simply!)
|
|
73
|
-
3. Tell them what needs to happen to fix it
|
|
74
|
-
4. Don't try to fix it yourself
|
|
75
|
-
|
|
76
|
-
**Example:**
|
|
77
|
-
> "I can't continue - there's a git conflict in some files.
|
|
78
|
-
>
|
|
79
|
-
> Files with conflicts:
|
|
80
|
-
> - src/components/Header.tsx
|
|
81
|
-
> - src/utils/auth.ts
|
|
82
|
-
>
|
|
83
|
-
> Once you resolve these (pick which changes to keep), let me know and we'll continue."
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
### How to Explain Problems
|
|
88
|
-
|
|
89
|
-
**Don't say this:**
|
|
90
|
-
> "ENOENT: no such file or directory, open '.clavix/outputs/prompts/'"
|
|
91
|
-
|
|
92
|
-
**Say this:**
|
|
93
|
-
> "Setting up your prompt storage..." (then just create the directory)
|
|
94
|
-
|
|
95
|
-
**Don't say this:**
|
|
96
|
-
> "Error: EACCES: permission denied, mkdir '/usr/local/clavix'"
|
|
97
|
-
|
|
98
|
-
**Say this:**
|
|
99
|
-
> "I can't create files in that location - it needs admin permissions.
|
|
100
|
-
> Try running from your project folder instead?"
|
|
101
|
-
|
|
102
|
-
**Don't say this:**
|
|
103
|
-
> "SyntaxError: Unexpected token } in JSON at position 1523"
|
|
104
|
-
|
|
105
|
-
**Say this:**
|
|
106
|
-
> "The settings file got corrupted somehow. I can start fresh if you want,
|
|
107
|
-
> or you can try to fix it manually."
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
### Recovery Templates
|
|
112
|
-
|
|
113
|
-
**For small hiccups (you fixed it):**
|
|
114
|
-
```
|
|
115
|
-
[If worth mentioning]
|
|
116
|
-
"Small hiccup - I've handled it. Moving on..."
|
|
117
|
-
|
|
118
|
-
[Usually just]
|
|
119
|
-
(Say nothing, continue working)
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
**For needing user input:**
|
|
123
|
-
```
|
|
124
|
-
"Quick question: [simple explanation of situation]
|
|
125
|
-
|
|
126
|
-
Would you like me to:
|
|
127
|
-
1. [Option A]
|
|
128
|
-
2. [Option B]
|
|
129
|
-
3. [Option C - usually 'skip for now']"
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**For real problems:**
|
|
133
|
-
```
|
|
134
|
-
"I ran into something I can't fix myself.
|
|
135
|
-
|
|
136
|
-
What happened: [simple explanation]
|
|
137
|
-
|
|
138
|
-
To fix this, you'll need to:
|
|
139
|
-
1. [Step 1]
|
|
140
|
-
2. [Step 2]
|
|
141
|
-
|
|
142
|
-
Once that's done, let me know and we'll pick up where we left off."
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
### Common Patterns (Internal Reference)
|
|
148
|
-
|
|
149
|
-
**File/Folder Issues:**
|
|
150
|
-
- File not found → Usually create it automatically
|
|
151
|
-
- Already exists → Ask: replace, rename, or cancel?
|
|
152
|
-
- Permission denied → Stop, explain, user needs to fix
|
|
153
|
-
- Disk full → Stop, explain, user needs to free space
|
|
154
|
-
|
|
155
|
-
**Git Issues:**
|
|
156
|
-
- CONFLICT detected → Stop, list files, user must resolve
|
|
157
|
-
- Not a git repo → Ask if they want to initialize one
|
|
158
|
-
- Nothing to commit → Fine, just continue
|
|
159
|
-
|
|
160
|
-
**Settings Issues:**
|
|
161
|
-
- Can't read/parse file → Stop, explain, might need to delete and restart
|
|
162
|
-
- Empty file → Usually just initialize with defaults
|
|
163
|
-
|
|
164
|
-
**Task Issues:**
|
|
165
|
-
- Task not found → Show available tasks, ask which one
|
|
166
|
-
- Already completed → Tell them, show what's left
|
|
167
|
-
- Wrong order → Explain the dependency, offer to fix order
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
### The Golden Rules
|
|
172
|
-
|
|
173
|
-
1. **Fix it yourself if you can** - Don't bother users with small stuff
|
|
174
|
-
2. **Explain simply when you can't** - No error codes, no jargon
|
|
175
|
-
3. **Always offer a path forward** - Never leave them stuck
|
|
176
|
-
4. **Preserve their work** - Never lose what they've done
|
|
177
|
-
5. **Stay calm and friendly** - Problems happen, no big deal
|