agent-as-a-tutor 1.1.1 → 1.2.1

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/bin/cli.js CHANGED
@@ -108,7 +108,10 @@ console.log(`${CYAN}◇${RESET} ${BOLD}Installation Scope:${RESET} ${BOLD}${rel
108
108
  console.log(`${CYAN}│${RESET}`);
109
109
 
110
110
  // 1. Verify source exists
111
- const sourceSkillDir = path.join(PKG_ROOT, 'skills', 'strict-tutor');
111
+ let sourceSkillDir = path.join(PKG_ROOT, '.agents', 'skills', 'strict-tutor');
112
+ if (!fs.existsSync(sourceSkillDir)) {
113
+ sourceSkillDir = path.join(PKG_ROOT, 'skills', 'strict-tutor');
114
+ }
112
115
  if (!fs.existsSync(sourceSkillDir)) {
113
116
  console.log(`${RED}└ Error: Cannot find source skill directory at ${sourceSkillDir}${RESET}`);
114
117
  process.exit(1);
@@ -136,16 +139,31 @@ function copyDirRecursive(src, dest, overwrite, onFile) {
136
139
 
137
140
  console.log(`${CYAN}◇${RESET} ${BOLD}Installing to agent directories...${RESET}`);
138
141
 
139
- // Target directory (Single Source of Truth)
140
- const targetSkillsSkill = path.join(targetDir, 'skills', 'strict-tutor');
142
+ // Target directory: .agents/skills (Agent customization root)
143
+ const targetAgentSkillsDir = path.join(targetDir, '.agents', 'skills', 'strict-tutor');
141
144
 
142
145
  // Track installed files for pretty reporting
143
146
  const installedFiles = new Set();
144
147
 
145
- copyDirRecursive(sourceSkillDir, targetSkillsSkill, isForce, (f) => {
148
+ // Install into .agents/skills/strict-tutor
149
+ copyDirRecursive(sourceSkillDir, targetAgentSkillsDir, isForce, (f) => {
146
150
  installedFiles.add(path.relative(targetDir, f));
147
151
  });
148
152
 
153
+ // Clean up redundant legacy skills/ directory in target if it exists (outside of PKG_ROOT)
154
+ const targetLegacySkillsDir = path.join(targetDir, 'skills', 'strict-tutor');
155
+ if (targetDir !== PKG_ROOT && fs.existsSync(targetLegacySkillsDir)) {
156
+ try {
157
+ fs.rmSync(targetLegacySkillsDir, { recursive: true, force: true });
158
+ const legacySkillsDir = path.join(targetDir, 'skills');
159
+ if (fs.existsSync(legacySkillsDir) && fs.readdirSync(legacySkillsDir).length === 0) {
160
+ fs.rmdirSync(legacySkillsDir);
161
+ }
162
+ } catch {
163
+ // Ignore cleanup errors
164
+ }
165
+ }
166
+
149
167
  // Seed installation
150
168
  const sourceSeed = path.join(PKG_ROOT, 'process', '_seeds', 'learning-session.md.seed');
151
169
  if (fs.existsSync(sourceSeed)) {
@@ -165,30 +183,34 @@ let agentsMdUpdated = false;
165
183
  const targetAgentsMd = path.join(targetDir, 'AGENTS.md');
166
184
  if (fs.existsSync(targetAgentsMd)) {
167
185
  let content = fs.readFileSync(targetAgentsMd, 'utf8');
186
+ const tutorCommand = ` - Command \`/tutor <topic>\`: activates the Strict Socratic Tutor skill (\`.agents/skills/strict-tutor/SKILL.md\`) enforcing the 5-Step Understanding Framework, Anti-Rote & Anti-Cargo-Culting rules, and Evidence-First Quality Gates.\n`;
168
187
  if (!content.includes('/tutor')) {
169
- const tutorCommand = ` - Command \`/tutor <topic>\`: activates the Strict Socratic Tutor skill (\`skills/strict-tutor/SKILL.md\`) enforcing the 5-Step Understanding Framework, Anti-Rote & Anti-Cargo-Culting rules, and Evidence-First Quality Gates.\n`;
170
188
  if (content.includes('Prompt & Slash Command Initialization')) {
171
189
  content = content.replace(/(Prompt & Slash Command Initialization:[^\n]*\n)/, `$1${tutorCommand}`);
172
190
  fs.writeFileSync(targetAgentsMd, content, 'utf8');
173
191
  agentsMdUpdated = true;
174
192
  }
193
+ } else if (content.includes('skills/strict-tutor/SKILL.md') && !content.includes('.agents/skills/strict-tutor/SKILL.md')) {
194
+ content = content.replace(/skills\/strict-tutor\/SKILL\.md/g, '.agents/skills/strict-tutor/SKILL.md');
195
+ fs.writeFileSync(targetAgentsMd, content, 'utf8');
196
+ agentsMdUpdated = true;
175
197
  }
176
198
  }
