gl-life-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 (40) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +69 -0
  3. package/README.md +237 -0
  4. package/bin/create-gl-life-claude.js +126 -0
  5. package/dist/hooks/auto-format.js +2 -0
  6. package/dist/hooks/complete-task.js +2 -0
  7. package/dist/hooks/enforce-migration-workflow.js +2 -0
  8. package/dist/hooks/enforce-structured-development.js +2 -0
  9. package/dist/hooks/enforce-test-pyramid.js +2 -0
  10. package/dist/hooks/init-task-tracker.js +2 -0
  11. package/dist/hooks/start-task.js +2 -0
  12. package/dist/hooks/task-status.js +2 -0
  13. package/dist/hooks/validate-database-changes.js +2 -0
  14. package/dist/hooks/validate-e2e-coverage.js +2 -0
  15. package/dist/hooks/validate-git-workflow.js +2 -0
  16. package/dist/hooks/validate-migration-impact.js +2 -0
  17. package/dist/hooks/validate-task-completion.js +2 -0
  18. package/dist/hooks/validate-test-quality.js +2 -0
  19. package/dist/hooks/validate-test-results.js +2 -0
  20. package/dist/hooks/validate-ui-integration.js +2 -0
  21. package/dist/scripts/help.js +3 -0
  22. package/dist/scripts/plan-amend.js +3 -0
  23. package/dist/scripts/plan-create.js +3 -0
  24. package/dist/scripts/plan-help.js +3 -0
  25. package/dist/scripts/plan-init.js +3 -0
  26. package/dist/scripts/plan-manager.js +3 -0
  27. package/dist/scripts/setup-git-hooks.js +3 -0
  28. package/dist/scripts/task-done.js +3 -0
  29. package/dist/scripts/task-merge.js +3 -0
  30. package/dist/scripts/task-next.js +3 -0
  31. package/dist/scripts/task-start.js +3 -0
  32. package/dist/scripts/task-status.js +3 -0
  33. package/lib/init.js +113 -0
  34. package/package.json +41 -0
  35. package/templates/.claude/CLAUDE.md +204 -0
  36. package/templates/.claude/PLAN-SCHEMA.json +240 -0
  37. package/templates/.claude/PROJECT-PLAN-TEMPLATE.json +223 -0
  38. package/templates/.claude/settings.json +157 -0
  39. package/templates/README.md +72 -0
  40. package/templates/package.json +27 -0
