Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/skills/verify-10x-cli/features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ proof.
- [Get a lesson](./get.md) — apply, dry run, print, filters, errors, interactive conflicts.
- [Sync lessons](./sync.md) — upstream updates, preserved local edits, cheap skip, `--force`.
- [Toolkit changelog](./changelog.md) — baseline recorded by sync/get, new releases, `--since`, older backend.
- [Skill glossary](./skill.md) — `10x skill <name>`: JSON and TTY output, aliases, language, typos, older backend.
- [Diagnose the setup](./doctor.md) — `10x doctor` report.

Not mapped yet: `10x helpers install` (offline, bundled skills), `10x bench`,
Expand Down
34 changes: 34 additions & 0 deletions .claude/skills/verify-10x-cli/features/skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Skill glossary

A learner runs `10x skill <name>` and reads a short terminal entry for one course skill:
place in the workflow, problem, solution, when to use it, what it produces and related
skills, in English or Polish. It reads nothing but the project's course and writes nothing.

## Sub-features

- `skill-found` — a known name, in JSON and in a TTY.
- `skill-aliases` — `/name` and a name without the `10x-` prefix resolve to the same entry.
- `skill-lang` — `--lang pl` returns Polish text and labels.
- `skill-missing` — an unknown name exits `5` and suggests close names.
- `skill-usage` — an invalid name or `--lang` exits `2`.
- `skill-unsupported` — a backend without the route exits `1`.

## Driving it with verify.sh

Preconditions: baseline run with `$V seed-auth`. The fake serves one overview,
`verify-fixture-skill`.

- **Found.** `$V cli found -- skill verify-fixture-skill`: exit `0`,
`data.overview.name` `verify-fixture-skill`, `data.overview.language` `en`.
`$V tty found-tty -- skill verify-fixture-skill` shows `Problem`, `Solution`, `Use when`,
`Produces` and `Related`.
- **Aliases.** `$V cli slash -- skill /verify-fixture-skill` returns the same entry.
- **Language.** `$V cli pl -- skill verify-fixture-skill --lang pl`:
`data.overview.language` `pl`. In a TTY the labels read `Rozwiązanie`, `Kiedy`, `Tworzy`.
- **Missing.** `$V cli missing -- skill verify-fixture-skil`: exit `5`, `error.code`
`skill_overview_not_found`, `error.hint` names `verify-fixture-skill`.
- **Usage.** `$V cli bad-name -- skill ../etc` exits `2` with `invalid_skill_name`;
`$V cli bad-lang -- skill verify-fixture-skill --lang de` exits `2` with `invalid_lang`.
- **Older backend.** `curl -X POST "$api/__fake/skill-overviews/route?enabled=0"`, then
`$V cli off -- skill verify-fixture-skill`: exit `1`, `error.code`
`skill_overviews_unsupported`.
32 changes: 31 additions & 1 deletion .claude/skills/verify-10x-cli/scripts/fake-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
// GET /__fake/requests request log (also <run-dir>/requests.log)
// POST /__fake/changelog/release publish a newer toolkit release (next patch, released now)
// POST /__fake/changelog/route?enabled=<0|1> remove / restore GET /api/changelog (404 = older backend)
// POST /__fake/skill-overviews/route?enabled=<0|1> remove / restore GET /api/skill-overviews

import { createHash, generateKeyPairSync, sign } from "node:crypto";
import { appendFileSync, writeFileSync } from "node:fs";
import { join } from "node:path";
import type { paths } from "../../../../src/generated/api-types";
// Not in the generated types yet (toolkit release-changelog); the CLI's hand-written shape.
import type { ChangelogEntry } from "../../../../src/lib/api-content";
import type { ChangelogEntry, SkillOverview } from "../../../../src/lib/api-content";

