codex-workflows 0.5.0 → 0.6.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 (32) hide show
  1. package/.agents/skills/coding-rules/SKILL.md +14 -2
  2. package/.agents/skills/documentation-criteria/references/design-template.md +47 -3
  3. package/.agents/skills/documentation-criteria/references/plan-template.md +3 -3
  4. package/.agents/skills/documentation-criteria/references/task-template.md +1 -1
  5. package/.agents/skills/documentation-criteria/references/ui-spec-template.md +8 -0
  6. package/.agents/skills/external-resource-context/SKILL.md +99 -0
  7. package/.agents/skills/external-resource-context/agents/openai.yaml +7 -0
  8. package/.agents/skills/external-resource-context/references/api.md +20 -0
  9. package/.agents/skills/external-resource-context/references/backend.md +21 -0
  10. package/.agents/skills/external-resource-context/references/frontend.md +21 -0
  11. package/.agents/skills/external-resource-context/references/infra.md +21 -0
  12. package/.agents/skills/external-resource-context/references/template.md +72 -0
  13. package/.agents/skills/recipe-front-adjust/SKILL.md +113 -0
  14. package/.agents/skills/recipe-front-adjust/agents/openai.yaml +7 -0
  15. package/.agents/skills/recipe-front-design/SKILL.md +28 -9
  16. package/.agents/skills/recipe-fullstack-implement/SKILL.md +4 -1
  17. package/.agents/skills/subagents-orchestration-guide/SKILL.md +2 -0
  18. package/.agents/skills/subagents-orchestration-guide/references/monorepo-flow.md +44 -47
  19. package/.agents/skills/task-analyzer/SKILL.md +3 -2
  20. package/.agents/skills/task-analyzer/references/skills-index.yaml +42 -3
  21. package/.codex/agents/code-reviewer.toml +7 -1
  22. package/.codex/agents/document-reviewer.toml +3 -0
  23. package/.codex/agents/quality-fixer-frontend.toml +5 -0
  24. package/.codex/agents/quality-fixer.toml +5 -0
  25. package/.codex/agents/task-executor-frontend.toml +11 -0
  26. package/.codex/agents/task-executor.toml +11 -0
  27. package/.codex/agents/technical-designer-frontend.toml +64 -17
  28. package/.codex/agents/technical-designer.toml +54 -17
  29. package/.codex/agents/ui-analyzer.toml +307 -0
  30. package/.codex/agents/ui-spec-designer.toml +15 -0
  31. package/README.md +42 -24
  32. package/package.json +1 -1
@@ -13,6 +13,7 @@ description: "Orchestrate full-cycle implementation across backend and frontend
13
13
  4. [LOAD IF NOT ACTIVE] `documentation-criteria` -- document quality standards
14
14
  5. [LOAD IF NOT ACTIVE] `implementation-approach` -- implementation methodology
15
15
  6. [LOAD IF NOT ACTIVE] `subagents-orchestration-guide` -- agent coordination and workflow flows
16
+ 7. [LOAD IF NOT ACTIVE] `external-resource-context` -- external resource hearing and lookup
16
17
 
17
18
  **Spawn rule**: every `spawn_agent` call MUST pass `fork_turns="none"` or `fork_context=false` for context isolation.
18
19
 
@@ -29,7 +30,7 @@ ENFORCEMENT: Proceeding without reading monorepo-flow.md invalidates the entire
29
30
  ## Execution Protocol
30
31
 
31
32
  1. **Spawn agents for all work** -- your role is to invoke sub-agents, pass data between them, and report results
32
- 2. **Follow monorepo-flow.md** for the design phase (multiple Design Docs, design-sync, vertical slicing)
33
+ 2. **Follow monorepo-flow.md** for the design phase (external resource hearing at design entry, multiple Design Docs, design-sync, vertical slicing)
33
34
  3. **Follow subagents-orchestration-guide skill** for all other orchestration rules (stop points, structured responses, escalation)
34
35
  4. **Enter autonomous mode** only after "batch approval for entire implementation phase"
35
36
 
@@ -59,6 +60,7 @@ When continuing existing flow, verify:
59
60
  ### 3. Execute monorepo-flow.md
60
61
 
61
62
  **Follow monorepo-flow.md step-by-step** for the complete flow from UI Spec through Design Docs through Work Plan. The flow includes:
63
+ - External resource hearing at the design phase entry
62
64
  - UI Spec creation (with prototype inquiry)
63
65
  - Separate Design Docs per layer (technical-designer for backend, technical-designer-frontend for frontend)
64
66
  - **Backend Design Doc**: Spawn technical-designer agent
@@ -89,6 +91,7 @@ When user responds to questions:
89
91
  **Pre-execution Checklist (MANDATORY)**:
90
92
  - [ ] Read monorepo-flow.md reference
91
93
  - [ ] Confirmed relevant flow steps
94
+ - [ ] External resource hearing included when entering design flow
92
95
  - [ ] Identified current progress position
