aped-method 1.8.0 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aped-method",
3
- "version": "1.8.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Scaffold the APED pipeline (Analyze, PRD, Epics, Dev, Review) into any Claude Code project",
6
6
  "bin": {
@@ -50,6 +50,26 @@ export function references(c) {
50
50
  path: `${a}/aped-ux/references/ux-patterns.md`,
51
51
  content: UX_PATTERNS,
52
52
  },
53
+ {
54
+ path: `${a}/aped-s/references/status-format.md`,
55
+ content: STATUS_FORMAT,
56
+ },
57
+ {
58
+ path: `${a}/aped-c/references/scope-change-guide.md`,
59
+ content: SCOPE_CHANGE_GUIDE,
60
+ },
61
+ {
62
+ path: `${a}/aped-ctx/references/analysis-checklist.md`,
63
+ content: ANALYSIS_CHECKLIST,
64
+ },
65
+ {
66
+ path: `${a}/aped-qa/references/test-patterns.md`,
67
+ content: TEST_PATTERNS,
68
+ },
69
+ {
70
+ path: `${a}/aped-d/references/ticket-git-workflow.md`,
71
+ content: TICKET_GIT_WORKFLOW,
72
+ },
53
73
  ];
54
74
  }
55
75
 
@@ -799,3 +819,488 @@ Rules ranked by impact. Apply in order — never skip a higher-priority rule for
799
819
  - [ ] Reduced motion and dynamic text size supported
800
820
  - [ ] ARIA roles/states announced correctly