// JSON body of a documented response, so regenerated api-types flag drift here too.
type Body<P extends keyof paths, M extends "get" | "post", S extends number = 200> =
Expand Down Expand Up @@ -93,6 +94,30 @@ const changelog: ChangelogEntry[] = [
releaseEntry("v2.59.0", "v2.58.1", "2026-10-01T09:00:00.000Z"),
];
let changelogRoute = true;

// Skill glossary: verify-fixture-skill belongs to the fixture course, related
// skills outside it are never served.
let skillOverviewsRoute = true;
const skillOverview = (language: "en" | "pl"): SkillOverview => ({
name: "verify-fixture-skill",
language,
updatedAt: "2026-11-01T10:00:00.000Z",
stage: language === "pl" ? "Główny łańcuch, krok 3: po research, przed implement" : "Core chain, step 3: after research, before implement",
problem: language === "pl" ? "Agent bez planu podejmuje kluczowe decyzje po cichu i odkrywasz je dopiero w diffie." : "Without a plan the agent makes key decisions silently, and you find them in the diff.",
solution: language === "pl" ? "Przepytuje Cię i zapisuje etapy z warunkami sukcesu." : "Interviews you and writes phases with success criteria.",
whenToUse: language === "pl" ? "Przed każdą zmianą większą niż szybki fix." : "Before any change bigger than a quick fix.",
artifacts: [{ path: "context/changes/<change-id>/plan.md", purpose: language === "pl" ? "Etapy i checklista Progress" : "Phases and the Progress checklist" }],
related: [{ name: "verify-m1l2-skill", why: language === "pl" ? "Realizuje plan" : "Executes the plan" }],
});

