agile-context-engineering 0.5.0 → 0.5.1

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 (102) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +7 -1
  4. package/README.md +16 -12
  5. package/agents/ace-code-discovery-analyst.md +245 -245
  6. package/agents/ace-code-integration-analyst.md +248 -248
  7. package/agents/ace-code-reviewer.md +375 -375
  8. package/agents/ace-product-owner.md +365 -361
  9. package/agents/ace-project-researcher.md +606 -606
  10. package/agents/ace-technical-application-architect.md +315 -315
  11. package/bin/install.js +587 -173
  12. package/hooks/ace-check-update.js +15 -14
  13. package/hooks/ace-statusline.js +30 -12
  14. package/hooks/hooks.json +14 -0
  15. package/package.json +3 -2
  16. package/shared/lib/ace-core.js +53 -0
  17. package/shared/lib/ace-core.test.js +308 -308
  18. package/shared/lib/ace-story.test.js +250 -250
  19. package/skills/execute-story/SKILL.md +116 -110
  20. package/skills/execute-story/script.js +13 -27
  21. package/skills/execute-story/script.test.js +261 -261
  22. package/skills/execute-story/story-template.xml +451 -451
  23. package/skills/execute-story/workflow.xml +3 -1
  24. package/skills/help/SKILL.md +71 -69
  25. package/skills/help/script.js +32 -35
  26. package/skills/help/script.test.js +183 -183
  27. package/skills/help/workflow.xml +14 -3
  28. package/skills/init-coding-standards/SKILL.md +91 -72
  29. package/skills/init-coding-standards/coding-standards-template.xml +531 -531
  30. package/skills/init-coding-standards/script.js +50 -59
  31. package/skills/init-coding-standards/script.test.js +70 -70
  32. package/skills/init-coding-standards/workflow.xml +1 -1
  33. package/skills/map-cross-cutting/SKILL.md +126 -89
  34. package/skills/map-cross-cutting/workflow.xml +1 -1
  35. package/skills/map-guide/SKILL.md +126 -89
  36. package/skills/map-guide/workflow.xml +1 -1
  37. package/skills/map-pattern/SKILL.md +125 -89
  38. package/skills/map-pattern/workflow.xml +1 -1
  39. package/skills/map-story/SKILL.md +180 -127
  40. package/skills/map-story/templates/tech-debt-index.xml +125 -125
  41. package/skills/map-story/workflow.xml +2 -2
  42. package/skills/map-subsystem/SKILL.md +155 -111
  43. package/skills/map-subsystem/script.js +51 -60
  44. package/skills/map-subsystem/script.test.js +68 -68
  45. package/skills/map-subsystem/templates/subsystem-architecture.xml +343 -343
  46. package/skills/map-subsystem/templates/subsystem-structure.xml +234 -234
  47. package/skills/map-subsystem/workflow.xml +1173 -1173
  48. package/skills/map-sys-doc/SKILL.md +125 -90
  49. package/skills/map-sys-doc/workflow.xml +1 -1
  50. package/skills/map-system/SKILL.md +103 -85
  51. package/skills/map-system/script.js +75 -84
  52. package/skills/map-system/script.test.js +73 -73
  53. package/skills/map-system/templates/system-structure.xml +177 -177
  54. package/skills/map-system/templates/testing-framework.xml +283 -283
  55. package/skills/map-system/workflow.xml +667 -667
  56. package/skills/map-walkthrough/SKILL.md +140 -92
  57. package/skills/map-walkthrough/workflow.xml +457 -457
  58. package/skills/plan-backlog/SKILL.md +93 -75
  59. package/skills/plan-backlog/script.js +121 -136
  60. package/skills/plan-backlog/script.test.js +83 -83
  61. package/skills/plan-backlog/workflow.xml +1348 -1348
  62. package/skills/plan-feature/SKILL.md +99 -76
  63. package/skills/plan-feature/feature-template.xml +361 -361
  64. package/skills/plan-feature/script.js +131 -148
  65. package/skills/plan-feature/script.test.js +80 -80
  66. package/skills/plan-feature/workflow.xml +1 -1
  67. package/skills/plan-product-vision/SKILL.md +91 -75
  68. package/skills/plan-product-vision/product-vision-template.xml +227 -227
  69. package/skills/plan-product-vision/script.js +51 -60
  70. package/skills/plan-product-vision/script.test.js +69 -69
  71. package/skills/plan-product-vision/workflow.xml +337 -337
  72. package/skills/plan-story/SKILL.md +125 -102
  73. package/skills/plan-story/script.js +18 -49
  74. package/skills/plan-story/story-template.xml +8 -1
  75. package/skills/plan-story/workflow.xml +17 -1
  76. package/skills/research-external-solution/SKILL.md +120 -107
  77. package/skills/research-external-solution/external-solution-template.xml +832 -832
  78. package/skills/research-external-solution/script.js +229 -238
  79. package/skills/research-external-solution/script.test.js +134 -134
  80. package/skills/research-external-solution/workflow.xml +657 -657
  81. package/skills/research-integration-solution/SKILL.md +121 -98
  82. package/skills/research-integration-solution/integration-solution-template.xml +1015 -1015
  83. package/skills/research-integration-solution/script.js +223 -231
  84. package/skills/research-integration-solution/script.test.js +134 -134
  85. package/skills/research-integration-solution/workflow.xml +711 -711
  86. package/skills/research-story-wiki/SKILL.md +101 -92
  87. package/skills/research-story-wiki/script.js +223 -231
  88. package/skills/research-story-wiki/script.test.js +138 -138
  89. package/skills/research-story-wiki/story-wiki-template.xml +194 -194
  90. package/skills/research-story-wiki/workflow.xml +473 -473
  91. package/skills/research-technical-solution/SKILL.md +131 -103
  92. package/skills/research-technical-solution/script.js +223 -231
  93. package/skills/research-technical-solution/script.test.js +134 -134
  94. package/skills/research-technical-solution/technical-solution-template.xml +1025 -1025
  95. package/skills/research-technical-solution/workflow.xml +761 -761
  96. package/skills/review-story/SKILL.md +99 -100
  97. package/skills/review-story/script.js +8 -16
  98. package/skills/review-story/script.test.js +169 -169
  99. package/skills/review-story/story-template.xml +451 -451
  100. package/skills/review-story/workflow.xml +1 -1
  101. package/skills/update/SKILL.md +65 -53
  102. package/skills/update/workflow.xml +21 -5
