@agentic15.com/agentic15-claude-zen 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE +201 -0
  3. package/README.md +204 -0
  4. package/bin/create-agentic15-claude-zen.js +201 -0
  5. package/dist/hooks/auto-format.js +2 -0
  6. package/dist/hooks/check-pending-reviews.js +2 -0
  7. package/dist/hooks/complete-task.js +2 -0
  8. package/dist/hooks/detect-pending-reviews.js +2 -0
  9. package/dist/hooks/enforce-hard-requirements.js +2 -0
  10. package/dist/hooks/enforce-migration-workflow.js +2 -0
  11. package/dist/hooks/enforce-plan-template.js +2 -0
  12. package/dist/hooks/enforce-structured-development.js +2 -0
  13. package/dist/hooks/enforce-test-pyramid.js +2 -0
  14. package/dist/hooks/init-task-tracker.js +2 -0
  15. package/dist/hooks/performance-cache.js +2 -0
  16. package/dist/hooks/prevent-read-bypass.js +2 -0
  17. package/dist/hooks/session-start-context.js +2 -0
  18. package/dist/hooks/start-task.js +2 -0
  19. package/dist/hooks/task-status.js +2 -0
  20. package/dist/hooks/validate-component-contract.js +2 -0
  21. package/dist/hooks/validate-database-changes.js +2 -0
  22. package/dist/hooks/validate-e2e-coverage.js +2 -0
  23. package/dist/hooks/validate-git-workflow.js +2 -0
  24. package/dist/hooks/validate-integration-site.js +2 -0
  25. package/dist/hooks/validate-migration-impact.js +2 -0
  26. package/dist/hooks/validate-task-completion.js +2 -0
  27. package/dist/hooks/validate-test-quality.js +2 -0
  28. package/dist/hooks/validate-test-results.js +2 -0
  29. package/dist/hooks/validate-ui-integration.js +2 -0
  30. package/dist/hooks/validate-ui-runtime.js +2 -0
  31. package/dist/hooks/validate-ui-syntax.js +2 -0
  32. package/dist/hooks/validate-ui-visual-native.js +2 -0
  33. package/dist/hooks/validate-ui-visual.js +2 -0
  34. package/dist/hooks/validate-visual-regression.js +2 -0
  35. package/dist/index.js +24 -0
  36. package/dist/index.js.map +7 -0
  37. package/dist/scripts/add-version-headers.js +2 -0
  38. package/dist/scripts/help.js +2 -0
  39. package/dist/scripts/plan-amend.js +2 -0
  40. package/dist/scripts/plan-create.js +2 -0
  41. package/dist/scripts/plan-generate.js +2 -0
  42. package/dist/scripts/plan-help.js +2 -0
  43. package/dist/scripts/plan-init.js +2 -0
  44. package/dist/scripts/plan-manager.js +2 -0
  45. package/dist/scripts/pre-publish-checklist.js +2 -0
  46. package/dist/scripts/production-test.js +2 -0
  47. package/dist/scripts/profile-hooks.js +2 -0
  48. package/dist/scripts/setup-git-hooks.js +2 -0
  49. package/dist/scripts/task-done.js +2 -0
  50. package/dist/scripts/task-merge.js +2 -0
  51. package/dist/scripts/task-next.js +2 -0
  52. package/dist/scripts/task-start.js +2 -0
  53. package/dist/scripts/task-status.js +2 -0
  54. package/dist/scripts/verify-hooks.js +2 -0
  55. package/package.json +61 -0
  56. package/src/core/DependencyInstaller.js +41 -0
  57. package/src/core/GitInitializer.js +45 -0
  58. package/src/core/HookInstaller.js +54 -0
  59. package/src/core/ProjectInitializer.js +105 -0
  60. package/src/core/TemplateManager.js +159 -0
  61. package/src/index.js +56 -0
  62. package/templates/.babelrc +6 -0
  63. package/templates/.claude/CLAUDE.md +408 -0
  64. package/templates/.claude/ONBOARDING.md +723 -0
  65. package/templates/.claude/PLAN-SCHEMA.json +240 -0
  66. package/templates/.claude/POST-INSTALL.md +248 -0
  67. package/templates/.claude/PROJECT-PLAN-TEMPLATE.json +223 -0
  68. package/templates/.claude/hooks/enforce-plan-template.js +106 -0
  69. package/templates/.claude/hooks/session-start-context.js +130 -0
  70. package/templates/.claude/hooks/validate-git-workflow.js +74 -0
  71. package/templates/.claude/settings.json +262 -0
  72. package/templates/.gitignore +14 -0
  73. package/templates/Agent/.gitkeep +3 -0
  74. package/templates/README.md +76 -0
  75. package/templates/__mocks__/fileMock.js +9 -0
  76. package/templates/jest.config.js +48 -0
  77. package/templates/jest.setup.js +13 -0
  78. package/templates/package.json +40 -0
  79. package/templates/scripts/.gitkeep +3 -0
  80. package/templates/test-site/README.md +271 -0
  81. package/templates/test-site/index.html +13 -0
  82. package/templates/test-site/package.json +25 -0
  83. package/templates/test-site/server.js +125 -0
  84. package/templates/test-site/src/App.css +130 -0
  85. package/templates/test-site/src/App.jsx +78 -0
  86. package/templates/test-site/src/index.css +39 -0
  87. package/templates/test-site/src/main.jsx +10 -0
  88. package/templates/test-site/vite.config.js +12 -0
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Copyright 2024-2025 Agentic15
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { mkdirSync, cpSync, readFileSync, writeFileSync, existsSync } from 'fs';
18
+ import { join, dirname } from 'path';
19
+ import { fileURLToPath } from 'url';
20
+
21
+ const __filename = fileURLToPath(import.meta.url);
22
+ const __dirname = dirname(__filename);
23
+
24
+ /**
25
+ * TemplateManager - Manages template copying and customization
26
+ *
27
+ * Single Responsibility: Copy and customize project templates
28
+ */
29
+ export class TemplateManager {
30
+ constructor() {
31
+ this.templatesDir = join(__dirname, '..', 'templates');
32
+ this.distDir = join(__dirname, '.');
33
+ }
34
+
35
+ /**
36
+ * Copy all templates to target directory
37
+ *
38
+ * @param {string} projectName - Name of the project
39
+ * @param {string} targetDir - Target directory path
40
+ */
41
+ async copyTemplates(projectName, targetDir) {
42
+ console.log('📦 Creating project directory...');
43
+ mkdirSync(targetDir, { recursive: true });
44
+
45
+ console.log('📋 Copying framework templates...');
46
+
47
+ // Copy .claude directory structure
48
+ this.copyDirectory('.claude', targetDir);
49
+
50
+ // Copy and customize package.json
51
+ this.copyAndCustomize('package.json', targetDir, projectName);
52
+
53
+ // Copy and customize README.md
54
+ this.copyAndCustomize('README.md', targetDir, projectName);
55
+
56
+ // Copy .gitignore (npm may rename it)
57
+ this.copyGitignore(targetDir);
58
+
59
+ // Copy test-site
60
+ this.copyDirectory('test-site', targetDir);
61
+
62
+ // Copy Agent directory
63
+ this.copyDirectory('Agent', targetDir);
64
+
65
+ // Copy scripts directory
66
+ this.copyDirectory('scripts', targetDir);
67
+
68
+ // Copy Jest configuration files
69
+ this.copySingleFile('jest.config.js', targetDir);
70
+ this.copySingleFile('jest.setup.js', targetDir);
71
+ this.copySingleFile('.babelrc', targetDir);
72
+
73
+ // Copy __mocks__ directory
74
+ this.copyDirectory('__mocks__', targetDir);
75
+
76
+ console.log('✅ Framework structure created');
77
+ console.log('✅ Templates copied');
78
+ console.log('✅ Configuration files generated');
79
+ }
80
+
81
+ /**
82
+ * Extract bundled scripts and hooks to node_modules
83
+ *
84
+ * @param {string} targetDir - Target directory path
85
+ */
86
+ async extractBundledFiles(targetDir) {
87
+ const bundleDir = join(targetDir, 'node_modules', '.agentic15-claude-zen');
88
+ console.log('\n📦 Setting up bundled scripts and hooks...');
89
+ mkdirSync(bundleDir, { recursive: true });
90
+
91
+ // Copy bundled scripts
92
+ console.log(' ├─ scripts/');
93
+ const bundledScriptsDir = join(this.distDir, 'scripts');
94
+ cpSync(bundledScriptsDir, join(bundleDir, 'scripts'), { recursive: true });
95
+
96
+ // Copy bundled hooks
97
+ console.log(' └─ hooks/');
98
+ const bundledHooksDir = join(this.distDir, 'hooks');
99
+ cpSync(bundledHooksDir, join(bundleDir, 'hooks'), { recursive: true });
100
+
101
+ console.log('✅ Bundled files extracted');
102
+ }
103
+
104
+ /**
105
+ * Copy a directory from templates to target
106
+ *
107
+ * @param {string} dirName - Directory name
108
+ * @param {string} targetDir - Target directory path
109
+ */
110
+ copyDirectory(dirName, targetDir) {
111
+ console.log(` ├─ ${dirName}/`);
112
+ cpSync(
113
+ join(this.templatesDir, dirName),
114
+ join(targetDir, dirName),
115
+ { recursive: true }
116
+ );
117
+ }
118
+
119
+ /**
120
+ * Copy a single file from templates to target
121
+ *
122
+ * @param {string} fileName - File name
123
+ * @param {string} targetDir - Target directory path
124
+ */
125
+ copySingleFile(fileName, targetDir) {
126
+ console.log(` ├─ ${fileName}`);
127
+ cpSync(
128
+ join(this.templatesDir, fileName),
129
+ join(targetDir, fileName)
130
+ );
131
+ }
132
+
133
+ /**
134
+ * Copy and customize a file with project name replacement
135
+ *
136
+ * @param {string} fileName - File name
137
+ * @param {string} targetDir - Target directory path
138
+ * @param {string} projectName - Project name for replacement
139
+ */
140
+ copyAndCustomize(fileName, targetDir, projectName) {
141
+ console.log(` ├─ ${fileName}`);
142
+ const template = readFileSync(join(this.templatesDir, fileName), 'utf8');
143
+ const customized = template.replace(/\{\{PROJECT_NAME\}\}/g, projectName);
144
+ writeFileSync(join(targetDir, fileName), customized);
145
+ }
146
+
147
+ /**
148
+ * Copy .gitignore file (handles npm renaming issue)
149
+ *
150
+ * @param {string} targetDir - Target directory path
151
+ */
152
+ copyGitignore(targetDir) {
153
+ console.log(' ├─ .gitignore');
154
+ const gitignoreSource = existsSync(join(this.templatesDir, '.gitignore'))
155
+ ? join(this.templatesDir, '.gitignore')
156
+ : join(this.templatesDir, '.npmignore');
157
+ cpSync(gitignoreSource, join(targetDir, '.gitignore'));
158
+ }
159
+ }
package/src/index.js ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Copyright 2024-2025 Agentic15
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /**
18
+ * Agentic15 Claude Zen - Main Entry Point
19
+ *
20
+ * Structured AI-assisted development framework for Claude Code
21
+ * with enforced quality standards
22
+ */
23
+
24
+ import { ProjectInitializer } from './core/ProjectInitializer.js';
25
+ import { TemplateManager } from './core/TemplateManager.js';
26
+ import { HookInstaller } from './core/HookInstaller.js';
27
+ import { DependencyInstaller } from './core/DependencyInstaller.js';
28
+ import { GitInitializer } from './core/GitInitializer.js';
29
+
30
+ /**
31
+ * Initialize a new project with Agentic15 Claude Zen framework
32
+ *
33
+ * @param {string} projectName - Name of the project
34
+ * @param {string} targetDir - Target directory path
35
+ * @param {Object} options - Configuration options
36
+ * @param {boolean} options.initGit - Initialize git repository (default: true)
37
+ * @param {boolean} options.installDeps - Install npm dependencies (default: true)
38
+ */
39
+ export async function initializeProject(projectName, targetDir, options = {}) {
40
+ // Dependency Injection: Create all dependencies
41
+ const templateManager = new TemplateManager();
42
+ const hookInstaller = new HookInstaller();
43
+ const dependencyInstaller = new DependencyInstaller();
44
+ const gitInitializer = new GitInitializer();
45
+
46
+ // Create orchestrator with injected dependencies
47
+ const projectInitializer = new ProjectInitializer(
48
+ templateManager,
49
+ hookInstaller,
50
+ dependencyInstaller,
51
+ gitInitializer
52
+ );
53
+
54
+ // Execute initialization
55
+ await projectInitializer.initialize(projectName, targetDir, options);
56
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", { "targets": { "node": "current" } }],
4
+ ["@babel/preset-react", { "runtime": "automatic" }]
5
+ ]
6
+ }
@@ -0,0 +1,408 @@
1
+ # Structured Coding Project
2
+ **Version:** 1.4.0
3
+ **Last Updated:** 2025-12-23
4
+ **Package:** agentic15-claude-zen
5
+
6
+ ## Communication Protocol
7
+ - Keep responses under 10 lines (brief summaries only)
8
+ - If user asks specific question, answer ONLY that question
9
+ - No examples, walls of text, or comprehensive explanations unless requested
10
+ - Ask "want details?" if answer requires more than 10 lines
11
+ - If making in-memory promise/correction, state: "IN MEMORY: WILL BE LOST ON CONTEXT CHANGE"
12
+
13
+ ## Your Job
14
+ Write source code and tests. Run them. Fix them. That's it.
15
+
16
+ ## What You Can Do
17
+ - Read any file (full codebase visibility)
18
+ - Modify files in `./Agent/` directory (all source, tests, migrations, db)
19
+ - Modify files in `./scripts/` directory (server scripts, utilities)
20
+ - Run npm scripts (build, test, lint)
21
+ - Commit and push to main branch
22
+
23
+ ## What You Cannot Do (Hard Blocked)
24
+ - Modify ANY files outside `./Agent/` and `./scripts/` directories (BLOCKED)
25
+ - Execute scripts in `./scripts/` or `./Agent/db/` (BLOCKED - human executes only)
26
+ - Modify documentation files (.md files in `./docs/` are DENIED)
27
+ - EDIT project plans once created (can Write initial plan, but Edit is BLOCKED)
28
+ - EDIT project plans once locked (hooks enforce immutability after lock)
29
+ - Modify .env or config files without asking
30
+ - Edit existing migration files (migrations are immutable once created)
31
+ - Run database CLI commands directly (psql, mysql, mongosh DENIED)
32
+ - Write code without an active task (task tracker enforced)
33
+ - Force push
34
+ - Install dependencies without asking
35
+ - Access external networks (curl, wget DENIED)
36
+
37
+ ## Git Workflow (Hard Enforced by Hooks)
38
+ **All work happens directly on main branch.** Task IDs in commit messages help track changes.
39
+
40
+ ### With Structured Development (Recommended):
41
+ 1. Start task: `npm run task:start TASK-001`
42
+ 2. Write code on main branch
43
+ 3. Run tests
44
+ 4. Commit frequently: `git commit -m "[TASK-001] Description"`
45
+ 5. Push to remote: `git push origin main`
46
+ 6. Complete task: `npm run task:done TASK-001`
47
+
48
+ ### Without Structured Development:
49
+ 1. Work on main branch
50
+ 2. Write code
51
+ 3. Run tests
52
+ 4. Commit: `git commit -m "Description"`
53
+ 5. Push: `git push origin main`
54
+
55
+ **Note:** All commits reference task IDs for traceability. No branching required.
56
+
57
+ ## Before Every Commit (Hard Enforced)
58
+ - Tests MUST pass (validated by hooks)
59
+ - Tests MUST contain real assertions (validated by hooks)
60
+ - Tests MUST NOT be empty/fake (validated by hooks)
61
+ - Code MUST be formatted (auto-formatted by hooks)
62
+
63
+ **⚡ SMART TESTING:**
64
+ - Hooks test ONLY changed/staged files (fast for 43,000+ line codebases)
65
+ - Manual `npm test` runs full test suite
66
+ - Changed source files (Agent/src/) automatically test related test files
67
+ - Prevents infinite loops on large projects
68
+
69
+ ## Commands Available
70
+ - `/commit-commands:commit` - Stage and commit to main branch
71
+
72
+ ## Architecture
73
+ All source code and tests are in `./Agent/` directory.
74
+
75
+ **Agent Directory Structure:**
76
+ - `./Agent/src/` - Source code
77
+ - `./Agent/tests/` - Test files
78
+ - `./Agent/spec/` - Spec files (if using spec-based testing)
79
+ - `./Agent/migrations/` - Database migration files (immutable once created)
80
+ - `./Agent/db/` - Database scripts (Claude writes, human executes)
81
+ - `./Agent/prisma/` - Prisma schema and migrations (if using Prisma)
82
+
83
+ **Scripts Directory:**
84
+ - `./scripts/` - Server startup scripts, utilities, deployment scripts
85
+ - Claude can READ/WRITE scripts
86
+ - Human EXECUTES scripts (Claude cannot run node ./scripts/** or bash ./scripts/**)
87
+
88
+ ## Critical Rules (Enforced by Hooks)
89
+ - NEVER work from memory - always read files first
90
+ - NEVER duplicate code - check existing implementations
91
+ - NEVER write fake/empty tests - hooks will block them
92
+ - NEVER write tests without assertions - hooks will block them
93
+ - NEVER skip failing tests - hooks will block commits
94
+ - NEVER create .md files - permission system blocks them
95
+
96
+ ## How Hooks Protect You
97
+ - PreToolUse hook validates git workflow before execution
98
+ - PostToolUse hook auto-formats code after edits
99
+ - PostToolUse hook validates test quality (blocks fake tests)
100
+ - PostToolUse hook validates UI component tests (blocks API-only tests)
101
+ - PostToolUse hook validates database changes (blocks direct schema edits)
102
+ - PostToolUse hook analyzes migration impact (warns about breaking changes)
103
+ - PostToolUse hook validates test results (blocks failures)
104
+ - PostToolUse hook enforces test pyramid (warns on missing UI tests)
105
+ - PostToolUse hook enforces migration workflow (blocks unsafe migrations)
106
+ - SessionStart hook reminds you of current context
107
+ - Permission system blocks dangerous operations
108
+
109
+ ## UI Testing Requirements (Hard Enforced)
110
+ When modifying UI components (.tsx, .jsx, .vue, .svelte):
111
+ - Component test file MUST exist
112
+ - Test MUST import and render the component
113
+ - Test MUST provide required props
114
+ - Test MUST simulate user events (clicks, inputs)
115
+ - Test MUST mock API calls if component uses them
116
+ - Test MUST validate state changes if component has state
117
+ - E2E tests REQUIRED for multi-component user flows
118
+
119
+ ## Integration Test Website (Hard Enforced)
120
+
121
+ UI components MUST be integrated into a test website for stakeholder validation before production deployment.
122
+
123
+ ### Purpose
124
+ Integration test websites allow stakeholders to:
125
+ - Preview UI components in realistic scenarios
126
+ - Interact with components using actual data
127
+ - Validate behavior and design before production
128
+ - Test responsiveness across devices
129
+ - Approve UX flows and visual design
130
+
131
+ ### Requirements
132
+ When modifying UI components (.tsx, .jsx, .vue, .svelte):
133
+ 1. **Test site directory MUST exist** at `./test-site/` (or configured path)
134
+ 2. **Test site MUST have package.json** with dev script
135
+ 3. **Component SHOULD be imported** in test site for validation
136
+ 4. Test site should run locally with hot reload
137
+
138
+ ### Workflow
139
+
140
+ #### 1. Initial Setup (One-Time)
141
+ ```bash
142
+ # Test site is included in project template
143
+ cd test-site
144
+ npm install
145
+ ```
146
+
147
+ #### 2. Add Components to Test Site
148
+ Edit `test-site/src/App.jsx` to import and render your component:
149
+
150
+ ```jsx
151
+ // Import your component
152
+ import { Button } from '../Agent/src/components/Button'
153
+
154
+ function App() {
155
+ return (
156
+ <section className="demo-section">
157
+ <h2>Button Component</h2>
158
+ <p>Validation: Click handlers, variants, disabled state</p>
159
+ <Button onClick={() => alert('Clicked!')} variant="primary">
160
+ Primary Button
161
+ </Button>
162
+ <Button variant="secondary">Secondary</Button>
163
+ <Button disabled>Disabled</Button>
164
+ </section>
165
+ )
166
+ }
167
+ ```
168
+
169
+ #### 3. Run Test Site Locally
170
+ ```bash
171
+ cd test-site
172
+ npm run dev
173
+ ```
174
+
175
+ Opens at http://localhost:3000 with hot reload.
176
+
177
+ #### 4. Share with Stakeholders
178
+
179
+ **Option A: Deploy to GitHub Pages**
180
+ ```bash
181
+ cd test-site
182
+ npm run deploy
183
+ ```
184
+
185
+ Share URL: `https://username.github.io/repo-name/`
186
+
187
+ **Option B: Local Network**
188
+ Run `npm run dev` and share your local IP:
189
+ ```
190
+ http://192.168.1.XXX:3000
191
+ ```
192
+
193
+ **Option C: Tunneling (ngrok)**
194
+ ```bash
195
+ npx ngrok http 3000
196
+ ```
197
+
198
+ Share the generated public URL.
199
+
200
+ #### 5. Collect Feedback
201
+ - Schedule live demo sessions
202
+ - Record video walkthroughs
203
+ - Use GitHub Issues for feedback
204
+ - Create approval checklists
205
+
206
+ ### Best Practices
207
+
208
+ **Use Realistic Data**
209
+ ```jsx
210
+ // Good: Realistic data stakeholders recognize
211
+ <UserCard name="John Smith" email="john@company.com" role="Manager" />
212
+
213
+ // Bad: Placeholder text
214
+ <UserCard name="Test User" email="test@test.com" role="User" />
215
+ ```
216
+
217
+ **Show Multiple States**
218
+ ```jsx
219
+ <Button variant="primary">Primary</Button>
220
+ <Button variant="secondary">Secondary</Button>
221
+ <Button disabled>Disabled</Button>
222
+ <Button loading>Loading...</Button>
223
+ ```
224
+
225
+ **Test Edge Cases**
226
+ ```jsx
227
+ <UserName name="Really Long Name That Might Wrap To Multiple Lines" />
228
+ <UserName name="" /> {/* Empty state */}
229
+ <ErrorMessage>Network connection lost. Please try again.</ErrorMessage>
230
+ ```
231
+
232
+ **Group by Feature**
233
+ ```jsx
234
+ <section className="checkout-flow">
235
+ <h2>Checkout Flow</h2>
236
+ <p>Validation: Cart → Shipping → Payment → Confirmation</p>
237
+ <ShoppingCart />
238
+ <ShippingForm />
239
+ <PaymentForm />
240
+ </section>
241
+ ```
242
+
243
+ **Add Annotations**
244
+ ```jsx
245
+ <div className="demo-section">
246
+ <h2>Login Form</h2>
247
+ <p><strong>Validation Points:</strong></p>
248
+ <ul>
249
+ <li>Email validation works correctly</li>
250
+ <li>Password toggle shows/hides password</li>
251
+ <li>Error messages display properly</li>
252
+ <li>Submit button disables during API call</li>
253
+ </ul>
254
+ <LoginForm />
255
+ </div>
256
+ ```
257
+
258
+ ### Configuration
259
+
260
+ Test site requirement can be disabled in `.claude/settings.json`:
261
+ ```json
262
+ {
263
+ "testing": {
264
+ "ui": {
265
+ "requireIntegrationSite": false
266
+ }
267
+ }
268
+ }
269
+ ```
270
+
271
+ Or configure custom directory:
272
+ ```json
273
+ {
274
+ "testing": {
275
+ "ui": {
276
+ "integrationSiteDir": "demo-site"
277
+ }
278
+ }
279
+ }
280
+ ```
281
+
282
+ ### Troubleshooting
283
+
284
+ **Components Not Found**
285
+ - Check import path relative to `test-site/src/`
286
+ - Verify components are exported properly
287
+ - Ensure file extensions match (.jsx, .tsx)
288
+
289
+ **Styles Not Working**
290
+ - Import component CSS alongside components
291
+ - Configure Tailwind/styled-components if used
292
+ - Check CSS module naming conventions
293
+
294
+ **Hot Reload Issues**
295
+ - Save files to trigger reload
296
+ - Check terminal for build errors
297
+ - Restart dev server: `Ctrl+C` then `npm run dev`
298
+
299
+ **Deployment Fails**
300
+ - Ensure GitHub Pages enabled in repo settings
301
+ - Check `gh-pages` branch exists
302
+ - Verify base path in `vite.config.js`
303
+
304
+ ### Framework Support
305
+
306
+ **React (Default)**
307
+ Template uses Vite + React with hot reload.
308
+
309
+ **Vue**
310
+ See `test-site/README.md` for Vue migration guide.
311
+
312
+ **Svelte**
313
+ See `test-site/README.md` for Svelte migration guide.
314
+
315
+ ## Database Migration Requirements (Hard Enforced)
316
+ Database changes MUST follow migration workflow:
317
+ - WRITE migration files in `./Agent/migrations/` or `./Agent/prisma/migrations/`
318
+ - WRITE database scripts in `./Agent/db/` (setup, seed, backup scripts)
319
+ - NEVER edit existing migrations (migrations are immutable once created)
320
+ - NEVER run database CLI (psql, mysql, mongosh BLOCKED)
321
+ - NEVER execute scripts (node ./Agent/db/** is BLOCKED)
322
+ - Human executes database scripts, Claude only writes them
323
+ - ALWAYS create new migration scripts:
324
+ - TypeORM: npm run migration:generate -- -n YourChange
325
+ - Prisma: npx prisma migrate dev --name your-change
326
+ - Sequelize: npx sequelize-cli migration:generate --name your-change
327
+ - ALWAYS update code/tests affected by schema changes
328
+ - ALWAYS run tests after migrations to verify compatibility
329
+ - Breaking changes (DROP/RENAME) require updating ALL affected code first
330
+
331
+ ## Structured Development Workflow (Hard Enforced)
332
+
333
+ ### Phase 1: Planning (Before Lock - Agent Creates Plan)
334
+ **Human Role:**
335
+ 1. Provide requirements: features, goals, constraints, acceptance criteria
336
+ 2. Review agent's proposed plan
337
+ 3. Request changes or approve plan
338
+ 4. Lock the plan when satisfied: `npm run plan:init`
339
+
340
+ **Agent Role:**
341
+ 1. Analyze human requirements
342
+ 2. Create PROJECT-PLAN.json in `.claude/plans/PLAN-ID/`
343
+ - Choose structure: Flat or Hierarchical (Project → Subproject → Milestone → Task)
344
+ - Break down work into tasks with IDs: TASK-001, TASK-002, etc.
345
+ - Assign phases: design, implementation, testing, deployment
346
+ - Estimate hours and define dependencies
347
+ 3. Present plan to human for review (summary + full breakdown)
348
+ 4. Revise plan based on human feedback (iterate until approved)
349
+ 5. DO NOT lock the plan - only human can lock
350
+
351
+ **Key Point:** Agent creates and refines the plan. Human reviews, requests changes, and approves/locks.
352
+
353
+ ### Phase 2: Lock the Plan (One-Time Action by Human)
354
+ 1. Human runs: `npm run plan:init`
355
+ 2. System generates:
356
+ - `.claude/plans/PLAN-ID/TASK-TRACKER.json` (tracks task states)
357
+ - `.claude/plans/PLAN-ID/tasks/TASK-XXX.json` (individual task files)
358
+ - `.claude/plans/PLAN-ID/.plan-locked` (immutability marker)
359
+ 3. Plan becomes IMMUTABLE (cannot be edited directly by anyone)
360
+ 4. Amendments require tool: `npm run plan:amend` (creates audit trail)
361
+
362
+ ### Phase 3: Execution (After Lock - Immutable Plan)
363
+ **Human Role:**
364
+ 1. Start a task: `npm run task:start TASK-001`
365
+ 2. Monitor progress: `npm run task:status`
366
+ 3. Complete task: `npm run task:done TASK-001`
367
+ 4. Request amendments if needed: `npm run plan:amend`
368
+
369
+ **Agent Role:**
370
+ 1. Work directly on main branch (no branching required)
371
+ 2. Write code in `Agent/` directory (blocked if no active task)
372
+ 3. Run tests and fix issues
373
+ 4. Commit changes frequently with task ID reference (REQUIRED)
374
+ 5. Push to remote regularly
375
+ 6. When task complete, ensure all changes committed
376
+ 7. Make amendments via tool when human requests
377
+
378
+ **Git Workflow (HARD ENFORCED):**
379
+ 1. **All work on main branch:** No branching required
380
+ 2. **During development:** Commit regularly with descriptive messages
381
+ 3. **Commit message format:** `[TASK-XXX] Description of changes`
382
+ 4. **When task done:** All changes must be committed before marking complete
383
+ 5. **Push regularly:** `git push origin main` to backup work
384
+ 6. **No merging needed:** Everything stays on main branch
385
+
386
+ **System Role:**
387
+ 1. Enforce active task requirement (hard block)
388
+ 2. Validate dependencies before task start
389
+ 3. Track time and progress automatically
390
+ 4. Log all amendments with timestamp and reason
391
+
392
+ ### Task Tracking Rules (Hard Enforced):
393
+ - ONE task active at a time (system enforced)
394
+ - Code changes in `Agent/` require active task (hook blocks Write/Edit)
395
+ - Commit messages should reference task ID (recommended)
396
+ - Tasks cannot be restarted once completed (system enforced)
397
+ - Dependencies must be completed first (HARD BLOCK - system checks on task:start)
398
+ - **Sequence validation:** Warns if skipping earlier tasks in same phase (5-second delay to cancel)
399
+ - **Phase order validation:** Warns if starting later phase with incomplete earlier phases (5-second delay to cancel)
400
+ - Progress tracked automatically in TASK-TRACKER.json
401
+ - Plan IMMUTABLE once locked - amendments only via tool with audit trail
402
+ - Active plan tracked in `.claude/ACTIVE-PLAN` file
403
+
404
+ ## Token Optimization
405
+ - Prompt caching enabled
406
+ - Output limited to 8192 tokens
407
+ - Non-essential model calls disabled
408
+ - Context loaded only when needed