agile-context-engineering 0.2.1 → 0.3.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 (51) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +51 -51
  3. package/README.md +324 -319
  4. package/agents/ace-research-synthesizer.md +228 -228
  5. package/agents/ace-technical-application-architect.md +28 -0
  6. package/agents/ace-wiki-mapper.md +445 -334
  7. package/agile-context-engineering/src/ace-tools.test.js +1089 -1089
  8. package/agile-context-engineering/templates/_command.md +53 -53
  9. package/agile-context-engineering/templates/_workflow.xml +16 -16
  10. package/agile-context-engineering/templates/product/product-backlog.xml +231 -231
  11. package/agile-context-engineering/templates/product/story-integration-solution.xml +1 -0
  12. package/agile-context-engineering/templates/product/story-wiki.xml +4 -0
  13. package/agile-context-engineering/templates/wiki/coding-standards.xml +38 -0
  14. package/agile-context-engineering/templates/wiki/decizions.xml +115 -115
  15. package/agile-context-engineering/templates/wiki/guide.xml +137 -137
  16. package/agile-context-engineering/templates/wiki/module-discovery.xml +174 -174
  17. package/agile-context-engineering/templates/wiki/pattern.xml +159 -159
  18. package/agile-context-engineering/templates/wiki/system-architecture.xml +254 -254
  19. package/agile-context-engineering/templates/wiki/system-cross-cutting.xml +197 -197
  20. package/agile-context-engineering/templates/wiki/system.xml +381 -381
  21. package/agile-context-engineering/templates/wiki/walkthrough.xml +255 -0
  22. package/agile-context-engineering/templates/wiki/wiki-readme.xml +297 -276
  23. package/agile-context-engineering/utils/questioning.xml +110 -110
  24. package/agile-context-engineering/workflows/execute-story.xml +1219 -1145
  25. package/agile-context-engineering/workflows/help.xml +540 -540
  26. package/agile-context-engineering/workflows/init-coding-standards.xml +386 -386
  27. package/agile-context-engineering/workflows/map-story.xml +1046 -797
  28. package/agile-context-engineering/workflows/map-subsystem.xml +2 -1
  29. package/agile-context-engineering/workflows/map-walkthrough.xml +457 -0
  30. package/agile-context-engineering/workflows/plan-feature.xml +1495 -1495
  31. package/agile-context-engineering/workflows/plan-story.xml +36 -1
  32. package/agile-context-engineering/workflows/research-integration-solution.xml +1 -0
  33. package/agile-context-engineering/workflows/research-story-wiki.xml +2 -1
  34. package/agile-context-engineering/workflows/research-technical-solution.xml +1 -0
  35. package/agile-context-engineering/workflows/review-story.xml +281 -281
  36. package/agile-context-engineering/workflows/update.xml +238 -0
  37. package/bin/install.js +126 -7
  38. package/commands/ace/execute-story.md +1 -0
  39. package/commands/ace/help.md +93 -93
  40. package/commands/ace/init-coding-standards.md +83 -83
  41. package/commands/ace/map-story.md +165 -156
  42. package/commands/ace/map-subsystem.md +140 -138
  43. package/commands/ace/map-system.md +92 -92
  44. package/commands/ace/map-walkthrough.md +127 -0
  45. package/commands/ace/plan-feature.md +89 -89
  46. package/commands/ace/plan-story.md +15 -1
  47. package/commands/ace/review-story.md +109 -109
  48. package/commands/ace/update.md +56 -0
  49. package/hooks/ace-check-update.js +62 -0
  50. package/hooks/ace-statusline.js +89 -0
  51. package/package.json +5 -3
