-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapply-rules.bat
More file actions
160 lines (148 loc) · 5.4 KB
/
Copy pathapply-rules.bat
File metadata and controls
160 lines (148 loc) · 5.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@echo off
setlocal EnableDelayedExpansion
chcp 65001 >nul
echo DEBUG: Script started
REM Vérifier que le répertoire cible est fourni
if "%~1"=="" (
echo Error: Please provide the target project directory
echo Usage: %~nx0 ^<target-project-directory^>
exit /b 1
)
set "TARGET_DIR=%~1"
REM Créer le répertoire cible s'il n'existe pas, et initialiser le README.md
if not exist "%TARGET_DIR%\" (
echo Creating new project directory: %TARGET_DIR%
mkdir "%TARGET_DIR%"
(
echo # New Project
echo,
echo This project has been initialized with agile workflow support and auto rule generation configured from [cursor-auto-rules-agile-workflow](https://github.com/bmadcode/cursor-auto-rules-agile-workflow)
echo,
echo For workflow documentation, see [Workflow Rules](docs/workflow-rules.md)
) > "%TARGET_DIR%\README.md"
)
REM Créer le dossier .cursor\rules
if not exist "%TARGET_DIR%\.cursor\rules\" (
mkdir "%TARGET_DIR%\.cursor\rules"
)
REM Copier les fichiers de règles de base (sans écraser les existants)
echo Copying core rule files...
for %%F in (.cursor\rules\*.mdc) do (
if not exist "%TARGET_DIR%\.cursor\rules\%%~nxF" (
copy "%%F" "%TARGET_DIR%\.cursor\rules\" >nul
)
)
REM Créer le dossier docs et générer le fichier de documentation workflow-rules.md
if not exist "%TARGET_DIR%\docs\" (
mkdir "%TARGET_DIR%\docs"
)
(
echo # Cursor Workflow Rules
echo,
echo This project has been updated to use the auto rule generator from [cursor-auto-rules-agile-workflow](https://github.com/bmadcode/cursor-auto-rules-agile-workflow)
echo,
echo ^> **Note**: This script can be safely re-run at any time to update the template rules to their latest versions^. It will not impact or overwrite any custom rules you've created^.
echo,
echo ## Core Features
echo,
echo - Automated rule generation
echo - Standardized documentation formats
echo - AI behavior control and optimization
echo - Flexible workflow integration options
echo,
echo ## Workflow Integration Options
echo,
echo ### 1^. Automatic Rule Application (Recommended)
echo The core workflow rules are automatically installed in ^.cursor/rules/:
echo - `901-prd^.mdc` - Product Requirements Document standards
echo - `902-arch^.mdc` - Architecture documentation standards
echo - `903-story^.mdc` - User story standards
echo - `801-workflow-agile^.mdc` - Complete Agile workflow (optional)
echo,
echo These rules are automatically applied when working with corresponding file types^.
echo,
echo ### 2^. Notepad-Based Workflow
echo For a more flexible approach, use the templates in `xnotes/`:
echo 1^. Enable Notepads in Cursor options
echo 2^. Create a new notepad (e^.g^., "agile")
echo 3^. Copy contents from `xnotes/workflow-agile^.md`
echo 4^. Use `@notepad-name` in conversations
echo,
echo ^> **Tip:** The Notepad approach is ideal for:
echo ^> - Initial project setup
echo ^> - Story implementation
echo ^> - Focused development sessions
echo ^> - Reducing context overhead
echo,
echo ## Getting Started
echo,
echo 1^. Review the templates in `xnotes/`
echo 2^. Choose your preferred workflow approach
echo 3^. Start using the AI with confidence!
echo,
echo For demos and tutorials, visit: [BMad Code Videos](https://youtube^.com/bmadcode)
) > "%TARGET_DIR%\docs\workflow-rules.md"
REM Mettre à jour le .gitignore avec xnotes et docs
if exist "%TARGET_DIR%\.gitignore" (
findstr /L /C:".cursor/rules/_*.mdc" "%TARGET_DIR%\.gitignore" >nul
if errorlevel 1 (
(
echo,
echo # Private individual user cursor rules
echo .cursor/rules/_*.mdc
echo,
echo # Documentation and templates
echo xnotes/
echo docs/
) >> "%TARGET_DIR%\.gitignore"
)
) else (
(
echo # Private individual user cursor rules
echo .cursor/rules/_*.mdc
echo,
echo # Documentation and templates
echo xnotes/
echo docs/
) > "%TARGET_DIR%\.gitignore"
)
REM Installer les templates de Notepad
echo Setting up Notepad templates...
if not exist "%TARGET_DIR%\xnotes\" (
mkdir "%TARGET_DIR%\xnotes"
)
xcopy "xnotes\*.*" "%TARGET_DIR%\xnotes\" /E /I /Y >nul
REM Mettre à jour le .cursorignore
if exist "%TARGET_DIR%\.cursorignore" (
findstr /L /C:"xnotes/" "%TARGET_DIR%\.cursorignore" >nul
if errorlevel 1 (
(
echo,
echo # Project notes and templates
echo xnotes/
) >> "%TARGET_DIR%\.cursorignore"
)
) else (
(
echo # Project notes and templates
echo xnotes/
) > "%TARGET_DIR%\.cursorignore"
)
REM Supprimer le fichier test.txt s'il existe
if exist "%TARGET_DIR%\test.txt" (
del "%TARGET_DIR%\test.txt"
)
echo,
echo Deployment Complete!
echo Core rules: %TARGET_DIR%\.cursor\rules\
echo Notepad templates: %TARGET_DIR%\xnotes\
echo Documentation: %TARGET_DIR%\docs\workflow-rules.md
echo Updated .gitignore and .cursorignore
echo,
echo Next steps:
echo 1^. Review the documentation in docs\workflow-rules^.md
echo 2^. Choose your preferred workflow approach
echo 3^. Enable Cursor Notepads if using the flexible workflow option
echo 4^. To start a new project, use xnotes\project-idea-prompt^.md as a template
echo to craft your initial message to the AI agent
endlocal