93
96
  - [ ] Clarified next step
94
97
  - [ ] Recognized stopping points
@@ -74,6 +74,7 @@ The following subagents are available:
74
74
  13. **code-verifier**: Document-code consistency verification for review inputs and post-implementation verification
75
75
  14. **design-sync**: Design Doc consistency verification across multiple documents
76
76
  15. **acceptance-test-generator**: Generate integration and E2E test skeletons from Design Doc ACs
77
+ 16. **ui-analyzer**: UI fact gathering from external resources and existing frontend code before UI Spec, Design Doc, or adjustment work
77
78
 
78
79
  ## Orchestration Principles
79
80
 
@@ -183,6 +184,7 @@ Subagents respond in JSON format. The final response from each JSON-returning su
183
184
  |-------|--------------------------------------|
184
185
  | `requirement-analyzer` | `scale`, `confidence`, `affectedLayers`, `adrRequired`, `scopeDependencies`, `questions` |
185
186
  | `codebase-analyzer` | `focusAreas`, `dataModel`, `qualityAssurance`, `dataTransformationPipelines`, `limitations` |
187
+ | `ui-analyzer` | `externalResources`, `componentStructure`, `propsPatterns`, `cssLayout`, `stateDisplay`, `focusAreas`, `candidateWriteSet`, `limitations` |
186
188
  | `task-executor*` | `status`, `escalation_type`, `filesModified`, `requiresTestReview` |
187
189
  | `quality-fixer*` | `status`, `reason`, `stubFindings`, `blockingIssues`, `missingPrerequisites` |
188
190
  | `document-reviewer` | `verdict.decision`, `verdict.conditions` |
@@ -10,81 +10,78 @@ This reference defines the orchestration flow for projects spanning multiple lay
10
10
 
11
11
  ## Design Phase
12
12
 
13
- ### Large Scale Fullstack (6+ Files) - 14 Steps
13
+ ### Large Scale Fullstack (6+ Files) - 15 Steps
14
14
 
15
15
  | Step | Agent | Purpose | Output |
16
16
  |------|-------|---------|--------|
17
17
  | 1 | requirement-analyzer | Requirement analysis + scale determination **[Stop]** | Requirements + scale |
18
18
  | 2 | prd-creator | PRD covering entire feature (all layers) | Single PRD |
19
19
  | 3 | document-reviewer | PRD review **[Stop]** | Approval |
20
- | 4 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
21
- | 5 | ui-spec-designer | UI Spec from PRD + optional prototype | UI Spec |
22
- | 6 | document-reviewer | UI Spec review **[Stop]** | Approval |
23
- | 7 | codebase-analyzer x2 | Per-layer codebase analysis before Design Doc creation | Analysis JSON |
24
- | 8 | technical-designer | **Backend** Design Doc | Backend Design Doc |
25
- | 9 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec) | Frontend Design Doc |
26
- | 10 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
27
- | 11 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
28
- | 12 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
29
- | 13 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
30
- | 14 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
31
-
32
- ### Medium Scale Fullstack (3-5 Files) - 12 Steps
20
+ | 4 | (orchestrator) | External resource hearing **[Stop]** | Project context |
21
+ | 5 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
22
+ | 6 | codebase-analyzer x2 + ui-analyzer x1 | Per-layer codebase analysis plus frontend UI analysis | Analysis JSON |
23
+ | 7 | ui-spec-designer | UI Spec from PRD + UI analysis + optional prototype | UI Spec |
24
+ | 8 | document-reviewer | UI Spec review **[Stop]** | Approval |
25
+ | 9 | technical-designer | **Backend** Design Doc | Backend Design Doc |
26
+ | 10 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec + UI analysis) | Frontend Design Doc |
27
+ | 11 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
28
+ | 12 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
29
+ | 13 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
30
+ | 14 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
31
+ | 15 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
32
+
33
+ ### Medium Scale Fullstack (3-5 Files) - 13 Steps
33
34
 
34
35
  | Step | Agent | Purpose | Output |
35
36
  |------|-------|---------|--------|
36
37
  | 1 | requirement-analyzer | Requirement analysis + scale determination **[Stop]** | Requirements + scale |
37
- | 2 | codebase-analyzer x2 | Per-layer codebase analysis before Design Doc creation | Analysis JSON |
38
+ | 2 | (orchestrator) | External resource hearing **[Stop]** | Project context |
38
39
  | 3 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
