safeword 0.2.3 → 0.2.4

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 (235) hide show
  1. package/.claude/commands/arch-review.md +32 -0
  2. package/.claude/commands/lint.md +6 -0
  3. package/.claude/commands/quality-review.md +13 -0
  4. package/.claude/commands/setup-linting.md +6 -0
  5. package/.claude/hooks/auto-lint.sh +6 -0
  6. package/.claude/hooks/auto-quality-review.sh +170 -0
  7. package/.claude/hooks/check-linting-sync.sh +17 -0
  8. package/.claude/hooks/inject-timestamp.sh +6 -0
  9. package/.claude/hooks/question-protocol.sh +12 -0
  10. package/.claude/hooks/run-linters.sh +8 -0
  11. package/.claude/hooks/run-quality-review.sh +76 -0
  12. package/.claude/hooks/version-check.sh +10 -0
  13. package/.claude/mcp/README.md +96 -0
  14. package/.claude/mcp/arcade.sample.json +9 -0
  15. package/.claude/mcp/context7.sample.json +7 -0
  16. package/.claude/mcp/playwright.sample.json +7 -0
  17. package/.claude/settings.json +62 -0
  18. package/.claude/skills/quality-reviewer/SKILL.md +190 -0
  19. package/.claude/skills/safeword-quality-reviewer/SKILL.md +13 -0
  20. package/.env.arcade.example +4 -0
  21. package/.env.example +11 -0
  22. package/.gitmodules +4 -0
  23. package/.safeword/SAFEWORD.md +33 -0
  24. package/.safeword/eslint/eslint-base.mjs +101 -0
  25. package/.safeword/guides/architecture-guide.md +404 -0
  26. package/.safeword/guides/code-philosophy.md +174 -0
  27. package/.safeword/guides/context-files-guide.md +405 -0
  28. package/.safeword/guides/data-architecture-guide.md +183 -0
  29. package/.safeword/guides/design-doc-guide.md +165 -0
  30. package/.safeword/guides/learning-extraction.md +515 -0
  31. package/.safeword/guides/llm-instruction-design.md +239 -0
  32. package/.safeword/guides/llm-prompting.md +95 -0
  33. package/.safeword/guides/tdd-best-practices.md +570 -0
  34. package/.safeword/guides/test-definitions-guide.md +243 -0
  35. package/.safeword/guides/testing-methodology.md +573 -0
  36. package/.safeword/guides/user-story-guide.md +237 -0
  37. package/.safeword/guides/zombie-process-cleanup.md +214 -0
  38. package/{templates → .safeword}/hooks/agents-md-check.sh +0 -0
  39. package/{templates → .safeword}/hooks/post-tool.sh +0 -0
  40. package/{templates → .safeword}/hooks/pre-commit.sh +0 -0
  41. package/.safeword/planning/002-user-story-quality-evaluation.md +1840 -0
  42. package/.safeword/planning/003-langsmith-eval-setup-prompt.md +363 -0
  43. package/.safeword/planning/004-llm-eval-test-cases.md +3226 -0
  44. package/.safeword/planning/005-architecture-enforcement-system.md +169 -0
  45. package/.safeword/planning/006-reactive-fix-prevention-research.md +135 -0
  46. package/.safeword/planning/011-cli-ux-vision.md +330 -0
  47. package/.safeword/planning/012-project-structure-cleanup.md +154 -0
  48. package/.safeword/planning/README.md +39 -0
  49. package/.safeword/planning/automation-plan-v2.md +1225 -0
  50. package/.safeword/planning/automation-plan-v3.md +1291 -0
  51. package/.safeword/planning/automation-plan.md +3058 -0
  52. package/.safeword/planning/design/005-cli-implementation.md +343 -0
  53. package/.safeword/planning/design/013-cli-self-contained-templates.md +596 -0
  54. package/.safeword/planning/design/013a-eslint-plugin-suite.md +256 -0
  55. package/.safeword/planning/design/013b-implementation-snippets.md +385 -0
  56. package/.safeword/planning/design/013c-config-isolation-strategy.md +242 -0
  57. package/.safeword/planning/design/code-philosophy-improvements.md +60 -0
  58. package/.safeword/planning/mcp-analysis.md +545 -0
  59. package/.safeword/planning/phase2-subagents-vs-skills-analysis.md +451 -0
  60. package/.safeword/planning/settings-improvements.md +970 -0
  61. package/.safeword/planning/test-definitions/005-cli-implementation.md +1301 -0
  62. package/.safeword/planning/test-definitions/cli-self-contained-templates.md +205 -0
  63. package/.safeword/planning/user-stories/001-guides-review-user-stories.md +1381 -0
  64. package/.safeword/planning/user-stories/003-reactive-fix-prevention.md +132 -0
  65. package/.safeword/planning/user-stories/004-technical-constraints.md +86 -0
  66. package/.safeword/planning/user-stories/005-cli-implementation.md +311 -0
  67. package/.safeword/planning/user-stories/cli-self-contained-templates.md +172 -0
  68. package/.safeword/planning/versioned-distribution.md +740 -0
  69. package/.safeword/prompts/arch-review.md +43 -0
  70. package/.safeword/prompts/quality-review.md +11 -0
  71. package/.safeword/scripts/arch-review.sh +235 -0
  72. package/.safeword/scripts/check-linting-sync.sh +58 -0
  73. package/.safeword/scripts/setup-linting.sh +559 -0
  74. package/.safeword/templates/architecture-template.md +136 -0
  75. package/.safeword/templates/ci/architecture-check.yml +79 -0
  76. package/.safeword/templates/design-doc-template.md +127 -0
  77. package/.safeword/templates/test-definitions-feature.md +100 -0
  78. package/.safeword/templates/ticket-template.md +74 -0
  79. package/.safeword/templates/user-stories-template.md +82 -0
  80. package/.safeword/tickets/001-guides-review-user-stories.md +83 -0
  81. package/.safeword/tickets/002-architecture-enforcement.md +211 -0
  82. package/.safeword/tickets/003-reactive-fix-prevention.md +57 -0
  83. package/.safeword/tickets/004-technical-constraints-in-user-stories.md +39 -0
  84. package/.safeword/tickets/005-cli-implementation.md +248 -0
  85. package/.safeword/tickets/006-flesh-out-skills.md +43 -0
  86. package/.safeword/tickets/007-flesh-out-questioning.md +44 -0
  87. package/.safeword/tickets/008-upgrade-questioning.md +58 -0
  88. package/.safeword/tickets/009-naming-conventions.md +41 -0
  89. package/.safeword/tickets/010-safeword-md-cleanup.md +34 -0
  90. package/.safeword/tickets/011-cursor-setup.md +86 -0
  91. package/.safeword/tickets/README.md +73 -0
  92. package/.safeword/version +1 -0
  93. package/AGENTS.md +59 -0
  94. package/CLAUDE.md +12 -0
  95. package/README.md +347 -0
  96. package/docs/001-cli-implementation-plan.md +856 -0
  97. package/docs/elite-dx-implementation-plan.md +1034 -0
  98. package/framework/README.md +131 -0
  99. package/framework/mcp/README.md +96 -0
  100. package/framework/mcp/arcade.sample.json +8 -0
  101. package/framework/mcp/context7.sample.json +6 -0
  102. package/framework/mcp/playwright.sample.json +6 -0
  103. package/framework/scripts/arch-review.sh +235 -0
  104. package/framework/scripts/check-linting-sync.sh +58 -0
  105. package/framework/scripts/load-env.sh +49 -0
  106. package/framework/scripts/setup-claude.sh +223 -0
  107. package/framework/scripts/setup-linting.sh +559 -0
  108. package/framework/scripts/setup-quality.sh +477 -0
  109. package/framework/scripts/setup-safeword.sh +550 -0
  110. package/framework/templates/ci/architecture-check.yml +78 -0
  111. package/learnings/ai-sdk-v5-breaking-changes.md +178 -0
  112. package/learnings/e2e-test-zombie-processes.md +231 -0
  113. package/learnings/milkdown-crepe-editor-property.md +96 -0
  114. package/learnings/prosemirror-fragment-traversal.md +119 -0
  115. package/package.json +19 -43
  116. package/packages/cli/AGENTS.md +1 -0
  117. package/packages/cli/ARCHITECTURE.md +279 -0
  118. package/packages/cli/package.json +51 -0
  119. package/packages/cli/src/cli.ts +63 -0
  120. package/packages/cli/src/commands/check.ts +166 -0
  121. package/packages/cli/src/commands/diff.ts +209 -0
  122. package/packages/cli/src/commands/reset.ts +190 -0
  123. package/packages/cli/src/commands/setup.ts +325 -0
  124. package/packages/cli/src/commands/upgrade.ts +163 -0
  125. package/packages/cli/src/index.ts +3 -0
  126. package/packages/cli/src/templates/config.ts +58 -0
  127. package/packages/cli/src/templates/content.ts +18 -0
  128. package/packages/cli/src/templates/index.ts +12 -0
  129. package/packages/cli/src/utils/agents-md.ts +66 -0
  130. package/packages/cli/src/utils/fs.ts +179 -0
  131. package/packages/cli/src/utils/git.ts +124 -0
  132. package/packages/cli/src/utils/hooks.ts +29 -0
  133. package/packages/cli/src/utils/output.ts +60 -0
  134. package/packages/cli/src/utils/project-detector.test.ts +185 -0
  135. package/packages/cli/src/utils/project-detector.ts +44 -0
  136. package/packages/cli/src/utils/version.ts +28 -0
  137. package/packages/cli/src/version.ts +6 -0
  138. package/packages/cli/templates/SAFEWORD.md +776 -0
  139. package/packages/cli/templates/doc-templates/architecture-template.md +136 -0
  140. package/packages/cli/templates/doc-templates/design-doc-template.md +134 -0
  141. package/packages/cli/templates/doc-templates/test-definitions-feature.md +131 -0
  142. package/packages/cli/templates/doc-templates/ticket-template.md +82 -0
  143. package/packages/cli/templates/doc-templates/user-stories-template.md +92 -0
  144. package/packages/cli/templates/guides/architecture-guide.md +423 -0
  145. package/packages/cli/templates/guides/code-philosophy.md +195 -0
  146. package/packages/cli/templates/guides/context-files-guide.md +457 -0
  147. package/packages/cli/templates/guides/data-architecture-guide.md +200 -0
  148. package/packages/cli/templates/guides/design-doc-guide.md +171 -0
  149. package/packages/cli/templates/guides/learning-extraction.md +552 -0
  150. package/packages/cli/templates/guides/llm-instruction-design.md +248 -0
  151. package/packages/cli/templates/guides/llm-prompting.md +102 -0
  152. package/packages/cli/templates/guides/tdd-best-practices.md +615 -0
  153. package/packages/cli/templates/guides/test-definitions-guide.md +334 -0
  154. package/packages/cli/templates/guides/testing-methodology.md +618 -0
  155. package/packages/cli/templates/guides/user-story-guide.md +256 -0
  156. package/packages/cli/templates/guides/zombie-process-cleanup.md +219 -0
  157. package/packages/cli/templates/hooks/agents-md-check.sh +27 -0
  158. package/packages/cli/templates/hooks/post-tool.sh +4 -0
  159. package/packages/cli/templates/hooks/pre-commit.sh +10 -0
  160. package/packages/cli/templates/prompts/arch-review.md +43 -0
  161. package/packages/cli/templates/prompts/quality-review.md +10 -0
  162. package/packages/cli/templates/skills/safeword-quality-reviewer/SKILL.md +207 -0
  163. package/packages/cli/tests/commands/check.test.ts +129 -0
  164. package/packages/cli/tests/commands/cli.test.ts +89 -0
  165. package/packages/cli/tests/commands/diff.test.ts +115 -0
  166. package/packages/cli/tests/commands/reset.test.ts +310 -0
  167. package/packages/cli/tests/commands/self-healing.test.ts +170 -0
  168. package/packages/cli/tests/commands/setup-blocking.test.ts +71 -0
  169. package/packages/cli/tests/commands/setup-core.test.ts +135 -0
  170. package/packages/cli/tests/commands/setup-git.test.ts +139 -0
  171. package/packages/cli/tests/commands/setup-hooks.test.ts +334 -0
  172. package/packages/cli/tests/commands/setup-linting.test.ts +189 -0
  173. package/packages/cli/tests/commands/setup-noninteractive.test.ts +80 -0
  174. package/packages/cli/tests/commands/setup-templates.test.ts +181 -0
  175. package/packages/cli/tests/commands/upgrade.test.ts +215 -0
  176. package/packages/cli/tests/helpers.ts +243 -0
  177. package/packages/cli/tests/npm-package.test.ts +83 -0
  178. package/packages/cli/tests/technical-constraints.test.ts +96 -0
  179. package/packages/cli/tsconfig.json +25 -0
  180. package/packages/cli/tsup.config.ts +11 -0
  181. package/packages/cli/vitest.config.ts +23 -0
  182. package/promptfoo.yaml +3270 -0
  183. package/dist/check-3NGQ4NR5.js +0 -129
  184. package/dist/check-3NGQ4NR5.js.map +0 -1
  185. package/dist/chunk-2XWIUEQK.js +0 -190
  186. package/dist/chunk-2XWIUEQK.js.map +0 -1
  187. package/dist/chunk-GZRQL3SX.js +0 -146
  188. package/dist/chunk-GZRQL3SX.js.map +0 -1
  189. package/dist/chunk-ORQHKDT2.js +0 -10
  190. package/dist/chunk-ORQHKDT2.js.map +0 -1
  191. package/dist/chunk-W66Z3C5H.js +0 -21
  192. package/dist/chunk-W66Z3C5H.js.map +0 -1
  193. package/dist/cli.d.ts +0 -1
  194. package/dist/cli.js +0 -34
  195. package/dist/cli.js.map +0 -1
  196. package/dist/diff-Y6QTAW4O.js +0 -166
  197. package/dist/diff-Y6QTAW4O.js.map +0 -1
  198. package/dist/index.d.ts +0 -11
  199. package/dist/index.js +0 -7
  200. package/dist/index.js.map +0 -1
  201. package/dist/reset-3ACTIYYE.js +0 -143
  202. package/dist/reset-3ACTIYYE.js.map +0 -1
  203. package/dist/setup-RR4M334C.js +0 -266
  204. package/dist/setup-RR4M334C.js.map +0 -1
  205. package/dist/upgrade-6AR3DHUV.js +0 -134
  206. package/dist/upgrade-6AR3DHUV.js.map +0 -1
  207. /package/{templates → framework}/SAFEWORD.md +0 -0
  208. /package/{templates → framework}/guides/architecture-guide.md +0 -0
  209. /package/{templates → framework}/guides/code-philosophy.md +0 -0
  210. /package/{templates → framework}/guides/context-files-guide.md +0 -0
  211. /package/{templates → framework}/guides/data-architecture-guide.md +0 -0
  212. /package/{templates → framework}/guides/design-doc-guide.md +0 -0
  213. /package/{templates → framework}/guides/learning-extraction.md +0 -0
  214. /package/{templates → framework}/guides/llm-instruction-design.md +0 -0
  215. /package/{templates → framework}/guides/llm-prompting.md +0 -0
  216. /package/{templates → framework}/guides/tdd-best-practices.md +0 -0
  217. /package/{templates → framework}/guides/test-definitions-guide.md +0 -0
  218. /package/{templates → framework}/guides/testing-methodology.md +0 -0
  219. /package/{templates → framework}/guides/user-story-guide.md +0 -0
  220. /package/{templates → framework}/guides/zombie-process-cleanup.md +0 -0
  221. /package/{templates → framework}/prompts/arch-review.md +0 -0
  222. /package/{templates → framework}/prompts/quality-review.md +0 -0
  223. /package/{templates/skills/safeword-quality-reviewer → framework/skills/quality-reviewer}/SKILL.md +0 -0
  224. /package/{templates/doc-templates → framework/templates}/architecture-template.md +0 -0
  225. /package/{templates/doc-templates → framework/templates}/design-doc-template.md +0 -0
  226. /package/{templates/doc-templates → framework/templates}/test-definitions-feature.md +0 -0
  227. /package/{templates/doc-templates → framework/templates}/ticket-template.md +0 -0
  228. /package/{templates/doc-templates → framework/templates}/user-stories-template.md +0 -0
  229. /package/{templates → packages/cli/templates}/commands/arch-review.md +0 -0
  230. /package/{templates → packages/cli/templates}/commands/lint.md +0 -0
  231. /package/{templates → packages/cli/templates}/commands/quality-review.md +0 -0
  232. /package/{templates → packages/cli/templates}/hooks/inject-timestamp.sh +0 -0
  233. /package/{templates → packages/cli/templates}/lib/common.sh +0 -0
  234. /package/{templates → packages/cli/templates}/lib/jq-fallback.sh +0 -0
  235. /package/{templates → packages/cli/templates}/markdownlint.jsonc +0 -0