@@ -1,89 +1,89 @@
1
- ---
2
- name: ace:plan-feature
3
- description: Plan a feature through backlog-aware questioning, story decomposition, and guided feature specification
4
- argument-hint: "[feature-id] [optional: context='text or file with feature description prompt']"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Write
9
- - Task
10
- - AskUserQuestion
11
- ---
12
-
13
- ```xml
14
- <command>
15
-
16
- <execution-time>
17
- <runs-after>
18
- <trigger>After /ace:plan-backlog — once the backlog exists, plan individual features</trigger>
19
- <trigger>Anytime — to create or refine a feature and its story breakdown</trigger>
20
- </runs-after>
21
- <use-when>
22
- <condition>Product backlog exists and you want to break a feature into stories</condition>
23
- <condition>Starting feature-level planning and need to decompose into stories</condition>
24
- <condition>Refining an existing feature with updated acceptance criteria or scope</condition>
25
- <condition>Adding a new feature to an existing epic</condition>
26
- </use-when>
27
- </execution-time>
28
-
29
- <input>
30
- <flags>
31
- </flags>
32
-
33
- <parameters>
34
- <required>
35
- </required>
36
-
37
- <optional>
38
- <param name="feature-id" type="text">
39
- Feature identifier from the product backlog (e.g., F3, #78).
40
- If provided, locates existing feature for planning or refinement.
41
- If omitted, presents the backlog for selection or allows creating
42
- a new feature.
43
- </param>
44
- <param name="context" type="file | text">
45
- Feature description, acceptance criteria, user stories, or any
46
- context to seed the feature planning process. Will be absorbed and
47
- refined through questioning, not used as-is.
48
- </param>
49
- </optional>
50
- </parameters>
51
- </input>
52
-
53
- <execution-context>
54
- <plan-feature-workflow>@~/.claude/agile-context-engineering/workflows/plan-feature.xml</plan-feature-workflow>
55
- <feature-template>@~/.claude/agile-context-engineering/templates/product/feature.xml</feature-template>
56
- <questioning>@~/.claude/agile-context-engineering/utils/questioning.xml</questioning>
57
- <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
58
- </execution-context>
59
-
60
- <output>
61
- <objective>
62
- Detect the project environment, load the product backlog and epic context,
63
- absorb any user-provided feature description, conduct deep questioning to
64
- define feature scope and acceptance criteria, decompose the feature into
65
- stories, and generate feature and story artifact files.
66
- Optionally create GitHub issues if github-project.enabled=true.
67
- </objective>
68
-
69
- <artifacts>
70
- .ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-feature_name>.md
71
- .ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/<id-story_name>.md
72
- </artifacts>
73
- </output>
74
-
75
- <process>
76
- Execute the plan-feature workflow from
77
- `@~/.claude/agile-context-engineering/workflows/plan-feature.xml` end-to-end.
78
- Preserve all workflow gates (validation, approvals, commits).
79
- </process>
80
-
81
- <next-steps>
82
- **After this command:**
83
- - `/ace:plan-story story-id` — Plan a story
84
- - `/ace:plan-feature feature-id` — Plan another feature
85
- - `/ace:help` — Check project initialization status
86
- </next-steps>
87
-
88
- </command>
89
- ```
1
+ ---
2
+ name: ace:plan-feature
3
+ description: Plan a feature through backlog-aware questioning, story decomposition, and guided feature specification
4
+ argument-hint: "[feature-id] [optional: context='text or file with feature description prompt']"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Write
9
+ - Task
10
+ - AskUserQuestion
11
+ ---
12
+
13
+ ```xml
14
+ <command>
15
+
16
+ <execution-time>
17
+ <runs-after>
18
+ <trigger>After /ace:plan-backlog — once the backlog exists, plan individual features</trigger>
19
+ <trigger>Anytime — to create or refine a feature and its story breakdown</trigger>
20
+ </runs-after>
21
+ <use-when>
22
+ <condition>Product backlog exists and you want to break a feature into stories</condition>
23
+ <condition>Starting feature-level planning and need to decompose into stories</condition>
24
+ <condition>Refining an existing feature with updated acceptance criteria or scope</condition>
25
+ <condition>Adding a new feature to an existing epic</condition>
26
+ </use-when>
27
+ </execution-time>
28
+
29
+ <input>
30
+ <flags>
31
+ </flags>
32
+
33
+ <parameters>
34
+ <required>
35
+ </required>
36
+
37
+ <optional>
38
+ <param name="feature-id" type="text">
39
+ Feature identifier from the product backlog (e.g., F3, #78).
40
+ If provided, locates existing feature for planning or refinement.
41
+ If omitted, presents the backlog for selection or allows creating
42
+ a new feature.
43
+ </param>
44
+ <param name="context" type="file | text">
45
+ Feature description, acceptance criteria, user stories, or any
46
+ context to seed the feature planning process. Will be absorbed and
47
+ refined through questioning, not used as-is.
48
+ </param>
49
+ </optional>
50
+ </parameters>
51
+ </input>
52
+
53
+ <execution-context>
54
+ <plan-feature-workflow>@~/.claude/agile-context-engineering/workflows/plan-feature.xml</plan-feature-workflow>
55
+ <feature-template>@~/.claude/agile-context-engineering/templates/product/feature.xml</feature-template>
56
+ <questioning>@~/.claude/agile-context-engineering/utils/questioning.xml</questioning>
57
+ <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
58
+ </execution-context>
59
+
60
+ <output>
61
+ <objective>
62
+ Detect the project environment, load the product backlog and epic context,
63
+ absorb any user-provided feature description, conduct deep questioning to
64
+ define feature scope and acceptance criteria, decompose the feature into
65
+ stories, and generate feature and story artifact files.
66
+ Optionally create GitHub issues if github-project.enabled=true.
67
+ </objective>
68
+
69
+ <artifacts>
70
+ .ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-feature_name>.md
71
+ .ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/<id-story_name>.md
72
+ </artifacts>
73
+ </output>
74
+
75
+ <process>
76
+ Execute the plan-feature workflow from
77
+ `@~/.claude/agile-context-engineering/workflows/plan-feature.xml` end-to-end.
78
+ Preserve all workflow gates (validation, approvals, commits).
79
+ </process>
80
+
81
+ <next-steps>
82
+ **After this command:**
83
+ - `/ace:plan-story story-id` — Plan a story
84
+ - `/ace:plan-feature feature-id` — Plan another feature
85
+ - `/ace:help` — Check project initialization status
86
+ </next-steps>
87
+
88
+ </command>
89
+ ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ace:plan-story
3
3
  description: Plan a story through deep questioning to create CRYSTAL-CLEAR acceptance criteria with ZERO assumptions, then dispatch wiki research, external analysis, integration analysis, and technical solution design
4
- argument-hint: "story=<file-path|github-url> [external-codebase=<source-path|github-url>] [external-docs=<weblink|filepath>]"
4
+ argument-hint: "story=<file-path|github-url> [external-codebase=<source-path|github-url>] [external-docs=<weblink|filepath>] [lib-docs=<weblinks-and-filepaths>]"
5
5
  allowed-tools:
6
6
  - Read
7
7
  - Bash
@@ -57,6 +57,15 @@ allowed-tools:
57
57
  Only used when external-codebase is also provided.
58
58
  Provides supplementary context for external analysis.
59
59
  </param>
60
+ <param name="lib-docs" type="weblinks and/or filepaths">
61
+ Space-separated string of weblinks and/or file paths to library or API documentation.
62
+ These are injected into the story's Relevant Wiki section as a
63
+ `### Library Documentation` subsection after pass 2 completes,
64
+ so that passes 4-5 (integration analysis, technical solution) can
65
+ reference them when designing the implementation.
66
+ Useful for third-party libraries, SDK docs, or API references
67
+ that inform how the story should be built.
68
+ </param>
60
69
  </optional>
