Agent skill

AI Context Workspace Init

by kvker in kvker/ai-context-workspace

Turns existing work units or an empty directory into an AI Context Workspace by scanning materials, generating background and conventions, and installing runtime skills.

MITAuto-check passedAgent Workflows

SKILL.md written in Chinese; this summary is our English description.

Install AI Context Workspace Init

skills CLI
$ npx skills add kvker/ai-context-workspace --skill an-init -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kvker/ai-context-workspace an-init --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kvker/ai-context-workspace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/an-init .claude/skills/an-init && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
an-init
GitHub stars
101
Token cost
~948 tokens
SKILL.md length
183 words
Files
34 (incl. scripts, assets)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Turns existing work units or an empty directory into an AI Context Workspace by scanning materials, generating background and conventions, and installing runtime skills.

  • Works in 5 steps: 确认当前目录同时包含根… → 检查 projects/ 下一级子目录,每个子目录视为独立工作单元。 → projects/… → …
  • Initializing a workspace that holds several project folders for agent use
  • SKILL.md covers 一、前置检查, 二、执行流程, 三、工作区扫描 and 四、上下文生成, plus 3 more sections
  • Runs JavaScript scripts from its folder; calls node

What it does

an-init turns existing work units, or an empty directory, into a domain-neutral AI Context Workspace. It treats each subfolder of projects/ as an independent work unit, gathers facts from READMEs, indexes, configs and existing conventions, then generates context: a root AGENTS.md rewritten as runtime routing, a README overview, background files and conventions files for structure and style. Conclusions must come from user input or workspace facts, anything uncertain is marked as pending confirmation, and valid human-written content is kept. The skill text is in Chinese.

The flow runs workspace scan, fact collection, context generation, action detection, pre-install checks, skill installation and a report with a restart. Node scripts such as detect-recipes.mjs and scan-projects.mjs do the scanning, and sub-agents may scan work units in parallel when supported. It installs runtime skills named an-task, an-task-split, an-recipes, an-refresh, an-review and an-archive, keeps an unfinished-initialization routing block in the root file until every install succeeds, and checks that artifacts/index.json has the expected shape. It talks to you in Chinese.

When your agent uses it

  • Initializing a workspace that holds several project folders for agent use
  • Generating background and conventions files from existing materials
  • Rewriting the root AGENTS.md into runtime routing
  • Resuming an unfinished workspace initialization

Example prompts

  • “Initialize this workspace as an AI Context Workspace from what is under projects/.”
  • “Start from an empty template and set up the minimal context files.”
  • “Resume the an-init setup and report what is still pending.”

Requirements

  • Node to run the bundled scan scripts
  • A workspace root with AGENTS.md and artifacts/index.json

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. 确认当前目录同时包含根 AGENTS.md、artifacts/index.json 和 .agents/skills/an-init/SKILL.md;否则停止,要求从工作区根目录重新执行。
  2. 检查 projects/ 下一级子目录,每个子目录视为独立工作单元。
  3. projects/ 为空或不存在时,一次性询问是否从空模板开始;确认后创建目录并生成最小上下文。
  4. 已有材料时直接继续,不要求用户填写能够从材料获得的信息。
  5. 独立工作单元默认可以用子代理并行扫描;环境不支持时由主代理顺序完成。

What it can do on your machine

Read from SKILL.md and the folder at commit 3d124d3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

AI Context Workspace Init loads about 948 tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 183 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~948

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from kvker/ai-context-workspace at commit 3d124d3, republished under its MIT licence (© kvker). 183 words, ~948 tokens.

