agentleFS
vlad-ryzhkovvlad-ryzhkov/ai-context-engineering-for-frontend/.claude/skills/init-project/SKILL.md

init-project

Skill2 starsChanged 8 months agoUnlicenseView on GitHub

Generate a project-specific CLAUDE.md by scanning the actual project tech stack. Run once when setting up AI context for a new frontend project. Do not use if CLAUDE.md already exists and is up to date.

53 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use addskill, apply-firmware and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ryanportfolioSkill

    addskill

    Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.

    Also in 6 projects that use this

  • ryanportfolioSkill

    apply-firmware

    Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.

    Also in 6 projects that use this

  • +10 more from ryanportfolio

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 45 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before execution the agent MUST load: .claude/protocols/gardener.md

    line 22
  2. Distinctive:

    Do NOT output intermediate scan results or file lists to chat.

    line 30
  3. Distinctive:

    If CLAUDE.md already exists:

    line 115
  4. Very specific:

    Write the following stub files to .claude/conventions/ (skip any that already exist):

    line 125
  5. Very specific:

    Read references/fe-codegen-templates.md for convention stub templates if available.

    line 146
  6. Very specific:

    Gardener Protocol: Call .claude/protocols/gardener.md before SKILL COMPLETE.

    line 168

“Common” is measured: kept by at least 6 in 10 of the 45 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Minimality Principle (research): LLM-generated context files reduce task success rate (−3%) and increase inference cost (+20%). This skill generates a minimal draft — human review and rewrite is mandatory. Include ONLY: tech stack, build/test commands, banned alternatives, specific tooling. Do NOT include: codebase overviews, directory listings, architecture descriptions, skills tables, or anything already present in existing documentation.

SYSTEM REQUIREMENTS

Before execution the agent MUST load: .claude/protocols/gardener.md


Init Project — Generate CLAUDE.md

Verbosity Protocol (SILENT MODE)

  • Do NOT output intermediate scan results or file lists to chat.
  • Output to chat ONLY: blocker messages, confirmation prompts, and the final SKILL COMPLETE block.
<purpose> Generate a minimal CLAUDE.md draft based on repository analysis. Focus: tech stack, commands, and banned alternatives — nothing more. Human review required before committing. </purpose>

Algorithm

Step 1: Detect Stack

cat package.json 2>/dev/null
cat tsconfig.json 2>/dev/null
ls src/ 2>/dev/null
ls 2>/dev/null

Extract:

  • Framework (React / Vue / Next / Nuxt — check for "react" or "vue" in deps)
  • TypeScript? Strict mode? (check tsconfig.json "strict": true)
  • Styling (Tailwind / CSS Modules / styled-components / emotion)
  • Global state (Zustand / Pinia / Redux / Jotai)
  • Server state (TanStack Query / SWR / Apollo)
  • Build tool (Vite / Webpack / Turbopack)
  • Testing (Vitest / Jest + Playwright / Cypress)
  • Linter (Biome / ESLint / Prettier)
  • API Client (HeyAPI / openapi-ts / axios / raw fetch)

Step 2: Detect Architecture

ls src/ 2>/dev/null

Identify pattern:

  • FSD: app/ pages/ widgets/ features/ entities/ shared/
  • Layer-based: components/ hooks/ pages/ utils/
  • Domain-based: feature name folders at root of src/
  • Flat: all files in src/

Step 3: Extract Commands

cat package.json | grep -A 20 '"scripts"'

Map to: dev, build, test, typecheck, lint.

Step 4: Generate CLAUDE.md

Read references/claude-md-template.md. Fill in detected values. Mark unknown values as TODO for user to fill.

Include:

  • Detected tech stack table (React or Vue column, with BANNED column)
  • Actual commands from package.json scripts

Do NOT include:

  • Project Structure / directory tree (agents discover files on their own)
  • Available Skills table (agents discover skills from YAML headers)
  • Codebase overview or architecture description
  • Content already present in README or docs/

Minimality check: Before saving, delete any section that duplicates information already available in the repository.

Step 5: Validate

  • No [placeholder] or TODO left in output (fill or remove)
  • Tech stack matches actual package.json (not guessed)
  • Commands exist in package.json scripts
  • No codebase overview or directory listing sections
  • No skills listing
  • No duplicated content from README/docs
  • No Safety Protocols section (covered by Claude Code system prompt)
  • No HTML comments from template

Step 6: Write

If CLAUDE.md already exists:

⚠️ CLAUDE.md already exists. Show diff and ask for confirmation before overwriting.

Otherwise: write to project root.

Step 7: Scaffold Convention Stubs

Write the following stub files to .claude/conventions/ (skip any that already exist):

  • _index.md — table of convention files
  • icons.md — icon library choice and usage pattern
  • ui-library.md — component library (shadcn / Headless UI / custom)
  • api-layer.md — env vars, base URLs, auth headers
  • routing.md — router setup and file conventions
  • fonts-and-assets.md — font source, CDN, asset pipeline

Each stub format:

# [Topic] Convention

<!-- Fill in after project setup -->
<!-- Source: -->
<!-- Package: -->
<!-- Usage: -->
<!-- Notes: -->

Read references/fe-codegen-templates.md for convention stub templates if available.

Anti-Patterns

Anti-PatternWhy It BreaksFix
Including Project Structure / directory treeAgents discover files on their own; adds costRemove directory listings
Including Available Skills tableAgents discover skills from YAML headersDo not list skills
Duplicating README/docs content+20% reasoning tokensOnly include info NOT in repo docs
Hardcoded stack not matching actual projectCLAUDE.md contradicts realityScan package.json; verify before writing
[placeholder] values left unfilledTemplate cruft interpreted as literal valuesReplace all; remove if unknown

Quality Gates

  • Stack detected from actual files
  • Commands match package.json scripts
  • No codebase overview or directory listings
  • No skills listing
  • No duplicated content from README/docs
  • CLAUDE.md written to project root
  • .claude/conventions/ stubs written (6 files)

Gardener Protocol: Call .claude/protocols/gardener.md before SKILL COMPLETE.

Completion Contract

✅ SKILL COMPLETE: /init-project
├─ Artifact: CLAUDE.md
├─ Framework: [detected]
├─ Coverage: [X/7 validation checks passed]
└─ Next: Review CLAUDE.md by hand, then /component-gen [react|vue] to verify setup

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.