claude-anchor 1.0.0
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/LICENSE +24 -0
- package/README.md +296 -0
- package/bin/init.js +182 -0
- package/package.json +62 -0
- package/templates/CLAUDE.md +182 -0
- package/templates/_CONVERSATION-PREFERENCES.md +161 -0
- package/templates/_GOLDEN-RULES.md +84 -0
- package/templates/_LESSONS-LEARNED.md +100 -0
- package/templates/_LONG-TERM-MEMORY.md +274 -0
- package/templates/_SHORT-TERM-MEMORY.md +214 -0
- package/templates/_SYSTEM_ARCHITECTURE.md +321 -0
- package/templates/_TODOS.md +66 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# System Architecture - [PROJECT_NAME]
|
|
2
|
+
|
|
3
|
+
**Technical reference for system design, data flow, and component interactions.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## High-Level Architecture
|
|
8
|
+
|
|
9
|
+
<!-- CUSTOMIZE: Replace with your system's architecture -->
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
13
|
+
│ [PROJECT_NAME] │
|
|
14
|
+
│ │
|
|
15
|
+
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
|
|
16
|
+
│ │ INPUT LAYER │ │
|
|
17
|
+
│ │ │ │
|
|
18
|
+
│ │ [Input 1] [Input 2] [Input 3] [Input N] │ │
|
|
19
|
+
│ │ │ │ │ │ │ │
|
|
20
|
+
│ └───────┼──────────────────┼──────────────────┼──────────────────┼───────────┘ │
|
|
21
|
+
│ │ │ │ │ │
|
|
22
|
+
│ ▼ ▼ ▼ ▼ │
|
|
23
|
+
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
|
|
24
|
+
│ │ PROCESSING LAYER │ │
|
|
25
|
+
│ │ │ │
|
|
26
|
+
│ │ ┌─────────────────┐ ┌─────────────────┐ │ │
|
|
27
|
+
│ │ │ Component A │─────────────────────►│ Component B │ │ │
|
|
28
|
+
│ │ │ [Purpose] │ │ [Purpose] │ │ │
|
|
29
|
+
│ │ └─────────────────┘ └────────┬────────┘ │ │
|
|
30
|
+
│ │ │ │ │
|
|
31
|
+
│ │ ▼ │ │
|
|
32
|
+
│ │ ┌─────────────────┐ │ │
|
|
33
|
+
│ │ │ Component C │ │ │
|
|
34
|
+
│ │ │ [Purpose] │ │ │
|
|
35
|
+
│ │ └────────┬────────┘ │ │
|
|
36
|
+
│ └─────────────────────────────────────────────────────┼──────────────────────┘ │
|
|
37
|
+
│ │ │
|
|
38
|
+
│ ▼ │
|
|
39
|
+
│ ┌────────────────────────────────────────────────────────────────────────────┐ │
|
|
40
|
+
│ │ OUTPUT LAYER │ │
|
|
41
|
+
│ │ │ │
|
|
42
|
+
│ │ [Output 1] [Output 2] [Logs] [Metrics] │ │
|
|
43
|
+
│ └────────────────────────────────────────────────────────────────────────────┘ │
|
|
44
|
+
│ │
|
|
45
|
+
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Data Flow
|
|
51
|
+
|
|
52
|
+
<!-- CUSTOMIZE: Show how data moves through your system -->
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
┌─────────────────┐
|
|
56
|
+
│ USER INPUT │
|
|
57
|
+
│ [describe] │
|
|
58
|
+
└────────┬────────┘
|
|
59
|
+
│
|
|
60
|
+
▼
|
|
61
|
+
┌─────────────────┐
|
|
62
|
+
│ VALIDATION │
|
|
63
|
+
│ [describe] │
|
|
64
|
+
└────────┬────────┘
|
|
65
|
+
│
|
|
66
|
+
┌──────────────────┼──────────────────┐
|
|
67
|
+
│ │ │
|
|
68
|
+
▼ ▼ ▼
|
|
69
|
+
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
|
|
70
|
+
│ Path A │ │ Path B │ │ Path C │
|
|
71
|
+
│ [condition] │ │ [condition] │ │ [condition] │
|
|
72
|
+
└───────┬────────┘ └───────┬────────┘ └───────┬────────┘
|
|
73
|
+
│ │ │
|
|
74
|
+
└──────────────────┼──────────────────┘
|
|
75
|
+
│
|
|
76
|
+
▼
|
|
77
|
+
┌─────────────────┐
|
|
78
|
+
│ OUTPUT │
|
|
79
|
+
│ [describe] │
|
|
80
|
+
└─────────────────┘
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Decision Tree
|
|
86
|
+
|
|
87
|
+
<!-- CUSTOMIZE: Document option/flag parsing or business logic branches -->
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
┌─────────────────┐
|
|
91
|
+
│ START │
|
|
92
|
+
└────────┬────────┘
|
|
93
|
+
│
|
|
94
|
+
▼
|
|
95
|
+
┌─────────────────┐
|
|
96
|
+
│ Option A set? │
|
|
97
|
+
└────────┬────────┘
|
|
98
|
+
│
|
|
99
|
+
┌──────────────────┴──────────────────┐
|
|
100
|
+
│ YES │ NO
|
|
101
|
+
▼ ▼
|
|
102
|
+
┌────────────────┐ ┌────────────────┐
|
|
103
|
+
│ Do X │ │ Do Y │
|
|
104
|
+
└───────┬────────┘ └───────┬────────┘
|
|
105
|
+
│ │
|
|
106
|
+
└──────────────────┬──────────────────┘
|
|
107
|
+
│
|
|
108
|
+
▼
|
|
109
|
+
┌─────────────────┐
|
|
110
|
+
│ Option B set? │
|
|
111
|
+
└────────┬────────┘
|
|
112
|
+
│
|
|
113
|
+
┌──────────────────┴──────────────────┐
|
|
114
|
+
│ YES │ NO
|
|
115
|
+
▼ ▼
|
|
116
|
+
┌────────────────┐ ┌────────────────┐
|
|
117
|
+
│ Configure Z │ │ Use default │
|
|
118
|
+
└───────┬────────┘ └───────┬────────┘
|
|
119
|
+
│ │
|
|
120
|
+
└──────────────────┬──────────────────┘
|
|
121
|
+
│
|
|
122
|
+
▼
|
|
123
|
+
┌─────────────────┐
|
|
124
|
+
│ EXECUTE │
|
|
125
|
+
└─────────────────┘
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Component Details
|
|
131
|
+
|
|
132
|
+
### Component A
|
|
133
|
+
|
|
134
|
+
**Purpose:** [Description]
|
|
135
|
+
|
|
136
|
+
**Inputs:**
|
|
137
|
+
- [Input 1]: [Description]
|
|
138
|
+
- [Input 2]: [Description]
|
|
139
|
+
|
|
140
|
+
**Outputs:**
|
|
141
|
+
- [Output 1]: [Description]
|
|
142
|
+
|
|
143
|
+
**Dependencies:**
|
|
144
|
+
- [Dependency 1]
|
|
145
|
+
- [Dependency 2]
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
┌─────────────────────────────────────────────────────┐
|
|
149
|
+
│ COMPONENT A │
|
|
150
|
+
├─────────────────────────────────────────────────────┤
|
|
151
|
+
│ │
|
|
152
|
+
│ Input ──► [Process 1] ──► [Process 2] ──► Output │
|
|
153
|
+
│ │ │
|
|
154
|
+
│ ▼ │
|
|
155
|
+
│ [Side Effect] │
|
|
156
|
+
│ │
|
|
157
|
+
└─────────────────────────────────────────────────────┘
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### Component B
|
|
163
|
+
|
|
164
|
+
<!-- CUSTOMIZE: Add more component sections as needed -->
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## File System Layout
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
172
|
+
│ FILE SYSTEM LAYOUT │
|
|
173
|
+
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
174
|
+
│ │
|
|
175
|
+
│ PROJECT ROOT │
|
|
176
|
+
│ ──────────────────────────────────────────────────── │
|
|
177
|
+
│ /path/to/project/ │
|
|
178
|
+
│ ├── CLAUDE.md Project documentation │
|
|
179
|
+
│ ├── GOLDEN-RULES.md Security rules │
|
|
180
|
+
│ ├── TODOS.md Task tracking │
|
|
181
|
+
│ ├── LESSONS-LEARNED.md Past issues │
|
|
182
|
+
│ ├── _CONVERSATION-PREFERENCES.md Output preferences │
|
|
183
|
+
│ ├── _SYSTEM_ARCHITECTURE.md This file │
|
|
184
|
+
│ ├── src/ Source code │
|
|
185
|
+
│ │ ├── main.py Entry point │
|
|
186
|
+
│ │ ├── component_a.py Component A │
|
|
187
|
+
│ │ └── component_b.py Component B │
|
|
188
|
+
│ ├── config/ Configuration │
|
|
189
|
+
│ │ └── settings.yaml Settings file │
|
|
190
|
+
│ ├── tests/ Test suite │
|
|
191
|
+
│ └── docs/ Additional docs │
|
|
192
|
+
│ │
|
|
193
|
+
│ RUNTIME FILES (Temporary) │
|
|
194
|
+
│ ──────────────────────────────────────────────────── │
|
|
195
|
+
│ /tmp/[project]/ │
|
|
196
|
+
│ ├── [temp files] │
|
|
197
|
+
│ └── [cache files] │
|
|
198
|
+
│ │
|
|
199
|
+
│ USER DATA (Persistent) │
|
|
200
|
+
│ ──────────────────────────────────────────────────── │
|
|
201
|
+
│ ~/.config/[project]/ User configuration │
|
|
202
|
+
│ ~/.local/share/[project]/ User data │
|
|
203
|
+
│ ~/.[project].log Log file │
|
|
204
|
+
│ │
|
|
205
|
+
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## State Management
|
|
211
|
+
|
|
212
|
+
<!-- CUSTOMIZE: If your system maintains state -->
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
216
|
+
│ STATE TRANSITIONS │
|
|
217
|
+
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
218
|
+
│ │
|
|
219
|
+
│ ┌──────────┐ trigger ┌──────────┐ trigger ┌──────────┐ │
|
|
220
|
+
│ │ IDLE │ ──────────────►│ RUNNING │ ──────────────►│ COMPLETE │ │
|
|
221
|
+
│ └──────────┘ └──────────┘ └──────────┘ │
|
|
222
|
+
│ ▲ │ │
|
|
223
|
+
│ │ │ error │
|
|
224
|
+
│ │ ▼ │
|
|
225
|
+
│ │ ┌──────────┐ │
|
|
226
|
+
│ └──────────────────────│ ERROR │ │
|
|
227
|
+
│ reset └──────────┘ │
|
|
228
|
+
│ │
|
|
229
|
+
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Error Handling
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
238
|
+
│ ERROR HANDLING FLOW │
|
|
239
|
+
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
240
|
+
│ │
|
|
241
|
+
│ ┌─────────────┐ │
|
|
242
|
+
│ │ OPERATION │ │
|
|
243
|
+
│ └──────┬──────┘ │
|
|
244
|
+
│ │ │
|
|
245
|
+
│ ▼ │
|
|
246
|
+
│ ┌─────────────────────┐ │
|
|
247
|
+
│ │ Error occurred? │ │
|
|
248
|
+
│ └──────────┬──────────┘ │
|
|
249
|
+
│ │ │
|
|
250
|
+
│ ┌──────────┴──────────┐ │
|
|
251
|
+
│ │ YES │ NO │
|
|
252
|
+
│ ▼ ▼ │
|
|
253
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
254
|
+
│ │ Retryable? │ │ SUCCESS │ │
|
|
255
|
+
│ └──────┬──────┘ │ Exit 0 │ │
|
|
256
|
+
│ │ └─────────────┘ │
|
|
257
|
+
│ ┌──────┴──────┐ │
|
|
258
|
+
│ │ YES │ NO │
|
|
259
|
+
│ ▼ ▼ │
|
|
260
|
+
│ ┌──────────┐ ┌──────────┐ │
|
|
261
|
+
│ │ RETRY │ │ FAIL │ │
|
|
262
|
+
│ │ (N max) │ │ Exit 1 │ │
|
|
263
|
+
│ └──────────┘ │ Log err │ │
|
|
264
|
+
│ └──────────┘ │
|
|
265
|
+
│ │
|
|
266
|
+
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Exit Codes
|
|
272
|
+
|
|
273
|
+
| Code | Meaning | Action |
|
|
274
|
+
|------|---------|--------|
|
|
275
|
+
| 0 | Success | Continue |
|
|
276
|
+
| 1 | General error | Check logs |
|
|
277
|
+
| 2 | Configuration error | Fix config |
|
|
278
|
+
| 3 | [Custom] | [Action] |
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Performance Considerations
|
|
283
|
+
|
|
284
|
+
<!-- CUSTOMIZE: Document performance characteristics -->
|
|
285
|
+
|
|
286
|
+
| Operation | Expected Time | Notes |
|
|
287
|
+
|-----------|---------------|-------|
|
|
288
|
+
| [Operation 1] | ~X seconds | [Notes] |
|
|
289
|
+
| [Operation 2] | ~Y minutes | [Notes] |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Security Model
|
|
294
|
+
|
|
295
|
+
<!-- CUSTOMIZE: If applicable -->
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
299
|
+
│ SECURITY BOUNDARIES │
|
|
300
|
+
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
301
|
+
│ │
|
|
302
|
+
│ TRUSTED ZONE │ UNTRUSTED ZONE │
|
|
303
|
+
│ ────────────── │ ──────────────── │
|
|
304
|
+
│ │ │
|
|
305
|
+
│ [Internal components] ◄────┼────► [External inputs] │
|
|
306
|
+
│ [Config files] │ [User data] │
|
|
307
|
+
│ [Credentials] │ [Network data] │
|
|
308
|
+
│ │ │
|
|
309
|
+
│ VALIDATION BOUNDARY ════════════╪═══════════════════════ │
|
|
310
|
+
│ │ │
|
|
311
|
+
│ All data crossing boundary │ │
|
|
312
|
+
│ MUST be validated │ │
|
|
313
|
+
│ │
|
|
314
|
+
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
**Document Version:** 1.0
|
|
320
|
+
**Created:** [DATE]
|
|
321
|
+
**Purpose:** Technical reference for [PROJECT_NAME] internals
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# TODOs - [PROJECT_NAME]
|
|
2
|
+
|
|
3
|
+
**Planned improvements and tasks.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## High Priority
|
|
8
|
+
|
|
9
|
+
<!-- CUSTOMIZE: Add urgent/blocking tasks here -->
|
|
10
|
+
|
|
11
|
+
- [ ] **[Task Title]**
|
|
12
|
+
- [Subtask or detail]
|
|
13
|
+
- [Subtask or detail]
|
|
14
|
+
- **Blocked by:** [dependency, if any]
|
|
15
|
+
|
|
16
|
+
- [ ] **[Task Title]**
|
|
17
|
+
- [Description]
|
|
18
|
+
- **DO AFTER:** [prerequisite task]
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Medium Priority
|
|
23
|
+
|
|
24
|
+
<!-- CUSTOMIZE: Add important but non-urgent tasks -->
|
|
25
|
+
|
|
26
|
+
- [ ] **[Task Title]**
|
|
27
|
+
- [Description]
|
|
28
|
+
- [Acceptance criteria]
|
|
29
|
+
|
|
30
|
+
- [ ] **[Task Title]**
|
|
31
|
+
- [Description]
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Low Priority
|
|
36
|
+
|
|
37
|
+
<!-- CUSTOMIZE: Add nice-to-have improvements -->
|
|
38
|
+
|
|
39
|
+
- [ ] **[Task Title]**
|
|
40
|
+
- [Description]
|
|
41
|
+
|
|
42
|
+
- [ ] **[Task Title]**
|
|
43
|
+
- [Description]
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Completed
|
|
48
|
+
|
|
49
|
+
<!-- Move completed tasks here with [x] checkbox -->
|
|
50
|
+
|
|
51
|
+
- [x] [Completed task description]
|
|
52
|
+
- [x] [Completed task description]
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Ideas for Future
|
|
57
|
+
|
|
58
|
+
<!-- Parking lot for ideas not yet committed to -->
|
|
59
|
+
|
|
60
|
+
- [Idea 1]
|
|
61
|
+
- [Idea 2]
|
|
62
|
+
- [Idea 3]
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
**Add new items as they come up. Move to Completed when done.**
|