safeword 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/{check-J6DFVBCE.js → check-FHNTC46G.js} +2 -2
  2. package/dist/check-FHNTC46G.js.map +1 -0
  3. package/dist/chunk-2XWIUEQK.js +190 -0
  4. package/dist/chunk-2XWIUEQK.js.map +1 -0
  5. package/dist/{chunk-UQMQ64CB.js → chunk-GZRQL3SX.js} +41 -2
  6. package/dist/chunk-GZRQL3SX.js.map +1 -0
  7. package/dist/cli.js +5 -5
  8. package/dist/{diff-U4IELWRL.js → diff-SPJ7BJBG.js} +31 -28
  9. package/dist/diff-SPJ7BJBG.js.map +1 -0
  10. package/dist/{reset-XETOHTCK.js → reset-3ACTIYYE.js} +44 -27
  11. package/dist/reset-3ACTIYYE.js.map +1 -0
  12. package/dist/{setup-CLDCHROZ.js → setup-ANC3NUOC.js} +76 -47
  13. package/dist/setup-ANC3NUOC.js.map +1 -0
  14. package/dist/{upgrade-DOKWRK7J.js → upgrade-3KVLLNDF.js} +37 -49
  15. package/dist/upgrade-3KVLLNDF.js.map +1 -0
  16. package/package.json +1 -1
  17. package/templates/SAFEWORD.md +776 -0
  18. package/templates/commands/arch-review.md +24 -0
  19. package/templates/commands/lint.md +11 -0
  20. package/templates/commands/quality-review.md +23 -0
  21. package/templates/doc-templates/architecture-template.md +136 -0
  22. package/templates/doc-templates/design-doc-template.md +134 -0
  23. package/templates/doc-templates/test-definitions-feature.md +131 -0
  24. package/templates/doc-templates/user-stories-template.md +92 -0
  25. package/templates/guides/architecture-guide.md +423 -0
  26. package/templates/guides/code-philosophy.md +195 -0
  27. package/templates/guides/context-files-guide.md +457 -0
  28. package/templates/guides/data-architecture-guide.md +200 -0
  29. package/templates/guides/design-doc-guide.md +171 -0
  30. package/templates/guides/learning-extraction.md +552 -0
  31. package/templates/guides/llm-instruction-design.md +248 -0
  32. package/templates/guides/llm-prompting.md +102 -0
  33. package/templates/guides/tdd-best-practices.md +615 -0
  34. package/templates/guides/test-definitions-guide.md +334 -0
  35. package/templates/guides/testing-methodology.md +618 -0
  36. package/templates/guides/user-story-guide.md +256 -0
  37. package/templates/guides/zombie-process-cleanup.md +219 -0
  38. package/templates/hooks/agents-md-check.sh +27 -0
  39. package/templates/hooks/inject-timestamp.sh +2 -3
  40. package/templates/hooks/post-tool.sh +4 -0
  41. package/templates/hooks/pre-commit.sh +10 -0
  42. package/templates/lib/common.sh +26 -0
  43. package/templates/lib/jq-fallback.sh +20 -0
  44. package/templates/markdownlint.jsonc +25 -0
  45. package/templates/prompts/arch-review.md +43 -0
  46. package/templates/prompts/quality-review.md +10 -0
  47. package/templates/skills/safeword-quality-reviewer/SKILL.md +207 -0
  48. package/dist/check-J6DFVBCE.js.map +0 -1
  49. package/dist/chunk-24OB57NJ.js +0 -78
  50. package/dist/chunk-24OB57NJ.js.map +0 -1
  51. package/dist/chunk-DB4CMUFD.js +0 -157
  52. package/dist/chunk-DB4CMUFD.js.map +0 -1
  53. package/dist/chunk-UQMQ64CB.js.map +0 -1
  54. package/dist/diff-U4IELWRL.js.map +0 -1
  55. package/dist/reset-XETOHTCK.js.map +0 -1
  56. package/dist/setup-CLDCHROZ.js.map +0 -1
  57. package/dist/upgrade-DOKWRK7J.js.map +0 -1
