@agentic15.com/agentic15-claude-zen 3.0.3 → 3.2.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  Copyright 2024-2025 agentic15.com
9
9
 
10
+ ## [3.1.0] - 2025-12-26
11
+
12
+ ### Summary
13
+ Minor release adding upgrade command for existing projects.
14
+
15
+ ### Added
16
+ - **`npx agentic15 upgrade`** - New command to upgrade framework files in existing projects
17
+ - Updates .claude/hooks/, settings.json, schemas, and templates
18
+ - Preserves user code (Agent/), plans (.claude/plans/), and local settings
19
+ - Creates automatic backup (.claude.backup/) before upgrading
20
+ - Shows version information and detailed upgrade report
21
+
22
+ ### Changed
23
+ - Updated command count in README from 5 to 6 commands
24
+
25
+ ## [3.0.4] - 2025-12-25
26
+
27
+ ### Summary
28
+ Package configuration cleanup - removed WORKFLOWS.md from files array as it's available on GitHub.
29
+
30
+ ### Changed
31
+ - Removed WORKFLOWS.md from package.json files array (documentation available at GitHub repo)
32
+ - No functional changes
33
+
10
34
  ## [3.0.3] - 2025-12-25
11
35
 
12
36
  ### Summary
package/README.md CHANGED
@@ -41,11 +41,12 @@ npx agentic15 commit # Test, commit, push, PR
41
41
 
42
42
  ## What It Does
43
43
 
44
- **5 Commands:**
44
+ **6 Commands:**
45
45
  - `npx agentic15 plan` - Generate and lock plans
46
46
  - `npx agentic15 task next` - Start next task
47
47
  - `npx agentic15 commit` - Test + commit + push + PR
48
48
  - `npx agentic15 status` - Check progress
49
+ - `npx agentic15 upgrade` - Upgrade framework files
49
50
  - `npm test` - Run tests
50
51
 
51
52
  **Automates:**
package/bin/agentic15.js CHANGED
@@ -6,6 +6,7 @@ import { TaskCommand } from '../src/cli/TaskCommand.js';
6
6
  import { CommitCommand } from '../src/cli/CommitCommand.js';
7
7
  import { StatusCommand } from '../src/cli/StatusCommand.js';
8
8
  import { PlanCommand } from '../src/cli/PlanCommand.js';
9
+ import { UpgradeCommand } from '../src/cli/UpgradeCommand.js';
9
10
 
10
11
  const program = new Command();
11
12
 
@@ -47,4 +48,10 @@ program
47
48
  .argument('[description]', 'Project description (required for first run)')
48
49
  .action((description) => PlanCommand.handle(description));
49
50
 
51
+ // Upgrade framework
52
+ program
53
+ .command('upgrade')
54
+ .description('Upgrade framework files to latest version')
55
+ .action(() => UpgradeCommand.execute());
56
+
50
57
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic15.com/agentic15-claude-zen",
3
- "version": "3.0.3",
3
+ "version": "3.2.0",
4
4
  "description": "Structured AI-assisted development framework for Claude Code with enforced quality standards",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -45,7 +45,6 @@
45
45
  "templates/",
46
46
  "templates/.gitignore",
47
47
  "README.md",
48
- "WORKFLOWS.md",
49
48
  "CHANGELOG.md",
50
49
  "LICENSE"
