agileflow 2.90.7 → 2.92.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 (144) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +6 -6
  3. package/lib/README.md +178 -0
  4. package/lib/codebase-indexer.js +818 -0
  5. package/lib/colors.js +190 -12
  6. package/lib/consent.js +232 -0
  7. package/lib/correlation.js +277 -0
  8. package/lib/error-codes.js +46 -0
  9. package/lib/errors.js +48 -6
  10. package/lib/file-cache.js +182 -0
  11. package/lib/format-error.js +156 -0
  12. package/lib/path-resolver.js +155 -7
  13. package/lib/paths.js +212 -20
  14. package/lib/placeholder-registry.js +205 -0
  15. package/lib/registry-di.js +358 -0
  16. package/lib/result-schema.js +363 -0
  17. package/lib/result.js +210 -0
  18. package/lib/session-registry.js +13 -0
  19. package/lib/session-state-machine.js +465 -0
  20. package/lib/validate-commands.js +308 -0
  21. package/lib/validate-names.js +3 -3
  22. package/lib/validate.js +116 -52
  23. package/package.json +4 -1
  24. package/scripts/af +34 -0
  25. package/scripts/agent-loop.js +63 -9
  26. package/scripts/agileflow-configure.js +2 -2
  27. package/scripts/agileflow-welcome.js +435 -23
  28. package/scripts/archive-completed-stories.sh +57 -11
  29. package/scripts/claude-tmux.sh +102 -0
  30. package/scripts/damage-control-bash.js +3 -70
  31. package/scripts/damage-control-edit.js +3 -20
  32. package/scripts/damage-control-write.js +3 -20
  33. package/scripts/dependency-check.js +310 -0
  34. package/scripts/get-env.js +11 -4
  35. package/scripts/lib/configure-detect.js +23 -1
  36. package/scripts/lib/configure-features.js +43 -2
  37. package/scripts/lib/context-formatter.js +771 -0
  38. package/scripts/lib/context-loader.js +699 -0
  39. package/scripts/lib/damage-control-utils.js +107 -0
  40. package/scripts/lib/json-utils.sh +162 -0
  41. package/scripts/lib/state-migrator.js +353 -0
  42. package/scripts/lib/story-state-machine.js +437 -0
  43. package/scripts/obtain-context.js +118 -1048
  44. package/scripts/pre-push-check.sh +46 -0
  45. package/scripts/precompact-context.sh +36 -11
  46. package/scripts/query-codebase.js +538 -0
  47. package/scripts/ralph-loop.js +5 -5
  48. package/scripts/session-manager.js +220 -42
  49. package/scripts/spawn-parallel.js +651 -0
  50. package/scripts/tui/blessed/data/watcher.js +180 -0
  51. package/scripts/tui/blessed/index.js +244 -0
  52. package/scripts/tui/blessed/panels/output.js +101 -0
  53. package/scripts/tui/blessed/panels/sessions.js +150 -0
  54. package/scripts/tui/blessed/panels/trace.js +97 -0
  55. package/scripts/tui/blessed/ui/help.js +77 -0
  56. package/scripts/tui/blessed/ui/screen.js +52 -0
  57. package/scripts/tui/blessed/ui/statusbar.js +47 -0
  58. package/scripts/tui/blessed/ui/tabbar.js +99 -0
  59. package/scripts/tui/index.js +38 -30
  60. package/scripts/validators/README.md +143 -0
  61. package/scripts/validators/component-validator.js +239 -0
  62. package/scripts/validators/json-schema-validator.js +186 -0
  63. package/scripts/validators/markdown-validator.js +152 -0
  64. package/scripts/validators/migration-validator.js +129 -0
  65. package/scripts/validators/security-validator.js +380 -0
  66. package/scripts/validators/story-format-validator.js +197 -0
  67. package/scripts/validators/test-result-validator.js +114 -0
  68. package/scripts/validators/workflow-validator.js +247 -0
  69. package/src/core/agents/accessibility.md +6 -0
  70. package/src/core/agents/adr-writer.md +6 -0
  71. package/src/core/agents/analytics.md +6 -0
  72. package/src/core/agents/api.md +6 -0
  73. package/src/core/agents/ci.md +6 -0
  74. package/src/core/agents/codebase-query.md +261 -0
  75. package/src/core/agents/compliance.md +6 -0
  76. package/src/core/agents/configuration-damage-control.md +6 -0
  77. package/src/core/agents/configuration-visual-e2e.md +6 -0
  78. package/src/core/agents/database.md +10 -0
  79. package/src/core/agents/datamigration.md +6 -0
  80. package/src/core/agents/design.md +6 -0
  81. package/src/core/agents/devops.md +6 -0
  82. package/src/core/agents/documentation.md +6 -0
  83. package/src/core/agents/epic-planner.md +6 -0
  84. package/src/core/agents/integrations.md +6 -0
  85. package/src/core/agents/mentor.md +6 -0
  86. package/src/core/agents/mobile.md +6 -0
  87. package/src/core/agents/monitoring.md +6 -0
  88. package/src/core/agents/multi-expert.md +6 -0
  89. package/src/core/agents/performance.md +6 -0
  90. package/src/core/agents/product.md +6 -0
  91. package/src/core/agents/qa.md +6 -0
  92. package/src/core/agents/readme-updater.md +6 -0
  93. package/src/core/agents/refactor.md +6 -0
  94. package/src/core/agents/research.md +6 -0
  95. package/src/core/agents/security.md +6 -0
  96. package/src/core/agents/testing.md +10 -0
  97. package/src/core/agents/ui.md +6 -0
  98. package/src/core/commands/adr.md +114 -0
  99. package/src/core/commands/agent.md +120 -0
  100. package/src/core/commands/assign.md +145 -0
  101. package/src/core/commands/audit.md +401 -0
  102. package/src/core/commands/babysit.md +32 -5
  103. package/src/core/commands/board.md +1 -0
  104. package/src/core/commands/changelog.md +118 -0
  105. package/src/core/commands/configure.md +42 -6
  106. package/src/core/commands/diagnose.md +114 -0
  107. package/src/core/commands/epic.md +205 -1
  108. package/src/core/commands/handoff.md +128 -0
  109. package/src/core/commands/help.md +76 -0
  110. package/src/core/commands/metrics.md +1 -0
  111. package/src/core/commands/pr.md +96 -0
  112. package/src/core/commands/research/analyze.md +1 -0
  113. package/src/core/commands/research/ask.md +2 -0
  114. package/src/core/commands/research/import.md +1 -0
  115. package/src/core/commands/research/list.md +2 -0
  116. package/src/core/commands/research/synthesize.md +584 -0
  117. package/src/core/commands/research/view.md +2 -0
  118. package/src/core/commands/roadmap/analyze.md +400 -0
  119. package/src/core/commands/session/new.md +113 -6
  120. package/src/core/commands/session/spawn.md +197 -0
  121. package/src/core/commands/sprint.md +22 -0
  122. package/src/core/commands/status.md +200 -1
  123. package/src/core/commands/story/list.md +9 -9
  124. package/src/core/commands/story/view.md +1 -0
  125. package/src/core/commands/story.md +143 -4
  126. package/src/core/experts/codebase-query/expertise.yaml +190 -0
  127. package/src/core/experts/codebase-query/question.md +73 -0
  128. package/src/core/experts/codebase-query/self-improve.md +105 -0
  129. package/src/core/templates/agileflow-metadata.json +55 -2
  130. package/src/core/templates/plan-template.md +125 -0
  131. package/src/core/templates/story-lifecycle.md +213 -0
  132. package/src/core/templates/story-template.md +4 -0
  133. package/src/core/templates/tdd-test-template.js +241 -0
  134. package/tools/cli/commands/setup.js +86 -0
  135. package/tools/cli/installers/core/installer.js +94 -0
  136. package/tools/cli/installers/ide/_base-ide.js +20 -11
  137. package/tools/cli/installers/ide/codex.js +29 -47
  138. package/tools/cli/lib/config-manager.js +17 -2
  139. package/tools/cli/lib/content-transformer.js +271 -0
  140. package/tools/cli/lib/error-handler.js +14 -22
  141. package/tools/cli/lib/ide-error-factory.js +421 -0
  142. package/tools/cli/lib/ide-health-monitor.js +364 -0
  143. package/tools/cli/lib/ide-registry.js +114 -1
  144. package/tools/cli/lib/ui.js +14 -25
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.92.0] - 2026-01-23
11
+
12
+ ### Added
13
+ - Tmux integration, i18n docs, EP-0022 codebase health improvements
14
+
15
+ ## [2.91.0] - 2026-01-20
16
+
17
+ ### Added
18
+ - GSD workflow integration, codebase query interface, and docs improvements
19
+
10
20
  ## [2.90.7] - 2026-01-17
