@friedbotstudio/create-baseline 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 (197) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +222 -0
  3. package/bin/cli.js +247 -0
  4. package/obj/template/.claude/agents/swarm-worker.md +52 -0
  5. package/obj/template/.claude/bin/LICENSE +201 -0
  6. package/obj/template/.claude/bin/NOTICE +48 -0
  7. package/obj/template/.claude/commands/approve-spec.md +29 -0
  8. package/obj/template/.claude/commands/approve-swarm.md +27 -0
  9. package/obj/template/.claude/commands/grant-commit.md +19 -0
  10. package/obj/template/.claude/commands/init-project.md +191 -0
  11. package/obj/template/.claude/hooks/artifact_template_guard.sh +141 -0
  12. package/obj/template/.claude/hooks/consent_gate_grant.sh +89 -0
  13. package/obj/template/.claude/hooks/destructive_cmd_guard.sh +42 -0
  14. package/obj/template/.claude/hooks/env_guard.sh +36 -0
  15. package/obj/template/.claude/hooks/git_commit_guard.sh +93 -0
  16. package/obj/template/.claude/hooks/harness_continuation.sh +121 -0
  17. package/obj/template/.claude/hooks/lib/__pycache__/resume_writer.cpython-314.pyc +0 -0
  18. package/obj/template/.claude/hooks/lib/common.sh +328 -0
  19. package/obj/template/.claude/hooks/lib/resume_writer.py +341 -0
  20. package/obj/template/.claude/hooks/lint_runner.sh +55 -0
  21. package/obj/template/.claude/hooks/memory_pre_compact.sh +36 -0
  22. package/obj/template/.claude/hooks/memory_session_start.sh +244 -0
  23. package/obj/template/.claude/hooks/memory_stop.sh +173 -0
  24. package/obj/template/.claude/hooks/plantuml_syntax_guard.sh +161 -0
  25. package/obj/template/.claude/hooks/process_lifecycle_guard.sh +89 -0
  26. package/obj/template/.claude/hooks/setup_guard.sh +50 -0
  27. package/obj/template/.claude/hooks/spec_approval_guard.sh +81 -0
  28. package/obj/template/.claude/hooks/spec_design_calls_guard.sh +183 -0
  29. package/obj/template/.claude/hooks/spec_diagram_presence_guard.sh +141 -0
  30. package/obj/template/.claude/hooks/swarm_approval_guard.sh +39 -0
  31. package/obj/template/.claude/hooks/swarm_boundary_guard.sh +136 -0
  32. package/obj/template/.claude/hooks/tdd_order_guard.sh +176 -0
  33. package/obj/template/.claude/hooks/test_runner.sh +75 -0
  34. package/obj/template/.claude/hooks/tests/fixtures/ac008_byte_equal_reference.txt +12 -0
  35. package/obj/template/.claude/hooks/tests/memory_session_start_test.sh +285 -0
  36. package/obj/template/.claude/hooks/track_guard.sh +127 -0
  37. package/obj/template/.claude/hooks/verify_pass_guard.sh +88 -0
  38. package/obj/template/.claude/memory/README.md +108 -0
  39. package/obj/template/.claude/memory/_pending.md +15 -0
  40. package/obj/template/.claude/memory/_resume.md +12 -0
  41. package/obj/template/.claude/memory/conventions.md +26 -0
  42. package/obj/template/.claude/memory/decisions.md +29 -0
  43. package/obj/template/.claude/memory/landmarks.md +26 -0
  44. package/obj/template/.claude/memory/landmines.md +27 -0
  45. package/obj/template/.claude/memory/libraries.md +27 -0
  46. package/obj/template/.claude/memory/pending-questions.md +28 -0
  47. package/obj/template/.claude/project.json +221 -0
  48. package/obj/template/.claude/settings.json +110 -0
  49. package/obj/template/.claude/skills/archive/SKILL.md +48 -0
  50. package/obj/template/.claude/skills/archive/archive.sh +145 -0
  51. package/obj/template/.claude/skills/audit-baseline/SKILL.md +80 -0
  52. package/obj/template/.claude/skills/audit-baseline/audit.sh +919 -0
  53. package/obj/template/.claude/skills/brd/SKILL.md +44 -0
  54. package/obj/template/.claude/skills/brd/template.md +83 -0
  55. package/obj/template/.claude/skills/chore/SKILL.md +99 -0
  56. package/obj/template/.claude/skills/claude-automation-recommender/LICENSE +202 -0
  57. package/obj/template/.claude/skills/claude-automation-recommender/NOTICE +69 -0
  58. package/obj/template/.claude/skills/claude-automation-recommender/SKILL.md +358 -0
  59. package/obj/template/.claude/skills/claude-automation-recommender/references/hooks-patterns.md +226 -0
  60. package/obj/template/.claude/skills/claude-automation-recommender/references/mcp-servers.md +263 -0
  61. package/obj/template/.claude/skills/claude-automation-recommender/references/plugins-reference.md +98 -0
  62. package/obj/template/.claude/skills/claude-automation-recommender/references/skills-reference.md +408 -0
  63. package/obj/template/.claude/skills/claude-automation-recommender/references/subagent-templates.md +181 -0
  64. package/obj/template/.claude/skills/code-structure/SKILL.md +204 -0
  65. package/obj/template/.claude/skills/commit/SKILL.md +21 -0
  66. package/obj/template/.claude/skills/copywriting/SKILL.md +252 -0
  67. package/obj/template/.claude/skills/copywriting/evals/evals.json +111 -0
  68. package/obj/template/.claude/skills/copywriting/references/ai-writing-detection.md +200 -0
  69. package/obj/template/.claude/skills/copywriting/references/copy-frameworks.md +344 -0
  70. package/obj/template/.claude/skills/copywriting/references/natural-transitions.md +272 -0
  71. package/obj/template/.claude/skills/design-ui/SKILL.md +175 -0
  72. package/obj/template/.claude/skills/design-ui/references/design-vs-development.md +89 -0
  73. package/obj/template/.claude/skills/design-ui/references/intent-table.md +64 -0
  74. package/obj/template/.claude/skills/design-ui/references/orchestration.md +121 -0
  75. package/obj/template/.claude/skills/design-ui/references/state-machine.md +125 -0
  76. package/obj/template/.claude/skills/document/SKILL.md +66 -0
  77. package/obj/template/.claude/skills/documentation/SKILL.md +50 -0
  78. package/obj/template/.claude/skills/harness/SKILL.md +169 -0
  79. package/obj/template/.claude/skills/humanizer/SKILL.md +489 -0
  80. package/obj/template/.claude/skills/humanizer/references/ai-writing-detection.md +208 -0
  81. package/obj/template/.claude/skills/impeccable/PROJECT_NOTES.md +22 -0
  82. package/obj/template/.claude/skills/impeccable/SKILL.md +153 -0
  83. package/obj/template/.claude/skills/impeccable/agents/openai.yaml +4 -0
  84. package/obj/template/.claude/skills/impeccable/reference/adapt.md +190 -0
  85. package/obj/template/.claude/skills/impeccable/reference/animate.md +173 -0
  86. package/obj/template/.claude/skills/impeccable/reference/audit.md +134 -0
  87. package/obj/template/.claude/skills/impeccable/reference/bolder.md +113 -0
  88. package/obj/template/.claude/skills/impeccable/reference/brand.md +104 -0
  89. package/obj/template/.claude/skills/impeccable/reference/clarify.md +174 -0
  90. package/obj/template/.claude/skills/impeccable/reference/cognitive-load.md +106 -0
  91. package/obj/template/.claude/skills/impeccable/reference/color-and-contrast.md +105 -0
  92. package/obj/template/.claude/skills/impeccable/reference/colorize.md +154 -0
  93. package/obj/template/.claude/skills/impeccable/reference/craft.md +138 -0
  94. package/obj/template/.claude/skills/impeccable/reference/critique.md +213 -0
  95. package/obj/template/.claude/skills/impeccable/reference/delight.md +302 -0
  96. package/obj/template/.claude/skills/impeccable/reference/distill.md +111 -0
  97. package/obj/template/.claude/skills/impeccable/reference/document.md +427 -0
  98. package/obj/template/.claude/skills/impeccable/reference/extract.md +70 -0
  99. package/obj/template/.claude/skills/impeccable/reference/harden.md +347 -0
  100. package/obj/template/.claude/skills/impeccable/reference/heuristics-scoring.md +234 -0
  101. package/obj/template/.claude/skills/impeccable/reference/interaction-design.md +195 -0
  102. package/obj/template/.claude/skills/impeccable/reference/layout.md +141 -0
  103. package/obj/template/.claude/skills/impeccable/reference/live.md +513 -0
  104. package/obj/template/.claude/skills/impeccable/reference/motion-design.md +99 -0
  105. package/obj/template/.claude/skills/impeccable/reference/onboard.md +234 -0
  106. package/obj/template/.claude/skills/impeccable/reference/optimize.md +258 -0
  107. package/obj/template/.claude/skills/impeccable/reference/overdrive.md +130 -0
  108. package/obj/template/.claude/skills/impeccable/reference/personas.md +178 -0
  109. package/obj/template/.claude/skills/impeccable/reference/polish.md +232 -0
  110. package/obj/template/.claude/skills/impeccable/reference/product.md +62 -0
  111. package/obj/template/.claude/skills/impeccable/reference/quieter.md +99 -0
  112. package/obj/template/.claude/skills/impeccable/reference/responsive-design.md +114 -0
  113. package/obj/template/.claude/skills/impeccable/reference/shape.md +136 -0
  114. package/obj/template/.claude/skills/impeccable/reference/spatial-design.md +100 -0
  115. package/obj/template/.claude/skills/impeccable/reference/teach.md +137 -0
  116. package/obj/template/.claude/skills/impeccable/reference/typeset.md +124 -0
  117. package/obj/template/.claude/skills/impeccable/reference/typography.md +159 -0
  118. package/obj/template/.claude/skills/impeccable/reference/ux-writing.md +107 -0
  119. package/obj/template/.claude/skills/impeccable/scripts/cleanup-deprecated.mjs +284 -0
  120. package/obj/template/.claude/skills/impeccable/scripts/command-metadata.json +94 -0
  121. package/obj/template/.claude/skills/impeccable/scripts/design-parser.mjs +820 -0
  122. package/obj/template/.claude/skills/impeccable/scripts/detect-csp.mjs +198 -0
  123. package/obj/template/.claude/skills/impeccable/scripts/is-generated.mjs +69 -0
  124. package/obj/template/.claude/skills/impeccable/scripts/live-accept.mjs +465 -0
  125. package/obj/template/.claude/skills/impeccable/scripts/live-browser.js +4684 -0
  126. package/obj/template/.claude/skills/impeccable/scripts/live-inject.mjs +436 -0
  127. package/obj/template/.claude/skills/impeccable/scripts/live-poll.mjs +187 -0
  128. package/obj/template/.claude/skills/impeccable/scripts/live-server.mjs +679 -0
  129. package/obj/template/.claude/skills/impeccable/scripts/live-wrap.mjs +395 -0
  130. package/obj/template/.claude/skills/impeccable/scripts/live.mjs +247 -0
  131. package/obj/template/.claude/skills/impeccable/scripts/load-context.mjs +93 -0
  132. package/obj/template/.claude/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
  133. package/obj/template/.claude/skills/impeccable/scripts/pin.mjs +214 -0
  134. package/obj/template/.claude/skills/implement/SKILL.md +83 -0
  135. package/obj/template/.claude/skills/intake/SKILL.md +46 -0
  136. package/obj/template/.claude/skills/intake/template.md +61 -0
  137. package/obj/template/.claude/skills/integrate/SKILL.md +62 -0
  138. package/obj/template/.claude/skills/memory-flush/SKILL.md +172 -0
  139. package/obj/template/.claude/skills/memory-flush/sweep.py +286 -0
  140. package/obj/template/.claude/skills/memory-flush/tests/run.sh +327 -0
  141. package/obj/template/.claude/skills/prose/SKILL.md +119 -0
  142. package/obj/template/.claude/skills/rca/SKILL.md +42 -0
  143. package/obj/template/.claude/skills/rca/template.md +83 -0
  144. package/obj/template/.claude/skills/research/SKILL.md +75 -0
  145. package/obj/template/.claude/skills/scenario/SKILL.md +64 -0
  146. package/obj/template/.claude/skills/scout/SKILL.md +72 -0
  147. package/obj/template/.claude/skills/security/SKILL.md +75 -0
  148. package/obj/template/.claude/skills/simplify/SKILL.md +67 -0
  149. package/obj/template/.claude/skills/spec/SKILL.md +69 -0
  150. package/obj/template/.claude/skills/spec/template.md +274 -0
  151. package/obj/template/.claude/skills/spec-diagram-review/SKILL.md +81 -0
  152. package/obj/template/.claude/skills/spec-lint/SKILL.md +55 -0
  153. package/obj/template/.claude/skills/spec-lint/lint.sh +218 -0
  154. package/obj/template/.claude/skills/spec-render/SKILL.md +45 -0
  155. package/obj/template/.claude/skills/spec-render/render.sh +109 -0
  156. package/obj/template/.claude/skills/spec-traceability-review/SKILL.md +72 -0
  157. package/obj/template/.claude/skills/swarm-dispatch/SKILL.md +212 -0
  158. package/obj/template/.claude/skills/swarm-dispatch/swarm_merge.sh +154 -0
  159. package/obj/template/.claude/skills/swarm-plan/SKILL.md +90 -0
  160. package/obj/template/.claude/skills/swarm-plan/validate.sh +181 -0
  161. package/obj/template/.claude/skills/tdd/SKILL.md +100 -0
  162. package/obj/template/.claude/skills/technical-tutorials/SKILL.md +569 -0
  163. package/obj/template/.claude/skills/technical-tutorials/references/audience-context-README.md +53 -0
  164. package/obj/template/.claude/skills/technical-tutorials/references/audience-context.md +246 -0
  165. package/obj/template/.claude/skills/technical-tutorials/references/audience-example.md +175 -0
  166. package/obj/template/.claude/skills/technical-tutorials/references/audience-template.md +152 -0
  167. package/obj/template/.claude/skills/triage/SKILL.md +55 -0
  168. package/obj/template/.claude/skills/verify/SKILL.md +74 -0
  169. package/obj/template/.mcp.json +24 -0
  170. package/obj/template/CLAUDE.md +327 -0
  171. package/obj/template/docs/init/seed.md +585 -0
  172. package/obj/template/manifest.json +214 -0
  173. package/package.json +48 -0
  174. package/src/.mcp.template.json +24 -0
  175. package/src/.npmrc.template +2 -0
  176. package/src/CLAUDE.template.md +327 -0
  177. package/src/agents/swarm-worker.template.md +51 -0
  178. package/src/cli/conflict.js +31 -0
  179. package/src/cli/doctor.js +152 -0
  180. package/src/cli/install.js +93 -0
  181. package/src/cli/io.js +27 -0
  182. package/src/cli/manifest.js +38 -0
  183. package/src/cli/mcp.js +54 -0
  184. package/src/cli/merge.js +107 -0
  185. package/src/cli/plantuml.js +121 -0
  186. package/src/cli/util.js +10 -0
  187. package/src/memory/_pending.template.md +15 -0
  188. package/src/memory/_resume.template.md +12 -0
  189. package/src/memory/conventions.template.md +26 -0
  190. package/src/memory/decisions.template.md +29 -0
  191. package/src/memory/landmarks.template.md +26 -0
  192. package/src/memory/landmines.template.md +27 -0
  193. package/src/memory/libraries.template.md +27 -0
  194. package/src/memory/pending-questions.template.md +28 -0
  195. package/src/project.template.json +221 -0
  196. package/src/seed.template.md +585 -0
  197. package/src/settings.template.json +110 -0
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: tdd
3
+ owner: baseline
4
+ description: Workflow Phase 6 — TDD coordinator. Decides the scenario recipe and the implementation contract in main context, writes them to a state file, seeds per-worker tasks (scenario, implement, verify-tick, design-ui-tick) into the TaskList, and yields with harness_state continue so the harness invokes each worker as its own tick. No subagent delegation; no nested Skill calls.
5
+ argument-hint: "[optional: spec path]"
6
+ ---
7
+
8
+ # tdd — Phase 6 coordinator (post-decomposition)
9
+
10
+ This skill is a **thin coordinator**. It does not invoke `scenario`, `implement`, or `design-ui` itself. Instead, it writes a recipe + contract state file, seeds per-worker tasks into the TaskList, and yields with `harness_state: "continue"`. The harness's next ticks pick up each worker task in order and invoke the matching skill — one Skill call per tick. The `verify-tick` worker is special: it has no Skill invocation at all; the harness inlines the four mechanical operations from `.claude/skills/verify/SKILL.md` (which is now contract-only, not Skill-tool-invocable).
11
+
12
+ Main-context decisions live here. Worker execution happens in harness ticks.
13
+
14
+ # Prereq
15
+
16
+ Either an approved spec exists (`.claude/state/spec_approvals/<slug>.approval`) OR `entry_phase` in `workflow.json` is `tdd` (quickfix/bugfix direct-to-TDD).
17
+
18
+ If neither, stop and direct the user to `/triage` first.
19
+
20
+ # Steps
21
+
22
+ ## 1. Verify prereq
23
+
24
+ Read `.claude/state/workflow.json`. Confirm `tdd` is the current phase to run (entry_phase is `tdd` for quickfix, OR `spec` is in `completed` AND the spec approval token exists for spec-track).
25
+
26
+ ## 2. Decide the scenario recipe (in main context)
27
+
28
+ Read the approved spec at `docs/specs/<slug>.md` (or, for direct-TDD, the failing-case description the user supplied). Produce an explicit recipe — one entry per scenario:
29
+
30
+ - `name` — `test_when_<condition>_then_<outcome>`.
31
+ - `covers` — the spec AC ID, or `"regression"` / `"boundary"` with explanation.
32
+ - `assertion` — what the test checks, in one plain sentence.
33
+ - `fixtures` — the real fixtures to use (paths, factories, helpers).
34
+
35
+ Also enumerate **out-of-scope scenarios** explicitly. This prevents the worker from over-producing.
36
+
37
+ Skip categories the spec marks out of scope.
38
+
39
+ ## 3. Decide the implementation contract (in main context)
40
+
41
+ Produce the recipe the implement worker will execute:
42
+
43
+ - **Failing test paths** — from the scenarios decided in step 2.
44
+ - **Write set** — the exact source file paths the implementation may touch. For solo `/tdd` use conventional source paths from `project.json → tdd.source_globs`. For `/swarm-dispatch` workers, the write set is fixed by the swarm plan.
45
+ - **Behavior contract** — the §Behavior sequence excerpts from the spec for the ACs in scope, plus §Design data model + contracts. Quote the spec; do not paraphrase.
46
+ - **Project conventions** — `test.cmd`, `lint.cmd`, TDD globs from `.claude/project.json`.
47
+
48
+ ## 4. Read the spec's Design calls (if any)
49
+
50
+ Parse the `## Design calls` section of `docs/specs/<slug>.md` into a list of rows. For each row, capture `slug`, `intent`, `target_files`, `write_set`, `register_override`, `references`. If the section body is `*(none)*` or the write_set from step 3 does not intersect `project.json → tdd.ui_globs`, the list is empty.
51
+
52
+ ## 5. Write the tdd coordinator state file
53
+
54
+ Create `.claude/state/tdd/` if missing. Write `.claude/state/tdd/<slug>.json` with shape:
55
+
56
+ ```jsonc
57
+ {
58
+ "slug": "<workflow slug>",
59
+ "recipe": [ { "name": "...", "covers": "...", "assertion": "...", "fixtures": "..." }, ... ],
60
+ "contract": {
61
+ "failing_test_paths": ["..."],
62
+ "write_set": ["..."],
63
+ "behavior_excerpts": ["..."],
64
+ "project_conventions": { "test_cmd": "...", "lint_cmd": "..." }
65
+ },
66
+ "design_calls_rows": [ { "slug": "...", "intent": "...", "target_files": "...", "write_set": "...", "register_override": "...", "references": "..." }, ... ]
67
+ }
68
+ ```
69
+
70
+ This file is the handoff: each subsequent harness tick reads the relevant slice and feeds it to its worker.
71
+
72
+ ## 6. Seed worker tasks into the TaskList
73
+
74
+ Create tasks via `TaskCreate`; wire `addBlockedBy` so the chain is sequential. Use these canonical entries:
75
+
76
+ - **Task A — scenario-tick**: subject `"Run /scenario for <slug>"`; metadata `{phase: "scenario-tick", slug}`; activeForm `"Running scenario"`.
77
+ - **Task B — implement-tick**: subject `"Run /implement for <slug>"`; metadata `{phase: "implement-tick", slug}`; activeForm `"Running implement"`; `addBlockedBy [A]`.
78
+ - **Task C — verify-tick**: subject `"Run inline verify for <slug>"`; metadata `{phase: "verify-tick", slug}`; activeForm `"Running verify (inlined)"`; `addBlockedBy [B]`. The harness, when this task becomes next-pending, inlines the four mechanical operations from `.claude/skills/verify/SKILL.md` rather than invoking that skill via the Skill tool (the verify skill is contract-only after the harness-auto-continuation refactor).
79
+ - **Tasks D₁..D_N — design-ui-tick (post-verify design implementation step; only when design_calls_rows is non-empty AND the implement write_set intersects `tdd.ui_globs`)**: one task per row. Subject `"Run /design-ui for <row.slug>"`; metadata `{phase: "design-ui-tick", slug, row_index: i}`; activeForm `"Running design-ui row <i>"`; `addBlockedBy [C]` for D₁, then chained `addBlockedBy [D_{i-1}]`. The design-ui worker handles the design implementation per the spec's `## Design calls` rows. After every D_i completes, the harness inlines a second verify pass (re-stamps `last_test_result`) to confirm the design work did not break behavior tests.
80
+ - **Task Z — tdd-finalize**: subject `"Finalize tdd for <slug>"`; metadata `{phase: "tdd-finalize", slug}`; activeForm `"Finalizing tdd"`; `addBlockedBy` the last D_i (or C if no design-ui). On execution, the harness appends `"tdd"` to `workflow.json → completed`, writes `harness_state: continue` with reason "tdd green; next: simplify", and proceeds.
81
+
82
+ ## 7. Write harness_state and yield
83
+
84
+ Marker FIRST: `echo "<slug>" > .claude/state/.harness_active` (the harness loop is in flight; the active marker stays set across the worker chain). Then write `.claude/state/harness_state` with `{state: "continue", slug, reason: "tdd recipe + contract + tasks ready; next: scenario"}` — exactly three keys; no `written_at`, no `tick_count`.
85
+
86
+ ## 8. Emit terminal message and return
87
+
88
+ Tell the user (one line): `"TDD recipe + contract written to .claude/state/tdd/<slug>.json. N worker tasks seeded. Continuing."` Return. The Stop hook reads `harness_state` and re-fires the harness on the same turn, which picks up Task A (scenario-tick).
89
+
90
+ # Failure handling (RALPH cap moved to implement-tick)
91
+
92
+ The RALPH iteration cap (5 attempts) lives inside the implement-tick worker — the harness invokes `Skill(implement)` and `implement` runs its own loop. If implement returns `BLOCKED` after 5 iterations, the harness writes `harness_state: yielded` with the blocker reason; the user investigates and may rerun /tdd with a refined contract.
93
+
94
+ # Constraints
95
+
96
+ - **Decisions live here.** The recipe for scenarios and the contract for implement — both are decided in main context BEFORE the state file is written. If you find yourself deferring a decision to a worker, stop and decide it.
97
+ - **No nested Skill invocations.** This skill does not call `scenario`, `implement`, `verify`, or `design-ui`. The harness invokes each worker as its own tick after reading the state file.
98
+ - **Never modify tests inside the implement worker.** If a test seems wrong, the harness will surface it and re-invoke the scenario worker with a corrected recipe. `implement` is forbidden from touching tests (worker SKILL constraint).
99
+ - **Inlined verify is binding.** When the harness runs the verify-tick, it produces the canonical four-line `last_test_result`. The `verify_pass_guard` hook reads line 1; that is the truth.
100
+ - **One Skill call per harness tick.** This is enforced by harness's per-tick atomicity contract. tdd itself emits zero Skill calls and returns after writing state + tasks.
@@ -0,0 +1,569 @@
1
+ ---
2
+ name: technical-tutorials
3
+ owner: baseline
4
+ description: When the user wants to create step-by-step technical tutorials, quickstarts, or code walkthroughs. Trigger phrases include "tutorial," "quickstart," "getting started guide," "walkthrough," "step by step," "how to guide," "hands-on guide," or "code tutorial."
5
+ metadata:
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Technical Tutorials
10
+
11
+ This skill helps you create step-by-step tutorials that actually work. Covers prerequisite handling, progressive complexity, troubleshooting sections, and creating those satisfying "it works!" moments.
12
+
13
+ ---
14
+
15
+ ## Before You Start
16
+
17
+ **Establish audience context first.** Before writing, you need to know:
18
+
19
+ - Developer skill level (beginner, intermediate, senior)
20
+ - Tech stack familiarity (what can you assume they know?)
21
+ - Environment (macOS, Linux, Windows, cloud)
22
+ - Why they're learning (job, side project, curiosity)
23
+
24
+ See `references/audience-context.md` (consolidated into this skill on 2026-04-28; was a standalone `developer-audience-context` skill upstream) for the audience profile shape and the 10 sections to capture. Either load an existing project-level `audience-context.md`, or elicit the four points above inline. Do not block the tutorial draft on missing audience information — document the assumptions you made at the top of the tutorial so the user can correct them.
25
+
26
+ ---
27
+
28
+ ## Tutorial Types
29
+
30
+ | Type | Length | Purpose | Example |
31
+ |------|--------|---------|---------|
32
+ | **Quickstart** | 5-10 min | First success ASAP | "Make your first API call" |
33
+ | **Tutorial** | 20-45 min | Learn a concept deeply | "Build a REST API with Node.js" |
34
+ | **Workshop** | 1-3 hours | Comprehensive project | "Build a full-stack app" |
35
+ | **Code walkthrough** | Varies | Explain existing code | "Understanding our SDK architecture" |
36
+
37
+ ---
38
+
39
+ ## The Tutorial Structure
40
+
41
+ ### Anatomy of a Great Tutorial
42
+
43
+ ```
44
+ 1. Title & Meta
45
+ - What you'll build
46
+ - Time estimate
47
+ - Prerequisites
48
+
49
+ 2. Overview
50
+ - What you'll learn
51
+ - Final result preview
52
+
53
+ 3. Prerequisites Check
54
+ - Environment setup
55
+ - Verification commands
56
+
57
+ 4. The Build (Progressive Steps)
58
+ - Step 1: Simplest foundation
59
+ - Step 2: Add one concept
60
+ - Step 3: Add complexity
61
+ - [Checkpoint: "It works!" moment]
62
+ - Step 4: Continue building
63
+ - ...
64
+ - [Final checkpoint]
65
+
66
+ 5. What You Built
67
+ - Recap
68
+ - Complete code
69
+
70
+ 6. Troubleshooting
71
+ - Common errors
72
+ - Debugging tips
73
+
74
+ 7. Next Steps
75
+ - Where to go from here
76
+ - Related tutorials
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Prerequisites Handling
82
+
83
+ ### The Prerequisites Section
84
+
85
+ Be explicit. Don't make developers guess what they need.
86
+
87
+ ```markdown
88
+ ## Prerequisites
89
+
90
+ Before starting, make sure you have:
91
+
92
+ | Requirement | Version | Check Command |
93
+ |-------------|---------|---------------|
94
+ | Node.js | 18+ | `node --version` |
95
+ | npm | 9+ | `npm --version` |
96
+ | Git | Any | `git --version` |
97
+
98
+ You should also be comfortable with:
99
+ - Basic JavaScript (variables, functions, async/await)
100
+ - Command line basics (cd, mkdir, running commands)
101
+ - REST API concepts (HTTP methods, JSON)
102
+
103
+ **New to any of these?** Check out [link to prerequisite tutorial].
104
+ ```
105
+
106
+ ### Environment Setup Section
107
+
108
+ Make setup foolproof:
109
+
110
+ ```markdown
111
+ ## Setting Up Your Environment
112
+
113
+ ### 1. Create Project Directory
114
+
115
+ \`\`\`bash
116
+ mkdir my-awesome-project
117
+ cd my-awesome-project
118
+ \`\`\`
119
+
120
+ ### 2. Initialize the Project
121
+
122
+ \`\`\`bash
123
+ npm init -y
124
+ \`\`\`
125
+
126
+ You should see output like:
127
+ \`\`\`json
128
+ {
129
+ "name": "my-awesome-project",
130
+ "version": "1.0.0",
131
+ ...
132
+ }
133
+ \`\`\`
134
+
135
+ ### 3. Install Dependencies
136
+
137
+ \`\`\`bash
138
+ npm install express dotenv
139
+ \`\`\`
140
+
141
+ ### 4. Verify Installation
142
+
143
+ \`\`\`bash
144
+ node -e "require('express'); console.log('Express installed!')"
145
+ \`\`\`
146
+
147
+ Expected output: `Express installed!`
148
+ ```
149
+
150
+ ---
151
+
152
+ ## Progressive Complexity
153
+
154
+ ### The Layer Cake Approach
155
+
156
+ Build up in understandable layers:
157
+
158
+ | Layer | What It Does | Example |
159
+ |-------|--------------|---------|
160
+ | **1. Skeleton** | Minimum viable code that runs | "Hello World" server |
161
+ | **2. Core feature** | Primary functionality | Add one API endpoint |
162
+ | **3. Real data** | Replace hardcoded values | Connect to database |
163
+ | **4. Error handling** | Production-ready patterns | Add try/catch, validation |
164
+ | **5. Polish** | Nice-to-haves | Logging, config, tests |
165
+
166
+ ### Show Progress, Not Perfection
167
+
168
+ **Wrong approach** (overwhelming):
169
+ ```javascript
170
+ // Here's the complete file with everything
171
+ const express = require('express');
172
+ const { Pool } = require('pg');
173
+ const helmet = require('helmet');
174
+ const rateLimit = require('express-rate-limit');
175
+ const winston = require('winston');
176
+ // ... 200 more lines
177
+ ```
178
+
179
+ **Right approach** (progressive):
180
+
181
+ **Step 1: Basic server**
182
+ ```javascript
183
+ const express = require('express');
184
+ const app = express();
185
+
186
+ app.get('/', (req, res) => {
187
+ res.send('Hello World!');
188
+ });
189
+
190
+ app.listen(3000, () => {
191
+ console.log('Server running on http://localhost:3000');
192
+ });
193
+ ```
194
+
195
+ **Step 2: Add your first route**
196
+ ```javascript
197
+ // Add this below your existing route
198
+ app.get('/api/users', (req, res) => {
199
+ res.json([{ id: 1, name: 'Jane' }]);
200
+ });
201
+ ```
202
+
203
+ ---
204
+
205
+ ## Copy-Paste Friendly Code
206
+
207
+ ### The Copy-Paste Checklist
208
+
209
+ Every code block must pass these tests:
210
+
211
+ | Test | How to Verify |
212
+ |------|---------------|
213
+ | **Runs standalone** | Copy into new file, execute, it works |
214
+ | **Imports included** | All `require`/`import` statements present |
215
+ | **No undefined variables** | No references to code from other steps without showing it |
216
+ | **Environment agnostic** | Works on Mac/Linux/Windows |
217
+ | **Comments explain why** | Not what (code shows what), but why |
218
+
219
+ ### Code Block Patterns
220
+
221
+ **File context is critical:**
222
+
223
+ ```javascript
224
+ // server.js - Add this to your existing file
225
+ const rateLimit = require('express-rate-limit');
226
+
227
+ // Add this BEFORE your routes
228
+ const limiter = rateLimit({
229
+ windowMs: 15 * 60 * 1000, // 15 minutes
230
+ max: 100 // limit each IP to 100 requests per window
231
+ });
232
+
233
+ app.use(limiter);
234
+ ```
235
+
236
+ **Show file structure:**
237
+
238
+ ```
239
+ my-project/
240
+ ├── src/
241
+ │ ├── index.js ← You're editing this
242
+ │ ├── routes/
243
+ │ │ └── users.js
244
+ │ └── db/
245
+ │ └── connection.js
246
+ ├── package.json
247
+ └── .env
248
+ ```
249
+
250
+ **Highlight changes in context:**
251
+
252
+ ```javascript
253
+ // src/index.js
254
+ const express = require('express');
255
+ const app = express();
256
+
257
+ // ✅ ADD THIS: Import your new route
258
+ const userRoutes = require('./routes/users');
259
+
260
+ // ✅ ADD THIS: Use the route
261
+ app.use('/api/users', userRoutes);
262
+
263
+ app.listen(3000);
264
+ ```
265
+
266
+ ---
267
+
268
+ ## "It Works!" Moments
269
+
270
+ ### Checkpoints Create Motivation
271
+
272
+ Every 3-5 steps, give developers a win:
273
+
274
+ ```markdown
275
+ ## Checkpoint: Test Your API
276
+
277
+ Let's make sure everything works before continuing.
278
+
279
+ **Start your server:**
280
+ \`\`\`bash
281
+ node server.js
282
+ \`\`\`
283
+
284
+ **In a new terminal, test the endpoint:**
285
+ \`\`\`bash
286
+ curl http://localhost:3000/api/users
287
+ \`\`\`
288
+
289
+ **You should see:**
290
+ \`\`\`json
291
+ [{"id": 1, "name": "Jane"}]
292
+ \`\`\`
293
+
294
+ 🎉 **It works!** Your API is returning data.
295
+
296
+ If you don't see this output, check the [Troubleshooting](#troubleshooting) section.
297
+ ```
298
+
299
+ ### Visual Confirmation
300
+
301
+ When possible, show what success looks like:
302
+
303
+ | Output Type | How to Show |
304
+ |-------------|-------------|
305
+ | **Terminal output** | Code block with expected text |
306
+ | **Browser result** | Screenshot or description |
307
+ | **API response** | Formatted JSON |
308
+ | **Logs** | Code block with log output |
309
+
310
+ ---
311
+
312
+ ## Troubleshooting Sections
313
+
314
+ ### Common Error Template
315
+
316
+ ```markdown
317
+ ## Troubleshooting
318
+
319
+ ### "Error: Cannot find module 'express'"
320
+
321
+ **Cause:** Dependencies weren't installed.
322
+
323
+ **Fix:**
324
+ \`\`\`bash
325
+ npm install
326
+ \`\`\`
327
+
328
+ ---
329
+
330
+ ### "EADDRINUSE: address already in use :::3000"
331
+
332
+ **Cause:** Another process is using port 3000.
333
+
334
+ **Fix (macOS/Linux):**
335
+ \`\`\`bash
336
+ # Find the process
337
+ lsof -i :3000
338
+
339
+ # Kill it (replace PID with actual number)
340
+ kill -9 PID
341
+ \`\`\`
342
+
343
+ **Or use a different port:**
344
+ \`\`\`javascript
345
+ app.listen(process.env.PORT || 3001);
346
+ \`\`\`
347
+
348
+ ---
349
+
350
+ ### "SyntaxError: Unexpected token"
351
+
352
+ **Cause:** Likely a typo or missing bracket.
353
+
354
+ **Debug steps:**
355
+ 1. Check the line number in the error
356
+ 2. Look for missing `,`, `}`, or `)`
357
+ 3. Verify all strings are closed with matching quotes
358
+ ```
359
+
360
+ ### Proactive Error Prevention
361
+
362
+ Add warnings before common pitfalls:
363
+
364
+ ```markdown
365
+ ⚠️ **Windows users:** Use `set` instead of `export`:
366
+ \`\`\`bash
367
+ # macOS/Linux
368
+ export API_KEY=your_key
369
+
370
+ # Windows Command Prompt
371
+ set API_KEY=your_key
372
+
373
+ # Windows PowerShell
374
+ $env:API_KEY="your_key"
375
+ \`\`\`
376
+ ```
377
+
378
+ ---
379
+
380
+ ## Tutorial Templates
381
+
382
+ ### Quickstart Template (5-10 minutes)
383
+
384
+ ```markdown
385
+ # [Product] Quickstart: [What You'll Do] in 5 Minutes
386
+
387
+ Get [specific outcome] in under 5 minutes.
388
+
389
+ ## Prerequisites
390
+
391
+ - [Requirement 1]
392
+ - [Requirement 2]
393
+
394
+ ## Step 1: Install
395
+
396
+ \`\`\`bash
397
+ npm install your-package
398
+ \`\`\`
399
+
400
+ ## Step 2: Configure
401
+
402
+ Create a `.env` file:
403
+ \`\`\`
404
+ API_KEY=your_key_here
405
+ \`\`\`
406
+
407
+ ## Step 3: Write Code
408
+
409
+ Create `index.js`:
410
+ \`\`\`javascript
411
+ // Complete, working code
412
+ \`\`\`
413
+
414
+ ## Step 4: Run It
415
+
416
+ \`\`\`bash
417
+ node index.js
418
+ \`\`\`
419
+
420
+ Expected output:
421
+ \`\`\`
422
+ [Output here]
423
+ \`\`\`
424
+
425
+ ## 🎉 You Did It!
426
+
427
+ You just [accomplished thing].
428
+
429
+ **Next steps:**
430
+ - [Link to full tutorial]
431
+ - [Link to API docs]
432
+ - [Link to examples repo]
433
+ ```
434
+
435
+ ### Full Tutorial Template (20-45 minutes)
436
+
437
+ ```markdown
438
+ # Build a [Thing] with [Technology]
439
+
440
+ Learn how to [outcome] by building [specific project].
441
+
442
+ | | |
443
+ |---|---|
444
+ | **Time** | 30 minutes |
445
+ | **Level** | Intermediate |
446
+ | **Prerequisites** | Node.js 18+, basic JavaScript |
447
+
448
+ ## What You'll Build
449
+
450
+ [Screenshot or diagram of final result]
451
+
452
+ By the end, you'll have:
453
+ - ✅ [Capability 1]
454
+ - ✅ [Capability 2]
455
+ - ✅ [Capability 3]
456
+
457
+ ## Prerequisites
458
+
459
+ ### Required Software
460
+
461
+ | Tool | Version | Verify |
462
+ |------|---------|--------|
463
+ | Node.js | 18+ | `node -v` |
464
+
465
+ ### Required Knowledge
466
+
467
+ - [Concept 1] — [link to learn]
468
+ - [Concept 2] — [link to learn]
469
+
470
+ ## Step 1: Project Setup
471
+
472
+ [Setup instructions with verification]
473
+
474
+ **Checkpoint:** You should see `[expected output]`.
475
+
476
+ ## Step 2: [First Feature]
477
+
478
+ [Instructions]
479
+
480
+ **Checkpoint:** Test with `[command]`.
481
+
482
+ ## Step 3: [Second Feature]
483
+
484
+ [Instructions]
485
+
486
+ ## Step 4: [Third Feature]
487
+
488
+ [Instructions]
489
+
490
+ **Checkpoint:** Your app should now [do thing].
491
+
492
+ ## Complete Code
493
+
494
+ Here's everything together:
495
+
496
+ \`\`\`javascript
497
+ // Full final code
498
+ \`\`\`
499
+
500
+ ## Troubleshooting
501
+
502
+ ### [Common Error 1]
503
+ [Solution]
504
+
505
+ ### [Common Error 2]
506
+ [Solution]
507
+
508
+ ## What You Learned
509
+
510
+ - [Key concept 1]
511
+ - [Key concept 2]
512
+ - [Key concept 3]
513
+
514
+ ## Next Steps
515
+
516
+ - **Go deeper:** [Link to advanced tutorial]
517
+ - **Explore:** [Link to related feature]
518
+ - **Get help:** [Link to Discord/community]
519
+ ```
520
+
521
+ ---
522
+
523
+ ## Quality Checklist
524
+
525
+ Before publishing, verify:
526
+
527
+ ### Code Quality
528
+ - [ ] Every code block runs without modification
529
+ - [ ] All imports/requires are included
530
+ - [ ] Expected output is shown
531
+ - [ ] Error handling is included
532
+ - [ ] Environment variables use `.env` pattern
533
+
534
+ ### Structure Quality
535
+ - [ ] Prerequisites are explicit
536
+ - [ ] Time estimate is accurate (test it!)
537
+ - [ ] Checkpoints every 3-5 steps
538
+ - [ ] Final complete code is provided
539
+ - [ ] Troubleshooting covers likely errors
540
+
541
+ ### Accessibility
542
+ - [ ] Works on Mac, Linux, AND Windows
543
+ - [ ] Commands work in bash/zsh/PowerShell
544
+ - [ ] File paths use correct separators
545
+ - [ ] No assumptions about installed tools
546
+
547
+ ---
548
+
549
+ ## Tools
550
+
551
+ | Tool | Use Case |
552
+ |------|----------|
553
+ | **[Octolens](https://octolens.com)** | Find common questions and errors developers encounter. Monitor Stack Overflow and GitHub issues for troubleshooting content. |
554
+ | **Replit/CodeSandbox** | Embed runnable examples |
555
+ | **Carbon/Ray.so** | Beautiful code screenshots |
556
+ | **Excalidraw** | Architecture diagrams |
557
+ | **Terminalizer** | Record terminal sessions |
558
+ | **Loom** | Quick video supplements |
559
+
560
+ ---
561
+
562
+ ## Related Skills
563
+
564
+ These four are upstream companion skills (from the `claude-code-setup` plugin family) and **do not ship with this baseline**. Listed here for reference only; if you need their capabilities, ask the user inline or install the plugin separately.
565
+
566
+ - `developer-audience-context` — Understand skill level and environment
567
+ - `devrel-content` — General technical writing principles
568
+ - `developer-onboarding` — Optimize time to first success
569
+ - `developer-seo` — Get tutorials found via search