Aiwg aiwg-regenerate-windsurfrules
Regenerate .windsurfrules for Windsurf with preserved team directives
install
source · Clone the upstream repo
git clone https://github.com/jmagly/aiwg
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/jmagly/aiwg "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.agents/skills/aiwg-regenerate-windsurfrules" ~/.claude/skills/jmagly-aiwg-aiwg-regenerate-windsurfrules && rm -rf "$T"
manifest:
.agents/skills/aiwg-regenerate-windsurfrules/SKILL.mdsource content
Regenerate .windsurfrules
Regenerate the
.windsurfrules file for Windsurf (Codeium) integration, analyzing current project state while preserving team directives and organizational requirements.
Hook file approach (default): Generates
AIWG-windsurf.md and adds @AIWG-windsurf.md directive. Note: Windsurf @-link support is unverified — defaults to full inject until confirmed (see #444).
Full inject (
): Embeds AIWG content inline with AIWG markers.--full-inject
Parameters
| Flag | Description |
|---|---|
| Skip creating backup file |
| Preview changes without writing |
| List all detected preserved content and exit |
| Full regeneration, preserve nothing (destructive) |
Execution Steps
Step 1: Create Backup
Unless
--no-backup specified:
- Check if
exists.windsurfrules - If exists, copy to
.windsurfrules.backup-{YYYYMMDD-HHMMSS} - Report backup location
Step 2: Extract Preserved Content
Same preservation patterns as other platforms:
- Explicit Preserve Blocks:
...<!-- PRESERVE --><!-- /PRESERVE --> - Preserved Section Headings: Team *, Org *, Definition of Done, etc.
- Inline Directives: Lines with directive keywords
Step 3: Analyze Project
- Languages and package managers
- Development commands
- Test framework
- CI/CD configuration
- Directory structure
- Windsurf-specific configuration in
.windsurf/
Step 4: Detect AIWG State
Check installed frameworks by scanning:
for workflows.windsurf/workflows/
for rules.windsurf/rules/
for skills.windsurf/skills/
for aggregated agentsAGENTS.md
Read registry for framework versions.
Step 5: Generate .windsurfrules
Document Structure:
# .windsurfrules Project rules for Windsurf AI assistance. ## Project Overview {Description from README.md or package.json} ## Tech Stack - **Language**: {detected languages} - **Framework**: {detected frameworks} - **Package Manager**: {npm/yarn/pnpm/etc.} ## Development Commands | Command | Description | |---------|-------------| | `npm install` | Install dependencies | | `npm run build` | Build project | | `npm test` | Run tests | ## Project Structure
src/ → Source code test/ → Test files docs/ → Documentation
## Code Conventions {Project-specific conventions} --- ## Team Directives <!-- PRESERVED SECTION --> {ALL PRESERVED CONTENT} <!-- /PRESERVED SECTION --> --- ## AIWG Framework Integration This project uses AIWG SDLC framework with Windsurf. ### Installed Frameworks | Framework | Agents | Workflows | |-----------|--------|-----------| | sdlc-complete | 54 | 42 | ### Using Agents Agents are available via AGENTS.md (aggregated format). ### Natural Language Mappings | Request | Maps To | |---------|---------| | "run security review" | flow-security-review-cycle | | "check status" | project-status | | "start iteration N" | flow-iteration-dual-track | ## Project Artifacts {If .aiwg/ exists:} | Category | Location | |----------|----------| | Requirements | @.aiwg/requirements/ | | Architecture | @.aiwg/architecture/ | ## Core References | Topic | Reference | |-------|-----------| | Orchestration | @~/.local/share/ai-writing-guide/agentic/code/addons/aiwg-utils/prompts/core/orchestrator.md | | Agent Design | @~/.local/share/ai-writing-guide/agentic/code/addons/aiwg-utils/prompts/agents/design-rules.md | {If SDLC framework installed:} ## SDLC References | Topic | Reference | |-------|-----------| | Natural Language | @~/.local/share/ai-writing-guide/agentic/code/frameworks/sdlc-complete/docs/simple-language-translations.md | ## Resources - **AIWG Installation**: `~/.local/share/ai-writing-guide` --- <!-- Add team-specific notes below. Content in preserved sections survives regeneration. -->
Step 6: Write Output
If
: Display content, do not write.--dry-run
Otherwise:
- Write to
.windsurfrules - Report summary
.windsurfrules Regenerated ========================== Backup: .windsurfrules.backup-20251206-153512 Preserved: 2 sections, 15 lines Regenerated: Project overview, structure, AIWG integration Output: .windsurfrules (187 lines)
Examples
# Regenerate .windsurfrules /aiwg-regenerate-windsurfrules # Preview changes /aiwg-regenerate-windsurfrules --dry-run # Check preserved content /aiwg-regenerate-windsurfrules --show-preserved # Full regeneration /aiwg-regenerate-windsurfrules --full
Related Commands
| Command | Regenerates |
|---|---|
| CLAUDE.md |
| WARP.md |
| AGENTS.md |
| .cursorrules |
| .windsurfrules |
| copilot-instructions.md |
| Auto-detect |
References
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/README.md — aiwg-utils addon overview
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/native-ux-tools.md — Platform capability matrix including Windsurf
- @$AIWG_ROOT/docs/cli-reference.md — CLI reference for aiwg sync and regenerate commands
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/README.md — SDLC framework context referenced in generated .windsurfrules