-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cursorrules
More file actions
543 lines (537 loc) · 22.9 KB
/
.cursorrules
File metadata and controls
543 lines (537 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
Always start with 'Enso!'
You are building an Ai app called Butterfly AI, that aggregates news from multiple sources, performa AI analysis on the news, and to interact with users to enable useful follow up actions.
These are the key design goals of each core component:
- Server side:
- News aggregation:
- Fast efficient crawling of daily news from multiple sources
- Consistent quality scoring to only include high quality news
- The persona design is for server to be eable to automatically find the best news according to each persona's definition of focus
- News analysis:
- The system by default will perform the following analysis:
- Context analysis: This aims to provide full background information for the news:
- Historical timeline analysis of the of the news
- Key concepts in order to fully understand the news
- Common misconceptions about the context of the news
- Hidden implications of the news
- Key stakeholders analysis:
- Identify the key stakeholders of the news
- Analyze the relationship between the stakeholders
- Identify the key players in the news
- Ripple analysis and prediction:
- Identify the ripples prediction of the news
- Analyze the ripple's cause and effect, and metrics for measuring the prediction of the ripple
- News embedding:
- The system will embed the news into a vector space, and use the vector space to perform similarity search
- Flutter client:
- Define the concept of persona and ripple in the client:
- Persona:
- Each persona is a clear definition of a user's focus:
- in selecting the relevant news
- in analyzing the news
- in advising on concrete actions to take based on the news as well as the user's focus
- Each persona is defined by a detailed description of the persona's role, interests, and goals:
- The description is used to match the news feed based on embedding similarity search
- The description is used to guide the butterfly analyst on identifying/copiloting concrete suggestions for actions to take for each news
- User experience:
- User could toggle between different personas to see the news feed and analysis with different focus
- User could add new personas by providing a description
- User could edit an existing persona by providing a description
- For each news, we are dynamically generating a full context news that fabricates all the analysis information for the news into one cohesive informational news
- With this persona based design, we are building a news analysis tool that could help users make sense of the complex news landscape and to take actions accordingly.
# Important rules you HAVE TO follow
- Always add debug logs & comments in the code for easier debug & readability
- Every time you choose to apply a rule(s), explicitly state the rule{s} in the output. You can abbreviate the rule description to a single word or phrase.
# Project structure structure
├── Env_settings.txt
├── README.md
├── README.txt
├── README_CN.md
├── __pycache__
│ └── performance_test.cpython-312.pyc
├── app
│ └── database
├── butterfly_apps
│ ├── README.md
│ ├── analysis_options.yaml
│ ├── android
│ │ ├── app
│ │ │ ├── build.gradle
│ │ │ └── src
│ │ ├── build.gradle
│ │ ├── butterfly_apps_android.iml
│ │ ├── gradle
│ │ │ └── wrapper
│ │ ├── gradle.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── local.properties
│ │ └── settings.gradle
│ ├── assets
│ │ ├── personas
│ │ │ ├── 1c4fb43a-07f4-4a74-a16d-1782884aec2c.png
│ │ │ ├── 6c2ffe7e-d8fc-4b02-8f56-1a1238477045.png
│ │ │ ├── 6def9808-3447-42e4-8e42-08da22d4603d.png
│ │ │ ├── da9daa56-d211-4178-9b14-f3fc7218a5bc.png
│ │ │ ├── ea9aded4-da38-42c9-ad21-a9faf812a2ca.png
│ │ │ └── f2fc61d7-004d-4826-be5c-0dc378d2c3f4.png
│ │ ├── ripples
│ │ └── sources
│ │ ├── Baidu News.png
│ │ ├── baidu_news.png
│ │ ├── bbc.png
│ │ ├── bbc_news.png
│ │ ├── butterfly_effect.png
│ │ ├── butterfly_effect_archives.png
│ │ ├── cnn.png
│ │ ├── toutiao.png
│ │ ├── 今日头条.png
│ │ └── 蝴蝶效应工作室.png
│ ├── build
│ │ ├── 62f8bfe5eed53d7b35f1c81b2f3a01d9
│ │ │ ├── _composite.stamp
│ │ │ ├── gen_dart_plugin_registrant.stamp
│ │ │ └── gen_localizations.stamp
│ │ ├── app
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── kotlin
│ │ │ ├── kotlinToolingMetadata
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── cache.dill.track.dill
│ │ ├── connectivity_plus
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── flutter_assets
│ │ │ ├── AssetManifest.bin
│ │ │ ├── AssetManifest.bin.json
│ │ │ ├── AssetManifest.json
│ │ │ ├── FontManifest.json
│ │ │ ├── NOTICES
│ │ │ ├── assets
│ │ │ ├── fonts
│ │ │ ├── packages
│ │ │ └── shaders
│ │ ├── geocoding_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── ios
│ │ │ ├── Debug-iphonesimulator
│ │ │ ├── XCBuildData
│ │ │ ├── iphonesimulator
│ │ │ └── pod_inputs.fingerprint
│ │ ├── package_info_plus
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── kotlin
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── path_provider_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── permission_handler_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── receive_sharing_intent
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── kotlin
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── share_plus
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── kotlin
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── shared_preferences_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── kotlin
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── sqflite_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── url_launcher_android
│ │ │ ├── generated
│ │ │ ├── intermediates
│ │ │ ├── outputs
│ │ │ └── tmp
│ │ ├── web
│ │ │ ├── assets
│ │ │ ├── canvaskit
│ │ │ ├── favicon.png
│ │ │ ├── flutter.js
│ │ │ ├── flutter_bootstrap.js
│ │ │ ├── flutter_service_worker.js
│ │ │ ├── icons
│ │ │ ├── index.html
│ │ │ ├── main.dart.js
│ │ │ ├── manifest.json
│ │ │ └── version.json
│ │ └── webview_flutter_android
│ │ ├── generated
│ │ ├── intermediates
│ │ ├── outputs
│ │ └── tmp
│ ├── butterfly_apps.iml
│ ├── devtools_options.yaml
│ ├── ios
│ │ ├── Flutter
│ │ │ ├── AppFrameworkInfo.plist
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Flutter.podspec
│ │ │ ├── Generated.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── flutter_export_environment.sh
│ │ ├── Podfile
│ │ ├── Podfile.lock
│ │ ├── Pods
│ │ │ ├── Headers
│ │ │ ├── Local Podspecs
│ │ │ ├── Manifest.lock
│ │ │ ├── Pods.xcodeproj
│ │ │ ├── ReachabilitySwift
│ │ │ └── Target Support Files
│ │ ├── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ ├── Base.lproj
│ │ │ ├── GeneratedPluginRegistrant.h
│ │ │ ├── GeneratedPluginRegistrant.m
│ │ │ ├── Info.plist
│ │ │ └── Runner-Bridging-Header.h
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ ├── xcshareddata
│ │ │ └── xcuserdata
│ │ └── RunnerTests
│ │ └── RunnerTests.swift
│ ├── lib
│ │ ├── analysis_page.dart
│ │ ├── butterfly_news.code-workspace
│ │ ├── cards
│ │ │ ├── Reusable Cards Readme
│ │ │ ├── base_expandable_card.dart
│ │ │ ├── butterfly_card.dart
│ │ │ ├── cause_card.dart
│ │ │ ├── effect_card.dart
│ │ │ ├── interactive_learning_card.dart
│ │ │ ├── key_player_card.dart
│ │ │ ├── react_card.dart
│ │ │ └── ripple_card.dart
│ │ ├── config
│ │ │ └── api_config.dart
│ │ ├── generate_page.dart
│ │ ├── l10n
│ │ │ └── app_localizations.dart
│ │ ├── main.dart
│ │ ├── models
│ │ │ ├── interest.dart
│ │ │ ├── news_article.dart
│ │ │ ├── persona.dart
│ │ │ ├── ripple.dart
│ │ │ └── user.dart
│ │ ├── news_detail_page.dart
│ │ ├── news_page.dart
│ │ ├── pages
│ │ │ ├── create_persona_dialog.dart
│ │ │ ├── edit_ripple_page.dart
│ │ │ ├── persona_management_page.dart
│ │ │ ├── rss_feed_page.dart
│ │ │ ├── search_bar.dart
│ │ │ ├── settings_dialog.dart
│ │ │ └── settings_page.dart
│ │ ├── platform
│ │ │ ├── url_helper.dart
│ │ │ ├── url_platform_interface.dart
│ │ │ ├── url_platform_io.dart
│ │ │ └── url_platform_web.dart
│ │ ├── services
│ │ │ ├── api_service.dart
│ │ │ ├── connectivity_service.dart
│ │ │ ├── feed_proxy_service.dart
│ │ │ ├── persona_manager.dart
│ │ │ ├── persona_service.dart
│ │ │ ├── ripple_template_service.dart
│ │ │ ├── search_service.dart
│ │ │ ├── socket_service.dart
│ │ │ └── update_service.dart
│ │ ├── shared_content_analysis_page.dart
│ │ ├── shared_content_viewer.dart
│ │ ├── theme
│ │ │ └── butterfly_theme.dart
│ │ ├── utils
│ │ │ ├── api_exceptions.dart
│ │ │ ├── content_processing.dart
│ │ │ ├── platform_utils.dart
│ │ │ ├── platform_utils_io.dart
│ │ │ ├── platform_utils_web.dart
│ │ │ ├── ripple_map_widget.dart
│ │ │ ├── shared_cache_manager.dart
│ │ │ ├── text_styles.dart
│ │ │ └── time_utils.dart
│ │ ├── welcome_page.dart
│ │ └── widgets
│ ├── linux
│ │ ├── CMakeLists.txt
│ │ ├── flutter
│ │ │ ├── CMakeLists.txt
│ │ │ ├── ephemeral
│ │ │ ├── generated_plugin_registrant.cc
│ │ │ ├── generated_plugin_registrant.h
│ │ │ └── generated_plugins.cmake
│ │ ├── main.cc
│ │ ├── my_application.cc
│ │ └── my_application.h
│ ├── macos
│ │ ├── Flutter
│ │ │ ├── Flutter-Debug.xcconfig
│ │ │ ├── Flutter-Release.xcconfig
│ │ │ ├── GeneratedPluginRegistrant.swift
│ │ │ └── ephemeral
│ │ ├── Podfile
│ │ ├── Podfile.lock
│ │ ├── Pods
│ │ │ ├── Headers
│ │ │ ├── Local Podspecs
│ │ │ ├── Pods.xcodeproj
│ │ │ ├── ReachabilitySwift
│ │ │ └── Target Support Files
│ │ ├── Runner
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets
│ │ │ ├── Base.lproj
│ │ │ ├── Configs
│ │ │ ├── DebugProfile.entitlements
│ │ │ ├── Info.plist
│ │ │ ├── MainFlutterWindow.swift
│ │ │ └── Release.entitlements
│ │ ├── Runner.xcodeproj
│ │ │ ├── project.pbxproj
│ │ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ ├── Runner.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ └── RunnerTests
│ │ └── RunnerTests.swift
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ ├── test
│ │ └── widget_test.dart
│ ├── tool
│ │ ├── Misc techniques
│ │ ├── Update_apk.txt
│ │ ├── build
│ │ │ └── ios
│ │ ├── cleanup.sh
│ │ ├── cleanup_profile.dart
│ │ ├── deploy_update.sh
│ │ └── update_version.py
│ ├── web
│ │ ├── favicon.png
│ │ ├── icons
│ │ │ ├── Icon-192.png
│ │ │ ├── Icon-512.png
│ │ │ ├── Icon-maskable-192.png
│ │ │ └── Icon-maskable-512.png
│ │ ├── index.html
│ │ └── manifest.json
│ └── windows
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── ephemeral
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── butterfly_server
│ ├── Azure_Deployment
│ │ └── web_app_setup
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-312.pyc
│ │ └── butterfly_server.cpython-313.pyc
│ ├── app
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-312.pyc
│ │ │ ├── __init__.cpython-313.pyc
│ │ │ ├── __init__.cpython-39.pyc
│ │ │ ├── app.cpython-312.pyc
│ │ │ ├── config.cpython-312.pyc
│ │ │ ├── config.cpython-313.pyc
│ │ │ ├── config.cpython-39.pyc
│ │ │ ├── llm_service.cpython-312.pyc
│ │ │ ├── llm_service.cpython-313.pyc
│ │ │ ├── llm_service.cpython-39.pyc
│ │ │ ├── news_analysis.cpython-312.pyc
│ │ │ ├── news_analysis.cpython-313.pyc
│ │ │ ├── news_analysis.cpython-39.pyc
│ │ │ ├── news_categorizer.cpython-312.pyc
│ │ │ ├── news_categorizer.cpython-313.pyc
│ │ │ ├── news_crawler.cpython-312.pyc
│ │ │ ├── news_crawler.cpython-313.pyc
│ │ │ ├── news_crawler.cpython-39.pyc
│ │ │ ├── news_pipeline.cpython-312.pyc
│ │ │ ├── news_pipeline.cpython-313.pyc
│ │ │ ├── news_process_ripples.cpython-312.pyc
│ │ │ ├── news_process_ripples.cpython-313.pyc
│ │ │ ├── persona_rss_manager.cpython-312.pyc
│ │ │ ├── persona_rss_manager.cpython-313.pyc
│ │ │ ├── rss_discovery.cpython-312.pyc
│ │ │ ├── rss_discovery.cpython-313.pyc
│ │ │ ├── server_router.cpython-312.pyc
│ │ │ ├── server_router.cpython-313.pyc
│ │ │ ├── server_router.cpython-39.pyc
│ │ │ ├── time_utils.cpython-312.pyc
│ │ │ ├── time_utils.cpython-313.pyc
│ │ │ ├── time_utils.cpython-39.pyc
│ │ │ └── version_config.cpython-313.pyc
│ │ ├── backup_script.sh
│ │ ├── config
│ │ │ └── version_config.py
│ │ ├── config.py
│ │ ├── data
│ │ │ ├── add_column.py
│ │ │ ├── apk
│ │ │ ├── butterfly_ai copy.db
│ │ │ ├── butterfly_ai.db
│ │ │ ├── news
│ │ │ ├── news copy
│ │ │ ├── persona_opml
│ │ │ ├── persona_opml copy
│ │ │ ├── personas.json
│ │ │ ├── personas_backup
│ │ │ ├── personas_clean.json
│ │ │ ├── processed_sites.json
│ │ │ ├── ripple_template.json
│ │ │ ├── ripple_template8.json
│ │ │ ├── ripples
│ │ │ ├── rss_analysis
│ │ │ └── rss_sites.opml
│ │ ├── data-20241227
│ │ │ ├── add_column.py
│ │ │ ├── butterfly_ai copy.db
│ │ │ ├── butterfly_ai.db
│ │ │ ├── news
│ │ │ ├── news copy
│ │ │ ├── persona_opml
│ │ │ ├── persona_opml copy
│ │ │ ├── personas.json
│ │ │ ├── personas_backup
│ │ │ ├── personas_clean.json
│ │ │ ├── processed_sites.json
│ │ │ ├── ripple_template.json
│ │ │ ├── ripple_template8.json
│ │ │ ├── ripples
│ │ │ ├── rss_analysis
│ │ │ └── rss_sites.opml
│ │ ├── data-20241228
│ │ │ ├── add_column.py
│ │ │ ├── butterfly_ai copy.db
│ │ │ ├── butterfly_ai.db
│ │ │ ├── news
│ │ │ ├── news copy
│ │ │ ├── persona_opml
│ │ │ ├── persona_opml copy
│ │ │ ├── personas.json
│ │ │ ├── personas_backup
│ │ │ ├── personas_clean.json
│ │ │ ├── processed_sites.json
│ │ │ ├── ripple_template.json
│ │ │ ├── ripple_template8.json
│ │ │ ├── ripples
│ │ │ ├── rss_analysis
│ │ │ └── rss_sites.opml
│ │ ├── database
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ ├── base.py
│ │ │ ├── content_cache.py
│ │ │ ├── database.py
│ │ │ ├── hybrid_matcher.py
│ │ │ ├── migrate_ripple.py
│ │ │ ├── models.py
│ │ │ ├── schema.py
│ │ │ └── vector_utils.py
│ │ ├── llm_service.py
│ │ ├── news_analysis.py
│ │ ├── news_categorizer.py
│ │ ├── news_crawler.py
│ │ ├── news_pipeline.py
│ │ ├── news_process_ripples.py
│ │ ├── persona_rss_manager copy.py
│ │ ├── persona_rss_manager.py
│ │ ├── rss_discovery copy.py
│ │ ├── rss_discovery.py
│ │ ├── server_router.py
│ │ ├── static
│ │ │ ├── css
│ │ │ ├── flutter
│ │ │ └── images
│ │ ├── templates
│ │ │ └── landing.html
│ │ ├── test_database.py
│ │ ├── time_utils.py
│ │ ├── utils
│ │ │ ├── __pycache__
│ │ │ └── db_utils.py
│ │ └── version_config.py
│ ├── azure.yaml
│ ├── butterfly_server.py
│ ├── config.ini
│ ├── logs
│ ├── news_categorizer.log
│ ├── news_crawler.log
│ ├── persona_rss.log
│ ├── requirements.txt
│ ├── scripts
│ │ ├── cleanup_database.py
│ │ ├── manage_apk.py
│ │ ├── news_pipeline_manager.py
│ │ ├── news_pipeline_manager_asia.py
│ │ └── performance_test.py
│ └── tool
│ └── update_server_version.py
├── butterfly_tools
│ ├── clean_flutter.bat
│ └── copy_news.sh
├── lib
│ └── widgets
├── logs
├── news_categorizer.log
├── news_crawler.log
├── persona_rss.log
└── tests
├── sample_map_app.py
└── test_butterfly_viz.py