llm-docs-sync 1.0.0 → 1.0.4

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @edutherapy/llm-docs-sync
1
+ # llm-docs-sync
2
2
 
3
3
  A functional, Effect-based documentation sync tool for maintaining up-to-date LLM context in your SvelteKit projects.
4
4
 
@@ -9,12 +9,15 @@ A functional, Effect-based documentation sync tool for maintaining up-to-date LL
9
9
  - 🔄 **Auto-Sync**: Keeps your LLM documentation context fresh
10
10
  - ⚙️ **Configurable**: Customize sources, output directory, and project rules
11
11
  - 🎯 **SvelteKit Ready**: Pre-configured for SvelteKit + Effect projects
12
+ - 📝 **Auto-Generated AGENTS.md**: Creates comprehensive agent configuration files
12
13
 
13
14
  ## Installation
14
15
 
15
- \`\`\`bash
16
+ ```bash
17
+
16
18
  bun add -d llm-docs-sync
17
- \`\`\`
19
+
20
+ ```
18
21
 
19
22
  ## Usage
20
23
 
@@ -22,69 +25,78 @@ bun add -d llm-docs-sync
22
25
 
23
26
  Add to your package.json scripts:
24
27
 
25
- \`\`\`json
28
+ ```json
29
+
26
30
  {
27
31
  "scripts": {
28
32
  "sync-docs": "llm-docs-sync"
29
33
  }
30
34
  }
31
- \`\`\`
35
+
36
+ ```
32
37
 
33
38
  Run:
34
- \`\`\`bash
39
+
40
+ ```bash
41
+
35
42
  bun run sync-docs
36
- \`\`\`
37
43
 
38
- This package is published under:
39
- - **Brand**: EduTherapy (a brand of Talim Shifa Studio)
40
- - **GitLab Repository**: https://gitlab.com/EduTherapy/llm-docs-sync
41
- - **NPM Publisher**: edutherapy (https://www.npmjs.com/~edutherapy)
42
- - **Company Website**: https://eduth.pro/
43
- - **Contact**: edutherapystudio@gmail.com
44
+ ```
44
45
 
45
46
  ### Programmatic API
46
47
 
47
- \`\`\`typescript
48
- import { syncDocs, DEFAULT_SOURCES, type DocSource } from 'llm-docs-sync';
48
+ ```typescript
49
+ import { syncDocs, type DocSource } from 'llm-docs-sync';
50
+ import { Effect } from 'effect';
51
+ import { DEFAULT_SOURCES, DEFAULT_PROJECT_RULES } from 'llm-docs-sync/defaults';
49
52
 
50
53
  // Use defaults
51
- await syncDocs();
54
+ Effect.runPromise(syncDocs());
52
55
 
53
56
  // Custom configuration
54
- await syncDocs({
55
- sources: [
56
- ...DEFAULT_SOURCES,
57
- { name: "Custom Lib", url: "https://example.com/llms.txt" }
58
- ],
59
- outputDir: "./docs/context",
60
- agentsFile: "AI_CONTEXT.md",
61
- projectRules: [
62
- "Use TypeScript strict mode",
63
- "Follow Effect best practices"
64
- ]
65
- });
66
- \`\`\`
57
+ Effect.runPromise(
58
+ syncDocs({
59
+ sources: [
60
+ ...DEFAULT_SOURCES,
61
+ { name: "Custom Lib", url: "https://example.com/llms.txt" }
62
+ ],
63
+ outputDir: "./docs/context",
64
+ agentsFile: "AI_CONTEXT.md",
65
+ projectRules: [
66
+ "Use TypeScript strict mode",
67
+ "Follow Effect best practices"
68
+ ]
69
+ })
70
+ );
71
+ ```
67
72
 
68
73
  ### Default Sources
69
74
 
70
- - Svelte 5
71
- - SvelteKit
72
- - Effect
73
- - Tailwind v4
74
- - Lucide
75
- - Vite
76
- - Biome
75
+ - Svelte 5: `https://svelte.dev/docs/svelte/llms.txt`
76
+ - SvelteKit: `https://svelte.dev/docs/kit/llms.txt`
77
+ - Effect: `https://effect.website/llms-full.txt`
78
+ - Vite: `https://vite.dev/llms.txt`
79
+ - Skeleton: `https://www.skeleton.dev/llms-svelte.txt`
80
+ - Dexie: `https://dexie.org/llms.txt`
81
+
82
+ ### Default Project Rules
83
+
84
+ 1. **Always use Bun** for adding packages, running scripts, and testing.
85
+ 2. **Svelte 5 Runes:** Use `$state`, `$derived`, and `$effect` as defined in local Svelte context.
86
+ 3. **Effect TS:** Follow the patterns defined in the Effect full documentation file.
77
87
 
78
88
  ## Configuration
79
89
 