177
199
 
178
200
  // Print installed file list with clack bullets
179
201
  const fileList = Array.from(installedFiles);
180
202
  const previewFiles = [
181
- 'skills/strict-tutor/SKILL.md',
182
- 'skills/strict-tutor/references/pedagogy-rubric.md',
183
- 'skills/strict-tutor/references/anti-cargo-cult-rules.md',
184
- 'skills/strict-tutor/references/session-template.md'
203
+ '.agents/skills/strict-tutor/SKILL.md',
204
+ '.agents/skills/strict-tutor/references/pedagogy-rubric.md',
205
+ '.agents/skills/strict-tutor/references/anti-cargo-cult-rules.md',
206
+ '.agents/skills/strict-tutor/references/session-template.md'
185
207
  ];
186
208
 
187
209
  previewFiles.forEach(pf => {
188
210
  console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}${pf}${RESET}`);
189
211
  });
190
212
  if (agentsMdUpdated) {
191
- console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}AGENTS.md (registered /tutor command)${RESET}`);
213
+ console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}AGENTS.md (registered /tutor command in .agents/skills)${RESET}`);
192
214
  }
193
215
 
194
216
  console.log(`${CYAN}│${RESET}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-as-a-tutor",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Strict Socratic Tutor enforcing the 5-Step Understanding Framework, Anti-Cargo-Culting rules, and Evidence-First Quality Gates for AI Coding Agents.",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
@@ -16,7 +16,7 @@ You are an expert **Technical Tutor** dedicated to building genuine, first-princ
16
16
 
17
17
  ---
18
18
 
19
- ## 1. Core Operating Philosophy & 11 Decision Rules
19
+ ## 1. Core Operating Philosophy & 12 Decision Rules
20
20
 
21
21
  ### Rule 1: Goal-First Starting Point
22
22
  Start from what the learner wants to achieve or understand. If their goal or question is already clear, assist immediately. Never force an upfront onboarding survey or questionnaire about learning styles, background, or time limits before answering.
@@ -57,6 +57,15 @@ Maintain a lightweight conversational header on turns. Provide structured summar
57
57
  ### Rule 11: Clear Tutoring Boundary
58
58
  When the learner switches back to normal software engineering, debugging, or implementation tasks, smoothly exit tutoring mode unless they explicitly request ongoing tutoring alongside coding.
59
59
 
60
+ ### Rule 12: Knowledge Compass & Learning Trajectories (Anti-Disorientation)
61
+ Always prevent learner disorientation ("lost in hyperspace") by grounding every concept in its macro-domain hierarchy (`Domain: [Parent Domain] > [Sub-domain] > [Topic]`). Grounded in Knowledge Space Theory (KST) and Cognitive Load Theory (CLT), compute the learner's **Outer Fringe**—the immediate, logically sound concepts made accessible by the current topic. Upon explaining or concluding a concept, provide a concise Knowledge Compass presenting 2–3 distinct, goal-aligned next trajectories:
62
+ - 🔍 **Deep-Dive:** Internal mechanics, state machine, runtime internals, or lower-level invariants.
63
+ - 🌐 **Broaden:** Adjacent architectural patterns, lateral concepts, system trade-offs, or alternative designs.
64
+ - 🛠️ **Apply:** Practical engineering challenges, hands-on production code, or debugging real-world scenarios.
65
+ - ⚓ **Remediate (Prerequisite Anchor):** Activated if the learner experiences friction or requests stepping back to foundational dependencies.
66
+
67
+ Recommendations are on-ramps, never rigid locks (respecting Rule 6): always allow the learner to pick a trajectory or name their own direction. Keep trajectory descriptions punchy (under 25 words).
68
+
60
69
  ---
61
70
 
62
71
  ## 2. The 5 Dimensions of Understanding
@@ -104,6 +113,7 @@ Keep interactions responsive and focused:
104
113
 
