@gannonh/kata 0.1.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 (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +439 -0
  3. package/agents/kata-codebase-mapper.md +738 -0
  4. package/agents/kata-debugger.md +1184 -0
  5. package/agents/kata-executor.md +753 -0
  6. package/agents/kata-integration-checker.md +423 -0
  7. package/agents/kata-phase-researcher.md +632 -0
  8. package/agents/kata-plan-checker.md +745 -0
  9. package/agents/kata-planner.md +1367 -0
  10. package/agents/kata-project-researcher.md +865 -0
  11. package/agents/kata-research-synthesizer.md +247 -0
  12. package/agents/kata-roadmapper.md +605 -0
  13. package/agents/kata-verifier.md +778 -0
  14. package/bin/install.js +569 -0
  15. package/commands/kata/add-phase.md +207 -0
  16. package/commands/kata/add-todo.md +182 -0
  17. package/commands/kata/audit-milestone.md +258 -0
  18. package/commands/kata/check-todos.md +217 -0
  19. package/commands/kata/complete-milestone.md +136 -0
  20. package/commands/kata/debug.md +149 -0
  21. package/commands/kata/discuss-phase.md +80 -0
  22. package/commands/kata/execute-phase.md +304 -0
  23. package/commands/kata/help.md +383 -0
  24. package/commands/kata/insert-phase.md +227 -0
  25. package/commands/kata/list-phase-assumptions.md +50 -0
  26. package/commands/kata/map-codebase.md +71 -0
  27. package/commands/kata/new-milestone.md +717 -0
  28. package/commands/kata/new-project.md +896 -0
  29. package/commands/kata/pause-work.md +123 -0
  30. package/commands/kata/plan-milestone-gaps.md +284 -0
  31. package/commands/kata/plan-phase.md +475 -0
  32. package/commands/kata/progress.md +356 -0
  33. package/commands/kata/remove-phase.md +338 -0
  34. package/commands/kata/research-phase.md +180 -0
  35. package/commands/kata/resume-work.md +40 -0
  36. package/commands/kata/update.md +172 -0
  37. package/commands/kata/verify-work.md +219 -0
  38. package/commands/kata/whats-new.md +124 -0
  39. package/hooks/kata-check-update.js +51 -0
  40. package/hooks/statusline.js +84 -0
  41. package/kata/references/checkpoints.md +788 -0
  42. package/kata/references/continuation-format.md +249 -0
  43. package/kata/references/git-integration.md +254 -0
  44. package/kata/references/questioning.md +141 -0
  45. package/kata/references/tdd.md +263 -0
  46. package/kata/references/ui-brand.md +160 -0
  47. package/kata/references/verification-patterns.md +595 -0
  48. package/kata/templates/DEBUG.md +159 -0
  49. package/kata/templates/UAT.md +247 -0
  50. package/kata/templates/codebase/architecture.md +255 -0
  51. package/kata/templates/codebase/concerns.md +310 -0
  52. package/kata/templates/codebase/conventions.md +307 -0
  53. package/kata/templates/codebase/integrations.md +280 -0
  54. package/kata/templates/codebase/stack.md +186 -0
  55. package/kata/templates/codebase/structure.md +285 -0
  56. package/kata/templates/codebase/testing.md +480 -0
  57. package/kata/templates/config.json +26 -0
  58. package/kata/templates/context.md +291 -0
  59. package/kata/templates/continue-here.md +78 -0
  60. package/kata/templates/debug-subagent-prompt.md +91 -0
  61. package/kata/templates/discovery.md +146 -0
  62. package/kata/templates/milestone-archive.md +123 -0
  63. package/kata/templates/milestone.md +115 -0
  64. package/kata/templates/phase-prompt.md +576 -0
  65. package/kata/templates/planner-subagent-prompt.md +117 -0
  66. package/kata/templates/project.md +184 -0
  67. package/kata/templates/requirements.md +231 -0
  68. package/kata/templates/research-project/ARCHITECTURE.md +204 -0
  69. package/kata/templates/research-project/FEATURES.md +147 -0
  70. package/kata/templates/research-project/PITFALLS.md +200 -0
  71. package/kata/templates/research-project/STACK.md +120 -0
  72. package/kata/templates/research-project/SUMMARY.md +170 -0
  73. package/kata/templates/research.md +529 -0
  74. package/kata/templates/roadmap.md +202 -0
  75. package/kata/templates/state.md +206 -0
  76. package/kata/templates/summary.md +269 -0
  77. package/kata/templates/user-setup.md +323 -0
  78. package/kata/templates/verification-report.md +322 -0
  79. package/kata/workflows/complete-milestone.md +750 -0
  80. package/kata/workflows/diagnose-issues.md +233 -0
  81. package/kata/workflows/discovery-phase.md +293 -0
  82. package/kata/workflows/discuss-phase.md +422 -0
  83. package/kata/workflows/execute-phase.md +552 -0
  84. package/kata/workflows/execute-plan.md +1831 -0
  85. package/kata/workflows/list-phase-assumptions.md +178 -0
  86. package/kata/workflows/map-codebase.md +289 -0
  87. package/kata/workflows/resume-project.md +311 -0
  88. package/kata/workflows/transition.md +564 -0
  89. package/kata/workflows/verify-phase.md +629 -0
  90. package/kata/workflows/verify-work.md +563 -0
  91. package/package.json +32 -0
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: kata:whats-new
3
+ description: See what's new in Kata since your installed version
4
+ ---
5
+
6
+ <objective>
7
+ Display changes between installed version and latest available version.
8
+
9
+ Shows version comparison, changelog entries for missed versions, and update instructions.
10
+ </objective>
11
+
12
+ <process>
13
+
14
+ <step name="get_installed_version">
15
+ Read installed version from VERSION file:
16
+
17
+ ```bash
18
+ cat ~/.claude/kata/VERSION 2>/dev/null
19
+ ```
20
+
21
+ **If VERSION file missing:**
22
+ ```
23
+ ## Kata What's New
24
+
25
+ **Installed version:** Unknown
26
+
27
+ Your installation doesn't include version tracking.
28
+
29
+ **To fix:** `npx @gannonh/kata --global`
30
+
31
+ This will reinstall with version tracking enabled.
32
+ ```
33
+
34
+ STOP here if no VERSION file.
35
+ </step>
36
+
37
+ <step name="fetch_remote_changelog">
38
+ Fetch latest CHANGELOG.md from GitHub:
39
+
40
+ Use WebFetch tool with:
41
+ - URL: `https://raw.githubusercontent.com/gannonh/kata/main/CHANGELOG.md`
42
+ - Prompt: "Extract all version entries with their dates and changes. Return in Keep-a-Changelog format."
43
+
44
+ **If fetch fails:**
45
+ Fall back to local changelog:
46
+ ```bash
47
+ cat ~/.claude/kata/CHANGELOG.md 2>/dev/null
48
+ ```
49
+
50
+ Note to user: "Couldn't check for updates (offline or GitHub unavailable). Showing local changelog."
51
+ </step>
52
+
53
+ <step name="parse_versions">
54
+ From the remote (or local) changelog:
55
+
56
+ 1. **Extract latest version** - First `## [X.Y.Z]` line after `## [Unreleased]`
57
+ 2. **Compare with installed** - From VERSION file
58
+ 3. **Extract entries between** - All version sections from latest down to (but not including) installed
59
+
60
+ **Version comparison:**
61
+ - If installed == latest: "You're on the latest version"
62
+ - If installed < latest: Show changes since installed version
63
+ - If installed > latest: "You're ahead of latest release (development version?)"
64
+ </step>
65
+
66
+ <step name="display_output">
67
+ Format output clearly:
68
+
69
+ **If up to date:**
70
+ ```
71
+ ## Kata What's New
72
+
73
+ **Installed:** 1.4.26
74
+ **Latest:** 1.4.26
75
+
76
+ You're on the latest version.
77
+
78
+ [View full changelog](https://github.com/gannonh/kata/blob/main/CHANGELOG.md)
79
+ ```
80
+
81
+ **If updates available:**
82
+ ```
83
+ ## Kata What's New
84
+
85
+ **Installed:** 1.4.23
86
+ **Latest:** 1.4.26
87
+
88
+ ---
89
+
90
+ ### Changes since your version:
91
+
92
+ ## [1.4.26] - 2026-01-20
93
+
94
+ ### Added
95
+ - Feature X
96
+ - Feature Y
97
+
98
+ ### Changed
99
+ - **BREAKING:** Changed Z behavior
100
+
101
+ ## [1.4.25] - 2026-01-18
102
+
103
+ ### Fixed
104
+ - Bug in feature A
105
+
106
+ ---
107
+
108
+ [View full changelog](https://github.com/gannonh/kata/blob/main/CHANGELOG.md)
109
+
110
+ **To update:** `npx @gannonh/kata --global`
111
+ ```
112
+
113
+ **Breaking changes:** Surface prominently with **BREAKING:** prefix in the output.
114
+ </step>
115
+
116
+ </process>
117
+
118
+ <success_criteria>
119
+ - [ ] Installed version read from VERSION file
120
+ - [ ] Remote changelog fetched (or graceful fallback to local)
121
+ - [ ] Version comparison displayed clearly
122
+ - [ ] Changes since installed version shown (if any)
123
+ - [ ] Update instructions provided when behind
124
+ </success_criteria>
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ // Check for Kata updates in background, write result to cache
3
+ // Called by SessionStart hook - runs once per session
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+ const { execSync, spawn } = require('child_process');
9
+
10
+ const homeDir = os.homedir();
11
+ const cacheDir = path.join(homeDir, '.claude', 'cache');
12
+ const cacheFile = path.join(cacheDir, 'kata-update-check.json');
13
+ const versionFile = path.join(homeDir, '.claude', 'kata', 'VERSION');
14
+
15
+ // Ensure cache directory exists
16
+ if (!fs.existsSync(cacheDir)) {
17
+ fs.mkdirSync(cacheDir, { recursive: true });
18
+ }
19
+
20
+ // Run check in background (spawn detached process)
21
+ const child = spawn(process.execPath, ['-e', `
22
+ const fs = require('fs');
23
+ const { execSync } = require('child_process');
24
+
25
+ const cacheFile = ${JSON.stringify(cacheFile)};
26
+ const versionFile = ${JSON.stringify(versionFile)};
27
+
28
+ let installed = '0.0.0';
29
+ try {
30
+ installed = fs.readFileSync(versionFile, 'utf8').trim();
31
+ } catch (e) {}
32
+
33
+ let latest = null;
34
+ try {
35
+ latest = execSync('npm view @gannonh/kata version', { encoding: 'utf8', timeout: 10000 }).trim();
36
+ } catch (e) {}
37
+
38
+ const result = {
39
+ update_available: latest && installed !== latest,
40
+ installed,
41
+ latest: latest || 'unknown',
42
+ checked: Math.floor(Date.now() / 1000)
43
+ };
44
+
45
+ fs.writeFileSync(cacheFile, JSON.stringify(result));
46
+ `], {
47
+ detached: true,
48
+ stdio: 'ignore'
49
+ });
50
+
51
+ child.unref();
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env node
2
+ // Claude Code Statusline - Kata Edition
3
+ // Shows: model | current task | directory | context usage
4
+
5
+ const fs = require('fs');
6
+ const path = require('path');
7
+ const os = require('os');
8
+
9
+ // Read JSON from stdin
10
+ let input = '';
11
+ process.stdin.setEncoding('utf8');
12
+ process.stdin.on('data', chunk => input += chunk);
13
+ process.stdin.on('end', () => {
14
+ try {
15
+ const data = JSON.parse(input);
16
+ const model = data.model?.display_name || 'Claude';
17
+ const dir = data.workspace?.current_dir || process.cwd();
18
+ const session = data.session_id || '';
19
+ const remaining = data.context_window?.remaining_percentage;
20
+
21
+ // Context window display (shows USED percentage)
22
+ let ctx = '';
23
+ if (remaining != null) {
24
+ const rem = Math.round(remaining);
25
+ const used = 100 - rem;
26
+
27
+ // Build progress bar (10 segments)
28
+ const filled = Math.floor(used / 10);
29
+ const bar = 'â–ˆ'.repeat(filled) + 'â–‘'.repeat(10 - filled);
30
+
31
+ // Color based on usage
32
+ if (used < 50) {
33
+ ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
34
+ } else if (used < 65) {
35
+ ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
36
+ } else if (used < 80) {
37
+ ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
38
+ } else {
39
+ ctx = ` \x1b[5;31m💀 ${bar} ${used}%\x1b[0m`;
40
+ }
41
+ }
42
+
43
+ // Current task from todos
44
+ let task = '';
45
+ const homeDir = os.homedir();
46
+ const todosDir = path.join(homeDir, '.claude', 'todos');
47
+ if (session && fs.existsSync(todosDir)) {
48
+ const files = fs.readdirSync(todosDir)
49
+ .filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
50
+ .map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime }))
51
+ .sort((a, b) => b.mtime - a.mtime);
52
+
53
+ if (files.length > 0) {
54
+ try {
55
+ const todos = JSON.parse(fs.readFileSync(path.join(todosDir, files[0].name), 'utf8'));
56
+ const inProgress = todos.find(t => t.status === 'in_progress');
57
+ if (inProgress) task = inProgress.activeForm || '';
58
+ } catch (e) {}
59
+ }
60
+ }
61
+
62
+ // Kata update available?
63
+ let kataUpdate = '';
64
+ const cacheFile = path.join(homeDir, '.claude', 'cache', 'kata-update-check.json');
65
+ if (fs.existsSync(cacheFile)) {
66
+ try {
67
+ const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
68
+ if (cache.update_available) {
69
+ kataUpdate = '\x1b[33m⬆ /kata:update\x1b[0m │ ';
70
+ }
71
+ } catch (e) {}
72
+ }
73
+
74
+ // Output
75
+ const dirname = path.basename(dir);
76
+ if (task) {
77
+ process.stdout.write(`${kataUpdate}\x1b[2m${model}\x1b[0m │ \x1b[1m${task}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
78
+ } else {
79
+ process.stdout.write(`${kataUpdate}\x1b[2m${model}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`);
80
+ }
81
+ } catch (e) {
82
+ // Silent fail - don't break statusline on parse errors
83
+ }
84
+ });