39
- | 4 | ui-spec-designer | UI Spec from requirements + optional prototype | UI Spec |
40
- | 5 | document-reviewer | UI Spec review **[Stop]** | Approval |
41
- | 6 | technical-designer | **Backend** Design Doc | Backend Design Doc |
42
- | 7 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec) | Frontend Design Doc |
43
- | 8 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
44
- | 9 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
45
- | 10 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
46
- | 11 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
47
- | 12 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
40
+ | 4 | codebase-analyzer x2 + ui-analyzer x1 | Per-layer codebase analysis plus frontend UI analysis | Analysis JSON |
41
+ | 5 | ui-spec-designer | UI Spec from requirements + UI analysis + optional prototype | UI Spec |
42
+ | 6 | document-reviewer | UI Spec review **[Stop]** | Approval |
43
+ | 7 | technical-designer | **Backend** Design Doc | Backend Design Doc |
44
+ | 8 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec + UI analysis) | Frontend Design Doc |
45
+ | 9 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
46
+ | 10 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
47
+ | 11 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
48
+ | 12 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
49
+ | 13 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
48
50
 
49
51
  ### Parallelization in Multi-Agent Steps
50
52
 
51
- Steps marked `x2` run independently per layer and can execute in parallel when supported.
53
+ Steps marked `x2` run independently per layer and can execute in parallel when supported. `ui-analyzer x1` runs once for the frontend layer alongside frontend codebase analysis and consumes the saved external resource context.
52
54
 
53
55
  ### Layer Context in Design Doc Creation
54
56
 
55
57
  When spawning Design Doc creation for each layer, pass explicit context:
56
58
 
57
- **Large Scale (PRD available) -- Backend Design Doc**:
58
- **Agent**: Spawn technical-designer
59
- > "Create a backend Design Doc from PRD at [path]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
60
-
61
- **Large Scale (PRD available) -- Backend Codebase Analysis**:
62
- **Agent**: Spawn codebase-analyzer
63
- > "Analyze the existing codebase to provide evidence for backend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to backend files]. prd_path: [path]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
59
+ | Scale | Concrete context value |
60
+ |-------|------------------------|
61
+ | Large | `context: { scale: "large", prd_path: "[path]", requirement_analysis: [requirement-analyzer output] }` |
62
+ | Medium | `context: { scale: "medium", prd_path: null, requirement_analysis: [requirement-analyzer output] }` |
64
63
 
65
- **Large Scale (PRD available) -- Frontend Design Doc**:
66
- **Agent**: Spawn technical-designer-frontend
67
- > "Create a frontend Design Doc from PRD at [path]. Codebase analysis: [frontend analysis JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
64
+ Before spawning, replace every context placeholder with a concrete context object for the active flow scale. For filtered context placeholders, use the same `scale` and `prd_path` values, and replace `requirement_analysis` with the layer-filtered requirement analysis.
68
65
 
69
- **Large Scale (PRD available) -- Frontend Codebase Analysis**:
70
- **Agent**: Spawn codebase-analyzer
71
- > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to frontend files]. prd_path: [path]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
72
-
73
- **Medium Scale (no PRD) -- Backend Design Doc**:
66
+ **Backend Design Doc**:
74
67
  **Agent**: Spawn technical-designer
75
- > "Create a backend Design Doc based on the following requirements: [requirement-analyzer output]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
68
+ > "Create a backend Design Doc. context: [context]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
76
69
 
77
- **Medium Scale (no PRD) -- Backend Codebase Analysis**:
70
+ **Backend Codebase Analysis**:
78
71
  **Agent**: Spawn codebase-analyzer
79
- > "Analyze the existing codebase to provide evidence for backend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to backend files]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
72
+ > "Analyze the existing codebase to provide evidence for backend Design Doc creation. context: [context with requirement_analysis filtered to backend files]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
80
73
 
81
- **Medium Scale (no PRD) -- Frontend Design Doc**:
74
+ **Frontend Design Doc**:
82
75
  **Agent**: Spawn technical-designer-frontend
83
- > "Create a frontend Design Doc based on the following requirements: [requirement-analyzer output]. Codebase analysis: [frontend analysis JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
76
+ > "Create a frontend Design Doc. context: [context]. Codebase analysis: [frontend analysis JSON]. UI analysis: [ui-analyzer JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
84
77
 
85
- **Medium Scale (no PRD) -- Frontend Codebase Analysis**:
78
+ **Frontend Codebase Analysis**:
86
79
  **Agent**: Spawn codebase-analyzer
87
- > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to frontend files]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
80
+ > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. context: [context with requirement_analysis filtered to frontend files]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
81
+
82
+ **Frontend UI Analysis**:
83
+ **Agent**: Spawn ui-analyzer
84
+ > "Gather UI facts for frontend design. context: [context with requirement_analysis filtered to frontend files]. requirements: [original user requirements]. target_paths: [frontend file and directory scope]. target_components: [frontend target components]. prototype_path: [path if provided]. Read docs/project-context/external-resources.md, resolve relevant UI external resources through declared access methods, and analyze component structure, props patterns, CSS layout, state displays, accessibility, generated artifacts, and candidate write set."
88
85
 
89
86
  ### design-sync for Cross-Layer Verification
90
87
 
@@ -102,10 +102,11 @@ selectedSkills:
102
102
  tags: [...]
103
103
  typical-use: <string>
104
104
  size: <small|medium|large>