51
50
  ],
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Copyright 2024-2025 agentic15.com
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 { existsSync, mkdirSync, copyFileSync, readdirSync, statSync, readFileSync, writeFileSync, unlinkSync, rmdirSync } 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
+ * UpgradeCommand - Updates framework files in existing projects
26
+ *
27
+ * Upgrades .claude/ framework files while preserving:
28
+ * - User code (Agent/src, Agent/tests)
29
+ * - Active plans (.claude/plans, .claude/ACTIVE-PLAN)
30
+ * - Local settings (.claude/settings.local.json)
31
+ */
32
+ export class UpgradeCommand {
33
+ static execute() {
34
+ console.log('\n' + '═'.repeat(70));
35
+ console.log('🔄 Agentic15 Claude Zen - Framework Upgrade');
36
+ console.log('═'.repeat(70) + '\n');
37
+
38
+ // Verify we're in a project directory
39
+ if (!existsSync('.claude')) {
40
+ console.log('❌ Not in an Agentic15 project directory');
41
+ console.log(' Run this command from your project root (where .claude/ exists)\n');
42
+ process.exit(1);
43
+ }
44
+
45
+ // Get current and package versions
46
+ const currentVersion = this.getCurrentVersion();
47
+ const packageVersion = this.getPackageVersion();
48
+
49
+ console.log(`📦 Current framework version: ${currentVersion || 'unknown'}`);
50
+ console.log(`📦 Package version: ${packageVersion}\n`);
51
+
52
+ // Backup current .claude directory
53
+ console.log('📂 Creating backup...');
54
+ this.createBackup();
55
+
56
+ try {
57
+ // Update framework files
58
+ console.log('🔄 Updating framework files...\n');
59
+ this.updateFrameworkFiles();
60
+
61
+ // Update version file
62
+ this.updateVersionFile(packageVersion);
63
+
64
+ console.log('\n✅ Upgrade completed successfully!\n');
65
+ console.log('📋 What was updated:');
66
+ console.log(' - .claude/hooks/ (git hooks)');
67
+ console.log(' - .claude/settings.json (framework settings)');
68
+ console.log(' - .claude/PLAN-SCHEMA.json (plan structure)');
69
+ console.log(' - .claude/PROJECT-PLAN-TEMPLATE.json (plan template)');
70
+ console.log(' - .claude/POST-INSTALL.md (documentation)\n');
71
+ console.log('📋 What was preserved:');
72
+ console.log(' - .claude/plans/ (your project plans)');
73
+ console.log(' - .claude/ACTIVE-PLAN (current plan)');
74
+ console.log(' - .claude/settings.local.json (local settings)');
75
+ console.log(' - Agent/ (your source code)');
76
+ console.log(' - test-site/ (your test site)\n');
77
+ console.log('💾 Backup location: .claude.backup/\n');
78
+ console.log('═'.repeat(70) + '\n');
79
+ } catch (error) {
80
+ console.log('\n❌ Upgrade failed:', error.message);
81
+ console.log(' Your original files are backed up in .claude.backup/');
82
+ console.log(' To restore: rm -rf .claude && mv .claude.backup .claude\n');
83
+ process.exit(1);
84
+ }
85
+ }
86
+
87
+ static getCurrentVersion() {
88
+ const versionFile = join('.claude', '.framework-version');
89
+ if (existsSync(versionFile)) {
90
+ return readFileSync(versionFile, 'utf-8').trim();
91
+ }
92
+ return null;
93
+ }
94
+
95
+ static getPackageVersion() {
96
+ const packageJsonPath = join(__dirname, '..', '..', 'package.json');
97
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
98
+ return packageJson.version;
99
+ }
100
+
101
+ static createBackup() {
102
+ const backupDir = '.claude.backup';
103
+
104
+ // Remove old backup if exists
105
+ if (existsSync(backupDir)) {
106
+ this.removeDirectory(backupDir);
107
+ }
108
+
109
+ // Copy entire .claude directory
110
+ this.copyDirectory('.claude', backupDir);
111
+ console.log(' ✓ Backup created at .claude.backup/\n');
112
+ }
113
+
114
+ static updateFrameworkFiles() {
115
+ const templatesDir = join(__dirname, '..', '..', 'templates', '.claude');
116
+
117
+ // Files to update (framework files only)
118
+ const filesToUpdate = [
119
+ 'hooks/complete-task.js',
120
+ 'hooks/enforce-plan-template.js',
121
+ 'hooks/post-merge.js',
122
+ 'hooks/session-start-context.js',
123
+ 'hooks/start-task.js',
124
+ 'hooks/validate-git-workflow.js',
125
+ 'PLAN-SCHEMA.json',
126
+ 'PROJECT-PLAN-TEMPLATE.json',
127
+ 'POST-INSTALL.md',
128
+ 'settings.json'
129
+ ];
130
+
131
+ // Ensure hooks directory exists
132
+ const hooksDir = join('.claude', 'hooks');
133
+ if (!existsSync(hooksDir)) {
134
+ mkdirSync(hooksDir, { recursive: true });
135
+ }
136
+
137
+ // Copy framework files
138
+ filesToUpdate.forEach(file => {
139
+ const sourcePath = join(templatesDir, file);
140
+ const destPath = join('.claude', file);
141
+
142
+ if (existsSync(sourcePath)) {
143
+ copyFileSync(sourcePath, destPath);
144
+ console.log(` ✓ Updated ${file}`);
145
+ }
146
+ });
147
+ }
148
+
149
+ static updateVersionFile(version) {
150
+ const versionFile = join('.claude', '.framework-version');
151
+ writeFileSync(versionFile, version);
152
+ }
153
+
154
+ static copyDirectory(src, dest) {
155
+ if (!existsSync(dest)) {
156
+ mkdirSync(dest, { recursive: true });
157
+ }
158
+
159
+ const entries = readdirSync(src, { withFileTypes: true });
160
+
161
+ for (const entry of entries) {
162
+ const srcPath = join(src, entry.name);
163
+ const destPath = join(dest, entry.name);
164
+
165
+ if (entry.isDirectory()) {
166
+ this.copyDirectory(srcPath, destPath);
167
+ } else {
168
+ copyFileSync(srcPath, destPath);
169
+ }
170
+ }
171
+ }
172
+
173
+ static removeDirectory(dir) {
174
+ if (existsSync(dir)) {
175
+ const entries = readdirSync(dir, { withFileTypes: true });
176
+
177
+ for (const entry of entries) {
178
+ const fullPath = join(dir, entry.name);
179
+ if (entry.isDirectory()) {
180
+ this.removeDirectory(fullPath);
181
+ } else {
182
+ unlinkSync(fullPath);
183
+ }
184
+ }
185
+
186
+ rmdirSync(dir);
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Require Active Task Hook
5
+ *
6
+ * BLOCKS all Edit/Write operations when no active task exists
7
+ *
8
+ * This is the enforcement mechanism that prevents workflow violations
9
+ */
10
+
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ // Read tool use from stdin
15
+ let input = '';
16
+ process.stdin.on('data', chunk => {
17
+ input += chunk;
18
+ });
19
+
20
+ process.stdin.on('end', () => {
21
+ try {
22
+ const toolUse = JSON.parse(input);
23
+
24
+ // Only check Edit and Write operations
25
+ if (toolUse.name !== 'Edit' && toolUse.name !== 'Write') {
26
+ // Allow all other tools
27
+ process.exit(0);
28
+ return;
29
+ }
30
+
31
+ // Check if active task exists
32
+ const activePlanFile = '.claude/ACTIVE-PLAN';
33
+
34
+ if (!fs.existsSync(activePlanFile)) {
35
+ console.error('\n' + '═'.repeat(70));
36
+ console.error('❌ BLOCKED: No active plan exists');
37
+ console.error('═'.repeat(70));
38
+ console.error('\nYou MUST have an active plan before making code changes.');
39
+ console.error('\nTo create a plan:');
40
+ console.error(' npx agentic15 plan "Your project requirements"');
41
+ console.error('\n' + '═'.repeat(70) + '\n');
42
+ process.exit(1);
43
+ return;
44
+ }
45
+
46
+ const activePlan = fs.readFileSync(activePlanFile, 'utf8').trim();
47
+ const planDir = path.join('.claude/plans', activePlan);
48
+ const trackerPath = path.join(planDir, 'TASK-TRACKER.json');
49
+
50
+ if (!fs.existsSync(trackerPath)) {
51
+ console.error('\n' + '═'.repeat(70));
52
+ console.error('❌ BLOCKED: Task tracker not found');
53
+ console.error('═'.repeat(70));
54
+ console.error('\nPlan exists but task tracker is missing.');
55
+ console.error('This indicates a corrupted plan state.');
56
+ console.error('\n' + '═'.repeat(70) + '\n');
57
+ process.exit(1);
58
+ return;
59
+ }
60
+
61
+ const tracker = JSON.parse(fs.readFileSync(trackerPath, 'utf8'));
62
+
63
+ if (!tracker.activeTask) {
64
+ console.error('\n' + '═'.repeat(70));
65
+ console.error('❌ BLOCKED: No active task');
66
+ console.error('═'.repeat(70));
67
+ console.error('\nYou MUST have an active task before making code changes.');
68
+ console.error('\nTo start a task:');
69
+ console.error(' npx agentic15 task next');
70
+ console.error('\nThis will:');
71
+ console.error(' 1. Show you the next pending task');
72
+ console.error(' 2. Create a feature branch');
73
+ console.error(' 3. Create a GitHub issue');
74
+ console.error(' 4. Mark the task as active');
75
+ console.error('\nThen you can make your changes.');
76
+ console.error('\n' + '═'.repeat(70) + '\n');
77
+ process.exit(1);
78
+ return;
79
+ }
80
+
81
+ // Active task exists - allow the operation
82
+ process.exit(0);
83
+
84
+ } catch (error) {
85
+ // If we can't parse or check, fail safe and allow
86
+ // (don't want to block legitimate work due to hook errors)
87
+ process.exit(0);
88
+ }
89
+ });
@@ -9,10 +9,6 @@
9
9
  "Bash(git log*)",
10
10
  "Bash(git diff*)",
11
11
  "Bash(git branch*)",
12
- "Bash(git checkout main)",
13
- "Bash(git add *)",
14
- "Bash(git commit*)",
15
- "Bash(git push*)",
16
12
  "Edit(./Agent/**)",
17
13
  "Write(./Agent/**)",
18
14
  "Edit(./scripts/**)",
@@ -164,6 +160,15 @@
164
160
  }
165
161
  ],
166
162
  "PreToolUse": [
163
+ {
164
+ "matcher": "Edit|Write",
165
+ "hooks": [
166
+ {
167
+ "type": "command",
168
+ "command": "node .claude/hooks/require-active-task.js"
169
+ }
170
+ ]
171
+ },
167
172
  {
168
173
  "matcher": "*",
169
174
  "hooks": [
@@ -4,7 +4,7 @@
4
4
  "description": "Project with Claude Code structured development framework",
5
5
  "type": "commonjs",
6
6
  "scripts": {
7
- "test": "jest"
7
+ "test": "jest --passWithNoTests"
8
8
  },
9
9
  "keywords": [
10
10
  "claude-code",