11
21
 
12
22
  ### Fixed
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  </p>
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/agileflow?color=brightgreen)](https://www.npmjs.com/package/agileflow)
6
- [![Commands](https://img.shields.io/badge/commands-72-blue)](docs/04-architecture/commands.md)
7
- [![Agents/Experts](https://img.shields.io/badge/agents%2Fexperts-29-orange)](docs/04-architecture/subagents.md)
6
+ [![Commands](https://img.shields.io/badge/commands-76-blue)](docs/04-architecture/commands.md)
7
+ [![Agents/Experts](https://img.shields.io/badge/agents%2Fexperts-30-orange)](docs/04-architecture/subagents.md)
8
8
  [![Skills](https://img.shields.io/badge/skills-dynamic-purple)](docs/04-architecture/skills.md)
9
9
 
10
10
  **AI-driven agile development for Claude Code, Cursor, Windsurf, OpenAI Codex CLI, and more.** Combining Scrum, Kanban, ADRs, and docs-as-code principles into one framework-agnostic system.
@@ -65,8 +65,8 @@ AgileFlow combines three proven methodologies:
65
65
 
66
66
  | Component | Count | Description |
67
67
  |-----------|-------|-------------|
68
- | [Commands](docs/04-architecture/commands.md) | 72 | Slash commands for agile workflows |
69
- | [Agents/Experts](docs/04-architecture/subagents.md) | 29 | Specialized agents with self-improving knowledge bases |
68
+ | [Commands](docs/04-architecture/commands.md) | 76 | Slash commands for agile workflows |
69
+ | [Agents/Experts](docs/04-architecture/subagents.md) | 30 | Specialized agents with self-improving knowledge bases |
70
70
  | [Skills](docs/04-architecture/skills.md) | Dynamic | Generated on-demand with `/agileflow:skill:create` |
71
71
 
72
72
  ---
@@ -76,8 +76,8 @@ AgileFlow combines three proven methodologies:
76
76
  Full documentation lives in [`docs/04-architecture/`](docs/04-architecture/):
77
77
 
78
78
  ### Reference
79
- - [Commands](docs/04-architecture/commands.md) - All 72 slash commands
80
- - [Agents/Experts](docs/04-architecture/subagents.md) - 29 specialized agents with self-improving knowledge
79
+ - [Commands](docs/04-architecture/commands.md) - All 76 slash commands
80
+ - [Agents/Experts](docs/04-architecture/subagents.md) - 30 specialized agents with self-improving knowledge
81
81
  - [Skills](docs/04-architecture/skills.md) - Dynamic skill generator with MCP integration
82
82
 
83
83
  ### Architecture
package/lib/README.md ADDED
@@ -0,0 +1,178 @@
1
+ # AgileFlow CLI Library
2
+
3
+ Core utility modules for AgileFlow CLI operations.
4
+
5
+ ## Result Schema (`result-schema.js`)
6
+
7
+ Provides a unified `Result<T>` type for consistent success/failure handling across the codebase.
8
+
9
+ ### Quick Start
10
+
11
+ ```javascript
12
+ const { success, failure, isSuccess, unwrapOr } = require('./result-schema');
13
+
14
+ // Success case
15
+ function loadConfig() {
16
+ const config = readConfigFile();
17
+ return success(config);
18
+ }
19
+
20
+ // Failure case with error code
21
+ function loadConfig() {
22
+ if (!fs.existsSync(configPath)) {
23
+ return failure('ENOENT', 'Config file not found');
24
+ }
25
+ return success(config);
26
+ }
27
+
28
+ // Using results
29
+ const result = loadConfig();
30
+ if (isSuccess(result)) {
31
+ console.log(result.data);
32
+ } else {
33
+ console.error(result.error);
34
+ console.error('Fix:', result.suggestedFix);
35
+ }
36
+ ```
37
+
38
+ ### Result Structure
39
+
40
+ **Success:**
41
+ ```javascript
42
+ {
43
+ ok: true,
44
+ data: <T> // The success data
45
+ }
46
+ ```
47
+
48
+ **Failure:**
49
+ ```javascript
50
+ {
51
+ ok: false,
52
+ error: string, // Human-readable message
53
+ errorCode: string, // Machine-readable code (ENOENT, ECONFIG, etc.)
54
+ severity: string, // critical | high | medium | low
55
+ category: string, // filesystem | permission | configuration | network | validation | state | dependency
56
+ recoverable: boolean,
57
+ suggestedFix: string,
58
+ autoFix: string|null,
59
+ context?: object, // Additional context
60
+ cause?: Error // Original error
61
+ }
62
+ ```
63
+
64
+ ### API Reference
65
+
66
+ #### Constructors
67
+
68
+ | Function | Description |
69
+ |----------|-------------|
70
+ | `success(data, meta?)` | Create success result |
71
+ | `failure(errorCode, message?, options?)` | Create failure result with error code |
72
+ | `failureFromError(error, defaultCode?)` | Create failure from Error object |
73
+
74
+ #### From Helpers
75
+
76
+ | Function | Description |
77
+ |----------|-------------|
78
+ | `fromCondition(condition, data, errorCode, message?)` | Create from boolean |
79
+ | `fromPromise(promise, defaultCode?)` | Wrap Promise in Result |
80
+ | `fromTry(fn, defaultCode?)` | Wrap sync function in Result |
81
+
82
+ #### Type Guards
83
+
84
+ | Function | Description |
85
+ |----------|-------------|
86
+ | `isSuccess(result)` | Check if result is success |
87
+ | `isFailure(result)` | Check if result is failure |
88
+
89
+ #### Extractors
90
+
91
+ | Function | Description |
92
+ |----------|-------------|
93
+ | `unwrap(result, context?)` | Get data or throw |
94
+ | `unwrapOr(result, defaultValue)` | Get data or default |
95
+
96
+ #### Transformers
97
+
98
+ | Function | Description |
99
+ |----------|-------------|
100
+ | `map(result, fn)` | Transform success data |
101
+ | `flatMap(result, fn)` | Chain result-returning operations |
102
+
103
+ #### Combinators
104
+
105
+ | Function | Description |
106
+ |----------|-------------|
107
+ | `all(results)` | Combine array of results |
108
+ | `any(results)` | Get first success or last failure |
109
+
110
+ ### Error Codes
111
+
112
+ Available error codes from `error-codes.js`:
113
+
114
+ | Code | Category | Description |
115
+ |------|----------|-------------|
116
+ | `ENOENT` | filesystem | File or directory not found |
117
+ | `ENODIR` | filesystem | Directory does not exist |
118
+ | `EEXIST` | filesystem | Already exists |
119
+ | `EACCES` | permission | Permission denied |
120
+ | `EPERM` | permission | Operation not permitted |
121
+ | `ECONFIG` | configuration | Invalid/missing configuration |
122
+ | `EPARSE` | configuration | Parse error (JSON/YAML) |
123
+ | `ESCHEMA` | configuration | Schema validation failed |
124
+ | `ENETWORK` | network | Network error |
125
+ | `ETIMEOUT` | network | Operation timed out |
126
+ | `EINVAL` | validation | Invalid argument |
127
+ | `EMISSING` | validation | Required value missing |
128
+ | `ESTATE` | state | Invalid application state |
129
+ | `ECONFLICT` | state | State conflict |
130
+ | `ELOCK` | state | Resource locked |
131
+ | `EDEP` | dependency | Missing dependency |
132
+ | `EUNKNOWN` | state | Unknown error |
133
+
134
+ ### Migration Guide
135
+
136
+ **Before (inconsistent):**
137
+ ```javascript
138
+ // Different modules return different shapes
139
+ return { ok: true, data };
140
+ return { success: true, result };
141
+ return { error: 'message' };
142
+ ```
143
+
144
+ **After (unified):**
145
+ ```javascript
146
+ const { success, failure } = require('../lib/result-schema');
147
+
148
+ // Always use Result type
149
+ return success(data);
150
+ return failure('ENOENT', 'File not found');
151
+ ```
152
+
153
+ ## Error Codes (`error-codes.js`)
154
+
155
+ Centralized error codes with metadata for auto-recovery.
156
+
157
+ ### Key Functions
158
+
159
+ | Function | Description |
160
+ |----------|-------------|
161
+ | `createErrorResult(code, message?, options?)` | Create failure Result |
162
+ | `createSuccessResult(data, meta?)` | Create success Result |
163
+ | `getErrorCode(code)` | Get error code metadata |
164
+ | `isRecoverable(error)` | Check if error is recoverable |
165
+ | `getSuggestedFix(error)` | Get fix suggestion |
166
+
167
+ ## Safe Wrappers (`errors.js`)
168
+
169
+ File/command wrappers that return Result objects:
170
+
171
+ | Function | Description |
172
+ |----------|-------------|
173
+ | `safeReadJSON(path, options?)` | Read and parse JSON |
174
+ | `safeWriteJSON(path, data, options?)` | Write JSON to file |
175
+ | `safeReadFile(path, options?)` | Read text file |
176
+ | `safeWriteFile(path, content, options?)` | Write text file |
177
+ | `safeExec(command, options?)` | Execute shell command |
178
+ | `safeParseJSON(content, options?)` | Parse JSON with validation |