@laitszkin/apollo-toolkit 2.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/AGENTS.md +62 -0
- package/CHANGELOG.md +100 -0
- package/LICENSE +21 -0
- package/README.md +144 -0
- package/align-project-documents/SKILL.md +94 -0
- package/align-project-documents/agents/openai.yaml +4 -0
- package/analyse-app-logs/LICENSE +21 -0
- package/analyse-app-logs/README.md +126 -0
- package/analyse-app-logs/SKILL.md +121 -0
- package/analyse-app-logs/agents/openai.yaml +4 -0
- package/analyse-app-logs/references/investigation-checklist.md +58 -0
- package/analyse-app-logs/references/log-signal-patterns.md +52 -0
- package/answering-questions-with-research/SKILL.md +46 -0
- package/answering-questions-with-research/agents/openai.yaml +4 -0
- package/bin/apollo-toolkit.js +7 -0
- package/commit-and-push/LICENSE +21 -0
- package/commit-and-push/README.md +26 -0
- package/commit-and-push/SKILL.md +70 -0
- package/commit-and-push/agents/openai.yaml +4 -0
- package/commit-and-push/references/branch-naming.md +15 -0
- package/commit-and-push/references/commit-messages.md +19 -0
- package/deep-research-topics/LICENSE +21 -0
- package/deep-research-topics/README.md +43 -0
- package/deep-research-topics/SKILL.md +84 -0
- package/deep-research-topics/agents/openai.yaml +4 -0
- package/develop-new-features/LICENSE +21 -0
- package/develop-new-features/README.md +52 -0
- package/develop-new-features/SKILL.md +105 -0
- package/develop-new-features/agents/openai.yaml +4 -0
- package/develop-new-features/references/testing-e2e.md +35 -0
- package/develop-new-features/references/testing-integration.md +42 -0
- package/develop-new-features/references/testing-property-based.md +44 -0
- package/develop-new-features/references/testing-unit.md +37 -0
- package/discover-edge-cases/CHANGELOG.md +19 -0
- package/discover-edge-cases/LICENSE +21 -0
- package/discover-edge-cases/README.md +87 -0
- package/discover-edge-cases/SKILL.md +124 -0
- package/discover-edge-cases/agents/openai.yaml +4 -0
- package/discover-edge-cases/references/architecture-edge-cases.md +41 -0
- package/discover-edge-cases/references/code-edge-cases.md +46 -0
- package/docs-to-voice/.env.example +106 -0
- package/docs-to-voice/CHANGELOG.md +71 -0
- package/docs-to-voice/LICENSE +21 -0
- package/docs-to-voice/README.md +118 -0
- package/docs-to-voice/SKILL.md +107 -0
- package/docs-to-voice/agents/openai.yaml +4 -0
- package/docs-to-voice/scripts/docs_to_voice.py +1385 -0
- package/docs-to-voice/scripts/docs_to_voice.sh +11 -0
- package/docs-to-voice/tests/test_docs_to_voice_api_max_chars.py +210 -0
- package/docs-to-voice/tests/test_docs_to_voice_sentence_timeline.py +115 -0
- package/docs-to-voice/tests/test_docs_to_voice_settings.py +43 -0
- package/docs-to-voice/tests/test_docs_to_voice_speech_rate.py +57 -0
- package/enhance-existing-features/CHANGELOG.md +35 -0
- package/enhance-existing-features/LICENSE +21 -0
- package/enhance-existing-features/README.md +54 -0
- package/enhance-existing-features/SKILL.md +120 -0
- package/enhance-existing-features/agents/openai.yaml +4 -0
- package/enhance-existing-features/references/e2e-tests.md +25 -0
- package/enhance-existing-features/references/integration-tests.md +30 -0
- package/enhance-existing-features/references/property-based-tests.md +33 -0
- package/enhance-existing-features/references/unit-tests.md +29 -0
- package/feature-propose/LICENSE +21 -0
- package/feature-propose/README.md +23 -0
- package/feature-propose/SKILL.md +107 -0
- package/feature-propose/agents/openai.yaml +4 -0
- package/feature-propose/references/enhancement-features.md +25 -0
- package/feature-propose/references/important-features.md +25 -0
- package/feature-propose/references/mvp-features.md +25 -0
- package/feature-propose/references/performance-features.md +25 -0
- package/financial-research/SKILL.md +208 -0
- package/financial-research/agents/openai.yaml +4 -0
- package/financial-research/assets/weekly_market_report_template.md +45 -0
- package/fix-github-issues/SKILL.md +98 -0
- package/fix-github-issues/agents/openai.yaml +4 -0
- package/fix-github-issues/scripts/list_issues.py +148 -0
- package/fix-github-issues/tests/test_list_issues.py +127 -0
- package/generate-spec/LICENSE +21 -0
- package/generate-spec/README.md +61 -0
- package/generate-spec/SKILL.md +96 -0
- package/generate-spec/agents/openai.yaml +4 -0
- package/generate-spec/references/templates/checklist.md +78 -0
- package/generate-spec/references/templates/spec.md +55 -0
- package/generate-spec/references/templates/tasks.md +35 -0
- package/generate-spec/scripts/create-specs +123 -0
- package/harden-app-security/CHANGELOG.md +27 -0
- package/harden-app-security/LICENSE +21 -0
- package/harden-app-security/README.md +46 -0
- package/harden-app-security/SKILL.md +127 -0
- package/harden-app-security/agents/openai.yaml +4 -0
- package/harden-app-security/references/agent-attack-catalog.md +117 -0
- package/harden-app-security/references/common-software-attack-catalog.md +168 -0
- package/harden-app-security/references/red-team-extreme-scenarios.md +81 -0
- package/harden-app-security/references/risk-checklist.md +78 -0
- package/harden-app-security/references/security-test-patterns-agent.md +101 -0
- package/harden-app-security/references/security-test-patterns-finance.md +88 -0
- package/harden-app-security/references/test-snippets.md +73 -0
- package/improve-observability/SKILL.md +114 -0
- package/improve-observability/agents/openai.yaml +4 -0
- package/learn-skill-from-conversations/CHANGELOG.md +15 -0
- package/learn-skill-from-conversations/LICENSE +22 -0
- package/learn-skill-from-conversations/README.md +47 -0
- package/learn-skill-from-conversations/SKILL.md +85 -0
- package/learn-skill-from-conversations/agents/openai.yaml +4 -0
- package/learn-skill-from-conversations/scripts/extract_recent_conversations.py +369 -0
- package/learn-skill-from-conversations/tests/test_extract_recent_conversations.py +176 -0
- package/learning-error-book/SKILL.md +112 -0
- package/learning-error-book/agents/openai.yaml +4 -0
- package/learning-error-book/assets/error_book_template.md +66 -0
- package/learning-error-book/scripts/render_markdown_to_pdf.py +367 -0
- package/lib/cli.js +338 -0
- package/lib/installer.js +225 -0
- package/maintain-project-constraints/SKILL.md +109 -0
- package/maintain-project-constraints/agents/openai.yaml +4 -0
- package/maintain-skill-catalog/README.md +18 -0
- package/maintain-skill-catalog/SKILL.md +66 -0
- package/maintain-skill-catalog/agents/openai.yaml +4 -0
- package/novel-to-short-video/CHANGELOG.md +53 -0
- package/novel-to-short-video/LICENSE +21 -0
- package/novel-to-short-video/README.md +63 -0
- package/novel-to-short-video/SKILL.md +233 -0
- package/novel-to-short-video/agents/openai.yaml +4 -0
- package/novel-to-short-video/references/plan-template.md +71 -0
- package/novel-to-short-video/references/roles-json.md +41 -0
- package/open-github-issue/LICENSE +21 -0
- package/open-github-issue/README.md +97 -0
- package/open-github-issue/SKILL.md +119 -0
- package/open-github-issue/agents/openai.yaml +4 -0
- package/open-github-issue/scripts/open_github_issue.py +380 -0
- package/open-github-issue/tests/test_open_github_issue.py +159 -0
- package/open-source-pr-workflow/CHANGELOG.md +32 -0
- package/open-source-pr-workflow/LICENSE +21 -0
- package/open-source-pr-workflow/README.md +23 -0
- package/open-source-pr-workflow/SKILL.md +123 -0
- package/open-source-pr-workflow/agents/openai.yaml +4 -0
- package/openai-text-to-image-storyboard/.env.example +10 -0
- package/openai-text-to-image-storyboard/CHANGELOG.md +49 -0
- package/openai-text-to-image-storyboard/LICENSE +21 -0
- package/openai-text-to-image-storyboard/README.md +99 -0
- package/openai-text-to-image-storyboard/SKILL.md +107 -0
- package/openai-text-to-image-storyboard/agents/openai.yaml +4 -0
- package/openai-text-to-image-storyboard/scripts/generate_storyboard_images.py +763 -0
- package/package.json +36 -0
- package/record-spending/SKILL.md +113 -0
- package/record-spending/agents/openai.yaml +4 -0
- package/record-spending/references/account-format.md +33 -0
- package/record-spending/references/workbook-layout.md +84 -0
- package/resolve-review-comments/SKILL.md +122 -0
- package/resolve-review-comments/agents/openai.yaml +4 -0
- package/resolve-review-comments/references/adoption-criteria.md +23 -0
- package/resolve-review-comments/scripts/review_threads.py +425 -0
- package/resolve-review-comments/tests/test_review_threads.py +74 -0
- package/review-change-set/LICENSE +21 -0
- package/review-change-set/README.md +55 -0
- package/review-change-set/SKILL.md +103 -0
- package/review-change-set/agents/openai.yaml +4 -0
- package/review-codebases/LICENSE +21 -0
- package/review-codebases/README.md +67 -0
- package/review-codebases/SKILL.md +109 -0
- package/review-codebases/agents/openai.yaml +4 -0
- package/scripts/install_skills.ps1 +283 -0
- package/scripts/install_skills.sh +262 -0
- package/scripts/validate_openai_agent_config.py +194 -0
- package/scripts/validate_skill_frontmatter.py +110 -0
- package/specs-to-project-docs/LICENSE +21 -0
- package/specs-to-project-docs/README.md +57 -0
- package/specs-to-project-docs/SKILL.md +111 -0
- package/specs-to-project-docs/agents/openai.yaml +4 -0
- package/specs-to-project-docs/references/templates/architecture.md +29 -0
- package/specs-to-project-docs/references/templates/configuration.md +29 -0
- package/specs-to-project-docs/references/templates/developer-guide.md +33 -0
- package/specs-to-project-docs/references/templates/docs-index.md +39 -0
- package/specs-to-project-docs/references/templates/features.md +25 -0
- package/specs-to-project-docs/references/templates/getting-started.md +38 -0
- package/specs-to-project-docs/references/templates/readme.md +49 -0
- package/systematic-debug/LICENSE +21 -0
- package/systematic-debug/README.md +81 -0
- package/systematic-debug/SKILL.md +59 -0
- package/systematic-debug/agents/openai.yaml +4 -0
- package/text-to-short-video/.env.example +36 -0
- package/text-to-short-video/LICENSE +21 -0
- package/text-to-short-video/README.md +82 -0
- package/text-to-short-video/SKILL.md +221 -0
- package/text-to-short-video/agents/openai.yaml +4 -0
- package/text-to-short-video/scripts/enforce_video_aspect_ratio.py +350 -0
- package/version-release/CHANGELOG.md +53 -0
- package/version-release/LICENSE +21 -0
- package/version-release/README.md +28 -0
- package/version-release/SKILL.md +94 -0
- package/version-release/agents/openai.yaml +4 -0
- package/version-release/references/branch-naming.md +15 -0
- package/version-release/references/changelog-writing.md +8 -0
- package/version-release/references/commit-messages.md +19 -0
- package/version-release/references/readme-writing.md +12 -0
- package/version-release/references/semantic-versioning.md +12 -0
- package/video-production/CHANGELOG.md +104 -0
- package/video-production/LICENSE +18 -0
- package/video-production/README.md +68 -0
- package/video-production/SKILL.md +213 -0
- package/video-production/agents/openai.yaml +4 -0
- package/video-production/references/plan-template.md +54 -0
- package/video-production/references/roles-json.md +41 -0
- package/weekly-financial-event-report/SKILL.md +195 -0
- package/weekly-financial-event-report/agents/openai.yaml +4 -0
- package/weekly-financial-event-report/assets/financial_event_report_template.md +53 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Edge-case tests for extract_recent_conversations.py."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
from datetime import datetime, timedelta, timezone
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
SCRIPT_PATH = (
|
|
16
|
+
Path(__file__).resolve().parents[1] / "scripts" / "extract_recent_conversations.py"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def write_session(path: Path, timestamp: datetime) -> None:
|
|
21
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
22
|
+
entries = [
|
|
23
|
+
{
|
|
24
|
+
"type": "session_meta",
|
|
25
|
+
"payload": {"timestamp": timestamp.isoformat()},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "event_msg",
|
|
29
|
+
"payload": {"type": "user_message", "message": f"user:{path.stem}"},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "event_msg",
|
|
33
|
+
"payload": {"type": "agent_message", "message": f"assistant:{path.stem}"},
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
with path.open("w", encoding="utf-8") as handle:
|
|
37
|
+
for entry in entries:
|
|
38
|
+
handle.write(json.dumps(entry) + "\n")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def run_extractor(
|
|
42
|
+
sessions_dir: Path,
|
|
43
|
+
archived_dir: Path | None = None,
|
|
44
|
+
*extra_args: str,
|
|
45
|
+
) -> str:
|
|
46
|
+
cmd = [
|
|
47
|
+
sys.executable,
|
|
48
|
+
str(SCRIPT_PATH),
|
|
49
|
+
"--sessions-dir",
|
|
50
|
+
str(sessions_dir),
|
|
51
|
+
]
|
|
52
|
+
if archived_dir is not None:
|
|
53
|
+
cmd.extend(["--archived-sessions-dir", str(archived_dir)])
|
|
54
|
+
cmd.extend(extra_args)
|
|
55
|
+
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
|
|
56
|
+
return result.stdout
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ExtractRecentConversationsTests(unittest.TestCase):
|
|
60
|
+
def test_default_lookback_covers_last_24_hours(self) -> None:
|
|
61
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
62
|
+
sessions_root = Path(tmp) / "sessions"
|
|
63
|
+
now = datetime.now(timezone.utc)
|
|
64
|
+
write_session(sessions_root / "recent.jsonl", now - timedelta(hours=3))
|
|
65
|
+
|
|
66
|
+
output = run_extractor(sessions_root)
|
|
67
|
+
|
|
68
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
69
|
+
self.assertIn("LOOKBACK_MINUTES=1440", output)
|
|
70
|
+
|
|
71
|
+
def test_limit_zero_is_treated_as_unlimited(self) -> None:
|
|
72
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
73
|
+
sessions_root = Path(tmp) / "sessions"
|
|
74
|
+
now = datetime.now(timezone.utc)
|
|
75
|
+
write_session(sessions_root / "a.jsonl", now - timedelta(minutes=5))
|
|
76
|
+
write_session(sessions_root / "b.jsonl", now - timedelta(minutes=10))
|
|
77
|
+
write_session(sessions_root / "c.jsonl", now - timedelta(minutes=15))
|
|
78
|
+
|
|
79
|
+
output = run_extractor(
|
|
80
|
+
sessions_root,
|
|
81
|
+
None,
|
|
82
|
+
"--lookback-minutes",
|
|
83
|
+
"60",
|
|
84
|
+
"--limit",
|
|
85
|
+
"0",
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=3", output)
|
|
89
|
+
|
|
90
|
+
def test_archived_sessions_are_read_before_cleanup(self) -> None:
|
|
91
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
92
|
+
sessions_root = Path(tmp) / "sessions"
|
|
93
|
+
archived_root = Path(tmp) / "archived_sessions"
|
|
94
|
+
now = datetime.now(timezone.utc)
|
|
95
|
+
archived_file = archived_root / "archived.jsonl"
|
|
96
|
+
write_session(archived_file, now - timedelta(minutes=30))
|
|
97
|
+
|
|
98
|
+
output = run_extractor(
|
|
99
|
+
sessions_root,
|
|
100
|
+
archived_root,
|
|
101
|
+
"--lookback-minutes",
|
|
102
|
+
"60",
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
106
|
+
self.assertIn("ARCHIVED_SESSIONS_INCLUDED=true", output)
|
|
107
|
+
self.assertIn("user:archived", output)
|
|
108
|
+
self.assertIn("assistant:archived", output)
|
|
109
|
+
self.assertIn("CLEANUP_REMOVED_ARCHIVED_SESSIONS=1", output)
|
|
110
|
+
self.assertFalse(archived_file.exists())
|
|
111
|
+
|
|
112
|
+
def test_cleanup_removes_only_old_sessions_from_sessions_dir(self) -> None:
|
|
113
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
114
|
+
sessions_root = Path(tmp) / "sessions"
|
|
115
|
+
now = datetime.now(timezone.utc)
|
|
116
|
+
recent_file = sessions_root / "recent.jsonl"
|
|
117
|
+
old_file = sessions_root / "old.jsonl"
|
|
118
|
+
write_session(recent_file, now - timedelta(hours=6))
|
|
119
|
+
write_session(old_file, now - timedelta(days=8))
|
|
120
|
+
|
|
121
|
+
output = run_extractor(
|
|
122
|
+
sessions_root,
|
|
123
|
+
None,
|
|
124
|
+
"--lookback-minutes",
|
|
125
|
+
"1440",
|
|
126
|
+
"--retention-days",
|
|
127
|
+
"7",
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
131
|
+
self.assertIn("CLEANUP_REMOVED_OLD_SESSIONS=1", output)
|
|
132
|
+
self.assertTrue(recent_file.exists())
|
|
133
|
+
self.assertFalse(old_file.exists())
|
|
134
|
+
|
|
135
|
+
def test_archived_cleanup_skips_active_sessions_when_paths_overlap(self) -> None:
|
|
136
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
137
|
+
sessions_root = Path(tmp) / "sessions"
|
|
138
|
+
now = datetime.now(timezone.utc)
|
|
139
|
+
recent_file = sessions_root / "recent.jsonl"
|
|
140
|
+
write_session(recent_file, now - timedelta(minutes=5))
|
|
141
|
+
|
|
142
|
+
output = run_extractor(
|
|
143
|
+
sessions_root,
|
|
144
|
+
sessions_root,
|
|
145
|
+
"--lookback-minutes",
|
|
146
|
+
"60",
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
150
|
+
self.assertIn("CLEANUP_REMOVED_ARCHIVED_SESSIONS=0", output)
|
|
151
|
+
self.assertTrue(recent_file.exists())
|
|
152
|
+
|
|
153
|
+
def test_limit_one_only_returns_latest_session_across_sources(self) -> None:
|
|
154
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
155
|
+
sessions_root = Path(tmp) / "sessions"
|
|
156
|
+
archived_root = Path(tmp) / "archived_sessions"
|
|
157
|
+
now = datetime.now(timezone.utc)
|
|
158
|
+
write_session(sessions_root / "older.jsonl", now - timedelta(minutes=20))
|
|
159
|
+
newest = archived_root / "newest.jsonl"
|
|
160
|
+
write_session(newest, now - timedelta(minutes=5))
|
|
161
|
+
|
|
162
|
+
output = run_extractor(
|
|
163
|
+
sessions_root,
|
|
164
|
+
archived_root,
|
|
165
|
+
"--lookback-minutes",
|
|
166
|
+
"60",
|
|
167
|
+
"--limit",
|
|
168
|
+
"1",
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
self.assertIn("RECENT_CONVERSATIONS_FOUND=1", output)
|
|
172
|
+
self.assertIn("newest.jsonl", output)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
if __name__ == "__main__":
|
|
176
|
+
unittest.main()
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learning-error-book
|
|
3
|
+
description: A learning-focused error-book workflow. When the user asks to summarize mistakes, the agent summarizes mistakes made while solving questions and generates/updates an error book in Markdown, rendered to PDF (depends on the pdf skill).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Learning Error Book Skill
|
|
7
|
+
|
|
8
|
+
## Dependencies
|
|
9
|
+
|
|
10
|
+
- Required: `pdf` whenever question sources or the final deliverable involve PDF handling.
|
|
11
|
+
- Conditional: none.
|
|
12
|
+
- Optional: none.
|
|
13
|
+
- Fallback: If PDF extraction fails, escalate to OCR through `pdf`; if OCR still cannot recover the content, ask the user for the minimum needed text or screenshots.
|
|
14
|
+
|
|
15
|
+
## Standards
|
|
16
|
+
|
|
17
|
+
- Evidence: Summarize mistakes only from traceable question sources, user attempts, and correct-answer evidence.
|
|
18
|
+
- Execution: Build an evidence table first, update `error_book/error-book.md`, then render `error_book/error-book.pdf` with Chinese-safe fonts.
|
|
19
|
+
- Quality: Explain mistake types, concept misunderstandings, and per-question solutions in a way that is specific, complete, and non-speculative.
|
|
20
|
+
- Output: Deliver the standardized error-book structure in Markdown and PDF with consistent section coverage.
|
|
21
|
+
|
|
22
|
+
Goal: when the user asks to "summarize mistakes / summarize errors / compile an error book", **summarize mistakes with evidence** and **generate or update** an error book (Markdown -> PDF).
|
|
23
|
+
|
|
24
|
+
## Behavior Contract (GIVEN/THEN)
|
|
25
|
+
|
|
26
|
+
GIVEN the user asks to **summarize mistakes/errors**
|
|
27
|
+
THEN the agent summarizes the user's mistakes made while solving questions
|
|
28
|
+
AND generates or updates an **error book** that includes:
|
|
29
|
+
- Coverage scope (which question files / sources are included)
|
|
30
|
+
- Common mistake types overview
|
|
31
|
+
- Conceptual mistake highlights (definition, user's common misjudgment, cautions)
|
|
32
|
+
- Mistake-by-mistake analysis and solutions
|
|
33
|
+
- For MC questions: explain why **each option** is wrong/right, and why the correct option is correct
|
|
34
|
+
AND the delivered error book must be a **PDF rendered from Markdown**, using fonts that properly render **Chinese text and Markdown symbols**.
|
|
35
|
+
|
|
36
|
+
## Trigger Conditions
|
|
37
|
+
|
|
38
|
+
Use this skill when the user intent matches:
|
|
39
|
+
- "summarize mistakes", "what did I do wrong", "compile error book", "review wrong answers"
|
|
40
|
+
- user provides question files (often PDFs) and asks to summarize mistakes
|
|
41
|
+
|
|
42
|
+
## Inputs (Facts You Must Collect)
|
|
43
|
+
|
|
44
|
+
Before writing anything, ensure you have enough facts (do not guess):
|
|
45
|
+
- Question source: file paths (PDF), or pasted text/screenshots, or question id/page number
|
|
46
|
+
- User's attempt: chosen option / written answer, and their reasoning (if available)
|
|
47
|
+
- Correct answer and explanation: extract from the PDF if present; otherwise ask the user to provide it
|
|
48
|
+
|
|
49
|
+
If the PDF is scanned/image-based and text extraction fails:
|
|
50
|
+
- Use the `pdf` skill to attempt OCR (if available)
|
|
51
|
+
- If OCR is not possible, request pasted text or screenshots (minimum: stem + options/sub-questions)
|
|
52
|
+
|
|
53
|
+
## Output Spec (Required Sections)
|
|
54
|
+
|
|
55
|
+
The error book must contain:
|
|
56
|
+
1) **Coverage Scope**: which question files/sources are included (with paths; include page/question ids when available)
|
|
57
|
+
2) **Common Mistake Types Overview**: 3-8 categories (concept misunderstanding, misreading conditions, derivation/calculation error, option traps, etc.), with representative questions
|
|
58
|
+
3) **Conceptual Mistake Highlights** (per concept):
|
|
59
|
+
- Definition (precise and actionable)
|
|
60
|
+
- User's common misjudgment (mapped to concrete mistakes)
|
|
61
|
+
- Cautions / checklists to avoid repeating the mistake
|
|
62
|
+
4) **Per-Question Mistake & Solution**:
|
|
63
|
+
- Traceable locator: file + page/question id
|
|
64
|
+
- User answer vs correct answer
|
|
65
|
+
- Why it's wrong (link back to mistake type + concept)
|
|
66
|
+
- Correct solution (step-by-step)
|
|
67
|
+
- For **MC**: explain why **each option** is wrong/right, and why the correct option is correct
|
|
68
|
+
|
|
69
|
+
Formats:
|
|
70
|
+
- Editable source: `error_book/error-book.md` (Markdown)
|
|
71
|
+
- Deliverable: `error_book/error-book.pdf` (PDF rendered from Markdown)
|
|
72
|
+
|
|
73
|
+
## Recommended File Layout (Keep It Consistent)
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
error_book/
|
|
77
|
+
error-book.md
|
|
78
|
+
error-book.pdf
|
|
79
|
+
sources/ # optional: shortcuts/copies/list of source PDFs
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Workflow (Required)
|
|
83
|
+
|
|
84
|
+
1) **Determine coverage**
|
|
85
|
+
- If the user provided files/question ids: add them to Coverage Scope
|
|
86
|
+
- If not: search the workspace for relevant PDFs and confirm with the user
|
|
87
|
+
|
|
88
|
+
2) **Extract question text + answers/explanations (extract when possible)**
|
|
89
|
+
- Use the `pdf` skill (pypdf/pdfplumber/OCR as available)
|
|
90
|
+
- If extraction fails, request user-provided text/screenshots
|
|
91
|
+
|
|
92
|
+
3) **Build an evidence table before writing**
|
|
93
|
+
- For each question: locator, user answer, correct answer, mistake type, concept(s), explanation
|
|
94
|
+
- Then map it into the required four sections
|
|
95
|
+
|
|
96
|
+
4) **Generate/update `error_book/error-book.md`**
|
|
97
|
+
- If missing: start from `assets/error_book_template.md`
|
|
98
|
+
- If exists: preserve existing content; append new mistakes; update Overview + Concepts sections
|
|
99
|
+
|
|
100
|
+
5) **Render Markdown -> PDF (CJK font support)**
|
|
101
|
+
- Run:
|
|
102
|
+
- `python3 learning-error-book/scripts/render_markdown_to_pdf.py error_book/error-book.md error_book/error-book.pdf`
|
|
103
|
+
- If paper size/font needs change: adjust script flags (`--help`)
|
|
104
|
+
|
|
105
|
+
## Built-in Template
|
|
106
|
+
|
|
107
|
+
- `assets/error_book_template.md`: template for first-time creation
|
|
108
|
+
|
|
109
|
+
## Rendering Notes (Avoid Pitfalls)
|
|
110
|
+
|
|
111
|
+
- Supported Markdown subset: headings, lists, **bold**/**italic**, inline `code`, fenced code blocks
|
|
112
|
+
- For complex tables/math: prefer bullet lists + step-by-step derivations, or paste original content into the question section
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Learning Error Book"
|
|
3
|
+
short_description: "Summarize mistakes into a Markdown-to-PDF error book"
|
|
4
|
+
default_prompt: "Use $learning-error-book to gather evidence about the user's mistakes, use $pdf whenever PDF extraction or OCR is needed, generate or update error_book/error-book.md from the skill template, and render the final deliverable to error_book/error-book.pdf."
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Error Book
|
|
2
|
+
|
|
3
|
+
Last updated: {{DATE}}
|
|
4
|
+
|
|
5
|
+
## 1. Coverage Scope
|
|
6
|
+
|
|
7
|
+
This error book includes the following question sources (with traceable locators):
|
|
8
|
+
|
|
9
|
+
- (Question file/source):
|
|
10
|
+
- Path: `...`
|
|
11
|
+
- Included questions: Q... / Page ... (optional)
|
|
12
|
+
|
|
13
|
+
## 2. Common Mistake Types Overview
|
|
14
|
+
|
|
15
|
+
> Goal: classify mistake patterns first, then use questions as evidence later.
|
|
16
|
+
|
|
17
|
+
- Concept misunderstanding:
|
|
18
|
+
- Representative questions: ...
|
|
19
|
+
- Misreading / missing conditions:
|
|
20
|
+
- Representative questions: ...
|
|
21
|
+
- Incomplete reasoning steps:
|
|
22
|
+
- Representative questions: ...
|
|
23
|
+
- Calculation / sign / algebra errors (if any):
|
|
24
|
+
- Representative questions: ...
|
|
25
|
+
- Option traps / intuitive misjudgment (common in MC):
|
|
26
|
+
- Representative questions: ...
|
|
27
|
+
|
|
28
|
+
## 3. Conceptual Mistake Highlights
|
|
29
|
+
|
|
30
|
+
### Concept: {{CONCEPT_NAME}}
|
|
31
|
+
|
|
32
|
+
- Definition (precise and actionable):
|
|
33
|
+
- ...
|
|
34
|
+
- User's common misjudgment (mapped to this mistake):
|
|
35
|
+
- ...
|
|
36
|
+
- Cautions / checklists:
|
|
37
|
+
- ...
|
|
38
|
+
- Minimal example (optional):
|
|
39
|
+
- ...
|
|
40
|
+
|
|
41
|
+
## 4. Mistake-by-Mistake Analysis & Solutions
|
|
42
|
+
|
|
43
|
+
### Question: {{QUESTION_ID}}
|
|
44
|
+
|
|
45
|
+
- Source locator:
|
|
46
|
+
- File: `...`
|
|
47
|
+
- Page / Question id: ...
|
|
48
|
+
- Stem:
|
|
49
|
+
- ...
|
|
50
|
+
- (If MC) Options:
|
|
51
|
+
- A. ...
|
|
52
|
+
- B. ...
|
|
53
|
+
- C. ...
|
|
54
|
+
- D. ...
|
|
55
|
+
- User answer: ...
|
|
56
|
+
- Correct answer: ...
|
|
57
|
+
- Why it was wrong (link to mistake type + concept):
|
|
58
|
+
- ...
|
|
59
|
+
- Correct solution (step-by-step):
|
|
60
|
+
1. ...
|
|
61
|
+
2. ...
|
|
62
|
+
- (If MC) Option-by-option reasoning:
|
|
63
|
+
- Why A is wrong/right: ...
|
|
64
|
+
- Why B is wrong/right: ...
|
|
65
|
+
- Why C is wrong/right: ...
|
|
66
|
+
- Why D is wrong/right: ...
|