safeword 0.2.4 → 0.2.6
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/dist/check-3NGQ4NR5.js +129 -0
- package/dist/check-3NGQ4NR5.js.map +1 -0
- package/dist/chunk-2XWIUEQK.js +190 -0
- package/dist/chunk-2XWIUEQK.js.map +1 -0
- package/dist/chunk-GZRQL3SX.js +146 -0
- package/dist/chunk-GZRQL3SX.js.map +1 -0
- package/dist/chunk-ORQHKDT2.js +10 -0
- package/dist/chunk-ORQHKDT2.js.map +1 -0
- package/dist/chunk-W66Z3C5H.js +21 -0
- package/dist/chunk-W66Z3C5H.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +34 -0
- package/dist/cli.js.map +1 -0
- package/dist/diff-Y6QTAW4O.js +166 -0
- package/dist/diff-Y6QTAW4O.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/reset-3ACTIYYE.js +143 -0
- package/dist/reset-3ACTIYYE.js.map +1 -0
- package/dist/setup-AIL5RL45.js +276 -0
- package/dist/setup-AIL5RL45.js.map +1 -0
- package/dist/upgrade-6AR3DHUV.js +134 -0
- package/dist/upgrade-6AR3DHUV.js.map +1 -0
- package/package.json +44 -19
- package/{.safeword → templates}/hooks/agents-md-check.sh +0 -0
- package/{.safeword → templates}/hooks/post-tool.sh +0 -0
- package/{.safeword → templates}/hooks/pre-commit.sh +0 -0
- package/.claude/commands/arch-review.md +0 -32
- package/.claude/commands/lint.md +0 -6
- package/.claude/commands/quality-review.md +0 -13
- package/.claude/commands/setup-linting.md +0 -6
- package/.claude/hooks/auto-lint.sh +0 -6
- package/.claude/hooks/auto-quality-review.sh +0 -170
- package/.claude/hooks/check-linting-sync.sh +0 -17
- package/.claude/hooks/inject-timestamp.sh +0 -6
- package/.claude/hooks/question-protocol.sh +0 -12
- package/.claude/hooks/run-linters.sh +0 -8
- package/.claude/hooks/run-quality-review.sh +0 -76
- package/.claude/hooks/version-check.sh +0 -10
- package/.claude/mcp/README.md +0 -96
- package/.claude/mcp/arcade.sample.json +0 -9
- package/.claude/mcp/context7.sample.json +0 -7
- package/.claude/mcp/playwright.sample.json +0 -7
- package/.claude/settings.json +0 -62
- package/.claude/skills/quality-reviewer/SKILL.md +0 -190
- package/.claude/skills/safeword-quality-reviewer/SKILL.md +0 -13
- package/.env.arcade.example +0 -4
- package/.env.example +0 -11
- package/.gitmodules +0 -4
- package/.safeword/SAFEWORD.md +0 -33
- package/.safeword/eslint/eslint-base.mjs +0 -101
- package/.safeword/guides/architecture-guide.md +0 -404
- package/.safeword/guides/code-philosophy.md +0 -174
- package/.safeword/guides/context-files-guide.md +0 -405
- package/.safeword/guides/data-architecture-guide.md +0 -183
- package/.safeword/guides/design-doc-guide.md +0 -165
- package/.safeword/guides/learning-extraction.md +0 -515
- package/.safeword/guides/llm-instruction-design.md +0 -239
- package/.safeword/guides/llm-prompting.md +0 -95
- package/.safeword/guides/tdd-best-practices.md +0 -570
- package/.safeword/guides/test-definitions-guide.md +0 -243
- package/.safeword/guides/testing-methodology.md +0 -573
- package/.safeword/guides/user-story-guide.md +0 -237
- package/.safeword/guides/zombie-process-cleanup.md +0 -214
- package/.safeword/planning/002-user-story-quality-evaluation.md +0 -1840
- package/.safeword/planning/003-langsmith-eval-setup-prompt.md +0 -363
- package/.safeword/planning/004-llm-eval-test-cases.md +0 -3226
- package/.safeword/planning/005-architecture-enforcement-system.md +0 -169
- package/.safeword/planning/006-reactive-fix-prevention-research.md +0 -135
- package/.safeword/planning/011-cli-ux-vision.md +0 -330
- package/.safeword/planning/012-project-structure-cleanup.md +0 -154
- package/.safeword/planning/README.md +0 -39
- package/.safeword/planning/automation-plan-v2.md +0 -1225
- package/.safeword/planning/automation-plan-v3.md +0 -1291
- package/.safeword/planning/automation-plan.md +0 -3058
- package/.safeword/planning/design/005-cli-implementation.md +0 -343
- package/.safeword/planning/design/013-cli-self-contained-templates.md +0 -596
- package/.safeword/planning/design/013a-eslint-plugin-suite.md +0 -256
- package/.safeword/planning/design/013b-implementation-snippets.md +0 -385
- package/.safeword/planning/design/013c-config-isolation-strategy.md +0 -242
- package/.safeword/planning/design/code-philosophy-improvements.md +0 -60
- package/.safeword/planning/mcp-analysis.md +0 -545
- package/.safeword/planning/phase2-subagents-vs-skills-analysis.md +0 -451
- package/.safeword/planning/settings-improvements.md +0 -970
- package/.safeword/planning/test-definitions/005-cli-implementation.md +0 -1301
- package/.safeword/planning/test-definitions/cli-self-contained-templates.md +0 -205
- package/.safeword/planning/user-stories/001-guides-review-user-stories.md +0 -1381
- package/.safeword/planning/user-stories/003-reactive-fix-prevention.md +0 -132
- package/.safeword/planning/user-stories/004-technical-constraints.md +0 -86
- package/.safeword/planning/user-stories/005-cli-implementation.md +0 -311
- package/.safeword/planning/user-stories/cli-self-contained-templates.md +0 -172
- package/.safeword/planning/versioned-distribution.md +0 -740
- package/.safeword/prompts/arch-review.md +0 -43
- package/.safeword/prompts/quality-review.md +0 -11
- package/.safeword/scripts/arch-review.sh +0 -235
- package/.safeword/scripts/check-linting-sync.sh +0 -58
- package/.safeword/scripts/setup-linting.sh +0 -559
- package/.safeword/templates/architecture-template.md +0 -136
- package/.safeword/templates/ci/architecture-check.yml +0 -79
- package/.safeword/templates/design-doc-template.md +0 -127
- package/.safeword/templates/test-definitions-feature.md +0 -100
- package/.safeword/templates/ticket-template.md +0 -74
- package/.safeword/templates/user-stories-template.md +0 -82
- package/.safeword/tickets/001-guides-review-user-stories.md +0 -83
- package/.safeword/tickets/002-architecture-enforcement.md +0 -211
- package/.safeword/tickets/003-reactive-fix-prevention.md +0 -57
- package/.safeword/tickets/004-technical-constraints-in-user-stories.md +0 -39
- package/.safeword/tickets/005-cli-implementation.md +0 -248
- package/.safeword/tickets/006-flesh-out-skills.md +0 -43
- package/.safeword/tickets/007-flesh-out-questioning.md +0 -44
- package/.safeword/tickets/008-upgrade-questioning.md +0 -58
- package/.safeword/tickets/009-naming-conventions.md +0 -41
- package/.safeword/tickets/010-safeword-md-cleanup.md +0 -34
- package/.safeword/tickets/011-cursor-setup.md +0 -86
- package/.safeword/tickets/README.md +0 -73
- package/.safeword/version +0 -1
- package/AGENTS.md +0 -59
- package/CLAUDE.md +0 -12
- package/README.md +0 -347
- package/docs/001-cli-implementation-plan.md +0 -856
- package/docs/elite-dx-implementation-plan.md +0 -1034
- package/framework/README.md +0 -131
- package/framework/mcp/README.md +0 -96
- package/framework/mcp/arcade.sample.json +0 -8
- package/framework/mcp/context7.sample.json +0 -6
- package/framework/mcp/playwright.sample.json +0 -6
- package/framework/scripts/arch-review.sh +0 -235
- package/framework/scripts/check-linting-sync.sh +0 -58
- package/framework/scripts/load-env.sh +0 -49
- package/framework/scripts/setup-claude.sh +0 -223
- package/framework/scripts/setup-linting.sh +0 -559
- package/framework/scripts/setup-quality.sh +0 -477
- package/framework/scripts/setup-safeword.sh +0 -550
- package/framework/templates/ci/architecture-check.yml +0 -78
- package/learnings/ai-sdk-v5-breaking-changes.md +0 -178
- package/learnings/e2e-test-zombie-processes.md +0 -231
- package/learnings/milkdown-crepe-editor-property.md +0 -96
- package/learnings/prosemirror-fragment-traversal.md +0 -119
- package/packages/cli/AGENTS.md +0 -1
- package/packages/cli/ARCHITECTURE.md +0 -279
- package/packages/cli/package.json +0 -51
- package/packages/cli/src/cli.ts +0 -63
- package/packages/cli/src/commands/check.ts +0 -166
- package/packages/cli/src/commands/diff.ts +0 -209
- package/packages/cli/src/commands/reset.ts +0 -190
- package/packages/cli/src/commands/setup.ts +0 -325
- package/packages/cli/src/commands/upgrade.ts +0 -163
- package/packages/cli/src/index.ts +0 -3
- package/packages/cli/src/templates/config.ts +0 -58
- package/packages/cli/src/templates/content.ts +0 -18
- package/packages/cli/src/templates/index.ts +0 -12
- package/packages/cli/src/utils/agents-md.ts +0 -66
- package/packages/cli/src/utils/fs.ts +0 -179
- package/packages/cli/src/utils/git.ts +0 -124
- package/packages/cli/src/utils/hooks.ts +0 -29
- package/packages/cli/src/utils/output.ts +0 -60
- package/packages/cli/src/utils/project-detector.test.ts +0 -185
- package/packages/cli/src/utils/project-detector.ts +0 -44
- package/packages/cli/src/utils/version.ts +0 -28
- package/packages/cli/src/version.ts +0 -6
- package/packages/cli/templates/SAFEWORD.md +0 -776
- package/packages/cli/templates/doc-templates/architecture-template.md +0 -136
- package/packages/cli/templates/doc-templates/design-doc-template.md +0 -134
- package/packages/cli/templates/doc-templates/test-definitions-feature.md +0 -131
- package/packages/cli/templates/doc-templates/ticket-template.md +0 -82
- package/packages/cli/templates/doc-templates/user-stories-template.md +0 -92
- package/packages/cli/templates/guides/architecture-guide.md +0 -423
- package/packages/cli/templates/guides/code-philosophy.md +0 -195
- package/packages/cli/templates/guides/context-files-guide.md +0 -457
- package/packages/cli/templates/guides/data-architecture-guide.md +0 -200
- package/packages/cli/templates/guides/design-doc-guide.md +0 -171
- package/packages/cli/templates/guides/learning-extraction.md +0 -552
- package/packages/cli/templates/guides/llm-instruction-design.md +0 -248
- package/packages/cli/templates/guides/llm-prompting.md +0 -102
- package/packages/cli/templates/guides/tdd-best-practices.md +0 -615
- package/packages/cli/templates/guides/test-definitions-guide.md +0 -334
- package/packages/cli/templates/guides/testing-methodology.md +0 -618
- package/packages/cli/templates/guides/user-story-guide.md +0 -256
- package/packages/cli/templates/guides/zombie-process-cleanup.md +0 -219
- package/packages/cli/templates/hooks/agents-md-check.sh +0 -27
- package/packages/cli/templates/hooks/post-tool.sh +0 -4
- package/packages/cli/templates/hooks/pre-commit.sh +0 -10
- package/packages/cli/templates/prompts/arch-review.md +0 -43
- package/packages/cli/templates/prompts/quality-review.md +0 -10
- package/packages/cli/templates/skills/safeword-quality-reviewer/SKILL.md +0 -207
- package/packages/cli/tests/commands/check.test.ts +0 -129
- package/packages/cli/tests/commands/cli.test.ts +0 -89
- package/packages/cli/tests/commands/diff.test.ts +0 -115
- package/packages/cli/tests/commands/reset.test.ts +0 -310
- package/packages/cli/tests/commands/self-healing.test.ts +0 -170
- package/packages/cli/tests/commands/setup-blocking.test.ts +0 -71
- package/packages/cli/tests/commands/setup-core.test.ts +0 -135
- package/packages/cli/tests/commands/setup-git.test.ts +0 -139
- package/packages/cli/tests/commands/setup-hooks.test.ts +0 -334
- package/packages/cli/tests/commands/setup-linting.test.ts +0 -189
- package/packages/cli/tests/commands/setup-noninteractive.test.ts +0 -80
- package/packages/cli/tests/commands/setup-templates.test.ts +0 -181
- package/packages/cli/tests/commands/upgrade.test.ts +0 -215
- package/packages/cli/tests/helpers.ts +0 -243
- package/packages/cli/tests/npm-package.test.ts +0 -83
- package/packages/cli/tests/technical-constraints.test.ts +0 -96
- package/packages/cli/tsconfig.json +0 -25
- package/packages/cli/tsup.config.ts +0 -11
- package/packages/cli/vitest.config.ts +0 -23
- package/promptfoo.yaml +0 -3270
- /package/{framework → templates}/SAFEWORD.md +0 -0
- /package/{packages/cli/templates → templates}/commands/arch-review.md +0 -0
- /package/{packages/cli/templates → templates}/commands/lint.md +0 -0
- /package/{packages/cli/templates → templates}/commands/quality-review.md +0 -0
- /package/{framework/templates → templates/doc-templates}/architecture-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/design-doc-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/test-definitions-feature.md +0 -0
- /package/{framework/templates → templates/doc-templates}/ticket-template.md +0 -0
- /package/{framework/templates → templates/doc-templates}/user-stories-template.md +0 -0
- /package/{framework → templates}/guides/architecture-guide.md +0 -0
- /package/{framework → templates}/guides/code-philosophy.md +0 -0
- /package/{framework → templates}/guides/context-files-guide.md +0 -0
- /package/{framework → templates}/guides/data-architecture-guide.md +0 -0
- /package/{framework → templates}/guides/design-doc-guide.md +0 -0
- /package/{framework → templates}/guides/learning-extraction.md +0 -0
- /package/{framework → templates}/guides/llm-instruction-design.md +0 -0
- /package/{framework → templates}/guides/llm-prompting.md +0 -0
- /package/{framework → templates}/guides/tdd-best-practices.md +0 -0
- /package/{framework → templates}/guides/test-definitions-guide.md +0 -0
- /package/{framework → templates}/guides/testing-methodology.md +0 -0
- /package/{framework → templates}/guides/user-story-guide.md +0 -0
- /package/{framework → templates}/guides/zombie-process-cleanup.md +0 -0
- /package/{packages/cli/templates → templates}/hooks/inject-timestamp.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/common.sh +0 -0
- /package/{packages/cli/templates → templates}/lib/jq-fallback.sh +0 -0
- /package/{packages/cli/templates → templates}/markdownlint.jsonc +0 -0
- /package/{framework → templates}/prompts/arch-review.md +0 -0
- /package/{framework → templates}/prompts/quality-review.md +0 -0
- /package/{framework/skills/quality-reviewer → templates/skills/safeword-quality-reviewer}/SKILL.md +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# User Stories: Reactive Fix Prevention
|
|
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**: Prevent AI agents from falling into reactive "error-fix-error" loops
|
|
7
|
-
|
|
8
|
-
**Related Issue**: Ticket #003
|
|
9
|
-
**Status**: ❌ Not Started (0/5 stories complete)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Story 1: Mandatory Architecture Context Loading
|
|
14
|
-
|
|
15
|
-
**As a** developer using an AI coding agent
|
|
16
|
-
**I want** the agent to load ARCHITECTURE.md before attempting any fix
|
|
17
|
-
**So that** fixes respect the system's layers and boundaries
|
|
18
|
-
|
|
19
|
-
**Acceptance Criteria**:
|
|
20
|
-
|
|
21
|
-
- [ ] Agent reads ARCHITECTURE.md (if exists) before proposing any error fix
|
|
22
|
-
- [ ] Agent identifies which layer the error occurs in
|
|
23
|
-
- [ ] Agent notes which layers the fix might affect
|
|
24
|
-
- [ ] If no ARCHITECTURE.md exists, agent proceeds with extra caution on multi-file changes
|
|
25
|
-
|
|
26
|
-
**Implementation Status**: ❌ Not Started
|
|
27
|
-
**Tests**: N/A (guidance-only, no automated tests)
|
|
28
|
-
|
|
29
|
-
**Notes**: Add to SAFEWORD.md "Before ANY Error Fix" section
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## Story 2: Reactive Fix Detection
|
|
34
|
-
|
|
35
|
-
**As a** developer using an AI coding agent
|
|
36
|
-
**I want** the agent to STOP after 2 failed fix attempts and use systematic-debugging
|
|
37
|
-
**So that** the agent doesn't continue guessing and creating new problems
|
|
38
|
-
|
|
39
|
-
**Acceptance Criteria**:
|
|
40
|
-
|
|
41
|
-
- [ ] After 1st failed fix, agent notes "2nd attempt—consider systematic-debugging"
|
|
42
|
-
- [ ] After 2nd failed fix, agent MUST stop and invoke systematic-debugging skill
|
|
43
|
-
- [ ] Agent completes Phase 1 (Root Cause Investigation) before any further fixes
|
|
44
|
-
- [ ] Agent documents findings before proceeding
|
|
45
|
-
|
|
46
|
-
**Implementation Status**: ❌ Not Started
|
|
47
|
-
**Tests**: N/A (guidance-only)
|
|
48
|
-
|
|
49
|
-
**Notes**: Aligns with existing systematic-debugging "3+ fixes" rule—this makes it stricter (2 fixes)
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Story 3: Blast Radius Awareness
|
|
54
|
-
|
|
55
|
-
**As a** developer using an AI coding agent
|
|
56
|
-
**I want** the agent to pause and ask before changes affecting 4+ files
|
|
57
|
-
**So that** sweeping changes don't violate architectural boundaries
|
|
58
|
-
|
|
59
|
-
**Acceptance Criteria**:
|
|
60
|
-
|
|
61
|
-
- [ ] Before modifying 4+ files, agent stops and summarizes proposed changes
|
|
62
|
-
- [ ] Agent explains why this many files need changing
|
|
63
|
-
- [ ] Agent asks: "This affects N files across [layers]. Proceed?"
|
|
64
|
-
- [ ] If approved, agent makes atomic commits after each file
|
|
65
|
-
|
|
66
|
-
**Implementation Status**: ❌ Not Started
|
|
67
|
-
**Tests**: N/A (guidance-only)
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Story 4: Fix Cascade Detection
|
|
72
|
-
|
|
73
|
-
**As a** developer using an AI coding agent
|
|
74
|
-
**I want** the agent to recognize when fixes are cascading across files
|
|
75
|
-
**So that** architectural problems are caught early instead of chased endlessly
|
|
76
|
-
|
|
77
|
-
**Acceptance Criteria**:
|
|
78
|
-
|
|
79
|
-
- [ ] When fix A reveals problem B in different file, agent notes the cascade
|
|
80
|
-
- [ ] When fix B reveals problem C in yet another file, agent MUST stop
|
|
81
|
-
- [ ] Agent documents: "Fixes cascading across files—possible architectural issue"
|
|
82
|
-
- [ ] Agent discusses with user before continuing
|
|
83
|
-
|
|
84
|
-
**Implementation Status**: ❌ Not Started
|
|
85
|
-
**Tests**: N/A (guidance-only)
|
|
86
|
-
|
|
87
|
-
**Notes**: This is the core "error-fix-error" pattern we're trying to break
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Story 5: Workaround Flagging
|
|
92
|
-
|
|
93
|
-
**As a** developer using an AI coding agent
|
|
94
|
-
**I want** workarounds to be explicitly flagged
|
|
95
|
-
**So that** workarounds are conscious decisions, not hidden debt
|
|
96
|
-
|
|
97
|
-
**Acceptance Criteria**:
|
|
98
|
-
|
|
99
|
-
- [ ] When adding code that works around a problem (catch-ignore, special case, duplication, setTimeout), agent flags it
|
|
100
|
-
- [ ] Agent adds comment: `// WORKAROUND: [reason] - TODO: [proper fix]`
|
|
101
|
-
- [ ] Agent tells user: "Adding workaround for [X]. Proper fix would be [Y]."
|
|
102
|
-
- [ ] Agent asks if workaround is acceptable
|
|
103
|
-
|
|
104
|
-
**Implementation Status**: ❌ Not Started
|
|
105
|
-
**Tests**: N/A (guidance-only)
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
## Summary
|
|
110
|
-
|
|
111
|
-
**Completed**: 0/5 stories (0%)
|
|
112
|
-
**Remaining**: 5/5 stories (100%)
|
|
113
|
-
|
|
114
|
-
### Phase 1: Core Prevention ❌
|
|
115
|
-
|
|
116
|
-
- Story 2: Reactive Fix Detection (P0)
|
|
117
|
-
- Story 4: Fix Cascade Detection (P0)
|
|
118
|
-
|
|
119
|
-
### Phase 2: Context & Awareness ❌
|
|
120
|
-
|
|
121
|
-
- Story 1: Architecture Context Loading (P1)
|
|
122
|
-
- Story 3: Blast Radius Awareness (P1)
|
|
123
|
-
|
|
124
|
-
### Phase 3: Debt Visibility ❌
|
|
125
|
-
|
|
126
|
-
- Story 5: Workaround Flagging (P2)
|
|
127
|
-
|
|
128
|
-
**Next Steps**:
|
|
129
|
-
|
|
130
|
-
1. Draft "Before ANY Error Fix" section for SAFEWORD.md
|
|
131
|
-
2. Draft "Red Flags (Stop and Think)" section for SAFEWORD.md
|
|
132
|
-
3. Update systematic-debugging skill with architecture context loading
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
# User Stories: Technical Constraints in TDD (Ticket #004)
|
|
2
|
-
|
|
3
|
-
**Guide**: `@./.safeword/guides/user-story-guide.md`
|
|
4
|
-
**Template**: `@./.safeword/templates/user-stories-template.md`
|
|
5
|
-
|
|
6
|
-
**Feature**: Add Technical Constraints section to user stories to capture NFRs before test definitions
|
|
7
|
-
|
|
8
|
-
**Related Issue**: #004
|
|
9
|
-
**Status**: ✅ Complete (3/3 stories complete)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Technical Constraints
|
|
14
|
-
|
|
15
|
-
_N/A — Documentation-only change, no runtime behavior._
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Story 1: Capture Technical Constraints in User Stories
|
|
20
|
-
|
|
21
|
-
**As a** developer using TDD workflow
|
|
22
|
-
**I want to** document technical constraints (performance, security, compatibility) alongside user stories
|
|
23
|
-
**So that** test definitions are informed by NFRs from the start
|
|
24
|
-
|
|
25
|
-
**Acceptance Criteria**:
|
|
26
|
-
|
|
27
|
-
- [✅] User stories template has Technical Constraints section
|
|
28
|
-
- [✅] Section includes categories: Performance, Security, Compatibility, Data, Dependencies, Infrastructure
|
|
29
|
-
- [✅] Each constraint is a checkbox for tracking
|
|
30
|
-
- [✅] Template notes "delete sections that don't apply"
|
|
31
|
-
|
|
32
|
-
**Implementation Status**: ✅ Complete
|
|
33
|
-
**Tests**: N/A (documentation change)
|
|
34
|
-
|
|
35
|
-
**Notes**: Chose to add constraints to user stories (Option A) vs separate doc (Option B) for simplicity.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Story 2: Guide Users on Filling Out Constraints
|
|
40
|
-
|
|
41
|
-
**As a** developer creating user stories
|
|
42
|
-
**I want to** understand what makes a good technical constraint
|
|
43
|
-
**So that** I write specific, testable constraints (not vague requirements)
|
|
44
|
-
|
|
45
|
-
**Acceptance Criteria**:
|
|
46
|
-
|
|
47
|
-
- [✅] User story guide has "Technical Constraints Section" with guidance
|
|
48
|
-
- [✅] Categories table explains what each category captures
|
|
49
|
-
- [✅] Good/bad examples show specific vs vague constraints
|
|
50
|
-
- [✅] Decision rule clarifies when to include/skip constraints
|
|
51
|
-
|
|
52
|
-
**Implementation Status**: ✅ Complete
|
|
53
|
-
**Tests**: N/A (documentation change)
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Story 3: Integrate Constraints into TDD Workflow
|
|
58
|
-
|
|
59
|
-
**As an** AI coding agent following SAFEWORD.md
|
|
60
|
-
**I want to** see constraints mentioned in the TDD workflow
|
|
61
|
-
**So that** I don't skip them when creating user stories
|
|
62
|
-
|
|
63
|
-
**Acceptance Criteria**:
|
|
64
|
-
|
|
65
|
-
- [✅] SAFEWORD.md workflow step 1 mentions "Technical Constraints"
|
|
66
|
-
- [✅] Creating user stories trigger includes "fill in constraints"
|
|
67
|
-
- [✅] Edge cases include "user stories missing Technical Constraints"
|
|
68
|
-
- [✅] TDD best practices has example with constraints
|
|
69
|
-
|
|
70
|
-
**Implementation Status**: ✅ Complete
|
|
71
|
-
**Tests**: N/A (documentation change)
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Summary
|
|
76
|
-
|
|
77
|
-
**Completed**: 3/3 stories (100%)
|
|
78
|
-
**Remaining**: 0/3 stories (0%)
|
|
79
|
-
|
|
80
|
-
### Phase 1: Core Implementation ✅
|
|
81
|
-
|
|
82
|
-
- Story 1: Template update
|
|
83
|
-
- Story 2: Guide update
|
|
84
|
-
- Story 3: Workflow integration
|
|
85
|
-
|
|
86
|
-
**Next Steps**: User confirmation, then sync framework/SAFEWORD.md to .safeword/SAFEWORD.md
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
# User Stories: Safeword CLI (Issue #1)
|
|
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**: TypeScript CLI (`safeword`) that replaces bash scripts with elite developer experience for setup, verification, and team onboarding.
|
|
7
|
-
|
|
8
|
-
**Related Issue**: #1 (GitHub)
|
|
9
|
-
**Status**: ❌ Not Started (0/12 stories complete)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Technical Constraints
|
|
14
|
-
|
|
15
|
-
### Performance
|
|
16
|
-
- [ ] CLI startup time < 500ms (no heavy imports at top level)
|
|
17
|
-
- [ ] Setup completes < 30s on average project
|
|
18
|
-
- [ ] Version check timeout: 3s max before graceful fallback
|
|
19
|
-
|
|
20
|
-
### Compatibility
|
|
21
|
-
- [ ] Node.js 18+ (LTS)
|
|
22
|
-
- [ ] macOS, Linux, Windows (WSL2)
|
|
23
|
-
- [ ] Works with pnpm, npm, yarn, bun
|
|
24
|
-
- [ ] Git optional (graceful degradation)
|
|
25
|
-
|
|
26
|
-
### Dependencies
|
|
27
|
-
- [ ] Minimal runtime dependencies (prefer Node built-ins)
|
|
28
|
-
- [ ] Must integrate with existing `.claude/settings.json` structure
|
|
29
|
-
- [ ] Must preserve existing Claude Code hooks (append, don't replace)
|
|
30
|
-
- [ ] Must preserve existing git pre-commit hooks (marker-based)
|
|
31
|
-
|
|
32
|
-
### Infrastructure
|
|
33
|
-
- [ ] Published to npm as `safeword`
|
|
34
|
-
- [ ] Executable via `npx safeword`
|
|
35
|
-
- [ ] No global install required
|
|
36
|
-
|
|
37
|
-
### Exit Codes
|
|
38
|
-
- [ ] Exit 0 = success (warnings acceptable)
|
|
39
|
-
- [ ] Exit 1 = core failure (linting fails, can't write files, unconfigured for diff/upgrade)
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Story 1: Version and Help
|
|
44
|
-
|
|
45
|
-
**As a** developer discovering safeword
|
|
46
|
-
**I want to** see version and help information
|
|
47
|
-
**So that** I can learn what commands are available
|
|
48
|
-
|
|
49
|
-
**Acceptance Criteria**:
|
|
50
|
-
- [ ] `npx safeword --version` shows CLI version (e.g., "1.2.0")
|
|
51
|
-
- [ ] `npx safeword --help` shows help with all commands and flags
|
|
52
|
-
- [ ] `npx safeword` (bare command) shows help
|
|
53
|
-
- [ ] Help includes: setup, check, upgrade, diff, reset commands
|
|
54
|
-
- [ ] Help includes: --version, --help, --yes, --verbose, --offline flags
|
|
55
|
-
|
|
56
|
-
**Implementation Status**: ❌ Not Started
|
|
57
|
-
**Tests**: TBD
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Story 2: First-Time Setup - Core Files
|
|
62
|
-
|
|
63
|
-
**As a** developer setting up a new project
|
|
64
|
-
**I want to** run `npx safeword setup` to install core files
|
|
65
|
-
**So that** I get safeword templates, guides, and configuration
|
|
66
|
-
|
|
67
|
-
**Acceptance Criteria**:
|
|
68
|
-
- [ ] Creates `.safeword/` directory with all templates
|
|
69
|
-
- [ ] Creates `.safeword/version` file with CLI version
|
|
70
|
-
- [ ] Prepends link to `AGENTS.md`: `**⚠️ ALWAYS READ FIRST: @./.safeword/SAFEWORD.md**`
|
|
71
|
-
- [ ] Creates `AGENTS.md` if it doesn't exist
|
|
72
|
-
- [ ] Checks for duplicate link before prepending (no duplicates)
|
|
73
|
-
- [ ] Prints summary of files created
|
|
74
|
-
|
|
75
|
-
**Implementation Status**: ❌ Not Started
|
|
76
|
-
**Tests**: TBD
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Story 3: First-Time Setup - Hooks and Skills
|
|
81
|
-
|
|
82
|
-
**As a** developer setting up a new project
|
|
83
|
-
**I want to** setup to register Claude Code hooks and skills
|
|
84
|
-
**So that** I get automated linting, quality review, and AGENTS.md protection
|
|
85
|
-
|
|
86
|
-
**Acceptance Criteria**:
|
|
87
|
-
- [ ] Registers hooks in `.claude/settings.json` (SessionStart, PostToolUse, Stop, etc.)
|
|
88
|
-
- [ ] Copies skills to `.claude/skills/safeword-*/`
|
|
89
|
-
- [ ] Preserves any existing hooks in `.claude/settings.json` (appends, doesn't replace)
|
|
90
|
-
- [ ] Includes SessionStart hook for AGENTS.md verification
|
|
91
|
-
- [ ] Exit 1 if hook registration fails
|
|
92
|
-
|
|
93
|
-
**Implementation Status**: ❌ Not Started
|
|
94
|
-
**Tests**: TBD
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Story 4: First-Time Setup - Linting
|
|
99
|
-
|
|
100
|
-
**As a** developer setting up a new project
|
|
101
|
-
**I want to** setup to configure linting automatically
|
|
102
|
-
**So that** I get ESLint + Prettier working without manual configuration
|
|
103
|
-
|
|
104
|
-
**Acceptance Criteria**:
|
|
105
|
-
- [ ] Detects project type (Next.js, React, TypeScript, etc.) from package.json
|
|
106
|
-
- [ ] Installs ESLint + Prettier as devDependencies
|
|
107
|
-
- [ ] Creates `eslint.config.mjs` configured for detected project type
|
|
108
|
-
- [ ] Creates `.prettierrc` with standard config
|
|
109
|
-
- [ ] Adds `"lint": "eslint ."` script to package.json
|
|
110
|
-
- [ ] Adds `"format": "prettier --write ."` script to package.json
|
|
111
|
-
- [ ] Exit 1 if linting setup fails (core failure)
|
|
112
|
-
|
|
113
|
-
**Implementation Status**: ❌ Not Started
|
|
114
|
-
**Tests**: TBD
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Story 5: Setup Blocks on Existing Config
|
|
119
|
-
|
|
120
|
-
**As a** developer who already has safeword configured
|
|
121
|
-
**I want to** see a clear error when running `setup` again
|
|
122
|
-
**So that** I don't accidentally overwrite my configuration
|
|
123
|
-
|
|
124
|
-
**Acceptance Criteria**:
|
|
125
|
-
- [ ] Running `npx safeword setup` when `.safeword/` exists shows error
|
|
126
|
-
- [ ] Error message: "Already configured. Run `safeword upgrade` to update."
|
|
127
|
-
- [ ] Exit code is 1
|
|
128
|
-
- [ ] No files are modified
|
|
129
|
-
|
|
130
|
-
**Implementation Status**: ❌ Not Started
|
|
131
|
-
**Tests**: TBD
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Story 6: Non-Interactive Setup
|
|
136
|
-
|
|
137
|
-
**As a** developer running setup in CI or scripts
|
|
138
|
-
**I want to** setup to work without prompts
|
|
139
|
-
**So that** I can automate project initialization
|
|
140
|
-
|
|
141
|
-
**Acceptance Criteria**:
|
|
142
|
-
- [ ] No TTY detected → uses defaults automatically (no prompts)
|
|
143
|
-
- [ ] `--yes` flag → forces defaults even in terminal
|
|
144
|
-
- [ ] Default for git prompt: skip init, show warning
|
|
145
|
-
- [ ] Setup completes without user interaction
|
|
146
|
-
- [ ] Warning shown when git skipped: "Skipped git initialization (no TTY detected)"
|
|
147
|
-
|
|
148
|
-
**Implementation Status**: ❌ Not Started
|
|
149
|
-
**Tests**: TBD
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## Story 7: Git Repository Handling
|
|
154
|
-
|
|
155
|
-
**As a** developer in a non-git directory
|
|
156
|
-
**I want to** be prompted about git initialization
|
|
157
|
-
**So that** I can choose whether to initialize git for hook support
|
|
158
|
-
|
|
159
|
-
**Acceptance Criteria**:
|
|
160
|
-
- [ ] No `.git/` detected + TTY → prompts "Initialize git repository? [y/N]"
|
|
161
|
-
- [ ] User says yes → runs `git init`, then installs git hooks
|
|
162
|
-
- [ ] User says no → continues setup, warns "Git hooks skipped (no repository)"
|
|
163
|
-
- [ ] With `--yes` or no TTY → auto-skips git init with warning
|
|
164
|
-
- [ ] With `.git/` present → installs git hooks, no prompt
|
|
165
|
-
- [ ] Git hooks use marker-based append (`SAFEWORD_ARCH_CHECK_START/END`)
|
|
166
|
-
- [ ] Preserves existing content in `.git/hooks/pre-commit`
|
|
167
|
-
|
|
168
|
-
**Implementation Status**: ❌ Not Started
|
|
169
|
-
**Tests**: TBD
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## Story 8: Health Check
|
|
174
|
-
|
|
175
|
-
**As a** developer maintaining a project
|
|
176
|
-
**I want to** run `npx safeword check` to see project health
|
|
177
|
-
**So that** I can verify configuration and check for updates
|
|
178
|
-
|
|
179
|
-
**Acceptance Criteria**:
|
|
180
|
-
- [ ] Shows CLI version: "Safeword CLI: v1.2.0"
|
|
181
|
-
- [ ] Shows project config version: "Project config: v1.0.0"
|
|
182
|
-
- [ ] Shows if update available: "(v1.2.0 available)"
|
|
183
|
-
- [ ] Verifies `.safeword/` structure is intact
|
|
184
|
-
- [ ] Exit code 0 on success
|
|
185
|
-
- [ ] On unconfigured project: "Not configured. Run `safeword setup`." (exit 0)
|
|
186
|
-
- [ ] Version check timeout after 3s → graceful fallback
|
|
187
|
-
- [ ] On timeout: "Couldn't check for updates (offline?)"
|
|
188
|
-
- [ ] `--offline` flag → skips version check entirely
|
|
189
|
-
|
|
190
|
-
**Implementation Status**: ❌ Not Started
|
|
191
|
-
**Tests**: TBD
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## Story 9: Upgrade Configuration
|
|
196
|
-
|
|
197
|
-
**As a** developer with an older safeword version
|
|
198
|
-
**I want to** run `npx safeword upgrade` to update my configuration
|
|
199
|
-
**So that** I get the latest templates, guides, and hooks
|
|
200
|
-
|
|
201
|
-
**Acceptance Criteria**:
|
|
202
|
-
- [ ] Overwrites all `.safeword/` files with CLI's bundled templates
|
|
203
|
-
- [ ] Updates `.claude/skills/safeword-*/` with latest skills
|
|
204
|
-
- [ ] Updates hooks in `.claude/settings.json` if changed
|
|
205
|
-
- [ ] Preserves non-safeword hooks in `.claude/settings.json`
|
|
206
|
-
- [ ] Updates `.safeword/version` file to CLI version
|
|
207
|
-
- [ ] Prints summary: files added, modified, unchanged
|
|
208
|
-
- [ ] Same-version upgrade → reinstalls anyway (for repairs)
|
|
209
|
-
- [ ] Refuses to downgrade: "CLI v1.0.0 is older than project v1.2.0. Update CLI first."
|
|
210
|
-
- [ ] On unconfigured project: "Not configured. Run `safeword setup`." (exit 1)
|
|
211
|
-
|
|
212
|
-
**Implementation Status**: ❌ Not Started
|
|
213
|
-
**Tests**: TBD
|
|
214
|
-
|
|
215
|
-
**Notes**: User customizations in `.safeword/` are overwritten by design. Documented behavior.
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Story 10: Preview Changes Before Upgrade
|
|
220
|
-
|
|
221
|
-
**As a** developer considering an upgrade
|
|
222
|
-
**I want to** run `npx safeword diff` to preview what would change
|
|
223
|
-
**So that** I can review changes before committing to upgrade
|
|
224
|
-
|
|
225
|
-
**Acceptance Criteria**:
|
|
226
|
-
- [ ] Default output shows summary: count of files added, modified, removed
|
|
227
|
-
- [ ] Lists each file by category (Added, Modified, Unchanged)
|
|
228
|
-
- [ ] Shows version transition: "Changes from v1.0.0 → v1.2.0"
|
|
229
|
-
- [ ] `--verbose` flag shows full unified diff for each modified file
|
|
230
|
-
- [ ] Exit code 0 on success
|
|
231
|
-
- [ ] On unconfigured project: "Not configured." (exit 1)
|
|
232
|
-
|
|
233
|
-
**Implementation Status**: ❌ Not Started
|
|
234
|
-
**Tests**: TBD
|
|
235
|
-
|
|
236
|
-
---
|
|
237
|
-
|
|
238
|
-
## Story 11: Remove Configuration
|
|
239
|
-
|
|
240
|
-
**As a** developer who wants to remove safeword
|
|
241
|
-
**I want to** run `npx safeword reset` to cleanly uninstall
|
|
242
|
-
**So that** I can remove safeword without leaving hook artifacts
|
|
243
|
-
|
|
244
|
-
**Acceptance Criteria**:
|
|
245
|
-
- [ ] Prompts for confirmation: "This will remove safeword configuration. Continue? [y/N]"
|
|
246
|
-
- [ ] `--yes` flag → auto-confirms without prompt
|
|
247
|
-
- [ ] No TTY → auto-confirms (like `--yes`)
|
|
248
|
-
- [ ] Removes `.safeword/` directory
|
|
249
|
-
- [ ] Removes safeword hooks from `.claude/settings.json` (preserves other hooks)
|
|
250
|
-
- [ ] Removes `.claude/skills/safeword-*/` directories
|
|
251
|
-
- [ ] Removes git hook markers from `.git/hooks/pre-commit` (preserves other content)
|
|
252
|
-
- [ ] Removes safeword link line from `AGENTS.md` (preserves other content)
|
|
253
|
-
- [ ] On unconfigured project: "Nothing to remove." (exit 0)
|
|
254
|
-
|
|
255
|
-
**Implementation Status**: ❌ Not Started
|
|
256
|
-
**Tests**: TBD
|
|
257
|
-
|
|
258
|
-
**Notes**:
|
|
259
|
-
- Linting artifacts intentionally preserved: `eslint.config.mjs`, `.prettierrc`, `lint`/`format` scripts, ESLint/Prettier devDependencies
|
|
260
|
-
- Rationale: Linting is useful independently, user may have customized, standard CLI behavior
|
|
261
|
-
- Summary should note: "Linting configuration preserved (remove manually if desired)"
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## Story 12: AGENTS.md Self-Healing
|
|
266
|
-
|
|
267
|
-
**As a** developer who accidentally removed the AGENTS.md link
|
|
268
|
-
**I want to** safeword to detect and fix this automatically
|
|
269
|
-
**So that** the LLM always reads SAFEWORD.md first
|
|
270
|
-
|
|
271
|
-
**Acceptance Criteria**:
|
|
272
|
-
- [ ] SessionStart hook checks if AGENTS.md contains safeword link
|
|
273
|
-
- [ ] If link missing → re-adds link to top of AGENTS.md
|
|
274
|
-
- [ ] If link missing → shows warning: "Restored AGENTS.md link (was removed)"
|
|
275
|
-
- [ ] If AGENTS.md file deleted → recreates file with link only
|
|
276
|
-
- [ ] Checks for duplicate before adding (no duplicates)
|
|
277
|
-
- [ ] Hook exits cleanly (doesn't block Claude Code startup)
|
|
278
|
-
|
|
279
|
-
**Implementation Status**: ❌ Not Started
|
|
280
|
-
**Tests**: TBD
|
|
281
|
-
|
|
282
|
-
**Notes**: Ensures LLM primacy—SAFEWORD.md must be read first for consistent behavior.
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
## Summary
|
|
287
|
-
|
|
288
|
-
**Completed**: 0/12 stories (0%)
|
|
289
|
-
**Remaining**: 12/12 stories (100%)
|
|
290
|
-
|
|
291
|
-
### Phase 1: Foundation ❌
|
|
292
|
-
- Story 1: Version and Help
|
|
293
|
-
|
|
294
|
-
### Phase 2: Setup Flow ❌
|
|
295
|
-
- Story 2: First-Time Setup - Core Files
|
|
296
|
-
- Story 3: First-Time Setup - Hooks and Skills
|
|
297
|
-
- Story 4: First-Time Setup - Linting
|
|
298
|
-
- Story 5: Setup Blocks on Existing Config
|
|
299
|
-
- Story 6: Non-Interactive Setup
|
|
300
|
-
- Story 7: Git Repository Handling
|
|
301
|
-
|
|
302
|
-
### Phase 3: Lifecycle Commands ❌
|
|
303
|
-
- Story 8: Health Check
|
|
304
|
-
- Story 9: Upgrade Configuration
|
|
305
|
-
- Story 10: Preview Changes Before Upgrade
|
|
306
|
-
|
|
307
|
-
### Phase 4: Cleanup & Maintenance ❌
|
|
308
|
-
- Story 11: Remove Configuration
|
|
309
|
-
- Story 12: AGENTS.md Self-Healing
|
|
310
|
-
|
|
311
|
-
**Next Steps**: Create test definitions, then implement Phase 1 (foundation)
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
# User Stories: CLI Self-Contained Templates
|
|
2
|
-
|
|
3
|
-
**Guide**: `@./.safeword/guides/user-story-guide.md`
|
|
4
|
-
**Template**: `@./.safeword/templates/user-stories-template.md`
|
|
5
|
-
|
|
6
|
-
**Feature**: Bundle all templates into CLI package so `npx safeword` works without external dependencies
|
|
7
|
-
|
|
8
|
-
**Related Issue**: N/A (internal)
|
|
9
|
-
**Status**: 🟡 In Progress (5/6 stories implemented, Story 1 partial)
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Technical Constraints
|
|
14
|
-
|
|
15
|
-
### Performance
|
|
16
|
-
- [ ] `safeword setup` completes in < 5s on SSD
|
|
17
|
-
- [ ] `safeword upgrade` completes in < 3s (no network calls)
|
|
18
|
-
|
|
19
|
-
### Security
|
|
20
|
-
- [ ] Hook scripts use `jq` for JSON output (no shell injection via echo)
|
|
21
|
-
- [ ] No secrets in bundled templates
|
|
22
|
-
|
|
23
|
-
### Compatibility
|
|
24
|
-
- [ ] Node.js 18+ (ESM-only)
|
|
25
|
-
- [ ] Works on macOS, Linux, Windows (Git Bash)
|
|
26
|
-
- [ ] Package managers: npm, yarn, pnpm, bun
|
|
27
|
-
|
|
28
|
-
### Dependencies
|
|
29
|
-
- [ ] Must use existing Claude Code hook format (nested `hooks` array)
|
|
30
|
-
- [ ] Must preserve user's existing `.claude/settings.json` hooks
|
|
31
|
-
- [ ] ESLint 9.x flat config with `defineConfig()` and `extends`
|
|
32
|
-
|
|
33
|
-
### Infrastructure
|
|
34
|
-
- [ ] CLI package < 500KB (excluding node_modules)
|
|
35
|
-
- [ ] Templates bundled as files (not string constants)
|
|
36
|
-
- [ ] `jq` required on system for hooks (`safeword check` warns if missing)
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Story 1: Setup Installs Complete Templates
|
|
41
|
-
|
|
42
|
-
**As a** developer running `safeword setup`
|
|
43
|
-
**I want** all safeword templates installed to my project
|
|
44
|
-
**So that** I have the full methodology without manual copying
|
|
45
|
-
|
|
46
|
-
**Acceptance Criteria**:
|
|
47
|
-
- [ ] `.safeword/SAFEWORD.md` is the full ~31KB file (not a stub)
|
|
48
|
-
- [ ] `.safeword/guides/` contains 13 methodology guides
|
|
49
|
-
- [ ] `.safeword/doc-templates/` contains 5 document templates
|
|
50
|
-
- [ ] `.safeword/prompts/` contains 2 review prompts
|
|
51
|
-
- [ ] Empty directories created: `.safeword/planning/user-stories/`, `.safeword/planning/design/`, `.safeword/tickets/completed/`, `.safeword/learnings/`
|
|
52
|
-
- [ ] `AGENTS.md` created (if missing) with link to `.safeword/SAFEWORD.md`; existing AGENTS.md untouched
|
|
53
|
-
- [ ] Running setup again overwrites safeword-owned files, preserves user content in `learnings/`
|
|
54
|
-
|
|
55
|
-
**Implementation Status**: 🟡 Partial (stub installed, full templates not bundled)
|
|
56
|
-
**Tests**: `packages/cli/tests/commands/setup-templates.test.ts`
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Story 2: Setup Installs Hook System
|
|
61
|
-
|
|
62
|
-
**As a** developer running `safeword setup`
|
|
63
|
-
**I want** Claude Code hooks installed and registered
|
|
64
|
-
**So that** quality automation works immediately
|
|
65
|
-
|
|
66
|
-
**Acceptance Criteria**:
|
|
67
|
-
- [ ] `.safeword/hooks/` contains 7 hook scripts with `{event}-{action}.sh` naming
|
|
68
|
-
- [ ] `.safeword/lib/` contains 2 shared scripts with `_lib-` prefix
|
|
69
|
-
- [ ] `.safeword/git/git-pre-commit.sh` exists for git hooks
|
|
70
|
-
- [ ] `.claude/settings.json` has hooks registered with correct nested format
|
|
71
|
-
- [ ] Hooks marked with `_safeword: true` for upgrade identification
|
|
72
|
-
- [ ] Existing user hooks in settings.json preserved (merged, not replaced)
|
|
73
|
-
- [ ] `.mcp.json` updated with context7 and playwright servers (merged, not replaced)
|
|
74
|
-
- [ ] Running setup again: safeword hooks replaced, user hooks preserved
|
|
75
|
-
|
|
76
|
-
**Implementation Status**: ✅ Implemented
|
|
77
|
-
**Tests**: `packages/cli/tests/commands/setup-hooks.test.ts`
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Story 3: Setup Installs Skills and Commands
|
|
82
|
-
|
|
83
|
-
**As a** developer running `safeword setup`
|
|
84
|
-
**I want** Claude Code skills and slash commands installed
|
|
85
|
-
**So that** I can use quality review features
|
|
86
|
-
|
|
87
|
-
**Acceptance Criteria**:
|
|
88
|
-
- [ ] `.claude/skills/quality-reviewer/SKILL.md` has full content with YAML frontmatter
|
|
89
|
-
- [ ] `.claude/commands/` contains quality-review.md, arch-review.md, lint.md
|
|
90
|
-
- [ ] Skill frontmatter includes `name`, `description`, `allowed-tools`
|
|
91
|
-
|
|
92
|
-
**Implementation Status**: ✅ Implemented
|
|
93
|
-
**Tests**: `packages/cli/tests/commands/setup-hooks.test.ts`
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Story 4: Setup Configures Linting
|
|
98
|
-
|
|
99
|
-
**As a** developer running `safeword setup`
|
|
100
|
-
**I want** ESLint and Prettier configured automatically
|
|
101
|
-
**So that** code quality is enforced from the start
|
|
102
|
-
|
|
103
|
-
**Acceptance Criteria**:
|
|
104
|
-
- [ ] `.safeword/eslint.config.js` generated with detected plugins (React, Vitest, etc.)
|
|
105
|
-
- [ ] `.safeword/prettier.config.js` generated with defaults
|
|
106
|
-
- [ ] `.safeword/.markdownlint.jsonc` created for markdown linting
|
|
107
|
-
- [ ] Root `eslint.config.js` created (if none exists) importing safeword config via `extends`
|
|
108
|
-
- [ ] Root `prettier.config.js` created (if none exists) spreading safeword config
|
|
109
|
-
- [ ] Existing lint configs preserved (not overwritten)
|
|
110
|
-
- [ ] ESLint plugins + `markdownlint-cli2` installed to project devDependencies
|
|
111
|
-
- [ ] `package.json` scripts added: `lint`, `lint:md`, `format`, `format:check` (if missing)
|
|
112
|
-
|
|
113
|
-
**Implementation Status**: ✅ Implemented (configs at root, not .safeword/)
|
|
114
|
-
**Tests**: `packages/cli/tests/commands/setup-linting.test.ts`
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Story 5: Upgrade Updates Safeword-Owned Files
|
|
119
|
-
|
|
120
|
-
**As a** developer running `safeword upgrade`
|
|
121
|
-
**I want** safeword templates updated without losing my customizations
|
|
122
|
-
**So that** I get improvements without merge conflicts
|
|
123
|
-
|
|
124
|
-
**Acceptance Criteria**:
|
|
125
|
-
- [ ] `.safeword/` contents replaced with latest templates
|
|
126
|
-
- [ ] User's `eslint.config.js` and `prettier.config.js` untouched
|
|
127
|
-
- [ ] Hooks with `_safeword: true` in settings.json replaced; user hooks preserved
|
|
128
|
-
- [ ] `learnings/` directory preserved (user content)
|
|
129
|
-
- [ ] Backup created before upgrade (`.safeword.backup/`)
|
|
130
|
-
- [ ] Backup deleted on success
|
|
131
|
-
|
|
132
|
-
**Implementation Status**: ✅ Implemented
|
|
133
|
-
**Tests**: `packages/cli/tests/commands/upgrade.test.ts`
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Story 6: Reset Removes Safeword Cleanly
|
|
138
|
-
|
|
139
|
-
**As a** developer running `safeword reset`
|
|
140
|
-
**I want** all safeword artifacts removed from my project
|
|
141
|
-
**So that** I can start fresh or remove safeword completely
|
|
142
|
-
|
|
143
|
-
**Acceptance Criteria**:
|
|
144
|
-
- [ ] `.safeword/` directory deleted
|
|
145
|
-
- [ ] Hooks with `_safeword: true` removed from `.claude/settings.json`
|
|
146
|
-
- [ ] `.claude/skills/quality-reviewer/` deleted
|
|
147
|
-
- [ ] `.claude/commands/` safeword commands deleted
|
|
148
|
-
- [ ] MCP servers `context7` and `playwright` removed from `.mcp.json`
|
|
149
|
-
- [ ] User's other hooks, skills, commands preserved
|
|
150
|
-
- [ ] User's lint configs untouched
|
|
151
|
-
|
|
152
|
-
**Implementation Status**: ✅ Implemented
|
|
153
|
-
**Tests**: `packages/cli/tests/commands/reset.test.ts`
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Summary
|
|
158
|
-
|
|
159
|
-
**Completed**: 5/6 stories (83%)
|
|
160
|
-
**Remaining**: Story 1 template bundling
|
|
161
|
-
|
|
162
|
-
### Core Setup
|
|
163
|
-
- Story 1: Complete templates - 🟡 Partial (stub only)
|
|
164
|
-
- Story 2: Hook system - ✅ Implemented
|
|
165
|
-
- Story 3: Skills and commands - ✅ Implemented
|
|
166
|
-
- Story 4: Linting configuration - ✅ Implemented
|
|
167
|
-
|
|
168
|
-
### Lifecycle
|
|
169
|
-
- Story 5: Upgrade - ✅ Implemented
|
|
170
|
-
- Story 6: Reset - ✅ Implemented
|
|
171
|
-
|
|
172
|
-
**Next Step**: Implement Story 1 - bundle full template files into CLI package
|