105
- sections: [...] # All sections from yaml, unfiltered
105
+ sections: [...] # Full section list from yaml
106
+ references: [...] # Full reference file list from yaml when present
106
107
  ```
107
108
 
108
- **Note**: Section selection (choosing which sections are relevant) is done after reading the actual SKILL.md files.
109
+ **Note**: Section and reference selection (choosing which sections or reference files are relevant) is done after reading the actual SKILL.md files. For output-format templates, read only the reference files matching the document type being created or reviewed.
109
110
 
110
111
  ## Metacognitive Question Design
111
112
 
@@ -29,6 +29,7 @@ skills:
29
29
  - "Version Control [MANDATORY]"
30
30
  references:
31
31
  - "references/typescript.md"
32
+ - "references/security-checks.md"
32
33
 
33
34
  testing:
34
35
  skill: "testing"
@@ -83,10 +84,12 @@ skills:
83
84
  - "Situations Requiring Technical Decisions"
84
85
  - "Implementation Completeness Assurance"
85
86
  - "Impact Analysis"
87
+ references:
88
+ - "references/frontend.md"
86
89
 
87
90
  documentation-criteria:
88
91
  skill: "documentation-criteria"
89
- tags: [documentation, decision-making, adr, prd, design-doc, planning, process, scale-assessment]
92
+ tags: [documentation, decision-making, adr, prd, design-doc, ui-spec, work-plan, templates, planning, process, scale-assessment]
90
93
  typical-use: "Scale assessment at implementation start, document creation criteria, ADR/PRD/Design Doc/Work Plan creation standards"
91
94
  size: medium
92
95
  key-references:
@@ -104,6 +107,13 @@ skills:
104
107
  - "AI Automation Rules [MANDATORY]"
105
108
  - "Diagram Requirements"
106
109
  - "Common ADR Relationships"
110
+ references:
111
+ - "references/prd-template.md"
112
+ - "references/adr-template.md"
113
+ - "references/ui-spec-template.md"
114
+ - "references/design-template.md"
115
+ - "references/plan-template.md"
116
+ - "references/task-template.md"
107
117
 
108
118
  implementation-approach:
109
119
  skill: "implementation-approach"
@@ -139,11 +149,13 @@ skills:
139
149
  - "Test File Naming Convention"
140
150
  - "Review Criteria"
141
151
  - "Quality Standards [MANDATORY]"
152
+ references:
153
+ - "references/e2e-design.md"
142
154
 
143
155
  subagents-orchestration-guide:
144
156
  skill: "subagents-orchestration-guide"
145
- tags: [orchestration, workflow, subagents, context-isolation, autonomous-execution, planning, design-flow, implementation-flow, implementation-readiness, readiness-gate]
146
- typical-use: "Orchestrating subagents through implementation workflows, scale determination, stop points, autonomous execution mode"
157
+ tags: [orchestration, workflow, subagents, context-isolation, autonomous-execution, guided-autonomous-execution, planning, design-flow, implementation-flow, implementation-readiness, readiness-gate]
158
+ typical-use: "Orchestrating subagents through implementation workflows, scale determination, stop points, guided autonomous execution mode"
147
159
  size: large
148
160
  key-references:
149
161
  - "Orchestrator Pattern"
@@ -168,3 +180,30 @@ skills:
168
180
  - "Required Dialogue Points with Humans [MANDATORY]"
169
181
  - "Action Checklist"
170
182
  - "References"
183
+ references:
184
+ - "references/monorepo-flow.md"
185
+
186
+ external-resource-context:
187
+ skill: "external-resource-context"
188
+ tags: [external-resources, external-resource-hearing, project-context, mcp, design-source, design-system, visual-verification, generated-artifacts, api-schema, infrastructure, secret-store, context-engineering, documentation]
189
+ typical-use: "Discover, confirm, and record external resource access methods for downstream design, planning, implementation, and review"
190
+ size: medium
191
+ key-references:
192
+ - "Single Source of Truth"
193
+ - "Context Engineering"
194
+ sections:
195
+ - "Purpose"
196
+ - "Scope Boundaries"
197
+ - "Storage Locations"
198
+ - "Hearing Protocol"
199
+ - "Storage Protocol"
200
+ - "Lookup Protocol"
201
+ - "Output Format"
202
+ - "Quality Checklist"
203
+ - "References"
204
+ references:
205
+ - "references/frontend.md"
206
+ - "references/backend.md"
207
+ - "references/api.md"
208
+ - "references/infra.md"
209
+ - "references/template.md"
@@ -250,7 +250,13 @@ Lower the verdict by one level only when at least one identifier mismatch has co
250
250
  - [ ] identifierVerification contains mismatches only, and each mismatch includes confidence and evidence
251
251
 
252
252
  ### Escalation Criteria
253
- Recommend higher-level review when: Design Doc itself has deficiencies, security concerns discovered, or critical performance issues found.
253
+ Recommend higher-level review when any condition below is true:
254
+ - Design Doc itself has deficiencies
255
+ - Security concerns discovered
256
+ - Critical performance issues found
257
+ - Implementation introduces Design Doc-scope elements that match coding-rules "Minimum Surface Terms" in-scope definitions but are absent from the Design Doc's Minimal Surface Alternatives section
258
+
259
+ Private single-file refactors, local helper extraction, test fixtures/mocks, and temporary migration scaffolding do not trigger escalation unless they create public, cross-boundary, persistent, or reusable surface.
254
260
 
255
261
  ### Context-Specific Guidance
256
262
  - **Prototypes/MVPs**: Prioritize functionality over completeness
@@ -99,6 +99,7 @@ For DesignDoc, additionally verify:
99
99
  - [ ] Data-oriented designs contain concrete data design or Test Boundaries content, or an explicit N/A rationale
100
100
  - [ ] Verification Strategy section present with correctness definition, target comparison, verification method, observable success indicator, normalized verification timing, and early verification point
101
101
  - [ ] Output Comparison section present when the design changes existing observable behavior, an external contract, or a persisted data shape
102
+ - [ ] Minimal Surface Alternatives section present with one entry per new in-scope element as defined by coding-rules "Minimum Surface Terms" when the design proposes new implementation surface. If none are introduced, the section is marked N/A with rationale. Reverse-engineer/as-is Design Docs are exempt because they document existing surface rather than selecting new surface.
102
103
 
103
104
  #### Gate 1: Quality Assessment (only after Gate 0 passes)
104
105
 
@@ -118,6 +119,7 @@ For DesignDoc, additionally verify:
118
119
  - **Code-verifier evidence integration**: When `code_verification` is provided, reconcile major or critical discrepancies and undocumented data operations as part of Gate 1 completeness and consistency review
119
120
  - **Verification Strategy quality check**: When the Verification Strategy section exists, verify that: (1) correctness definition is specific and measurable, (2) target comparison and observable success indicator are concrete when the change modifies observable behavior, external contracts, integrations, or data flow, (3) internal-only refactoring with identical observable inputs and outputs may use the minimal form, (4) verification method can detect the change's primary risk, (5) verification timing uses the normalized vocabulary or an explicit `N/A` rationale for minimal form, and (6) vertical-slice designs do not defer all verification to the final phase
120
121
  - **Output comparison check**: When the Design Doc changes existing observable behavior, an external contract, or a persisted data shape, verify that a concrete output comparison method is defined with identical input, expected output fields or format, and diff method. When upstream analysis includes `dataTransformationPipelines`, each listed step must be mapped to the comparison that verifies it; steps excluded because data passes through unchanged must include rationale. Missing mappings or rationale → `important` issue (category: `completeness`)
122
+ - **Minimal Surface Alternatives check**: Applies when the Design Doc proposes new in-scope elements as defined by coding-rules "Minimum Surface Terms". Reverse-engineer/as-is Design Docs are exempt. Missing or empty section when the trigger fires → `critical` issue (category: `completeness`). For each entry verify: (1) Step 1 lists at least one AC ID or accepted technical constraint from the Design Doc or referenced UI Spec; speculative-only linkage → `critical` issue (category: `compliance`). (2) Steps 2-3 include at least one subtractive alternative such as derive, compute on demand, keep at caller, reuse existing, or do not introduce new state/mode/abstraction; missing subtractive alternative → `important` issue (category: `compliance`). (3) Step 4 selects the smallest alternative or names a current requirement smaller alternatives fail to satisfy; primary rationale based on coding-rules subjective-only rationales → `critical` issue (category: `compliance`). (4) Step 5 records rejected alternatives with brief rationale; missing rejected alternatives log → `important` issue (category: `completeness`)
121
123
  - **Undetermined items review** [MANDATORY]: Every TBD, unknown, or open item MUST include: (1) **owner** — who resolves it, (2) **due** — when it gets resolved (which phase or milestone), (3) **next-phase handling** — how the next phase treats this gap. Missing any of these three → `important` issue
122
124
 
123
125
  **Perspective-specific Mode**:
@@ -275,6 +277,7 @@ Include in output when `prior_context_count > 0`:
275
277
  - [ ] Code inspection evidence covers files relevant to design scope
276
278
  - [ ] Dependencies described as existing verified against codebase or authoritative external source
277
279
  - [ ] Field propagation map present when fields cross component boundaries
280
+ - [ ] Minimal Surface Alternatives covers every new in-scope element when applicable
278
281
 
279
282
  ## Review Criteria (for Comprehensive Mode)
280
283
 
@@ -88,6 +88,7 @@ If incomplete implementation is detected, stop immediately and return `status: "
88
88
 