/** GET /api/skill-overviews?course=<known course>&lang=en|pl */
function skillOverviewsResponse(q: URLSearchParams): Response {
const lang = q.get("lang") ?? "en";
if (lang !== "en" && lang !== "pl") return fail("invalid_query", 400);
const course = q.get("course");
if (course !== null && course !== "10xdevs3" && course !== "10xdevs-3") return fail("course_not_found", 404);
return json({ overviews: [skillOverview(lang)] });
}
const semver = (v: string) => /^v(\d+)\.(\d+)\.(\d+)$/.exec(v)?.slice(1).map(Number);
const semverGt = (a: number[], b: number[]) => {
for (let i = 0; i < 3; i++) if (a[i]! !== b[i]!) return a[i]! > b[i]!;
Expand Down Expand Up @@ -198,6 +223,10 @@ async function route(req: Request): Promise<Response> {
changelog.unshift(entry);
return json({ version: entry.version, releasedAt: entry.releasedAt });
}
if (path === "/__fake/skill-overviews/route" && req.method === "POST") {
skillOverviewsRoute = url.searchParams.get("enabled") !== "0";
return json({ skillOverviewsRoute });
}
if (path === "/__fake/changelog/route" && req.method === "POST") {
changelogRoute = url.searchParams.get("enabled") !== "0";
return json({ changelogRoute });
Expand All @@ -223,6 +252,7 @@ async function route(req: Request): Promise<Response> {

if (!authed(req)) return fail("unauthorized", 401);
if (path === "/api/changelog") return changelogRoute ? changelogResponse(url.searchParams) : fail("not_found", 404);
if (path === "/api/skill-overviews") return skillOverviewsRoute ? skillOverviewsResponse(url.searchParams) : fail("not_found", 404);
if (path === "/api/me/courses")
return json({ courses: [{ ...COURSE, available: true }], defaultCourse: COURSE.slug } satisfies Body<"/api/me/courses", "get">);

Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- **`10x skill <name>` explains a course skill in the terminal.** A short glossary
entry: place in the 10x workflow, problem, solution, when to use it, what it
produces and up to three related skills, in English or Polish (`--lang`). It follows
the project's course (`--course`), suggests close names for a typo, and needs a
backend serving `GET /api/skill-overviews`.
- **Factory AI is a supported tool profile.** `--tool factory` writes skills
under `.factory/skills/`, prompts under `.factory/commands/`, config templates
under `.factory/config-templates/`, and course rules to root `AGENTS.md`.
Expand Down
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Profile migration preserves course and both ownership ledgers. It copies to the
- **Recording** (`lib/toolkit-baseline.ts`) runs after a real `sync` with no errored lesson and not aborted (skipped conflicts still count), and after an unfiltered, non-dry-run `get`. It fetches `limit=1` and calls `recordToolkitVersion()`, which re-reads the manifest right before writing so ownership written during the run is never clobbered. It is strictly best-effort: 404/network/empty/invalid responses leave the manifest untouched and never change output, JSON envelope or exit code (only `--verbose` mentions it).
- **Resolution** in `changelog`: `--since vX.Y.Z` (→ `since`, exclusive) or `YYYY-MM-DD` (→ `sinceDate`, inclusive) > `toolkit.version` > newest lesson `appliedAt` / `lastApplied` > none (limit 5 + "Run 10x sync" hint). A 404 maps to `changelog_unsupported` (exit 1). `ChangelogResponse` is hand-written in `api-content.ts` until generated types include the route.

## `10x skill` & skill overviews

`commands/skill.ts` is read-only and renders one entry from `GET /api/skill-overviews`: a terminal glossary, so keep the output short. The toolkit generates the text from each `SKILL.md` when it changes on master; the CLI filters the course-scoped list locally, which is also what powers its typo suggestions. Course scope reuses `resolveCourseScope()` from `changelog.ts`. All text is remote-controlled: sanitize before printing and wrap before styling.

## Conventions worth knowing

- TypeScript is `strict` + `noUncheckedIndexedAccess` + `noImplicitOverride`. Index access on arrays/records returns `T | undefined` — handle it.
Expand Down
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ remain visible. Full lesson downloads and other commands remain available below.
| `10x get <ref>` | Fetch a lesson and apply artifacts to your workspace |
| `10x sync` | Bulk-download / refresh lessons and report what changed upstream |
| `10x changelog` | Show 10x-toolkit release notes since your last sync |
| `10x skill <name>` | Explain a skill: problem, solution, when to use it, what it produces, related skills |
| `10x doctor` | Diagnose auth, API connectivity, and local config |
| `10x bench` | Live top-10 AI model leaderboard from [10xbench.ai](https://10xbench.ai) — no login needed |
| `10x bench-kit <action>` | Create (`init`) and update (`update`) a company benchmark instance from the [10x-bench-kit](https://github.com/przeprogramowani/10x-bench-kit) template |
Expand Down Expand Up @@ -330,6 +331,51 @@ a backend that does not serve the changelog yet the command fails with
(`--json` or piped) is `{ baseline: { source, version?, date?, recordedAt? },
course, newEntries, entries }` (`course` is `null` outside a project), where `source` is `flag`, `sync`, `applied` or `none`.

### `10x skill <name>`

`10x skill <name>` is a terminal glossary of the course skills: what a skill is for and
where it sits in the 10x workflow, short enough to read next to your work. It needs a
login and never writes anything.

```bash
10x skill 10x-plan
10x skill plan --lang pl # the 10x- prefix and a leading / are optional
10x skill 10x-plan --course 10xdevs4
```

```text
/10x-plan
Core chain, step 3: after research, before implement

Problem Agents that code without a plan make key decisions silently, and you find
them in the diff when they are expensive to undo.
Solution Interviews you with recommendations, forces decisions while they are cheap,
and writes phases with success criteria.
Use when Before implementing any change bigger than a quick fix.

Produces context/changes/<change-id>/plan.md
Phases, success criteria and the Progress checklist

Related /10x-research Gathers the evidence the plan is built on
/10x-plan-review Challenges the plan before any code
/10x-implement Executes the plan phase by phase
```

| Flag | Description |
|------|-------------|
| `--course <course>` | Look in one course instead of this project's course (e.g. `10xdevs4`) |
| `--lang <lang>` | `en` or `pl` (default: your configured language, then `en`) |

The course follows the same rule as `10x changelog`: the flag, then the project's
course, then every course you have. Overviews are generated by the toolkit from each
skill's `SKILL.md` and refresh when that skill changes on its master branch, so a frozen
course's copy of a skill can be older than its overview. An unknown name exits `5` with
`skill_overview_not_found` and suggests close names; invalid usage exits `2`, a missing
login `3`, an account without access to the course `4`. A backend that does not serve
overviews yet fails with `skill_overviews_unsupported` (exit `1`). JSON output (`--json`
or piped) is `{ course, overview: { name, language, updatedAt, stage, problem, solution,
whenToUse, artifacts: [{ path, purpose }], related: [{ name, why }] } }`.

### `10x bench`

Shows the [10xBench](https://10xbench.ai) leaderboard — the top 10 AI models
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@przeprogramowani/10x-cli",
"version": "1.31.0",
"version": "1.32.0",
"description": "Open-source CLI for 10xDevs course content",
"repository": {
"type": "git",
Expand Down
13 changes: 13 additions & 0 deletions skills/10x-cli-guide/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ skill/prompt edits and does not bypass protected rules or safe removal. Config
templates remain create-only. Cleanup preserves modified/untracked files and
files owned elsewhere; do not manually sweep a skill directory after sync.

To explain what one course skill is for, use `skill` (**unreleased**: check the
actual runner's `skill --help` first). It prints the problem, solution, when to use
it, what it produces and up to three related skills; it reads nothing from the project
except its course and writes nothing.

```bash
10x_cli skill 10x-plan # this project's course, configured language
10x_cli skill plan --lang pl # the 10x- prefix and leading / are optional
10x_cli skill 10x-plan --course 10xdevs4
```

To see what changed in the course toolkit itself, use `changelog`. This command
is **unreleased**: check the actual runner's `changelog --help` first.

Expand Down Expand Up @@ -294,6 +305,8 @@ visible. Doctor exit 78 can coexist with outer JSON `status: "ok"`.
| Locked or unpublished v4 | Inspect module availability/release evidence; do not bypass the gate or fall back to v3. |
| Unsupported name/missing index | Verify exact CLI package and content release; preserve the error for the release owner. |
| `changelog_unsupported` | The backend does not serve the toolkit changelog yet; sync/get still work. Retry later; do not treat it as a content failure. |
| `skill_overview_not_found` | No overview for that name in this course. Use the suggested names from the hint, or `--course` for another course. |
| `skill_overviews_unsupported` | The backend does not serve skill overviews yet; sync/get still work. Retry later. |
| Network/API failure | Keep diagnostics, retry the same context when service returns; no config reset. |
| Missing `10x-idea-check` after setup | Older helper journeys selected only init/shape/prd. Check the actual commands, selected profile path and manifest; use the idea-check preview/get above to add its complete tree. If the files already exist, read that exact SKILL.md and check the agent's discovery/reload behavior before reinstalling. An absent slash command alone does not prove missing files. |
| Wrong directory/profile | Recheck cwd and explicit flags; a fresh project may legitimately have no tool directory. |
Expand Down
2 changes: 1 addition & 1 deletion src/commands/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface CourseScope {
}

/** `--course`, else the project's course; a corrupt or conflicting project stops here, as in get/sync. */
function resolveCourseScope(ctx: OutputContext, raw: unknown, projectRoot: string): CourseScope {
export function resolveCourseScope(ctx: OutputContext, raw: unknown, projectRoot: string): CourseScope {
if (raw !== undefined) {
const value = typeof raw === "string" ? raw.trim() : "";
if (!value) outputError(ctx, "invalid_course", "--course needs a course, e.g. '10xdevs4'.", ExitCodes.USAGE);
Expand Down
Loading
Loading