diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc415e9c..dd553daa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,3 +35,6 @@ jobs: - name: Build run: npm run build + + - name: Package generated skills + run: npm run skills:package diff --git a/.github/workflows/publish-skills.yml b/.github/workflows/publish-skills.yml new file mode 100644 index 00000000..3fe62af8 --- /dev/null +++ b/.github/workflows/publish-skills.yml @@ -0,0 +1,49 @@ +name: Publish Interview AI Skills + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: publish-interview-skills + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7 + with: + node-version: 26 + + - name: Generate and verify skills + run: npm run skills:check + + - name: Package skills + run: npm run skills:package + + - name: Publish downloadable archives + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + if ! gh release view skills-latest >/dev/null 2>&1; then + gh release create skills-latest \ + --target "$GITHUB_SHA" \ + --title "Interview AI Skills (latest)" \ + --notes "Automatically generated from the interview handbook on main." \ + --latest=false + fi + gh release upload skills-latest dist/skill-archives/*.zip --clobber diff --git a/.gitignore b/.gitignore index f46371cb..b4dfc2bc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ pnpm-debug.log* public/examples/angular public/examples/react dist + +# Generated AI skills are published as GitHub Release assets +/skills/*/SKILL.md +/skills/*/references/ diff --git a/.prettierignore b/.prettierignore index 66ae216e..16255cdd 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,5 @@ package-lock.json +# Generated from src/pages/**/index.md; maintained by npm run skills:generate +skills/*/SKILL.md +skills/*/references/*.md diff --git a/README.md b/README.md index 66528b88..f936b4f7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,31 @@ Вопросы и практические задания для подготовки разработчиков к собеседованиям: инженерные основы, Frontend, Backend, архитектура, инфраструктура, командная работа и карьера. +## AI Skills для подготовки к собеседованиям + +Кроме справочника, в репозитории есть [каталог AI Skills](https://angular-ru.github.io/interview/skills/). Каждый раздел +вопросов доступен как отдельный скилл для AI-агентов: он проводит пробное интервью по теме, проверяет ответы, объясняет +ошибки и адаптирует сложность под Junior, Middle или Senior. + +Установить все тематические скиллы: + +```bash +npx skills@latest add https://github.com/Angular-RU/angular-ru-interview-questions/releases/download/skills-latest/all.zip +``` + +Или только Angular: + +```bash +npx skills@latest add https://github.com/Angular-RU/angular-ru-interview-questions/releases/download/skills-latest/angular.zip +``` + +Генератор использует `src/pages/**/index.md` как единственный источник вопросов и ответов. При сборке он создает +`skills/<тема>/SKILL.md` и `references/part-XX.md` локально; эти файлы **не хранятся в Git**. После каждого push в +`main` GitHub Actions публикует обновленные ZIP-архивы в +[GitHub Release `skills-latest`](https://github.com/Angular-RU/angular-ru-interview-questions/releases/tag/skills-latest). +Каждую тему можно установить отдельно, а `all.zip` содержит все 26 тем. После установки все вопросы и ответы доступны +без доступа к сайту. Генерация и проверка выполняются автоматически через `npm run skills:check`. + ## Основы и инструменты ### Архитектура компьютера [Computer Science logo](public/logos/computer-science.svg) diff --git a/package.json b/package.json index 4522fc1f..0a7543c4 100644 --- a/package.json +++ b/package.json @@ -18,14 +18,17 @@ "scripts": { "predev": "npm run prebuild", "dev": "astro dev", - "prebuild": "npm run build:public --workspaces --if-present", + "prebuild": "npm run skills:check && npm run build:public --workspaces --if-present", "build": "astro build", "postbuild": "pagefind --site dist --exclude-selectors \".sidebar-navigation, .site-search\"", "preview": "astro preview", "debug": "npm run build && astro preview --host 127.0.0.1 --port 4321", "astro": "astro", - "format": "prettier \"!package-lock.json\" . --ignore-path .gitignore --write", - "format:check": "prettier \"!package-lock.json\" . --ignore-path .gitignore --check" + "format": "prettier \"!package-lock.json\" . --ignore-path .gitignore --ignore-path .prettierignore --write", + "format:check": "prettier \"!package-lock.json\" . --ignore-path .gitignore --ignore-path .prettierignore --check", + "skills:check": "npm run skills:generate && node scripts/check-skills.mjs && node scripts/generate-skills.mjs --check", + "skills:generate": "node scripts/generate-skills.mjs", + "skills:package": "bash scripts/package-skills.sh" }, "devDependencies": { "@astrojs/markdown-remark": "7.3.5", diff --git a/scripts/check-skills.mjs b/scripts/check-skills.mjs new file mode 100644 index 00000000..0eb5d12e --- /dev/null +++ b/scripts/check-skills.mjs @@ -0,0 +1,38 @@ +import assert from 'node:assert/strict'; +import {existsSync, readFileSync, readdirSync, statSync} from 'node:fs'; +import {join} from 'node:path'; + +const root = new URL('../', import.meta.url).pathname; +const catalog = JSON.parse(readFileSync(join(root, 'skills/catalog.json'), 'utf8')); +const slugs = new Set(); + +for (const skill of catalog) { + assert.match(skill.slug, /^[a-z0-9]+(?:-[a-z0-9]+)*$/); + assert(!slugs.has(skill.slug), `Duplicate skill: ${skill.slug}`); + slugs.add(skill.slug); + assert(skill.title && skill.description && skill.category); + assert(skill.topics.length >= 3, `Missing topic coverage: ${skill.slug}`); + + const pagePath = join(root, 'src/pages', skill.slug, 'index.md'); + assert(existsSync(pagePath), `Missing topic page: ${skill.slug}`); + assert.match(readFileSync(pagePath, 'utf8'), /kind:\s*questions/); + + const path = join(root, 'skills', skill.slug, 'SKILL.md'); + assert(existsSync(path), `Missing SKILL.md: ${skill.slug}`); + const content = readFileSync(path, 'utf8'); + assert(content.startsWith(`---\nname: ${skill.slug}\ndescription:`), `Invalid frontmatter: ${skill.slug}`); + assert(content.includes(`/interview/${skill.slug}/`), `Missing handbook link: ${skill.slug}`); +} + +const pageSlugs = readdirSync(join(root, 'src/pages')) + .filter((entry) => existsSync(join(root, 'src/pages', entry, 'index.md'))) + .filter((entry) => /kind:\s*questions/.test(readFileSync(join(root, 'src/pages', entry, 'index.md'), 'utf8'))) + .sort(); +assert.deepEqual([...slugs].sort(), pageSlugs, 'Catalog must match all question pages'); + +const skillDirs = readdirSync(join(root, 'skills')) + .filter((entry) => statSync(join(root, 'skills', entry)).isDirectory()) + .sort(); +assert.deepEqual(skillDirs, [...slugs].sort(), 'Skill directories must match catalog'); + +console.log(`Validated ${catalog.length} installable skills and question pages.`); diff --git a/scripts/generate-skills.mjs b/scripts/generate-skills.mjs new file mode 100644 index 00000000..91abcc6c --- /dev/null +++ b/scripts/generate-skills.mjs @@ -0,0 +1,171 @@ +import assert from 'node:assert/strict'; +import {existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync} from 'node:fs'; +import {join} from 'node:path'; +import {fileURLToPath} from 'node:url'; + +const root = fileURLToPath(new URL('../', import.meta.url)); +const catalog = JSON.parse(readFileSync(join(root, 'skills/catalog.json'), 'utf8')); +const check = process.argv.includes('--check'); +const maxChunkSize = 48_000; +const generated = new Set(); + +function convertQuestions(source, slug) { + const body = source.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n/, ''); + const sourceCount = (body.match(/)/gi) ?? []).length; + let convertedCount = 0; + + const converted = body.replace( + /
\s*]*)?>([\s\S]*?)<\/summary>([\s\S]*?)<\/details>/gi, + (_, question, content) => { + convertedCount++; + const title = question.replace(/<[^>]+>/g, '').trim(); + let answer = content + .trim() + .replace(/^\s*/i, '') + .trim(); + answer = answer.replace(/^
\s*/i, '').replace(/\s*<\/td><\/tr><\/table>$/i, ''); + return '\n\n#### Вопрос: ' + title + '\n\n' + answer.trim() + '\n\n'; + }, + ); + + assert(convertedCount > 0, 'No questions extracted from ' + slug); + // Some answers contain literal HTML examples with
tags. + assert(sourceCount - convertedCount <= 1, 'Unconverted questions in ' + slug); + const markdown = converted.replace( + /(!\[[^\]]*\]\()(assets\/[^)]+)(\))/g, + (_, before, asset, after) => + before + + 'https://raw.githubusercontent.com/Angular-RU/angular-ru-interview-questions/main/src/pages/' + + slug + + '/' + + asset + + after, + ); + + return {markdown, count: convertedCount}; +} + +function splitIntoChunks(markdown) { + const sections = markdown.split(/(?=^###\s)/m); + const chunks = []; + let current = {text: '', topics: new Set()}; + let lastTopic = 'Основы'; + + const flush = () => { + if (!current.text.trim()) return; + chunks.push({text: current.text.trim(), topics: [...current.topics]}); + current = {text: '', topics: new Set()}; + }; + + for (const section of sections) { + const match = section.match(/^###\s+(.+)$/m); + if (match) lastTopic = match[1].trim(); + const pieces = section.length > maxChunkSize ? section.split(/(?=^#### Вопрос: )/m) : [section]; + + for (const piece of pieces) { + if (!piece.trim()) continue; + if (current.text.length && current.text.length + piece.length > maxChunkSize) flush(); + current.text += piece; + current.topics.add(lastTopic); + } + } + flush(); + return chunks; +} + +function generateSkill(skill) { + const page = readFileSync(join(root, 'src/pages', skill.slug, 'index.md'), 'utf8'); + const {markdown, count} = convertQuestions(page, skill.slug); + const chunks = splitIntoChunks(markdown); + const items = new Map(); + const index = []; + for (const [i, chunk] of chunks.entries()) { + const filename = 'part-' + String(i + 1).padStart(2, '0') + '.md'; + const file = 'skills/' + skill.slug + '/references/' + filename; + const questions = (chunk.text.match(/^#### Вопрос: /gm) ?? []).length; + const topics = chunk.topics.join(', '); + items.set( + file, + [ + '# ' + skill.title + ' — вопросы и ответы, часть ' + (i + 1), + '', + '> Автоматически сгенерировано из src/pages/' + skill.slug + '/index.md. Не редактируйте вручную.', + '', + chunk.text, + '', + ].join('\n'), + ); + index.push('- [' + topics + '](references/' + filename + ') — ' + questions + ' вопросов'); + } + assert.equal( + chunks.reduce((sum, chunk) => sum + (chunk.text.match(/^#### Вопрос: /gm) ?? []).length, 0), + count, + ); + + items.set( + 'skills/' + skill.slug + '/SKILL.md', + [ + '---', + 'name: ' + skill.slug, + 'description: ' + + JSON.stringify( + 'Вопросы и ответы для технического собеседования по теме ' + + skill.title + + '. Используйте для подготовки, проверки знаний и проведения интервью.', + ), + '---', + '', + '# ' + skill.title + ' — подготовка к собеседованию', + '', + 'Скилл содержит **' + + count + + ' вопросов с ответами** из репозитория Angular-RU/angular-ru-interview-questions. Материалы включены в папку references/ и доступны без интернета.', + '', + '## Работа с вопросами', + '', + '1. Учитывайте запрос пользователя: обучение, объяснение конкретной темы, тренировка или пробное интервью.', + '2. При интервью задавайте **по одному вопросу** из файлов references/, не раскрывайте ответ до ответа кандидата.', + '3. Оценивайте ответ, сопоставляя его с Коротким ответом и Полным ответом исходного материала. Уточняйте пробелы и приводите примеры из базы вопросов.', + '4. Учитывайте желаемый уровень Junior, Middle или Senior. Не придумывайте содержимое источника и не выдавайте собственные дополнения за текст справочника.', + '5. Если пользователь попросил объяснение, отвечайте сразу, а не запускайте обязательное интервью. Сохраняйте язык общения пользователя.', + '6. Для API, которые могут измениться, отличайте формулировку источника от актуальных фактов. При необходимости проверяйте официальную документацию.', + '', + '## Вопросы и ответы по разделам', + '', + ...index, + '', + 'Исходный раздел: https://angular-ru.github.io/interview/' + skill.slug + '/', + '', + ].join('\n'), + ); + return items; +} + +for (const skill of catalog) { + const items = generateSkill(skill); + for (const [relative, content] of items) { + generated.add(relative); + const absolute = join(root, relative); + if (check) { + assert(existsSync(absolute), 'Missing generated file: ' + relative); + assert.equal(readFileSync(absolute, 'utf8'), content, 'Outdated generated file: ' + relative); + } else { + mkdirSync(join(absolute, '..'), {recursive: true}); + writeFileSync(absolute, content); + } + } + + const references = join(root, 'skills', skill.slug, 'references'); + if (existsSync(references)) { + for (const filename of readdirSync(references)) { + const relative = 'skills/' + skill.slug + '/references/' + filename; + if (!generated.has(relative) && filename.startsWith('part-') && filename.endsWith('.md')) { + if (check) throw new Error('Stale generated file: ' + relative); + unlinkSync(join(references, filename)); + } + } + } +} +console.log( + (check ? 'Verified' : 'Generated') + ' question banks and skill instructions for ' + catalog.length + ' topics.', +); diff --git a/scripts/package-skills.sh b/scripts/package-skills.sh new file mode 100644 index 00000000..43e7015b --- /dev/null +++ b/scripts/package-skills.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +out="dist/skill-archives" +mkdir -p "$out" +rm -f "$out"/*.zip + +shopt -s nullglob +skill_dirs=(skills/*/) +if (( ${#skill_dirs[@]} == 0 )); then + echo "No generated skill directories found." >&2 + exit 1 +fi + +for skill_dir in "${skill_dirs[@]}"; do + slug="${skill_dir#skills/}" + slug="${slug%/}" + + if [[ ! -f "skills/$slug/SKILL.md" ]]; then + echo "Missing generated SKILL.md for $slug" >&2 + exit 1 + fi + + (cd skills && zip -q -r -X "../$out/$slug.zip" "$slug") + unzip -tq "$out/$slug.zip" >/dev/null +done + +(cd skills && zip -q -r -X "../$out/all.zip" */) +unzip -tq "$out/all.zip" >/dev/null +echo "Packaged ${#skill_dirs[@]} skills and the full bundle." diff --git a/skills/catalog.json b/skills/catalog.json new file mode 100644 index 00000000..7ae2a11f --- /dev/null +++ b/skills/catalog.json @@ -0,0 +1,328 @@ +[ + { + "slug": "ai", + "title": "AI", + "category": "Основы и инструменты", + "description": "AI-assisted development, агенты, промптинг, оценка качества AI-кода и безопасное применение моделей.", + "topics": [ + "AI-assisted development", + "проверка AI-генерируемого кода", + "AI-агенты и MCP", + "prompt engineering", + "тестирование AI-результатов" + ] + }, + { + "slug": "angular", + "title": "Angular", + "category": "Frontend", + "description": "Components, dependency injection, templates, signals, RxJS, routing, forms и SSR.", + "topics": [ + "standalone components и templates", + "dependency injection и providers", + "signals и change detection", + "RxJS и асинхронные потоки", + "routing, forms и SSR" + ] + }, + { + "slug": "architecture", + "title": "Распределенные системы", + "category": "Backend", + "description": "Микросервисы, надежность, согласованность данных и масштабирование.", + "topics": [ + "монолит и микросервисы", + "CAP, consistency и availability", + "асинхронная коммуникация", + "fault tolerance и retries", + "масштабирование и наблюдаемость" + ] + }, + { + "slug": "career-teamwork", + "title": "Карьера в команде", + "category": "Карьера", + "description": "Soft skills, командное взаимодействие, коммуникация и технические интервью.", + "topics": [ + "собеседования и самопрезентация", + "коммуникация в команде", + "конфликты и обратная связь", + "лидерство и наставничество", + "карьерный рост" + ] + }, + { + "slug": "computer-science", + "title": "Архитектура компьютера", + "category": "Основы и инструменты", + "description": "Процессоры, память, машинные инструкции и основы устройства компьютера.", + "topics": [ + "CPU и инструкции", + "иерархия памяти и кэши", + "RAM и адресация", + "параллелизм и выполнение", + "системные ограничения" + ] + }, + { + "slug": "css", + "title": "CSS", + "category": "Frontend", + "description": "Layout, Flexbox, Grid, каскад, адаптивность, rendering и performance.", + "topics": [ + "cascade и specificity", + "Flexbox и Grid", + "responsive layout", + "CSS architecture", + "rendering и performance" + ] + }, + { + "slug": "databases-sql", + "title": "Базы данных", + "category": "Backend", + "description": "SQL, проектирование схем, индексы, транзакции и производительность запросов.", + "topics": [ + "проектирование реляционной схемы", + "JOIN, GROUP BY и подзапросы", + "индексы и планы запросов", + "транзакции и изоляция", + "оптимизация SQL" + ] + }, + { + "slug": "development-process", + "title": "Процессы разработки", + "category": "Карьера", + "description": "Scrum, Kanban, планирование, декомпозиция и взаимодействие с аналитиками.", + "topics": [ + "Agile, Scrum и Kanban", + "оценка и декомпозиция задач", + "планирование и приоритизация", + "определение готовности", + "сотрудничество аналитиков и разработчиков" + ] + }, + { + "slug": "docker", + "title": "Docker", + "category": "Инфраструктура", + "description": "Образы, контейнеры, Dockerfile, Compose и практический запуск приложений.", + "topics": [ + "images vs containers", + "Dockerfile и слои", + "volumes и networks", + "Docker Compose", + "безопасность и оптимизация образов" + ] + }, + { + "slug": "frontend-architecture-patterns", + "title": "Организация кода", + "category": "Frontend", + "description": "Модульные границы, зависимости, архитектурные паттерны и организация frontend-кода.", + "topics": [ + "границы модулей", + "layering и dependency direction", + "архитектурные паттерны", + "feature organization", + "trade-offs и рефакторинг" + ] + }, + { + "slug": "git", + "title": "Git", + "category": "Основы и инструменты", + "description": "История изменений, ветвление, rebase, merge, pull requests и командная работа.", + "topics": [ + "commits и branches", + "merge vs rebase", + "cherry-pick и revert", + "разрешение конфликтов", + "pull request workflow" + ] + }, + { + "slug": "html", + "title": "HTML", + "category": "Frontend", + "description": "Семантика, формы, доступность, metadata, SEO и структура документов.", + "topics": ["semantic HTML", "forms и validation", "accessibility и ARIA", "SEO и metadata", "SVG и media"] + }, + { + "slug": "infrastructure", + "title": "DevOps", + "category": "Инфраструктура", + "description": "CI/CD, deployment, delivery pipelines, feature flags и эксплуатация.", + "topics": [ + "CI/CD pipelines", + "build и artifacts", + "deployment и rollback", + "feature flags", + "monitoring и reliability" + ] + }, + { + "slug": "integrations", + "title": "Интеграции", + "category": "Backend", + "description": "REST, SOAP, очереди, брокеры сообщений и интеграционные паттерны.", + "topics": [ + "REST API", + "SOAP и контрактные интеграции", + "message queues", + "синхронные и асинхронные взаимодействия", + "идемпотентность и retries" + ] + }, + { + "slug": "javascript", + "title": "JavaScript", + "category": "Frontend", + "description": "Язык, асинхронность, Event Loop, DOM, fetch и runtime браузера.", + "topics": [ + "types, references и memory", + "closures и prototypes", + "promises и async/await", + "Event Loop", + "DOM, fetch и browser APIs" + ] + }, + { + "slug": "linux", + "title": "Linux / Unix", + "category": "Основы и инструменты", + "description": "Shell, файлы, права, процессы, сеть и рабочее окружение Unix.", + "topics": [ + "shell commands", + "permissions и filesystem", + "processes и signals", + "network diagnostics", + "pipes и shell scripts" + ] + }, + { + "slug": "nodejs", + "title": "Node.js", + "category": "Backend", + "description": "Node runtime, npm, HTTP, networking, tooling и observability.", + "topics": [ + "Node.js runtime", + "event loop и async I/O", + "npm scripts", + "HTTP servers", + "diagnostics и observability" + ] + }, + { + "slug": "operating-systems", + "title": "Операционные системы", + "category": "Основы и инструменты", + "description": "Процессы, потоки, память, файловые системы и сетевые основы.", + "topics": ["processes vs threads", "scheduling", "virtual memory", "filesystems", "I/O и networking"] + }, + { + "slug": "qa", + "title": "QA", + "category": "Инфраструктура", + "description": "Стратегия тестирования, unit/integration/e2e, метрики качества и анализ дефектов.", + "topics": [ + "testing pyramid", + "unit, integration и e2e", + "test design и edge cases", + "regression и flaky tests", + "quality metrics" + ] + }, + { + "slug": "react", + "title": "React", + "category": "Frontend", + "description": "Components, hooks, state, rendering, routing, forms и экосистема React.", + "topics": [ + "components и JSX", + "hooks и effects", + "state и rendering", + "forms и data fetching", + "React architecture" + ] + }, + { + "slug": "state-management", + "title": "State Management", + "category": "Frontend", + "description": "Client/server/URL state, кэширование, нормализация и state managers.", + "topics": [ + "local vs shared state", + "server state и caching", + "URL state и forms", + "normalization", + "reactivity и state managers" + ] + }, + { + "slug": "system-analysis", + "title": "Системный анализ", + "category": "Архитектура", + "description": "Требования, user stories, процессы и аналитические артефакты.", + "topics": [ + "functional vs non-functional requirements", + "user stories и acceptance criteria", + "BPMN и UML", + "API contracts", + "traceability и change management" + ] + }, + { + "slug": "system-design", + "title": "Проектирование UI", + "category": "Frontend", + "description": "UI-архитектура, rendering strategies, масштабирование и технические компромиссы.", + "topics": [ + "frontend system design", + "UI data flow", + "SSR, CSR и hydration", + "performance и accessibility", + "trade-offs и ограничения" + ] + }, + { + "slug": "typescript", + "title": "TypeScript", + "category": "Frontend", + "description": "Типизация, generics, utility types, архитектура типов и runtime-контракты.", + "topics": [ + "generics и constraints", + "union и narrowing", + "mapped и conditional types", + "type-safe API design", + "runtime validation" + ] + }, + { + "slug": "ui-ux", + "title": "UI/UX", + "category": "Frontend", + "description": "Usability, accessibility, сценарии пользователей, интерфейсные состояния и продуктовые решения.", + "topics": [ + "UX research", + "interaction design", + "accessibility", + "error и empty states", + "usability и product metrics" + ] + }, + { + "slug": "web-protocols", + "title": "Веб-протоколы и безопасность", + "category": "Основы и инструменты", + "description": "HTTP, браузерная сеть, authentication, authorization и web security.", + "topics": [ + "HTTP request lifecycle", + "HTTP caching и headers", + "cookies и sessions", + "authentication vs authorization", + "XSS, CSRF и CORS" + ] + } +] diff --git a/src/components/SkillHero.astro b/src/components/SkillHero.astro new file mode 100644 index 00000000..795b642d --- /dev/null +++ b/src/components/SkillHero.astro @@ -0,0 +1,61 @@ +--- +import type {Skill} from '../data/skills'; +import {installCommand} from '../data/skills'; +import SkillInstall from './SkillInstall.astro'; + +interface Props { + readonly skill: Skill; +} + +const {skill} = Astro.props; +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +--- + +
+
+

/{skill.slug} · AI Skill

+

{skill.title}

+

{skill.description}

+ + + + +
+ + +
diff --git a/src/components/SkillInstall.astro b/src/components/SkillInstall.astro new file mode 100644 index 00000000..88c995a2 --- /dev/null +++ b/src/components/SkillInstall.astro @@ -0,0 +1,56 @@ +--- +interface Props { + readonly command: string; +} + +const {command} = Astro.props; +--- + +
+ + {command} + +
+ + diff --git a/src/data/skills.ts b/src/data/skills.ts new file mode 100644 index 00000000..4e709e1c --- /dev/null +++ b/src/data/skills.ts @@ -0,0 +1,12 @@ +import catalog from '../../skills/catalog.json'; + +export const skills = catalog; +export type Skill = (typeof skills)[number]; + +const releaseUrl = + 'https://github.com/Angular-RU/angular-ru-interview-questions/releases/download/skills-latest'; + +export const installAllCommand = `npx skills@latest add ${releaseUrl}/all.zip`; + +export const installCommand = (slug: string): string => + `npx skills@latest add ${releaseUrl}/${slug}.zip`; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 3e265626..853b6df3 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -3,6 +3,8 @@ import {ClientRouter} from 'astro:transitions'; import SidebarNavigation from '../components/SidebarNavigation.astro'; import SiteSearch from '../components/SiteSearch.astro'; +import SkillHero from '../components/SkillHero.astro'; +import {skills} from '../data/skills'; import '../styles/global.css'; interface MarkdownHeading { @@ -33,6 +35,8 @@ const basePath = import.meta.env.BASE_URL.replace(/\/$/, ''); const currentPath = Astro.url.pathname.replace(/\/$/, ''); const homeHref = `${basePath}/`; const isHomePage = currentPath === basePath; +const skillSlug = currentPath.slice(basePath.length).replace(/^\/+|\/+$/g, ''); +const currentSkill = skills.find(({slug}) => slug === skillSlug); const showHomeLink = !isHomePage; const canonicalUrl = new URL(Astro.url.pathname, Astro.site ?? Astro.url.origin); @@ -123,6 +127,8 @@ const searchEnabled = import.meta.env.PROD; title={title} /> + {currentSkill && } + diff --git a/src/pages/index.astro b/src/pages/index.astro index 8e08a0cf..aaf514d2 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -187,6 +187,12 @@ const exampleCards = examples.slice().sort((a, b) => a.order - b.order); )) } + + AI Skills + diff --git a/src/pages/skills/index.astro b/src/pages/skills/index.astro new file mode 100644 index 00000000..b3b9bfd9 --- /dev/null +++ b/src/pages/skills/index.astro @@ -0,0 +1,67 @@ +--- +import Layout from '../../layouts/Layout.astro'; +import SkillInstall from '../../components/SkillInstall.astro'; +import {installAllCommand, skills} from '../../data/skills'; + +const base = import.meta.env.BASE_URL.replace(/\/$/, ''); +const groups = [...new Set(skills.map(({category}) => category))]; +--- + + +
+
+

/skills

+

AI Skills для технических интервью

+

+ Превратите справочник вопросов в персонального AI-интервьюера. Скиллы задают вопросы, разбирают ответы и + помогают подготовиться к техническому собеседованию. +

+
+ Установить все скиллы + +
+
+ +
+ {skills.length} скиллов + Выберите тему и установите только то, что нужно +
+ + { + groups.map((group) => ( +
+

{group}

+
+ {skills + .filter(({category}) => category === group) + .map((skill) => ( + + + {skill.title} + {skill.description} + + /{skill.slug} + + + + ))} +
+
+ )) + } +
+
diff --git a/src/styles/global.css b/src/styles/global.css index 2330fc09..c519c640 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -8,3 +8,4 @@ @import './markdown.css'; @import './content-figures.css'; @import './markdown-details.css'; +@import './skills.css'; diff --git a/src/styles/skills.css b/src/styles/skills.css new file mode 100644 index 00000000..838e6121 --- /dev/null +++ b/src/styles/skills.css @@ -0,0 +1,382 @@ +.skill-install { + display: flex; + min-height: 62px; + align-items: center; + gap: 12px; + padding: 10px 12px 10px 18px; + border: 1px solid #d9dde4; + border-radius: 12px; + background: #f5f6f8; +} + +.skill-install__prompt { + color: #808893; + font-family: monospace; +} + +.content .skill-install code { + flex: 1; + min-width: 0; + padding: 0; + overflow-wrap: anywhere; + color: #22262e; + background: transparent; + font-size: 0.9rem; + line-height: 1.4; +} + +.skill-install__copy { + flex-shrink: 0; + padding: 10px 12px; + border: 1px solid #d5d9df; + border-radius: 9px; + color: #343b45; + background: #fff; + font: inherit; + font-size: 0.82rem; + font-weight: 700; + cursor: pointer; +} + +.skill-install__copy:hover { + border-color: #9aaec8; + background: #edf2f9; +} + +.skill-install__copy:focus-visible, +.skill-hero a:focus-visible, +.skills-catalog a:focus-visible { + outline: 3px solid #8bb8ff; + outline-offset: 3px; +} + +.skill-hero { + display: grid; + grid-template-columns: minmax(0, 1.13fr) minmax(0, 0.87fr); + align-items: center; + gap: clamp(28px, 4vw, 56px); + padding: 22px 0 44px; + border-bottom: 1px solid var(--border); +} + +.content .skill-hero__eyebrow { + margin: 0 0 24px; + color: #575f6c; + font-family: monospace; + font-size: 0.9rem; +} + +.skill-hero__eyebrow span { + color: #838b96; +} + +.content .skill-hero h1 { + margin: 0; + color: #101216; + font-size: clamp(2.8rem, 5vw, 4.6rem); + line-height: 1; + letter-spacing: -0.06em; +} + +.content .skill-hero__lead { + margin: 26px 0 28px; + color: #49515d; + font-size: clamp(1.07rem, 1.6vw, 1.3rem); + line-height: 1.65; +} + +.skill-hero__links { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 10px; + margin-top: 18px; + color: #7f8791; + font-size: 0.88rem; +} + +.content .skill-hero__links a { + color: #4a5568; + font-weight: 500; + text-decoration: none; +} + +.skill-hero__visual { + min-width: 0; + padding: 10px; + border: 1px solid #dfe3e7; + border-radius: 23px; + background: #fff; + box-shadow: 0 9px 24px rgb(12 24 44 / 6%); +} + +.skill-hero__window { + min-height: 310px; + overflow: hidden; + border: 1px solid #161d25; + border-radius: 15px; + color: #dbeafe; + background: + repeating-linear-gradient(0deg, transparent 0 3px, rgb(255 255 255 / 2%) 4px 5px), + radial-gradient(ellipse at 53% 46%, #1d3550, transparent 65%), #0c1119; +} + +.skill-hero__window-top { + display: flex; + height: 48px; + align-items: center; + gap: 6px; + padding: 0 18px; + border-bottom: 1px solid rgb(255 255 255 / 8%); +} + +.skill-hero__dot { + width: 7px; + height: 7px; + border-radius: 100%; + background: #52657a; +} + +.skill-hero__window-label { + margin-left: auto; + color: #7c8da0; + font-family: monospace; + font-size: 0.65rem; + letter-spacing: 0.13em; +} + +.skill-hero__terminal { + padding: 28px 30px 24px; + font-family: monospace; +} + +.skill-hero__terminal-label { + color: #6db9ee; + font-size: 0.68rem; + letter-spacing: 0.18em; +} + +.skill-hero__terminal-title { + margin: 12px 0 26px; + overflow-wrap: anywhere; + color: #fff; + font-size: clamp(1.5rem, 2.8vw, 2.5rem); + letter-spacing: -0.04em; + text-shadow: 0 0 24px rgb(80 183 255 / 45%); +} + +.skill-hero__terminal-line { + margin-top: 13px; + color: #bbc7d8; + font-size: 0.78rem; +} + +.skill-hero__terminal-line span { + margin-right: 12px; + color: #5f9dbb; +} + +.skill-hero__cursor { + display: inline-block; + width: 7px; + height: 13px; + margin-left: 3px; + background: #65cfff; + vertical-align: -2px; + animation: skill-cursor-pulse 1.4s steps(2) infinite; +} + +.skill-hero__terminal-footer { + margin-top: 26px; + color: #7d8ea2; + font-size: 0.68rem; +} + +.skill-hero__terminal-footer span { + padding: 0 7px; + color: #5f7187; +} + +@keyframes skill-cursor-pulse { + 50% { + opacity: 0.1; + } +} + +.skills-catalog__intro { + padding: 20px 0 36px; +} + +.content .skills-catalog__eyebrow { + margin: 0 0 22px; + color: #6b7280; + font-family: monospace; + font-size: 0.95rem; +} + +.content .skills-catalog h1 { + max-width: 850px; + margin: 0; + font-size: clamp(2.8rem, 6vw, 5.5rem); + line-height: 1.03; + letter-spacing: -0.06em; +} + +.content .skills-catalog__lead { + max-width: 790px; + margin: 26px 0 32px; + color: #4b5563; + font-size: 1.15rem; +} + +.skills-catalog__install { + max-width: 780px; +} + +.skills-catalog__install > span { + display: inline-block; + margin-bottom: 12px; + color: #555f6d; + font-size: 0.84rem; + font-weight: 700; +} + +.skills-catalog__summary { + display: flex; + flex-wrap: wrap; + gap: 10px 16px; + align-items: baseline; + padding: 20px 0; + border-top: 1px solid var(--border); + color: #637083; + font-size: 0.94rem; +} + +.skills-catalog__summary strong { + color: #151a20; +} + +.content .skills-catalog__section h2 { + margin: 36px 0 18px; + padding: 0; + border: 0; + font-size: 1.5rem; + letter-spacing: -0.03em; +} + +.skills-catalog__grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); + gap: 14px; +} + +.content .skills-catalog__card { + display: flex; + min-height: 224px; + flex-direction: column; + padding: 24px; + border: 1px solid #dde3eb; + border-radius: 17px; + color: #141a25; + background: #fff; + box-shadow: 0 9px 24px rgb(15 23 42 / 4%); + font-weight: 400; + text-decoration: none; + transition: + transform 160ms ease, + border-color 160ms ease, + box-shadow 160ms ease; +} + +.skills-catalog__card:hover { + transform: translateY(-3px); + border-color: #8cb5e7; + box-shadow: 0 14px 30px rgb(15 23 42 / 10%); +} + +.skills-catalog__card-icon { + display: grid; + width: 53px; + height: 53px; + place-items: center; + margin-bottom: 20px; + border-radius: 12px; + color: #76cdf5; + background: #0b1826; + font-family: monospace; + font-size: 0.9rem; +} + +.skills-catalog__card-title { + color: #101827; + font-size: 1.25rem; + font-weight: 750; + letter-spacing: -0.025em; +} + +.skills-catalog__card-description { + margin-top: 9px; + color: #667285; + font-size: 0.9rem; + line-height: 1.5; +} + +.skills-catalog__card-footer { + display: flex; + justify-content: space-between; + align-items: center; + gap: 12px; + margin-top: auto; + padding-top: 22px; + color: #426ea1; +} + +.content .skills-catalog__card-footer code { + padding: 0; + overflow-wrap: anywhere; + background: none; + font-size: 0.76rem; +} + +@media (max-width: 900px) { + .skill-hero { + grid-template-columns: 1fr; + } + + .skill-hero__window { + min-height: 270px; + } +} + +@media (max-width: 600px) { + .skill-install { + align-items: flex-start; + flex-wrap: wrap; + } + + .skill-install__copy { + margin-left: auto; + } + + .skill-hero__terminal { + padding: 24px; + } + + .skills-catalog__grid { + grid-template-columns: 1fr; + } +} + +@media (prefers-reduced-motion: reduce) { + .skill-hero__cursor { + animation: none; + } + + .skills-catalog__card { + transition: none; + } + + .skills-catalog__card:hover { + transform: none; + } +}