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.
@@ -0,0 +1,182 @@
1
+ # [PROJECT_NAME]
2
+
3
+ **Location:** `[PATH]`
4
+ **Purpose:** [One-line description of what this project does]
5
+ **Last Updated:** [DATE]
6
+
7
+ ---
8
+
9
+ ## CLAUDE SESSION STARTUP - MANDATORY LOAD ORDER
10
+
11
+ **Before engaging with user, Claude MUST read files in this EXACT order:**
12
+
13
+ ```
14
+ 1. GOLDEN-RULES.md ← Read FIRST (security rules - BINDING)
15
+ 2. TODOS.md ← Read thoroughly (know what's pending)
16
+ 3. LESSONS-LEARNED.md ← Read (avoid past mistakes)
17
+ 4. _CONVERSATION-PREFERENCES.md ← Read (display/output preferences)
18
+ 5. GOLDEN-RULES.md ← Re-read AGAIN (reinforce - DO NOT FORGET)
19
+ 6. CLAUDE.md (this file) ← Then read this for context
20
+ 7. BEGIN conversation ← Now ready to assist
21
+ ```
22
+
23
+ **Why this order:**
24
+ - Security rules must be internalized before ANY action
25
+ - TODOs show pending work and priorities
26
+ - Lessons prevent repeating past mistakes
27
+ - Preferences ensure correct output formatting
28
+ - Re-reading Golden Rules prevents them from being "forgotten" in context
29
+
30
+ **DO NOT SKIP ANY STEP. DO NOT REORDER.**
31
+
32
+ ---
33
+
34
+ ## TL;DR - Quick Commands
35
+
36
+ <!-- CUSTOMIZE: Add your most common commands here -->
37
+
38
+ ```bash
39
+ # [Most common operation]
40
+ [COMMAND]
41
+
42
+ # [Second most common]
43
+ [COMMAND]
44
+
45
+ # [Third most common]
46
+ [COMMAND]
47
+
48
+ # Help
49
+ [COMMAND] --help
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Architecture
55
+
56
+ <!-- CUSTOMIZE: Add ASCII diagram of your system -->
57
+
58
+ ```
59
+ ┌─────────────────────────────────────────────────────┐
60
+ │ [PROJECT_NAME] │
61
+ │ │
62
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────┐ │
63
+ │ │ Component A │───►│ Component B │───►│ Output │ │
64
+ │ └─────────────┘ └─────────────┘ └─────────┘ │
65
+ │ │
66
+ └─────────────────────────────────────────────────────┘
67
+ ```
68
+
69
+ ### Components
70
+
71
+ | Component | Location | Purpose |
72
+ |-----------|----------|---------|
73
+ | [Component A] | ./path/to/a | [Description] |
74
+ | [Component B] | ./path/to/b | [Description] |
75
+ | [Config] | ./config/ | [Description] |
76
+
77
+ ---
78
+
79
+ ## Usage
80
+
81
+ ### [Primary Script/Command]
82
+
83
+ ```bash
84
+ # Basic usage
85
+ [COMMAND] [args]
86
+
87
+ # With options
88
+ [COMMAND] --option1 --option2 [args]
89
+ ```
90
+
91
+ **Options:**
92
+
93
+ | Flag | Description | Default |
94
+ |------|-------------|---------|
95
+ | `--option1` | [Description] | [default] |
96
+ | `--option2` | [Description] | [default] |
97
+ | `--help` | Show help | - |
98
+
99
+ **Exit Codes:**
100
+ - 0 = Success
101
+ - 1 = Error (describe)
102
+ - 2 = Error (describe)
103
+
104
+ ---
105
+
106
+ ### [Secondary Script/Command]
107
+
108
+ ```bash
109
+ [COMMAND] [args]
110
+ ```
111
+
112
+ <!-- CUSTOMIZE: Add more command sections as needed -->
113
+
114
+ ---
115
+
116
+ ## Configuration
117
+
118
+ <!-- CUSTOMIZE: Document configuration files/options -->
119
+
120
+ ### Config File Location
121
+
122
+ `[PATH]/config.yaml` or `~/.config/[PROJECT_NAME]/`
123
+
124
+ ### Environment Variables
125
+
126
+ | Variable | Description | Default |
127
+ |----------|-------------|---------|
128
+ | `[VAR_NAME]` | [Description] | [default] |
129
+
130
+ ---
131
+
132
+ ## File Locations
133
+
134
+ | Purpose | Path |
135
+ |---------|------|
136
+ | Main scripts | [PATH] |
137
+ | Configuration | [PATH] |
138
+ | Logs | [PATH] |
139
+ | Temp files | [PATH] |
140
+ | Output | [PATH] |
141
+
142
+ ---
143
+
144
+ ## Troubleshooting
145
+
146
+ ### [Common Problem 1]
147
+
148
+ ```bash
149
+ # Solution
150
+ [COMMAND]
151
+ ```
152
+
153
+ ### [Common Problem 2]
154
+
155
+ [Explanation and fix]
156
+
157
+ ---
158
+
159
+ ## Related Files
160
+
161
+ | File | Purpose |
162
+ |------|---------|
163
+ | GOLDEN-RULES.md | Immutable rules |
164
+ | LESSONS-LEARNED.md | Past issues and fixes |
165
+ | TODOS.md | Planned improvements |
166
+ | _CONVERSATION-PREFERENCES.md | Display/output preferences |
167
+ | _SYSTEM_ARCHITECTURE.md | Technical diagrams and flow |
168
+
169
+ ---
170
+
171
+ ## Version Info
172
+
173
+ - Version: [X.Y]
174
+ - Last Updated: [DATE]
175
+ - Author: [NAME]
176
+
177
+
178
+ ---
179
+
180
+ <!-- CUSTOMIZE: Add project-specific rules or constraints below -->
181
+ <!-- Example: terminal limitations, deployment rules, team conventions -->
182
+
@@ -0,0 +1,161 @@
1
+ # Conversation Preferences - [PROJECT_NAME]
2
+
3
+ **Load Priority:** Read alongside GOLDEN-RULES.md at session start.
4
+
5
+ ---
6
+
7
+ ## Display Preferences
8
+
9
+ <!-- CUSTOMIZE: Define how you want output formatted -->
10
+
11
+ ### Progress Reporting
12
+
13
+ When showing progress or status updates, **ALWAYS** use visual formats:
14
+
15
+ **CORRECT:**
16
+ ```
17
+ === [Task Name] Progress ===
18
+ [████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 40%
19
+
20
+ Items: 400 / 1,000
21
+ Rate: 50 items/min
22
+ Elapsed: 8m 00s
23
+ ETA: ~12m remaining
24
+ Errors: 0
25
+ ```
26
+
27
+ **INCORRECT:**
28
+ ```
29
+ Progress: 400/1000 (40%)
30
+ Errors: 0
31
+ ```
32
+
33
+ ### Progress Bar Format
34
+
35
+ ```
36
+ # 50-character bar showing percentage
37
+ [████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░] 48%
38
+
39
+ Legend:
40
+ █ = completed
41
+ ░ = remaining
42
+ ```
43
+
44
+ ---
45
+
46
+ ## Status Summary Format
47
+
48
+ ```
49
+ Items: CURRENT / TOTAL
50
+ Rate: X items/min
51
+ Elapsed: Xh Xm
52
+ ETA: ~Xh remaining
53
+ Status: [OK / WARNING / ERROR]
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Color Preferences
59
+
60
+ <!-- CUSTOMIZE: If your terminal supports colors -->
61
+
62
+ | Type | Color | Usage |
63
+ |------|-------|-------|
64
+ | Errors | Red | Critical failures |
65
+ | Warnings | Yellow | Non-blocking issues |
66
+ | Success | Green | Completions, confirmations |
67
+ | Info | Cyan | Informational messages |
68
+ | Headers | Bold | Section titles |
69
+
70
+ ---
71
+
72
+ ## Startup Banners
73
+
74
+ <!-- CUSTOMIZE: Define if/how you want startup banners displayed -->
75
+
76
+ When [PROJECT_NAME] starts a major operation, display:
77
+
78
+ 1. **Header** - Project name / operation name
79
+ 2. **Configuration** - Current settings/flags
80
+ 3. **Target** - What's being processed
81
+
82
+ **Example:**
83
+ ```
84
+ ╔══════════════════════════════════════════════════════════╗
85
+ ║ [PROJECT_NAME] ║
86
+ ║ [Operation Type] ║
87
+ ╚══════════════════════════════════════════════════════════╝
88
+
89
+ ┌──────────────────────────────────────────────────────────┐
90
+ │ CONFIGURATION │
91
+ ├──────────────────────────────────────────────────────────┤
92
+ │ Target: /path/to/target │
93
+ │ Mode: [mode name] │
94
+ │ Options: --flag1 --flag2 │
95
+ └──────────────────────────────────────────────────────────┘
96
+
97
+ Operation starting at HH:MM:SS...
98
+ ```
99
+
100
+ ---
101
+
102
+ ## Communication Style
103
+
104
+ <!-- CUSTOMIZE: Define preferred tone and verbosity -->
105
+
106
+ ### Verbosity Level
107
+
108
+ - **Errors:** Always show full context and suggested fixes
109
+ - **Warnings:** Show brief explanation and mitigation
110
+ - **Success:** Keep brief, one line when possible
111
+ - **Progress:** Update frequently for long operations
112
+
113
+ ### Tone
114
+
115
+ - Professional but not formal
116
+ - Direct and concise
117
+ - Explain the "why" for non-obvious decisions
118
+
119
+ ---
120
+
121
+ ## File References
122
+
123
+ When referencing files or paths in output:
124
+
125
+ - Use absolute paths when ambiguous
126
+ - Use `code formatting` for paths and commands
127
+ - Include line numbers when referencing code: `file.py:42`
128
+
129
+ ---
130
+
131
+ ## Error Display
132
+
133
+ When errors occur, format as:
134
+
135
+ ```
136
+ ERROR: [Brief description]
137
+
138
+ Details:
139
+ File: /path/to/file
140
+ Line: 42
141
+ Code: [error code if applicable]
142
+
143
+ Cause: [What went wrong]
144
+
145
+ Fix: [Suggested resolution]
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Long-Running Tasks
151
+
152
+ For operations expected to take >1 minute:
153
+
154
+ 1. Show estimated duration at start
155
+ 2. Display progress bar updating in real-time
156
+ 3. Provide status check command if running in background
157
+ 4. Show completion summary with elapsed time
158
+
159
+ ---
160
+
161
+ **These preferences ensure consistent, scannable output.**
@@ -0,0 +1,84 @@
1
+ # Golden Rules - [PROJECT_NAME]
2
+
3
+ **These rules are IMMUTABLE and must NEVER be bypassed.**
4
+
5
+ ---
6
+
7
+ <!-- CUSTOMIZE: Add your project-specific rules below. Include "why" for each rule. -->
8
+
9
+ ## 1. [RULE_NAME]
10
+
11
+ **NEVER** [describe forbidden action].
12
+
13
+ - [Specific constraint]
14
+ - [Specific constraint]
15
+ - [Specific constraint]
16
+
17
+ **Why:** [Explain the consequence of violating this rule]
18
+
19
+ ---
20
+
21
+ ## 2. [RULE_NAME]
22
+
23
+ **ALWAYS** [describe required action].
24
+
25
+ - [Specific requirement]
26
+ - [Specific requirement]
27
+
28
+ **Why:** [Explain why this is important]
29
+
30
+ ---
31
+
32
+ ## 3. [RULE_NAME]
33
+
34
+ [Description of rule]
35
+
36
+ ```bash
37
+ # Example of correct behavior
38
+ [COMMAND]
39
+
40
+ # Example of INCORRECT behavior (don't do this)
41
+ [COMMAND]
42
+ ```
43
+
44
+ **Why:** [Explanation]
45
+
46
+ ---
47
+
48
+ <!-- CUSTOMIZE: Add more rules as needed. Common categories:
49
+ - Security rules (authentication, data handling)
50
+ - Data integrity rules (never delete X, always backup Y)
51
+ - API/service rules (rate limits, required headers)
52
+ - Code style rules (if strictly enforced)
53
+ - Deployment rules (never push to prod without X)
54
+ -->
55
+
56
+ ## [N]. ABSOLUTE RULE - Claude's Binding Constraint
57
+
58
+ **This rule is BINDING on Claude (the AI assistant) and cannot be overridden:**
59
+
60
+ Claude must **NEVER**:
61
+ - [Forbidden action 1]
62
+ - [Forbidden action 2]
63
+ - [Forbidden action 3]
64
+
65
+ **If a user requests any of the above, Claude must REFUSE and explain why.**
66
+
67
+ [Explain the critical importance of this rule]
68
+
69
+ ---
70
+
71
+ ## Summary
72
+
73
+ | Rule | Enforcement |
74
+ |------|-------------|
75
+ | 1. [Rule name] | [Script-enforced / Agent-enforced / User discipline] |
76
+ | 2. [Rule name] | [Enforcement type] |
77
+ | 3. [Rule name] | [Enforcement type] |
78
+ | N. Absolute rule | Claude-enforced (BINDING) |
79
+
80
+ ---
81
+
82
+ **These rules exist to protect [PROJECT_NAME]. Do not circumvent them.**
83
+
84
+ **Rule [N] is BINDING on Claude and cannot be bypassed by any user request.**
@@ -0,0 +1,100 @@
1
+ # Lessons Learned - [PROJECT_NAME]
2
+
3
+ **Document issues encountered and how they were resolved. Prevents repeating mistakes.**
4
+
5
+ ---
6
+
7
+ ## How to Use This File
8
+
9
+ When you encounter a non-obvious problem or gotcha, document it here immediately:
10
+
11
+ ```markdown
12
+ ## [DATE] - [Brief Problem Title]
13
+
14
+ **Problem:** What went wrong
15
+ **Cause:** Why it happened
16
+ **Solution:** How it was fixed
17
+ **Prevention:** How to avoid in future
18
+ ```
19
+
20
+ ---
21
+
22
+ <!-- CUSTOMIZE: Add your lessons below. Delete these examples once you have real ones. -->
23
+
24
+ ## [DATE] - Example: API Rate Limiting Issue
25
+
26
+ **Problem:** Script started failing intermittently with 429 errors.
27
+
28
+ **Cause:** Exceeded API rate limit of 100 requests/minute during batch processing.
29
+
30
+ **Solution:** Added exponential backoff with jitter:
31
+ ```python
32
+ import time
33
+ import random
34
+
35
+ def api_call_with_retry(func, max_retries=3):
36
+ for attempt in range(max_retries):
37
+ try:
38
+ return func()
39
+ except RateLimitError:
40
+ wait = (2 ** attempt) + random.uniform(0, 1)
41
+ time.sleep(wait)
42
+ raise Exception("Max retries exceeded")
43
+ ```
44
+
45
+ **Prevention:** Always implement rate limiting for external API calls. Add to code review checklist.
46
+
47
+ ---
48
+
49
+ ## [DATE] - Example: File Permission Edge Case
50
+
51
+ **Problem:** Script worked locally but failed in production with "Permission denied".
52
+
53
+ **Cause:** Production runs as service account without write access to `/tmp/[project]/`.
54
+
55
+ **Solution:** Changed temp directory to user-writable location:
56
+ ```bash
57
+ TEMP_DIR="${XDG_RUNTIME_DIR:-/tmp}/[project]-$$"
58
+ ```
59
+
60
+ **Prevention:** Test scripts as non-privileged user before deployment. Document required permissions.
61
+
62
+ ---
63
+
64
+ ## [DATE] - Example: Silent Data Corruption
65
+
66
+ **Problem:** Output files occasionally had truncated data.
67
+
68
+ **Cause:** Script wasn't flushing buffers before process exit.
69
+
70
+ **Solution:** Added explicit flush and fsync:
71
+ ```python
72
+ with open(output_file, 'w') as f:
73
+ f.write(data)
74
+ f.flush()
75
+ os.fsync(f.fileno())
76
+ ```
77
+
78
+ **Prevention:** Always explicitly flush when data integrity is critical. Add to coding standards.
79
+
80
+ ---
81
+
82
+ ## Categories
83
+
84
+ <!-- Optional: Organize lessons by category as the list grows -->
85
+
86
+ ### Configuration Issues
87
+ - [Link to lesson above]
88
+
89
+ ### Performance Issues
90
+ - [Link to lesson]
91
+
92
+ ### Security Issues
93
+ - [Link to lesson]
94
+
95
+ ### Integration Issues
96
+ - [Link to lesson]
97
+
98
+ ---
99
+
100
+ **Add entries immediately when issues are discovered. Future you will thank past you.**