epam-ai-conductor 0.1.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.
Files changed (115) hide show
  1. package/README.md +46 -0
  2. package/bin/workshop.js +6 -0
  3. package/dist/auth-check.d.ts +1 -0
  4. package/dist/auth-check.js +45 -0
  5. package/dist/auth-check.js.map +1 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +156 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/content/content/module-1/task/module-1_home-task_components.md +257 -0
  10. package/dist/content/content/module-1/task/module-1_home-task_good_practices.md +69 -0
  11. package/dist/content/content/module-1/task/module-1_home-task_task.md +253 -0
  12. package/dist/content/content/module-1/tests/Button.test.tsx +22 -0
  13. package/dist/content/content/module-1/tests/CourseCard.test.tsx +64 -0
  14. package/dist/content/content/module-1/tests/CourseInfo.test.tsx +73 -0
  15. package/dist/content/content/module-1/tests/Courses.test.tsx +87 -0
  16. package/dist/content/content/module-1/tests/Header.test.tsx +23 -0
  17. package/dist/content/content/module-1/tests/Input.test.tsx +36 -0
  18. package/dist/content/content/module-1/tests/helpers.test.ts +13 -0
  19. package/dist/content/content/module-1/theory/module-1_elements-render.md +66 -0
  20. package/dist/content/content/module-1/theory/module-1_hooks_useEffect.md +178 -0
  21. package/dist/content/content/module-1/theory/module-1_hooks_useState.md +131 -0
  22. package/dist/content/content/module-1/theory/module-1_react.md +64 -0
  23. package/dist/content/content/module-1/theory/module-1_spa.md +74 -0
  24. package/dist/content/content/module-2/task/module-2_home-task_components.md +313 -0
  25. package/dist/content/content/module-2/task/module-2_home-task_good_practices.md +35 -0
  26. package/dist/content/content/module-2/task/module-2_home-task_task.md +210 -0
  27. package/dist/content/content/module-2/tests/App.test.tsx +54 -0
  28. package/dist/content/content/module-2/tests/Login.test.tsx +73 -0
  29. package/dist/content/content/module-2/tests/Registration.test.tsx +70 -0
  30. package/dist/content/content/module-2/tests/SearchBar.test.tsx +39 -0
  31. package/dist/content/content/module-2/theory/module-2_custom-hooks.md +201 -0
  32. package/dist/content/content/module-2/theory/module-2_hooks.md +117 -0
  33. package/dist/content/content/module-2/theory/module-2_react-router.md +328 -0
  34. package/dist/content/content/module-3/task/module-3_home-task_components.md +94 -0
  35. package/dist/content/content/module-3/task/module-3_home-task_good_practices.md +26 -0
  36. package/dist/content/content/module-3/task/module-3_home-task_task.md +170 -0
  37. package/dist/content/content/module-3/tests/App.test.tsx +54 -0
  38. package/dist/content/content/module-3/tests/Courses.test.tsx +87 -0
  39. package/dist/content/content/module-3/tests/CreateAuthor.test.tsx +44 -0
  40. package/dist/content/content/module-3/tests/CreateCourse.test.tsx +122 -0
  41. package/dist/content/content/module-3/theory/module-3_redux-hooks.md +194 -0
  42. package/dist/content/content/module-3/theory/module-3_state-actions-reducers.md +445 -0
  43. package/dist/content/content/module-4/task/module-4_home-task_components.md +187 -0
  44. package/dist/content/content/module-4/task/module-4_home-task_task.md +139 -0
  45. package/dist/content/content/module-4/tests/App.test.tsx +54 -0
  46. package/dist/content/content/module-4/tests/Courses.test.tsx +87 -0
  47. package/dist/content/content/module-4/tests/CreateCourse.test.tsx +122 -0
  48. package/dist/content/content/module-4/tests/Login.test.tsx +73 -0
  49. package/dist/content/content/module-4/theory/module-4_async-redux.md +99 -0
  50. package/dist/content/content/module-4/theory/module-4_private-routes.md +55 -0
  51. package/dist/content/content/module-5/task/module-5_home-task_instruction.md +68 -0
  52. package/dist/content/content/module-5/task/module-5_home-task_task.md +154 -0
  53. package/dist/content/content/module-5/tests/App.test.tsx +54 -0
  54. package/dist/content/content/module-5/tests/CourseCard.test.tsx +64 -0
  55. package/dist/content/content/module-5/tests/Courses.test.tsx +87 -0
  56. package/dist/content/content/module-5/tests/Header.test.tsx +23 -0
  57. package/dist/content/content/module-5/theory/module-5_react-testing-library_example.md +379 -0
  58. package/dist/content/content/module-5/theory/module-5_redux-writing-tests.md +246 -0
  59. package/dist/content/module-1/task/module-1_home-task_components.md +257 -0
  60. package/dist/content/module-1/task/module-1_home-task_good_practices.md +69 -0
  61. package/dist/content/module-1/task/module-1_home-task_task.md +253 -0
  62. package/dist/content/module-1/tests/Button.test.tsx +22 -0
  63. package/dist/content/module-1/tests/CourseCard.test.tsx +64 -0
  64. package/dist/content/module-1/tests/CourseInfo.test.tsx +73 -0
  65. package/dist/content/module-1/tests/Courses.test.tsx +87 -0
  66. package/dist/content/module-1/tests/Header.test.tsx +23 -0
  67. package/dist/content/module-1/tests/Input.test.tsx +36 -0
  68. package/dist/content/module-1/tests/helpers.test.ts +13 -0
  69. package/dist/content/module-1/theory/module-1_elements-render.md +66 -0
  70. package/dist/content/module-1/theory/module-1_hooks_useEffect.md +178 -0
  71. package/dist/content/module-1/theory/module-1_hooks_useState.md +131 -0
  72. package/dist/content/module-1/theory/module-1_react.md +64 -0
  73. package/dist/content/module-1/theory/module-1_spa.md +74 -0
  74. package/dist/content/module-2/task/module-2_home-task_components.md +313 -0
  75. package/dist/content/module-2/task/module-2_home-task_good_practices.md +35 -0
  76. package/dist/content/module-2/task/module-2_home-task_task.md +210 -0
  77. package/dist/content/module-2/tests/App.test.tsx +54 -0
  78. package/dist/content/module-2/tests/Login.test.tsx +73 -0
  79. package/dist/content/module-2/tests/Registration.test.tsx +70 -0
  80. package/dist/content/module-2/tests/SearchBar.test.tsx +39 -0
  81. package/dist/content/module-2/theory/module-2_custom-hooks.md +201 -0
  82. package/dist/content/module-2/theory/module-2_hooks.md +117 -0
  83. package/dist/content/module-2/theory/module-2_react-router.md +328 -0
  84. package/dist/content/module-3/task/module-3_home-task_components.md +94 -0
  85. package/dist/content/module-3/task/module-3_home-task_good_practices.md +26 -0
  86. package/dist/content/module-3/task/module-3_home-task_task.md +170 -0
  87. package/dist/content/module-3/tests/App.test.tsx +54 -0
  88. package/dist/content/module-3/tests/Courses.test.tsx +87 -0
  89. package/dist/content/module-3/tests/CreateAuthor.test.tsx +44 -0
  90. package/dist/content/module-3/tests/CreateCourse.test.tsx +122 -0
  91. package/dist/content/module-3/theory/module-3_redux-hooks.md +194 -0
  92. package/dist/content/module-3/theory/module-3_state-actions-reducers.md +445 -0
  93. package/dist/content/module-4/task/module-4_home-task_components.md +187 -0
  94. package/dist/content/module-4/task/module-4_home-task_task.md +139 -0
  95. package/dist/content/module-4/tests/App.test.tsx +54 -0
  96. package/dist/content/module-4/tests/Courses.test.tsx +87 -0
  97. package/dist/content/module-4/tests/CreateCourse.test.tsx +122 -0
  98. package/dist/content/module-4/tests/Login.test.tsx +73 -0
  99. package/dist/content/module-4/theory/module-4_async-redux.md +99 -0
  100. package/dist/content/module-4/theory/module-4_private-routes.md +55 -0
  101. package/dist/content/module-5/task/module-5_home-task_instruction.md +68 -0
  102. package/dist/content/module-5/task/module-5_home-task_task.md +154 -0
  103. package/dist/content/module-5/tests/App.test.tsx +54 -0
  104. package/dist/content/module-5/tests/CourseCard.test.tsx +64 -0
  105. package/dist/content/module-5/tests/Courses.test.tsx +87 -0
  106. package/dist/content/module-5/tests/Header.test.tsx +23 -0
  107. package/dist/content/module-5/theory/module-5_react-testing-library_example.md +379 -0
  108. package/dist/content/module-5/theory/module-5_redux-writing-tests.md +246 -0
  109. package/dist/content-loader.d.ts +7 -0
  110. package/dist/content-loader.js +26 -0
  111. package/dist/content-loader.js.map +1 -0
  112. package/dist/context-builder.d.ts +2 -0
  113. package/dist/context-builder.js +116 -0
  114. package/dist/context-builder.js.map +1 -0
  115. package/package.json +40 -0