Download SKILL.mdSave it as .claude/skills/an-init/SKILL.md (or your agent's skills folder). This skill also uses 33 other files; get the full folder from GitHub.
name
an-init
description
将已有工作单元或空目录初始化为领域无关的 AI Context Workspace。分析 projects 中的材料,生成 background、conventions、recipes 和运行期路由,并安全安装运行期 Skills。始终使用中文与用户沟通。

AI Context Workspace 初始化

将 projects/ 中的材料纳入通用 AI Context Workspace 结构。初始化只整理事实和约定,不创建任务 Artifact,不预设行业。

一、前置检查

  1. 确认当前目录同时包含根 AGENTS.md、artifacts/index.json 和 .agents/skills/an-init/SKILL.md;否则停止,要求从工作区根目录重新执行。
  2. 检查 projects/ 下一级子目录,每个子目录视为独立工作单元。
  3. projects/ 为空或不存在时,一次性询问是否从空模板开始;确认后创建目录并生成最小上下文。
  4. 已有材料时直接继续,不要求用户填写能够从材料获得的信息。
  5. 独立工作单元默认可以用子代理并行扫描;环境不支持时由主代理顺序完成。

二、执行流程

text
工作区扫描 → 事实整理 → 上下文生成 → 动作探测 → 安装前检查 → 安装 Skills → 报告并重启

三、工作区扫描

从工作区根目录运行:

bash
node .agents/skills/an-init/assets/skills/an-recipes/scripts/detect-recipes.mjs --root projects --write .agents/recipes.json
node .agents/skills/an-init/assets/skills/an-refresh/scripts/scan-projects.mjs --root projects --artifacts artifacts --format markdown

扫描输出中的 diagnostics 非空或 truncated: true 时,先针对目标材料补充检查并在报告中说明限制。扫描失败不得解释为“没有内容”。

扫描后按需阅读 README、索引、配置、注释和已有规范,提取:

  • 目录、文件类型和主要材料。
  • 已明确表达的用途、入口和外部约定。
  • 声明的工具、脚本和可执行动作。
  • 命名、文件组织和格式规律。

所有结论必须来自用户输入或工作区事实。可以基于证据归纳,但必须标注来源;置信度不足时写“待确认”,不得用领域常识补成已确认事实。

四、上下文生成

已有文件时保留仍有效的人工内容,只修改与事实冲突或已经过时的部分。

根 AGENTS.md

改写为运行期路由,至少包含:

  • 已确认的工作区定位和工作单元路由。
  • 目录职责和敏感文件约束。
  • 必读规范。
  • 指向 artifacts/index.json 的任务状态路由。
  • $an-task、$an-task-split、$an-recipes、$an-refresh、$an-review、$an-archive 的运行期 Skill 路由。
  • $an-task 触发规则:用户明确下达“开始吧”“开始做”“实现”“动手”“开工”等进入执行态的指令时,无论此前讨论多少轮,都必须先经 $an-task 分流;该规则写入运行期根 AGENTS。
  • $an-task 规模规则:小改动只允许不创建 Artifact,不允许跳过分流;预计变更涉及 3 个以上文件或跨前后端时至少使用 L2。

移除原模板阶段说明,但在安装完成前保留以下唯一待完成路由块;所有 $an-init 和 .agents/skills/an-init 引用都必须放在块内:

markdown
<!-- an-init-pending:start -->
初始化尚未完成时,使用 `$an-init` 继续;入口位于 `.agents/skills/an-init/`。
<!-- an-init-pending:end -->

根文件不复制活跃任务表或流程正文。安装器在所有运行期 Skill 提交成功后原子移除该块;失败或取消时该入口仍可重试。

根 AI 行为约束必须包含:

text
当任务需要访问某个目录时,先检查该目录及其相关父级路径中的 AGENTS.md(如存在),再读取或修改其中的文件。不要为此主动遍历无关目录。
README.md

将模板 README 改写为当前工作区的人类概览,至少说明用途、工作单元、目录、运行期 Skills 和启动方式。必须移除 <!-- ai-context-workspace-readme --> 标记;不要删除用户 README。

background

生成或更新:

  • background/overview.md:定位、已知目标、主要材料、待确认和来源。
  • background/workspaces.md:每个工作单元的路径、类型、内容、动作和来源。
  • background/AGENTS.md:稳定但可刷新、任务默认只读、已确认与待确认分离。

不要创建 background/product/overview.md 等行业固定路径。

conventions
  • conventions/structure.md:实际目录结构和工作单元职责。
  • conventions/style-guide.md:有证据的命名、文件组织、格式和标注约定;没有稳定规律时保持简短。
  • 保留 workflow.md、flow-policy.md、document.md、principles.md 和 rules.md 的通用机器契约,不把业务事实复制进去。
artifacts

确认 artifacts/index.json 符合:

json
{
  "schemaVersion": 1,
  "active": []
}

初始化不创建任务 Artifact。Artifact 的机器契约统一引用 conventions/workflow.md。

recipes

.agents/recipes.json 只记录从实际工作区发现的动作。命令必须有声明依据;无法自动执行的检查使用 inspection,不伪造命令。

五、安全安装运行期 Skills

先预检:

bash
node .agents/skills/an-init/scripts/install-runtime.mjs --root . --dry-run

确认预检列出的 Skills、根路由和 README 均正确后执行:

bash
node .agents/skills/an-init/scripts/install-runtime.mjs --root .

安装器先复制到 staging 并验证所有 Skill,再提交目标、原子移除待完成路由块,并将 an-init 退出发现路径。提交前失败会恢复根 AGENTS、已提交目标和 an-init;提交成功后的旧副本清理失败只报告 warning,不回滚已安装 Skills。不要手工执行 mv ...; rm -rf ...。

六、完成报告

报告:

  • 识别到的工作单元和来源。
  • 生成或更新的文件。
  • 动作探测结果、diagnostics 和截断限制。
  • 待确认事项。
  • 安装结果。

明确告知用户:OpenCode、Codex 和其他启动时加载 Skill 的客户端必须退出并重启,运行期 Skills 才会生效。不要在当前会话继续调用新安装的 $an-refresh 或 $an-task。

错误处理

情况处理
当前目录不是工作区根停止,不执行扫描、安装或清理
空工作区未获确认停止,不安装 Skills
扫描脚本失败报告失败并用可用工具继续整理;不得把失败记为空结果
部分文件无法读取跳过并记录路径和限制
安装预检失败修复根路由、README 或目标冲突后重新预检
安装提交失败保留待完成路由和 an-init,报告回滚结果后可直接重试
旧 an-init 副本清理 warning运行期 Skills 已安装;报告残留路径,不反向回滚
用户取消不安装 Skills;若已生成运行期文档,保留待完成路由块以便重试

© kvker, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 33 other files (scripts, assets) in .agents/skills/an-init of kvker/ai-context-workspace.

  • SKILL.md
  • agents/openai.yaml
  • assets/skills/an-archive/SKILL.md.txt
  • assets/skills/an-archive/agents/openai.yaml
  • assets/skills/an-archive/scripts/archive-task.mjs
  • assets/skills/an-recipes/SKILL.md.txt
  • assets/skills/an-recipes/agents/openai.yaml
  • assets/skills/an-recipes/scripts/detect-recipes.mjs
  • assets/skills/an-refresh/SKILL.md.txt
  • assets/skills/an-refresh/agents/openai.yaml
  • … and 24 more

Open the folder on GitHubat commit 3d124d3

Compare with similar skills

AI Context Workspace Init next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

AI Context Workspace Init compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
AI Context Workspace Init this skillkvker/ai-context-workspace101—~948Automated safety check: PassMIT
Intent Layercrafter-station/skills1121 repos~633Automated safety check: PassMIT
AI Bomcdxgen/cdxgen1.1k—~2.5kAutomated safety check: PassApache-2.0
Add Remote Endpointnextcloud/android-library106—~1.1kAutomated safety check: PassCustom licence
Project Healthjezweb/claude-skills1.1k1 repos~3kAutomated safety check: PassMIT
AGENTS.md Scaffoldmajiayu000/spellbook286—~1.5kAutomated safety check: PassMIT

Similar skills

  • Intent Layer

    crafter-station/skills

    Set up hierarchical Intent Layer (AGENTS.md files) for codebases.

    112 GitHub starsUsed in 1 repo~633 tokens
    Agent WorkflowsAuto-check passed
  • AI Bom

    cdxgen/cdxgen

    Generates AI-BOM, MCP inventory, AI skill inventory, and AI authorship provenance documents with cdxgen, cataloging models, inference services, Hugging Face purls, MCP servers and their…

    1.1k GitHub stars~2.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Add Remote Endpoint

    nextcloud/android-library

    A skill your agent uses when adding a new remote/network endpoint (a RemoteOperation / OCSRemoteOperation) to this Nextcloud Android library, or when the user says "add an endpoint", "new remote…

    106 GitHub stars~1.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Project Health

    jezweb/claude-skills

    All-in-one project configuration and health management. An agent skill from jezweb/claude-skills.

    1.1k GitHub starsUsed in 1 repo~3k tokens
    Agent WorkflowsAuto-check passed
  • AGENTS.md Scaffold

    majiayu000/spellbook

    Scans a repository for real evidence and proposes, or on request writes, a small stack of root and scoped AGENTS.md files with validation commands and generated-file boundaries.

    286 GitHub stars~1.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Scaffold Claude

    ragnar-pwninskjold/tech-snacks

    A skill your agent uses when the user wants to create, draft, or scaffold a CLAUDE.md (or AGENTS.md) file for their project.

    136 GitHub stars~1.7k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed

Categories

Questions about AI Context Workspace Init

What does AI Context Workspace Init do?

Turns existing work units or an empty directory into an AI Context Workspace by scanning materials, generating background and conventions, and installing runtime skills. an-init turns existing work units, or an empty directory, into a domain-neutral AI Context Workspace.md rewritten as runtime routing, a README overview, background files and conventions files for structure and style.

When should I use AI Context Workspace Init?

AI Context Workspace Init fits situations like: initializing a workspace that holds several project folders for agent use; generating background and conventions files from existing materials; rewriting the root AGENTS.md into runtime routing; resuming an unfinished workspace initialization.

How do I install AI Context Workspace Init in Claude Code?

Run `npx skills add kvker/ai-context-workspace --skill an-init -a claude-code`. Or copy the skill folder (.agents/skills/an-init in kvker/ai-context-workspace) into .claude/skills/an-init in your project. Claude Code loads it when a task matches its description.

How do I install AI Context Workspace Init in Codex?

Run `npx skills add kvker/ai-context-workspace --skill an-init -a codex`. Or copy the skill folder (.agents/skills/an-init in kvker/ai-context-workspace) into .agents/skills/an-init in your project. Codex loads it when a task matches its description.

Can I use AI Context Workspace Init in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kvker/ai-context-workspace --skill an-init -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/an-init, .gemini/skills/an-init, .github/skills/an-init and .opencode/skills/an-init in your project.

What does AI Context Workspace Init need to run?

Going by SKILL.md and its folder, AI Context Workspace Init needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node to run the bundled scan scripts; A workspace root with AGENTS.md and artifacts/index.json.

Does AI Context Workspace Init access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is AI Context Workspace Init safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does AI Context Workspace Init use?

AI Context Workspace Init is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does AI Context Workspace Init use?

About 948 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to AI Context Workspace Init?

Skills that share tags, products or a category with AI Context Workspace Init: Intent Layer (crafter-station/skills, 112 stars), AI Bom (cdxgen/cdxgen, 1.1k stars), Add Remote Endpoint (nextcloud/android-library, 106 stars) and Project Health (jezweb/claude-skills, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains AI Context Workspace Init?

kvker (a GitHub user) maintains it in kvker/ai-context-workspace, which has 101 GitHub stars. The repository was last updated on September 8, 2026.

Source: kvker/ai-context-workspace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.