@numericoach/gskills-admin-cli 0.1.19 → 0.1.21
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/README.md +14 -0
- package/dist/gskills-admin.js +222 -2
- package/package.json +1 -1
- package/skills/gskills-admin-cli/SKILL.md +40 -7
- package/skills/gskills-content-sync-cache-ops/SKILL.md +32 -14
- package/skills/gskills-feedback-db-ops/SKILL.md +25 -7
- package/skills/gskills-ops-db-audit/SKILL.md +17 -11
- package/skills/gskills-source-id-repair/SKILL.md +41 -0
- package/skills/gskills-user-session-invalidation/SKILL.md +67 -0
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ gskills-admin sync presets --output json
|
|
|
27
27
|
gskills-admin sync logs --target <instanceId> --take 10 --output json
|
|
28
28
|
gskills-admin sync diff --target <instanceId> --only pages,menus --pages <pageId,pageId> --languages fr,en --output json
|
|
29
29
|
gskills-admin sync diff --target <instanceId> --preset client-content --output json
|
|
30
|
+
gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json
|
|
30
31
|
gskills-admin sync run --targets <instanceId,instanceId> --only pages,quizzes --dry-run --output json
|
|
31
32
|
```
|
|
32
33
|
|
|
@@ -72,10 +73,17 @@ Operational helpers are available for the admin-only flows agents should not imp
|
|
|
72
73
|
```bash
|
|
73
74
|
gskills-admin feedback inspect <feedbackId> --output json
|
|
74
75
|
gskills-admin feedback translation-status <feedbackId> --output json
|
|
76
|
+
gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run --output json
|
|
75
77
|
gskills-admin feedback send-reply <feedbackId> --subject "GSkills - ..." --body-file ./reply.txt --dry-run --output json
|
|
76
78
|
gskills-admin access diagnose --email user@example.com --instance <instanceId> --output json
|
|
77
79
|
gskills-admin access grant --user <userId> --type DEFAULT --dry-run --output json
|
|
78
80
|
gskills-admin internal-knowledge sync-media --source global --since today --languages fr --all-targets --dry-run --output json
|
|
81
|
+
gskills-admin pages backfill-field --field headerColor --all-targets --dry-run --output json
|
|
82
|
+
gskills-admin progress learning-path-quiz-mismatches --instance <instanceId> --output json
|
|
83
|
+
gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run --output json
|
|
84
|
+
gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run --output json
|
|
85
|
+
gskills-admin sessions invalidate --email user@example.com --dry-run --output json
|
|
86
|
+
gskills-admin content-assistant lookup --query "artifact title" --output json
|
|
79
87
|
gskills-admin admin-ingest repair-state --instance <instanceId> --output json
|
|
80
88
|
gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output json
|
|
81
89
|
gskills-admin instances create-plan --output json
|
|
@@ -92,6 +100,10 @@ Feedback reply bodies are file-based on purpose. Production replies are multi-li
|
|
|
92
100
|
|
|
93
101
|
`internal-knowledge sync-media` changes only selected media fields on existing target copies matched by `sourceKnowledgeId`. The default field is `url`, and it invalidates `pages-knowledge` cache for touched instances.
|
|
94
102
|
|
|
103
|
+
The direct-DB replacement commands cover the recurring historical gaps: email-to-feedback import, quiz/course progress repair, source-link repair, page metadata backfill, content-assistant artifact lookup, and JWT session invalidation. Reads stay read-only. Writes require `--dry-run` or `--yes` and log through the app API.
|
|
104
|
+
|
|
105
|
+
Agents can combine the CLI with local code. Use CLI JSON output inside shell loops, `jq`, Bun, Node, or TypeScript helpers for batching, joins, comparisons, retries, and reports. If a small local tool is missing, install or invoke it when useful. Keep production access through the authenticated CLI, not direct DB URLs.
|
|
106
|
+
|
|
95
107
|
Raw project and analytics data can be read or adjusted through resources such as `project-data`, `ticket-sla-rules`, `learning-path-items`, `learning-path-groups`, `quiz-questions`, `quiz-options`, `analytics`, `quiz-attempts`, `user-paths`, `chromebook-progress`, `user-badges`, `user-learning-paths`, and `user-learning-path-item-completions`.
|
|
96
108
|
|
|
97
109
|
## Agent skill
|
|
@@ -103,6 +115,8 @@ gskills-admin skills install --target ~/.codex/skills
|
|
|
103
115
|
gskills-admin skills install --name gskills-vocabulary --target ~/.codex/skills
|
|
104
116
|
gskills-admin skills install --name gskills-customer-playbooks --target ~/.codex/skills
|
|
105
117
|
gskills-admin skills install --name gskills-feedback-db-ops --target ~/.codex/skills
|
|
118
|
+
gskills-admin skills install --name gskills-source-id-repair --target ~/.codex/skills
|
|
119
|
+
gskills-admin skills install --name gskills-user-session-invalidation --target ~/.codex/skills
|
|
106
120
|
```
|
|
107
121
|
|
|
108
122
|
## Output
|
package/dist/gskills-admin.js
CHANGED
|
@@ -780,10 +780,16 @@ var runCommand = async (ctx) => {
|
|
|
780
780
|
return runTranslateCommand(actionOrResource, maybeAction, ctx);
|
|
781
781
|
if (group === "feedback")
|
|
782
782
|
return runFeedbackCommand(actionOrResource, maybeAction, ctx);
|
|
783
|
+
if (group === "progress")
|
|
784
|
+
return runProgressCommand(actionOrResource, ctx);
|
|
783
785
|
if (group === "access")
|
|
784
786
|
return runAccessCommand(actionOrResource, ctx);
|
|
787
|
+
if (group === "sessions")
|
|
788
|
+
return runSessionsCommand(actionOrResource, ctx);
|
|
785
789
|
if (group === "admin-ingest")
|
|
786
790
|
return runAdminIngestCommand(actionOrResource, ctx);
|
|
791
|
+
if (group === "content-assistant")
|
|
792
|
+
return runContentAssistantCommand(actionOrResource, ctx);
|
|
787
793
|
if (group === "entities")
|
|
788
794
|
return runEntitiesCommand(actionOrResource, maybeAction, ctx);
|
|
789
795
|
if (group === "org-units-sync")
|
|
@@ -833,6 +839,9 @@ var runResourceCommand = async (resource, action, maybeId, _rest, ctx) => {
|
|
|
833
839
|
if (resource.name === "internal-knowledge" && action === "sync-media") {
|
|
834
840
|
return runKnowledgeSyncMediaCommand(ctx);
|
|
835
841
|
}
|
|
842
|
+
if (resource.name === "pages" && action === "backfill-field") {
|
|
843
|
+
return runPagesBackfillFieldCommand(ctx);
|
|
844
|
+
}
|
|
836
845
|
if (action === "list")
|
|
837
846
|
return listResource(resource, ctx);
|
|
838
847
|
if (action === "get") {
|
|
@@ -1040,8 +1049,66 @@ var runFeedbackCommand = async (action, feedbackId, ctx) => {
|
|
|
1040
1049
|
})
|
|
1041
1050
|
});
|
|
1042
1051
|
}
|
|
1052
|
+
if (action === "import-email") {
|
|
1053
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1054
|
+
throw new CliError("Importing feedback from email writes production data. Add --yes or use --dry-run.", 2);
|
|
1055
|
+
}
|
|
1056
|
+
const data = await parseJsonObjectFlag(ctx, "data", "data-file");
|
|
1057
|
+
if (Object.keys(data).length === 0)
|
|
1058
|
+
throw new CliError("Missing --data or --data-file JSON", 2);
|
|
1059
|
+
return requestApi("/api/cli/feedback/import-email", {
|
|
1060
|
+
method: "POST",
|
|
1061
|
+
body: JSON.stringify({
|
|
1062
|
+
data,
|
|
1063
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1064
|
+
})
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1043
1067
|
throw new CliError(`Unknown feedback command "${action}"`, 2);
|
|
1044
1068
|
};
|
|
1069
|
+
var runProgressCommand = async (action, ctx) => {
|
|
1070
|
+
if (!action || action === "help")
|
|
1071
|
+
return progressHelp();
|
|
1072
|
+
if (action === "embedded-course") {
|
|
1073
|
+
const userId = getStringFlag(ctx, "user");
|
|
1074
|
+
const quizId = getStringFlag(ctx, "quiz");
|
|
1075
|
+
const pageId = getStringFlag(ctx, "page");
|
|
1076
|
+
if (!userId || !quizId || !pageId)
|
|
1077
|
+
throw new CliError("Missing --user, --quiz, or --page", 2);
|
|
1078
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1079
|
+
throw new CliError("Progress repair writes production data. Add --yes or use --dry-run.", 2);
|
|
1080
|
+
}
|
|
1081
|
+
return requestApi("/api/cli/progress/embedded-course", {
|
|
1082
|
+
method: "POST",
|
|
1083
|
+
body: JSON.stringify({
|
|
1084
|
+
userId,
|
|
1085
|
+
quizId,
|
|
1086
|
+
pageId,
|
|
1087
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1088
|
+
})
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
if (action === "learning-path-quiz-mismatches") {
|
|
1092
|
+
const searchParams = progressSearchParams(ctx);
|
|
1093
|
+
return requestApi(`/api/cli/progress/learning-path-quiz-mismatches?${searchParams.toString()}`);
|
|
1094
|
+
}
|
|
1095
|
+
if (action === "repair-learning-path-quiz-mismatches") {
|
|
1096
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1097
|
+
throw new CliError("Learning path quiz mismatch repair writes production data. Add --yes or use --dry-run.", 2);
|
|
1098
|
+
}
|
|
1099
|
+
return requestApi("/api/cli/progress/repair-learning-path-quiz-mismatches", {
|
|
1100
|
+
method: "POST",
|
|
1101
|
+
body: JSON.stringify({
|
|
1102
|
+
instanceId: getStringFlag(ctx, "instance"),
|
|
1103
|
+
learningPathId: getStringFlag(ctx, "learning-path"),
|
|
1104
|
+
userId: getStringFlag(ctx, "user"),
|
|
1105
|
+
limit: getNumberFlag(ctx, "limit"),
|
|
1106
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1107
|
+
})
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
throw new CliError(`Unknown progress command "${action}"`, 2);
|
|
1111
|
+
};
|
|
1045
1112
|
var runInstanceCreationCommand = async (action, ctx) => {
|
|
1046
1113
|
if (!action || action === "help" || action === "create-plan")
|
|
1047
1114
|
return instanceCreateHelp();
|
|
@@ -1141,6 +1208,49 @@ var runAdminIngestCommand = async (action, ctx) => {
|
|
|
1141
1208
|
}
|
|
1142
1209
|
throw new CliError(`Unknown admin-ingest command "${action}"`, 2);
|
|
1143
1210
|
};
|
|
1211
|
+
var runSessionsCommand = async (action, ctx) => {
|
|
1212
|
+
if (!action || action === "help")
|
|
1213
|
+
return sessionsHelp();
|
|
1214
|
+
if (action !== "invalidate")
|
|
1215
|
+
throw new CliError(`Unknown sessions command "${action}"`, 2);
|
|
1216
|
+
const userIds = [
|
|
1217
|
+
...splitCsv(getStringFlag(ctx, "users")),
|
|
1218
|
+
...splitCsv(getStringFlag(ctx, "user"))
|
|
1219
|
+
];
|
|
1220
|
+
const emails = [
|
|
1221
|
+
...splitCsv(getStringFlag(ctx, "emails")),
|
|
1222
|
+
...splitCsv(getStringFlag(ctx, "email"))
|
|
1223
|
+
];
|
|
1224
|
+
if (userIds.length === 0 && emails.length === 0) {
|
|
1225
|
+
throw new CliError("Missing --user, --users, --email, or --emails", 2);
|
|
1226
|
+
}
|
|
1227
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1228
|
+
throw new CliError("Session invalidation writes production data. Add --yes or use --dry-run.", 2);
|
|
1229
|
+
}
|
|
1230
|
+
return requestApi("/api/cli/sessions/invalidate", {
|
|
1231
|
+
method: "POST",
|
|
1232
|
+
body: JSON.stringify({
|
|
1233
|
+
userIds,
|
|
1234
|
+
emails,
|
|
1235
|
+
instanceId: getStringFlag(ctx, "instance"),
|
|
1236
|
+
reason: getStringFlag(ctx, "reason"),
|
|
1237
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1238
|
+
})
|
|
1239
|
+
});
|
|
1240
|
+
};
|
|
1241
|
+
var runContentAssistantCommand = async (action, ctx) => {
|
|
1242
|
+
if (!action || action === "help")
|
|
1243
|
+
return contentAssistantHelp();
|
|
1244
|
+
if (action !== "lookup")
|
|
1245
|
+
throw new CliError(`Unknown content-assistant command "${action}"`, 2);
|
|
1246
|
+
const searchParams = new URLSearchParams;
|
|
1247
|
+
for (const flag of ["chat", "user", "email", "query", "take"]) {
|
|
1248
|
+
const value = getStringFlag(ctx, flag);
|
|
1249
|
+
if (value)
|
|
1250
|
+
searchParams.set(flag, value);
|
|
1251
|
+
}
|
|
1252
|
+
return requestApi(`/api/cli/content-assistant/lookup?${searchParams.toString()}`);
|
|
1253
|
+
};
|
|
1144
1254
|
var runKnowledgeSyncMediaCommand = async (ctx) => {
|
|
1145
1255
|
const targetInstanceIds = getTargetInstanceIds(ctx);
|
|
1146
1256
|
const allTargets = hasFlag(ctx, "all-targets");
|
|
@@ -1171,6 +1281,34 @@ var runKnowledgeSyncMediaCommand = async (ctx) => {
|
|
|
1171
1281
|
})
|
|
1172
1282
|
});
|
|
1173
1283
|
};
|
|
1284
|
+
var runPagesBackfillFieldCommand = async (ctx) => {
|
|
1285
|
+
const targetInstanceIds = getTargetInstanceIds(ctx);
|
|
1286
|
+
const allTargets = hasFlag(ctx, "all-targets");
|
|
1287
|
+
if (targetInstanceIds.length === 0 && !allTargets) {
|
|
1288
|
+
throw new CliError("Missing --target, --targets, or --all-targets", 2);
|
|
1289
|
+
}
|
|
1290
|
+
if (targetInstanceIds.length > 0 && allTargets) {
|
|
1291
|
+
throw new CliError("Use either --target/--targets or --all-targets, not both", 2);
|
|
1292
|
+
}
|
|
1293
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1294
|
+
throw new CliError("Page backfill writes production data. Add --yes or use --dry-run.", 2);
|
|
1295
|
+
}
|
|
1296
|
+
const field = getStringFlag(ctx, "field");
|
|
1297
|
+
if (!field)
|
|
1298
|
+
throw new CliError("Missing --field", 2);
|
|
1299
|
+
return requestApi("/api/cli/pages/backfill-field", {
|
|
1300
|
+
method: "POST",
|
|
1301
|
+
body: JSON.stringify({
|
|
1302
|
+
sourceInstanceId: getStringFlag(ctx, "source") ?? "global",
|
|
1303
|
+
targetInstanceIds,
|
|
1304
|
+
allTargets,
|
|
1305
|
+
field,
|
|
1306
|
+
languages: splitCsv(getStringFlag(ctx, "languages")),
|
|
1307
|
+
skipCache: hasFlag(ctx, "no-cache"),
|
|
1308
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1309
|
+
})
|
|
1310
|
+
});
|
|
1311
|
+
};
|
|
1174
1312
|
var runEntitiesCommand = async (action, entityId, ctx) => {
|
|
1175
1313
|
if (!action || action === "help")
|
|
1176
1314
|
return entitiesHelp();
|
|
@@ -1291,6 +1429,8 @@ var runSyncCommand = async (action, ctx) => {
|
|
|
1291
1429
|
return syncPresets();
|
|
1292
1430
|
if (action === "logs")
|
|
1293
1431
|
return syncLogs(ctx);
|
|
1432
|
+
if (action === "repair-source-links")
|
|
1433
|
+
return syncRepairSourceLinks(ctx);
|
|
1294
1434
|
if (action !== "run" && action !== "diff")
|
|
1295
1435
|
throw new CliError(`Unknown sync command "${action}"`, 2);
|
|
1296
1436
|
const targetInstanceIds = getTargetInstanceIds(ctx);
|
|
@@ -1414,6 +1554,22 @@ var syncLogs = (ctx) => {
|
|
|
1414
1554
|
searchParams.set("take", String(getNumberFlag(ctx, "take") ?? 10));
|
|
1415
1555
|
return requestApi(`/api/cli/sync/logs?${searchParams.toString()}`);
|
|
1416
1556
|
};
|
|
1557
|
+
var syncRepairSourceLinks = (ctx) => {
|
|
1558
|
+
const targetInstanceId = getStringFlag(ctx, "target") ?? getStringFlag(ctx, "instance");
|
|
1559
|
+
if (!targetInstanceId)
|
|
1560
|
+
throw new CliError("Missing --target", 2);
|
|
1561
|
+
if (!hasFlag(ctx, "yes") && !hasFlag(ctx, "dry-run")) {
|
|
1562
|
+
throw new CliError("Source-link repair writes production data. Add --yes or use --dry-run.", 2);
|
|
1563
|
+
}
|
|
1564
|
+
return requestApi("/api/cli/sync/repair-source-links", {
|
|
1565
|
+
method: "POST",
|
|
1566
|
+
body: JSON.stringify({
|
|
1567
|
+
sourceInstanceId: getStringFlag(ctx, "source") ?? "global",
|
|
1568
|
+
targetInstanceId,
|
|
1569
|
+
dryRun: hasFlag(ctx, "dry-run")
|
|
1570
|
+
})
|
|
1571
|
+
});
|
|
1572
|
+
};
|
|
1417
1573
|
var syncPresets = () => ({
|
|
1418
1574
|
note: "Presets from common super-admin sync runs. Always run sync diff before sync run --yes.",
|
|
1419
1575
|
presets: [
|
|
@@ -1547,6 +1703,22 @@ var entitySearchParams = (ctx) => {
|
|
|
1547
1703
|
searchParams.set("language", language);
|
|
1548
1704
|
return searchParams;
|
|
1549
1705
|
};
|
|
1706
|
+
var progressSearchParams = (ctx) => {
|
|
1707
|
+
const searchParams = new URLSearchParams;
|
|
1708
|
+
const instanceId = getStringFlag(ctx, "instance");
|
|
1709
|
+
const userId = getStringFlag(ctx, "user");
|
|
1710
|
+
const learningPathId = getStringFlag(ctx, "learning-path");
|
|
1711
|
+
const limit = getStringFlag(ctx, "limit");
|
|
1712
|
+
if (instanceId)
|
|
1713
|
+
searchParams.set("instanceId", instanceId);
|
|
1714
|
+
if (userId)
|
|
1715
|
+
searchParams.set("userId", userId);
|
|
1716
|
+
if (learningPathId)
|
|
1717
|
+
searchParams.set("learningPathId", learningPathId);
|
|
1718
|
+
if (limit)
|
|
1719
|
+
searchParams.set("limit", limit);
|
|
1720
|
+
return searchParams;
|
|
1721
|
+
};
|
|
1550
1722
|
var splitCsv = (value) => value ? value.split(",").map((item) => item.trim()).filter(Boolean) : [];
|
|
1551
1723
|
var setWhereValue = (where, fieldPath, value) => {
|
|
1552
1724
|
const parts = fieldPath.split(".").map((part) => part.trim()).filter(Boolean);
|
|
@@ -1622,6 +1794,10 @@ var getTextFlag = async (ctx, inlineName, fileName) => {
|
|
|
1622
1794
|
}
|
|
1623
1795
|
return getStringFlag(ctx, inlineName);
|
|
1624
1796
|
};
|
|
1797
|
+
var parseJsonObjectFlag = async (ctx, inlineName, fileName) => {
|
|
1798
|
+
const text = await getTextFlag(ctx, inlineName, fileName);
|
|
1799
|
+
return parseJsonObject(text, `--${inlineName}`);
|
|
1800
|
+
};
|
|
1625
1801
|
var getNumberFlag = (ctx, name) => {
|
|
1626
1802
|
const value = getStringFlag(ctx, name);
|
|
1627
1803
|
if (!value)
|
|
@@ -1641,8 +1817,12 @@ var rootHelp = () => ({
|
|
|
1641
1817
|
`gskills-admin pages update <id> --data '{"disabled":true}'`,
|
|
1642
1818
|
"gskills-admin pages delete <id> --force --confirm-delete pages:<id> # soft-disables only",
|
|
1643
1819
|
"gskills-admin sync run --target <instanceId> --only pages,quizzes --yes",
|
|
1820
|
+
"gskills-admin sync repair-source-links --target <instanceId> --dry-run",
|
|
1644
1821
|
"gskills-admin translate pages <id> --to en,es --dry-run",
|
|
1645
|
-
"gskills-admin internal-knowledge sync-media --since today --languages fr --all-targets --dry-run"
|
|
1822
|
+
"gskills-admin internal-knowledge sync-media --since today --languages fr --all-targets --dry-run",
|
|
1823
|
+
"gskills-admin progress learning-path-quiz-mismatches --instance <instanceId>",
|
|
1824
|
+
"gskills-admin sessions invalidate --email user@example.com --dry-run",
|
|
1825
|
+
"gskills-admin content-assistant lookup --query 'draft'"
|
|
1646
1826
|
],
|
|
1647
1827
|
resources: resources.map((resource) => resource.name),
|
|
1648
1828
|
output: "Use --output json, --output jsonl, --output table, or --output markdown. Piped output defaults to JSON.",
|
|
@@ -1672,18 +1852,26 @@ var schemaHelp = () => ({
|
|
|
1672
1852
|
{ name: "sync run", required: ["--target or --targets"], safety: ["--yes or --dry-run"], writes: true },
|
|
1673
1853
|
{ name: "sync logs", flags: ["--target", "--source", "--status", "--take"], writes: false },
|
|
1674
1854
|
{ name: "sync presets", writes: false },
|
|
1855
|
+
{ name: "sync repair-source-links", required: ["--target"], flags: ["--source", "--yes", "--dry-run"], writes: true },
|
|
1675
1856
|
{ name: "cache scopes", writes: false },
|
|
1676
1857
|
{ name: "cache invalidate", required: ["--instance"], flags: ["--scope", "--languages", "--yes", "--dry-run"], writes: true },
|
|
1677
1858
|
{ name: "translate", args: ["kind", "id?"], required: ["--to"], flags: ["--ids", "--all", "--instance", "--from", "--where", "--take", "--mode", "--source-history", "--yes", "--dry-run"], writes: true },
|
|
1678
1859
|
{ name: "internal-knowledge sync-media", flags: ["--source", "--target", "--targets", "--all-targets", "--languages", "--since", "--updated-after", "--fields", "--mime", "--source-type", "--include-disabled", "--include-archived", "--no-cache", "--yes", "--dry-run"], writes: true },
|
|
1860
|
+
{ name: "pages backfill-field", required: ["--field", "--target or --targets or --all-targets"], flags: ["--source", "--languages", "--no-cache", "--yes", "--dry-run"], writes: true },
|
|
1679
1861
|
{ name: "feedback inspect", args: ["feedbackId or URL"], writes: false },
|
|
1680
1862
|
{ name: "feedback translation-status", args: ["feedbackId or URL"], writes: false },
|
|
1863
|
+
{ name: "feedback import-email", flags: ["--data", "--data-file", "--yes", "--dry-run"], writes: true },
|
|
1681
1864
|
{ name: "feedback claim", args: ["feedbackId"], flags: ["--dry-run"], writes: true },
|
|
1682
1865
|
{ name: "feedback send-claim", args: ["feedbackId"], flags: ["--recipient-email", "--recipient-name", "--cc", "--subject", "--body", "--yes", "--dry-run"], writes: true },
|
|
1683
1866
|
{ name: "feedback send-reply", args: ["feedbackId"], flags: ["--subject", "--subject-file", "--body-file", "--translated-subject", "--translated-subject-file", "--translated-body-file", "--user-language", "--current-language", "--yes", "--dry-run"], writes: true },
|
|
1867
|
+
{ name: "progress learning-path-quiz-mismatches", flags: ["--instance", "--learning-path", "--user", "--limit"], writes: false },
|
|
1868
|
+
{ name: "progress repair-learning-path-quiz-mismatches", flags: ["--instance", "--learning-path", "--user", "--limit", "--yes", "--dry-run"], writes: true },
|
|
1869
|
+
{ name: "progress embedded-course", required: ["--user", "--quiz", "--page"], flags: ["--yes", "--dry-run"], writes: true },
|
|
1684
1870
|
{ name: "access diagnose", required: ["--user or --email"], flags: ["--instance"], writes: false },
|
|
1685
1871
|
{ name: "access grant", required: ["--user"], flags: ["--type", "--start-at", "--custom-duration-days", "--preferred-language", "--yes", "--dry-run"], writes: true },
|
|
1686
1872
|
{ name: "access revoke-active", required: ["--user"], flags: ["--yes", "--dry-run"], writes: true },
|
|
1873
|
+
{ name: "sessions invalidate", required: ["--user or --users or --email or --emails"], flags: ["--instance", "--reason", "--yes", "--dry-run"], writes: true },
|
|
1874
|
+
{ name: "content-assistant lookup", flags: ["--chat", "--user", "--email", "--query", "--take"], writes: false },
|
|
1687
1875
|
{ name: "admin-ingest repair-state", required: ["--instance"], writes: false },
|
|
1688
1876
|
{ name: "admin-ingest repair", required: ["--instance"], flags: ["--yes", "--dry-run"], writes: true },
|
|
1689
1877
|
{ name: "instances create-plan", writes: false },
|
|
@@ -1740,6 +1928,8 @@ var syncHelp = () => ({
|
|
|
1740
1928
|
"gskills-admin sync diff --target <instanceId> --preset client-content",
|
|
1741
1929
|
"gskills-admin sync logs --target <instanceId> --take 10",
|
|
1742
1930
|
"gskills-admin sync presets",
|
|
1931
|
+
"gskills-admin sync repair-source-links --target <instanceId> --dry-run",
|
|
1932
|
+
"gskills-admin sync repair-source-links --target <instanceId> --yes",
|
|
1743
1933
|
"gskills-admin sync run --target <instanceId> --yes",
|
|
1744
1934
|
"gskills-admin sync run --targets <id,id> --only pages,quizzes --dry-run",
|
|
1745
1935
|
"gskills-admin sync run --target <instanceId> --only pages,quizzes,learningPaths --pages <id,id> --languages fr,en --yes",
|
|
@@ -1811,6 +2001,8 @@ var feedbackHelp = () => ({
|
|
|
1811
2001
|
"gskills-admin feedback inspect <feedbackId>",
|
|
1812
2002
|
"gskills-admin feedback inspect 'https://client.g-skills.fr/fr/...'",
|
|
1813
2003
|
"gskills-admin feedback translation-status <feedbackId>",
|
|
2004
|
+
"gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run",
|
|
2005
|
+
"gskills-admin feedback import-email --data-file ./feedback-email.json --yes",
|
|
1814
2006
|
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --dry-run",
|
|
1815
2007
|
"gskills-admin feedback send-reply <feedbackId> --subject 'GSkills - ...' --body-file ./reply.fr.txt --yes",
|
|
1816
2008
|
"gskills-admin feedback claim <feedbackId> --dry-run",
|
|
@@ -1819,6 +2011,33 @@ var feedbackHelp = () => ({
|
|
|
1819
2011
|
],
|
|
1820
2012
|
note: "send-reply is the normal feedback detail email template flow. claim/send-claim is only the SLA ticket-taken-in-charge flow."
|
|
1821
2013
|
});
|
|
2014
|
+
var progressHelp = () => ({
|
|
2015
|
+
usage: [
|
|
2016
|
+
"gskills-admin progress learning-path-quiz-mismatches --instance <instanceId>",
|
|
2017
|
+
"gskills-admin progress learning-path-quiz-mismatches --learning-path <pathId> --user <userId>",
|
|
2018
|
+
"gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run",
|
|
2019
|
+
"gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --yes",
|
|
2020
|
+
"gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run",
|
|
2021
|
+
"gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --yes"
|
|
2022
|
+
],
|
|
2023
|
+
note: "Replaces direct DB repairs for passed quiz attempts that did not mark the course or learning-path item complete."
|
|
2024
|
+
});
|
|
2025
|
+
var sessionsHelp = () => ({
|
|
2026
|
+
usage: [
|
|
2027
|
+
"gskills-admin sessions invalidate --email user@example.com --dry-run",
|
|
2028
|
+
"gskills-admin sessions invalidate --emails user@example.com,other@example.com --reason access_rule_change --yes",
|
|
2029
|
+
"gskills-admin sessions invalidate --users <userId,userId> --instance <instanceId> --yes"
|
|
2030
|
+
],
|
|
2031
|
+
note: "Increments sessionVersion and stores the invalidation timestamp and reason without deleting the user."
|
|
2032
|
+
});
|
|
2033
|
+
var contentAssistantHelp = () => ({
|
|
2034
|
+
usage: [
|
|
2035
|
+
"gskills-admin content-assistant lookup --chat <chatId>",
|
|
2036
|
+
"gskills-admin content-assistant lookup --email user@example.com --take 5",
|
|
2037
|
+
"gskills-admin content-assistant lookup --query 'document title'"
|
|
2038
|
+
],
|
|
2039
|
+
note: "Reads recent content-assistant chats and artifact metadata so agents do not query Chat and ChatMessage directly."
|
|
2040
|
+
});
|
|
1822
2041
|
var adminIngestHelp = () => ({
|
|
1823
2042
|
usage: [
|
|
1824
2043
|
"gskills-admin admin-ingest repair-state --instance <instanceId>",
|
|
@@ -1896,7 +2115,8 @@ var resourceHelp = (resource) => ({
|
|
|
1896
2115
|
`gskills-admin ${resource.name} create --data '{"instanceId":"global"}'`,
|
|
1897
2116
|
`gskills-admin ${resource.name} update <id> --data '{"disabled":true}'`,
|
|
1898
2117
|
`gskills-admin ${resource.name} delete <id> --force --confirm-delete ${resource.name}:<id>`,
|
|
1899
|
-
...resource.name === "internal-knowledge" ? [`gskills-admin ${resource.name} sync-media --since today --languages fr --all-targets --dry-run`] : []
|
|
2118
|
+
...resource.name === "internal-knowledge" ? [`gskills-admin ${resource.name} sync-media --since today --languages fr --all-targets --dry-run`] : [],
|
|
2119
|
+
...resource.name === "pages" ? [`gskills-admin ${resource.name} backfill-field --field headerColor --all-targets --dry-run`] : []
|
|
1900
2120
|
],
|
|
1901
2121
|
defaultFields: resource.defaultFields,
|
|
1902
2122
|
cache: {
|
package/package.json
CHANGED
|
@@ -88,12 +88,45 @@ Good pattern:
|
|
|
88
88
|
|
|
89
89
|
1. Use `gskills-admin schema`, resource reads, and specialized commands first.
|
|
90
90
|
2. If the operation needs custom logic, inspect the app code and add or use an authenticated CLI API route.
|
|
91
|
-
3.
|
|
92
|
-
4.
|
|
93
|
-
5.
|
|
91
|
+
3. Combine CLI calls with local code when the operation needs loops, joins, batching, parsing, retries, comparisons, or reports.
|
|
92
|
+
4. Keep the write path behind `--dry-run` and `--yes`.
|
|
93
|
+
5. Log admin-visible writes and invalidate deploy cache when the data affects visible content.
|
|
94
|
+
6. Publish the CLI and bundled skills when a recurring DB-only workaround becomes a normal operation.
|
|
95
|
+
|
|
96
|
+
Good CLI plus code examples:
|
|
97
|
+
|
|
98
|
+
- call `gskills-admin ... --output json` from a shell loop, `jq`, Bun, Node, or TypeScript helper
|
|
99
|
+
- turn CLI JSON into a target list, then call another CLI command per target
|
|
100
|
+
- run a dry-run loop first, inspect the aggregate, then run the same loop with `--yes`
|
|
101
|
+
- use app code to understand domain logic, then expose the actual write behind a CLI route
|
|
102
|
+
- write temporary local scripts for orchestration, but keep repeatable behavior in the CLI or a skill
|
|
103
|
+
|
|
104
|
+
If the local environment is missing a small tool needed for the loop, the agent may install or invoke it, for example `jq`, shell utilities, `bunx`, or a small npm package. Prefer temporary/local tooling over asking for direct DB access. Do not install heavyweight or risky tools without a reason, and never use a tool install as a shortcut around auth, `--dry-run`, `--yes`, admin logs, or cache invalidation.
|
|
94
105
|
|
|
95
106
|
Do not ask an agent for `DATABASE_URL` and do not write a one-off direct DB script when the same job will happen again. Code is still useful, but it should live behind the CLI or a reusable app helper.
|
|
96
107
|
|
|
108
|
+
## Direct DB Replacement Matrix
|
|
109
|
+
|
|
110
|
+
These recurring historical DB-only jobs now have CLI paths:
|
|
111
|
+
|
|
112
|
+
| Former direct DB job | CLI path |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| Feedback context from id or URL | `gskills-admin feedback inspect <feedbackId-or-url> --output json` |
|
|
115
|
+
| Feedback translation fallback audit | `gskills-admin feedback translation-status <feedbackId> --output json` |
|
|
116
|
+
| Import client email into feedback rows | `gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run --output json` |
|
|
117
|
+
| Customer reply from a resolved ticket | `gskills-admin feedback send-reply <feedbackId> --subject "..." --body-file ./reply.txt --dry-run --output json` |
|
|
118
|
+
| Access-pass truth for a user | `gskills-admin access diagnose --email user@example.com --instance <instanceId> --output json` |
|
|
119
|
+
| Existing global knowledge video URL changed | `gskills-admin internal-knowledge sync-media --source global --since today --languages fr --all-targets --dry-run --output json` |
|
|
120
|
+
| Source-link drift after sync | `gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json` |
|
|
121
|
+
| Page metadata backfill from global copies | `gskills-admin pages backfill-field --field headerColor --all-targets --dry-run --output json` |
|
|
122
|
+
| Passed quiz did not complete a page/course | `gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run --output json` |
|
|
123
|
+
| Passed learning-path quiz missing completion row | `gskills-admin progress learning-path-quiz-mismatches --instance <instanceId> --output json` then `gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run --output json` |
|
|
124
|
+
| Force relogin after access/auth data change | `gskills-admin sessions invalidate --email user@example.com --dry-run --output json` |
|
|
125
|
+
| Find content-assistant artifact links | `gskills-admin content-assistant lookup --query "artifact title" --output json` |
|
|
126
|
+
| Admin ingest incomplete sync repair | `gskills-admin admin-ingest repair-state --instance <instanceId> --output json` then `gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output json` |
|
|
127
|
+
|
|
128
|
+
If a job is not in this table, first try `gskills-admin schema --output json` and resource CRUD. If the route is still missing and the job is recurring, add the CLI route before reaching for direct DB access.
|
|
129
|
+
|
|
97
130
|
## Instance Rules
|
|
98
131
|
|
|
99
132
|
If `--instance` is omitted, content-like resources default to `instanceId = "global"`.
|
|
@@ -207,7 +240,7 @@ When explaining CLI work to the user, use `gskills-vocabulary`. Speak like a GSk
|
|
|
207
240
|
|
|
208
241
|
Users could do most of these content tasks in the GSkills UI. The reason they ask Codex is speed. Keep the answer simple: what changed, what stays hidden or visible, and what was verified.
|
|
209
242
|
|
|
210
|
-
After translating content,
|
|
243
|
+
After translating content, use CLI output to prove there are no missing languages, no unexpected active content, no missing related content, and no language mismatch between connected things.
|
|
211
244
|
|
|
212
245
|
For internal knowledge videos, use `knowledge-video`. It queues the same native video localization workflow as the editor, so it creates a localization job instead of copying the original media.
|
|
213
246
|
|
|
@@ -373,7 +406,7 @@ Typical mapping:
|
|
|
373
406
|
|
|
374
407
|
## Feedback Emails
|
|
375
408
|
|
|
376
|
-
Use `inspect`
|
|
409
|
+
Use `inspect` instead of direct DB inspection. It returns the feedback row, user, instance, route metadata, analysis, assignees, recent replies and comments.
|
|
377
410
|
|
|
378
411
|
```bash
|
|
379
412
|
gskills-admin feedback inspect <feedbackId> --output json
|
|
@@ -450,7 +483,7 @@ Use dry-run to inspect the full plan and warnings. The real run creates the inst
|
|
|
450
483
|
|
|
451
484
|
## Accesses
|
|
452
485
|
|
|
453
|
-
Use `access diagnose` before granting, revoking, or
|
|
486
|
+
Use `access diagnose` before granting, revoking, or adding a missing CLI route.
|
|
454
487
|
|
|
455
488
|
```bash
|
|
456
489
|
gskills-admin access diagnose --email user@example.com --instance <instanceId> --output json
|
|
@@ -480,7 +513,7 @@ gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output jso
|
|
|
480
513
|
gskills-admin admin-ingest repair --instance <instanceId> --yes --output json
|
|
481
514
|
```
|
|
482
515
|
|
|
483
|
-
`repair-state` reads the same planner as the admin-console data UI. `repair --yes` queues the existing repair catchup workflow and writes an admin log.
|
|
516
|
+
`repair-state` reads the same planner as the admin-console data UI. `repair --yes` queues the existing repair catchup workflow and writes an admin log. If the deployed CLI path is unavailable, add or deploy the CLI route instead of reviving the old direct snippet.
|
|
484
517
|
|
|
485
518
|
## Entities And Restrictions
|
|
486
519
|
|
|
@@ -7,7 +7,7 @@ description: Use when Codex is asked to maintain GSkills content data outside no
|
|
|
7
7
|
|
|
8
8
|
Use this for Codex-backed maintenance of GSkills content data.
|
|
9
9
|
|
|
10
|
-
This is not about UI visits. It is about proving and fixing content state with
|
|
10
|
+
This is not about UI visits. It is about proving and fixing content state with the CLI, sync logs, cache helpers, and production verification.
|
|
11
11
|
|
|
12
12
|
For normal agents, use `gskills-admin` as the production access layer. If the old fix required direct DB or a repo script, first check whether the CLI now exposes that operation.
|
|
13
13
|
|
|
@@ -48,7 +48,7 @@ Known example:
|
|
|
48
48
|
|
|
49
49
|
## Cache Invalidation After Data Repair
|
|
50
50
|
|
|
51
|
-
Use this when a
|
|
51
|
+
Use this when a data repair or sync leaves old deploy data visible.
|
|
52
52
|
|
|
53
53
|
Rules:
|
|
54
54
|
|
|
@@ -78,6 +78,13 @@ Verify current cache keys disappear or versions increase for sample instances.
|
|
|
78
78
|
|
|
79
79
|
Use this for scoped prod backfills like `Pages.headerColor`.
|
|
80
80
|
|
|
81
|
+
Preferred path:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
gskills-admin pages backfill-field --field headerColor --all-targets --dry-run --output json
|
|
85
|
+
gskills-admin pages backfill-field --field headerColor --all-targets --yes --output json
|
|
86
|
+
```
|
|
87
|
+
|
|
81
88
|
Pattern:
|
|
82
89
|
|
|
83
90
|
1. Count mapped rows.
|
|
@@ -88,10 +95,21 @@ Pattern:
|
|
|
88
95
|
|
|
89
96
|
Known validated shape:
|
|
90
97
|
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
98
|
+
- the CLI writes only `Pages.headerColor`
|
|
99
|
+
- target rows are matched by `crossInstanceID` pointing to a global page
|
|
100
|
+
- historical before count: 49,338 mapped pages, 25,611 mismatches
|
|
101
|
+
- historical after count: 0 mismatches
|
|
102
|
+
|
|
103
|
+
## Source Link Repair
|
|
104
|
+
|
|
105
|
+
Use this when synced content exists but source linkage is missing or stale, especially learning path item/group links, internal knowledge source links, or resource references.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json
|
|
109
|
+
gskills-admin sync repair-source-links --target <instanceId> --yes --output json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The command runs a narrow sync-engine pass for learning paths, knowledge and resources, fixes duplicates, keeps normal sync logging, and invalidates deploy cache after a real repair.
|
|
95
113
|
|
|
96
114
|
## Knowledge Media Reference Sync
|
|
97
115
|
|
|
@@ -123,7 +141,7 @@ gskills-admin admin-ingest repair --instance <instanceId> --dry-run --output jso
|
|
|
123
141
|
gskills-admin admin-ingest repair --instance <instanceId> --yes --output json
|
|
124
142
|
```
|
|
125
143
|
|
|
126
|
-
This uses the same repair planner and catchup workflow as the admin-console data UI.
|
|
144
|
+
This uses the same repair planner and catchup workflow as the admin-console data UI. If the deployed CLI route is missing, add or deploy it before reviving one-off workflow snippets.
|
|
127
145
|
|
|
128
146
|
Verify the queue is empty:
|
|
129
147
|
|
|
@@ -136,13 +154,13 @@ Verify the queue is empty:
|
|
|
136
154
|
|
|
137
155
|
Use this when the user asks for “the artifact” or a content creation thread.
|
|
138
156
|
|
|
139
|
-
|
|
157
|
+
Preferred path:
|
|
140
158
|
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
|
|
159
|
+
```bash
|
|
160
|
+
gskills-admin content-assistant lookup --chat <chatId> --output json
|
|
161
|
+
gskills-admin content-assistant lookup --email user@example.com --take 5 --output json
|
|
162
|
+
gskills-admin content-assistant lookup --query "artifact title" --output json
|
|
163
|
+
```
|
|
146
164
|
|
|
147
165
|
Return the exact prod route:
|
|
148
166
|
|
|
@@ -150,7 +168,7 @@ Return the exact prod route:
|
|
|
150
168
|
https://g-skills.fr/fr/super-admin/global/content-assistant/<chatId>
|
|
151
169
|
```
|
|
152
170
|
|
|
153
|
-
Do not browse manually when the
|
|
171
|
+
Do not browse manually or query `Chat` and `ChatMessage` directly when the CLI lookup can return the artifact metadata.
|
|
154
172
|
|
|
155
173
|
## Broken Deploy Content After Sync
|
|
156
174
|
|
|
@@ -15,9 +15,10 @@ For normal agents, start with the CLI instead of direct DB access:
|
|
|
15
15
|
gskills-admin feedback inspect <feedbackId> --output json
|
|
16
16
|
gskills-admin feedback inspect 'https://client.g-skills.fr/fr/...' --output json
|
|
17
17
|
gskills-admin feedback translation-status <feedbackId> --output json
|
|
18
|
+
gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run --output json
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Do not switch to direct DB for convenience. If the CLI output proves the next required table or action is not exposed yet, add a CLI route or reusable helper.
|
|
21
22
|
|
|
22
23
|
## What Codex Has Actually Been Used For
|
|
23
24
|
|
|
@@ -35,7 +36,7 @@ Use direct DB only when the CLI output proves the next required table is not exp
|
|
|
35
36
|
- Slack `#g-skills-auto` thread, especially Marina replies.
|
|
36
37
|
- Gmail thread when the ticket comes from forwarded client mail.
|
|
37
38
|
- Screenshot and client metadata.
|
|
38
|
-
2. Read
|
|
39
|
+
2. Read production state through the CLI.
|
|
39
40
|
- Prefer `gskills-admin feedback inspect` first.
|
|
40
41
|
- `Feedback`
|
|
41
42
|
- `FeedbackAnalysis`
|
|
@@ -49,7 +50,7 @@ Use direct DB only when the CLI output proves the next required table is not exp
|
|
|
49
50
|
- For imported emails, split separate asks into separate feedbacks.
|
|
50
51
|
4. Act.
|
|
51
52
|
- Use existing app/CLI action when available.
|
|
52
|
-
- If a direct DB write
|
|
53
|
+
- If the old workflow needed a direct DB write, use the matching CLI command or add one.
|
|
53
54
|
- For customer replies, use file-based body text and preserve the customer/user language.
|
|
54
55
|
5. Verify.
|
|
55
56
|
- Re-read feedback state.
|
|
@@ -83,6 +84,15 @@ Verification:
|
|
|
83
84
|
- assignee is Theo when requested,
|
|
84
85
|
- original thread ids preserved in context.
|
|
85
86
|
|
|
87
|
+
CLI import:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
gskills-admin feedback import-email --data-file ./feedback-email.json --dry-run --output json
|
|
91
|
+
gskills-admin feedback import-email --data-file ./feedback-email.json --yes --output json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The JSON payload should include `instanceId`, `userId` or `userEmail`, `description`, optional `summary`, optional `translatedFr`, optional `assigneeIds` or `assigneeEmails`, and `source.gmailThreadId`.
|
|
95
|
+
|
|
86
96
|
## Feedback Closure With Email
|
|
87
97
|
|
|
88
98
|
Use this when the user asks to treat a feedback after a prod fix.
|
|
@@ -119,11 +129,19 @@ Proof chain:
|
|
|
119
129
|
- learning-path item completion rows,
|
|
120
130
|
- relevant runtime function.
|
|
121
131
|
|
|
122
|
-
For embedded quiz completion, the
|
|
132
|
+
For embedded quiz completion, use the CLI:
|
|
123
133
|
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
|
|
134
|
+
```bash
|
|
135
|
+
gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --dry-run --output json
|
|
136
|
+
gskills-admin progress embedded-course --user <userId> --quiz <quizId> --page <pageId> --yes --output json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
For learning-path quiz item mismatches:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
gskills-admin progress learning-path-quiz-mismatches --instance <instanceId> --output json
|
|
143
|
+
gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --dry-run --output json
|
|
144
|
+
gskills-admin progress repair-learning-path-quiz-mismatches --instance <instanceId> --yes --output json
|
|
127
145
|
```
|
|
128
146
|
|
|
129
147
|
Only write after the dry-run proves eligibility.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gskills-ops-db-audit
|
|
3
|
-
description: Use when mining Codex history and prod
|
|
3
|
+
description: Use when mining Codex history and old prod data evidence to identify recurring non-dev GSkills operations, especially data repairs, cache/sync fixes, feedback handling, auth/access changes, and content knowledge retrieval.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GSkills Codex Ops Audit
|
|
7
7
|
|
|
8
8
|
Use this when the user asks what Codex is often used for on GSkills outside normal development work.
|
|
9
9
|
|
|
10
|
-
Do not count UI visits as work. The signal is Codex-led investigation or mutation:
|
|
10
|
+
Do not count UI visits as work. The historical signal is Codex-led investigation or mutation:
|
|
11
11
|
|
|
12
|
-
- prod
|
|
13
|
-
- prod
|
|
12
|
+
- old prod data reads,
|
|
13
|
+
- old prod data writes,
|
|
14
14
|
- Vercel/prod env checks,
|
|
15
15
|
- Slack/Gmail/Chronicle context that leads to GSkills data work,
|
|
16
16
|
- cache invalidation,
|
|
@@ -19,7 +19,7 @@ Do not count UI visits as work. The signal is Codex-led investigation or mutatio
|
|
|
19
19
|
- access/auth/session data changes,
|
|
20
20
|
- content assistant or chat data lookup.
|
|
21
21
|
|
|
22
|
-
For current operations, remember that most agents only have the authenticated CLI, not Theo's direct DB access. The audit should identify which old DB-only steps are now covered by `gskills-admin`, and
|
|
22
|
+
For current operations, remember that most agents only have the authenticated CLI, not Theo's direct DB access. The audit should identify which old DB-only steps are now covered by `gskills-admin`, and any remaining recurring gap should become a CLI route or reusable helper.
|
|
23
23
|
|
|
24
24
|
## Current Pattern Map
|
|
25
25
|
|
|
@@ -27,12 +27,12 @@ This is based on Codex memory and rollout summaries checked on 2026-05-13.
|
|
|
27
27
|
|
|
28
28
|
Common Codex-backed GSkills ops:
|
|
29
29
|
|
|
30
|
-
- Feedback investigation and resolution from URL, Slack, Gmail, screenshots and
|
|
30
|
+
- Feedback investigation and resolution from URL, Slack, Gmail, screenshots and production data.
|
|
31
31
|
- Feedback creation from forwarded client emails into prod `Feedback`, `FeedbackAnalysis`, and `FeedbackAssignee`.
|
|
32
32
|
- Feedback closure after production verification, including assignment, reply row, and Resend email.
|
|
33
33
|
- Course/progress data repair after proving quiz attempts or completion state.
|
|
34
34
|
- Sync/page visibility investigations where prod data and admin logs prove target copies drifted.
|
|
35
|
-
- Cache invalidation after sync or
|
|
35
|
+
- Cache invalidation after sync or data repairs, especially page/menu/app deploy caches.
|
|
36
36
|
- Admin ingest repair workflows for incomplete Google/Admin console data syncs.
|
|
37
37
|
- Bulk page metadata backfills, such as copying `Pages.headerColor` from global to client copies.
|
|
38
38
|
- Auth/access data changes, such as Air Liquide `domainGranular` updates and JWT session invalidation.
|
|
@@ -42,8 +42,8 @@ Common Codex-backed GSkills ops:
|
|
|
42
42
|
|
|
43
43
|
1. Search Codex memory and rollout summaries first.
|
|
44
44
|
- Use `MEMORY.md` to locate relevant summaries.
|
|
45
|
-
- Search `rollout_summaries` for concrete phrases like `
|
|
46
|
-
2. Then inspect
|
|
45
|
+
- Search `rollout_summaries` for concrete phrases like `Feedback`, `cache`, `sync`, `backfill`, `domainGranular`, `sessionVersion`, `content-assistant`.
|
|
46
|
+
2. Then inspect current truth through the CLI when possible.
|
|
47
47
|
- Do not infer old behavior from current logs if the task is historical.
|
|
48
48
|
- Admin logs usually do not tag old Codex work as Codex.
|
|
49
49
|
3. Ignore pure code refactors unless the Codex run also included prod data proof or mutation.
|
|
@@ -58,15 +58,21 @@ Common Codex-backed GSkills ops:
|
|
|
58
58
|
5. Convert repeatable DB-only operations into CLI guidance.
|
|
59
59
|
- feedback context: `gskills-admin feedback inspect`
|
|
60
60
|
- feedback translation fallback: `gskills-admin feedback translation-status`
|
|
61
|
+
- feedback email import: `gskills-admin feedback import-email`
|
|
61
62
|
- access truth: `gskills-admin access diagnose`
|
|
62
63
|
- existing knowledge media reference changes: `gskills-admin internal-knowledge sync-media`
|
|
64
|
+
- source link repair: `gskills-admin sync repair-source-links`
|
|
65
|
+
- page metadata backfill: `gskills-admin pages backfill-field --field headerColor`
|
|
66
|
+
- progress repair: `gskills-admin progress embedded-course` or `progress repair-learning-path-quiz-mismatches`
|
|
67
|
+
- session invalidation: `gskills-admin sessions invalidate`
|
|
68
|
+
- content assistant artifact lookup: `gskills-admin content-assistant lookup`
|
|
63
69
|
- admin ingest repair state and launch: `gskills-admin admin-ingest repair-state` then `repair --yes`
|
|
64
70
|
- cache repairs: `gskills-admin cache invalidate`
|
|
65
71
|
|
|
66
72
|
## High-Signal Rollout Families
|
|
67
73
|
|
|
68
74
|
- `gskills_feedback_resolving_skill_created`
|
|
69
|
-
- Feedback work should start with
|
|
75
|
+
- Feedback work should start with `gskills-admin feedback inspect`, screenshots, route context and recurrence.
|
|
70
76
|
- `gskills_feedback_triage_slack_marina_comments`
|
|
71
77
|
- For tickets, check `#g-skills-auto` and Marina comments before trusting AI summaries.
|
|
72
78
|
- `gskills_feedback_positioning_quiz_completion_bug`
|
|
@@ -94,7 +100,7 @@ When asked for a new skill or workflow, output:
|
|
|
94
100
|
|
|
95
101
|
- what Codex actually did before,
|
|
96
102
|
- the repeated trigger pattern,
|
|
97
|
-
- what
|
|
103
|
+
- what CLI commands, app helpers, or DB tables matter,
|
|
98
104
|
- how to run it safely now,
|
|
99
105
|
- what proof is required before saying it is done.
|
|
100
106
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gskills-source-id-repair
|
|
3
|
+
description: Use when a GSkills sync fails or looks corrupted because source links are missing, duplicated, or stale. Covers `sourceItemId`, `sourceGroupId`, `sourceKnowledgeId`, page `crossInstanceID`, CLI dry-run triage, targeted sync-engine repair runs, and safe cleanup principles.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GSkills Source ID Repair
|
|
7
|
+
|
|
8
|
+
Use this skill when a GSkills instance sync fails with source-link errors or when learning paths look duplicated, stale, or half-synced.
|
|
9
|
+
|
|
10
|
+
Start here, not with direct DB or ad hoc scripts:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json
|
|
14
|
+
gskills-admin sync repair-source-links --target <instanceId> --yes --output json
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The dry-run returns mapped and missing counts for learning path items, learning path groups, internal knowledge, and pages. The real run performs a narrow sync-engine repair for learning paths, knowledge, and resources, fixes duplicates, logs the operation, and invalidates deploy cache.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
- Start with the CLI dry-run.
|
|
22
|
+
- Fix the data, not just the app fallback.
|
|
23
|
+
- Prefer the sync engine over ad hoc SQL when it can reconcile structure.
|
|
24
|
+
- Only consider manual cleanup after checking completions and source structure in code.
|
|
25
|
+
- If this becomes recurring, add another CLI route or extend `sync repair-source-links`.
|
|
26
|
+
|
|
27
|
+
## Triage
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
gskills-admin sync logs --target <instanceId> --take 10 --output json
|
|
31
|
+
gskills-admin sync repair-source-links --target <instanceId> --dry-run --output json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If the dry-run shows missing links, run the same command with `--yes` after approval, then dry-run again.
|
|
35
|
+
|
|
36
|
+
## Done Criteria
|
|
37
|
+
|
|
38
|
+
- CLI dry-run shows the expected before counts.
|
|
39
|
+
- Real repair ran with `--yes` only after approval.
|
|
40
|
+
- Follow-up dry-run shows no remaining repairable source-link gap.
|
|
41
|
+
- A fresh sync no longer fails on the source-id bug.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gskills-user-session-invalidation
|
|
3
|
+
description: Use when you need to disconnect one or more GSkills users without using the UI. Covers the CLI invalidation command, User.sessionVersion, sessionInvalidatedAt, sessionInvalidationReason, how NextAuth JWT sessions are invalidated, and how to verify the next browser request forces relogin.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GSkills User Session Invalidation
|
|
7
|
+
|
|
8
|
+
Use this skill when a GSkills user must be disconnected from their current browser session without deleting, unlinking, or changing their account.
|
|
9
|
+
|
|
10
|
+
This is not for access passes, role changes, or nuking auth provider records.
|
|
11
|
+
|
|
12
|
+
## What Disconnect Means
|
|
13
|
+
|
|
14
|
+
GSkills uses JWT sessions. You cannot delete a server-side session row because there is no session table to delete.
|
|
15
|
+
|
|
16
|
+
The app invalidates a browser session by comparing two versions:
|
|
17
|
+
|
|
18
|
+
- `User.sessionVersion` in the database
|
|
19
|
+
- `token.sessionVersion` inside the user's existing JWT cookie
|
|
20
|
+
|
|
21
|
+
When `User.sessionVersion` is greater than the JWT version, the next request marks the session as `SessionInvalidated`.
|
|
22
|
+
|
|
23
|
+
Then the protected layouts redirect to:
|
|
24
|
+
|
|
25
|
+
`/api/auth/force-signout?redirectTo=...`
|
|
26
|
+
|
|
27
|
+
That route handler calls Auth.js `signOut()`, which clears the browser auth cookies. The user lands on sign in and must log in again.
|
|
28
|
+
|
|
29
|
+
## CLI
|
|
30
|
+
|
|
31
|
+
Single user:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
gskills-admin sessions invalidate --email user@company.com --dry-run --output json
|
|
35
|
+
gskills-admin sessions invalidate --email user@company.com --reason admin_forced_relogin --yes --output json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Bulk:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gskills-admin sessions invalidate --emails alice@company.com,bob@company.com --dry-run --output json
|
|
42
|
+
gskills-admin sessions invalidate --emails alice@company.com,bob@company.com --reason admin_forced_relogin --yes --output json
|
|
43
|
+
gskills-admin sessions invalidate --users <userId,userId> --instance <instanceId> --dry-run --output json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The dry-run returns matched users, missing targets, and before/after session fields. If any target is missing, stop and resolve the email or instance first.
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
|
|
50
|
+
- Use `gskills-admin sessions invalidate`, not direct DB.
|
|
51
|
+
- The CLI updates only `User.sessionVersion`, `sessionInvalidatedAt`, and `sessionInvalidationReason`.
|
|
52
|
+
- Do not delete auth provider rows.
|
|
53
|
+
- Do not revoke access passes unless the user explicitly asks for access removal.
|
|
54
|
+
- Do not confuse disconnection with access.
|
|
55
|
+
|
|
56
|
+
## Verification
|
|
57
|
+
|
|
58
|
+
The CLI response includes invalidated count, missing targets, invalidation timestamp, and reason.
|
|
59
|
+
|
|
60
|
+
Behavior verification:
|
|
61
|
+
|
|
62
|
+
- If the user already has an old JWT, their next request should redirect through `/api/auth/force-signout`.
|
|
63
|
+
- The force signout route clears cookies.
|
|
64
|
+
- The user should land on `/[lang]/auth/signin`.
|
|
65
|
+
- They should not see `Accès refusé`.
|
|
66
|
+
|
|
67
|
+
Access is separate from disconnection. Access is controlled by active `AccessPass`, role based access, and instance/entity restrictions.
|