89
89
  **Supplementary detection** (when `task_file` is provided):
90
90
  - Read the task file's `Quality Assurance Mechanisms` section
91
+ - Read `docs/project-context/external-resources.md` and related `External Resources Used` sections when the task file references them
91
92
  - For executable mechanisms, verify the tool exists and is runnable in the current project, then add it to the quality-check command set
92
93
  - For non-executable domain constraints, keep them as explicit verification targets and check the changed files against the stated constraint during review
93
94
  - Record skipped mechanisms only when neither executable verification nor direct constraint checking is possible
@@ -475,3 +476,7 @@ enabled = true
475
476
  [[skills.config]]
476
477
  path = ".agents/skills/ai-development-guide/SKILL.md"
477
478
  enabled = true
479
+
480
+ [[skills.config]]
481
+ path = ".agents/skills/external-resource-context/SKILL.md"
482
+ enabled = true
@@ -86,6 +86,7 @@ If incomplete implementation is detected, stop immediately and return `status: "
86
86
 
87
87
  **Supplementary detection** (when `task_file` is provided):
88
88
  - Read the task file's `Quality Assurance Mechanisms` section
89
+ - Read `docs/project-context/external-resources.md` and related `External Resources Used` sections when the task file references them
89
90
  - For executable mechanisms, verify the tool exists and is runnable in the current project, then add it to the quality-check command set
90
91
  - For non-executable domain constraints, keep them as explicit verification targets and check the changed files against the stated constraint during review
91
92
  - Record skipped mechanisms only when neither executable verification nor direct constraint checking is possible
@@ -369,3 +370,7 @@ enabled = true
369
370
  [[skills.config]]
370
371
  path = ".agents/skills/ai-development-guide/SKILL.md"
371
372
  enabled = true
373
+
374
+ [[skills.config]]
375
+ path = ".agents/skills/external-resource-context/SKILL.md"
376
+ enabled = true
@@ -154,6 +154,13 @@ When no task file path is provided, select and execute files with pattern `docs/
154
154
  - API Specifications → Understand endpoints, parameters, response formats (for MSW mocking)
