agent-as-a-tutor 1.1.0 → 1.2.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/bin/cli.js
CHANGED
|
@@ -136,17 +136,20 @@ function copyDirRecursive(src, dest, overwrite, onFile) {
|
|
|
136
136
|
|
|
137
137
|
console.log(`${CYAN}◇${RESET} ${BOLD}Installing to agent directories...${RESET}`);
|
|
138
138
|
|
|
139
|
-
// Target directories
|
|
140
|
-
const
|
|
141
|
-
const
|
|
139
|
+
// Target directories: Primary .agents/skills (Agent customization root) + skills (compatibility)
|
|
140
|
+
const targetAgentSkillsDir = path.join(targetDir, '.agents', 'skills', 'strict-tutor');
|
|
141
|
+
const targetLegacySkillsDir = path.join(targetDir, 'skills', 'strict-tutor');
|
|
142
142
|
|
|
143
143
|
// Track installed files for pretty reporting
|
|
144
144
|
const installedFiles = new Set();
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
// 1. Install into .agents/skills/strict-tutor (Primary agent customization root)
|
|
147
|
+
copyDirRecursive(sourceSkillDir, targetAgentSkillsDir, isForce, (f) => {
|
|
147
148
|
installedFiles.add(path.relative(targetDir, f));
|
|
148
149
|
});
|
|
149
|
-
|
|
150
|
+
|
|
151
|
+
// 2. Mirror into skills/strict-tutor for backward compatibility
|
|
152
|
+
copyDirRecursive(sourceSkillDir, targetLegacySkillsDir, isForce, (f) => {
|
|
150
153
|
installedFiles.add(path.relative(targetDir, f));
|
|
151
154
|
});
|
|
152
155
|
|
|
@@ -169,13 +172,17 @@ let agentsMdUpdated = false;
|
|
|
169
172
|
const targetAgentsMd = path.join(targetDir, 'AGENTS.md');
|
|
170
173
|
if (fs.existsSync(targetAgentsMd)) {
|
|
171
174
|
let content = fs.readFileSync(targetAgentsMd, 'utf8');
|
|
175
|
+
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`;
|
|
172
176
|
if (!content.includes('/tutor')) {
|
|
173
|
-
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`;
|
|
174
177
|
if (content.includes('Prompt & Slash Command Initialization')) {
|
|
175
178
|
content = content.replace(/(Prompt & Slash Command Initialization:[^\n]*\n)/, `$1${tutorCommand}`);
|
|
176
179
|
fs.writeFileSync(targetAgentsMd, content, 'utf8');
|
|
177
180
|
agentsMdUpdated = true;
|
|
178
181
|
}
|
|
182
|
+
} else if (content.includes('skills/strict-tutor/SKILL.md') && !content.includes('.agents/skills/strict-tutor/SKILL.md')) {
|
|
183
|
+
content = content.replace(/skills\/strict-tutor\/SKILL\.md/g, '.agents/skills/strict-tutor/SKILL.md');
|
|
184
|
+
fs.writeFileSync(targetAgentsMd, content, 'utf8');
|
|
185
|
+
agentsMdUpdated = true;
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
|
|
@@ -185,15 +192,14 @@ const previewFiles = [
|
|
|
185
192
|
'.agents/skills/strict-tutor/SKILL.md',
|
|
186
193
|
'.agents/skills/strict-tutor/references/pedagogy-rubric.md',
|
|
187
194
|
'.agents/skills/strict-tutor/references/anti-cargo-cult-rules.md',
|
|
188
|
-
'.agents/skills/strict-tutor/references/session-template.md'
|
|
189
|
-
'skills/strict-tutor/SKILL.md'
|
|
195
|
+
'.agents/skills/strict-tutor/references/session-template.md'
|
|
190
196
|
];
|
|
191
197
|
|
|
192
198
|
previewFiles.forEach(pf => {
|
|
193
199
|
console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}${pf}${RESET}`);
|
|
194
200
|
});
|
|
195
201
|
if (agentsMdUpdated) {
|
|
196
|
-
console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}AGENTS.md (registered /tutor command)${RESET}`);
|
|
202
|
+
console.log(`${CYAN}│${RESET} ${GREEN}✔${RESET} ${DIM}AGENTS.md (registered /tutor command in .agents/skills)${RESET}`);
|
|
197
203
|
}
|
|
198
204
|
|
|
199
205
|
console.log(`${CYAN}│${RESET}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-as-a-tutor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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 &
|
|
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
|
-
|
|
118
|
-
[
|
|
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]
|