@@ -0,0 +1,240 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Project Plan Schema",
4
+ "description": "Hierarchical project plan with SDLC state machine",
5
+ "type": "object",
6
+ "required": ["version", "project"],
7
+ "properties": {
8
+ "version": {
9
+ "type": "string",
10
+ "const": "2.0",
11
+ "description": "Schema version"
12
+ },
13
+ "project": {
14
+ "type": "object",
15
+ "required": ["id", "name", "description", "status", "subprojects"],
16
+ "properties": {
17
+ "id": {
18
+ "type": "string",
19
+ "pattern": "^PROJ-[0-9]{3}$"
20
+ },
21
+ "name": {
22
+ "type": "string",
23
+ "minLength": 1
24
+ },
25
+ "description": {
26
+ "type": "string"
27
+ },
28
+ "status": {
29
+ "type": "string",
30
+ "enum": ["planning", "active", "on-hold", "completed", "cancelled"]
31
+ },
32
+ "createdAt": {
33
+ "type": "string",
34
+ "format": "date-time"
35
+ },
36
+ "createdBy": {
37
+ "type": "string"
38
+ },
39
+ "locked": {
40
+ "type": "boolean"
41
+ },
42
+ "lockedAt": {
43
+ "type": "string",
44
+ "format": "date-time"
45
+ },
46
+ "subprojects": {
47
+ "type": "array",
48
+ "items": {
49
+ "$ref": "#/definitions/subproject"
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "definitions": {
56
+ "subproject": {
57
+ "type": "object",
58
+ "required": ["id", "name", "description", "status", "milestones"],
59
+ "properties": {
60
+ "id": {
61
+ "type": "string",
62
+ "pattern": "^SUB-[0-9]{3}$"
63
+ },
64
+ "name": {
65
+ "type": "string"
66
+ },
67
+ "description": {
68
+ "type": "string"
69
+ },
70
+ "status": {
71
+ "type": "string",
72
+ "enum": ["pending", "active", "on-hold", "completed", "cancelled"]
73
+ },
74
+ "dependencies": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string",
78
+ "pattern": "^SUB-[0-9]{3}$"
79
+ }
80
+ },
81
+ "milestones": {
82
+ "type": "array",
83
+ "items": {
84
+ "$ref": "#/definitions/milestone"
85
+ }
86
+ }
87
+ }
88
+ },
89
+ "milestone": {
90
+ "type": "object",
91
+ "required": ["id", "name", "description", "status", "tasks"],
92
+ "properties": {
93
+ "id": {
94
+ "type": "string",
95
+ "pattern": "^MILE-[0-9]{3}$"
96
+ },
97
+ "name": {
98
+ "type": "string"
99
+ },
100
+ "description": {
101
+ "type": "string"
102
+ },
103
+ "status": {
104
+ "type": "string",
105
+ "enum": ["pending", "active", "completed"]
106
+ },
107
+ "dueDate": {
108
+ "type": "string",
109
+ "format": "date"
110
+ },
111
+ "dependencies": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string",
115
+ "pattern": "^MILE-[0-9]{3}$"
116
+ }
117
+ },
118
+ "tasks": {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/definitions/task"
122
+ }
123
+ }
124
+ }
125
+ },
126
+ "task": {
127
+ "type": "object",
128
+ "required": ["id", "title", "status", "phase"],
129
+ "properties": {
130
+ "id": {
131
+ "type": "string",
132
+ "pattern": "^TASK-[0-9]{3}$"
133
+ },
134
+ "title": {
135
+ "type": "string"
136
+ },
137
+ "description": {
138
+ "type": "string"
139
+ },
140
+ "status": {
141
+ "type": "string",
142
+ "enum": ["pending", "in_progress", "blocked", "review", "testing", "completed", "cancelled"]
143
+ },
144
+ "phase": {
145
+ "type": "string",
146
+ "enum": ["requirements", "design", "implementation", "testing", "deployment", "maintenance"],
147
+ "description": "SDLC phase"
148
+ },
149
+ "dependencies": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string",
153
+ "pattern": "^TASK-[0-9]{3}$"
154
+ }
155
+ },
156
+ "assignee": {
157
+ "type": "string"
158
+ },
159
+ "estimatedHours": {
160
+ "type": "number",
161
+ "minimum": 0
162
+ },
163
+ "actualHours": {
164
+ "type": "number",
165
+ "minimum": 0
166
+ },
167
+ "completionCriteria": {
168
+ "type": "array",
169
+ "items": {
170
+ "type": "string"
171
+ }
172
+ },
173
+ "testCases": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "string"
177
+ }
178
+ },
179
+ "artifacts": {
180
+ "type": "object",
181
+ "properties": {
182
+ "design": {
183
+ "type": "array",
184
+ "items": {
185
+ "type": "string"
186
+ }
187
+ },
188
+ "code": {
189
+ "type": "array",
190
+ "items": {
191
+ "type": "string"
192
+ }
193
+ },
194
+ "tests": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "documentation": {
201
+ "type": "array",
202
+ "items": {
203
+ "type": "string"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "startedAt": {
209
+ "type": "string",
210
+ "format": "date-time"
211
+ },
212
+ "completedAt": {
213
+ "type": "string",
214
+ "format": "date-time"
215
+ },
216
+ "blockedReason": {
217
+ "type": "string"
218
+ },
219
+ "notes": {
220
+ "type": "array",
221
+ "items": {
222
+ "type": "object",
223
+ "properties": {
224
+ "timestamp": {
225
+ "type": "string",
226
+ "format": "date-time"
227
+ },
228
+ "author": {
229
+ "type": "string"
230
+ },
231
+ "content": {
232
+ "type": "string"
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+ }
@@ -0,0 +1,223 @@
1
+ {
2
+ "version": "2.0",
3
+ "project": {
4
+ "id": "PROJ-001",
5
+ "name": "E-commerce Platform",
6
+ "description": "Full-featured online store with payment processing",
7
+ "status": "planning",
8
+ "createdAt": "2025-12-18T00:00:00.000Z",
9
+ "createdBy": "human",
10
+ "locked": false,
11
+ "subprojects": [
12
+ {
13
+ "id": "SUB-001",
14
+ "name": "User Management System",
15
+ "description": "Authentication, authorization, and user profiles",
16
+ "status": "pending",
17
+ "dependencies": [],
18
+ "milestones": [
19
+ {
20
+ "id": "MILE-001",
21
+ "name": "Core Authentication",
22
+ "description": "Basic login/logout functionality",
23
+ "status": "pending",
24
+ "dependencies": [],
25
+ "tasks": [
26
+ {
27
+ "id": "TASK-001",
28
+ "title": "Design user database schema",
29
+ "description": "Create ERD for users, roles, sessions",
30
+ "status": "pending",
31
+ "phase": "design",
32
+ "dependencies": [],
33
+ "estimatedHours": 4,
34
+ "completionCriteria": [
35
+ "ERD diagram completed",
36
+ "Schema reviewed by team",
37
+ "Migration scripts ready"
38
+ ],
39
+ "artifacts": {
40
+ "design": ["./Agent/db/schema/users.sql"],
41
+ "code": [],
42
+ "tests": [],
43
+ "documentation": ["./docs/database-design.md"]
44
+ }
45
+ },
46
+ {
47
+ "id": "TASK-002",
48
+ "title": "Implement user registration API",
49
+ "description": "POST /api/auth/register endpoint",
50
+ "status": "pending",
51
+ "phase": "implementation",
52
+ "dependencies": ["TASK-001"],
53
+ "estimatedHours": 6,
54
+ "completionCriteria": [
55
+ "Email validation implemented",
56
+ "Password hashing with bcrypt",
57
+ "Duplicate email check",
58
+ "Returns JWT token"
59
+ ],
60
+ "testCases": [
61
+ "Valid registration succeeds",
62
+ "Invalid email rejected",
63
+ "Weak password rejected",
64
+ "Duplicate email rejected"
65
+ ],
66
+ "artifacts": {
67
+ "design": [],
68
+ "code": [
69
+ "./Agent/src/controllers/authController.js",
70
+ "./Agent/src/services/userService.js"
71
+ ],
72
+ "tests": ["./Agent/tests/auth.test.js"],
73
+ "documentation": []
74
+ }
75
+ },
76
+ {
77
+ "id": "TASK-003",
78
+ "title": "Write unit tests for registration",
79
+ "description": "Test all registration edge cases",
80
+ "status": "pending",
81
+ "phase": "testing",
82
+ "dependencies": ["TASK-002"],
83
+ "estimatedHours": 3,
84
+ "completionCriteria": [
85
+ "100% code coverage for registration",
86
+ "All edge cases tested",
87
+ "Integration tests pass"
88
+ ],
89
+ "artifacts": {
90
+ "code": [],
91
+ "tests": [
92
+ "./Agent/tests/auth.test.js",
93
+ "./Agent/tests/integration/register.test.js"
94
+ ]
95
+ }
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "id": "MILE-002",
101
+ "name": "User Profile Management",
102
+ "description": "Profile viewing and editing",
103
+ "status": "pending",
104
+ "dependencies": ["MILE-001"],
105
+ "tasks": [
106
+ {
107
+ "id": "TASK-004",
108
+ "title": "Create profile update API",
109
+ "description": "PATCH /api/users/:id endpoint",
110
+ "status": "pending",
111
+ "phase": "implementation",
112
+ "dependencies": ["TASK-003"],
113
+ "estimatedHours": 5,
114
+ "completionCriteria": [
115
+ "Can update name, email, avatar",
116
+ "Email uniqueness validated",
117
+ "Authorization checked"
118
+ ],
119
+ "artifacts": {
120
+ "code": ["./Agent/src/controllers/userController.js"],
121
+ "tests": ["./Agent/tests/userProfile.test.js"]
122
+ }
123
+ }
124
+ ]
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "id": "SUB-002",
130
+ "name": "Product Catalog System",
131
+ "description": "Product listings, search, and categories",
132
+ "status": "pending",
133
+ "dependencies": [],
134
+ "milestones": [
135
+ {
136
+ "id": "MILE-003",
137
+ "name": "Basic Product CRUD",
138
+ "description": "Create, read, update, delete products",
139
+ "status": "pending",
140
+ "dependencies": [],
141
+ "tasks": [
142
+ {
143
+ "id": "TASK-005",
144
+ "title": "Design product database schema",
145
+ "description": "Tables for products, categories, images",
146
+ "status": "pending",
147
+ "phase": "design",
148
+ "dependencies": [],
149
+ "estimatedHours": 3,
150
+ "completionCriteria": [
151
+ "Schema supports multiple categories",
152
+ "Image URLs stored properly",
153
+ "Price and inventory tracked"
154
+ ],
155
+ "artifacts": {
156
+ "design": ["./Agent/db/schema/products.sql"]
157
+ }
158
+ },
159
+ {
160
+ "id": "TASK-006",
161
+ "title": "Implement product listing API",
162
+ "description": "GET /api/products with pagination",
163
+ "status": "pending",
164
+ "phase": "implementation",
165
+ "dependencies": ["TASK-005"],
166
+ "estimatedHours": 4,
167
+ "completionCriteria": [
168
+ "Pagination works (limit/offset)",
169
+ "Filtering by category",
170
+ "Sorting by price, name, date"
171
+ ],
172
+ "artifacts": {
173
+ "code": ["./Agent/src/controllers/productController.js"],
174
+ "tests": ["./Agent/tests/products.test.js"]
175
+ }
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ "id": "SUB-003",
183
+ "name": "Shopping Cart & Checkout",
184
+ "description": "Cart management and order processing",
185
+ "status": "pending",
186
+ "dependencies": ["SUB-001", "SUB-002"],
187
+ "milestones": [
188
+ {
189
+ "id": "MILE-004",
190
+ "name": "Shopping Cart",
191
+ "description": "Add/remove/update cart items",
192
+ "status": "pending",
193
+ "dependencies": ["MILE-001", "MILE-003"],
194
+ "tasks": [
195
+ {
196
+ "id": "TASK-007",
197
+ "title": "Implement cart management",
198
+ "description": "Session-based cart for guests, DB for users",
199
+ "status": "pending",
200
+ "phase": "implementation",
201
+ "dependencies": ["TASK-002", "TASK-006"],
202
+ "estimatedHours": 8,
203
+ "completionCriteria": [
204
+ "Add items to cart",
205
+ "Update quantities",
206
+ "Calculate totals",
207
+ "Persist cart for logged-in users"
208
+ ],
209
+ "artifacts": {
210
+ "code": [
211
+ "./Agent/src/services/cartService.js",
212
+ "./Agent/src/controllers/cartController.js"
213
+ ],
214
+ "tests": ["./Agent/tests/cart.test.js"]
215
+ }
216
+ }
217
+ ]
218
+ }
219
+ ]
220
+ }
221
+ ]
222
+ }
223
+ }
@@ -0,0 +1,157 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Read(**)",
5
+ "Glob",
6
+ "Grep",
7
+ "Bash(npm run *)",
8
+ "Bash(git status*)",
9
+ "Bash(git log*)",
10
+ "Bash(git diff*)",
11
+ "Bash(git branch*)",
12
+ "Bash(git checkout -b feature/*)",
13
+ "Bash(git checkout -b bugfix/*)",
14
+ "Bash(git checkout -b hotfix/*)",
15
+ "Bash(git add *)",
16
+ "Bash(git commit*)",
17
+ "Bash(git push*)",
18
+ "Edit(./Agent/**)",
19
+ "Write(./Agent/**)",
20
+ "Edit(./scripts/**)",
21
+ "Write(./scripts/**)",
22
+ "Write(./.claude/PROJECT-PLAN.json)"
23
+ ],
24
+ "ask": [
25
+ "Edit(./package.json)",
26
+ "Edit(./tsconfig.json)",
27
+ "Edit(./jest.config.*)",
28
+ "Write(./config/**)"
29
+ ],
30
+ "deny": [
31
+ "Edit(**/*.md)",
32
+ "Write(**/*.md)",
33
+ "Edit(./docs/**)",
34
+ "Write(./docs/**)",
35
+ "Edit(./README.md)",
36
+ "Edit(./CHANGELOG.md)",
37
+ "Edit(./.env*)",
38
+ "Write(./.env*)",
39
+ "Edit(./.claude/PROJECT-PLAN.json)",
40
+ "Edit(./.claude/settings.json)",
41
+ "Edit(./.claude/hooks/**)",
42
+ "Write(./.claude/hooks/**)",
43
+ "Edit(./.claude/CLAUDE.md)",
44
+ "Edit(./.claude/TASK-TRACKER.json)",
45
+ "Bash(curl*)",
46
+ "Bash(wget*)",
47
+ "Bash(rm -rf*)",
48
+ "Bash(sudo*)",
49
+ "Bash(npm install*)",
50
+ "Bash(npm publish*)",
51
+ "Bash(git push --force*)",
52
+ "Bash(git checkout main*)",
53
+ "Bash(git merge*)",
54
+ "Bash(psql*)",
55
+ "Bash(mysql*)",
56
+ "Bash(sqlite3*)",
57
+ "Bash(mongosh*)",
58
+ "Bash(redis-cli*)",
59
+ "Bash(node ./scripts/**)",
60
+ "Bash(node ./Agent/db/**)",
61
+ "Bash(bash ./scripts/**)",
62
+ "Bash(sh ./scripts/**)",
63
+ "WebFetch",
64
+ "WebSearch"
65
+ ]
66
+ },
67
+ "sandbox": {
68
+ "enabled": true,
69
+ "autoAllowBashIfSandboxed": true,
70
+ "allowUnsandboxedCommands": false
71
+ },
72
+ "env": {
73
+ "DISABLE_PROMPT_CACHING": "0",
74
+ "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192",
75
+ "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1"
76
+ },
77
+ "hooks": {
78
+ "SessionStart": [
79
+ {
80
+ "matcher": "startup",
81
+ "hooks": [
82
+ {
83
+ "type": "command",
84
+ "command": "echo '=== Context Loaded ===' && git rev-parse --abbrev-ref HEAD 2>/dev/null && echo 'Current branch' || echo 'Not in git repo'"
85
+ }
86
+ ]
87
+ }
88
+ ],
89
+ "PreToolUse": [
90
+ {
91
+ "matcher": "Bash",
92
+ "hooks": [
93
+ {
94
+ "type": "command",
95
+ "command": "node node_modules/.gl-life-claude/hooks/validate-git-workflow.js"
96
+ },
97
+ {
98
+ "type": "command",
99
+ "command": "node node_modules/.gl-life-claude/hooks/validate-task-completion.js"
100
+ }
101
+ ]
102
+ }
103
+ ],
104
+ "PostToolUse": [
105
+ {
106
+ "matcher": "Edit|Write",
107
+ "hooks": [
108
+ {
109
+ "type": "command",
110
+ "command": "node node_modules/.gl-life-claude/hooks/enforce-structured-development.js"
111
+ },
112
+ {
113
+ "type": "command",
114
+ "command": "node node_modules/.gl-life-claude/hooks/auto-format.js"
115
+ },
116
+ {
117
+ "type": "command",
118
+ "command": "node node_modules/.gl-life-claude/hooks/validate-test-quality.js"
119
+ },
120
+ {
121
+ "type": "command",
122
+ "command": "node node_modules/.gl-life-claude/hooks/validate-ui-integration.js"
123
+ },
124
+ {
125
+ "type": "command",
126
+ "command": "node node_modules/.gl-life-claude/hooks/validate-database-changes.js"
127
+ },
128
+ {
129
+ "type": "command",
130
+ "command": "node node_modules/.gl-life-claude/hooks/validate-migration-impact.js"
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "matcher": "Bash",
136
+ "hooks": [
137
+ {
138
+ "type": "command",
139
+ "command": "node node_modules/.gl-life-claude/hooks/validate-test-results.js"
140
+ },
141
+ {
142
+ "type": "command",
143
+ "command": "node node_modules/.gl-life-claude/hooks/validate-e2e-coverage.js"
144
+ },
145
+ {
146
+ "type": "command",
147
+ "command": "node node_modules/.gl-life-claude/hooks/enforce-test-pyramid.js"
148
+ },
149
+ {
150
+ "type": "command",
151
+ "command": "node node_modules/.gl-life-claude/hooks/enforce-migration-workflow.js"
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ }
157
+ }
@@ -0,0 +1,72 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ Project initialized with [GL.Life Claude Code Framework](https://github.com/ajayhanda/gl-life-claude)
4
+
5
+ ## Structured Development Workflow
6
+
7
+ This project uses the Claude Code enforcement framework for task-based development with built-in guardrails.
8
+
9
+ ### Quick Start
10
+
11
+ 1. **Create a project plan:**
12
+ ```bash
13
+ npm run plan:create
14
+ ```
15
+
16
+ 2. **Initialize the plan:**
17
+ ```bash
18
+ npm run plan:init
19
+ ```
20
+
21
+ 3. **Start the next available task (recommended):**
22
+ ```bash
23
+ npm run task:next
24
+ ```
25
+
26
+ Or manually start a specific task:
27
+ ```bash
28
+ npm run task:start TASK-001
29
+ ```
30
+
31
+ 4. **Check task status:**
32
+ ```bash
33
+ npm run task:status
34
+ ```
35
+
36
+ 5. **Complete a task:**
37
+ ```bash
38
+ npm run task:done TASK-001
39
+ ```
40
+
41
+ ### Available Commands
42
+
43
+ - `npm run help` - Show all available commands
44
+ - `npm run plan:create` - Create a new project plan
45
+ - `npm run plan:init` - Initialize and lock the plan
46
+ - `npm run plan:manager` - Manage plans (switch, archive, delete)
47
+ - `npm run plan:amend` - Amend locked plan with audit trail
48
+ - `npm run task:next` - Start next available task (auto-picks based on dependencies)
49
+ - `npm run task:start TASK-XXX` - Start a specific task
50
+ - `npm run task:done TASK-XXX` - Complete a task
51
+ - `npm run task:status` - View task status
52
+ - `npm run task:merge TASK-XXX` - Merge completed task to main
53
+
54
+ ### Framework Features
55
+
56
+ - **Task-Based Development** - Structured workflow with dependencies
57
+ - **Git Workflow Enforcement** - Automatic branch management
58
+ - **Pre-commit Hooks** - Code quality and test validation
59
+ - **Project Plan Management** - Hierarchical plans with milestones
60
+ - **Task Tracking** - Automatic progress tracking and time estimates
61
+
62
+ ### Documentation
63
+
64
+ Configuration files are in [.claude/](.claude/):
65
+ - `CLAUDE.md` - Complete framework documentation
66
+ - `settings.json` - Permissions and hook configuration
67
+ - `PLAN-SCHEMA.json` - Project plan schema
68
+ - `PROJECT-PLAN-TEMPLATE.json` - Plan template
69
+
70
+ ## Development
71
+
72
+ Your code goes here!