fito-tui 0.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.
Files changed (179) hide show
  1. package/README.md +88 -0
  2. package/agents/fito-case-source-planner.md +265 -0
  3. package/agents/fito-performance-reviewer.md +231 -0
  4. package/agents/fito-practice-concept-content-generator.md +318 -0
  5. package/agents/fito-practice-concept-identifier.md +482 -0
  6. package/agents/fito-practice-execution-fact-content-generator.md +299 -0
  7. package/agents/fito-practice-execution-fact-identifier.md +367 -0
  8. package/agents/fito-practice-usage-scenario-content-generator.md +331 -0
  9. package/agents/fito-practice-usage-scenario-identifier.md +397 -0
  10. package/agents/fito-subagent-selftest.md +27 -0
  11. package/agents/fito-technology-generator.md +207 -0
  12. package/agents/fito-tool-concept-content-generator.md +282 -0
  13. package/agents/fito-tool-concept-identifier.md +384 -0
  14. package/agents/fito-tool-execution-fact-content-generator.md +382 -0
  15. package/agents/fito-tool-execution-fact-identifier.md +360 -0
  16. package/agents/fito-tool-usage-scenario-content-generator.md +381 -0
  17. package/agents/fito-tool-usage-scenario-identifier.md +432 -0
  18. package/agents/fito-tutor.md +185 -0
  19. package/extensions/fito-delegate.js +539 -0
  20. package/extensions/fito-delegate.ts +691 -0
  21. package/extensions/fito-fetch-tools.js +380 -0
  22. package/extensions/fito-fetch-tools.ts +419 -0
  23. package/extensions/fito-startup.js +166 -0
  24. package/extensions/fito-startup.ts +188 -0
  25. package/package.json +56 -0
  26. package/prompts/fito-auth-refresh.md +15 -0
  27. package/prompts/fito-case-design.md +506 -0
  28. package/prompts/fito-case-edit.md +91 -0
  29. package/prompts/fito-case-generate.md +222 -0
  30. package/prompts/fito-case-open.md +124 -0
  31. package/prompts/fito-case-plan-source.md +114 -0
  32. package/prompts/fito-create-or-update-competence.md +261 -0
  33. package/prompts/fito-create-or-update-technology.md +199 -0
  34. package/prompts/fito-delete-competence.md +147 -0
  35. package/prompts/fito-evaluate.md +148 -0
  36. package/prompts/fito-fetch-urls-content.md +35 -0
  37. package/prompts/fito-generate-domain-concepts.md +85 -0
  38. package/prompts/fito-generate-execution-facts.md +85 -0
  39. package/prompts/fito-generate-usage-scenarios.md +85 -0
  40. package/prompts/fito-identify-domain-concepts.md +49 -0
  41. package/prompts/fito-identify-execution-facts.md +49 -0
  42. package/prompts/fito-identify-usage-scenarios.md +49 -0
  43. package/prompts/fito-login.md +21 -0
  44. package/prompts/fito-logout.md +14 -0
  45. package/prompts/fito-publish-case.md +266 -0
  46. package/prompts/fito-push-knowledge.md +84 -0
  47. package/prompts/fito-submit.md +208 -0
  48. package/prompts/fito-tutor.md +120 -0
  49. package/shared/case-briefing/briefing.js +221 -0
  50. package/shared/case-briefing/briefing.ts +261 -0
  51. package/shared/case-quiz/scoring.js +16 -0
  52. package/shared/case-quiz/scoring.ts +61 -0
  53. package/shared/case-validation/case-loader.js +88 -0
  54. package/shared/case-validation/case-loader.ts +106 -0
  55. package/shared/case-validation/case-schema.js +716 -0
  56. package/shared/case-validation/case-schema.ts +895 -0
  57. package/shared/competences/competence-list.js +29 -0
  58. package/shared/competences/competence-list.ts +32 -0
  59. package/shared/fito-api/README.md +192 -0
  60. package/shared/fito-api/client.js +731 -0
  61. package/shared/fito-api/client.ts +1426 -0
  62. package/shared/fito-session/credentials.js +79 -0
  63. package/shared/fito-session/credentials.ts +88 -0
  64. package/shared/fito-session/session.js +16 -0
  65. package/shared/fito-session/session.ts +35 -0
  66. package/shared/github-url/parse.js +26 -0
  67. package/shared/github-url/parse.ts +35 -0
  68. package/shared/knowledge-components/component-names.js +35 -0
  69. package/shared/knowledge-components/component-names.ts +39 -0
  70. package/shared/knowledge-components/knowledge-fetch.js +46 -0
  71. package/shared/knowledge-components/knowledge-fetch.ts +57 -0
  72. package/shared/knowledge-components/knowledge-search.js +101 -0
  73. package/shared/knowledge-components/knowledge-search.ts +144 -0
  74. package/shared/knowledge-components/push-payload.js +104 -0
  75. package/shared/knowledge-components/push-payload.ts +129 -0
  76. package/shared/knowledge-components/reference.js +24 -0
  77. package/shared/knowledge-components/reference.ts +43 -0
  78. package/shared/knowledge-components/technology-fetch.js +30 -0
  79. package/shared/knowledge-components/technology-fetch.ts +38 -0
  80. package/shared/shell-exec/exec.js +22 -0
  81. package/shared/shell-exec/exec.ts +46 -0
  82. package/skills/fito-auth/SKILL.md +68 -0
  83. package/skills/fito-auth/auth-refresh.js +23 -0
  84. package/skills/fito-auth/auth-refresh.ts +25 -0
  85. package/skills/fito-auth/browser.js +35 -0
  86. package/skills/fito-auth/browser.ts +57 -0
  87. package/skills/fito-auth/callback-server.js +152 -0
  88. package/skills/fito-auth/callback-server.ts +189 -0
  89. package/skills/fito-auth/login.js +37 -0
  90. package/skills/fito-auth/login.ts +42 -0
  91. package/skills/fito-auth/logout.js +24 -0
  92. package/skills/fito-auth/logout.ts +25 -0
  93. package/skills/fito-case-author/SKILL.md +179 -0
  94. package/skills/fito-case-author/checkout.js +222 -0
  95. package/skills/fito-case-author/checkout.ts +281 -0
  96. package/skills/fito-case-author/github-publish.js +218 -0
  97. package/skills/fito-case-author/github-publish.ts +251 -0
  98. package/skills/fito-case-author/publish-payload.js +108 -0
  99. package/skills/fito-case-author/publish-payload.ts +186 -0
  100. package/skills/fito-case-author/publish-state.js +72 -0
  101. package/skills/fito-case-author/publish-state.ts +87 -0
  102. package/skills/fito-case-author/publish-version.js +364 -0
  103. package/skills/fito-case-author/publish-version.ts +495 -0
  104. package/skills/fito-case-author/publish.js +284 -0
  105. package/skills/fito-case-author/publish.ts +394 -0
  106. package/skills/fito-case-author/semver.js +55 -0
  107. package/skills/fito-case-author/semver.ts +63 -0
  108. package/skills/fito-case-author/status-gate.js +34 -0
  109. package/skills/fito-case-author/status-gate.ts +54 -0
  110. package/skills/fito-case-author/validate.js +62 -0
  111. package/skills/fito-case-author/validate.ts +64 -0
  112. package/skills/fito-case-runner/SKILL.md +119 -0
  113. package/skills/fito-case-runner/case-component-names.js +45 -0
  114. package/skills/fito-case-runner/case-component-names.ts +65 -0
  115. package/skills/fito-case-runner/case-detail.js +20 -0
  116. package/skills/fito-case-runner/case-detail.ts +20 -0
  117. package/skills/fito-case-runner/github.js +234 -0
  118. package/skills/fito-case-runner/github.ts +287 -0
  119. package/skills/fito-case-runner/manifest.js +56 -0
  120. package/skills/fito-case-runner/manifest.ts +73 -0
  121. package/skills/fito-case-runner/open.js +175 -0
  122. package/skills/fito-case-runner/open.ts +241 -0
  123. package/skills/fito-case-runner/report.js +22 -0
  124. package/skills/fito-case-runner/report.ts +24 -0
  125. package/skills/fito-case-runner/runner.js +158 -0
  126. package/skills/fito-case-runner/runner.ts +304 -0
  127. package/skills/fito-case-runner/score-quiz-mc.js +85 -0
  128. package/skills/fito-case-runner/score-quiz-mc.ts +99 -0
  129. package/skills/fito-case-runner/submit-evaluation.js +73 -0
  130. package/skills/fito-case-runner/submit-evaluation.ts +98 -0
  131. package/skills/fito-case-runner/submit-quiz-result.js +75 -0
  132. package/skills/fito-case-runner/submit-quiz-result.ts +100 -0
  133. package/skills/fito-case-runner/submit.js +85 -0
  134. package/skills/fito-case-runner/submit.ts +111 -0
  135. package/skills/fito-case-runner/workdir.js +10 -0
  136. package/skills/fito-case-runner/workdir.ts +11 -0
  137. package/skills/fito-competence-write/SKILL.md +155 -0
  138. package/skills/fito-competence-write/create.js +64 -0
  139. package/skills/fito-competence-write/create.ts +80 -0
  140. package/skills/fito-competence-write/delete.js +136 -0
  141. package/skills/fito-competence-write/delete.ts +166 -0
  142. package/skills/fito-competence-write/display.js +20 -0
  143. package/skills/fito-competence-write/display.ts +21 -0
  144. package/skills/fito-competence-write/payload.js +96 -0
  145. package/skills/fito-competence-write/payload.ts +115 -0
  146. package/skills/fito-competence-write/update.js +155 -0
  147. package/skills/fito-competence-write/update.ts +206 -0
  148. package/skills/fito-evaluator/SKILL.md +73 -0
  149. package/skills/fito-evaluator/criterion-exec.js +64 -0
  150. package/skills/fito-evaluator/criterion-exec.ts +73 -0
  151. package/skills/fito-evaluator/evaluate-automated.js +57 -0
  152. package/skills/fito-evaluator/evaluate-automated.ts +84 -0
  153. package/skills/fito-evaluator/evaluate.js +28 -0
  154. package/skills/fito-evaluator/evaluate.ts +86 -0
  155. package/skills/fito-evaluator/report.js +112 -0
  156. package/skills/fito-evaluator/report.ts +128 -0
  157. package/skills/fito-evaluator/rubric.js +90 -0
  158. package/skills/fito-evaluator/rubric.ts +170 -0
  159. package/skills/fito-knowledge-push/SKILL.md +114 -0
  160. package/skills/fito-knowledge-push/push.js +282 -0
  161. package/skills/fito-knowledge-push/push.ts +360 -0
  162. package/skills/fito-source-ingestion/SKILL.md +77 -0
  163. package/skills/fito-source-ingestion/authoring-check.js +128 -0
  164. package/skills/fito-source-ingestion/authoring-check.ts +155 -0
  165. package/skills/fito-source-ingestion/bundle.js +198 -0
  166. package/skills/fito-source-ingestion/bundle.ts +246 -0
  167. package/skills/fito-technology-write/SKILL.md +108 -0
  168. package/skills/fito-technology-write/create.js +134 -0
  169. package/skills/fito-technology-write/create.ts +161 -0
  170. package/skills/fito-technology-write/payload.js +64 -0
  171. package/skills/fito-technology-write/payload.ts +70 -0
  172. package/skills/fito-technology-write/update.js +122 -0
  173. package/skills/fito-technology-write/update.ts +171 -0
  174. package/skills/fito-url-content-fetcher/SKILL.md +213 -0
  175. package/templates/concept-practice-content-template.md +281 -0
  176. package/templates/concept-tool-content-template.md +207 -0
  177. package/templates/execution-fact-practice-content-template.md +372 -0
  178. package/templates/execution-fact-tool-content-template.md +307 -0
  179. package/templates/usage-scenario-content-template.md +248 -0