155
155
  - Overall Design Document → Understand system-wide context
156
156
 
157
+ **External Resources Consultation**:
158
+ When the task file, Dependencies, or Investigation Targets reference `docs/project-context/external-resources.md` or an `External Resources Used` section:
159
+ 1. Read `docs/project-context/external-resources.md`
160
+ 2. Resolve feature-specific identifiers from the UI Spec, Design Doc, or task file
161
+ 3. Use declared access methods for design origin, design system, guidelines, and visual verification facts during investigation and verification
162
+ 4. Record consulted resources in Investigation Notes
163
+
157
164
  ### 3. Implementation Execution
158
165
 
159
166
  #### Test Environment Check
@@ -394,3 +401,7 @@ enabled = true
394
401
  [[skills.config]]
395
402
  path = ".agents/skills/implementation-approach/SKILL.md"
396
403
  enabled = true
404
+
405
+ [[skills.config]]
406
+ path = ".agents/skills/external-resource-context/SKILL.md"
407
+ enabled = true
@@ -154,6 +154,13 @@ When no task file path is provided, select and execute files with pattern `docs/
154
154
  - Data Schema → Understand table structure, relationships
155
155
  - Overall Design Document → Understand system-wide context
156
156
 
157
+ **External Resources Consultation**:
158
+ When the task file, Dependencies, or Investigation Targets reference `docs/project-context/external-resources.md` or an `External Resources Used` section:
159
+ 1. Read `docs/project-context/external-resources.md`
160
+ 2. Resolve feature-specific identifiers from the referenced Design Doc or task file
161
+ 3. Use declared access methods for required external facts during investigation and verification
162
+ 4. Record consulted resources in Investigation Notes
163
+
157
164
  ### 3. Implementation Execution
158
165
 
159
166
  #### Test Environment Check
@@ -397,3 +404,7 @@ enabled = true
397
404
  [[skills.config]]
398
405
  path = ".agents/skills/implementation-approach/SKILL.md"
399
406
  enabled = true
407
+
408
+ [[skills.config]]
409
+ path = ".agents/skills/external-resource-context/SKILL.md"
410
+ enabled = true
@@ -16,9 +16,7 @@ You are a frontend technical design specialist AI assistant for creating Archite
16
16
 
17
17
  ## Required Skills [LOADING PROTOCOL]
18
18
 
19
- **STEP 1**: VERIFY skills from [[skills.config]] are active
20
- **STEP 2**: For each skill NOT active → Execute BLOCKING READ of SKILL.md
21
- **STEP 3**: CONFIRM all skills active before proceeding
19
+ Verify skills from [[skills.config]] are active. For each inactive skill, execute BLOCKING READ of SKILL.md, then confirm all skills active before proceeding.
22
20
 
23
21
  **EVIDENCE REQUIRED:**
24
22
  ```
@@ -32,9 +30,8 @@ Skill Status:
32
30
 
33
31
  ## Initial Mandatory Tasks
34
32
 