@@ -8,109 +8,132 @@ model: opus
8
8
  effort: high
9
9
  ---
10
10
 
11
- # Plan Story
12
-
13
- Orchestrate story specification through deep questioning and multi-pass research.
14
-
15
- ## When to Use
16
-
17
- - After `/ace:plan-feature` — when a feature's story breakdown exists with stub story files
18
- - To create or refine a story specification from a description or GitHub issue
19
- - When a story stub needs formal INVEST-compliant specification
20
- - When an existing story needs refinement due to scope changes or AC gaps
21
- - When you have a new story idea (text or no input) and need it placed in the backlog
22
-
23
- ## Input
24
-
25
- ### Optional
26
-
27
- - **`story`** — Story source:
28
- - **File path**: Path to a markdown file containing the story seed (typically from plan-feature, or any markdown with a description)
29
- - **GitHub URL or issue number**: e.g., `story=#95` or `story=https://github.com/owner/repo/issues/95`
30
- - When omitted, enters "new story" mode and guides the user through backlog placement.
31
-
32
- - **`text`** — Inline story description to seed the planning session. Used when no story file exists yet — the text becomes the initial description and the workflow asks where in the backlog this story belongs. Ignored if `story` is provided.
33
-
34
- - **`external-codebase`** — Path or GitHub repo to an external system to analyze. Triggers pass 3 automatically.
35
-
36
- - **`external-docs`** — Link or filepath to external system documentation. Only used with external-codebase.
37
-
38
- - **`lib-docs`** — Space-separated weblinks and/or filepaths to library/API documentation. Injected into the Relevant Wiki section after pass 2.
39
-
40
11
  ## Environment Context (preprocessed)
41
12
 
42
13
  !`node "${CLAUDE_SKILL_DIR}/script.js" init "$ARGUMENTS" 2>/dev/null`
43
14
 