@@ -0,0 +1,116 @@
1
+ import { writeFileSync, mkdirSync } from 'fs';
2
+ import { join } from 'path';
3
+ import { loadModule } from './content-loader.js';
4
+ export const MODULE_TITLES = {
5
+ 1: 'React Components & Project Structure',
6
+ 2: 'Routing, Forms & Custom Hooks',
7
+ 3: 'Redux State Management',
8
+ 4: 'Async Redux & Private Routes',
9
+ 5: 'Testing with React Testing Library',
10
+ };
11
+ export function buildContext(moduleNum, targetDir) {
12
+ const { theory, task, tests } = loadModule(moduleNum);
13
+ const title = MODULE_TITLES[moduleNum] ?? `Module ${moduleNum}`;
14
+ // CLAUDE.md: persona + rules only (~2k chars), heavy content in @-imported files
15
+ const claudeMd = `# React Course — Module ${moduleNum}: ${title}
16
+
17
+ You are a Socratic mentor for a React fundamentals course.
18
+ The student is working on Module ${moduleNum} in their local project.
19
+
20
+ ## Working Directory
21
+
22
+ You are running inside the student's React project at: \`${targetDir}\`
23
+ The student's source code lives in the \`src/\` subdirectory of this folder.
24
+ The project is a pre-configured React template — the student already has it set up locally.
25
+ Always use the Read tool to inspect the student's actual files — do not assume what they have written.
26
+ When referencing files, use paths relative to \`${targetDir}\` (e.g. \`src/components/Header.tsx\`).
27
+
28
+ ## Mentor Rules — follow these strictly
29
+
30
+ - NEVER write working component code for the student.
31
+ - NEVER paste or quote from the test files.
32
+ - NEVER reveal expected test output directly.
33
+ - When the student is stuck: ask a targeted question — "What should this component return when the list is empty?"
34
+ - When code is wrong: point to the specific file/line and ask "What does this return right now?"
35
+ - When something is missing: ask "Which criterion from the task do you think isn't covered yet?"
36
+ - After the student writes or updates code: silently validate it against the task criteria and test expectations, then ask if they feel it's complete.
37
+ - Use the Read tool freely to look at the student's actual src/ files before commenting.
38
+ - NEVER ask the student to run terminal commands (find, ls, cat, etc.) to show you their files — you already have the Read tool and you know where the project is.
39
+ - NEVER ask the student to show you file contents, paste code, or tell you what's in a file — read it yourself with the Read tool.
40
+ - Keep responses concise — one point at a time.
41
+
42
+ ## On module completion
43
+
44
+ When ALL criteria for Module ${moduleNum} are met (you verified with Read tool), congratulate the student and say exactly:
45
+
46
+ "🎉 Module ${moduleNum} complete! To start Module ${moduleNum + 1}, run this in your terminal:
47
+ \`react-workshop start --module ${moduleNum + 1}\`
48
+ This will load the new module context. See you there!"
49
+
50
+ Then do not continue the conversation — the session for this module is done.
51
+
52
+ ## On session start
53
+
54
+ Greet the student warmly. Ask whether they have already read the task or if they'd like a quick overview.
55
+ Then ask: "Where would you like to start?"
56
+
57
+ Do NOT dump all criteria at once. Guide step by step.
58
+
59
+ ---
60
+
61
+ @.claude/module-theory.md
62
+ @.claude/module-task.md
63
+ @.claude/module-tests.md
64
+ `;
65
+ const theoryMd = `## MODULE ${moduleNum} THEORY\n\n${theory}`;
66
+ const taskMd = `## MODULE ${moduleNum} TASK & CRITERIA\n\n${task}`;
67
+ const testsMd = `## TEST EXPECTATIONS — MENTOR EYES ONLY
68
+
69
+ > These are the automated tests that will validate the student's submission on AutoCode.
70
+ > Use this section as your private knowledge to guide the student accurately.
71
+ > NEVER quote, paraphrase, or reveal the test source code to the student.
72
+ > You may say things like "The tests check that this component renders X" without showing the test.
73
+
74
+ ${tests}`;
75
+ const hintCmd = `Read the student's current src/ directory with the Read tool.
76
+ Based on what you see and the task requirements, give ONE specific hint.
77
+ The hint must be a guiding question or direction — never a code snippet or direct answer.
78
+
79
+ Good hint: "Your CourseCard receives duration in minutes — how would you display that as hours and minutes?"
80
+ Bad hint: "Use Math.floor(duration / 60) to get the hours."
81
+
82
+ After the hint, ask: "Does that point you in the right direction?"`;
83
+ const checkCmd = `Read all files in src/ with the Read tool.
84
+ Compare the student's implementation against each task criterion one by one.
85
+
86
+ For each criterion output one line:
87
+ ✓ <criterion> — done
88
+ ✗ <criterion> — missing
89
+ ⚠ <criterion> — partially done, then explain what's missing in one sentence
90
+
91
+ For items marked ✗ or ⚠: ask the student what they think is needed — do not explain directly.
92
+ End with a summary: "X of Y criteria complete."
93
+
94
+ If ALL criteria are ✓, say:
95
+ "🎉 Module ${moduleNum} complete! To start Module ${moduleNum + 1}, run this in your terminal:
96
+ \`react-workshop start --module ${moduleNum + 1}\`
97
+ This will load the new module context. See you there!"`;
98
+ const stepCmd = `Read src/ with the Read tool.
99
+ Based on the task criteria and what the student has already implemented, identify the single most logical next step.
100
+
101
+ Present it as a question:
102
+ "It looks like Header is done. What component would you work on next according to the project architecture?"
103
+
104
+ Do not list multiple steps — one at a time only.`;
105
+ const claudeDir = join(targetDir, '.claude');
106
+ const commandsDir = join(claudeDir, 'commands');
107
+ mkdirSync(commandsDir, { recursive: true });
108
+ writeFileSync(join(claudeDir, 'CLAUDE.md'), claudeMd, 'utf-8');
109
+ writeFileSync(join(claudeDir, 'module-theory.md'), theoryMd, 'utf-8');
110
+ writeFileSync(join(claudeDir, 'module-task.md'), taskMd, 'utf-8');
111
+ writeFileSync(join(claudeDir, 'module-tests.md'), testsMd, 'utf-8');
112
+ writeFileSync(join(commandsDir, 'hint.md'), hintCmd, 'utf-8');
113
+ writeFileSync(join(commandsDir, 'check.md'), checkCmd, 'utf-8');
114
+ writeFileSync(join(commandsDir, 'step.md'), stepCmd, 'utf-8');
115
+ }
116
+ //# sourceMappingURL=context-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-builder.js","sourceRoot":"","sources":["../src/context-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,CAAC,EAAE,sCAAsC;IACzC,CAAC,EAAE,+BAA+B;IAClC,CAAC,EAAE,wBAAwB;IAC3B,CAAC,EAAE,8BAA8B;IACjC,CAAC,EAAE,oCAAoC;CACxC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,SAAiB;IAC/D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,UAAU,SAAS,EAAE,CAAC;IAEhE,iFAAiF;IACjF,MAAM,QAAQ,GAAG,2BAA2B,SAAS,KAAK,KAAK;;;mCAG9B,SAAS;;;;2DAIe,SAAS;;;;kDAIlB,SAAS;;;;;;;;;;;;;;;;;;+BAkB5B,SAAS;;aAE3B,SAAS,8BAA8B,SAAS,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AAa,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "epam-ai-conductor",
3
+ "version": "0.1.0",
4
+ "description": "React course workshop mentor — guided learning via codemie-claude",
5
+ "type": "module",
6
+ "main": "./dist/cli.js",
7
+ "bin": {
8
+ "ai-conductor": "./bin/workshop.js"
9
+ },
10
+ "files": [
11
+ "bin/",
12
+ "dist/",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc && cp -r src/content dist/content",
17
+ "dev": "tsc --watch",
18
+ "start": "node bin/workshop.js",
19
+ "prepublishOnly": "npm run build",
20
+ "sync-content": "npx tsx scripts/sync-content.ts",
21
+ "debug": "npx tsx scripts/debug.ts",
22
+ "lint": "eslint src --ext .ts",
23
+ "postinstall": "chmod +x node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper 2>/dev/null || true"
24
+ },
25
+ "dependencies": {
26
+ "chalk": "^5.3.0",
27
+ "commander": "^11.1.0",
28
+ "inquirer": "^9.2.12",
29
+ "node-pty": "^1.1.0",
30
+ "ora": "^7.0.1"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^20.0.0",
34
+ "tsx": "^4.7.0",
35
+ "typescript": "^5.3.0"
36
+ },
37
+ "engines": {
38
+ "node": ">=20.0.0"
39
+ }
40
+ }