cnhkmcp 2.1.9__py3-none-any.whl → 2.3.0__py3-none-any.whl

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.
Files changed (142) hide show
  1. cnhkmcp/__init__.py +1 -1
  2. cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221/BRAIN_AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221Mac_Linux/321/207/320/231/320/230/321/206/320/254/320/274.zip +0 -0
  3. cnhkmcp/untracked/AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221//321/205/320/237/320/234/321/205/320/227/342/225/227/321/205/320/276/320/231/321/210/320/263/320/225AI/321/206/320/231/320/243/321/205/342/225/226/320/265/321/204/342/225/221/342/225/221_Windows/321/207/320/231/320/230/321/206/320/254/320/274.exe +0 -0
  4. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/README.md +1 -1
  5. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/config.json +2 -2
  6. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +1 -1
  7. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/chroma.sqlite3 +0 -0
  8. cnhkmcp/untracked/APP/Tranformer/Transformer.py +2 -2
  9. cnhkmcp/untracked/APP/Tranformer/transformer_config.json +1 -1
  10. cnhkmcp/untracked/APP/blueprints/feature_engineering.py +2 -2
  11. cnhkmcp/untracked/APP/blueprints/inspiration_house.py +4 -4
  12. cnhkmcp/untracked/APP/blueprints/paper_analysis.py +3 -3
  13. cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +34 -73
  14. cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +2 -2
  15. cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +366 -1
  16. cnhkmcp/untracked/APP/static/inspiration.js +345 -13
  17. cnhkmcp/untracked/APP/templates/index.html +11 -3
  18. cnhkmcp/untracked/APP/templates/transformer_web.html +1 -1
  19. cnhkmcp/untracked/APP/trailSomeAlphas/README.md +38 -0
  20. cnhkmcp/untracked/APP/trailSomeAlphas/ace.log +66 -0
  21. cnhkmcp/untracked/APP/trailSomeAlphas/enhance_template.py +588 -0
  22. cnhkmcp/untracked/APP/trailSomeAlphas/requirements.txt +3 -0
  23. cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline.py +1001 -0
  24. cnhkmcp/untracked/APP/trailSomeAlphas/run_pipeline_step_by_step.ipynb +5258 -0
  25. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/OUTPUT_TEMPLATE.md +325 -0
  26. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/SKILL.md +503 -0
  27. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/examples.md +244 -0
  28. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/output_report/ASI_delay1_analyst11_ideas.md +285 -0
  29. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-data-feature-engineering/reference.md +399 -0
  30. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/SKILL.md +40 -0
  31. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/config.json +6 -0
  32. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709385783386000.json +388 -0
  33. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386274840400.json +131 -0
  34. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709386838244700.json +1926 -0
  35. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387369198500.json +31 -0
  36. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709387908905800.json +1926 -0
  37. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709388486243600.json +240 -0
  38. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389024058600.json +1926 -0
  39. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709389549608700.json +41 -0
  40. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390068714000.json +110 -0
  41. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709390591996900.json +36 -0
  42. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391129137100.json +31 -0
  43. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709391691643500.json +41 -0
  44. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392192099200.json +31 -0
  45. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709392703423500.json +46 -0
  46. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769709393213729400.json +246 -0
  47. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710186683932500.json +388 -0
  48. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187165414300.json +131 -0
  49. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710187665211700.json +1926 -0
  50. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188149193400.json +31 -0
  51. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710188667627400.json +1926 -0
  52. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189220822000.json +240 -0
  53. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710189726189500.json +1926 -0
  54. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190248066100.json +41 -0
  55. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710190768298700.json +110 -0
  56. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191282588100.json +36 -0
  57. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710191838960900.json +31 -0
  58. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192396688000.json +41 -0
  59. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710192941922400.json +31 -0
  60. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710193473524600.json +46 -0
  61. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710194001961200.json +246 -0
  62. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710420975888800.json +46 -0
  63. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710421647590100.json +196 -0
  64. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422131378500.json +5 -0
  65. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710422644184400.json +196 -0
  66. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710423702350600.json +196 -0
  67. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_1_idea_1769710424244661800.json +5 -0
  68. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/analyst11_ASI_delay1.csv +211 -0
  69. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/data/analyst11_ASI_delay1/final_expressions.json +7062 -0
  70. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace.log +3 -0
  71. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/ace_lib.py +1514 -0
  72. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/fetch_dataset.py +113 -0
  73. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/helpful_functions.py +180 -0
  74. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/implement_idea.py +236 -0
  75. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/merge_expression_list.py +90 -0
  76. cnhkmcp/untracked/APP/trailSomeAlphas/skills/brain-feature-implementation/scripts/parsetab.py +60 -0
  77. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/op/321/206/320/220/342/225/227/321/207/342/225/227/320/243.md +434 -0
  78. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance/sample_prompt.md +62 -0
  79. cnhkmcp/untracked/APP/trailSomeAlphas/skills/template_final_enhance//321/205/320/235/320/245/321/205/320/253/320/260/321/205/320/275/320/240/321/206/320/220/320/255/321/210/320/220/320/223/321/211/320/220/342/225/227/321/210/342/225/233/320/241/321/211/320/243/342/225/233.md +354 -0
  80. cnhkmcp/untracked/APP/usage.md +2 -2
  81. cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +388 -8
  82. cnhkmcp/untracked/skills/alpha-expression-verifier/scripts/validator.py +889 -0
  83. cnhkmcp/untracked/skills/brain-data-feature-engineering/OUTPUT_TEMPLATE.md +325 -0
  84. cnhkmcp/untracked/skills/brain-data-feature-engineering/SKILL.md +263 -0
  85. cnhkmcp/untracked/skills/brain-data-feature-engineering/examples.md +244 -0
  86. cnhkmcp/untracked/skills/brain-data-feature-engineering/reference.md +493 -0
  87. cnhkmcp/untracked/skills/brain-feature-implementation/SKILL.md +87 -0
  88. cnhkmcp/untracked/skills/brain-feature-implementation/config.json +6 -0
  89. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/analyst15_GLB_delay1.csv +289 -0
  90. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/final_expressions.json +410 -0
  91. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588244.json +4 -0
  92. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588251.json +20 -0
  93. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588273.json +23 -0
  94. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588293.json +23 -0
  95. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588319.json +23 -0
  96. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588322.json +14 -0
  97. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588325.json +20 -0
  98. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588328.json +23 -0
  99. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588354.json +23 -0
  100. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588357.json +23 -0
  101. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588361.json +23 -0
  102. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588364.json +23 -0
  103. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588368.json +23 -0
  104. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588391.json +14 -0
  105. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588394.json +23 -0
  106. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588397.json +59 -0
  107. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588400.json +35 -0
  108. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588403.json +20 -0
  109. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588428.json +23 -0
  110. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588431.json +32 -0
  111. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588434.json +20 -0
  112. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588438.json +20 -0
  113. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588441.json +14 -0
  114. cnhkmcp/untracked/skills/brain-feature-implementation/data/analyst15_GLB_delay1/idea_1768588468.json +20 -0
  115. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/ace_lib.py +1514 -0
  116. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/fetch_dataset.py +107 -0
  117. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/helpful_functions.py +180 -0
  118. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/implement_idea.py +165 -0
  119. cnhkmcp/untracked/skills/brain-feature-implementation/scripts/merge_expression_list.py +88 -0
  120. cnhkmcp/untracked/skills/brain-improve-alpha-performance/arXiv_API_Tool_Manual.md +490 -0
  121. cnhkmcp/untracked/skills/brain-improve-alpha-performance/reference.md +1 -1
  122. cnhkmcp/untracked/skills/brain-improve-alpha-performance/scripts/arxiv_api.py +229 -0
  123. cnhkmcp/untracked/skills/planning-with-files/SKILL.md +211 -0
  124. cnhkmcp/untracked/skills/planning-with-files/examples.md +202 -0
  125. cnhkmcp/untracked/skills/planning-with-files/reference.md +218 -0
  126. cnhkmcp/untracked/skills/planning-with-files/scripts/check-complete.sh +44 -0
  127. cnhkmcp/untracked/skills/planning-with-files/scripts/init-session.sh +120 -0
  128. cnhkmcp/untracked/skills/planning-with-files/templates/findings.md +95 -0
  129. cnhkmcp/untracked/skills/planning-with-files/templates/progress.md +114 -0
  130. cnhkmcp/untracked/skills/planning-with-files/templates/task_plan.md +132 -0
  131. cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +35 -11
  132. cnhkmcp/vector_db/_manifest.json +1 -0
  133. cnhkmcp/vector_db/_meta.json +1 -0
  134. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/METADATA +1 -1
  135. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/RECORD +142 -31
  136. /cnhkmcp/untracked/{skills/expression_verifier → APP/trailSomeAlphas/skills/brain-feature-implementation}/scripts/validator.py +0 -0
  137. /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/SKILL.md +0 -0
  138. /cnhkmcp/untracked/skills/{expression_verifier → alpha-expression-verifier}/scripts/verify_expr.py +0 -0
  139. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/WHEEL +0 -0
  140. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/entry_points.txt +0 -0
  141. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/licenses/LICENSE +0 -0
  142. {cnhkmcp-2.1.9.dist-info → cnhkmcp-2.3.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,229 @@
1
+ import requests
2
+ import xml.etree.ElementTree as ET
3
+ import os
4
+ import sys
5
+ import argparse
6
+
7
+ def search_arxiv(query, max_results=10):
8
+ """Search arXiv for papers"""
9
+ base_url = "http://export.arxiv.org/api/query"
10
+ params = {
11
+ 'search_query': query,
12
+ 'start': 0,
13
+ 'max_results': max_results
14
+ }
15
+
16
+ response = requests.get(base_url, params=params)
17
+ return response.text
18
+
19
+ def get_paper_metadata(paper_id):
20
+ """Get paper metadata directly from arXiv API"""
21
+ try:
22
+ # Use the arXiv API to get paper metadata
23
+ metadata_url = f"http://export.arxiv.org/api/query?id_list={paper_id}"
24
+ response = requests.get(metadata_url)
25
+
26
+ if response.status_code == 200:
27
+ papers = parse_search_results(response.text)
28
+ if papers and len(papers) > 0:
29
+ return papers[0]
30
+ return None
31
+ except Exception as e:
32
+ print(f"Error fetching paper metadata: {e}")
33
+ return None
34
+
35
+ def download_paper(paper_id, output_dir=".", paper_title=None):
36
+ """Download a paper by its ID and rename it to the paper title"""
37
+ pdf_url = f"https://arxiv.org/pdf/{paper_id}.pdf"
38
+ response = requests.get(pdf_url)
39
+
40
+ if response.status_code == 200:
41
+ # Create filename from paper title if available, otherwise use paper ID
42
+ if paper_title:
43
+ # Clean the title for filename (remove special characters, limit length)
44
+ clean_title = "".join(c for c in paper_title if c.isalnum() or c in (' ', '-', '_')).rstrip()
45
+ clean_title = clean_title.replace(' ', '_')[:100] # Limit length to 100 chars
46
+ filename = f"{clean_title}.pdf"
47
+ else:
48
+ filename = f"{paper_id}.pdf"
49
+
50
+ filepath = os.path.join(output_dir, filename)
51
+
52
+ with open(filepath, 'wb') as f:
53
+ f.write(response.content)
54
+ print(f"Downloaded: {filepath}")
55
+ return filepath
56
+ else:
57
+ print(f"Failed to download paper {paper_id}")
58
+ return None
59
+
60
+ def parse_search_results(xml_content):
61
+ """Parse XML search results and extract paper information"""
62
+ try:
63
+ root = ET.fromstring(xml_content)
64
+ papers = []
65
+
66
+ # Find all entry elements
67
+ for entry in root.findall('.//{http://www.w3.org/2005/Atom}entry'):
68
+ paper_info = {}
69
+
70
+ # Extract title
71
+ title_elem = entry.find('.//{http://www.w3.org/2005/Atom}title')
72
+ if title_elem is not None:
73
+ paper_info['title'] = title_elem.text.strip()
74
+
75
+ # Extract authors
76
+ authors = []
77
+ for author in entry.findall('.//{http://www.w3.org/2005/Atom}author'):
78
+ name_elem = author.find('.//{http://www.w3.org/2005/Atom}name')
79
+ if name_elem is not None:
80
+ authors.append(name_elem.text.strip())
81
+ paper_info['authors'] = authors
82
+
83
+ # Extract abstract
84
+ summary_elem = entry.find('.//{http://www.w3.org/2005/Atom}summary')
85
+ if summary_elem is not None:
86
+ paper_info['abstract'] = summary_elem.text.strip()
87
+
88
+ # Extract paper ID from the id field
89
+ id_elem = entry.find('.//{http://www.w3.org/2005/Atom}id')
90
+ if id_elem is not None:
91
+ # Extract ID from URL like "http://arxiv.org/abs/2103.12345"
92
+ paper_id = id_elem.text.split('/')[-1]
93
+ paper_info['paper_id'] = paper_id
94
+
95
+ # Extract published date
96
+ published_elem = entry.find('.//{http://www.w3.org/2005/Atom}published')
97
+ if published_elem is not None:
98
+ paper_info['published'] = published_elem.text.strip()
99
+
100
+ papers.append(paper_info)
101
+
102
+ return papers
103
+ except ET.ParseError as e:
104
+ print(f"Error parsing XML: {e}")
105
+ return []
106
+
107
+ def search_and_download(query, max_results=5, download_first=False):
108
+ """Search for papers and optionally download the first result"""
109
+ print(f"Searching arXiv for: '{query}'")
110
+ print("-" * 50)
111
+
112
+ # Search for papers
113
+ results = search_arxiv(query, max_results)
114
+ papers = parse_search_results(results)
115
+
116
+ if not papers:
117
+ print("No papers found.")
118
+ return
119
+
120
+ # Display search results
121
+ print(f"Found {len(papers)} papers:\n")
122
+ for i, paper in enumerate(papers, 1):
123
+ print(f"{i}. Title: {paper.get('title', 'N/A')}")
124
+ print(f" Authors: {', '.join(paper.get('authors', ['N/A']))}")
125
+ print(f" Paper ID: {paper.get('paper_id', 'N/A')}")
126
+ print(f" Published: {paper.get('published', 'N/A')}")
127
+ print(f" Abstract: {paper.get('abstract', 'N/A')[:200]}...")
128
+ print()
129
+
130
+ # Optionally download first paper
131
+ if download_first and papers:
132
+ first_paper = papers[0]
133
+ paper_id = first_paper.get('paper_id')
134
+ paper_title = first_paper.get('title')
135
+ if paper_id:
136
+ print(f"Downloading first paper: {paper_id}")
137
+ download_paper(paper_id, paper_title=paper_title)
138
+ else:
139
+ print("Could not extract paper ID for download")
140
+
141
+ def interactive_mode():
142
+ """Interactive mode for searching arXiv"""
143
+ print("🔍 arXiv Paper Search Tool")
144
+ print("=" * 40)
145
+ print("Commands:")
146
+ print(" search <query> [max_results] - Search for papers")
147
+ print(" download <paper_id> - Download a specific paper")
148
+ print(" help - Show this help message")
149
+ print(" quit/exit - Exit the program")
150
+ print()
151
+
152
+ while True:
153
+ try:
154
+ command = input("📚 arxiv> ").strip()
155
+
156
+ if not command:
157
+ continue
158
+
159
+ parts = command.split()
160
+ cmd = parts[0].lower()
161
+
162
+ if cmd in ['quit', 'exit', 'q']:
163
+ print("Goodbye! 👋")
164
+ break
165
+
166
+ elif cmd == 'help':
167
+ print("Commands:")
168
+ print(" search <query> [max_results] - Search for papers")
169
+ print(" download <paper_id> - Download a specific paper")
170
+ print(" help - Show this help message")
171
+ print(" quit/exit - Exit the program")
172
+ print()
173
+
174
+ elif cmd == 'search':
175
+ if len(parts) < 2:
176
+ print("Usage: search <query> [max_results]")
177
+ continue
178
+
179
+ query = ' '.join(parts[1:-1]) if len(parts) > 2 else parts[1]
180
+ max_results = int(parts[-1]) if len(parts) > 2 and parts[-1].isdigit() else 5
181
+
182
+ search_and_download(query, max_results, download_first=False)
183
+
184
+ elif cmd == 'download':
185
+ if len(parts) < 2:
186
+ print("Usage: download <paper_id>")
187
+ continue
188
+
189
+ paper_id = parts[1]
190
+ # Get paper metadata first
191
+ print(f"Fetching paper information for {paper_id}...")
192
+ paper_info = get_paper_metadata(paper_id)
193
+
194
+ if paper_info and paper_info.get('title'):
195
+ paper_title = paper_info['title']
196
+ print(f"Found paper: {paper_title}")
197
+ download_paper(paper_id, paper_title=paper_title)
198
+ else:
199
+ print(f"Could not find paper information for {paper_id}")
200
+ print("Downloading with paper ID as filename...")
201
+ download_paper(paper_id)
202
+
203
+ else:
204
+ print(f"Unknown command: {cmd}")
205
+ print("Type 'help' for available commands")
206
+
207
+ except KeyboardInterrupt:
208
+ print("\nGoodbye! 👋")
209
+ break
210
+ except Exception as e:
211
+ print(f"Error: {e}")
212
+
213
+ # Example usage
214
+ if __name__ == "__main__":
215
+ parser = argparse.ArgumentParser(description='Search and download papers from arXiv')
216
+ parser.add_argument('query', nargs='?', help='Search query')
217
+ parser.add_argument('-n', '--max_results', type=int, default=5, help='Maximum number of results (default: 5)')
218
+ parser.add_argument('-d', '--download', action='store_true', help='Download the first result')
219
+ parser.add_argument('-i', '--interactive', action='store_true', help='Start interactive mode')
220
+
221
+ args = parser.parse_args()
222
+
223
+ if args.interactive:
224
+ interactive_mode()
225
+ elif args.query:
226
+ search_and_download(args.query, args.max_results, args.download)
227
+ else:
228
+ # Default behavior - start interactive mode
229
+ interactive_mode()
@@ -0,0 +1,211 @@
1
+ ---
2
+ name: planning-with-files
3
+ version: "2.1.0"
4
+ description: Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls.
5
+ user-invocable: true
6
+ allowed-tools:
7
+ - Read
8
+ - Write
9
+ - Edit
10
+ - Bash
11
+ - Glob
12
+ - Grep
13
+ - WebFetch
14
+ - WebSearch
15
+ hooks:
16
+ SessionStart:
17
+ - hooks:
18
+ - type: command
19
+ command: "echo '[planning-with-files] Ready. Auto-activates for complex tasks, or invoke manually with /planning-with-files'"
20
+ PreToolUse:
21
+ - matcher: "Write|Edit|Bash"
22
+ hooks:
23
+ - type: command
24
+ command: "cat task_plan.md 2>/dev/null | head -30 || true"
25
+ PostToolUse:
26
+ - matcher: "Write|Edit"
27
+ hooks:
28
+ - type: command
29
+ command: "echo '[planning-with-files] File updated. If this completes a phase, update task_plan.md status.'"
30
+ Stop:
31
+ - hooks:
32
+ - type: command
33
+ command: "$HOME/.claude/skills/planning-with-files/scripts/check-complete.sh"
34
+ ---
35
+
36
+ # Planning with Files
37
+
38
+ Work like Manus: Use persistent markdown files as your "working memory on disk."
39
+
40
+ ## Important: Where Files Go
41
+
42
+ When using this skill:
43
+
44
+ - **Templates** are stored in the skill directory at `$HOME/.claude/skills/planning-with-files/templates/`
45
+ - **Your planning files** (`task_plan.md`, `findings.md`, `progress.md`) should be created in **your project directory** — the folder where you're working
46
+
47
+ | Location | What Goes There |
48
+ |----------|-----------------|
49
+ | Skill directory (`$HOME/.claude/skills/planning-with-files/`) | Templates, scripts, reference docs |
50
+ | Your project directory | `task_plan.md`, `findings.md`, `progress.md` |
51
+
52
+ This ensures your planning files live alongside your code, not buried in the skill installation folder.
53
+
54
+ ## Quick Start
55
+
56
+ Before ANY complex task:
57
+
58
+ 1. **Create `task_plan.md`** in your project — Use [templates/task_plan.md](templates/task_plan.md) as reference
59
+ 2. **Create `findings.md`** in your project — Use [templates/findings.md](templates/findings.md) as reference
60
+ 3. **Create `progress.md`** in your project — Use [templates/progress.md](templates/progress.md) as reference
61
+ 4. **Re-read plan before decisions** — Refreshes goals in attention window
62
+ 5. **Update after each phase** — Mark complete, log errors
63
+
64
+ > **Note:** All three planning files should be created in your current working directory (your project root), not in the skill's installation folder.
65
+
66
+ ## The Core Pattern
67
+
68
+ ```
69
+ Context Window = RAM (volatile, limited)
70
+ Filesystem = Disk (persistent, unlimited)
71
+
72
+ → Anything important gets written to disk.
73
+ ```
74
+
75
+ ## File Purposes
76
+
77
+ | File | Purpose | When to Update |
78
+ |------|---------|----------------|
79
+ | `task_plan.md` | Phases, progress, decisions | After each phase |
80
+ | `findings.md` | Research, discoveries | After ANY discovery |
81
+ | `progress.md` | Session log, test results | Throughout session |
82
+
83
+ ## Critical Rules
84
+
85
+ ### 1. Create Plan First
86
+ Never start a complex task without `task_plan.md`. Non-negotiable.
87
+
88
+ ### 2. The 2-Action Rule
89
+ > "After every 2 view/browser/search operations, IMMEDIATELY save key findings to text files."
90
+
91
+ This prevents visual/multimodal information from being lost.
92
+
93
+ ### 3. Read Before Decide
94
+ Before major decisions, read the plan file. This keeps goals in your attention window.
95
+
96
+ ### 4. Update After Act
97
+ After completing any phase:
98
+ - Mark phase status: `in_progress` → `complete`
99
+ - Log any errors encountered
100
+ - Note files created/modified
101
+
102
+ ### 5. Log ALL Errors
103
+ Every error goes in the plan file. This builds knowledge and prevents repetition.
104
+
105
+ ```markdown
106
+ ## Errors Encountered
107
+ | Error | Attempt | Resolution |
108
+ |-------|---------|------------|
109
+ | FileNotFoundError | 1 | Created default config |
110
+ | API timeout | 2 | Added retry logic |
111
+ ```
112
+
113
+ ### 6. Never Repeat Failures
114
+ ```
115
+ if action_failed:
116
+ next_action != same_action
117
+ ```
118
+ Track what you tried. Mutate the approach.
119
+
120
+ ## The 3-Strike Error Protocol
121
+
122
+ ```
123
+ ATTEMPT 1: Diagnose & Fix
124
+ → Read error carefully
125
+ → Identify root cause
126
+ → Apply targeted fix
127
+
128
+ ATTEMPT 2: Alternative Approach
129
+ → Same error? Try different method
130
+ → Different tool? Different library?
131
+ → NEVER repeat exact same failing action
132
+
133
+ ATTEMPT 3: Broader Rethink
134
+ → Question assumptions
135
+ → Search for solutions
136
+ → Consider updating the plan
137
+
138
+ AFTER 3 FAILURES: Escalate to User
139
+ → Explain what you tried
140
+ → Share the specific error
141
+ → Ask for guidance
142
+ ```
143
+
144
+ ## Read vs Write Decision Matrix
145
+
146
+ | Situation | Action | Reason |
147
+ |-----------|--------|--------|
148
+ | Just wrote a file | DON'T read | Content still in context |
149
+ | Viewed image/PDF | Write findings NOW | Multimodal → text before lost |
150
+ | Browser returned data | Write to file | Screenshots don't persist |
151
+ | Starting new phase | Read plan/findings | Re-orient if context stale |
152
+ | Error occurred | Read relevant file | Need current state to fix |
153
+ | Resuming after gap | Read all planning files | Recover state |
154
+
155
+ ## The 5-Question Reboot Test
156
+
157
+ If you can answer these, your context management is solid:
158
+
159
+ | Question | Answer Source |
160
+ |----------|---------------|
161
+ | Where am I? | Current phase in task_plan.md |
162
+ | Where am I going? | Remaining phases |
163
+ | What's the goal? | Goal statement in plan |
164
+ | What have I learned? | findings.md |
165
+ | What have I done? | progress.md |
166
+
167
+ ## When to Use This Pattern
168
+
169
+ **Use for:**
170
+ - Multi-step tasks (3+ steps)
171
+ - Research tasks
172
+ - Building/creating projects
173
+ - Tasks spanning many tool calls
174
+ - Anything requiring organization
175
+
176
+ **Skip for:**
177
+ - Simple questions
178
+ - Single-file edits
179
+ - Quick lookups
180
+
181
+ ## Templates
182
+
183
+ Copy these templates to start:
184
+
185
+ - [templates/task_plan.md](templates/task_plan.md) — Phase tracking
186
+ - [templates/findings.md](templates/findings.md) — Research storage
187
+ - [templates/progress.md](templates/progress.md) — Session logging
188
+
189
+ ## Scripts
190
+
191
+ Helper scripts for automation:
192
+
193
+ - `scripts/init-session.sh` — Initialize all planning files
194
+ - `scripts/check-complete.sh` — Verify all phases complete
195
+
196
+ ## Advanced Topics
197
+
198
+ - **Manus Principles:** See [reference.md](reference.md)
199
+ - **Real Examples:** See [examples.md](examples.md)
200
+
201
+ ## Anti-Patterns
202
+
203
+ | Don't | Do Instead |
204
+ |-------|------------|
205
+ | Use TodoWrite for persistence | Create task_plan.md file |
206
+ | State goals once and forget | Re-read plan before decisions |
207
+ | Hide errors and retry silently | Log errors to plan file |
208
+ | Stuff everything in context | Store large content in files |
209
+ | Start executing immediately | Create plan file FIRST |
210
+ | Repeat failed actions | Track attempts, mutate approach |
211
+ | Create files in skill directory | Create files in your project |
@@ -0,0 +1,202 @@
1
+ # Examples: Planning with Files in Action
2
+
3
+ ## Example 1: Research Task
4
+
5
+ **User Request:** "Research the benefits of morning exercise and write a summary"
6
+
7
+ ### Loop 1: Create Plan
8
+ ```bash
9
+ Write task_plan.md
10
+ ```
11
+
12
+ ```markdown
13
+ # Task Plan: Morning Exercise Benefits Research
14
+
15
+ ## Goal
16
+ Create a research summary on the benefits of morning exercise.
17
+
18
+ ## Phases
19
+ - [ ] Phase 1: Create this plan ✓
20
+ - [ ] Phase 2: Search and gather sources
21
+ - [ ] Phase 3: Synthesize findings
22
+ - [ ] Phase 4: Deliver summary
23
+
24
+ ## Key Questions
25
+ 1. What are the physical health benefits?
26
+ 2. What are the mental health benefits?
27
+ 3. What scientific studies support this?
28
+
29
+ ## Status
30
+ **Currently in Phase 1** - Creating plan
31
+ ```
32
+
33
+ ### Loop 2: Research
34
+ ```bash
35
+ Read task_plan.md # Refresh goals
36
+ WebSearch "morning exercise benefits"
37
+ Write notes.md # Store findings
38
+ Edit task_plan.md # Mark Phase 2 complete
39
+ ```
40
+
41
+ ### Loop 3: Synthesize
42
+ ```bash
43
+ Read task_plan.md # Refresh goals
44
+ Read notes.md # Get findings
45
+ Write morning_exercise_summary.md
46
+ Edit task_plan.md # Mark Phase 3 complete
47
+ ```
48
+
49
+ ### Loop 4: Deliver
50
+ ```bash
51
+ Read task_plan.md # Verify complete
52
+ Deliver morning_exercise_summary.md
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Example 2: Bug Fix Task
58
+
59
+ **User Request:** "Fix the login bug in the authentication module"
60
+
61
+ ### task_plan.md
62
+ ```markdown
63
+ # Task Plan: Fix Login Bug
64
+
65
+ ## Goal
66
+ Identify and fix the bug preventing successful login.
67
+
68
+ ## Phases
69
+ - [x] Phase 1: Understand the bug report ✓
70
+ - [x] Phase 2: Locate relevant code ✓
71
+ - [ ] Phase 3: Identify root cause (CURRENT)
72
+ - [ ] Phase 4: Implement fix
73
+ - [ ] Phase 5: Test and verify
74
+
75
+ ## Key Questions
76
+ 1. What error message appears?
77
+ 2. Which file handles authentication?
78
+ 3. What changed recently?
79
+
80
+ ## Decisions Made
81
+ - Auth handler is in src/auth/login.ts
82
+ - Error occurs in validateToken() function
83
+
84
+ ## Errors Encountered
85
+ - [Initial] TypeError: Cannot read property 'token' of undefined
86
+ → Root cause: user object not awaited properly
87
+
88
+ ## Status
89
+ **Currently in Phase 3** - Found root cause, preparing fix
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Example 3: Feature Development
95
+
96
+ **User Request:** "Add a dark mode toggle to the settings page"
97
+
98
+ ### The 3-File Pattern in Action
99
+
100
+ **task_plan.md:**
101
+ ```markdown
102
+ # Task Plan: Dark Mode Toggle
103
+
104
+ ## Goal
105
+ Add functional dark mode toggle to settings.
106
+
107
+ ## Phases
108
+ - [x] Phase 1: Research existing theme system ✓
109
+ - [x] Phase 2: Design implementation approach ✓
110
+ - [ ] Phase 3: Implement toggle component (CURRENT)
111
+ - [ ] Phase 4: Add theme switching logic
112
+ - [ ] Phase 5: Test and polish
113
+
114
+ ## Decisions Made
115
+ - Using CSS custom properties for theme
116
+ - Storing preference in localStorage
117
+ - Toggle component in SettingsPage.tsx
118
+
119
+ ## Status
120
+ **Currently in Phase 3** - Building toggle component
121
+ ```
122
+
123
+ **notes.md:**
124
+ ```markdown
125
+ # Notes: Dark Mode Implementation
126
+
127
+ ## Existing Theme System
128
+ - Located in: src/styles/theme.ts
129
+ - Uses: CSS custom properties
130
+ - Current themes: light only
131
+
132
+ ## Files to Modify
133
+ 1. src/styles/theme.ts - Add dark theme colors
134
+ 2. src/components/SettingsPage.tsx - Add toggle
135
+ 3. src/hooks/useTheme.ts - Create new hook
136
+ 4. src/App.tsx - Wrap with ThemeProvider
137
+
138
+ ## Color Decisions
139
+ - Dark background: #1a1a2e
140
+ - Dark surface: #16213e
141
+ - Dark text: #eaeaea
142
+ ```
143
+
144
+ **dark_mode_implementation.md:** (deliverable)
145
+ ```markdown
146
+ # Dark Mode Implementation
147
+
148
+ ## Changes Made
149
+
150
+ ### 1. Added dark theme colors
151
+ File: src/styles/theme.ts
152
+ ...
153
+
154
+ ### 2. Created useTheme hook
155
+ File: src/hooks/useTheme.ts
156
+ ...
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Example 4: Error Recovery Pattern
162
+
163
+ When something fails, DON'T hide it:
164
+
165
+ ### Before (Wrong)
166
+ ```
167
+ Action: Read config.json
168
+ Error: File not found
169
+ Action: Read config.json # Silent retry
170
+ Action: Read config.json # Another retry
171
+ ```
172
+
173
+ ### After (Correct)
174
+ ```
175
+ Action: Read config.json
176
+ Error: File not found
177
+
178
+ # Update task_plan.md:
179
+ ## Errors Encountered
180
+ - config.json not found → Will create default config
181
+
182
+ Action: Write config.json (default config)
183
+ Action: Read config.json
184
+ Success!
185
+ ```
186
+
187
+ ---
188
+
189
+ ## The Read-Before-Decide Pattern
190
+
191
+ **Always read your plan before major decisions:**
192
+
193
+ ```
194
+ [Many tool calls have happened...]
195
+ [Context is getting long...]
196
+ [Original goal might be forgotten...]
197
+
198
+ → Read task_plan.md # This brings goals back into attention!
199
+ → Now make the decision # Goals are fresh in context
200
+ ```
201
+
202
+ This is why Manus can handle ~50 tool calls without losing track. The plan file acts as a "goal refresh" mechanism.