61
70
  </parameters>
62
71
  </input>
@@ -128,6 +137,11 @@ allowed-tools:
128
137
  external-codebase=src/external/lightweight-charts/ \
129
138
  external-docs=https://tradingview.github.io/lightweight-charts/
130
139
 
140
+ # With library documentation references
141
+ /ace:plan-story \
142
+ story=.ace/artifacts/product/e1-charts/f2-rendering/s3-canvas/s3-canvas.md \
143
+ lib-docs="https://docs.some-lib.io/api src/vendor/some-lib/README.md"
144
+
131
145
  # With just an issue number (uses configured repo)
132
146
  /ace:plan-story story=#95
133
147
  ```
@@ -1,109 +1,109 @@
1
- ---
2
- name: ace:review-story
3
- description: Standalone code review — performs 3-level artifact verification, anti-pattern detection, coding standards enforcement, and tech debt discovery against a story's implementation
4
- argument-hint: "story=<file-path|github-url>"
5
- allowed-tools:
6
- - Read
7
- - Bash
8
- - Glob
9
- - Grep
10
- ---
11
-
12
- ```xml
13
- <command>
14
-
15
- <execution-time>
16
- <runs-after>
17
- <trigger>After /ace:execute-story — to re-run code review after manual changes</trigger>
18
- <trigger>Anytime — to review a story implementation standalone</trigger>
19
- </runs-after>
20
- <use-when>
21
- <condition>A story has been implemented and needs code review</condition>
22
- <condition>Re-checking after manual changes post-execution</condition>
23
- <condition>Verifying stories implemented outside ACE</condition>
24
- <condition>Pre-merge quality gate</condition>
25
- </use-when>
26
- </execution-time>
27
-
28
- <input>
29
- <flags>
30
- </flags>
31
-
32
- <parameters>
33
- <required>
34
- <param name="story" type="file | github-url">
35
- Story source — can be either:
36
- - **File path**: Path to a fully-planned story markdown file
37
- (must have AC + Technical Solution sections)
38
- - **GitHub URL or issue number**: GitHub story reference
39
- Must be a valid, accessible file or GitHub issue.
40
- The story MUST have Acceptance Criteria and Technical Solution.
41
- </param>
42
- </required>
43
- </parameters>
44
- </input>
45
-
46
- <execution-context>
47
- <review-story-workflow>@~/.claude/agile-context-engineering/workflows/review-story.xml</review-story-workflow>
48
- <story-template>@~/.claude/agile-context-engineering/templates/product/story.xml</story-template>
49
- <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
50
- </execution-context>
51
-
52
- <output>
53
- <objective>
54
- Review a story's implementation directly (the session IS the reviewer):
55
- 1. Load story context (AC, Technical Solution, Out of Scope)
56
- 2. Identify changed/created files related to the story
57
- 3. Run 3-level artifact verification (EXISTS → SUBSTANTIVE → WIRED)
58
- 4. Detect anti-patterns (dead code, stubs, TODOs, hardcoded values)
59
- 5. Enforce coding standards (mandatory, blocker-level)
60
- 6. Check AC coverage (all Gherkin scenarios implemented)
61
- 7. Discover pre-existing tech debt in touched files
62
- 8. Report results with structured format
63
- </objective>
64
-
65
- <artifacts>
66
- No files modified — this command is read-only.
67
- Outputs a structured review report to the conversation.
68
- </artifacts>
69
- </output>
70
-
71
- <process>
72
- For this command use the `ace-code-reviewer` agent
73
- that's specialized in code review.
74
-
75
- Execute the review-story workflow from
76
- `@~/.claude/agile-context-engineering/workflows/review-story.xml` end-to-end.
77
-
78
- **CRITICAL REQUIREMENTS:**
79
- - Story MUST have Acceptance Criteria — STOP if missing
80
- - Story MUST have Technical Solution — STOP if missing
81
- - This is a READ-ONLY command — do NOT modify any code
82
- - Coding standards violations are BLOCKERS, not warnings
83
- - Dead code and backwards-compatible shims must be flagged for DELETION
84
- </process>
85
-
86
- <example-usage>
87
- ```
88
- # Review a story from a file path
89
- /ace:review-story \
90
- story=.ace/artifacts/product/e1-auth/f3-oauth/s1-buttons/s1-buttons.md
91
-
92
- # Review from a GitHub issue
93
- /ace:review-story \
94
- story=https://github.com/owner/repo/issues/95
95
-
96
- # With just an issue number
97
- /ace:review-story story=#95
98
- ```
99
- </example-usage>
100
-
101
- <next-steps>
102
- **After this command:**
103
- - `/ace:execute-story story=...` — Re-execute to fix reported issues
104
- - `/ace:review-story story=...` — Re-run review after fixes
105
- - `/ace:help` — Check project status
106
- </next-steps>
107
-
108
- </command>
109
- ```
1
+ ---
2
+ name: ace:review-story
3
+ description: Standalone code review — performs 3-level artifact verification, anti-pattern detection, coding standards enforcement, and tech debt discovery against a story's implementation
4
+ argument-hint: "story=<file-path|github-url>"
5
+ allowed-tools:
6
+ - Read
7
+ - Bash
8
+ - Glob
9
+ - Grep
10
+ ---
11
+
12
+ ```xml
13
+ <command>
14
+
15
+ <execution-time>
16
+ <runs-after>
17
+ <trigger>After /ace:execute-story — to re-run code review after manual changes</trigger>
18
+ <trigger>Anytime — to review a story implementation standalone</trigger>
19
+ </runs-after>
20
+ <use-when>
21
+ <condition>A story has been implemented and needs code review</condition>
22
+ <condition>Re-checking after manual changes post-execution</condition>
23
+ <condition>Verifying stories implemented outside ACE</condition>
24
+ <condition>Pre-merge quality gate</condition>
25
+ </use-when>
26
+ </execution-time>
27
+
28
+ <input>
29
+ <flags>
30
+ </flags>
31
+
32
+ <parameters>
33
+ <required>
34
+ <param name="story" type="file | github-url">
35
+ Story source — can be either:
36
+ - **File path**: Path to a fully-planned story markdown file
37
+ (must have AC + Technical Solution sections)
38
+ - **GitHub URL or issue number**: GitHub story reference
39
+ Must be a valid, accessible file or GitHub issue.
40
+ The story MUST have Acceptance Criteria and Technical Solution.
41
+ </param>
42
+ </required>
43
+ </parameters>
44
+ </input>
45
+
46
+ <execution-context>
47
+ <review-story-workflow>@~/.claude/agile-context-engineering/workflows/review-story.xml</review-story-workflow>
48
+ <story-template>@~/.claude/agile-context-engineering/templates/product/story.xml</story-template>
49
+ <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
50
+ </execution-context>
51
+
52
+ <output>
53
+ <objective>
54
+ Review a story's implementation directly (the session IS the reviewer):
55
+ 1. Load story context (AC, Technical Solution, Out of Scope)
56
+ 2. Identify changed/created files related to the story
57
+ 3. Run 3-level artifact verification (EXISTS → SUBSTANTIVE → WIRED)
58
+ 4. Detect anti-patterns (dead code, stubs, TODOs, hardcoded values)
59
+ 5. Enforce coding standards (mandatory, blocker-level)
60
+ 6. Check AC coverage (all Gherkin scenarios implemented)
61
+ 7. Discover pre-existing tech debt in touched files
62
+ 8. Report results with structured format
63
+ </objective>
64
+
65
+ <artifacts>
66
+ No files modified — this command is read-only.
67
+ Outputs a structured review report to the conversation.
68
+ </artifacts>
69
+ </output>
70
+
71
+ <process>
72
+ For this command use the `ace-code-reviewer` agent
73
+ that's specialized in code review.
74
+
75
+ Execute the review-story workflow from
76
+ `@~/.claude/agile-context-engineering/workflows/review-story.xml` end-to-end.
77
+
78
+ **CRITICAL REQUIREMENTS:**
79
+ - Story MUST have Acceptance Criteria — STOP if missing
80
+ - Story MUST have Technical Solution — STOP if missing
81
+ - This is a READ-ONLY command — do NOT modify any code
82
+ - Coding standards violations are BLOCKERS, not warnings
83
+ - Dead code and backwards-compatible shims must be flagged for DELETION
84
+ </process>
85
+
86
+ <example-usage>
87
+ ```
88
+ # Review a story from a file path
89
+ /ace:review-story \
90
+ story=.ace/artifacts/product/e1-auth/f3-oauth/s1-buttons/s1-buttons.md
91
+
92
+ # Review from a GitHub issue
93
+ /ace:review-story \
94
+ story=https://github.com/owner/repo/issues/95
95
+
96
+ # With just an issue number
97
+ /ace:review-story story=#95
98
+ ```
99
+ </example-usage>
100
+
101
+ <next-steps>
102
+ **After this command:**
103
+ - `/ace:execute-story story=...` — Re-execute to fix reported issues
104
+ - `/ace:review-story story=...` — Re-run review after fixes
105
+ - `/ace:help` — Check project status
106
+ </next-steps>
107
+
108
+ </command>
109
+ ```
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: ace:update
3
+ description: Update ACE to latest version with changelog display
4
+ argument-hint: ""
5
+ allowed-tools:
6
+ - Bash
7
+ - AskUserQuestion
8
+ - WebFetch
9
+ ---
10
+
11
+ ```xml
12
+ <command>
13
+
14
+ <execution-time>
15
+ <runs-after>
16
+ <trigger>When statusline shows the update indicator</trigger>
17
+ <trigger>When user wants to check for or install ACE updates</trigger>
18
+ </runs-after>
19
+ </execution-time>
20
+
21
+ <input>
22
+ <parameters>
23
+ <required></required>
24
+ <optional></optional>
25
+ </parameters>
26
+ </input>
27
+
28
+ <execution-context>
29
+ <update-workflow>@~/.claude/agile-context-engineering/workflows/update.xml</update-workflow>
30
+ <ui-formatting>@~/.claude/agile-context-engineering/utils/ui-formatting.md</ui-formatting>
31
+ </execution-context>
32
+
33
+ <output>
34
+ <objective>
35
+ Check for ACE updates, install if available, and display what changed.
36
+ Automatically detects local vs global installation and Claude vs Crush runtime.
37
+ </objective>
38
+ </output>
39
+
40
+ <process>
41
+ Execute the update workflow from
42
+ `@~/.claude/agile-context-engineering/workflows/update.xml` end-to-end.
43
+
44
+ The workflow handles all logic including:
45
+ 1. Installation detection (local/global, Claude/Crush)
46
+ 2. Latest version checking via npm
47
+ 3. Version comparison
48
+ 4. Changelog fetching and display
49
+ 5. Clean install warning display
50
+ 6. User confirmation
51
+ 7. Update execution
52
+ 8. Cache clearing and restart reminder
53
+ </process>
54
+
55
+ </command>
56
+ ```
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ // Check for ACE 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 { spawn } = require('child_process');
9
+
10
+ const homeDir = os.homedir();
11
+ const cwd = process.cwd();
12
+ const cacheDir = path.join(homeDir, '.claude', 'cache');
13
+ const cacheFile = path.join(cacheDir, 'ace-update-check.json');
14
+
15
+ // VERSION file locations (check project first, then global)
16
+ const projectVersionFile = path.join(cwd, '.claude', 'agile-context-engineering', 'VERSION');
17
+ const globalVersionFile = path.join(homeDir, '.claude', 'agile-context-engineering', 'VERSION');
18
+
19
+ // Ensure cache directory exists
20
+ if (!fs.existsSync(cacheDir)) {
21
+ fs.mkdirSync(cacheDir, { recursive: true });
22
+ }
23
+
24
+ // Run check in background (spawn detached process, windowsHide prevents console flash)
25
+ const child = spawn(process.execPath, ['-e', `
26
+ const fs = require('fs');
27
+ const { execSync } = require('child_process');
28
+
29
+ const cacheFile = ${JSON.stringify(cacheFile)};
30
+ const projectVersionFile = ${JSON.stringify(projectVersionFile)};
31
+ const globalVersionFile = ${JSON.stringify(globalVersionFile)};
32
+
33
+ // Check project directory first (local install), then global
34
+ let installed = '0.0.0';
35
+ try {
36
+ if (fs.existsSync(projectVersionFile)) {
37
+ installed = fs.readFileSync(projectVersionFile, 'utf8').trim();
38
+ } else if (fs.existsSync(globalVersionFile)) {
39
+ installed = fs.readFileSync(globalVersionFile, 'utf8').trim();
40
+ }
41
+ } catch (e) {}
42
+
43
+ let latest = null;
44
+ try {
45
+ latest = execSync('npm view agile-context-engineering version', { encoding: 'utf8', timeout: 10000, windowsHide: true }).trim();
46
+ } catch (e) {}
47
+
48
+ const result = {
49
+ update_available: latest && installed !== latest,
50
+ installed,
51
+ latest: latest || 'unknown',
52
+ checked: Math.floor(Date.now() / 1000)
53
+ };
54
+
55
+ fs.writeFileSync(cacheFile, JSON.stringify(result));
56
+ `], {
57
+ stdio: 'ignore',
58
+ windowsHide: true,
59
+ detached: true
60
+ });
61
+
62
+ child.unref();
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env node
2
+ // Claude Code Statusline - ACE Edition
3
+ // Shows: update indicator | 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 scaled to 80% limit)
22
+ // Claude Code enforces an 80% context limit, so we scale to show 100% at that point
23
+ let ctx = '';
24
+ if (remaining != null) {
25
+ const rem = Math.round(remaining);
26
+ const rawUsed = Math.max(0, Math.min(100, 100 - rem));
27
+ // Scale: 80% real usage = 100% displayed
28
+ const used = Math.min(100, Math.round((rawUsed / 80) * 100));
29
+
30
+ // Build progress bar (10 segments)
31
+ const filled = Math.floor(used / 10);
32
+ const bar = '\u2588'.repeat(filled) + '\u2591'.repeat(10 - filled);
33
+
34
+ // Color based on scaled usage
35
+ if (used < 63) {
36
+ ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
37
+ } else if (used < 81) {
38
+ ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
39
+ } else if (used < 95) {
40
+ ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
41
+ } else {
42
+ ctx = ` \x1b[5;31m\u{1F480} ${bar} ${used}%\x1b[0m`;
43
+ }
44
+ }
45
+
46
+ // Current task from todos
47
+ let task = '';
48
+ const homeDir = os.homedir();
49
+ const todosDir = path.join(homeDir, '.claude', 'todos');
50
+ if (session && fs.existsSync(todosDir)) {
51
+ try {
52
+ const files = fs.readdirSync(todosDir)
53
+ .filter(f => f.startsWith(session) && f.includes('-agent-') && f.endsWith('.json'))
54
+ .map(f => ({ name: f, mtime: fs.statSync(path.join(todosDir, f)).mtime }))
55
+ .sort((a, b) => b.mtime - a.mtime);
56
+
57
+ if (files.length > 0) {
58
+ try {
59
+ const todos = JSON.parse(fs.readFileSync(path.join(todosDir, files[0].name), 'utf8'));
60
+ const inProgress = todos.find(t => t.status === 'in_progress');
61
+ if (inProgress) task = inProgress.activeForm || '';
62
+ } catch (e) {}
63
+ }
64
+ } catch (e) {}
65
+ }
66
+
67
+ // ACE update available?
68
+ let aceUpdate = '';
69
+ const cacheFile = path.join(homeDir, '.claude', 'cache', 'ace-update-check.json');
70
+ if (fs.existsSync(cacheFile)) {
71
+ try {
72
+ const cache = JSON.parse(fs.readFileSync(cacheFile, 'utf8'));
73
+ if (cache.update_available) {
74
+ aceUpdate = '\x1b[33m\u2B06 /ace:update\x1b[0m \u2502 ';
75
+ }
76
+ } catch (e) {}
77
+ }
78
+
79
+ // Output
80
+ const dirname = path.basename(dir);
81
+ if (task) {
82
+ process.stdout.write(`${aceUpdate}\x1b[2m${model}\x1b[0m \u2502 \x1b[1m${task}\x1b[0m \u2502 \x1b[2m${dirname}\x1b[0m${ctx}`);
83
+ } else {
84
+ process.stdout.write(`${aceUpdate}\x1b[2m${model}\x1b[0m \u2502 \x1b[2m${dirname}\x1b[0m${ctx}`);
85
+ }
86
+ } catch (e) {
87
+ // Silent fail - don't break statusline on parse errors
88
+ }
89
+ });