801
821
  `;
822
+
823
+ const STATUS_FORMAT = `# Sprint Status Dashboard Format
824
+
825
+ ## Pipeline Progress Bar
826
+
827
+ Display format:
828
+ \`\`\`
829
+ Pipeline: A[✓] → P[✓] → UX[✓] → E[✓] → D[▶] → R[ ]
830
+ \`\`\`
831
+
832
+ Symbols:
833
+ - \`✓\` = phase done
834
+ - \`▶\` = phase in-progress
835
+ - \` \` = phase not started
836
+ - \`—\` = phase skipped
837
+
838
+ ## Epic Progress Bar
839
+
840
+ \`\`\`
841
+ Epic 1: {{title}} [████████░░] 80% (4/5 stories)
842
+ \`\`\`
843
+
844
+ - Bar: 10 chars wide, \`█\` for done, \`░\` for remaining
845
+ - Show fraction and percentage
846
+
847
+ ## Story Status Icons
848
+
849
+ | Status | Icon | Meaning |
850
+ |--------|------|---------|
851
+ | done | ✓ | Story completed and reviewed |
852
+ | review | ⟳ | Waiting for adversarial review |
853
+ | in-progress | ▶ | Currently being implemented |
854
+ | ready-for-dev | ○ | Ready to start |
855
+ | backlog | · | Not yet planned |
856
+ | blocked | ✗ | Blocked by issue |
857
+
858
+ ## Blocker Categories
859
+
860
+ - **[AI-Review]** items — review findings not yet addressed
861
+ - **HALT** — dev stopped due to missing config/dependency/ambiguity
862
+ - **Stuck** — in-progress for multiple sessions without progress
863
+ - **Dependency** — blocked by another story
864
+
865
+ ## Next Action Logic
866
+
867
+ | Current State | Suggestion |
868
+ |---------------|------------|
869
+ | Stories ready-for-dev | "Run /aped-d to implement next story" |
870
+ | Stories in review | "Run /aped-r to review completed story" |
871
+ | All stories done | "Pipeline complete! Run /aped-qa for E2E tests" |
872
+ | Blockers found | Describe each blocker and resolution path |
873
+ | No state file | "Run /aped-a to start the pipeline" |
874
+ `;
875
+
876
+ const SCOPE_CHANGE_GUIDE = `# Scope Change Management Guide
877
+
878
+ ## Impact Assessment Matrix
879
+
880
+ | Change Type | PRD | UX | Epics | Stories | Code | Severity |
881
+ |-------------|-----|-----|-------|---------|------|----------|
882
+ | New feature added | Add FRs | Add screens | New stories | Create | None | Minor |
883
+ | Feature removed | Remove FRs | Remove screens | Archive stories | Archive | May delete | Minor |
884
+ | FR modified | Update FR | May update | Update story ACs | Update | May refactor | Medium |
885
+ | Architecture change | Update NFRs | May rebuild | Update all Dev Notes | Reset | May rewrite | Major |
886
+ | Priority reorder | No change | No change | Reorder | Reset status | None | Minor |
887
+ | Complete pivot | Restart | Restart | Restart | Restart | Archive | Critical |
888
+
889
+ ## Change Process
890
+
891
+ ### Step 1: Document the Change
892
+ - What changed and why
893
+ - Who requested it (user, stakeholder, technical discovery)
894
+ - Date of change
895
+
896
+ ### Step 2: Impact Analysis
897
+ - List all affected artifacts (PRD sections, stories, code files)
898
+ - Classify severity (minor/medium/major/critical)
899
+ - Estimate effort to apply change
900
+
901
+ ### Step 3: User Confirmation
902
+ - Present impact summary to user
903
+ - Get explicit "proceed" before making changes
904
+ - For major/critical: warn about in-progress work loss
905
+
906
+ ### Step 4: Execute Change
907
+ - Archive affected artifacts to \`{output}/archive/{date}/\`
908
+ - Apply changes top-down (PRD → UX → Epics → Stories)
909
+ - Re-validate at each level (scripts)
910
+ - Update state.yaml
911
+
912
+ ### Step 5: Verify Consistency
913
+ - FR coverage still 100%
914
+ - No orphan stories
915
+ - No broken dependencies
916
+ - State reflects new reality
917
+
918
+ ## Scope Creep Detection
919
+
920
+ Warning signs:
921
+ - Total FRs grew >20% from original PRD
922
+ - Epic count increased
923
+ - Stories consistently exceed single-session size
924
+ - "Just one more thing" pattern repeating
925
+
926
+ Response:
927
+ - Flag to user with metrics
928
+ - Suggest moving additions to Growth phase
929
+ - Enforce MVP discipline
930
+ `;
931
+
932
+ const ANALYSIS_CHECKLIST = `# Brownfield Project Analysis Checklist
933
+
934
+ ## Phase 1: Structure Discovery
935
+
936
+ - [ ] Identify primary language(s) from config files
937
+ - [ ] Map directory structure (max 3 levels)
938
+ - [ ] Find entry points (main, index, app, server)
939
+ - [ ] Count: files, LOC, languages
940
+ - [ ] Identify package manager (npm, yarn, pnpm, cargo, pip, go mod)
941
+ - [ ] Check for monorepo structure (workspaces, packages/)
942
+
943
+ ## Phase 2: Architecture Mapping
944
+
945
+ - [ ] Identify pattern (MVC, hexagonal, microservices, monolith, serverless)
946
+ - [ ] Map data flow: entry → processing → storage → response
947
+ - [ ] List databases and data stores
948
+ - [ ] List external API integrations
949
+ - [ ] List message queues/event systems
950
+ - [ ] Identify caching layer
951
+ - [ ] Map authentication/authorization flow
952
+
953
+ ## Phase 3: Convention Extraction
954
+
955
+ - [ ] File naming convention (camelCase, kebab-case, PascalCase)
956
+ - [ ] Function/method naming convention
957
+ - [ ] Code organization (feature-based, layer-based, domain-based)
958
+ - [ ] Error handling pattern (try/catch, Result type, error codes)
959
+ - [ ] Logging approach (structured, unstructured, library used)
960
+ - [ ] Config management (env vars, .env files, config files, vault)
961
+ - [ ] Linting/formatting (ESLint, Prettier, Biome, rustfmt)
962
+
963
+ ## Phase 4: Dependency Audit
964
+
965
+ - [ ] List production dependencies with versions
966
+ - [ ] Flag outdated packages (major versions behind)
967
+ - [ ] Check for known security advisories
968
+ - [ ] Identify lock file type
969
+ - [ ] Note any vendored/bundled dependencies
970
+ - [ ] Check for deprecated packages
971
+
972
+ ## Phase 5: Testing
973
+
974
+ - [ ] Identify test framework(s)
975
+ - [ ] Estimate test coverage (file count, coverage reports)
976
+ - [ ] Check for CI/CD pipeline config
977
+ - [ ] Identify test types present (unit, integration, E2E)
978
+ - [ ] Check for test fixtures/factories/mocks
979
+
980
+ ## Output Format
981
+
982
+ \`\`\`markdown
983
+ # Project Context: {name}
984
+
985
+ ## Tech Stack
986
+ - Language: {lang} {version}
987
+ - Framework: {framework} {version}
988
+ - Database: {db}
989
+ - Test Framework: {test_fw}
990
+
991
+ ## Architecture
992
+ - Pattern: {pattern}
993
+ - Entry: {entry_point}
994
+ - Modules: {key_modules}
995
+
996
+ ## Conventions
997
+ - Files: {naming}
998
+ - Code style: {linter}
999
+ - Error handling: {pattern}
1000
+
1001
+ ## Dependencies ({count} total)
1002
+ | Package | Version | Purpose | Status |
1003
+ |---------|---------|---------|--------|
1004
+
1005
+ ## Integration Points
1006
+ | Service | Purpose | Protocol |
1007
+ |---------|---------|----------|
1008
+
1009
+ ## Notes
1010
+ - {important_context_for_dev}
1011
+ \`\`\`
1012
+ `;
1013
+
1014
+ const TEST_PATTERNS = `# E2E & Integration Test Patterns
1015
+
1016
+ ## Framework Selection
1017
+
1018
+ | Project Type | E2E Framework | Integration Framework |
1019
+ |-------------|---------------|----------------------|
1020
+ | Node.js + React | Playwright or Cypress | Supertest + Vitest |
1021
+ | Node.js + API only | - | Supertest + Jest/Vitest |
1022
+ | Next.js | Playwright | Next.js test utils |
1023
+ | Python + Django/Flask | Playwright | pytest + httpx |
1024
+ | Python + FastAPI | Playwright | pytest + httpx |
1025
+ | Go | - | go test + httptest |
1026
+ | Rust | - | reqwest + tokio::test |
1027
+
1028
+ ## E2E Test Structure
1029
+
1030
+ \`\`\`
1031
+ tests/e2e/
1032
+ {journey-name}.test.{ext} # One file per user journey
1033
+ fixtures/ # Test data
1034
+ helpers/ # Page objects, utilities
1035
+ \`\`\`
1036
+
1037
+ ### User Journey Test Template
1038
+
1039
+ \`\`\`
1040
+ describe("{Journey Name}", () => {
1041
+ test("happy path: {description}", async () => {
1042
+ // Given: {precondition from AC}
1043
+ // When: {action from AC}
1044
+ // Then: {outcome from AC}
1045
+ });
1046
+
1047
+ test("error: {error scenario}", async () => {
1048
+ // Given: {invalid state}
1049
+ // When: {action}
1050
+ // Then: {error handling}
1051
+ });
1052
+
1053
+ test("edge: {edge case}", async () => {
1054
+ // Given: {boundary condition}
1055
+ // When: {action}
1056
+ // Then: {expected behavior}
1057
+ });
1058
+ });
1059
+ \`\`\`
1060
+
1061
+ ## Integration Test Structure
1062
+
1063
+ \`\`\`
1064
+ tests/integration/
1065
+ {endpoint-or-service}.test.{ext}
1066
+ fixtures/
1067
+ helpers/
1068
+ \`\`\`
1069
+
1070
+ ### API Test Template
1071
+
1072
+ \`\`\`
1073
+ describe("{Endpoint/Service}", () => {
1074
+ test("POST /api/resource - creates resource", async () => {
1075
+ // Arrange: valid payload
1076
+ // Act: POST request
1077
+ // Assert: 201, response body, DB state
1078
+ });
1079
+
1080
+ test("POST /api/resource - 400 on invalid input", async () => {
1081
+ // Arrange: invalid payload
1082
+ // Act: POST request
1083
+ // Assert: 400, error message
1084
+ });
1085
+
1086
+ test("GET /api/resource/:id - 404 on missing", async () => {
1087
+ // Arrange: non-existent ID
1088
+ // Act: GET request
1089
+ // Assert: 404
1090
+ });
1091
+
1092
+ test("auth: rejects unauthenticated requests", async () => {
1093
+ // Arrange: no auth header
1094
+ // Act: request
1095
+ // Assert: 401
1096
+ });
1097
+ });
1098
+ \`\`\`
1099
+
1100
+ ## Test Coverage Goals
1101
+
1102
+ | Category | Target | How to verify |
1103
+ |----------|--------|---------------|
1104
+ | AC coverage | 100% of ACs have tests | Map each AC → test |
1105
+ | Happy paths | Every user journey | 1 E2E test per journey |
1106
+ | Error paths | All error states | 1 test per error scenario |
1107
+ | Auth boundaries | All protected routes | Unauthorized + forbidden |
1108
+ | Edge cases | Empty, null, max values | Boundary value analysis |
1109
+
1110
+ ## Anti-Patterns
1111
+
1112
+ - **Flaky tests**: Don't depend on timing. Use waitFor, retries, explicit waits.
1113
+ - **Shared state**: Each test must be independent. Reset DB/state before each.
1114
+ - **Hardcoded selectors**: Use data-testid or accessible roles, not CSS classes.
1115
+ - **Testing implementation**: Test behavior, not internal structure.
1116
+ - **No assertions**: Every test must assert something. \`expect(true).toBe(true)\` is not a test.
1117
+ `;
1118
+
1119
+ const TICKET_GIT_WORKFLOW = `# Ticket System & Git Provider Integration
1120
+
1121
+ Read \`ticket_system\` and \`git_provider\` from config.yaml to adapt all instructions below.
1122
+
1123
+ ---
1124
+
1125
+ ## Ticket System Sync Rules
1126
+
1127
+ ### If ticket_system = "none"
1128
+ Skip all ticket references. Use plain commit messages without ticket IDs.
1129
+
1130
+ ### If ticket_system = "linear"
1131
+
1132
+ **BEFORE starting a story:**
1133
+ 1. Find the corresponding Linear issue
1134
+ 2. Move issue status to **In Progress**
1135
+ 3. Use the **Linear-suggested git branch name** (from Linear UI: "Copy git branch name")
1136
+ 4. Add a comment on the issue: what you're about to implement
1137
+
1138
+ **DURING development:**
1139
+ - Reference the Linear issue ID in EVERY commit message
1140
+ - Use **Linear magic words** for auto-linking:
1141
+ - \`Part of TEAM-XX\` — links without closing (use in intermediate commits)
1142
+ - \`Fixes TEAM-XX\` — links and auto-closes issue on merge
1143
+ - Commit format: \`type(TEAM-XX): description\\n\\nPart of TEAM-XX\`
1144
+
1145
+ **AFTER completing:**
1146
+ 1. Create PR with issue ID: \`gh pr create --title "feat(TEAM-XX): Story X.Y - Description" --body "Fixes TEAM-XX"\`
1147
+ 2. Move issue to **In Review**
1148
+ 3. After merge: move to **Done**
1149
+ 4. Update state.yaml to match
1150
+
1151
+ ### If ticket_system = "jira"
1152
+
1153
+ **BEFORE:** Find JIRA issue (PROJ-XX), move to In Progress, use branch: \`feature/PROJ-XX-description\`
1154
+
1155
+ **DURING:**
1156
+ - Reference JIRA issue ID in every commit: \`type(PROJ-XX): description\`
1157
+ - JIRA smart commits: \`PROJ-XX #in-progress\`, \`PROJ-XX #done\`
1158
+
1159
+ **AFTER:**
1160
+ - PR title: \`feat(PROJ-XX): Story X.Y - Description\`
1161
+ - JIRA auto-links PRs via issue ID in branch name or commit
1162
+
1163
+ ### If ticket_system = "github-issues"
1164
+
1165
+ **BEFORE:** Find GitHub issue #XX, assign yourself
1166
+
1167
+ **DURING:**
1168
+ - Reference in commits: \`type(#XX): description\`
1169
+ - Use \`Closes #XX\` or \`Fixes #XX\` in final commit/PR body
1170
+
1171
+ **AFTER:**
1172
+ - \`gh pr create --title "feat: Story X.Y" --body "Closes #XX"\`
1173
+ - Issue auto-closes when PR merges
1174
+
1175
+ ### If ticket_system = "gitlab-issues"
1176
+
1177
+ **BEFORE:** Find GitLab issue #XX, assign yourself
1178
+
1179
+ **DURING:**
1180
+ - Reference: \`type(#XX): description\`
1181
+ - Use \`Closes #XX\` in commit/MR body
1182
+
1183
+ **AFTER:**
1184
+ - \`glab mr create --title "feat: Story X.Y" --description "Closes #XX"\`
1185
+ - Issue auto-closes when MR merges
1186
+
1187
+ ---
1188
+
1189
+ ## Git Provider Workflow
1190
+
1191
+ ### If git_provider = "github"
1192
+
1193
+ **Branch strategy:**
1194
+ \`\`\`
1195
+ main (production)
1196
+ └── develop (integration, if configured)
1197
+ └── feature/{ticket-id}-description
1198
+ \`\`\`
1199
+
1200
+ **Commands:**
1201
+ \`\`\`bash
1202
+ # Start story
1203
+ git checkout main # or develop if exists
1204
+ git pull
1205
+ git checkout -b feature/{ticket-id}-description
1206
+
1207
+ # During dev
1208
+ git add <specific-files> # NEVER git add . or git add -A
1209
+ git commit -m "type({ticket-id}): description"
1210
+
1211
+ # Complete
1212
+ git push -u origin feature/{ticket-id}-description
1213
+ gh pr create --base main --title "type({ticket-id}): Story X.Y - Title" --body "Fixes {ticket-id}"
1214
+
1215
+ # After merge
1216
+ git checkout main && git pull
1217
+ git branch -d feature/{ticket-id}-description
1218
+ \`\`\`
1219
+
1220
+ ### If git_provider = "gitlab"
1221
+
1222
+ **Commands:**
1223
+ \`\`\`bash
1224
+ # Start
1225
+ git checkout main && git pull
1226
+ git checkout -b feature/{ticket-id}-description
1227
+
1228
+ # Complete
1229
+ git push -u origin feature/{ticket-id}-description
1230
+ glab mr create --base main --title "type({ticket-id}): Story X.Y" --description "Closes {ticket-id}"
1231
+
1232
+ # After merge
1233
+ git checkout main && git pull
1234
+ git branch -d feature/{ticket-id}-description
1235
+ \`\`\`
1236
+
1237
+ ### If git_provider = "bitbucket"
1238
+
1239
+ **Commands:**
1240
+ \`\`\`bash
1241
+ # Start
1242
+ git checkout main && git pull
1243
+ git checkout -b feature/{ticket-id}-description
1244
+
1245
+ # Complete
1246
+ git push -u origin feature/{ticket-id}-description
1247
+ # Create PR via Bitbucket web UI or API
1248
+ \`\`\`
1249
+
1250
+ ---
1251
+
1252
+ ## Commit Message Format
1253
+
1254
+ \`\`\`
1255
+ type({ticket-id}): short description
1256
+
1257
+ [Optional body]
1258
+
1259
+ {Magic word} {ticket-id}
1260
+ \`\`\`
1261
+
1262
+ | Prefix | Usage |
1263
+ |--------|-------|
1264
+ | feat | New feature / story implementation |
1265
+ | fix | Bug fix |
1266
+ | refactor | Code restructuring (no behavior change) |
1267
+ | test | Adding or updating tests |
1268
+ | docs | Documentation changes |
1269
+ | chore | Build, config, tooling changes |
1270
+
1271
+ ---
1272
+
1273
+ ## State Sync
1274
+
1275
+ Local state.yaml and ticket system MUST agree:
1276
+
1277
+ | state.yaml | Linear | Jira | GitHub/GitLab Issues |
1278
+ |------------|--------|------|---------------------|
1279
+ | backlog | Backlog | Backlog | No label |
1280
+ | ready-for-dev | Todo | To Do | "ready" label |
1281
+ | in-progress | In Progress | In Progress | "in progress" label |
1282
+ | review | In Review | In Review | PR linked |
1283
+ | done | Done | Done | Closed |
1284
+
1285
+ **If they diverge, the ticket system is the authority.** Update state.yaml to match.
1286
+
1287
+ ---
1288
+
1289
+ ## Epic/Milestone Tracking
1290
+
1291
+ - When first story of an epic moves to In Progress → update epic/milestone status
1292
+ - When ALL stories in an epic are Done → mark milestone complete
1293
+ - Keep milestone descriptions updated if scope changes
1294
+
1295
+ ---
1296
+
1297
+ ## Critical Rules
1298
+
1299
+ 1. NEVER commit directly to main
1300
+ 2. ALWAYS create feature branch before starting
1301
+ 3. ALWAYS include ticket ID in every commit message
1302
+ 4. ALWAYS update ticket status: In Progress → In Review → Done
1303
+ 5. ALWAYS stage specific files — never \`git add .\` or \`git add -A\`
1304
+ 6. ALWAYS use ticket system's suggested branch name when available
1305
+ 7. NEVER commit secrets (.env, API keys, settings.local.json)
1306
+ `;
@@ -338,6 +338,105 @@ if [[ \${#IN_STORY_NOT_GIT[@]} -gt 0 ]]; then
338
338
  exit 1
339
339
  fi
340
340
 
341
+ exit 0
342
+ `,
343
+ },
344
+ {
345
+ path: `${a}/aped-ux/scripts/validate-ux.sh`,
346
+ executable: true,
347
+ content: `#!/usr/bin/env bash
348
+ # Validate UX design spec completeness
349
+ # Usage: validate-ux.sh <ux-dir>
350
+ # Exit 0 if valid, exit 1 with missing items listed
351
+
352
+ set -euo pipefail
353
+
354
+ if [[ $# -ne 1 ]]; then
355
+ echo "Usage: $0 <ux-directory>"
356
+ exit 1
357
+ fi
358
+
359
+ UX_DIR="$1"
360
+
361
+ if [[ ! -d "$UX_DIR" ]]; then
362
+ echo "ERROR: Directory not found: $UX_DIR"
363
+ exit 1
364
+ fi
365
+
366
+ ISSUES=()
367
+
368
+ # Check required output files
369
+ REQUIRED_FILES=(
370
+ "design-spec.md"
371
+ "screen-inventory.md"
372
+ "components.md"
373
+ "flows.md"
374
+ )
375
+
376
+ for file in "\${REQUIRED_FILES[@]}"; do
377
+ if [[ ! -f "$UX_DIR/$file" ]]; then
378
+ ISSUES+=("MISSING FILE: $UX_DIR/$file")
379
+ fi
380
+ done
381
+
382
+ # Check design-spec.md has required sections
383
+ if [[ -f "$UX_DIR/design-spec.md" ]]; then
384
+ SPEC_SECTIONS=(
385
+ "## Tech Stack"
386
+ "## Architecture"
387
+ "## Conventions"
388
+ "## Dependencies"
389
+ )
390
+
391
+ # Reuse pattern: check for sections about design tokens and UI library
392
+ if ! grep -q "color\\|Color\\|palette\\|token" "$UX_DIR/design-spec.md" 2>/dev/null; then
393
+ ISSUES+=("MISSING CONTENT: design-spec.md has no color/token definitions")
394
+ fi
395
+
396
+ if ! grep -q "typography\\|Typography\\|font\\|Font" "$UX_DIR/design-spec.md" 2>/dev/null; then
397
+ ISSUES+=("MISSING CONTENT: design-spec.md has no typography definitions")
398
+ fi
399
+ fi
400
+
401
+ # Check screen-inventory.md has content
402
+ if [[ -f "$UX_DIR/screen-inventory.md" ]]; then
403
+ SCREEN_COUNT=$(grep -cE '^\\|.*\\|.*\\|' "$UX_DIR/screen-inventory.md" 2>/dev/null || echo 0)
404
+ if [[ "$SCREEN_COUNT" -lt 3 ]]; then
405
+ ISSUES+=("LOW SCREEN COUNT: Found $SCREEN_COUNT screens (expected at least 3)")
406
+ fi
407
+ fi
408
+
409
+ # Check components.md has component entries
410
+ if [[ -f "$UX_DIR/components.md" ]]; then
411
+ COMP_COUNT=$(grep -cE '^#{2,3} ' "$UX_DIR/components.md" 2>/dev/null || echo 0)
412
+ if [[ "$COMP_COUNT" -lt 3 ]]; then
413
+ ISSUES+=("LOW COMPONENT COUNT: Found $COMP_COUNT components (expected at least 3)")
414
+ fi
415
+ fi
416
+
417
+ # Check preview app exists
418
+ PREVIEW_DIR="\${UX_DIR}-preview"
419
+ if [[ -d "$PREVIEW_DIR" ]]; then
420
+ if [[ ! -f "$PREVIEW_DIR/package.json" ]]; then
421
+ ISSUES+=("MISSING: Preview app has no package.json")
422
+ fi
423
+ if [[ ! -d "$PREVIEW_DIR/src" ]]; then
424
+ ISSUES+=("MISSING: Preview app has no src/ directory")
425
+ fi
426
+ else
427
+ ISSUES+=("WARNING: No preview app at $PREVIEW_DIR (optional but recommended)")
428
+ fi
429
+
430
+ # Report
431
+ if [[ \${#ISSUES[@]} -gt 0 ]]; then
432
+ echo "UX VALIDATION FAILED — Issues found:"
433
+ for issue in "\${ISSUES[@]}"; do
434
+ echo " - $issue"
435
+ done
436
+ exit 1
437
+ fi
438
+
439
+ echo "UX VALIDATION PASSED — All required files and content present"
341
440
  exit 0
342
441
  `,
343
442
  },
@@ -335,13 +335,18 @@ Story files: \`${o}/stories/{story-key}.md\`
335
335
 
336
336
  ## Ticket System Integration
337
337
 
338
- Read \`ticket_system\` from config. If not \`none\`:
338
+ Read \`ticket_system\` from config. Read \`${a}/aped-d/references/ticket-git-workflow.md\` for full guide.
339
+
340
+ If \`ticket_system\` is not \`none\`:
339
341
  - Add ticket reference in each story header: \`**Ticket:** {{ticket_id}}\`
340
- - If \`jira\`: format as \`PROJ-###\` placeholder
341
- - If \`linear\`: format as \`TEAM-###\` placeholder
342
- - If \`github-issues\`: format as \`#issue_number\` placeholder
343
- - If \`gitlab-issues\`: format as \`#issue_number\` placeholder
342
+ - Add suggested branch name: \`**Branch:** feature/{{ticket_id}}-{{story-slug}}\`
343
+ - Format ticket ID per provider:
344
+ - \`linear\`: \`TEAM-###\` (e.g., \`KON-10\`)
345
+ - \`jira\`: \`PROJ-###\` (e.g., \`PROJ-42\`)
346
+ - \`github-issues\`: \`#issue_number\` (e.g., \`#10\`)
347
+ - \`gitlab-issues\`: \`#issue_number\` (e.g., \`#10\`)
344
348
  - Note: actual ticket creation is manual — these are reference placeholders
349
+ - In Dev Notes, add: "Commit prefix: \`feat({{ticket_id}})\`"
345
350
 
346
351
  ## FR Coverage Map
347
352
 
@@ -469,11 +474,32 @@ Mark \`[x]\` ONLY when: tests exist, pass 100%, implementation matches, ACs sati
469
474
 
470
475
  **STOP and ask user if:** new dependency, 3 consecutive failures, missing config, ambiguity.
471
476
 
472
- ## Git Commit Convention
477
+ ## Git & Ticket Workflow
478
+
479
+ Read \`${a}/aped-d/references/ticket-git-workflow.md\` for full integration guide.
480
+
481
+ Read \`ticket_system\` and \`git_provider\` from \`${a}/config.yaml\`.
482
+
483
+ ### Before Implementation
484
+ If \`ticket_system\` is not \`none\`:
485
+ 1. Find the corresponding ticket/issue for this story
486
+ 2. Move ticket status to **In Progress**
487
+ 3. Create feature branch using ticket system's suggested name
488
+ 4. Add a comment on the ticket: implementation plan
489
+
490
+ If \`ticket_system\` is \`none\`:
491
+ 1. Create branch: \`feature/{story-key}\`
492
+
493
+ ### During Implementation
494
+ - Include ticket ID in EVERY commit: \`type({ticket-id}): description\`
495
+ - Use magic words for auto-linking (see reference doc)
496
+ - NEVER use \`git add .\` — stage specific files only
473
497
 
474
- Read \`git_provider\` and \`ticket_system\` from config:
475
- - Commit message format: \`type(scope): description\`
476
- - If ticket system configured, append ticket ref: \`type(scope): description [TICKET-ID]\`
498
+ ### After Implementation
499
+ 1. Push branch and create PR/MR (adapt to \`git_provider\`):
500
+ - \`github\`: \`gh pr create --title "feat({ticket-id}): Story X.Y" --body "Fixes {ticket-id}"\`
501
+ - \`gitlab\`: \`glab mr create --title "feat({ticket-id}): Story X.Y" --description "Closes {ticket-id}"\`
502
+ 2. Move ticket to **In Review**
477
503
 
478
504
  ## Completion
479
505
 
@@ -572,6 +598,20 @@ Severity: CRITICAL > HIGH > MEDIUM > LOW. Format: \`[Severity] Description [file
572
598
  - MEDIUM/LOW only: fix automatically, story — \`done\`
573
599
  - HIGH+: fix or add \`[AI-Review]\` items, story — \`in-progress\`
574
600
 
601
+ ## Ticket & Git Update
602
+
603
+ Read \`ticket_system\` and \`git_provider\` from \`${a}/config.yaml\`.
604
+ Read \`${a}/aped-d/references/ticket-git-workflow.md\` for details.
605
+
606
+ If story → \`done\`:
607
+ 1. If PR exists: approve/merge (adapt to \`git_provider\`)
608
+ 2. If \`ticket_system\` is not \`none\`: move ticket to **Done**
609
+ 3. Cleanup: delete feature branch after merge
610
+
611
+ If story → \`in-progress\` (review found HIGH+ issues):
612
+ 1. Add [AI-Review] items as comments on the PR
613
+ 2. Ticket stays in **In Review**
614
+
575
615
  ## State Update
576
616
 
577
617
  Update \`${o}/state.yaml\`. If more stories remain: invoke Skill tool with \`skill: "aped-d"\`. If all stories done: report pipeline completion.
@@ -860,6 +900,14 @@ mkdir -p ${o}/ux
860
900
  5. Write \`${o}/ux/flows.md\` — navigation flow diagrams
861
901
  6. Take **screenshots** of each screen at desktop resolution → \`${o}/ux/screenshots/\`
862
902
 
903
+ ## Validation
904
+
905
+ \`\`\`bash
906
+ bash ${a}/aped-ux/scripts/validate-ux.sh ${o}/ux
907
+ \`\`\`
908
+
909
+ If validation fails: fix missing files or content and re-validate.
910
+
863
911
  ## State Update
864
912
 
865
913
  Update \`${o}/state.yaml\`:
@@ -913,6 +961,7 @@ metadata:
913
961
 
914
962
  1. Read \`${a}/config.yaml\` — extract \`communication_language\`, \`ticket_system\`
915
963
  2. Read \`${o}/state.yaml\` — load full pipeline and sprint state
964
+ 3. Read \`${a}/aped-s/references/status-format.md\` for display conventions
916
965
 
917
966
  ## Pipeline Overview
918
967
 
@@ -957,11 +1006,20 @@ Based on current state, suggest the next logical command:
957
1006
  - If all stories \`done\`: suggest pipeline complete
958
1007
  - If blockers found: describe resolution path
959
1008
 
960
- ## Ticket System Integration
1009
+ ## Ticket System Sync
1010
+
1011
+ Read \`${a}/aped-d/references/ticket-git-workflow.md\` for status mapping.
961
1012
 
962
1013
  If \`ticket_system\` is not \`none\`:
963
- - Show ticket references alongside story statuses
964
- - Note any stories without ticket references
1014
+ - Show ticket ID alongside each story status
1015
+ - Flag any stories without ticket references
1016
+ - Check sync: compare state.yaml statuses with expected ticket statuses
1017
+ - If divergence detected: warn user — "state.yaml says X, ticket system should be Y"
1018
+ - Display mapping table:
1019
+ - \`backlog\` → Backlog/Todo
1020
+ - \`in-progress\` → In Progress
1021
+ - \`review\` → In Review
1022
+ - \`done\` → Done
965
1023
 
966
1024
  ## Output
967
1025
 
@@ -1004,6 +1062,7 @@ Use when requirements change, priorities shift, or the current approach needs re
1004
1062
  1. Read \`${a}/config.yaml\` — extract config
1005
1063
  2. Read \`${o}/state.yaml\` — understand current pipeline state
1006
1064
  3. Read existing artifacts: brief, PRD, epics, stories
1065
+ 4. Read \`${a}/aped-c/references/scope-change-guide.md\` for impact matrix and process
1007
1066
 
1008
1067
  ## Impact Assessment
1009
1068
 
@@ -1105,6 +1164,7 @@ Use on existing codebases to generate project context before running the APED pi
1105
1164
 
1106
1165
  1. Read \`${a}/config.yaml\` — extract config
1107
1166
  2. Verify this is a brownfield project (existing code, not greenfield)
1167
+ 3. Read \`${a}/aped-ctx/references/analysis-checklist.md\` for the full analysis checklist
1108
1168
 
1109
1169
  ## Codebase Analysis
1110
1170
 
@@ -1223,6 +1283,7 @@ Generate comprehensive end-to-end and integration tests for completed stories or
1223
1283
 
1224
1284
  1. Read \`${a}/config.yaml\` — extract config
1225
1285
  2. Read \`${o}/state.yaml\` — find completed stories/epics
1286
+ 3. Read \`${a}/aped-qa/references/test-patterns.md\` for framework selection and test templates
1226
1287
 
1227
1288
  ## Scope Selection
1228
1289
 
@@ -1390,13 +1451,18 @@ Quick checklist — no full adversarial review:
1390
1451
  - [ ] No regressions in existing tests
1391
1452
  - [ ] AC from quick spec satisfied
1392
1453
 
1393
- ## Git Commit
1454
+ ## Git & Ticket Workflow
1394
1455
 
1395
1456
  Read \`ticket_system\` and \`git_provider\` from config.
1396
- - Format: \`type(scope): description\`
1397
- - Append ticket ref if configured
1398
- - If \`git_provider\` is \`github\`: suggest PR creation with \`gh pr create\`
1399
- - If \`git_provider\` is \`gitlab\`: suggest MR creation with \`glab mr create\`
1457
+ Read \`${a}/aped-d/references/ticket-git-workflow.md\` for full guide.
1458
+
1459
+ 1. **Branch**: create \`fix/{ticket-id}-{slug}\` or \`feature/{ticket-id}-{slug}\`
1460
+ 2. **Commits**: \`type({ticket-id}): description\` include magic words per ticket provider
1461
+ 3. **PR/MR**:
1462
+ - \`github\`: \`gh pr create --title "fix({ticket-id}): description" --body "Fixes {ticket-id}"\`
1463
+ - \`gitlab\`: \`glab mr create --title "fix({ticket-id}): description" --description "Closes {ticket-id}"\`
1464
+ - \`bitbucket\`: push branch, create PR via web
1465
+ 4. **Ticket**: move to Done after merge
1400
1466
 
1401
1467
  ## Output
1402
1468