plugins/utils/skills/aiwg-regenerate-claude/SKILL.md
Regenerate CLAUDE.md for Claude Code with hook file architecture
npx skillsauth add jmagly/aiwg aiwg-regenerate-claudeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Team content is preserved. AIWG content is updated. Only Claude-specific content is inlined.
The agent must distinguish between:
| 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) |
When running without --full-inject:
AIWG.md — assembles AIWG context from installed framework manifestsCLAUDE.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
Unless --no-backup specified:
CLAUDE.md existsCLAUDE.md.backup-{YYYYMMDD-HHMMSS}Backup created: CLAUDE.md.backup-20260113-152233If no existing file, skip backup and note: No existing CLAUDE.md found, generating fresh.
If existing CLAUDE.md present (and not --full):
Read the file and intelligently categorize each section:
Team Content (PRESERVE):
AIWG Content (UPDATE):
Identification Heuristics:
~/.local/share/ai-writing-guideDetect 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
Check for installed frameworks:
.aiwg/frameworks/registry.json if exists.claude/agents/ for deployed agents (Claude-specific).claude/commands/ for deployed commands (Claude-specific)~/.local/share/ai-writing-guide/registry.json for global stateIdentify active frameworks:
Check Claude-specific config:
Read .claude/settings.local.json if exists for:
Document Structure:
# CLAUDE.md
This file provides guidance to Claude Code when working with this codebase.
## Repository Purpose
{First paragraph from README.md or package.json description}
## Tech Stack
- **Languages**: {detected languages}
- **Runtime**: {Node.js version, Python version, etc.}
- **Package Manager**: {npm, yarn, pip, etc.}
- **Framework**: {React, FastAPI, etc. if detected}
- **Database**: {if detected from dependencies}
## Development Commands
```bash
# {grouped by purpose}
{extracted commands with descriptions}
{test command}{coverage command if found}{test directory}{Description based on directory structure}
{key directories with descriptions}
{file} - {purpose}
{repeat for key files}{List of config files and their purpose}
{INSERT ALL TEAM CONTENT HERE - EXACTLY AS FOUND}
{If team content exists, preserve it verbatim in its original location/order}
{If .aiwg/ directory exists, wire up project-specific docs:}
| Category | Location | |----------|----------| | Requirements | @.aiwg/requirements/ | | Architecture | @.aiwg/architecture/ | | Planning | @.aiwg/planning/ | | Testing | @.aiwg/testing/ | | Security | @.aiwg/security/ |
{Only include rows for directories that exist}
{ENHANCEMENT: Add @-mentions below team sections to link with AIWG resources} {Example: If team has "Security Requirements" section, add below it:} {Related: @.aiwg/security/, /flow-security-review-cycle, /flow-compliance-validation}
AIWG is installed at: ~/.local/share/ai-writing-guide
| Component | Type | Count | |-----------|------|-------| {table of installed frameworks, addons - only if any installed}
ONLY Claude Code slash commands are listed here. For full documentation, see references below.
Commands are invoked with /command-name:
Intake & Planning:
/intake-wizard - Generate project intake forms interactively/intake-from-codebase - Analyze codebase to generate intake/project-status - Check current project phase and status/project-health-check - Comprehensive project health assessmentPhase Transitions:
/flow-inception-to-elaboration - Transition to Elaboration phase/flow-elaboration-to-construction - Transition to Construction phase/flow-construction-to-transition - Transition to Transition phase/flow-gate-check - Validate phase gate criteriaContinuous Workflows:
/flow-security-review-cycle - Security validation workflow/flow-test-strategy-execution - Test execution workflow/flow-risk-management-cycle - Risk management workflow/flow-retrospective-cycle - Retrospective analysisDevelopment:
/flow-guided-implementation - Step-by-step implementation guidance/generate-tests - Generate test suite for implementation/setup-tdd - Set up test-driven development workflow/pr-review - Perform comprehensive pull request reviewRegeneration & Setup:
/aiwg-regenerate-claude - Regenerate this CLAUDE.md file/aiwg-setup-project - Set up AIWG for new project/aiwg-kb - AIWG knowledge base queries{Note: List only ~15-20 most commonly used commands}
Full command catalog (52 commands): @~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/commands/
Agents are markdown files in .claude/agents/:
Architecture & Design:
architecture-designer - System architecture and technical decisionsdatabase-architect - Database design and optimizationapi-designer - RESTful/GraphQL API designDevelopment & Implementation:
software-implementer - Test-first development (TDD)integrator - Component integration and build managementtest-engineer - Comprehensive test suite creationtest-architect - Test strategy and framework designQuality & Operations:
code-reviewer - Code quality and security reviewsecurity-architect - Security design and threat modelingdevops-engineer - CI/CD and deployment automationManagement & Coordination:
project-manager - Project planning and trackingproduct-owner - Product vision and requirementsscrum-master - Agile process facilitation{Note: List only deployed agents, ~10-15 most relevant}
Full agent catalog: @~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/agents/
You are the Core Orchestrator. When users request workflows:
Natural language mappings:
| User says... | Maps to... | |--------------|------------| | "transition to elaboration" | /flow-inception-to-elaboration | | "run security review" | /flow-security-review-cycle | | "check status" | /project-status | | "start iteration 2" | /flow-iteration-dual-track | | "generate tests" | /generate-tests | | "review this PR" | /pr-review |
Full natural language guide: @~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/docs/simple-language-translations.md
AIWG Installation: ~/.local/share/ai-writing-guide/
Framework Documentation:
Core References:
Multi-vendor setup?
### Step 6: Write Output
**If `--dry-run`:**
Display the generated content, do not write.
**Otherwise:**
1. Write generated content to `CLAUDE.md`
2. Verify write succeeded
3. Report summary
**Hook file approach (default)**:
Backup: CLAUDE.md.backup-20260113-152233
Hook File: ✓ AIWG.md generated (312 lines) - Frameworks: sdlc-complete v2.1.0, aiwg-utils v1.5.0 - Includes: orchestrator context, RULES-INDEX, 47 commands, 12 agents
CLAUDE.md Updated: ✓ Team content preserved (46 lines) ✓ @AIWG.md directive added
Output: CLAUDE.md (49 lines), AIWG.md (312 lines)
To disable AIWG context: aiwg hook-disable To regenerate hook only: aiwg hook-regenerate
**Full inject mode (`--full-inject`)**:
Backup: CLAUDE.md.backup-20260113-152233
Team Content Preserved: ✓ Team Conventions (18 lines) ✓ Definition of Done (9 lines) ✓ Security Requirements (7 lines) ✓ API Guidelines (12 lines)
AIWG Content Updated: ✓ Tech Stack (TypeScript, Node.js 18+) ✓ Development Commands (12 scripts) ✓ Testing (Vitest) ✓ AIWG Integration (387 lines inline)
Output: CLAUDE.md (433 lines, 18,244 bytes) Note: Using legacy full-inject mode. Run without --full-inject to use hook file approach.
## Content Enhancement
When preserving team content, the agent MAY add helpful @-mentions and links below team sections **without modifying the team's words**.
**Example:**
Team wrote:
```markdown
## Security Requirements
- Must comply with SOC2
- All data encrypted at rest
- Quarterly penetration testing
Agent enhances:
## Security Requirements
- Must comply with SOC2
- All data encrypted at rest
- Quarterly penetration testing
Related: /flow-security-review-cycle, /flow-compliance-validation, @.aiwg/security/
The team's content is untouched. Links are added below.
INCLUDE (inline in CLAUDE.md):
.claude/commands/.claude/agents/EXCLUDE (reference only, don't inline):
REFERENCE (link to, don't detail):
Target size: 300-450 lines (excluding team content)
The agent MAY update genuinely outdated information:
The agent MUST NOT change:
# Regenerate CLAUDE.md with intelligent preservation and vendor filtering
/aiwg-regenerate-claude
# Preview without writing
/aiwg-regenerate-claude --dry-run
# Full regeneration (replaces everything)
/aiwg-regenerate-claude --full
# Skip backup (use carefully)
/aiwg-regenerate-claude --no-backup
| Condition | Action | |-----------|--------| | No CLAUDE.md exists | Generate fresh document | | Backup fails | Abort, report error | | Read error | Report error, suggest --full | | No AIWG detected | Generate project-only content, warn | | No package files | Generate minimal structure, warn | | Ambiguous content | Preserve it (err on side of caution) |
| Command | Regenerates |
|---------|-------------|
| /aiwg-regenerate-claude | CLAUDE.md (Claude Code) |
| /aiwg-regenerate-copilot | copilot-instructions.md (GitHub Copilot) |
| /aiwg-regenerate-cursorrules | .cursorrules (Cursor) |
| /aiwg-regenerate-windsurfrules | .windsurfrules (Windsurf) |
| /aiwg-regenerate-warp | WARP.md (Warp Terminal) |
| /aiwg-regenerate-factory | .factory/README.md (Factory AI) |
| /aiwg-regenerate-agents | AGENTS.md (Multi-vendor) |
| /aiwg-regenerate | Auto-detect vendor |
data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.