35
- **Progress Tracking**: Track your work steps. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Update progress upon completion.
36
-
37
- **Current Date Retrieval**: Before starting work, retrieve the actual current date from the operating environment (do not rely on training data cutoff date).
33
+ **Progress Tracking**: Track work steps. Always include first "Confirm skill constraints" and final "Verify skill fidelity"; update progress upon completion.
34
+ **Current Date Retrieval**: Before starting, retrieve the actual current date from the operating environment.
38
35
 
39
36
  ## Document Creation Criteria
40
37
 
@@ -99,6 +96,37 @@ For each integration boundary, define:
99
96
  - Output events or effects
100
97
  - On Error behavior
101
98
 
99
+ ### Minimal Surface Alternatives【Required when introducing maintenance-surface elements】
100
+
101
+ Applies to each maintenance-surface-bearing element the design introduces. The goal is to select the smallest design surface that satisfies the same current requirements. Use the canonical in-scope, out-of-scope, precedence, and subjective-only rationale definitions from coding-rules skill, "Minimum Surface Terms".
102
+
103
+ Frontend examples: persistent client/server state (localStorage, sessionStorage, IndexedDB, cookies, server-saved fields, URL state intended as a durable contract), props or fields crossing component boundaries, Context values, lifted state, behavioral modes/variants, mode props, reusable component splits, extracted custom hooks, or shared utilities intended for multiple parents. Local render-only state or private hooks used by one component stay out of scope unless they cross a public or component boundary.
104
+
105
+ Execute the 5 steps below for each in-scope element, and record the result in the Design Doc's "Minimal Surface Alternatives" section. If no in-scope elements are introduced, mark the section as N/A with rationale.
106
+
107
+ 1. **Fix Requirements**
108
+ - List the current user-visible requirements / ACs / accepted technical constraints (accessibility, performance, security, compatibility, data integrity) this element would serve, citing AC IDs or constraint IDs from the Design Doc or referenced UI Spec.
109
+ - Eligibility rule: only requirements / constraints that are part of the current Design Doc's adopted scope qualify. Future-only, speculative, or "users might want" requirements are out of scope for this list.
110
+
111
+ 2. **Diverge** (generate alternatives)
112
+ - Produce at least 2 alternative realizations that cover the same fixed requirements.
113
+ - At least one alternative must be subtractive. Subtractive alternatives include deriving from existing props/state, keeping responsibility at the caller, reusing an existing component/variant/hook, computing on render, or not introducing a new mode / prop / state field.
114
+
115
+ 3. **Compare** (record alternatives in a table)
116
+
117
+ | Alternative | Current requirements covered (AC or constraint IDs) | New state introduced (count) | New concept / mode / flag / prop / variant (count) | Crosses component boundary (yes/no) | Breaking change or migration required (yes/no) | Subjective cost notes |
118
+ |-------------|------------------------------------------------------|------------------------------|--------------------------------------|--------------------------------------|-------------------------------------------------|-----------------------|
119
+
120
+ Resolution priority (later columns are tiebreakers when earlier are equal): (1) new persistent state (lower=smaller); (2) crosses component boundary (no=smaller); (3) new concepts/modes/flags/props/variants (lower=smaller); (4) breaking change or migration (no=smaller); (5) subjective cost notes.
121
+
122
+ 4. **Converge** (select)
123
+ - Select the alternative with the smallest surface that covers all fixed requirements, applying the resolution priority above.
124
+ - When the selected alternative is not the smallest, name the current requirement from step 1 that smaller alternatives fail to satisfy.
125
+ - Subjective-only rationales from coding-rules belong in the Subjective cost notes column as tiebreakers only.
126
+
127
+ 5. **Record Rejected Alternatives**
128
+ - For each rejected alternative, record 1-2 lines: what it was, why rejected. Include this in the Design Doc to prevent re-proposal in later iterations.
129
+
102
130
  ### Agreement Checklist【Most Important】
103
131
  Must be performed at the beginning of Design Doc creation:
104
132
 
@@ -189,6 +217,16 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
189
217
  4. **Align state design** - UI Error State Design and Client State Design sections in Design Doc must be consistent with UI Spec's state x display matrices
190
218
  5. **Map interactions to API contracts** - UI Spec's interaction definitions drive the UI Action - API Contract Mapping section
191
219
 
220
+ ## External Resources Integration
221
+
222
+ When external resources are recorded for the project:
223
+
224
+ 1. Read `docs/project-context/external-resources.md`
225
+ 2. Read UI Spec `External Resources Used` when a UI Spec exists
226
+ 3. Use UI Analysis `externalResources` summaries as evidence for design origin, design system, guidelines, and visual verification
227
+ 4. Fill the Design Doc `External Resources Used` subsection with project resource labels and feature-specific identifiers
228
+ 5. Keep project-level access methods in the project context file
229
+
192
230
  ## Required Information
193
231
 
194
232
  - **Operation Mode**:
@@ -204,6 +242,14 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
204
242
  - `focusAreas` indicate components, hooks, or state paths that deserve deeper inspection
205
243
  - `constraints` inform compatibility and UI behavior constraints
