Skip to content
Skills Library
AI & agents · Automation

ctx-init

/ctx-init

Initialize AGENTS.md + CLAUDE.md + rules/ in a code repo (fresh mode). Triggers on "/ctx-init", "init context", "scaffold AGENTS.md", or when user asks to set up project context in a new repo.

Licence
MIT
Last repository change
07.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Initialize AGENTS.md + CLAUDE.md + rules/ in a code repo (fresh mode). Triggers on "/ctx-init", "init context", "scaffold AGENTS.md", or when user asks to set up project context in a new repo.

Triggers from the description

init contextscaffold AGENTS.md
Original author description

Initialize AGENTS.md + CLAUDE.md + rules/ in a code repo (fresh mode). Triggers on "/ctx-init", "init context", "scaffold AGENTS.md", or when user asks to set up project context in a new repo.

How it works

  1. Input (ask the user before running)
  2. Procedure
  3. Example invocation
Original SKILL.md headings · 52 lines, 392 words
SKILL.md preview
---
name: ctx-init
description: Initialize AGENTS.md + CLAUDE.md + rules/ in a code repo (fresh mode). Triggers on "/ctx-init", "init context", "scaffold AGENTS.md", or when user asks to set up project context in a new repo.
---

# ctx-init — context initialization in a repo

Creates the `ctx` structure in the current repo:
- `AGENTS.md` from template with frontmatter (all `@`-imports are relative `@./rules/...`)
- `CLAUDE.md` with `@AGENTS.md` import
- `rules/` with copies of shared plugin rules (`language`, `dates`, `git`, `no-secrets`, `no-public-names`) **plus** project-specific stubs (`stack`, `testing`, `boundaries`, `focus`)

Both shared rules and templates exist in two language variants: `en/` (English) and `ru/` (Russian). The user picks one at init time. Shared rules are copied rather than imported via `$PLUGIN_ROOT` because Claude Code **does not expand** env variables in project-level `@`-imports (and this is needed for cross-agent compatibility: Codex/Gemini/Cursor all read the same `AGENTS.md`).

## Input (ask the user before running)

1. **project** — short name (e.g. `MYAPP`, `API`, `DOCS`).
2. **description** — one line describing the project topic.
3. **language** — `en` or `ru` (default `en`). Determines the language of `AGENTS.md` headers, the 5 shared rule files (`language`, `dates`, `git`, `no-secrets`, `no-public-names`), and the 4 project stubs (`stack`, `testing`, `boundaries`, `focus`).

## Procedure

**Pre-flight checks:**
1. `pwd` must be the root of the repo being initialized.
2. If `AGENTS.md` already exists — **stop and tell the user** that migration is not supported. Ask the user to rename the old file manually (`mv AGENTS.md AGENTS.md.legacy`) and call `ctx-init` again.

**Actions** (replace `<LANG>` with the chosen `en` or `ru`). Resolve the plugin root first — `CLAUDE_PLUGIN_ROOT` can be empty under Codex:

```bash
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-<installed-plugin-root>}"
```

`ctx-lint` parses frontmatter with PyYAML. If `python3 -c 'import yaml'` fails, run the commands below as `uv run --with pyyaml python3 …` (or install it: `python3 -m pip install pyyaml`).

1. Copy `$PLUGIN_ROOT/templates/<LANG>/AGENTS.md.template` to `./AGENTS.md`.
2. Substitute `{{PROJECT}}`, `{{DESCRIPTION}}` via `sed`.
3. Copy `$PLUGIN_ROOT/templates/<LANG>/CLAUDE.md.template` to `./CLAUDE.md`.
4. Create `./rules/`.
5. Copy **shared rules**: `$PLUGIN_ROOT/rules/<LANG>/*.md` to `./rules/`.
6. Copy **project stubs**: `$PLUGIN_ROOT/templates/<LANG>/stubs-repo-rules/*.md` to `./rules/` (without overwriting shared files).
7. Run `python3 $PLUGIN_ROOT/lib/ctx-lint.py <repo>` — verify all `@`-imports resolve (0 errors).
8. Show the user what was created, and ask them to fill in `stack.md`, `testing.md`, `boundaries.md`, `focus.md` inside the project `rules` directory.
9. Do not commit automatically — user reviews and commits themselves.

## Example invocation

```
User: /ctx-init
Agent: "Ready to initialize context. Answer 3 questions:
  1. project name (MYAPP/API/DOCS/...)?
  2. description (short project topic)?
  3. language for rules and AGENTS.md headers (en/ru, default en)?"
```

After answers — executes steps 1–7 and shows the diff.
Files in this package (2)
  • SKILL.md 3 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named ctx-init.

Database snapshot: 13.11.2026 · package version fec1b33d0864 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 2 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100init
    Use when the user asks to initialize a repo, create AGENTS.md, generate contributor guidelines, or set up agent-oriented documentation for a codebase.
  • 100scaffold-init
    Initialize an AI-native development workspace with spec-driven workflow infrastructure. Use when starting a new project, setting up Claude Code on a codebase for the first time, or when the user says scaffold, initialize, set up AI workflow, onboard this repo, or similar. Do not…
  • 100init
    This skill should be used when a user asks to initialize a repository for AI agents, create or update an AGENTS.md file, scaffold agent instructions for a codebase, or improve existing agent guidance. Triggers include phrases like 'create an AGENTS.md', 'set up agent…
  • 100init-project
    Use this skill for \"initialize project\", \"set up project\", \"scaffold project\", \"create AGENTS.md\", \"create CLAUDE.md\", \"set up rules\", \"create context directory\", \"vibe rules\", \"project templates\", \"init new project\", \"set up development structure\",…
  • 100create-context
    Create baseline context from .in/ folder with manifest-driven organization (run once per project). Use when bootstrapping project context, setting up .ctx/ snapshot. Triggers include "create context", "bootstrap context", "setup context", "init context".
  • 90Project Scaffolding
    This skill should be used when the user wants to set up Claude for a project, create a CLAUDE.md file, scaffold the .claude directory, initialize an AI workflow, configure a project for Claude, set up dev intelligence, initialize a new project, or do a new project setup.…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.