44
- ## Supporting Resources
45
-
46
- Read ALL of these before starting the workflow:
47
-
48
- - **Workflow**: Read [workflow.xml](workflow.xml) — complete orchestration process with all steps
49
- - **Story template**: Read [story-template.xml](story-template.xml) — output format for the story specification
50
- - **Questioning guide**: Read `${CLAUDE_SKILL_DIR}/../../shared/utils/questioning.xml` — deep questioning techniques
51
- - **UI formatting**: Read `${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md` — ACE output formatting rules
52
-
53
- ## Process
54
-
55
- Use the `ace-product-owner` agent for requirements gathering, deep questioning, and story specification.
56
-
57
- The Environment Context above contains the preprocessed INIT JSON — use it directly instead of running the init script manually. The workflow's step 1 setup can skip the init bash call since that data is already available.
58
-
59
- Read all supporting resources listed above, then execute the workflow defined in [workflow.xml](workflow.xml) end-to-end. Preserve all workflow gates (validation, approvals, commits).
60
-
61
- **Context Window Protection:**
62
- Passes 2-5 run as background agents. Each agent writes output directly to files.
63
- The orchestrator MUST NOT call TaskOutput on any background agent.
64
- Only track when each pass finishes to start the next one.
65
-
66
- **Pass execution order:**
67
- Pass 2 + Pass 3 (if applicable) wait Pass 4 wait Pass 5 → wait → done
68
-
69
- ## Artifacts
70
-
71
- ```
72
- .ace/artifacts/product/<epic>/<feature>/<story>/
73
- ├── <story>.md # Story specification (passes 1, 2, 5)
74
- ├── external-analysis.md # OPTIONAL (pass 3)
75
- └── integration-analysis.md # Integration analysis (pass 4)
76
- ```
77
-
78
- ## Example Usage
79
-
80
- ```
81
- # New story from inline text workflow asks for backlog placement
82
- /ace:plan-story text="User can reset their password via email link"
83
-
84
- # New story with no input workflow asks title then placement
85
- /ace:plan-story
86
-
87
- # From a plan-feature stub file
88
- /ace:plan-story story=.ace/artifacts/product/e1-auth/f3-oauth/s1-buttons/s1-buttons.md
89
-
90
- # From a loose markdown file (no ACE structure yet — triggers placement flow)
91
- /ace:plan-story story=notes/password-reset-idea.md
92
-
93
- # From a GitHub issue
94
- /ace:plan-story story=https://github.com/owner/repo/issues/95
95
-
96
- # With external system analysis
97
- /ace:plan-story \
98
- story=.ace/artifacts/product/e1-charts/f2-rendering/s3-canvas/s3-canvas.md \
99
- external-codebase=src/external/lightweight-charts/ \
100
- external-docs=https://tradingview.github.io/lightweight-charts/
101
-
102
- # With library documentation
103
- /ace:plan-story \
104
- story=.ace/artifacts/product/e1-charts/f2-rendering/s3-canvas/s3-canvas.md \
105
- lib-docs="https://docs.some-lib.io/api src/vendor/some-lib/README.md"
106
-
107
- # With just an issue number
108
- /ace:plan-story story=#95
109
- ```
110
-
111
- ## Next Steps
112
-
113
- - `/ace:execute-story story=...` — Execute the story implementation
114
- - `/ace:plan-story story=...` — Plan the next story in the feature
115
- - `/ace:verify-story story=...` — Verify a completed story
116
- - `/ace:help` — Check project initialization status
15
+ ## Supporting Resources (auto-loaded)
16
+
17
+ !`cat "${CLAUDE_SKILL_DIR}/workflow.xml"`
18
+
19
+ !`cat "${CLAUDE_SKILL_DIR}/story-template.xml"`
20
+
21
+ !`cat "${CLAUDE_SKILL_DIR}/../../shared/utils/questioning.xml"`
22
+
23
+ !`cat "${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md"`
24
+
25
+ ```xml
26
+ <command>
27
+
28
+ <execution-time>
29
+ <runs-after>
30
+ <trigger>After /ace:plan-feature once a feature's story breakdown exists with stub story files</trigger>
31
+ <trigger>Anytime — to create or refine a story specification from a description or GitHub issue</trigger>
32
+ </runs-after>
33
+ <use-when>
34
+ <condition>A story stub exists (from plan-feature) and needs formal specification</condition>
35
+ <condition>A GitHub issue describes work that needs INVEST-compliant acceptance criteria</condition>
36
+ <condition>An existing story needs refinement — scope changed, AC gaps found</condition>
37
+ <condition>You want to create a complete story specification from any text description</condition>
38
+ <condition>You have a new story idea (text or no input) and need it placed in the backlog</condition>
39
+ </use-when>
40
+ </execution-time>
41
+
42
+ <input>
43
+ <flags>
44
+ </flags>
45
+
46
+ <parameters>
47
+ <required>
48
+ </required>
49
+
50
+ <optional>
51
+ <param name="story" type="file | github-url">
52
+ Story sourcecan be either:
53
+ - **File path**: Path to an existing markdown file containing the story seed
54
+ (typically a stub from plan-feature, or any markdown with a description)
55
+ - **GitHub URL or issue number**: GitHub story reference
56
+ When omitted, the workflow enters "new story" mode and guides the user
57
+ through backlog placement before proceeding to specification.
58
+ If provided but invalid, stop and prompt the user.
59
+ </param>
60
+ <param name="text" type="text">
61
+ Inline story description to seed the planning session.
62
+ Used when no story file exists yet — the text becomes the initial description
63
+ and the workflow asks where in the backlog this story belongs.
64
+ Ignored if `story` is provided.
65
+ </param>
66
+ <param name="external-codebase" type="filepath | github-url">
67
+ Path or GitHub repo to an external industry-standard system to analyze.
68
+ When provided, pass 3 (external analysis) runs automatically.
69
+ When NOT provided, the user is offered the option to provide it or skip.
70
+ </param>
71
+ <param name="external-docs" type="weblink | filepath">
72
+ Link or path to external system documentation.
73
+ Only used when external-codebase is also provided.
74
+ Provides supplementary context for external analysis.
75
+ </param>
76
+ <param name="lib-docs" type="weblinks and/or filepaths">
77
+ Space-separated string of weblinks and/or file paths to library or API documentation.
78
+ These are injected into the story's Relevant Wiki section as a
79
+ `### Library Documentation` subsection after pass 2 completes,
80
+ so that passes 4-5 (integration analysis, technical solution) can
81
+ reference them when designing the implementation.
82
+ Useful for third-party libraries, SDK docs, or API references
83
+ that inform how the story should be built.
84
+ </param>
85
+ </optional>
86
+ </parameters>
87
+ </input>
88
+
89
+ <execution-context>
90
+ <!-- All supporting files are auto-loaded in the Supporting Resources section above.
91
+ The model does NOT need to Read these files — they are already in context. -->
92
+ </execution-context>
93
+
94
+ <output>
95
+ <objective>
96
+ Take a story seed (stub file, GitHub issue, or any text description) and produce
97
+ a COMPLETE story specification through deep questioning that ensures:
98
+ - ZERO ASSUMPTIONS — every behavior is explicitly specified
99
+ - CRYSTAL-CLEAR acceptance criteria with exact triggers, preconditions, outcomes
100
+ - INVEST compliance — Independent, Negotiable, Valuable, Estimable, Small, Testable
101
+ - Gherkin scenarios cover happy paths, edge cases, AND error paths
102
+
103
+ After story requirements are defined (pass 1), dispatch research passes 2-5
104
+ as background agents:
105
+ - Pass 2: Wiki research (updates story file with Relevant Wiki section)
106
+ - Pass 3: External analysis (OPTIONAL — creates external-analysis.md)
107
+ - Pass 4: Integration analysis (creates integration-analysis.md)
108
+ - Pass 5: Technical solution (appends to story file)
109
+
110
+ Each research pass writes directly to disk. The orchestrator context window
111
+ contains ONLY story requirements — research outputs do NOT flow back.
112
+ </objective>
113
+
114
+ <artifacts>
115
+ .ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/&lt;id-story_name&gt;.md
116
+ .ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/external-analysis.md (OPTIONAL)
117
+ .ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/integration-analysis.md
118
+ </artifacts>
119
+ </output>
120
+
121
+ <process>
122
+ For this command use the `ace-product-owner` agent
123
+ that's specialized in requirements gathering, deep questioning, and story specification.
124
+
125
+ Execute the plan-story workflow from
126
+ `workflow.xml` end-to-end.
127
+ Preserve all workflow gates (validation, approvals, commits).
128
+
129
+ **CRITICAL — Context Window Protection:**
130
+ Passes 2-5 run as background agents. Each agent writes output directly to files.
131
+ The orchestrator MUST NOT call TaskOutput on any background agent.
132
+ The orchestrator only needs to know when each pass finishes to start the next one.
133
+
134
+ **Pass execution order:**
135
+ Pass 2 + Pass 3 (if applicable) → wait → Pass 4 → wait → Pass 5 → wait → done
136
+ </process>
137
+
138
+ <example-usage>
139
+ ```
@@ -19,7 +19,7 @@ const path = require('path');
19
19
  const {
20
20
  loadConfig, pathExists, safeReadFile, generateSlug, resolveModel,
21
21
  detectBrownfieldStatus, loadSettings, execCommand,
22
- output, error, parseKeyValueArgs,
22
+ output, error, runSkillScript,
23
23
  } = require('../../shared/lib/ace-core');
24
24
 
25
25
  const {
@@ -32,44 +32,25 @@ const { syncStory, resolveFields, createIssue } = require('../../shared/lib/ace-
32
32
 
33
33
  // ─── CLI Dispatch ────────────────────────────────────────────────────────────
34
34
 
35
- const cwd = process.cwd();
36
- const args = process.argv.slice(2);
37
- const raw = args.includes('--raw');
38
- const cmd = args[0];
39
-
40
- switch (cmd) {
41
- case 'init':
42
- cmdInit(cwd, raw, args.slice(1).filter(a => a !== '--raw'));
43
- break;
44
- case 'update-state':
45
- updateState(cwd, raw, args.slice(1).filter(a => a !== '--raw'));
46
- break;
47
- case 'sync-github':
48
- syncStory(cwd, raw, args.slice(1).filter(a => a !== '--raw'));
49
- break;
50
- case 'resolve-model': {
51
- const agentType = args[1];
35
+ runSkillScript({
36
+ init: cmdInit,
37
+ 'update-state': (cwd, raw, args) => updateState(cwd, raw, args),
38
+ 'sync-github': (cwd, raw, args) => syncStory(cwd, raw, args),
39
+ 'resolve-model': (cwd, raw, args, parsed) => {
40
+ const agentType = parsed._positional || args[0];
52
41
  if (!agentType) error('resolve-model requires agent-type argument');
53
42
  const model = resolveModel(cwd, agentType);
54
43
  output({ model, agent: agentType }, raw, model);
55
- break;
56
- }
57
- case 'generate-slug': {
58
- const text = args.slice(1).filter(a => a !== '--raw').join(' ');
44
+ },
45
+ 'generate-slug': (cwd, raw, args, parsed) => {
46
+ const text = parsed._positional || args.join(' ');
59
47
  if (!text) error('generate-slug requires text argument');
60
48
  const slug = generateSlug(text);
61
49
  output({ slug }, raw, slug);
62
- break;
63
- }
64
- case 'resolve-fields':
65
- resolveFields(cwd, raw, args.slice(1).filter(a => a !== '--raw'));
66
- break;
67
- case 'create-issue':
68
- createIssue(cwd, raw, args.slice(1).filter(a => a !== '--raw'));
69
- break;
70
- default:
71
- error(`Unknown command: ${cmd}\nAvailable: init, update-state, sync-github, resolve-model, generate-slug, resolve-fields, create-issue`);
72
- }
50
+ },
51
+ 'resolve-fields': (cwd, raw, args) => resolveFields(cwd, raw, args),
52
+ 'create-issue': (cwd, raw, args) => createIssue(cwd, raw, args),
53
+ });
73
54
 
74
55
  // ─── Init: Plan Story ────────────────────────────────────────────────────────
75
56
 
@@ -87,7 +68,7 @@ switch (cmd) {
87
68
  * initArgs: array of arguments — either a single positional path/URL,
88
69
  * or key=value pairs (story=X text=Y)
89
70
  */
90
- function cmdInit(cwd, raw, initArgs) {
71
+ function cmdInit(cwd, raw, args, parsed) {
91
72
  const config = loadConfig(cwd);
92
73
  const brownfield = detectBrownfieldStatus(cwd);
93
74
 
@@ -116,21 +97,9 @@ function cmdInit(cwd, raw, initArgs) {
116
97
  }
117
98
  const has_wiki = has_wiki_system_wide || has_wiki_subsystems;
118
99
 
119
- // ── Parse input: support both positional and key=value forms ──
120
- // Positional: script.js init path/to/story.md
121
- // Key-value: script.js init story=path/to/story.md text="some description"
122
- const hasKeyValue = initArgs.some(a => a.includes('='));
123
- let resolvedStoryParam = null;
124
- let textParam = null;
125
-
126
- if (hasKeyValue) {
127
- const kvArgs = parseKeyValueArgs(initArgs);
128
- resolvedStoryParam = kvArgs.story || null;
129
- textParam = kvArgs.text || null;
130
- } else if (initArgs.length > 0) {
131
- // Positional: treat entire arg list as the story param
132
- resolvedStoryParam = initArgs.join(' ');
133
- }
100
+ // ── Parse input from shared parsed args ──
101
+ const resolvedStoryParam = parsed.story || parsed._positional || null;
102
+ const textParam = parsed.text || null;
134
103
 
135
104
  // ── Base result (shared across all modes) ──
136
105
  const baseResult = {
@@ -125,7 +125,11 @@
125
125
 
126
126
  Minimum coverage: happy path + at least one edge case + at least one error path.
127
127
  Each scenario must be independent — no scenario depends on another's state.
128
- If more than 6-8 scenarios are needed, the story is likely too large — split it. --&gt;
128
+ If more than 6-8 scenarios are needed, the story is likely too large — split it.
129
+
130
+ FORMAT: Use ### H3 headers for scenario names and **bold** for Given/When/Then.
131
+ Do NOT wrap scenarios in fenced code blocks (no ```gherkin).
132
+ This format renders cleanly in both markdown files and GitHub issue bodies. --&gt;
129
133
 
