@vpxa/aikit 0.1.179 → 0.1.181
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/embeddings/dist/index.js +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-zeo-iLGr.js → server-tzRu5ODc.js} +46 -46
- package/packages/tools/dist/index.js +1 -1
- package/scaffold/dist/definitions/prompts.mjs +187 -60
- package/scaffold/dist/definitions/skills/_shared-viewer-inject.mjs +1 -1
- package/scaffold/dist/definitions/skills/c4-architecture.mjs +9 -6
- package/scaffold/dist/definitions/skills/docs.mjs +82 -60
|
@@ -837,7 +837,10 @@ docs/
|
|
|
837
837
|
├── index.md # Tour listing with descriptions
|
|
838
838
|
├── architecture.md # System structure tour
|
|
839
839
|
├── data-flow.md # Data pipeline tour
|
|
840
|
-
|
|
840
|
+
├── feature-{name}.md # Feature-specific tours
|
|
841
|
+
└── interactive/
|
|
842
|
+
├── {name}.json # Tour data injected into viewer
|
|
843
|
+
└── {name}.html # Interactive viewer output
|
|
841
844
|
\`\`\`
|
|
842
845
|
|
|
843
846
|
## Interactive JSON Tour (Recommended)
|
|
@@ -851,16 +854,16 @@ Tour data must conform to [references/tour.schema.json](references/tour.schema.j
|
|
|
851
854
|
### Usage (MANDATORY — every tour MUST produce interactive HTML)
|
|
852
855
|
|
|
853
856
|
Every tour MUST produce both:
|
|
854
|
-
- \`docs/tours/{name}.
|
|
857
|
+
- \`docs/tours/interactive/{name}.json\` — machine-readable data
|
|
855
858
|
- \`docs/tours/interactive/{name}.html\` — interactive viewer for humans
|
|
856
859
|
|
|
857
860
|
Steps:
|
|
858
861
|
1. Generate JSON that conforms to [references/tour.schema.json](references/tour.schema.json)
|
|
859
|
-
2. Save JSON to \`docs/tours/{name}.
|
|
862
|
+
2. Save JSON to \`docs/tours/interactive/{name}.json\`
|
|
860
863
|
3. Create interactive HTML by running the injection script:
|
|
861
864
|
|
|
862
865
|
\`\`\`bash
|
|
863
|
-
node scripts/inject-viewer.mjs --template assets/tour-viewer.html --data docs/tours/{name}.
|
|
866
|
+
node scripts/inject-viewer.mjs --template assets/tour-viewer.html --data docs/tours/interactive/{name}.json --out docs/tours/interactive/{name}.html
|
|
864
867
|
\`\`\`
|
|
865
868
|
|
|
866
869
|
The script reads the viewer template, injects tour JSON data, and writes the output HTML. Cross-platform, no dependencies.
|
|
@@ -871,6 +874,7 @@ The script reads the viewer template, injects tour JSON data, and writes the out
|
|
|
871
874
|
{
|
|
872
875
|
"title": "Authentication Tour",
|
|
873
876
|
"description": "Walk through the login path from entry point to token issuance.",
|
|
877
|
+
"estimatedTime": "12 min",
|
|
874
878
|
"version": "1.0.0",
|
|
875
879
|
"metadata": {
|
|
876
880
|
"author": "AI Kit",
|
|
@@ -880,33 +884,27 @@ The script reads the viewer template, injects tour JSON data, and writes the out
|
|
|
880
884
|
},
|
|
881
885
|
"steps": [
|
|
882
886
|
{
|
|
887
|
+
"stepNumber": 1,
|
|
883
888
|
"id": "entry-point",
|
|
884
889
|
"title": "Request Entry",
|
|
885
|
-
"
|
|
890
|
+
"explanation": "This handler receives the login request, validates the outer shape, and forwards work to the auth service. It exists to keep malformed input from reaching credential and token logic deeper in the stack. The route uses boundary validation first, then hands the normalized request to the auth service so downstream code can assume a known shape. This step connects the public HTTP surface to the internal authentication pipeline.",
|
|
886
891
|
"file": "src/http/routes/login.ts",
|
|
887
892
|
"line": 1,
|
|
888
893
|
"endLine": 28,
|
|
894
|
+
"learnsConcept": "Request boundary validation",
|
|
895
|
+
"duration": "2 min",
|
|
889
896
|
"language": "ts",
|
|
890
897
|
"codeSnippet": "export async function loginRoute(req, res) { /* ... */ }",
|
|
891
|
-
"
|
|
892
|
-
{
|
|
893
|
-
"line": 8,
|
|
894
|
-
"label": "Request validation starts here",
|
|
895
|
-
"style": "info"
|
|
896
|
-
}
|
|
897
|
-
],
|
|
898
|
-
"notes": [
|
|
899
|
-
"Introduces the request boundary.",
|
|
900
|
-
"The main concept here is input validation before auth logic."
|
|
901
|
-
]
|
|
898
|
+
"notes": "Introduces the request boundary and shows why validation happens before auth logic."
|
|
902
899
|
}
|
|
903
|
-
]
|
|
900
|
+
],
|
|
901
|
+
"dependencies": []
|
|
904
902
|
}
|
|
905
903
|
\`\`\`
|
|
906
904
|
|
|
907
905
|
### Step Content Quality Requirements
|
|
908
906
|
|
|
909
|
-
Each tour step
|
|
907
|
+
Each tour step explanation MUST include ALL of these elements:
|
|
910
908
|
|
|
911
909
|
1. **What** — What this code does (1 sentence)
|
|
912
910
|
2. **Why** — Why it exists, what problem it solves, what would break without it (1-2 sentences)
|
|
@@ -916,30 +914,32 @@ Each tour step description MUST include ALL of these elements:
|
|
|
916
914
|
**Bad example (too shallow):**
|
|
917
915
|
\`\`\`json
|
|
918
916
|
{
|
|
917
|
+
"stepNumber": 3,
|
|
918
|
+
"id": "preview-generator",
|
|
919
919
|
"title": "The preview generator",
|
|
920
|
-
"
|
|
921
|
-
"notes": ["Entry point for the build pipeline."]
|
|
920
|
+
"explanation": "This file registers the skills adapter for generating preview files."
|
|
922
921
|
}
|
|
923
922
|
\`\`\`
|
|
924
923
|
|
|
925
924
|
**Good example (deep, educational):**
|
|
926
925
|
\`\`\`json
|
|
927
926
|
{
|
|
927
|
+
"stepNumber": 3,
|
|
928
|
+
"id": "skills-adapter-registration",
|
|
928
929
|
"title": "Skills Adapter Registration",
|
|
929
|
-
"
|
|
930
|
-
"
|
|
931
|
-
"
|
|
932
|
-
|
|
933
|
-
]
|
|
930
|
+
"explanation": "generate.mjs registers the skills adapter — a function that reads .mjs skill definitions and transforms them into deployable SKILL.md + reference files. Without this adapter, the build pipeline has no way to discover or process skill sources. It uses a plugin pattern where each adapter (skills, prompts, agents) is registered independently, allowing the pipeline to process different artifact types through a unified interface. This step matters because it is the bridge between raw authoring inputs and every generated documentation artifact downstream.",
|
|
931
|
+
"learnsConcept": "Adapter-based generation pipelines",
|
|
932
|
+
"duration": "3 min",
|
|
933
|
+
"notes": "This is the entry point that connects raw .mjs definitions to the full build output. Watch for the definitions directory scan that feeds into the adapter."
|
|
934
934
|
}
|
|
935
935
|
\`\`\`
|
|
936
936
|
|
|
937
937
|
**Quality bar:** If a developer reads only the tour (without opening any files), they should understand the system's architecture, design decisions, and data flow.
|
|
938
938
|
|
|
939
939
|
**Minimum requirements per step:**
|
|
940
|
-
-
|
|
941
|
-
- Notes: 2
|
|
942
|
-
-
|
|
940
|
+
- Explanation: 3-5 sentences minimum (not 1-2)
|
|
941
|
+
- Notes: Optional, but when present use 1-2 sentences explaining architectural significance
|
|
942
|
+
- Include \`stepNumber\`, \`id\`, \`duration\`, and \`learnsConcept\` for every step
|
|
943
943
|
- codeSnippet: Include for steps where the key logic fits in <15 lines
|
|
944
944
|
|
|
945
945
|
### Line Number Validation (MANDATORY)
|
|
@@ -956,7 +956,7 @@ After generating tour JSON, validate EVERY step's line numbers against the actua
|
|
|
956
956
|
For each step:
|
|
957
957
|
compact({ path: step.file, query: step.title }) → find actual location
|
|
958
958
|
read_file(step.file, step.line, step.line + 10) → verify code matches description
|
|
959
|
-
If mismatch → search({ query: step.
|
|
959
|
+
If mismatch → search({ query: step.explanation }) → find correct file:line
|
|
960
960
|
\`\`\`
|
|
961
961
|
|
|
962
962
|
Tour JSON with stale line numbers is a **quality gate failure**. Fix before saving.
|
|
@@ -965,15 +965,17 @@ Tour JSON with stale line numbers is a **quality gate failure**. Fix before savi
|
|
|
965
965
|
|
|
966
966
|
1. **title**: Use a reader-facing tour name.
|
|
967
967
|
2. **description**: State the tour goal and scope in one or two sentences.
|
|
968
|
-
3. **
|
|
969
|
-
4. **
|
|
970
|
-
5. **
|
|
971
|
-
6. **
|
|
972
|
-
7. **
|
|
973
|
-
8. **
|
|
974
|
-
9. **
|
|
975
|
-
10. **
|
|
976
|
-
11. **
|
|
968
|
+
3. **estimatedTime**: Include a reader-facing duration for the full tour, such as \`15 min\`.
|
|
969
|
+
4. **version**: Set the schema version you are targeting.
|
|
970
|
+
5. **metadata**: Use optional metadata for authoring info, tags, timestamps, and difficulty.
|
|
971
|
+
6. **steps**: Keep array order aligned with the explicit \`stepNumber\` field.
|
|
972
|
+
7. **id**: Required for stable references and dependency edges; use descriptive kebab-case.
|
|
973
|
+
8. **explanation** on each step: Explain what matters in this step and why it belongs in the tour.
|
|
974
|
+
9. **file**, **line**, and **endLine**: Point to the exact source span when possible.
|
|
975
|
+
10. **learnsConcept** and **duration**: Use them to make the learning goal and reading effort explicit.
|
|
976
|
+
11. **codeSnippet** and **language**: Provide a fallback snippet when the viewer cannot load the file directly.
|
|
977
|
+
12. **notes**: Capture concepts, tips, cautions, or prerequisite reminders that do not belong in the main explanation.
|
|
978
|
+
13. **dependencies**: Use step ids to describe prerequisite or flow relationships when the graph should show them.
|
|
977
979
|
|
|
978
980
|
Mapping from the old contract to the current schema:
|
|
979
981
|
|
|
@@ -1185,7 +1187,7 @@ docs/
|
|
|
1185
1187
|
"description": "Schema for AI Kit interactive code tour data. The agent generates JSON matching this schema, which is injected into tour-viewer.html.",
|
|
1186
1188
|
"version": "1.0.0",
|
|
1187
1189
|
"type": "object",
|
|
1188
|
-
"required": ["title", "steps"],
|
|
1190
|
+
"required": ["title", "description", "estimatedTime", "steps"],
|
|
1189
1191
|
"properties": {
|
|
1190
1192
|
"title": {
|
|
1191
1193
|
"type": "string",
|
|
@@ -1195,6 +1197,10 @@ docs/
|
|
|
1195
1197
|
"type": "string",
|
|
1196
1198
|
"description": "Brief tour description shown below the title"
|
|
1197
1199
|
},
|
|
1200
|
+
"estimatedTime": {
|
|
1201
|
+
"type": "string",
|
|
1202
|
+
"description": "Estimated reading time (e.g., '15 min')"
|
|
1203
|
+
},
|
|
1198
1204
|
"version": {
|
|
1199
1205
|
"type": "string",
|
|
1200
1206
|
"description": "Schema version for forward compatibility",
|
|
@@ -1214,15 +1220,25 @@ docs/
|
|
|
1214
1220
|
"minItems": 1,
|
|
1215
1221
|
"items": {
|
|
1216
1222
|
"type": "object",
|
|
1217
|
-
"required": ["title", "
|
|
1223
|
+
"required": ["title", "explanation", "id", "stepNumber"],
|
|
1218
1224
|
"properties": {
|
|
1225
|
+
"stepNumber": {
|
|
1226
|
+
"type": "integer",
|
|
1227
|
+
"minimum": 1,
|
|
1228
|
+
"description": "1-based step order number"
|
|
1229
|
+
},
|
|
1230
|
+
"id": {
|
|
1231
|
+
"type": "string",
|
|
1232
|
+
"pattern": "^[a-z0-9-]+$",
|
|
1233
|
+
"description": "Kebab-case unique step identifier (used in dependency graph)"
|
|
1234
|
+
},
|
|
1219
1235
|
"title": {
|
|
1220
1236
|
"type": "string",
|
|
1221
1237
|
"description": "Step title shown in navigation"
|
|
1222
1238
|
},
|
|
1223
|
-
"
|
|
1239
|
+
"explanation": {
|
|
1224
1240
|
"type": "string",
|
|
1225
|
-
"description": "
|
|
1241
|
+
"description": "Detailed explanation of what this code does and why it matters (3-5 sentences minimum)"
|
|
1226
1242
|
},
|
|
1227
1243
|
"file": {
|
|
1228
1244
|
"type": "string",
|
|
@@ -1236,6 +1252,14 @@ docs/
|
|
|
1236
1252
|
"type": "integer",
|
|
1237
1253
|
"description": "Ending line number (for range highlights)"
|
|
1238
1254
|
},
|
|
1255
|
+
"learnsConcept": {
|
|
1256
|
+
"type": "string",
|
|
1257
|
+
"description": "Key concept this step teaches (displayed as concept tag)"
|
|
1258
|
+
},
|
|
1259
|
+
"duration": {
|
|
1260
|
+
"type": "string",
|
|
1261
|
+
"description": "Estimated reading time for this step (e.g., '2 min')"
|
|
1262
|
+
},
|
|
1239
1263
|
"codeSnippet": {
|
|
1240
1264
|
"type": "string",
|
|
1241
1265
|
"description": "Code snippet to display if file is not available"
|
|
@@ -1244,26 +1268,24 @@ docs/
|
|
|
1244
1268
|
"type": "string",
|
|
1245
1269
|
"description": "Language for syntax highlighting of codeSnippet"
|
|
1246
1270
|
},
|
|
1247
|
-
"highlights": {
|
|
1248
|
-
"type": "array",
|
|
1249
|
-
"items": {
|
|
1250
|
-
"type": "object",
|
|
1251
|
-
"properties": {
|
|
1252
|
-
"line": { "type": "integer" },
|
|
1253
|
-
"label": { "type": "string" },
|
|
1254
|
-
"style": { "type": "string", "enum": ["info", "warning", "error", "success"] }
|
|
1255
|
-
},
|
|
1256
|
-
"required": ["line"]
|
|
1257
|
-
},
|
|
1258
|
-
"description": "Line-level highlights within the code"
|
|
1259
|
-
},
|
|
1260
1271
|
"notes": {
|
|
1261
|
-
"type": "
|
|
1262
|
-
"
|
|
1263
|
-
"description": "Additional callouts or tips for this step"
|
|
1272
|
+
"type": "string",
|
|
1273
|
+
"description": "Additional notes for this step"
|
|
1264
1274
|
}
|
|
1265
1275
|
}
|
|
1266
1276
|
}
|
|
1277
|
+
},
|
|
1278
|
+
"dependencies": {
|
|
1279
|
+
"type": "array",
|
|
1280
|
+
"items": {
|
|
1281
|
+
"type": "object",
|
|
1282
|
+
"required": ["source", "target"],
|
|
1283
|
+
"properties": {
|
|
1284
|
+
"source": { "type": "string", "description": "Source step id" },
|
|
1285
|
+
"target": { "type": "string", "description": "Target step id" }
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
"description": "Step dependency edges for the graph visualization"
|
|
1267
1289
|
}
|
|
1268
1290
|
}
|
|
1269
1291
|
}`},{file:`references/generation-pipeline.md`,content:`# Generation Pipeline Reference
|
|
@@ -2595,11 +2617,11 @@ PRDs go in \`docs/prd/PRD-NNN-descriptive-name.md\`. The index lives at \`docs/p
|
|
|
2595
2617
|
Detailed instructions in [references/tour-generation.md](references/tour-generation.md).
|
|
2596
2618
|
|
|
2597
2619
|
**MANDATORY outputs** for every tour:
|
|
2598
|
-
1. \`docs/tours/{name}.
|
|
2620
|
+
1. \`docs/tours/interactive/{name}.json\` — data (must conform to [tour.schema.json](references/tour.schema.json))
|
|
2599
2621
|
2. \`docs/tours/interactive/{name}.html\` — interactive viewer (inject JSON into shipped \`assets/tour-viewer.html\`)
|
|
2600
2622
|
|
|
2601
2623
|
**Content quality bar:**
|
|
2602
|
-
- Each step: 3-5 sentence
|
|
2624
|
+
- Each step: 3-5 sentence explanation (what/why/how/connection), include \`stepNumber\`, \`id\`, \`duration\`, and \`learnsConcept\`
|
|
2603
2625
|
- Line numbers MUST be validated against actual source files before saving
|
|
2604
2626
|
- A developer reading only the tour should understand the system without opening files
|
|
2605
2627
|
|