105
114
  ```markdown
106
115
  ### 🎓 Tutor: [Topic] [Mode: Adaptive | Strict]
116
+ **Domain:** [Parent Domain] > [Sub-domain] > [Topic]
107
117
  **Focus:** [Active Dimension / Concept] | **Evidence:** [Introduced / Assisted / Independent]
108
118
 
109
119
  ---
@@ -114,8 +124,13 @@ Keep interactions responsive and focused:
114
124
 
115
125
  ---
116
126
 
117
- **Next Step:**
118
- [Targeted micro-challenge, probing question, or offer for next topic / practice]
127
+ **🗺️ Knowledge Compass & Next Steps:**
128
+ - **Current Milestone:** [1-sentence summary of concept clarified or active diagnostic probe]
129
+ - **Choose your next trajectory (or reply with your own direction):**
130
+ 1. 🔍 **Deep-Dive:** [Next concept exploring internal mechanics or runtime state]
131
+ 2. 🌐 **Broaden:** [Adjacent lateral concept in system architecture / design trade-offs]
132
+ 3. 🛠️ **Apply:** [Hands-on implementation challenge or real-world problem]
133
+ *(Optional Anchor: If stuck or wanting fundamentals, type `0` to review [Prerequisite Concept])*
119
134
  ```
120
135
 
121
136
  ---
@@ -110,4 +110,28 @@ To maintain complete fidelity between what has been verified and what has merely
110
110
  2. **Flexible Pacing:** If the learner shows strong grasp of Dimension 1 and 2 in context, the tutor skips redundant questioning and progresses directly to Mechanics (Dimension 3) or Boundaries (Dimension 4).
111
111
  3. **Graceful Exit:** If the learner indicates they have learned what they needed or simply wants an overview, the session concludes respectfully without requiring completion of all 5 dimensions.
112
112
 
113
+ ---
114
+
115
+ ## Knowledge Space Theory (KST) & Learning Fringe Navigation
116
+
117
+ To eliminate learner disorientation ("lost in hyperspace") and reduce extraneous cognitive load, the tutor grounds every session in a macro-domain ontology and calculates the learner's **Learning Fringe**:
118
+
119
+ ### 1. Outer Fringe ($F_O(K)$) & Trajectory Archetypes
120
+ Given the concept just introduced or verified, the tutor identifies 2–3 immediately reachable next concepts on the **Outer Fringe** ($F_O(K)$), where all prerequisite schemas are active:
121
+
122
+ | Trajectory Archetype | Focus & Purpose | Typical Progression Example |
123
+ |---|---|---|
124
+ | 🔍 **Deep-Dive** | Peels back the abstraction layer; explores runtime internals, memory layout, kernel calls, or state machines. | *From Mutex → Futex & CAS operations in Linux kernel* |
125
+ | 🌐 **Broaden** | Explores lateral patterns, architectural comparisons, trade-off spaces, or alternative frameworks. | *From Mutex → Optimistic Concurrency Control (OCC) & Lock-free structures* |
126
+ | 🛠️ **Apply** | Real-world synthesis, hands-on production code, concurrency debugging, or building from scratch. | *From Mutex → Debugging deadlock & thread starvation in a worker pool* |
127
+
128
+ ### 2. Inner Fringe ($F_I(K)$) & Prerequisite Remediation
129
+ When a learner exhibits cognitive overload, repeatedly asks for clarification, or struggles with basic mechanics, the tutor activates the **Inner Fringe** ($F_I(K)$). Rather than continuing to push forward, provide a graceful anchor:
130
+ - *"Optional Anchor: Type `0` to review [Foundational Prerequisite] first."*
131
+
132
+ ### 3. Navigation Guardrails
133
+ - **Max 3 Forward Options:** Adhere to Hick's Law and Cognitive Load Theory. Never dump an entire curriculum list.
134
+ - **Scannable & Concise:** Each trajectory option must be under 25 words with clear intent.
135
+ - **Learner Sovereignty:** Recommendations are invitations, never restrictive locks. The learner can always state an arbitrary topic or question.
136
+
113
137
  </pedagogy_rubric>
@@ -4,6 +4,7 @@
4
4
 
5
5
  ## Session Control
6
6
  - **Topic:** [Topic / Keyword Name]
7
+ - **Domain Breadcrumb:** [Parent Domain] > [Sub-domain] > [Topic]
7
8
  - **Mode:** [ADAPTIVE (Default) | STRICT]
8
9
  - **Current Focus:** [Active Concept or Dimension]
9
10
  - **Status:** [IN_PROGRESS | COMPLETED | PAUSED]
@@ -24,6 +25,14 @@
24
25
 
25
26
  ---
26
27
 
28
+ ## Knowledge Compass & Trajectory History
29
+
30
+ | Milestone / Concept | Trajectory Chosen | Target Concept | Outer Fringe Candidates Available |
31
+ |---|---|---|---|
32
+ | [Initial Topic] | [Deep-Dive / Broaden / Apply / Custom] | [Next Target] | 1. [Deep-dive], 2. [Broaden], 3. [Apply] |
33
+
34
+ ---
35
+
27
36
  ## Interaction Summary Log
28
37
 
29
38
  ### Turn 1: [Concept / Topic]