80
- \`\`\`typescript
90
+ ```typescript
91
+
81
92
  type SyncConfig = {
82
- sources?: DocSource[]; // Documentation sources to sync
93
+ sources?: DocSource[]; // Documentation sources to sync (default: DEFAULT_SOURCES)
83
94
  outputDir?: string; // Output directory (default: ./.opencode/context)
84
95
  agentsFile?: string; // AGENTS.md file path (default: AGENTS.md)
85
- projectRules?: string[]; // Custom project rules
96
+ projectRules?: string[]; // Custom project rules (default: DEFAULT_PROJECT_RULES)
86
97
  };
87
- \`\`\`
98
+
99
+ ```
88
100
 
89
101
  ## Example Workflow
90
102
 
@@ -93,14 +105,117 @@ type SyncConfig = {
93
105
  3. Run before starting development or in CI/CD
94
106
  4. Your AGENTS.md and context files stay updated
95
107
 
96
- \`\`\`json
108
+ ```json
109
+
97
110
  {
98
111
  "scripts": {
99
112
  "predev": "bun run sync-docs",
100
113
  "dev": "vite dev"
101
114
  }
102
115
  }
103
- \`\`\`
116
+
117
+ ```
118
+
119
+ ## Generated AGENTS.md Format
120
+
121
+ The tool generates an `AGENTS.md` file with the following structure. If the file already exists, the new content is appended with a separator (`\n\n---\n\n`):
122
+
123
+ ```markdown
124
+ # OpenCode Agent Configuration
125
+ **Primary Runtime:** Bun (System-wide)
126
+ **Context Strategy:** Local Documentation First
127
+
128
+ ## 📚 Local Documentation References
129
+ The following files contain the latest API specifications and standards.
130
+ Always consult these before attempting to write code for these libraries:
131
+
132
+ - **Svelte 5**: Refer to "./.opencode/context/svelte-5.md"
133
+ - **SvelteKit**: Refer to "./.opencode/context/sveltekit.md"
134
+ - **Effect**: Refer to "./.opencode/context/effect.md"
135
+ - **Vite**: Refer to "./.opencode/context/vite.md"
136
+ - **Skeleton**: Refer to "./.opencode/context/skeleton.md"
137
+ - **Dexie**: Refer to "./.opencode/context/dexie.md"
138
+
139
+ ## 🛠 Project Rules
140
+ 1. **Always use Bun** for adding packages, running scripts, and testing.
141
+ 2. **Svelte 5 Runes:** Use `$state`, `$derived`, and `$effect` as defined in local Svelte context.
142
+ 3. **Effect TS:** Follow the patterns defined in the Effect full documentation file.
143
+ ```
144
+
145
+ ## API Reference
146
+
147
+ ### Functions
148
+
149
+ #### `syncDocs(config?: Partial<SyncConfig>): Effect.Effect<void, never>`
150
+
151
+ Main sync function that fetches documentation from all sources and generates AGENTS.md.
152
+
153
+ #### `runCLI(): void`
154
+
155
+ Runs the sync process from command line.
156
+
157
+ #### `toFileName(name: string): string`
158
+
159
+ Converts a source name to a filename (lowercase, spaces to hyphens).
160
+
161
+ #### `createManifest(results: readonly SyncResult[]): readonly string[]`
162
+
163
+ Creates manifest entries for successful sync results.
164
+
165
+ ### Types
166
+
167
+ #### `DocSource`
168
+
169
+ ```typescript
170
+
171
+ interface DocSource {
172
+ readonly name: string;
173
+ readonly url: string;
174
+ }
175
+
176
+ ```
177
+
178
+ #### `SyncResult`
179
+
180
+ ```typescript
181
+
182
+ interface SyncResult {
183
+ readonly name: string;
184
+ readonly filePath: string;
185
+ readonly status: "success" | "failed";
186
+ }
187
+
188
+ ```
189
+
190
+ #### `SyncConfig`
191
+
192
+ ```typescript
193
+
194
+ interface SyncConfig {
195
+ readonly sources: readonly DocSource[];
196
+ readonly outputDir: string;
197
+ readonly agentsFile?: string;
198
+ readonly projectRules?: readonly string[];
199
+ }
200
+
201
+ ```
202
+
203
+ ## Testing
204
+
205
+ ```bash
206
+
207
+ bun test
208
+
209
+ ```
210
+
211
+ ## Publishing
212
+
213
+ This package is published under:
214
+ - **Brand**: EduTherapy (a brand of Talim Shifa Studio)
215
+ - **NPM Package**: [llm-docs-sync](https://www.npmjs.com/package/llm-docs-sync)
216
+ - **NPM Publisher**: [edutherapy](https://www.npmjs.com/~edutherapy)
217
+ - **Company Website**: https://eduth.pro/
218
+ - **Contact**: edutherapystudio@gmail.com
104
219
 
105
220
  ## License
106
221