@@ -0,0 +1,171 @@
1
+ # Design Doc Guide for Claude Code
2
+
3
+ ## How to Fill Out Design Doc
4
+
5
+ **Template:** `@.safeword/templates/design-doc-template.md`
6
+
7
+ **When user asks:** "Create design doc for [feature]" or "Design [system/component]"
8
+
9
+ ---
10
+
11
+ ## What You Do
12
+
13
+ 1. **Verify Prerequisites**
14
+ - Confirm user stories exist (if not, create them first)
15
+ - Confirm test definitions exist (if not, create them first)
16
+ - Reference both in the design doc
17
+
18
+ 2. **Read Template**
19
+ - Read `@.safeword/templates/design-doc-template.md`
20
+ - Use it as the structure for the design doc
21
+
22
+ 3. **Fill In Sections**
23
+
24
+ **Architecture:**
25
+ - 1-2 paragraphs: High-level approach
26
+ - What are we building and how does it fit together?
27
+ - Add diagram if helpful (optional)
28
+
29
+ **Components:**
30
+ - Define Component [N] with full example (name, responsibility, interface, dependencies, tests)
31
+ - Define Component [N+1] with different example (show the [N]/[N+1] pattern)
32
+ - Add more components as needed (N+2, N+3, etc.)
33
+
34
+ **Data Model (if applicable):**
35
+ - State shape, database schema, or data structures
36
+ - Show relationships between types
37
+ - How data flows through the system
38
+
39
+ **Component Interaction (if applicable):**
40
+ - How components communicate
41
+ - Data flow between them (Component [N] → Component [N+1])
42
+ - Events/method calls
43
+
44
+ **User Flow:**
45
+ - Step-by-step user interaction
46
+ - Use concrete examples (e.g., "clicks 'Toggle AI Pane' button, presses Cmd+J")
47
+
48
+ **Key Decisions:**
49
+ - Decision [N]: What we're using/doing, why (with specifics), trade-off
50
+ - Decision [N+1]: Different decision (show the [N]/[N+1] pattern)
51
+ - Add more decisions as needed
52
+
53
+ **Implementation Notes (if applicable):**
54
+ - Constraints (technical limitations, performance requirements)
55
+ - Error Handling (how errors are caught, user-facing vs internal)
56
+ - Gotchas (edge cases, common mistakes)
57
+ - Open Questions (blocking questions, needs research)
58
+
59
+ **References (if applicable):**
60
+ - Link to relevant ADRs, external docs, proof of concepts
61
+
62
+ 4. **Save to Project**
63
+ - Save to `planning/design/[feature-name]-design.md` or similar location
64
+ - Follow project's convention for design doc location
65
+
66
+ ---
67
+
68
+ ## DO Include
69
+
70
+ - ✅ Clear component interfaces with TypeScript examples
71
+ - ✅ Full [N] and [N+1] examples (like user stories and test definitions templates)
72
+ - ✅ References to user stories and test definitions (don't duplicate them)
73
+ - ✅ User flow with concrete examples
74
+ - ✅ Key decisions with "what, why, trade-off"
75
+ - ✅ Rationale with specifics (metrics, benchmarks, analysis)
76
+
77
+ ---
78
+
79
+ ## DON'T Include
80
+
81
+ - ❌ Duplicating user stories (reference them instead)
82
+ - ❌ Duplicating test definitions (reference them instead)
83
+ - ❌ Project-wide architecture decisions (those go in ARCHITECTURE.md)
84
+ - ❌ Implementation details that should be in code comments
85
+ - ❌ Generic advice without project-specific context
86
+
87
+ ---
88
+
89
+ ## When to Use Design Doc vs Architecture Doc
90
+
91
+ **Use Design Doc when:**
92
+
93
+ - Designing a specific feature implementation
94
+ - Need component breakdown and interactions
95
+ - Feature-specific technical decisions
96
+ - 2-3 pages (~121 lines)
97
+
98
+ **Use Architecture Doc when:**
99
+
100
+ - Project-wide technology choices
101
+ - Data model for entire system
102
+ - Principles and patterns for the whole project
103
+ - Comprehensive (10+ pages)
104
+
105
+ **Reference:** `@.safeword/guides/architecture-guide.md` for detailed comparison
106
+
107
+ ---
108
+
109
+ ## Re-evaluation Path (When Unclear)
110
+
111
+ **If unsure whether feature needs a design doc:**
112
+
113
+ 1. **Count components** — Does implementation touch >3 components?
114
+ - Yes → Design doc needed
115
+ - No → Continue to question 2
116
+
117
+ 2. **Check user story count** — Does feature span 2+ user stories?
118
+ - Yes → Design doc needed
119
+ - No → Continue to question 3
120
+
121
+ 3. **Check complexity signals** — Any of these present?
122
+ - New data model or schema changes
123
+ - Non-obvious component interactions
124
+ - Multiple technical decisions with trade-offs
125
+ - Yes to any → Design doc needed
126
+ - No to all → Skip design doc, implement directly
127
+
128
+ **If prerequisites don't exist:**
129
+
130
+ 1. User stories missing → Create them first (guide: `@.safeword/guides/user-story-guide.md`)
131
+ 2. Test definitions missing → Create them after user stories (guide: `@.safeword/guides/test-definitions-guide.md`)
132
+ 3. Then create design doc referencing both
133
+
134
+ ---
135
+
136
+ ## Example Commands
137
+
138
+ **Creating design doc:**
139
+
140
+ ```
141
+ User: "Create design doc for three-pane layout"
142
+ You: [Read user stories and test definitions, then create design doc]
143
+ ```
144
+
145
+ **Updating design doc:**
146
+
147
+ ```
148
+ User: "Update design doc to add error handling section"
149
+ You: [Read existing design doc, add Implementation Notes section with error handling]
150
+ ```
151
+
152
+ ---
153
+
154
+ ## Quality Checklist
155
+
156
+ Before saving, verify:
157
+
158
+ - ✓ References user stories and test definitions (not duplicates them)
159
+ - ✓ Has Component [N] and Component [N+1] examples
160
+ - ✓ User flow has concrete examples
161
+ - ✓ Key decisions have "what, why, trade-off"
162
+ - ✓ All optional sections marked "(if applicable)"
163
+ - ✓ ~121 lines (concise, LLM-optimized)
164
+
165
+ ---
166
+
167
+ ## LLM Instruction Design
168
+
169
+ **Important:** Design docs are instructions that LLMs read and follow.
170
+
171
+ **See:** `@.safeword/guides/llm-instruction-design.md` for comprehensive framework on writing clear, actionable documentation that LLMs can reliably follow.