/aiwg-regenerate-claude
Regenerate CLAUDE.md for Claude Code with hook file architecture
Claude Code
$ npx -y skills add jmagly/aiwg --skill aiwg-regenerate-claude --agent claude-code
Codex
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a codex -y
Cursor
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a cursor -y
Gemini CLI
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a gemini-cli -y
GitHub Copilot
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a github-copilot -y
OpenCode
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a opencode -y
Windsurf
$ npx skills add jmagly/aiwg --skill aiwg-regenerate-claude -a windsurf -y
SKILL.md
aiwg-regenerate-claude.SKILL.mdnamespace: aiwg
name: aiwg-regenerate-claude
platforms: [all]
description: Regenerate CLAUDE.md for Claude Code with hook file architecture
<!-- AIWG-SKILL-CALLOUT --> > **Skill access pattern (post-kernel-pivot, 2026.5+)** > > Skill names referenced in this document's *narrative* are AIWG skills, **not slash commands**. Most are not kernel-listed and cannot be invoked as `/skill-name` by the platform. Reach them via: > > ```bash > aiwg discover "<capability>" > aiwg show skill <name> --body > ``` > > Only kernel-listed skills (`aiwg-doctor`, `aiwg-refresh`, `aiwg-status`, `aiwg-help`, `use`, `steward`) are directly invokable as slash commands. See [skill-discovery rule](../../rules/skill-discovery.md). > > **Exception**: The "Available Slash Commands (Claude Code)" template block below is *generated output* destined for end-user CLAUDE.md files, where Claude Code's slash-command syntax applies. Slash prefixes in that block are preserved intentionally.
Regenerate CLAUDE.md
Regenerate the CLAUDE.md file for Claude Code integration. This command performs an **intelligent merge** — analyzing the current project state while preserving team-written content.
**Hook file architecture (default):** Generates `AIWG.md` with all AIWG context, and adds a single `@AIWG.md` directive to CLAUDE.md. This keeps CLAUDE.md minimal and user-owned.
**Full injection (`--full-inject`):** Legacy mode — injects full AIWG content directly into CLAUDE.md (useful for platforms that do not support @-link loading, or user preference).
**Vendor-specific filtering:** This command includes ONLY Claude Code slash commands and agents, reducing context pollution. Other vendor content is referenced but not inlined.
Core Principle
**Team content is preserved. AIWG content is updated. Only Claude-specific content is inlined.**
The agent must distinguish between:
- **Team content**: Project rules, conventions, requirements, decisions written by humans
- **AIWG content**: Framework integration, agent definitions, reference links generated by AIWG
- **Claude-specific**: Slash commands, Claude agents, Claude settings
- **Other vendors**: Copilot, Cursor, Warp commands (reference only)
Parameters
| Flag | Description | |------|-------------| | `--no-backup` | Skip creating backup file | | `--dry-run` | Preview changes without writing | | `--full` | Full regeneration - replaces everything (destructive) | | `--full-inject` | Inject AIWG content directly into CLAUDE.md (legacy/compatibility mode) | | `--migrate` | Migrate existing full-injection to hook file approach (runs `/migrate-hook --provider claude`) |
Hook File Architecture (Default)
When running without `--full-inject`:
1. **Generate `AIWG.md`** — assembles AIWG context from installed framework manifests 2. **Update `CLAUDE.md`** — minimal: user content + `@AIWG.md` directive
# CLAUDE.md
## Repository Purpose
[your project description]
@AIWG.md
## Project-Specific Notes
[your team conventions here]
To revert to inline injection: `/aiwg-regenerate-claude --full-inject`
To disable context temporarily: `aiwg hook-disable`
Execution Steps
Step 1: Create Backup
Unless `--no-backup` specified:
1. Check if `CLAUDE.md` exists 2. If exists, copy to `CLAUDE.md.backup-{YYYYMMDD-HHMMSS}` 3. Report: `Backup created: CLAUDE.md.backup-20260113-152233`
If no existing file, skip backup and note: `No existing CLAUDE.md found, generating fresh.`
Step 2: Analyze Existing Content
If existing CLAUDE.md present (and not `--full`):
**Read the file and intelligently categorize each section:**
**Team Content (PRESERVE):**
- Project-specific coding standards and conventions
- API guidelines and architectural decisions
- Security policies and compliance requirements
- Team workflows and processes
- Business rules and constraints
- Definition of Done criteria
- Historical context and rationale
- Any content that reflects human decisions about the project
**AIWG Content (UPDATE):**
- AIWG Integration sections
- Agent definitions and listings
- Command listings
- @-mention reference tables
- Orchestration instructions
- Framework version information
- Auto-detected project info (tech stack, commands)
**Identification Heuristics:**
- Team content often uses first-person ("we", "our team")
- Team content references specific business/domain terms
- Team content contains opinions, preferences, rationale
- AIWG content references `~/.local/share/ai-writing-guide`
- AIWG content has structured @-mention tables
- AIWG content lists agents, commands, frameworks
Step 3: Analyze Project
**Detect Languages & Package Managers:**
Use Glob to find package files:
package.json → Node.js/npm
pyproject.toml / requirements.txt → Python
go.mod → Go
Cargo.toml → Rust
pom.xml / build.gradle → Java
composer.json → PHP
Gemfile → Ruby
**Extract Development Commands:**
From `package.json`:
{
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint ."
}
}From `Makefile`:
build:
go build ./...
test:
go test ./...**Detect Test Framework:**
| File Pattern | Framework | |--------------|-----------| | `jest.config.*` | Jest | | `vitest.config.*` | Vitest | | `pytest.ini`, `conftest.py` | Pytest | | `*_test.go` | Go testing | | `.rspec` | RSpec | | `phpunit.xml` | PHPUnit |
**Detect CI/CD:**
| Path | Platform | |------|----------| | `.github/workflows/*.yml` | GitHub Actions | | `.gitlab-ci.yml` | GitLab CI | | `Jenkinsfile` | Jenkins | | `.circleci/config.yml` | CircleCI | | `azure-pipelines.yml` | Azure DevOps |
**Extract Project Description:**
Read first meaningful paragraph from `README.md` or `description` from `package.json`.
**Analyze Directory Structure:**
src/ or lib/ → Source code
test/ or tests/ or __tests__/ → Tests
docs/ → Documentation
scripts/ or tools/ → Tooling
.github/ → GitHub configuration
Step 4: Detect AIWG State
**Check for installed framew
Read more
namespace: aiwg name: aiwg-regenerate-claude platforms: [all] description: Regenerate CLAUDE.md for Claude Code with hook file architecture
<!-- AIWG-SKILL-CALLOUT --> > **Skill access pattern (post-kernel-pivot, 2026.5+)** > > Skill names referenced in this document's *narrative* are AIWG skills, **not slash commands**. Most are not kernel-listed and cannot be invoked as `/skill-name` by the platform. Reach them via: > > ```bash > aiwg discover "<capability>" > aiwg show skill <name> --body > ``` > > Only kernel-listed skills (`aiwg-doctor`, `aiwg-refresh`, `aiwg-status`, `aiwg-help`, `use`, `steward`) are directly invokable as slash commands. See [skill-discovery rule](../../rules/skill-discovery.md). > > **Exception**: The "Available Slash Commands (Claude Code)" template block below is *generated output* destined for end-user CLAUDE.md files, where Claude Code's slash-command syntax applies. Slash prefixes in that block are preserved intentionally.
Regenerate CLAUDE.md
Regenerate the CLAUDE.md file for Claude Code integration. This command performs an **intelligent merge** — analyzing the current project state while preserving team-written content.
**Hook file architecture (default):** Generates `AIWG.md` with all AIWG context, and adds a single `@AIWG.md` directive to CLAUDE.md. This keeps CLAUDE.md minimal and user-owned.
**Full injection (`--full-inject`):** Legacy mode — injects full AIWG content directly into CLAUDE.md (useful for platforms that do not support @-link loading, or user preference).
**Vendor-specific filtering:** This command includes ONLY Claude Code slash commands and agents, reducing context pollution. Other vendor content is referenced but not inlined.
Core Principle
**Team content is preserved. AIWG content is updated. Only Claude-specific content is inlined.**
The agent must distinguish between:
- **Team content**: Project rules, conventions, requirements, decisions written by humans
- **AIWG content**: Framework integration, agent definitions, reference links generated by AIWG
- **Claude-specific**: Slash commands, Claude agents, Claude settings
- **Other vendors**: Copilot, Cursor, Warp commands (reference only)
Parameters
| Flag | Description | |------|-------------| | `--no-backup` | Skip creating backup file | | `--dry-run` | Preview changes without writing | | `--full` | Full regeneration - replaces everything (destructive) | | `--full-inject` | Inject AIWG content directly into CLAUDE.md (legacy/compatibility mode) | | `--migrate` | Migrate existing full-injection to hook file approach (runs `/migrate-hook --provider claude`) |
Hook File Architecture (Default)
When running without `--full-inject`:
1. **Generate `AIWG.md`** — assembles AIWG context from installed framework manifests 2. **Update `CLAUDE.md`** — minimal: user content + `@AIWG.md` directive
# CLAUDE.md ## Repository Purpose [your project description] @AIWG.md ## Project-Specific Notes [your team conventions here]
To revert to inline injection: `/aiwg-regenerate-claude --full-inject`
To disable context temporarily: `aiwg hook-disable`
Execution Steps
Step 1: Create Backup
Unless `--no-backup` specified:
1. Check if `CLAUDE.md` exists 2. If exists, copy to `CLAUDE.md.backup-{YYYYMMDD-HHMMSS}` 3. Report: `Backup created: CLAUDE.md.backup-20260113-152233`
If no existing file, skip backup and note: `No existing CLAUDE.md found, generating fresh.`
Step 2: Analyze Existing Content
If existing CLAUDE.md present (and not `--full`):
**Read the file and intelligently categorize each section:**
**Team Content (PRESERVE):**
- Project-specific coding standards and conventions
- API guidelines and architectural decisions
- Security policies and compliance requirements
- Team workflows and processes
- Business rules and constraints
- Definition of Done criteria
- Historical context and rationale
- Any content that reflects human decisions about the project
**AIWG Content (UPDATE):**
- AIWG Integration sections
- Agent definitions and listings
- Command listings
- @-mention reference tables
- Orchestration instructions
- Framework version information
- Auto-detected project info (tech stack, commands)
**Identification Heuristics:**
- Team content often uses first-person ("we", "our team")
- Team content references specific business/domain terms
- Team content contains opinions, preferences, rationale
- AIWG content references `~/.local/share/ai-writing-guide`
- AIWG content has structured @-mention tables
- AIWG content lists agents, commands, frameworks
Step 3: Analyze Project
**Detect Languages & Package Managers:**
Use Glob to find package files:
package.json → Node.js/npm pyproject.toml / requirements.txt → Python go.mod → Go Cargo.toml → Rust pom.xml / build.gradle → Java composer.json → PHP Gemfile → Ruby
**Extract Development Commands:**
From `package.json`:
{
"scripts": {
"build": "tsc",
"test": "vitest",
"lint": "eslint ."
}
}From `Makefile`:
build:
go build ./...
test:
go test ./...**Detect Test Framework:**
| File Pattern | Framework | |--------------|-----------| | `jest.config.*` | Jest | | `vitest.config.*` | Vitest | | `pytest.ini`, `conftest.py` | Pytest | | `*_test.go` | Go testing | | `.rspec` | RSpec | | `phpunit.xml` | PHPUnit |
**Detect CI/CD:**
| Path | Platform | |------|----------| | `.github/workflows/*.yml` | GitHub Actions | | `.gitlab-ci.yml` | GitLab CI | | `Jenkinsfile` | Jenkins | | `.circleci/config.yml` | CircleCI | | `azure-pipelines.yml` | Azure DevOps |
**Extract Project Description:**
Read first meaningful paragraph from `README.md` or `description` from `package.json`.
**Analyze Directory Structure:**
src/ or lib/ → Source code test/ or tests/ or __tests__/ → Tests docs/ → Documentation scripts/ or tools/ → Tooling .github/ → GitHub configuration
Step 4: Detect AIWG State
**Check for installed framew
Reusable project context and specialist workflows for the AI tools you already use. Plan software, coordinate specialist reviews, prepare campaigns, investigate incidents, organize research, curate media, and maintain operational knowledge.
Other skills on aiwg.
More skills from other plugins.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Questions about aiwg-regenerate-claude.
- Which coding agents can use aiwg-regenerate-claude?
- aiwg-regenerate-claude installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

