omnilearn-workflow 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.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # OmniLearn Workflow
2
+
3
+ **AI-powered adaptive learning workflows for [OpenCode](https://opencode.ai).** Uses multi-agent orchestration to create personalized learning roadmaps, generate hands-on assignments, and track progress across any skill.
4
+
5
+ **GitHub:** https://github.com/BlackPool25/OmniLearn
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ # Install the workflow commands
11
+ npx omnilearn-workflow
12
+
13
+ # Open OpenCode
14
+ opencode
15
+
16
+ # Set up your learning directory
17
+ /omnilearn-init
18
+
19
+ # Create your first roadmap
20
+ /omnilearn-roadmap I want to learn Rust
21
+ ```
22
+
23
+ ## Available Commands
24
+
25
+ | Command | Purpose |
26
+ |---------|---------|
27
+ | `/omnilearn-init` | Set up your learning directory and config |
28
+ | `/omnilearn-roadmap` | Create a personalized, research-backed learning roadmap |
29
+ | `/omnilearn-roadmap-edit` | Edit an existing roadmap without losing progress |
30
+ | `/omnilearn-start` | Interactive learning: hands-on assignments, Q&A, progress tracking |
31
+ | `/omnilearn-refine` | Deep-dive questions and subtopic refinements |
32
+
33
+ ## How It Works
34
+
35
+ OmniLearn uses **multi-agent orchestration** (Sisyphus → subagents) to:
36
+
37
+ 1. **Research** — Parallel subagents use web search + Context7 to find everything needed for real-world proficiency
38
+ 2. **Adapt** — Scans your existing skills, reads your preferences, and skips what you already know
39
+ 3. **Integrate** — Combines skills you already have with new ones (e.g., Python + FastAPI = full-stack ML API)
40
+ 4. **Generate** — Creates hands-on assignments at 3 difficulty levels: Basic → Intermediate → Real-World
41
+ 5. **Track** — Every assignment completion and session is logged in `topic-progress.md`
42
+
43
+ ## Architecture
44
+
45
+ ```
46
+ .omnilearn/ ← In your configured learning directory
47
+ ├── UserPreferences.md ← Global preferences (auto-learned)
48
+ └── <skill>/
49
+ ├── roadmap.md ← Master roadmap
50
+ ├── SkillPreferences.md ← Per-skill preferences
51
+ ├── progress-index.md ← Overview index
52
+ ├── runs/ ← Action logs only
53
+ └── topics/<topic>/
54
+ ├── topic-roadmap.md ← Detailed subtopic plan
55
+ ├── topic-progress.md ← 🔑 Progress lives here
56
+ ├── assignments/ ← Hands-on tasks with tests
57
+ └── runs/ ← Session action logs
58
+ ```
59
+
60
+ ## Requirements
61
+
62
+ - [OpenCode](https://opencode.ai) with [Oh-My-OpenAgent](https://github.com/code-yeongyu/oh-my-openagent) installed
63
+ - Node.js >= 18
64
+
65
+ ## Configuration
66
+
67
+ OmniLearn stores its config at `~/.config/opencode/omnilearn.json`:
68
+
69
+ ```json
70
+ {
71
+ "learningDirectory": "/absolute/path/to/learning",
72
+ "setupDate": "2026-07-04",
73
+ "version": "1"
74
+ }
75
+ ```
76
+
77
+ Run `/omnilearn-init` in OpenCode to configure.
78
+
79
+ ## License
80
+
81
+ MIT
package/bin/install.js ADDED
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * OmniLearn Workflow Installer
5
+ *
6
+ * Installs OmniLearn commands into OpenCode's command directory
7
+ * so they're available as global /omnilearn-* commands.
8
+ *
9
+ * GitHub: https://github.com/BlackPool25/OmniLearn
10
+ *
11
+ * Usage:
12
+ * npx omnilearn-workflow # Interactive install
13
+ * npx omnilearn-workflow --help # Show help
14
+ * npx omnilearn-workflow --yes # Auto-install with defaults
15
+ */
16
+
17
+ const fs = require('fs');
18
+ const path = require('path');
19
+ const readline = require('readline');
20
+
21
+ const PKG_DIR = path.resolve(__dirname, '..');
22
+ const COMMANDS_DIR = path.join(PKG_DIR, 'commands');
23
+ const OPENCODE_COMMAND_DIR = path.join(
24
+ process.env.HOME || process.env.USERPROFILE,
25
+ '.config',
26
+ 'opencode',
27
+ 'command'
28
+ );
29
+
30
+ const COMMANDS = [
31
+ 'omnilearn-init.md',
32
+ 'omnilearn-roadmap.md',
33
+ 'omnilearn-roadmap-edit.md',
34
+ 'omnilearn-start.md',
35
+ 'omnilearn-refine.md',
36
+ ];
37
+
38
+ function printBanner() {
39
+ console.log(`
40
+ ╔══════════════════════════════════════════════════╗
41
+ ║ OmniLearn Workflow Installer ║
42
+ ║ AI-powered adaptive learning for OpenCode ║
43
+ ╚══════════════════════════════════════════════════╝
44
+ `);
45
+ }
46
+
47
+ function printHelp() {
48
+ console.log(`
49
+ Usage:
50
+ npx omnilearn-workflow Interactive install
51
+ npx omnilearn-workflow --yes Auto-install with defaults
52
+ npx omnilearn-workflow --help Show this help
53
+
54
+ What this installer does:
55
+ 1. Copies 5 command files to ~/.config/opencode/command/
56
+ 2. Makes them available as /omnilearn-* commands in OpenCode
57
+
58
+ After install, open OpenCode and run:
59
+ /omnilearn-init — Set up your learning directory
60
+ /omnilearn-roadmap — Create your first roadmap
61
+ `);
62
+ }
63
+
64
+ function ask(question) {
65
+ const rl = readline.createInterface({
66
+ input: process.stdin,
67
+ output: process.stdout,
68
+ });
69
+ return new Promise((resolve) => {
70
+ rl.question(question, (answer) => {
71
+ rl.close();
72
+ resolve(answer.trim());
73
+ });
74
+ });
75
+ }
76
+
77
+ async function install(autoYes = false) {
78
+ printBanner();
79
+
80
+ // Check if OpenCode command directory exists
81
+ if (!fs.existsSync(OPENCODE_COMMAND_DIR)) {
82
+ console.log(` [✗] OpenCode command directory not found at:`);
83
+ console.log(` ${OPENCODE_COMMAND_DIR}`);
84
+ console.log(``);
85
+ console.log(` Make sure OpenCode is installed first:`);
86
+ console.log(` https://opencode.ai`);
87
+ console.log(``);
88
+ process.exit(1);
89
+ }
90
+
91
+ console.log(` OpenCode command directory: ${OPENCODE_COMMAND_DIR}`);
92
+ console.log(``);
93
+
94
+ // List existing omnilearn commands
95
+ const existing = fs.readdirSync(OPENCODE_COMMAND_DIR)
96
+ .filter(f => f.startsWith('omnilearn-') && f.endsWith('.md'));
97
+
98
+ if (existing.length > 0 && !autoYes) {
99
+ console.log(` Found ${existing.length} existing OmniLearn command(s):`);
100
+ existing.forEach(f => console.log(` • ${f}`));
101
+ console.log(``);
102
+ const answer = await ask(' Overwrite existing commands? [y/N] ');
103
+ if (answer.toLowerCase() !== 'y') {
104
+ console.log(' Skipping installation of command files.');
105
+ console.log(' Existing commands preserved.');
106
+ console.log('');
107
+ return await postInstall(autoYes);
108
+ }
109
+ }
110
+
111
+ // Copy command files
112
+ let copied = 0;
113
+ for (const cmd of COMMANDS) {
114
+ const src = path.join(COMMANDS_DIR, cmd);
115
+ const dest = path.join(OPENCODE_COMMAND_DIR, cmd);
116
+
117
+ if (!fs.existsSync(src)) {
118
+ console.log(` [✗] Source not found: ${cmd}`);
119
+ continue;
120
+ }
121
+
122
+ try {
123
+ fs.copyFileSync(src, dest);
124
+ fs.chmodSync(dest, 0o644);
125
+ console.log(` [✓] Installed: ${cmd}`);
126
+ copied++;
127
+ } catch (err) {
128
+ console.log(` [✗] Failed to install ${cmd}: ${err.message}`);
129
+ }
130
+ }
131
+
132
+ console.log(``);
133
+ console.log(` Installed ${copied}/${COMMANDS.length} command(s).`);
134
+ console.log(``);
135
+
136
+ return await postInstall(autoYes);
137
+ }
138
+
139
+ async function postInstall(autoYes) {
140
+ console.log(` ┌──────────────────────────────────────────────────────────┐`);
141
+ console.log(` │ ✅ OmniLearn commands installed! │`);
142
+ console.log(` │ │`);
143
+ console.log(` │ Next steps: │`);
144
+ console.log(` │ │`);
145
+ console.log(` │ 1. Open OpenCode in your learning project │`);
146
+ console.log(` │ 2. Run: /omnilearn-init │`);
147
+ console.log(` │ (This sets up your learning directory) │`);
148
+ console.log(` │ │`);
149
+ console.log(` │ 3. Run: /omnilearn-roadmap I want to learn <skill> │`);
150
+ console.log(` │ (Creates your first learning roadmap) │`);
151
+ console.log(` │ │`);
152
+ console.log(` │ Available commands: │`);
153
+ console.log(` │ /omnilearn-init — Configure learning directory │`);
154
+ console.log(` │ /omnilearn-roadmap — Create a learning roadmap │`);
155
+ console.log(` │ /omnilearn-roadmap-edit— Edit an existing roadmap │`);
156
+ console.log(` │ /omnilearn-start — Start learning a topic │`);
157
+ console.log(` │ /omnilearn-refine — Refine a subtopic or ask Qs │`);
158
+ console.log(` └──────────────────────────────────────────────────────────┘`);
159
+ console.log(``);
160
+ }
161
+
162
+ // ─── CLI ───
163
+
164
+ const args = process.argv.slice(2);
165
+
166
+ if (args.includes('--help') || args.includes('-h')) {
167
+ printHelp();
168
+ process.exit(0);
169
+ }
170
+
171
+ const autoYes = args.includes('--yes') || args.includes('-y');
172
+
173
+ install(autoYes).catch((err) => {
174
+ console.error('Installation failed:', err.message);
175
+ process.exit(1);
176
+ });
@@ -0,0 +1,203 @@
1
+ ---
2
+ description: Initialize OmniLearn — set your learning directory, create the base structure, and configure global preferences. Run this before using any other omnilearn-* command.
3
+ ---
4
+
5
+ # /omnilearn-init — Initialize OmniLearn Learning Environment
6
+
7
+ ## Usage
8
+ ```
9
+ /omnilearn-init
10
+ /omnilearn-init /absolute/path/to/learning/materials
11
+ /omnilearn-init ./my-learning
12
+ ```
13
+
14
+ ## What This Does
15
+
16
+ 1. Checks if OmniLearn is already configured (reads `~/.config/opencode/omnilearn.json`)
17
+ 2. If not configured: asks the user where to store learning materials, saves config
18
+ 3. Creates the base `.omnilearn/` directory structure at the configured path
19
+ 4. Creates initial `UserPreferences.md` (empty — populated organically)
20
+ 5. Confirms setup is complete
21
+
22
+ ## Config File
23
+
24
+ OmniLearn stores its configuration in `~/.config/opencode/omnilearn.json`:
25
+
26
+ ```json
27
+ {
28
+ "learningDirectory": "/absolute/path/to/learning",
29
+ "setupDate": "2026-07-04",
30
+ "version": "1"
31
+ }
32
+ ```
33
+
34
+ This global location is always accessible regardless of which project directory you're in. All commands read this file at startup.
35
+
36
+ ## Directory Structure Created
37
+
38
+ ```
39
+ {learningDirectory}/
40
+ └── .omnilearn/
41
+ ├── config.json ← Mirror of the global config (for reference)
42
+ └── UserPreferences.md ← Global user preferences (auto-populated)
43
+ ```
44
+
45
+ ## Phase 0: CHECK EXISTING CONFIG
46
+
47
+ ### 0.1 Check if Already Configured
48
+
49
+ ```bash
50
+ OMNILEARN_CONFIG="$HOME/.config/opencode/omnilearn.json"
51
+
52
+ if [ -f "$OMNILEARN_CONFIG" ]; then
53
+ echo "OmniLearn is already configured."
54
+ LEARNING_DIR=$(jq -r '.learningDirectory' "$OMNILEARN_CONFIG")
55
+ echo "Learning directory: $LEARNING_DIR"
56
+ echo ""
57
+ echo "To change it, run: /omnilearn-init <new-path>"
58
+ echo "Or continue using the existing setup with any omnilearn-* command."
59
+ exit 0
60
+ fi
61
+ ```
62
+
63
+ If the user provided a path as an argument, use it directly (skip Phase 1).
64
+
65
+ ### 0.2 Read Argument (if provided)
66
+
67
+ ```bash
68
+ if [ -n "$ARG1" ]; then
69
+ LEARNING_DIR=$(realpath "$ARG1" 2>/dev/null || echo "$ARG1")
70
+ # Proceed to Phase 2
71
+ fi
72
+ ```
73
+
74
+ ## Phase 1: ASK USER FOR LEARNING DIRECTORY
75
+
76
+ If no argument was provided and no config exists:
77
+
78
+ > "Welcome to OmniLearn! 🎉
79
+ >
80
+ > I need a directory where all your learning materials will be stored.
81
+ > This is where skill roadmaps, assignments, progress tracking, and run logs live.
82
+ >
83
+ > Where would you like to set up your learning directory?"
84
+ >
85
+ > Options:
86
+ > 1. **Current directory** ({cwd}) — simplest, everything stays in this project
87
+ > 2. **Home directory** (~/OmniLearn) — accessible from any project
88
+ > 3. **Custom path** — you specify
89
+
90
+ Use the `question` tool to present these options. For "Custom path", collect the user's typed path.
91
+
92
+ ```bash
93
+ # Make the path absolute
94
+ LEARNING_DIR=$(realpath "$LEARNING_DIR" 2>/dev/null || echo "$LEARNING_DIR")
95
+ ```
96
+
97
+ ## Phase 2: CREATE CONFIG & DIRECTORY STRUCTURE
98
+
99
+ ### 2.1 Save Global Config
100
+
101
+ ```bash
102
+ mkdir -p "$HOME/.config/opencode"
103
+
104
+ cat > "$OMNILEARN_CONFIG" << 'CONFIG'
105
+ {
106
+ "learningDirectory": "LEARNING_DIR_PLACEHOLDER",
107
+ "setupDate": "DATE_PLACEHOLDER",
108
+ "version": "1"
109
+ }
110
+ CONFIG
111
+
112
+ # Replace placeholders
113
+ sed -i "s|LEARNING_DIR_PLACEHOLDER|$LEARNING_DIR|g" "$OMNILEARN_CONFIG"
114
+ sed -i "s|DATE_PLACEHOLDER|$(date +%Y-%m-%d)|g" "$OMNILEARN_CONFIG"
115
+ ```
116
+
117
+ ### 2.2 Create Base Directory Structure
118
+
119
+ ```bash
120
+ # Create .omnilearn in the learning directory
121
+ OMNILEARN_DIR="$LEARNING_DIR/.omnilearn"
122
+ mkdir -p "$OMNILEARN_DIR"
123
+
124
+ # Create a local config mirror (for reference when browsing)
125
+ cat > "$OMNILEARN_DIR/config.json" << 'CONFIG'
126
+ {
127
+ "learningDirectory": "LEARNING_DIR_PLACEHOLDER",
128
+ "setupDate": "DATE_PLACEHOLDER",
129
+ "version": "1"
130
+ }
131
+ CONFIG
132
+ sed -i "s|LEARNING_DIR_PLACEHOLDER|$LEARNING_DIR|g" "$OMNILEARN_DIR/config.json"
133
+ sed -i "s|DATE_PLACEHOLDER|$(date +%Y-%m-%d)|g" "$OMNILEARN_DIR/config.json"
134
+ ```
135
+
136
+ ### 2.3 Create Initial UserPreferences.md
137
+
138
+ ```bash
139
+ cat > "$OMNILEARN_DIR/UserPreferences.md" << 'EOF'
140
+ # Global User Preferences
141
+
142
+ _This file is auto-managed by OmniLearn. Preferences are learned organically from interactions — never from forms or questionnaires._
143
+
144
+ ## Learning Style
145
+ <!-- Preferences about how the user learns best, inferred from behavior -->
146
+
147
+ ## Technical Background
148
+ <!-- The user's demonstrated experience level, preferred tools, and known technologies -->
149
+
150
+ ## Goals
151
+ <!-- Career, personal, or academic goals related to learning -->
152
+
153
+ ## Preference Log
154
+
155
+ ### {setupDate}: OmniLearn initialized
156
+ - Learning directory set to: {learningDirectory}
157
+ - OmniLearn v1 initialized
158
+ - User preferences file created — will grow organically with use
159
+ EOF
160
+ ```
161
+
162
+ ## Phase 3: CONFIRM SETUP
163
+
164
+ ```markdown
165
+ ┌──────────────────────────────────────────────────────────────────┐
166
+ │ ✅ OmniLearn Initialized │
167
+ ├──────────────────────────────────────────────────────────────────┤
168
+ │ │
169
+ │ Learning directory: {learningDirectory} │
170
+ │ Config: {OMNILEARN_CONFIG} │
171
+ │ │
172
+ │ All omnilearn-* commands are now ready to use: │
173
+ │ │
174
+ │ /omnilearn-roadmap <skill> — Create a learning roadmap │
175
+ │ /omnilearn-roadmap-edit <skill> — Edit an existing roadmap │
176
+ │ /omnilearn-start <skill> — Start learning │
177
+ │ /omnilearn-refine <skill> — Refine a subtopic │
178
+ │ │
179
+ │ Get started: │
180
+ │ /omnilearn-roadmap I want to learn Rust │
181
+ └──────────────────────────────────────────────────────────────────┘
182
+ ```
183
+
184
+ ## Quality Gates
185
+
186
+ | Check | Phase | Action if Failed |
187
+ |-------|-------|-----------------|
188
+ | Config file written | 2 | Check permissions on ~/.config/opencode/ |
189
+ | Learning directory exists | 2 | Create if not exists |
190
+ | .omnilearn/ created inside learning directory | 2 | mkdir -p |
191
+ | UserPreferences.md created | 2 | Write default template |
192
+ | Config readable by shell | 2 | Test: `jq` or `grep` the file |
193
+ | User confirmed the path is correct | 1 | Re-ask if wrong |
194
+
195
+ ## Error Recovery
196
+
197
+ | Situation | Action |
198
+ |-----------|--------|
199
+ | Config already exists | Show current config, exit |
200
+ | User provides invalid path | Ask again with validation |
201
+ | ~/.config/opencode/ not writable | Suggest `sudo` or manual setup |
202
+ | jq not available | Use `grep` + `sed` to parse JSON instead |
203
+ | User wants to change directory later | Re-run /omnilearn-init <new-path> |