@@ -0,0 +1,136 @@
1
+ # [Project Name] Architecture
2
+
3
+ **Version:** 1.0
4
+ **Last Updated:** YYYY-MM-DD
5
+ **Status:** Design | Production | Proposed | Deprecated
6
+
7
+ ---
8
+
9
+ ## Table of Contents
10
+
11
+ - [Overview](#overview)
12
+ - [Layers & Boundaries](#layers--boundaries)
13
+ - [Data Model](#data-model)
14
+ - [Key Decisions](#key-decisions)
15
+ - [Best Practices](#best-practices)
16
+ - [Migration Strategy](#migration-strategy)
17
+
18
+ ---
19
+
20
+ ## Overview
21
+
22
+ [High-level description of the system architecture, technology choices, and design philosophy.]
23
+
24
+ ### Tech Stack
25
+
26
+ | Category | Choice | Rationale |
27
+ | ---------------- | ------ | --------- |
28
+ | Language | | |
29
+ | Framework | | |
30
+ | Database | | |
31
+ | State Management | | |
32
+
33
+ ---
34
+
35
+ ## Layers & Boundaries
36
+
37
+ ### Layer Definitions
38
+
39
+ | Layer | Directory | Responsibility |
40
+ | ------ | ------------- | ------------------------------ |
41
+ | app | `src/app/` | UI, routing, composition |
42
+ | domain | `src/domain/` | Business rules, pure logic |
43
+ | infra | `src/infra/` | IO, APIs, DB, external SDKs |
44
+ | shared | `src/shared/` | Utilities usable by all layers |
45
+
46
+ ### Allowed Dependencies
47
+
48
+ | From | To | Allowed | Rationale |
49
+ | ------ | ------ | ------- | ------------------------------------------------- |
50
+ | app | domain | ✅ | UI composes business logic |
51
+ | app | infra | ✅ | UI triggers side effects |
52
+ | app | shared | ✅ | Utilities available everywhere |
53
+ | domain | app | ❌ | Domain must be framework-agnostic |
54
+ | domain | infra | ❌ | Domain contains pure logic only |
55
+ | domain | shared | ✅ | Utilities available everywhere |
56
+ | infra | domain | ✅ | Adapters may use domain types |
57
+ | infra | app | ❌ | Infra should not depend on UI |
58
+ | infra | shared | ✅ | Utilities available everywhere |
59
+ | shared | \* | ❌ | Shared has no dependencies (except external libs) |
60
+
61
+ **Note:** This template allows direct app→infra. Alternative: force app→domain→infra for stricter separation (hexagonal/ports-adapters pattern).
62
+
63
+ ### Boundary Enforcement
64
+
65
+ Boundaries enforced via `eslint-plugin-boundaries`. See `.safeword/guides/architecture-guide.md` → Enforcement with eslint-plugin-boundaries for setup.
66
+
67
+ ---
68
+
69
+ ## Data Model
70
+
71
+ ### Entities
72
+
73
+ | Entity | Table/Collection | Description |
74
+ | ------ | ---------------- | ----------- |
75
+ | | | |
76
+
77
+ ### Relationships
78
+
79
+ ```
80
+ [Entity A] 1──n [Entity B]
81
+ [Entity B] n──n [Entity C]
82
+ ```
83
+
84
+ ### Schema Notes
85
+
86
+ - [Key constraints, indexes, etc.]
87
+
88
+ ---
89
+
90
+ ## Key Decisions
91
+
92
+ ### [Decision Title]
93
+
94
+ **Status:** Active | Superseded | Deprecated
95
+ **Date:** YYYY-MM-DD
96
+
97
+ | Field | Value |
98
+ | -------------- | --------------------------------------------- |
99
+ | What | [The decision in 1-2 sentences] |
100
+ | Why | [Rationale with specifics - numbers, metrics] |
101
+ | Trade-off | [What we gave up or accepted] |
102
+ | Alternatives | [Other options considered and why rejected] |
103
+ | Implementation | [File references: `src/path/file.ts:12-45`] |
104
+
105
+ ---
106
+
107
+ ## Best Practices
108
+
109
+ ### [Pattern Name]
110
+
111
+ **What:** [Brief description]
112
+ **Why:** [Rationale]
113
+ **Example:** See `src/path/example.ts`
114
+
115
+ ---
116
+
117
+ ## Migration Strategy
118
+
119
+ ### From [Previous State] to [Target State]
120
+
121
+ **Trigger:** [When to migrate]
122
+ **Steps:**
123
+
124
+ 1. [Step 1]
125
+ 2. [Step 2]
126
+
127
+ **Rollback:** [How to revert if needed]
128
+
129
+ ---
130
+
131
+ ## Appendix
132
+
133
+ ### References
134
+
135
+ - [Link to relevant docs]
136
+ - [Link to ADRs if migrating from ADR system]
@@ -0,0 +1,134 @@
1
+ # Design: [Feature Name]
2
+
3
+ **Guide**: `@./.safeword/guides/design-doc-guide.md` - Principles, structure guidelines, and avoiding bloat
4
+ **Template**: `@./.safeword/templates/design-doc-template.md`
5
+
6
+ **Related**: User Stories: `[path]` | Test Definitions: `[path]`
7
+
8
+ **TDD Note**: This design implements tests from Test Definitions. Reference specific test scenarios (e.g., "Test 3.1: Component X enables keyboard shortcut Y").
9
+
10
+ ## Architecture
11
+
12
+ [1-2 paragraphs: High-level approach. What are we building and how does it fit together?]
13
+
14
+ **Diagram** (if applicable):
15
+ [Text diagram or link to visual]
16
+
17
+ ## Components
18
+
19
+ ### Component [N]: [ComponentName]
20
+
21
+ **What**: [Responsibility in 1 sentence]
22
+ **Where** (if applicable): `[file/path/component.ts]`
23
+ **Interface**:
24
+
25
+ ```typescript
26
+ // Key types/interfaces
27
+ interface Example {
28
+ id: string;
29
+ // ...
30
+ }
31
+
32
+ // Key methods
33
+ function doSomething(input: Example): Result;
34
+ ```
35
+
36
+ **Dependencies**: [What it uses]
37
+ **Tests**: [Which test scenarios this component enables]
38
+
39
+ ### Component [N+1]: [AnotherComponentName]
40
+
41
+ **What**: [Different responsibility than Component N]
42
+ **Where** (if applicable): `[different/file/path.ts]`
43
+ **Interface**:
44
+
45
+ ```typescript
46
+ // Different example
47
+ interface AnotherExample {
48
+ value: string;
49
+ }
50
+
51
+ function anotherMethod(input: AnotherExample): Output;
52
+ ```
53
+
54
+ **Dependencies**: [Different dependencies]
55
+ **Tests**: [Different test scenarios this enables]
56
+
57
+ ## Data Model (if applicable)
58
+
59
+ [Describe state shape, database schema, or data structures. Include relationships between types and how data flows through the system.]
60
+
61
+ ```typescript
62
+ // Core data structures
63
+ interface FeatureState {
64
+ items: Item[];
65
+ selectedId: string | null;
66
+ }
67
+
68
+ interface Item {
69
+ id: string;
70
+ name: string;
71
+ // ...
72
+ }
73
+ ```
74
+
75
+ ## Component Interaction (if applicable)
76
+
77
+ [How components communicate and data flows between them]
78
+
79
+ **Flow:**
80
+ Component [N] → Component [N+1]
81
+
82
+ **Events/Calls:**
83
+
84
+ - Component [N] triggers [event/method] in Component [N+1]
85
+ - Component [N+1] updates [state/data] consumed by [other components/system]
86
+
87
+ ## User Flow
88
+
89
+ 1. User [action, e.g., clicks "Toggle AI Pane" button, presses Cmd+J]
90
+ 2. System [response, e.g., updates state, triggers re-render, calls API]
91
+ 3. User sees [outcome, e.g., AI pane appears/disappears, loading spinner, error message]
92
+
93
+ ## Key Decisions
94
+
95
+ ### Decision [N]: [Technical choice]
96
+
97
+ **What**: [What we're using/doing]
98
+ **Why**: [Rationale with specifics - include metrics, benchmarks, or analysis]
99
+ **Trade-off**: [What we're giving up]
100
+
101
+ ### Decision [N+1]: [Technical choice]
102
+
103
+ **What**: [Different choice than Decision N]
104
+ **Why**: [Rationale with specifics - include metrics, benchmarks, or analysis]
105
+ **Trade-off**: [Different trade-off]
106
+
107
+ ## Implementation Notes (if applicable)
108
+
109
+ **Constraints**:
110
+
111
+ - [Technical limitation, e.g., "Must support Safari 14+", "No Node.js dependencies"]
112
+ - [Performance requirement, e.g., "< 200ms response time", "Bundle size < 100KB"]
113
+
114
+ **Error Handling**:
115
+
116
+ - [How errors are caught and handled]
117
+ - [User-facing vs internal errors]
118
+ - [Retry/fallback strategies]
119
+
120
+ **Gotchas**:
121
+
122
+ - [Edge case or common mistake]
123
+ - [Thing to watch out for]
124
+
125
+ **Open Questions**:
126
+
127
+ - [ ] [Blocking question]
128
+ - [ ] [Needs research]
129
+
130
+ ## References (if applicable)
131
+
132
+ - [ADR-XXX: Related decision]
133
+ - [External docs or examples]
134
+ - [Proof of concept]
@@ -0,0 +1,131 @@
1
+ # Test Definitions: [Feature Name] (Issue #[number])
2
+
3
+ **Guide**: `@./.safeword/guides/test-definitions-guide.md` - Structure, status tracking, and TDD workflow
4
+ **Template**: `@./.safeword/templates/test-definitions-feature.md`
5
+
6
+ **Feature**: [Brief description of the feature]
7
+
8
+ **Related Issue**: #[number]
9
+ **Test File**: `[path/to/test.spec.ts]`
10
+ **Total Tests**: [N] ([X] passing, [Y] skipped, [Z] not implemented)
11
+
12
+ ---
13
+
14
+ ## Test Suite [N]: [Suite Name]
15
+
16
+ [Brief description of what this test suite covers]
17
+
18
+ ### Test [N.1]: [Test name] [✅/⏭️/❌]
19
+
20
+ **Status**: [✅ Passing / ⏭️ Skipped / ❌ Not Implemented / 🔴 Failing]
21
+ **Description**: [What this test verifies]
22
+
23
+ **Steps**:
24
+
25
+ 1. [Action 1]
26
+ 2. [Action 2]
27
+ 3. [Action 3]
28
+
29
+ **Expected**:
30
+
31
+ - [Expected outcome 1]
32
+ - [Expected outcome 2]
33
+ - [Expected outcome 3]
34
+
35
+ ---
36
+
37
+ ### Test [N.2]: [Test name] [✅/⏭️/❌]
38
+
39
+ **Status**: [✅ Passing / ⏭️ Skipped / ❌ Not Implemented / 🔴 Failing]
40
+ **Description**: [What this test verifies]
41
+
42
+ **Steps**:
43
+
44
+ 1. [Action 1]
45
+ 2. [Action 2]
46
+
47
+ **Expected**:
48
+
49
+ - [Expected outcome 1]
50
+ - [Expected outcome 2]
51
+
52
+ ---
53
+
54
+ ## Test Suite [N+1]: [Suite Name]
55
+
56
+ [Brief description of what this test suite covers]
57
+
58
+ ### Test [N+1.1]: [Test name] [✅/⏭️/❌]
59
+
60
+ **Status**: [✅ Passing / ⏭️ Skipped / ❌ Not Implemented / 🔴 Failing]
61
+ **Description**: [What this test verifies]
62
+
63
+ **Steps**:
64
+
65
+ 1. [Action 1]
66
+ 2. [Action 2]
67
+
68
+ **Expected**:
69
+
70
+ - [Expected outcome 1]
71
+
72
+ ---
73
+
74
+ ## Test Suite [N]: Technical Constraints
75
+
76
+ _Tests for non-functional requirements from user story Technical Constraints section. Add tests for each applicable category: Performance, Security, Compatibility, Data, Dependencies, Infrastructure. Delete this suite if no constraints apply._
77
+
78
+ ### Test [N.1]: [Constraint name] [✅/⏭️/❌]
79
+
80
+ **Status**: [✅ Passing / ⏭️ Skipped / ❌ Not Implemented / 🔴 Failing]
81
+ **Category**: [Performance / Security / Compatibility / Data / Dependencies / Infrastructure]
82
+ **Constraint**: [Copy exact constraint from user story, e.g., "API response < 200ms at P95"]
83
+
84
+ **Steps**:
85
+
86
+ 1. [Setup test conditions]
87
+ 2. [Execute operation]
88
+ 3. [Measure/verify result]
89
+
90
+ **Expected**:
91
+
92
+ - [Measurable outcome matching constraint]
93
+
94
+ ---
95
+
96
+ ## Summary
97
+
98
+ **Total**: [N] tests
99
+ **Passing**: [X] tests ([X]%)
100
+ **Skipped**: [Y] tests ([Y]%)
101
+ **Not Implemented**: [Z] tests ([Z]%)
102
+ **Failing**: [F] tests ([F]%)
103
+
104
+ ### Coverage by Feature
105
+
106
+ | Feature | Tests | Status |
107
+ | ----------- | ------- | ------------ |
108
+ | [Feature 1] | [X]/[N] | [✅/❌] [X]% |
109
+ | [Feature 2] | [X]/[N] | [✅/❌] [X]% |
110
+ | [Feature 3] | [X]/[N] | [✅/❌] [X]% |
111
+
112
+ ### Skipped Tests Rationale
113
+
114
+ 1. **Test [N.X]** ([Test name]): [Reason for skipping - e.g., conflicts with design decision, requires manual testing, etc.]
115
+ 2. **Test [N.Y]** ([Test name]): [Reason for skipping]
116
+
117
+ ---
118
+
119
+ ## Test Execution
120
+
121
+ ```bash
122
+ # Run all tests for this feature
123
+ [command to run all tests]
124
+
125
+ # Run specific test
126
+ [command to run specific test with --grep flag]
127
+ ```
128
+
129
+ ---
130
+
131
+ **Last Updated**: [YYYY-MM-DD]
@@ -0,0 +1,82 @@
1
+ ---
2
+ id: XXX
3
+ status: in_progress
4
+ created: YYYY-MM-DDTHH:MM:SSZ
5
+ last_modified: YYYY-MM-DDTHH:MM:SSZ
6
+ ---
7
+
8
+ # Title
9
+
10
+ **Goal:** {One sentence: what are we trying to achieve?}
11
+
12
+ **Why:** {One sentence: why does this matter?}
13
+
14
+ ## Work Log
15
+
16
+ **Purpose:** Track what you've tried so you don't repeat dead ends or lose context.
17
+
18
+ **CRITICAL: Re-read this ticket before each significant action to stay on track.**
19
+
20
+ **Log immediately after:**
21
+
22
+ - Starting work
23
+ - Completing a step
24
+ - Trying an approach (document result: success or failure)
25
+ - Discovering a blocker, tradeoff, or decision point
26
+ - Writing a test (RED) or making it pass (GREEN)
27
+ - Committing code
28
+
29
+ **Format:** `YYYY-MM-DDTHH:MM:SSZ Action: Description (refs: commit/file/PR)`
30
+
31
+ **Examples:**
32
+
33
+ ```
34
+ - 2025-11-24T18:50:00Z Started: Changing button background to red
35
+ - 2025-11-24T18:51:30Z Tried: Added `background: red` to Button.css
36
+ - 2025-11-24T18:52:00Z Found: Button now has white text on red (unreadable)
37
+ - 2025-11-24T18:53:00Z Tried: Changed text color to white
38
+ - 2025-11-24T18:54:15Z Found: Hover state still blue (conflicts)
39
+ - 2025-11-24T18:55:00Z Complete: Updated all button states to red theme (refs: commit 9a3f2c1)
40
+ ```
41
+
42
+ ---
43
+
44
+ {Keep work log in reverse-chronological order. Newest entries at top.}
45
+ {Re-read before each action. Check what you've tried. Stay aligned with Goal.}
46
+
47
+ ---
48
+
49
+ ## Optional Sections (Add When Needed)
50
+
51
+ ### Planning Docs
52
+
53
+ {Only for complex features that need user stories, test definitions, design docs}
54
+
55
+ - .safeword/planning/user-stories/XXX-feature-name.md
56
+ - .safeword/planning/test-definitions/XXX-feature-name.md
57
+ - .safeword/planning/design/XXX-feature-name.md
58
+
59
+ ### Scope
60
+
61
+ {Only for complex features with unclear boundaries}
62
+
63
+ **In scope:**
64
+
65
+ -
66
+
67
+ **Out of scope:**
68
+
69
+ -
70
+
71
+ ### Acceptance Criteria
72
+
73
+ {Only for features or complex bugs where "done" isn't obvious}
74
+
75
+ - [ ]
76
+ - [ ]
77
+
78
+ ### Root Cause
79
+
80
+ {Only for bugs that required investigation}
81
+
82
+ {What caused this issue? Document for future reference.}
@@ -0,0 +1,92 @@
1
+ # User Stories: [Feature Name] (Issue #[number])
2
+
3
+ **Guide**: `@./.safeword/guides/user-story-guide.md` - Best practices, INVEST criteria, and examples
4
+ **Template**: `@./.safeword/templates/user-stories-template.md`
5
+
6
+ **Feature**: [Brief description of the feature]
7
+
8
+ **Related Issue**: #[number]
9
+ **Status**: [🚧 In Progress / ✅ Complete / ❌ Not Started] ([X/Y] stories complete)
10
+
11
+ ---
12
+
13
+ ## Technical Constraints
14
+
15
+ _Non-functional requirements that inform test definitions. Delete sections that don't apply._
16
+
17
+ ### Performance
18
+
19
+ - [ ] [e.g., Response time < 200ms at P95]
20
+
21
+ ### Security
22
+
23
+ - [ ] [e.g., All inputs validated/sanitized]
24
+
25
+ ### Compatibility
26
+
27
+ - [ ] [e.g., Chrome 100+, Safari 16+]
28
+
29
+ ### Data
30
+
31
+ - [ ] [e.g., GDPR: user data deletable within 72h]
32
+
33
+ ### Dependencies
34
+
35
+ - [ ] [e.g., Must use existing AuthService]
36
+
37
+ ### Infrastructure
38
+
39
+ - [ ] [e.g., Memory usage < 512MB]
40
+
41
+ ---
42
+
43
+ ## Story [N]: [Story Title]
44
+
45
+ **As a** [role]
46
+ **I want to** [capability]
47
+ **So that** [value]
48
+
49
+ **Acceptance Criteria**:
50
+
51
+ - [✅/❌] [criterion 1]
52
+ - [✅/❌] [criterion 2]
53
+ - [✅/❌] [criterion 3]
54
+
55
+ **Implementation Status**: [✅ Complete / 🚧 In Progress / ❌ Not Started]
56
+ **Tests**: [test file path and line numbers]
57
+
58
+ **Notes**: [Optional: design decisions, scope clarifications, or open questions]
59
+
60
+ ---
61
+
62
+ ## Story [N+1]: [Story Title]
63
+
64
+ **As a** [role]
65
+ **I want to** [capability]
66
+ **So that** [value]
67
+
68
+ **Acceptance Criteria**:
69
+
70
+ - [✅/❌] [criterion 1]
71
+ - [✅/❌] [criterion 2]
72
+
73
+ **Implementation Status**: [✅ Complete / 🚧 In Progress / ❌ Not Started]
74
+ **Tests**: [test file path]
75
+
76
+ ---
77
+
78
+ ## Summary
79
+
80
+ **Completed**: [N]/[M] stories ([X]%)
81
+ **Remaining**: [N]/[M] stories ([X]%)
82
+
83
+ ### [Phase Name]: [Description] [✅/❌]
84
+
85
+ - Story N: [Description]
86
+ - Story N+1: [Description]
87
+
88
+ ### [Phase Name]: [Description] [✅/❌]
89
+
90
+ - Story N+2: [Description]
91
+
92
+ **Next Steps**: [What needs to be done next to complete the feature]