@@ -0,0 +1,222 @@
1
+ ---
2
+ description: Generate a Fito case — turn a case proposal into the validated `.case/` contract in a local working directory
3
+ argument-hint: '[<proposal-path>] [--dir <path>]'
4
+ ---
5
+ The author wants to generate a Fito case — the GENERATE step of case authoring:
6
+ consume the case proposal `/fito-case-design` produced, write the `.case/`
7
+ artifacts into a local working directory, and validate them with the structural
8
+ validator. Drive the whole flow below on this session — a knowledgeable peer
9
+ building the case contract with the author. Two boundaries hold throughout:
10
+ **write only inside the working directory** — on a reused project, `.case/` is
11
+ yours and the project's source files are not — and **never push anywhere**:
12
+ publishing is `/fito-publish-case`'s job. The starter source code is not
13
+ generated here either — it is built outside Fito, guided by
14
+ `/fito-case-plan-source`.
15
+
16
+ Parse `$ARGUMENTS`:
17
+
18
+ - **proposal-path** (optional): the leading free text — the case proposal file.
19
+ Defaults to `./case-proposal.md`
20
+ - **--dir <path>** (optional): the case working directory the artifacts land in
21
+
22
+ ## 1. Read the proposal and settle the working directory
23
+
24
+ If the proposal file doesn't exist, stop and point the author at
25
+ `/fito-case-design` — this flow starts from its output, never from scratch.
26
+ Read it and check it carries the Parameters, Learning objectives, Prerequisites,
27
+ and Rubric-criteria YAML blocks (quiz and Source grounding are optional); if a
28
+ required block is missing, ask the author to finish the design step first.
29
+
30
+ Then settle the working directory and the run's **mode**:
31
+
32
+ - **Re-validate** — the working directory already contains `.case/`: skip
33
+ straight to step 5. This is the re-entry after the outside-Fito source work,
34
+ giving the finished tree its fresh attestation.
35
+ - **Reuse** — `--dir` (or, by default, the project path in the proposal's
36
+ Source grounding section) names an existing project tree: `.case/` is
37
+ generated into it, shaped by what the project contains, and the project keeps
38
+ its existing repo and history.
39
+ - **Greenfield** — no existing tree: the directory is created fresh and
40
+ git-initialized. If no `--dir` was given, ask the author where the case
41
+ should live.
42
+
43
+ **Done when** the mode is named and both the proposal and the working directory
44
+ are resolved.
45
+
46
+ ## 2. Confirm before writing
47
+
48
+ Present the plan in one compact block: working title, case type, estimated
49
+ duration, working directory, and mode. Resolve two things with the author
50
+ before any file is written:
51
+
52
+ - **Authors** for the manifest — propose `git config user.name` /
53
+ `user.email`, and let the author correct them.
54
+ - Any **Open questions** the proposal carries — they were left for exactly
55
+ this moment; don't silently pick answers.
56
+
57
+ **Done when** the author confirms the plan.
58
+
59
+ ## 3. Generate the `.case/` artifacts
60
+
61
+ Write the complete contract — every file below is required by the validator
62
+ unless marked optional:
63
+
64
+ - `manifest.yaml` — `title` and `type` from the proposal; `version: "1.0.0"`;
65
+ `status: draft`; `estimated_duration_minutes`, `language`, and `tags` from
66
+ the Parameters block; the confirmed `authors`; and the submission block —
67
+ `method: pull_request`, `target_branch: v1.0.0`, `student_branch: solution`.
68
+ - `learning_objectives.yaml` — the proposal's Learning objectives block as-is.
69
+ - `prerequisites.yaml` — the proposal's Prerequisites block; each entry gains
70
+ the `mandatory:` flag (`true` unless the author says otherwise).
71
+ - `rubric.yaml` — the proposal's criteria with each `levels_sketch` expanded
72
+ into full `levels` (scores 0–3, each with a `label` and a substantive
73
+ `description`). The four levels are a **quality ladder at one depth** — the
74
+ criterion's `bloom_level` — and each judges the learner from that level's
75
+ perspective: `not_achieved` not met, `partial` partly met, `achieved` met,
76
+ `exemplary` met well. They never climb from one Bloom level to the next.
77
+ `achieved` defines the award — a score of 2 or 3 records the criterion's
78
+ `bloom_level`, and 0 or 1 records `NOT_ACHIEVED` — so expand it with the
79
+ most care. Weights must sum to exactly 100; each `evaluation_method`
80
+ completed — `automated` needs `command` + `passing_condition` (real gate
81
+ commands from the proposal, never guessed), `ai` needs a `prompt_hint`. On
82
+ greenfield, where no source tree exists yet, derive the `automated` command
83
+ from the proposal's `toolchain` block (e.g. a `gradle` toolchain →
84
+ `./gradlew test`), noting it is verified against the built tree at the
85
+ post-source re-generate.
86
+ - `quiz.yaml` (optional) — only when the proposal has quiz items: give each
87
+ question an `id`; `multiple_choice` gets `choices` and a single `answer`
88
+ choice id; `short_answer`/`code_snippet` get an `evaluation` (`ai` or
89
+ `human`).
90
+ - `situation/situation.yaml` + `situation/01_intro.md` — the narrative the
91
+ learner lands in, authored from the proposal's Scope; add further documents
92
+ (ticket, email, log output…) when the scope calls for them, each listed in
93
+ `situation.yaml` with its `format`.
94
+ - `task/objective.md` — the single goal statement; `task/deliverables.yaml` —
95
+ the expected outputs; `task/constraints.md` (optional) — rules the learner
96
+ must follow; `task/steps.md` — tutorial cases only.
97
+ - `starter_state/description.md` + `starter_state/known_state.yaml` — the
98
+ starting condition. Before the source work exists, `known_state.yaml` states
99
+ the *contract that work must realize* (which tests must fail, which errors
100
+ must show), not an observation. Its fields are observable checks only
101
+ (`failing_tests`, `known_errors`, `build_status`, …); it carries no `branch`
102
+ field — `.case/` describes the case on every ref, so a branch value can
103
+ never be branch-correct (SPEC deviation #5).
104
+ - `solution/notes.md` — the evaluator-only rationale: the intended approach
105
+ and what each rubric criterion should see; refined again after the source
106
+ work. `solution/notes-template.md` — the blank authoring scaffold of the
107
+ same sections.
108
+ - `solution.yaml` — `branch: case/solution-v1.0.0`, `visibility`
109
+ (`post_completion` unless the author chooses otherwise), and a short `notes`
110
+ string.
111
+ - `artifacts.yaml` — on reuse, annotate the project's real files with roles
112
+ (`evidence` / `target` / `reference` / `scaffold` / `do-not-touch`); on
113
+ greenfield, an empty `artifacts:` list — it is finalized at the post-source
114
+ re-generate, not by `/fito-case-plan-source` (which writes only
115
+ `.authoring/`).
116
+
117
+ Four rules bind the content:
118
+
119
+ 1. **The case type binds the artifacts** — `diagnostic`: `known_state.yaml`
120
+ must carry `failing_tests` or `known_errors`; `implementation`:
121
+ `deliverables.yaml` must include a `code_change` entry; `tutorial`:
122
+ `task/steps.md` is mandatory and `failing_tests` must not appear.
123
+ 2. **Never invent component ids.** Every `knowledge_component` comes from the
124
+ proposal — they are already fetch-verified by `/fito-case-design`.
125
+ **Version-scope every grounding `fito_knowledge_fetch` this flow issues** —
126
+ pass the declared version from the proposal's `technologies` `{slug, version}`
127
+ pairs, so a component live only for another major line reads as missing. In
128
+ practice the only fetch here is a mid-flow addition: if the author wants a
129
+ component added, probe it with the `fito_knowledge_fetch` tool first, passing
130
+ the declared version for that component's technology, so the probe is
131
+ version-scoped exactly as the design step; only a fetch-verified id may enter
132
+ the files. Bloom levels come only from `KNOWLEDGE`, `COMPREHENSION`,
133
+ `APPLICATION`.
134
+ 3. **Learner-facing prose carries the case fiction** — situation documents
135
+ read like the ticket/email/log they claim to be; evaluator-only rationale
136
+ stays under `solution/`.
137
+ 4. **Every description names the topic, never the move** — a readable file
138
+ may state what is broken and what the goal is; the move that repairs it
139
+ stays under `solution/`. Apply one test to each description: *could a
140
+ learner who read only this description, and nothing else from the case,
141
+ apply the fix?* If yes, rewrite it. It binds both halves of this step: the
142
+ `learning_objectives.yaml` and `prerequisites.yaml` descriptions **copied
143
+ from the proposal** — repair a violating one here, with the author,
144
+ rather than passing it through — and the `artifacts.yaml`,
145
+ `task/deliverables.yaml` and `task/constraints.md` prose this flow
146
+ authors itself, where naming the defect's location or the technique that
147
+ repairs it is the same leak. `tutorial` cases are the exception: their
148
+ `task/steps.md` *is* the method.
149
+
150
+ Then present the contract for the author's review — a **digest**, not a file
151
+ dump: type and duration, the learning objectives and prerequisites (ids + Bloom
152
+ levels), each rubric criterion with its weight and evaluation method, the
153
+ situation documents, whether a quiz rides along, and the **optional fields the
154
+ contract leaves empty**. Run step 5's validator command now and read that last
155
+ item from its `optionalFieldsNotUsed`, rather than judging emptiness by eye —
156
+ an optional field is the one thing the validator can never reject, so it stays
157
+ invisible unless the run reports it. **A failing run reports no inventory at
158
+ all**: apply step 5's failure loop here until the tree passes, so the digest
159
+ describes a valid contract and step 4 never commits a broken tree. Each unused
160
+ field is legal and often right; naming them here is what lets the author fill
161
+ one, or leave it, while the tree is still uncommitted. Walk through any file
162
+ the author asks to see, and iterate on their feedback **before anything is
163
+ committed** — the author owns every value in the contract.
164
+
165
+ **Done when** every file above exists in `.case/` (plus `quiz.yaml` exactly
166
+ when the proposal has quiz items), the four rules hold, the validator exits 0
167
+ on the tree, and the author has reviewed the digest — unused optional fields
168
+ included — and confirmed the contract.
169
+
170
+ ## 4. Put the working directory on git
171
+
172
+ - **Greenfield**: `git init` with `main` as the initial branch, then commit the
173
+ `.case/` artifacts — the branch `/fito-publish-case` will later push.
174
+ - **Reuse**: the project keeps its existing repo and history. Confirm with the
175
+ author, then commit the new `.case/` on the current branch.
176
+
177
+ **Done when** the artifacts are committed (or the author declined the reuse
178
+ commit — note it and continue).
179
+
180
+ ## 5. Validate and iterate
181
+
182
+ Use the `fito-case-author` skill (read its `SKILL.md`), then run:
183
+
184
+ ```bash
185
+ node <fito-case-author skill dir>/validate.js <working-dir>
186
+ ```
187
+
188
+ - **Failure (exit 1)** — relay the errors **verbatim**, grouped by file —
189
+ never paraphrase or collapse them; the error text is the author's debugging
190
+ interface. Each error carries a **`path`** as well as a `message`: relay both,
191
+ because a message alone can read `Invalid input: expected string, received
192
+ undefined`, which names no field. Fix the named artifacts and re-run.
193
+ **Never regenerate** the `.case/` tree over a fixable error; the loop is
194
+ edit → validate, not start over.
195
+ - **Success (exit 0)** — relay the structural attestation (validator + ruleset
196
+ versions) and the extracted `(componentId, bloomLevel)` reference set — the
197
+ pair `/fito-publish-case` forwards to the backend from the *last* run over
198
+ the finished tree. Relay **`optionalFieldsNotUsed`** with them: the optional
199
+ fields this case leaves empty, grouped by file. Nothing is wrong with them —
200
+ the author decides which to fill.
201
+
202
+ **Done when** a validator run exits 0 on the current state of the tree, and the
203
+ fixes that got it there are committed. The loop itself never commits, because
204
+ it runs from two places: entered from step 3 it is still pre-commit and step 4
205
+ commits its fixes with the rest, while entered here — on an already-committed
206
+ tree, which is every re-validate — its fixes need a commit of their own.
207
+
208
+ ## 6. Hand off
209
+
210
+ Close with the working directory path, the mode, and the attestation summary
211
+ (validator + ruleset versions, reference count). Make one expectation
212
+ explicit: a structural pass does not prove the referenced components exist —
213
+ reference existence is resolved by the backend at publish. Then the road
214
+ ahead:
215
+
216
+ 1. `/fito-case-plan-source` — produce the spec + plan for the case-project
217
+ source work
218
+ 2. build the starter source **outside Fito**, guided by those documents
219
+ 3. re-run `/fito-case-generate --dir <path>` over the finished tree — the
220
+ re-validate mode above — where `artifacts.yaml` is finalized against the
221
+ now-real tree and the fresh attestation is earned
222
+ 4. `/fito-publish-case` — push, register, and publish
@@ -0,0 +1,124 @@
1
+ ---
2
+ description: Open a Fito case — fork it, check it out, and get briefed on the situation and task
3
+ argument-hint: "<case-id>"
4
+ ---
5
+ The learner wants to open the Fito case `$1` and start working on it. Drive the
6
+ whole open-and-orient flow below.
7
+
8
+ If no case id was given, ask the learner for it first — it is the case's UUID,
9
+ the `<id>` from its `/cases/<id>` URL — and don't run anything until you have it.
10
+
11
+ ## 1. Open the case (fork → checkout → working branch)
12
+
13
+ Use the `fito-case-runner` skill (read its `SKILL.md`), then run:
14
+
15
+ ```bash
16
+ node <fito-case-runner skill dir>/open.js $1
17
+ ```
18
+
19
+ This forks the case repo to the learner's GitHub account, clones it into
20
+ `~/.fito/cases/$1/`, checks out the published version, **structurally
21
+ re-validates** the `.case/` checkout, and creates the working branch.
22
+
23
+ - Stream the output so the learner sees which GitHub account owns the fork (ask
24
+ them to confirm it is their Fito-linked account) and the checkout path.
25
+ - If it prints a "case source malformed" report (structural errors and **no**
26
+ branch created), **stop here — do not orient.** Show the errors and the report
27
+ affordance; suggest re-running `/fito-case-open $1` later or reporting the case.
28
+ - It refuses to overwrite a non-empty existing checkout. If the learner has
29
+ already opened this case, that is fine — point them at the existing
30
+ `~/.fito/cases/$1/` and `/fito-submit $1`, and skip to step 2.
31
+ - If it refuses because the case is **deprecated**, relay its message verbatim
32
+ and stop — do not orient, and never work around the refusal with raw git
33
+ commands.
34
+ - If it opens but prints a `⚠ This case has been deprecated…` warning, relay
35
+ the warning before the briefing and continue normally.
36
+ - If it stops because the learner's fork already carries this case's working
37
+ branch from a **previous attempt**, the resume-vs-start-over call is the
38
+ **learner's — never yours**. Relay the two options it prints — **resume**
39
+ keeps that attempt's commits and its open pull request; **start over**
40
+ deletes the fork's branch, closing that pull request and losing its unmerged
41
+ work — and wait for the learner to choose. Then re-run the exact `--resume`
42
+ or `--start-over` command it printed. Never reconcile the branches yourself
43
+ with raw git commands.
44
+ - If `gh` is missing or unauthenticated, relay its message: install `gh` and run
45
+ `gh auth login` with the Fito-linked GitHub account, then retry.
46
+
47
+ **Done when** it prints `Case opened at:` with the checkout path and `on branch
48
+ '<name>'` (or you confirmed an already-open checkout). On any non-zero exit, stop
49
+ here — do not orient.
50
+
51
+ ## 2. Brief the learner on the case
52
+
53
+ Read the case from `~/.fito/cases/$1/.case/` and orient the learner. **Never read
54
+ or reveal anything under `.case/solution/`** — those are evaluator-only rationale
55
+ notes; surfacing them would defeat the case. Read only the files named below.
56
+
57
+ Present, in this order:
58
+
59
+ 1. **Header** — from `.case/manifest.yaml`: the `title`, the `type`
60
+ (diagnostic / implementation / tutorial), and `estimated_duration_minutes`.
61
+ 2. **Situation** — read `.case/situation/situation.yaml` and present **every**
62
+ listed document **in its given order**, reading `.case/situation/<file>` and
63
+ heading it with the document's `title`. Frame each by its `format` so the
64
+ learner reads it in context — a `ticket`, an `email`, a `log_output`, a
65
+ `chat_thread`, a `pull_request_description`, or plain `prose`. Do not reorder
66
+ or skip any.
67
+ 3. **Task** — `.case/task/objective.md` (the single goal). Then, **if the file is
68
+ present**, `.case/task/constraints.md` (rules the learner must follow) and, for
69
+ `tutorial` cases, `.case/task/steps.md`. Then summarize
70
+ `.case/task/deliverables.yaml` — the expected outputs.
71
+ 4. **Artifacts** — point the learner at `.case/artifacts.yaml`, the annotated map
72
+ of relevant repo files (evidence / target / reference / scaffold). Call out the
73
+ `target` files they will most likely change.
74
+
75
+ Keep the briefing calm and precise — a knowledgeable peer handing off a case, not
76
+ a pitch.
77
+
78
+ **Done when** every situation document has been rendered in order and the header,
79
+ task (objective + any constraints/steps + deliverables), and key artifacts are
80
+ all surfaced.
81
+
82
+ ## 3. Ground the case in the knowledge vocabulary
83
+
84
+ Read `.case/learning_objectives.yaml` and `.case/prerequisites.yaml`. Collect
85
+ every `knowledge_component` ref across both, **dedupe** them, and call the
86
+ `fito_knowledge_fetch` tool **once per ref** to ground the briefing in the real
87
+ component rather than your own recollection. If a ref cannot be fetched (e.g. a
88
+ `404` for a component not yet in the vocabulary), note it briefly and continue
89
+ — do not abort the orientation. Summarize in two groups:
90
+
91
+ - **This case develops** — the refs from `learning_objectives.yaml`.
92
+ - **You should already know** — the refs from `prerequisites.yaml`.
93
+
94
+ **Done when** every deduped ref has been fetched (or noted as unavailable) and the
95
+ two-group summary is presented.
96
+
97
+ ## 4. Hand off
98
+
99
+ Tell the learner where their working tree is (`~/.fito/cases/$1/`) and which
100
+ branch they are on, that they make and commit their changes there, and that when
101
+ they are ready they submit with:
102
+
103
+ ```
104
+ /fito-submit $1
105
+ ```
106
+
107
+ Then tell them about the tutor, and tell them all four of these:
108
+
109
+ 1. `/fito-tutor` answers questions **about this case**;
110
+ 2. and about **the knowledge components** behind it;
111
+ 3. one question **or a sustained conversation**, running beside this briefing
112
+ rather than replacing it;
113
+ 4. **invoke it bare** — the case was opened in this session, so the tutor needs
114
+ no case id.
115
+
116
+ If the case includes a knowledge-check quiz (`.case/quiz.yaml`), it is administered
117
+ later, not here: `/fito-evaluate $1` runs it as a **local practice** (nothing
118
+ recorded), and `/fito-submit $1` runs it for real, recording the result alongside
119
+ the rubric.
120
+
121
+ **Done when** the learner knows where their tree is, which branch they are on,
122
+ how to submit — and **all four** of the tutor points above have reached them.
123
+ Count them before you finish: the tutor is how they get unstuck, and a point you
124
+ summarized away is a capability they will never use.
@@ -0,0 +1,114 @@
1
+ ---
2
+ description: Plan a Fito case's source — produce `.authoring/source-spec.md` + `source-plan.md` guiding the source work done outside Fito
3
+ argument-hint: '[<case-dir>] [--scenario reuse|greenfield] [--proposal <path>]'
4
+ ---
5
+ The author wants the spec + plan for their case-project source — the
6
+ PLAN-SOURCE step of case authoring, between `/fito-case-generate` (which
7
+ produced the `.case/` contract) and the source work itself, which happens
8
+ **outside Fito** with tooling of the author's choice. This flow produces the
9
+ two documents that guide that work — `.authoring/source-spec.md` (what the
10
+ source must be) and `.authoring/source-plan.md` (ordered, verifiable steps) —
11
+ covering both the starter state the learner receives and the solution branch
12
+ (`case/solution-vX.Y.Z`) the publish step later pushes. The documents are this
13
+ flow's **only writes** — never modify `.case/` or the project source — and
14
+ **never push anywhere**: publishing is `/fito-publish-case`'s job.
15
+
16
+ Parse `$ARGUMENTS`:
17
+
18
+ - **case-dir** (optional): the leading free text — the case working directory
19
+ `/fito-case-generate` produced. Defaults to `.`
20
+ - **--scenario reuse|greenfield** (optional): overrides the detection in
21
+ step 1 — `reuse` (an existing project becomes the case project) or
22
+ `greenfield` (the starter source is built from scratch)
23
+ - **--proposal <path>** (optional): the case proposal `/fito-case-design`
24
+ wrote. When omitted, step 1 looks for it
25
+
26
+ ## 1. Resolve the case and the scenario
27
+
28
+ The directory must contain `.case/` — this flow plans source for an existing
29
+ contract, never invents one. If it is missing, stop and point the author at
30
+ `/fito-case-generate` first.
31
+
32
+ Detect the scenario from source presence: **reuse** when the tree carries
33
+ project source beyond the case scaffolding (`.case/`, `.authoring/`, `.git`,
34
+ a `case-proposal.md`); **greenfield** when it does not. `--scenario`
35
+ overrides the detection. State what you detected and confirm with the author
36
+ before going on.
37
+
38
+ Find the proposal: the `--proposal` path, else `case-proposal.md` in the
39
+ case directory, else `./case-proposal.md` — where `/fito-case-design` writes
40
+ it by default. Name the file you found when you confirm the scenario. If
41
+ `--proposal` names a missing file, or neither default exists, ask the author
42
+ for the proposal's path; an author without one gives each technology's
43
+ declared major-line version and the toolchain instead.
44
+
45
+ If the documents already exist under `.authoring/`, this is a revision run:
46
+ say so and ask what should change — the feedback rides along in step 2; never
47
+ silently overwrite the author's reviewed documents.
48
+
49
+ **Done when** the author has confirmed the directory, the scenario, and the
50
+ proposal file — or the versions and toolchain that stand in for it.
51
+
52
+ ## 2. Delegate to the planner
53
+
54
+ Delegate to the `fito-case-source-planner` **subagent** via the
55
+ `fito_delegate` tool, handing it: the case working directory, the
56
+ scenario, the declared `{slug, version}` technology pairs and the
57
+ `toolchain` block from the proposal step 1 found (or the author's answers
58
+ in its place), and (on a revision run) the author's feedback. The pairs
59
+ **version-scope** the planner's knowledge fetches (each component reads
60
+ for the case's declared major line, not another); the toolchain grounds a
61
+ greenfield scaffold. The planner reads the `.case/` contract — the rubric
62
+ gates, `starter_state/known_state.yaml`, task, situation, `solution.yaml` —
63
+ skims the source on reuse, and writes the two documents into `.authoring/`.
64
+
65
+ This delegation blocks — you read the child's summary from the tool result.
66
+
67
+ Then check the tree, not the report — a worker's self-report is not ground
68
+ truth: both `.authoring/source-spec.md` and `.authoring/source-plan.md` must
69
+ exist in the case directory. If either is missing, re-delegate before any
70
+ review.
71
+
72
+ **Done when** both documents exist on disk and the worker's digest is in
73
+ hand.
74
+
75
+ ## 3. Review with the author
76
+
77
+ Relay the worker's **digest** — scenario, both terminal states, plan-step
78
+ count, gates covered, any contract conflict it surfaced, and its **toolchain
79
+ cross-check** section — not a file dump. Any mismatch there is **advisory** (a
80
+ declared toolchain contradicting a technology version's stated requirements,
81
+ e.g. Javalin 7 wanting Java 17+ against a Java 11 toolchain): surface it for
82
+ the author to reconcile the declaration — it is **not** a contract conflict, so
83
+ do not route it back to `.case/`. Walk through any document section the author asks to see, and iterate
84
+ on their feedback **before anything is committed**: hand focused revisions
85
+ back to the worker (step 2) until the author confirms the documents.
86
+
87
+ If the worker surfaced a **contract conflict** — a gate command the project's
88
+ build files don't declare, a named test path that cannot exist — the fix
89
+ belongs in `.case/`: re-enter `/fito-case-generate` to correct the contract,
90
+ then re-run this flow. Never plan around the contract.
91
+
92
+ **Done when** the author confirms the documents.
93
+
94
+ ## 4. Commit the documents
95
+
96
+ Stage **only `.authoring/`** and commit — **greenfield** on `main` (the
97
+ branch `/fito-case-generate` initialized), **reuse** on the current branch,
98
+ keeping the documents beside `.case/` on one line of history. Nothing else in
99
+ the tree is modified: if `git status` shows changes outside `.authoring/`,
100
+ stop and surface them instead of committing.
101
+
102
+ **Done when** the two documents are committed (or the author declined the
103
+ commit — note it and continue).
104
+
105
+ ## 5. Hand off
106
+
107
+ Close with the two file paths, the scenario, and the road ahead:
108
+
109
+ 1. execute `.authoring/source-plan.md` **outside Fito** — the author's own
110
+ harness and skills; the plan ends with every gate passing on the solution
111
+ branch and the starter contract realized on the starter branch
112
+ 2. re-run `/fito-case-generate --dir <path>` over the finished tree — its
113
+ re-validate mode — for the fresh attestation
114
+ 3. `/fito-publish-case` — push, register, and publish