130
134
  ### Scenario: [Short descriptive name]
131
135
 
@@ -322,6 +326,9 @@
322
326
 
323
327
  Bad: "Given the user clicks login" (action, not state)
324
328
  Good: "Given the user is on the login page"
329
+
330
+ **Formatting**: Use `### Scenario:` H3 headers and `**Given**`/`**When**`/`**Then**` bold markdown.
331
+ Do NOT use fenced code blocks (no ```gherkin). The markdown format renders in GitHub issues.
325
332
  </guideline>
326
333
 
327
334
  <guideline name="story-sizing">
@@ -25,7 +25,7 @@
25
25
  </purpose>
26
26
 
27
27
  <mandatory-context>
28
- Read all supporting resource files listed in the skill before starting.
28
+ All supporting resource files are auto-loaded in the skill prompt above. Do NOT re-read them.
29
29
  Also read any document or text passed as parameter ($ARGUMENTS).
30
30
  </mandatory-context>
31
31
 
@@ -808,6 +808,13 @@
808
808
 
809
809
  <step name="dispatch-research" order="8">
810
810
 
811
+ **YOU (the product owner) DO NOT WRITE passes 2-5 yourself.**
812
+ Your job in this step is ONLY to dispatch background agents and wait for them.
813
+ You MUST NOT write the `## Relevant Wiki` section — the wiki-mapper agent does that.
814
+ You MUST NOT write the `## Technical Solution` section — the technical-architect agent does that.
815
+ You MUST NOT create any files not specified below (no wiki-research.md, no notes.md).
816
+ If you skip a dispatch or write these sections yourself, the workflow has FAILED.
817
+
811
818
  Display:
812
819
  ```
813
820
  ┌──────────────────────────────────────────────────┐
@@ -1130,6 +1137,15 @@
1130
1137
  ```
1131
1138
  + Pass 5 complete. Technical solution appended to story file.
1132
1139
  ```
1140
+
1141
+ <!-- ── 8i: Verification — confirm all passes ran ────────────── -->
1142
+
1143
+ Read the story file and verify it contains BOTH:
1144
+ 1. A `## Relevant Wiki` section with actual wiki references (not just a placeholder)
1145
+ 2. A `## Technical Solution` section with actual technical design (not just a placeholder or reference to another file)
1146
+
1147
+ If either section is missing or still a placeholder, the pass dispatch FAILED.
1148
+ Display an error and re-dispatch the missing pass(es).
1133
1149
  </step>
1134
1150
 
1135
1151
  <!-- ══════════════════════════════════════════════════════════════════ -->
@@ -1,107 +1,120 @@
1
- ---
2
- name: research-external-solution
3
- description: COMPREHENSIVE, IN-DEPTH, CODE-LEVEL Analysis of User Story Implementation in External Repository
4
- argument-hint: "story=<file-path|github-url> external-codebase=<source-path|github-url> [external-docs=<weblink|filepath>]"
5
- disable-model-invocation: true
6
- allowed-tools: Read, Bash, Write, AskUserQuestion, Glob, Grep, WebFetch
7
- model: opus
8
- effort: max
9
- context: fork
10
- agent: ace-code-discovery-analyst
11
- ---
12
-
13
- # Research External Solution
14
-
15
- Perform a COMPREHENSIVE, IN-DEPTH, CODE-LEVEL ANALYSIS of how a specific story's functionality is implemented in an external reference system.
16
-
17
- ## When to Use
18
-
19
- - After `/ace:plan-story` -- once story requirements (pass 1-2) are complete
20
- - Anytime a story references an external system or reference implementation
21
- - When a story or feature references an external codebase to learn from
22
- - When you need to understand how an industry-standard system implements specific functionality
23
- - When you want to extract algorithms, patterns, and implementation details from reference code
24
-
25
- ## Input
26
-
27
- ### Required
28
-
29
- - **`story`** -- Story source:
30
- - **File path**: Path to a markdown file containing the story (from plan-story command)
31
- - **GitHub URL or issue number**: GitHub story reference
32
- - Must be a valid, accessible file or GitHub issue.
33
- - Contains the user story and acceptance criteria that define what to analyze.
34
- - **Requirements for the analysis are extracted from this story.**
35
- - If not valid, stop and prompt the user.
36
-
37
- - **`external-codebase`** -- Path or GitHub repo to the external industry-standard system to analyze:
38
- - If local path: Confirm folder exists and contains source code
39
- - If GitHub URL: Verify repository accessibility
40
-
41
- ### Optional
42
-
43
- - **`external-docs`** -- Link or path to external system documentation:
44
- - If weblink: Verify URL is accessible
45
- - If filepath: Verify file exists and is readable
46
- - **PREFER using context7 MCP server** when installed -- it provides up-to-date library documentation automatically.
47
-
48
- ## Environment Context (preprocessed)
49
-
50
- !`node "${CLAUDE_SKILL_DIR}/script.js" init "$ARGUMENTS" 2>/dev/null`
51
-
52
- ## Supporting Resources
53
-
54
- Read ALL of these before starting the workflow:
55
-
56
- - **Workflow**: Read [workflow.xml](workflow.xml) -- complete orchestration process with all steps
57
- - **External solution template**: Read [external-solution-template.xml](external-solution-template.xml) -- output format for the analysis
58
- - **UI formatting**: Read `${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md` -- ACE output formatting rules
59
-
60
- ## Process
61
-
62
- Use the `ace-code-discovery-analyst` agent for code discovery.
63
-
64
- The Environment Context above contains the preprocessed INIT JSON -- use it directly instead of running the init script manually. The workflow's step 1 setup can skip the init bash call since that data is already available.
65
-
66
- Read all supporting resources listed above, then execute the workflow defined in [workflow.xml](workflow.xml) end-to-end. Preserve all workflow gates (validation, approvals, commits).
67
-
68
- This is NOT a high-level overview -- it's a DEEP DIVE into:
69
- - EXACT code implementations with line-by-line analysis
70
- - COMPLETE algorithms and formulas extracted verbatim from code
71
- - ALL design patterns with actual code examples
72
- - EVERY file, function, and constant involved in the story
73
- - FULL execution paths traced 5+ levels deep minimum
74
-
75
- All output is written ONLY to the analysis file -- no GitHub updates, no modifications to the story file.
76
-
77
- ## Artifacts
78
-
79
- ```
80
- .ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/external-analysis.md
81
- ```
82
-
83
- ## Example Usage
84
-
85
- ```
86
- # Example with file path story and GitHub external repo
87
- /ace:research-external-solution \
88
- story=.ace/artifacts/product/e1-auth/f3-oauth/s1-buttons/s1-buttons.md \
89
- external-codebase=https://github.com/tradingview/lightweight-charts \
90
- external-docs=https://tradingview.github.io/lightweight-charts/
91
-
92
- # Example with GitHub story and local external repo
93
- /ace:research-external-solution \
94
- story=https://github.com/owner/repo/issues/83 \
95
- external-codebase=src/external/lightweight-charts/
96
-
97
- # Example with context7 (no external-docs needed)
98
- /ace:research-external-solution \
99
- story=.ace/artifacts/product/e1-charts/f2-rendering/s3-canvas/s3-canvas.md \
100
- external-codebase=https://github.com/tradingview/lightweight-charts
101
- ```
102
-
103
- ## Next Steps
104
-
105
- - Continue with story refinement -- integration analysis (pass 4) and technical solution (pass 5)
106
- - `/ace:research-external-solution story=... external-codebase=...` -- Analyze another story
107
- - `/ace:help` -- Check project initialization status
1
+ ---
2
+ name: research-external-solution
3
+ description: COMPREHENSIVE, IN-DEPTH, CODE-LEVEL Analysis of User Story Implementation in External Repository
4
+ argument-hint: "story=<file-path|github-url> external-codebase=<source-path|github-url> [external-docs=<weblink|filepath>]"
5
+ disable-model-invocation: true
6
+ allowed-tools: Read, Bash, Write, AskUserQuestion, Glob, Grep, WebFetch
7
+ model: opus
8
+ effort: max
9
+ context: fork
10
+ agent: ace-code-discovery-analyst
11
+ ---
12
+
13
+ ## Environment Context (preprocessed)
14
+
15
+ !`node "${CLAUDE_SKILL_DIR}/script.js" init "$ARGUMENTS" 2>/dev/null`
16
+
17
+ ## Supporting Resources (auto-loaded)
18
+
19
+ !`cat "${CLAUDE_SKILL_DIR}/workflow.xml"`
20
+
21
+ !`cat "${CLAUDE_SKILL_DIR}/external-solution-template.xml"`
22
+
23
+ !`cat "${CLAUDE_SKILL_DIR}/../../shared/utils/ui-formatting.md"`
24
+
25
+ ```xml
26
+ <command>
27
+
28
+ <execution-time>
29
+ <runs-after>
30
+ <trigger>After /ace:plan-story once story requirements (pass 1-2) are complete</trigger>
31
+ <trigger>Anytime when a story references an external system or reference implementation</trigger>
32
+ </runs-after>
33
+ <use-when>
34
+ <condition>Story or feature references an external codebase to learn from</condition>
35
+ <condition>Need to understand how an industry-standard system implements specific functionality</condition>
36
+ <condition>Want to extract algorithms, patterns, and implementation details from reference code</condition>
37
+ </use-when>
38
+ </execution-time>
39
+
40
+ <input>
41
+ <flags>
42
+ </flags>
43
+
44
+ <parameters>
45
+ <required>
46
+ <param name="story" type="file | github-url">
47
+ Story source — can be either:
48
+ - **File path**: Path to a markdown file containing the story (from plan-story command)
49
+ - **GitHub URL or issue number**: GitHub story reference
50
+ Must be a valid, accessible file or GitHub issue.
51
+ Contains the user story and acceptance criteria that define what to analyze.
52
+ **Requirements for the analysis are extracted from this story.**
53
+ If not valid, stop and prompt the user.
54
+ </param>
55
+ <param name="external-codebase" type="filepath | github-url">
56
+ Path or GitHub repo to the external industry-standard system to analyze.
57
+ - If local path: Confirm folder exists and contains source code
58
+ - If GitHub URL: Verify repository accessibility
59
+ The external repository to analyze for implementation patterns,
60
+ algorithms, formulas, and architectural decisions.
61
+ If not valid, stop and prompt the user.
62
+ </param>
63
+ </required>
64
+
65
+ <optional>
66
+ <param name="external-docs" type="weblink | filepath">
67
+ Link or path to external industry-standard system documentation.
68
+ Provides supplementary context when available.
69
+ - If weblink: Verify URL is accessible
70
+ - If filepath: Verify file exists and is readable
71
+ **PREFER using context7 MCP server** when installed — it provides
72
+ up-to-date library documentation automatically. Use context7 whenever
73
+ the external system is a known library/framework.
74
+ </param>
75
+ </optional>
76
+ </parameters>
77
+ </input>
78
+
79
+ <execution-context>
80
+ <!-- All supporting files are auto-loaded in the Supporting Resources section above.
81
+ The model does NOT need to Read these files — they are already in context. -->
82
+ </execution-context>
83
+
84
+ <output>
85
+ <objective>
86
+ Perform a COMPREHENSIVE, IN-DEPTH, CODE-LEVEL ANALYSIS of how a specific
87
+ story's functionality is implemented in an external reference system.
88
+ This is NOT a high-level overview — it's a DEEP DIVE into:
89
+ - EXACT code implementations with line-by-line analysis
90
+ - COMPLETE algorithms and formulas extracted verbatim from code
91
+ - ALL design patterns with actual code examples
92
+ - EVERY file, function, and constant involved in the story
93
+ - FULL execution paths traced 5+ levels deep minimum
94
+
95
+ The analysis ensures our implementation:
96
+ - Follows established patterns and best practices (with code proof)
97
+ - Uses exact algorithms and formulas (copied from their code)
98
+ - Maintains compatibility with industry standards (matching their APIs)
99
+
100
+ All output is written ONLY to the analysis file — no GitHub updates,
101
+ no modifications to the story file. This artifact is consumed by
102
+ pass 5 (technical solution) of the story specification pipeline.
103
+ </objective>
104
+
105
+ <artifacts>
106
+ .ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/external-analysis.md
107
+ </artifacts>
108
+ </output>
109
+
110
+ <process>
111
+ For this command use the `ace-code-discovery-analyst` agent
112
+ that's specialized in code discovery.
113
+
114
+ Execute the research-external-solution workflow from
115
+ `workflow.xml` end-to-end.
116
+ Preserve all workflow gates (validation, approvals, commits).
117
+ </process>
118
+
119
+ <example-usage>
120
+ ```