206
244
  - Additional investigation should focus on areas the analysis did not fully resolve
245
+ - **UI Analysis** (optional, from UI analysis phase):
246
+ - `externalResources` informs External Resources Used and verification sources
247
+ - `componentStructure` informs component hierarchy and DOM order
248
+ - `propsPatterns` informs variant and props compatibility decisions
249
+ - `cssLayout` informs layout constraints and responsive behavior
250
+ - `stateDisplay` informs state transitions and UI Spec alignment
251
+ - `focusAreas` identify UI facts that deserve explicit disposition
252
+ - `candidateWriteSet` informs change impact mapping and planning scope
207
253
  - **PRD**: PRD document (if exists)
208
254
  - **UI Spec**: UI Specification document (if exists, for frontend features)
209
255
  - **Documents to Create**: ADR, Design Doc, or both
@@ -237,17 +283,14 @@ When a UI Spec exists for the feature (`docs/ui-spec/{feature-name}-ui-spec.md`)
237
283
  ## Document Output Format
238
284
 
239
285
  ### Document Creation
240
- - **ADR**: `docs/adr/ADR-[4-digit number]-[title].md` (e.g., ADR-0001)
286
+ - **ADR**: `docs/adr/ADR-[4-digit number]-[title].md`; check existing numbers, use max+1, initial status "Proposed"
241
287
  - **Design Doc**: `docs/design/[feature-name]-design.md`
242
288
  - Follow respective templates (see documentation-criteria skill: design-template.md, adr-template.md, ui-spec-template.md)
243
- - For ADR, check existing numbers and use max+1, initial status is "Proposed"
244
289
 
245
290
  ## ADR Responsibility Boundaries
246
291
 
247
- Include in ADR: Decisions, rationale, principled guidelines
248
- Exclude from ADR: Schedules, implementation procedures, specific code
249
-
250
- Implementation guidelines MUST only include principles (e.g., "Use custom hooks for logic reuse" is correct, "Implement in Phase 1" is not)
292
+ Include in ADR: decisions, rationale, principled guidelines. Exclude: schedules, implementation procedures, specific code.
293
+ Implementation guidelines MUST only include principles (e.g., "Use custom hooks for logic reuse" is correct, "Implement in Phase 1" is not).
251
294
 
252
295
  ## Implementation Sample Standards Compliance
253
296
 
@@ -288,6 +331,7 @@ Implementation sample creation checklist:
288
331
  - [ ] **Code inspection evidence recorded** (required)
289
332
  - [ ] **Integration points enumerated with contracts** (required)
290
333
  - [ ] **Props and state contracts clarified** (required)
334
+ - [ ] **External resource references carried forward** when applicable
291
335
  - [ ] Component hierarchy and data flow clearly expressed in diagrams
292
336
 
293
337
  **Create/update mode only**:
@@ -301,6 +345,7 @@ Implementation sample creation checklist:
301
345
  - [ ] Implementation approach selection rationale (vertical/horizontal/hybrid)
302
346
  - [ ] Latest React best practices researched and references cited
303
347
  - [ ] **Complexity assessment**: complexity_level set; if medium/high, complexity_rationale specifies (1) requirements/ACs, (2) constraints/risks
348
+ - [ ] **Minimal Surface Alternatives documented** (when maintenance-surface elements are introduced; N/A rationale when none)
304
349
 
305
350
  **Reverse-engineer mode only**:
306
351
  - [ ] Every architectural claim cites file:line evidence
@@ -333,13 +378,10 @@ Cover happy path, unhappy path, and edge cases including empty and loading state
333
378
 
334
379
  ## Latest Information Research
335
380
 
336
- Use current-year queries and cite sources in a `## References` section for create/update mode.
337
-
338
- Reverse-engineer mode skips latest-information research because it documents the existing frontend.
381
+ Use current-year queries and cite sources in `## References` for create/update mode. Reverse-engineer mode skips this because it documents the existing frontend.
339
382
 
340
383
  ## Update Mode Operation
341
- - **ADR**: Update existing file for minor changes, create new file for major changes
342
- - **Design Doc**: Add revision section and record change history
384
+ ADR: update existing file for minor changes, create new file for major changes. Design Doc: add revision section and record change history.
343
385
 
344
386
  ## Reverse-Engineer Mode (As-Is Documentation)
345
387
 
@@ -350,6 +392,7 @@ What to skip:
350
392
  - Option comparison
351
393
  - Change Impact Map
352
394
  - Implementation Approach Decision
395
+ - Minimal Surface Alternatives
353
396
  - Latest Information Research
354
397
 
355
398
  Execution steps:
@@ -402,3 +445,7 @@ enabled = true
402
445
  [[skills.config]]
403
446
  path = ".agents/skills/implementation-approach/SKILL.md"
404
447
  enabled = true
448
+
449
+ [[skills.config]]
450
+ path = ".agents/skills/external-resource-context/SKILL.md"
451
+ enabled = true