universal-dev-standards 5.0.0-rc.5 → 5.0.0-rc.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.
Files changed (54) hide show
  1. package/bin/uds.js +1 -0
  2. package/bundled/ai/standards/spec-driven-development.ai.yaml +5 -1
  3. package/bundled/ai/standards/structured-task-definition.ai.yaml +108 -0
  4. package/bundled/ai/standards/workflow-state-protocol.ai.yaml +121 -0
  5. package/bundled/core/context-aware-loading.md +44 -4
  6. package/bundled/core/spec-driven-development.md +2 -1
  7. package/bundled/core/structured-task-definition.md +245 -0
  8. package/bundled/core/workflow-state-protocol.md +287 -0
  9. package/bundled/locales/zh-CN/CLAUDE.md +2 -2
  10. package/bundled/locales/zh-CN/README.md +2 -2
  11. package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +3 -2
  12. package/bundled/locales/zh-CN/ai/standards/spec-driven-development.ai.yaml +1 -1
  13. package/bundled/locales/zh-CN/core/spec-driven-development.md +10 -9
  14. package/bundled/locales/zh-CN/core/structured-task-definition.md +255 -0
  15. package/bundled/locales/zh-CN/core/test-driven-development.md +1 -1
  16. package/bundled/locales/zh-CN/core/workflow-state-protocol.md +297 -0
  17. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +8 -1
  18. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +15 -7
  19. package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +9 -8
  20. package/bundled/locales/zh-CN/skills/README.md +1 -0
  21. package/bundled/locales/zh-CN/skills/commands/methodology.md +1 -1
  22. package/bundled/locales/zh-CN/skills/methodology-system/guide.md +1 -1
  23. package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +9 -8
  24. package/bundled/locales/zh-TW/CLAUDE.md +2 -2
  25. package/bundled/locales/zh-TW/README.md +2 -2
  26. package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +3 -2
  27. package/bundled/locales/zh-TW/ai/standards/spec-driven-development.ai.yaml +1 -1
  28. package/bundled/locales/zh-TW/core/spec-driven-development.md +1 -1
  29. package/bundled/locales/zh-TW/core/structured-task-definition.md +247 -0
  30. package/bundled/locales/zh-TW/core/workflow-state-protocol.md +289 -0
  31. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +8 -1
  32. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +15 -7
  33. package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +9 -8
  34. package/bundled/locales/zh-TW/methodologies/guides/sdd-guide.md +10 -9
  35. package/bundled/locales/zh-TW/methodologies/guides/tdd-guide.md +1 -1
  36. package/bundled/locales/zh-TW/skills/README.md +1 -0
  37. package/bundled/locales/zh-TW/skills/commands/methodology.md +1 -1
  38. package/bundled/locales/zh-TW/skills/methodology-system/guide.md +1 -1
  39. package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +9 -8
  40. package/bundled/skills/agents/README.md +65 -0
  41. package/bundled/skills/agents/spec-analyst.md +32 -0
  42. package/bundled/skills/commands/methodology.md +1 -1
  43. package/bundled/skills/commands/sdd.md +128 -2
  44. package/bundled/skills/methodology-system/guide.md +1 -1
  45. package/bundled/skills/spec-driven-dev/guide.md +10 -9
  46. package/bundled/skills/workflows/README.md +141 -0
  47. package/bundled/skills/workflows/feature-dev.workflow.yaml +6 -1
  48. package/package.json +1 -1
  49. package/src/commands/check.js +7 -2
  50. package/src/commands/update.js +5 -1
  51. package/src/installers/manifest-installer.js +4 -0
  52. package/src/utils/hasher.js +26 -0
  53. package/src/utils/integration-generator.js +5 -2
  54. package/standards-registry.json +27 -3
package/bin/uds.js CHANGED
@@ -106,6 +106,7 @@ program
106
106
  .option('--restore', 'Restore all modified and missing files')
107
107
  .option('--restore-missing', 'Restore only missing files')
108
108
  .option('--no-interactive', 'Disable interactive mode')
109
+ .option('--ci', 'CI mode: disable interactive prompts and set exit code on issues')
109
110
  .option('--migrate', 'Migrate legacy manifest to hash-based tracking')
110
111
  .option('--offline', 'Skip npm registry check for CLI updates')
111
112
  .action(checkCommand);
@@ -10,6 +10,10 @@ meta:
10
10
 
11
11
  workflow:
12
12
  stages:
13
+ - stage: Discuss
14
+ description: Capture gray areas, lock scope, establish canonical refs
15
+ artifacts: read_first list, scope definition, gray area log
16
+
13
17
  - stage: Proposal
14
18
  description: Define what to change and why
15
19
  artifacts: proposal.md
@@ -41,7 +45,7 @@ principles:
41
45
 
42
46
  methodology_over_tooling:
43
47
  rule: SDD is a methodology, not bound to a single tool
44
- universal_flow: Proposal -> Review -> Implementation -> Verification -> Archive
48
+ universal_flow: Discuss -> Proposal -> Review -> Implementation -> Verification -> Archive
45
49
 
46
50
  spec_first:
47
51
  rule: No functional code changes without approved specification
@@ -0,0 +1,108 @@
1
+ # Structured Task Definition - AI Optimized
2
+ # Source: core/structured-task-definition.md
3
+
4
+ id: structured-task-definition
5
+ meta:
6
+ version: "1.0.0"
7
+ updated: "2026-03-17"
8
+ source: core/structured-task-definition.md
9
+ description: Standard structure for AI task definitions with 4 required fields
10
+
11
+ principles:
12
+ grounded_execution:
13
+ rule: Every AI task must read specified files before acting
14
+ rationale: Prevents hallucination by establishing ground truth from actual code
15
+
16
+ concrete_actions:
17
+ rule: Task actions must specify exact files, locations, and operations
18
+ rationale: Eliminates vague instructions like "improve" or "enhance"
19
+
20
+ measurable_completion:
21
+ rule: Acceptance criteria must use Given/When/Then format
22
+ rationale: Every criterion is independently verifiable
23
+
24
+ executable_verification:
25
+ rule: Verification uses commands (grep, test, ls), not subjective judgment
26
+ rationale: Machine-verifiable outcomes eliminate ambiguity
27
+
28
+ required_fields:
29
+ read_first:
30
+ description: Files that MUST be read before task execution
31
+ purpose: Establish ground truth, prevent hallucination
32
+ format: "List of {path, reason} entries"
33
+ rules:
34
+ - All listed files must exist
35
+ - Include implementation files AND their tests
36
+ - Include relevant spec documents (if SDD active)
37
+
38
+ action:
39
+ description: Concrete steps with exact file paths and operations
40
+ purpose: Remove all ambiguity about what to do
41
+ format: "List of {step, file, operation, location, description}"
42
+ operations: [add, modify, delete, move, rename]
43
+ rules:
44
+ - Each step specifies a single file
45
+ - Line numbers provide context (approximate OK)
46
+ - No step should be "do whatever seems right"
47
+
48
+ acceptance_criteria:
49
+ description: GWT-format completion conditions
50
+ purpose: Testable conditions with no room for "it seems to work"
51
+ format: "List of {id, given, when, then}"
52
+ rules:
53
+ - Use Given/When/Then format
54
+ - Each AC independently verifiable
55
+ - Include regression criteria
56
+ - Number for traceability (AC-1, AC-2)
57
+
58
+ verification:
59
+ description: Executable commands that verify completion
60
+ purpose: Machine-verifiable outcomes
61
+ format: "List of {command, expect}"
62
+ rules:
63
+ - Every AC has at least one verification command
64
+ - Prefer deterministic checks (grep, test, ls)
65
+ - Include test execution
66
+ - Failed verification = task not complete
67
+
68
+ rules:
69
+ - id: task-must-have-read-first
70
+ trigger: creating AI task or sub-task
71
+ instruction: >
72
+ Every task must include a read_first field listing files to read
73
+ before execution. This establishes ground truth and prevents
74
+ hallucination about code structure or API signatures.
75
+ priority: required
76
+
77
+ - id: task-must-have-concrete-actions
78
+ trigger: defining task actions
79
+ instruction: >
80
+ Task actions must specify exact file paths, line locations,
81
+ and operations (add/modify/delete/move/rename). Vague instructions
82
+ like "improve error handling" or "add validation" are not acceptable.
83
+ priority: required
84
+
85
+ - id: task-must-have-verification
86
+ trigger: completing task definition
87
+ instruction: >
88
+ Every task must include verification commands that can objectively
89
+ confirm completion. Use grep, test commands, file existence checks,
90
+ or test suite execution — never subjective judgment like "looks good."
91
+ priority: required
92
+
93
+ - id: task-scope-matching
94
+ trigger: evaluating whether to apply full structure
95
+ instruction: >
96
+ Apply full 4-field structure for features, bug fixes, and refactoring.
97
+ Trivial changes (typos, formatting) may skip. Hotfixes need at minimum
98
+ read_first + verification.
99
+ priority: recommended
100
+
101
+ quick_reference:
102
+ fields:
103
+ columns: [Field, Purpose, Anti-Pattern Prevented]
104
+ rows:
105
+ - [read_first, Establish ground truth, Anti-hallucination]
106
+ - [action, Concrete steps, Anti-ambiguity]
107
+ - [acceptance_criteria, GWT conditions, Anti-omission]
108
+ - [verification, Executable checks, Anti-subjectivity]
@@ -0,0 +1,121 @@
1
+ # Workflow State Protocol - AI Optimized
2
+ # Source: core/workflow-state-protocol.md
3
+
4
+ id: workflow-state-protocol
5
+ meta:
6
+ version: "1.0.0"
7
+ updated: "2026-03-17"
8
+ source: core/workflow-state-protocol.md
9
+ description: Protocol for persisting and restoring workflow state across AI sessions
10
+
11
+ principles:
12
+ state_persistence:
13
+ rule: Multi-phase workflows must save state at phase transitions
14
+ rationale: Enables resumption after session boundaries without state loss
15
+
16
+ event_sourcing:
17
+ rule: Important decisions and transitions are logged in append-only event log
18
+ rationale: Provides audit trail and enables understanding of workflow history
19
+
20
+ session_independence:
21
+ rule: Each AI session should be able to resume any workflow from saved state
22
+ rationale: Context window limits make single-session completion unreliable
23
+
24
+ state_file:
25
+ location: ".workflow-state/{workflow}-{id}.yaml"
26
+ required_fields:
27
+ - workflow # Workflow type (sdd, feature-dev, etc.)
28
+ - spec_id # Spec or task identifier
29
+ - current_phase # Active phase ID
30
+ - status # in-progress | paused | blocked | completed | abandoned
31
+ - updated # Last update timestamp (ISO 8601)
32
+ - phases_completed # Ordered list of completed phase IDs
33
+ optional_fields:
34
+ - title
35
+ - iteration_count
36
+ - created
37
+ - artifacts
38
+ - progress_summary
39
+ - completed_steps
40
+ - next_steps
41
+ - open_questions
42
+ - decisions
43
+
44
+ event_log:
45
+ location: ".workflow-state/{workflow}-{id}.log.yaml"
46
+ format: append-only YAML list
47
+ event_types:
48
+ - phase_enter # Workflow enters a new phase
49
+ - phase_exit # Workflow exits a phase
50
+ - checkpoint # Notable milestone
51
+ - decision # Important decision made
52
+ - error # Error or failure
53
+ - interruption # Workflow paused (HITL or context limit)
54
+ - resumption # Workflow resumed from saved state
55
+ required_event_fields:
56
+ - timestamp
57
+ - event_type
58
+ - phase
59
+ - summary
60
+
61
+ rules:
62
+ - id: state-save-on-phase-transition
63
+ trigger: workflow phase changes
64
+ instruction: >
65
+ When a workflow transitions between phases, update the state file
66
+ with new current_phase, add the completed phase to phases_completed,
67
+ and update the timestamp. Also append a phase_exit and phase_enter
68
+ event to the event log.
69
+ priority: required
70
+
71
+ - id: state-load-on-resume
72
+ trigger: session start or workflow command invocation
73
+ instruction: >
74
+ At session start, check .workflow-state/ for any files with
75
+ status 'in-progress' or 'paused'. If found, inform the user
76
+ of active workflows and offer to resume. When a workflow command
77
+ is invoked (e.g., /sdd implement SPEC-042), check for existing
78
+ state before starting fresh.
79
+ priority: required
80
+
81
+ - id: state-save-on-session-end
82
+ trigger: AI session ending with active workflow
83
+ instruction: >
84
+ Before ending a session during an active workflow, save current
85
+ progress to the state file. Update progress_summary, next_steps,
86
+ and open_questions to enable seamless resumption.
87
+ priority: required
88
+
89
+ - id: event-log-on-decision
90
+ trigger: important design or scope decision made
91
+ instruction: >
92
+ When a significant decision is made during a workflow (design choice,
93
+ scope change, technology selection), append a 'decision' event to the
94
+ event log with the decision summary and reasoning.
95
+ priority: recommended
96
+
97
+ - id: state-staleness-warning
98
+ trigger: loading state file older than 7 days
99
+ instruction: >
100
+ If a state file's 'updated' timestamp is more than 7 days old,
101
+ warn the user that the workflow state may be stale and suggest
102
+ reviewing it before continuing.
103
+ priority: recommended
104
+
105
+ - id: gitignore-workflow-state
106
+ trigger: creating .workflow-state/ directory
107
+ instruction: >
108
+ Recommend adding .workflow-state/ to .gitignore as workflow state
109
+ is session-specific. Exception: teams sharing state across developers
110
+ may version-control it but should clean up completed workflows.
111
+ priority: recommended
112
+
113
+ quick_reference:
114
+ state_lifecycle:
115
+ columns: [Event, Action]
116
+ rows:
117
+ - [Phase transition, Update state file + append event log]
118
+ - [Important decision, Record in state decisions + event log]
119
+ - [Session ending, Save progress_summary and next_steps]
120
+ - [Session starting, Check .workflow-state/ for active workflows]
121
+ - [Workflow complete, Set status to completed]
@@ -95,23 +95,63 @@ Projects configure domain mappings in `manifest.json`:
95
95
 
96
96
  ---
97
97
 
98
- ## 3. Implementation Guidelines
98
+ ## 3. Custom Domains
99
99
 
100
- ### 3.1 For Standard Authors
100
+ Projects can define custom domains in `manifest.json` using the `extensions` array. Custom domains are **additive only** — they cannot override built-in domains.
101
+
102
+ ### 3.1 Extension Format
103
+
104
+ ```json
105
+ {
106
+ "extensions": [
107
+ {
108
+ "type": "custom-domain",
109
+ "domain": "ml-pipeline",
110
+ "description": "Standards for ML pipeline workflows",
111
+ "triggers": ["pipeline", "model training", "dataset", "*.pipeline.*"],
112
+ "standards": ["ai/standards/custom-ml-pipeline.ai.yaml"]
113
+ }
114
+ ]
115
+ }
116
+ ```
117
+
118
+ ### 3.2 Custom Domain Rules
119
+
120
+ | Rule | Description |
121
+ |------|-------------|
122
+ | **Additive only** | Custom domains cannot override or shadow built-in domains |
123
+ | **Unique names** | Domain names must not conflict with built-in domain names |
124
+ | **Standard paths** | Referenced standards must exist in the project |
125
+ | **Trigger format** | Same format as built-in domain triggers (keywords, file patterns, commands) |
126
+
127
+ ### 3.3 Hook-Based Enforcement (Optional)
128
+
129
+ For Claude Code users, a `UserPromptSubmit` hook can automatically inject relevant standards based on the user's prompt. The hook reads the prompt, matches it against manifest domain triggers (both built-in and custom), and outputs matching standard file paths as context.
130
+
131
+ **Requirements:**
132
+ - Hook execution must complete in < 500ms
133
+ - Hook failures must not block the user's prompt
134
+ - See `scripts/hooks/inject-standards.js` for reference implementation
135
+
136
+ ---
137
+
138
+ ## 4. Implementation Guidelines
139
+
140
+ ### 4.1 For Standard Authors
101
141
 
102
142
  - Register new standards in `manifest.json` under the appropriate domain
103
143
  - Choose `always-on` only for standards that genuinely apply to every interaction
104
144
  - Define specific, actionable triggers in the domain configuration (not vague keywords)
105
145
  - Assign each standard to exactly one domain
106
146
 
107
- ### 3.2 For AI Tool Integrations
147
+ ### 4.2 For AI Tool Integrations
108
148
 
109
149
  - At session start, always load the `always-on` domain
110
150
  - Parse user's first message for trigger keywords before loading additional standards
111
151
  - When in doubt, load the standard — false positives are better than missing context
112
152
  - Cache domain membership for the session duration
113
153
 
114
- ### 3.3 Backward Compatibility
154
+ ### 4.3 Backward Compatibility
115
155
 
116
156
  - Existing `manifest.json` without `domains` continues to work (all standards loaded)
117
157
  - The `domains` field is additive — it does not remove existing `standards` list behavior
@@ -25,8 +25,9 @@ SDD operates at different maturity levels: Spec-first (discard after completion)
25
25
 
26
26
  | Aspect | Description |
27
27
  |--------|-------------|
28
- | **Core Workflow** | Proposal → Review → Implementation → Verification → Archive |
28
+ | **Core Workflow** | Discuss → Proposal → Review → Implementation → Verification → Archive |
29
29
  | **Key Principle** | Spec First, Code Second |
30
+ | **AC Format** | Given/When/Then (GWT) — enables structured BDD derivation |
30
31
  | **Test Generation** | Forward Derivation (/derive-bdd, /derive-tdd, /derive-all) |
31
32
  | **Maturity Levels** | Spec-first, Spec-anchored, Spec-as-source |
32
33
  | **Tools** | OpenSpec, Spec Kit, Manual (file-based) |
@@ -0,0 +1,245 @@
1
+ # Structured Task Definition Standards
2
+
3
+ **Version**: 1.0.0
4
+ **Last Updated**: 2026-03-17
5
+ **Applicability**: All projects using AI-assisted development
6
+ **Scope**: universal
7
+ **Industry Standards**: Inspired by GSD (Get Shit Done) task structure
8
+ **References**: [GSD](https://github.com/gsd-build/get-shit-done)
9
+
10
+ ---
11
+
12
+ ## Summary
13
+
14
+ Structured Task Definition ensures that every AI task includes the minimum context needed for reliable execution. By requiring four mandatory fields — `read_first`, `action`, `acceptance_criteria`, and `verification` — this standard prevents hallucination, eliminates ambiguity, and ensures every task outcome is objectively verifiable.
15
+
16
+ ---
17
+
18
+ ## Quick Reference
19
+
20
+ | Aspect | Description |
21
+ |--------|-------------|
22
+ | **Core Principle** | Every task must be grounded, specific, testable, and verifiable |
23
+ | **Required Fields** | `read_first`, `action`, `acceptance_criteria`, `verification` |
24
+ | **Anti-Hallucination** | `read_first` establishes ground truth before execution |
25
+ | **Anti-Ambiguity** | `action` specifies exact files, line numbers, and operations |
26
+ | **Anti-Omission** | `acceptance_criteria` uses GWT format for completeness |
27
+ | **Anti-Subjectivity** | `verification` uses executable commands, not judgment |
28
+
29
+ ---
30
+
31
+ ## The Four Required Fields
32
+
33
+ ### 1. `read_first` — Establish Ground Truth
34
+
35
+ A list of files that MUST be read before executing the task. This prevents the AI from hallucinating about code structure, API signatures, or project conventions.
36
+
37
+ **Purpose**: Build accurate mental model from actual code, not assumptions.
38
+
39
+ **Format**:
40
+ ```yaml
41
+ read_first:
42
+ - path: src/auth/login.js
43
+ reason: Contains current login implementation
44
+ - path: tests/auth/login.test.js
45
+ reason: Existing test patterns to follow
46
+ - path: docs/specs/SPEC-042.md
47
+ reason: Approved specification for this change
48
+ ```
49
+
50
+ **Rules**:
51
+ - All listed files must exist (verified before task execution)
52
+ - Include both implementation files and their tests
53
+ - Include the relevant spec document (if SDD is active)
54
+ - Include config files that affect behavior
55
+
56
+ ### 2. `action` — Concrete Steps
57
+
58
+ A list of specific, unambiguous steps with exact file paths and line references. Eliminates vague instructions like "improve error handling" or "add validation."
59
+
60
+ **Purpose**: Remove all ambiguity about what to do and where to do it.
61
+
62
+ **Format**:
63
+ ```yaml
64
+ action:
65
+ - step: 1
66
+ file: src/auth/login.js
67
+ operation: modify
68
+ location: "lines 42-58 (validateCredentials function)"
69
+ description: Add rate limiting check before credential validation
70
+ details: |
71
+ Insert a call to rateLimiter.check(req.ip) before the
72
+ existing validateCredentials() call. If rate limit exceeded,
73
+ throw RateLimitError with 429 status.
74
+ - step: 2
75
+ file: tests/auth/login.test.js
76
+ operation: add
77
+ location: "after line 120 (end of 'validation' describe block)"
78
+ description: Add rate limiting test cases
79
+ ```
80
+
81
+ **Rules**:
82
+ - Each step specifies a single file and operation
83
+ - Operations are: `add`, `modify`, `delete`, `move`, `rename`
84
+ - Line numbers are approximate (may shift) but provide context
85
+ - No step should be "do whatever seems right"
86
+
87
+ ### 3. `acceptance_criteria` — Measurable Completion Conditions
88
+
89
+ Criteria in Given/When/Then format that define when the task is complete. Each criterion maps to a verifiable outcome.
90
+
91
+ **Purpose**: Every condition is testable — no room for "it seems to work."
92
+
93
+ **Format**:
94
+ ```yaml
95
+ acceptance_criteria:
96
+ - id: AC-1
97
+ given: A user has made 5 login attempts in the last minute
98
+ when: They attempt a 6th login
99
+ then: The system returns HTTP 429 with "Rate limit exceeded" message
100
+ - id: AC-2
101
+ given: A user has not exceeded the rate limit
102
+ when: They attempt login with valid credentials
103
+ then: Login succeeds as before (no regression)
104
+ ```
105
+
106
+ **Rules**:
107
+ - Use GWT format (aligns with SDD and BDD standards)
108
+ - Each AC must be independently verifiable
109
+ - Include regression criteria (existing behavior preserved)
110
+ - Number criteria for traceability (AC-1, AC-2, etc.)
111
+
112
+ ### 4. `verification` — Executable Checks
113
+
114
+ Commands or checks that objectively verify the task is complete. Uses `grep`, `test`, `ls`, `npm test`, or similar — never subjective judgment.
115
+
116
+ **Purpose**: Machine-verifiable outcomes eliminate "I think it looks good."
117
+
118
+ **Format**:
119
+ ```yaml
120
+ verification:
121
+ - command: "grep -n 'rateLimiter.check' src/auth/login.js"
122
+ expect: "At least one match found"
123
+ - command: "npm test -- tests/auth/login.test.js"
124
+ expect: "All tests pass (exit code 0)"
125
+ - command: "grep -c 'rate.limit' tests/auth/login.test.js"
126
+ expect: "At least 2 test cases for rate limiting"
127
+ ```
128
+
129
+ **Rules**:
130
+ - Every AC should have at least one verification command
131
+ - Prefer deterministic checks (grep, test, file existence) over semantic evaluation
132
+ - Include test execution as a verification step
133
+ - Failed verification = task is not complete
134
+
135
+ ---
136
+
137
+ ## Complete Task Example
138
+
139
+ ```yaml
140
+ task:
141
+ id: TASK-042
142
+ title: Add rate limiting to login endpoint
143
+ spec_ref: SPEC-042
144
+
145
+ read_first:
146
+ - path: src/auth/login.js
147
+ reason: Current login implementation
148
+ - path: src/middleware/rate-limiter.js
149
+ reason: Existing rate limiter utility
150
+ - path: tests/auth/login.test.js
151
+ reason: Test patterns to follow
152
+ - path: docs/specs/SPEC-042.md
153
+ reason: Approved specification
154
+
155
+ action:
156
+ - step: 1
157
+ file: src/auth/login.js
158
+ operation: modify
159
+ location: "validateCredentials function (line ~45)"
160
+ description: Add rate limit check before credential validation
161
+ - step: 2
162
+ file: tests/auth/login.test.js
163
+ operation: add
164
+ location: "end of validation describe block"
165
+ description: Add rate limiting test cases
166
+
167
+ acceptance_criteria:
168
+ - id: AC-1
169
+ given: A user exceeds 5 login attempts per minute
170
+ when: They attempt another login
171
+ then: HTTP 429 returned with rate limit message
172
+ - id: AC-2
173
+ given: A user is within rate limits
174
+ when: They login with valid credentials
175
+ then: Login succeeds normally (no regression)
176
+
177
+ verification:
178
+ - command: "grep -n 'rateLimiter' src/auth/login.js"
179
+ expect: "Rate limiter imported and used"
180
+ - command: "npm test -- tests/auth/login.test.js"
181
+ expect: "All tests pass"
182
+ ```
183
+
184
+ ---
185
+
186
+ ## When to Apply
187
+
188
+ | Scenario | Apply Full Structure? | Notes |
189
+ |----------|----------------------|-------|
190
+ | New feature (SDD) | Yes | All 4 fields required |
191
+ | Bug fix | Yes | `read_first` includes bug report and affected code |
192
+ | Refactoring | Yes | `acceptance_criteria` focus on no-regression |
193
+ | Trivial changes | No | Typos, formatting — skip structure |
194
+ | Hotfixes | Partial | At minimum `read_first` + `verification` |
195
+
196
+ ---
197
+
198
+ ## Integration with SDD
199
+
200
+ When used with Spec-Driven Development:
201
+ - `read_first` includes the approved spec document
202
+ - `acceptance_criteria` are derived from the spec's AC section
203
+ - `verification` includes spec compliance checks
204
+ - Tasks are created during the Implementation phase
205
+
206
+ ---
207
+
208
+ ## Best Practices
209
+
210
+ ### Do's
211
+
212
+ - Include regression criteria in every task
213
+ - Use exact file paths (verified by `read_first`)
214
+ - Keep tasks atomic (one logical change)
215
+ - Reference spec IDs when applicable
216
+
217
+ ### Don'ts
218
+
219
+ - Don't use vague action descriptions ("improve", "enhance", "refactor")
220
+ - Don't skip `verification` — it's the most important field
221
+ - Don't assume file structure — always verify via `read_first`
222
+ - Don't create tasks without reading the target code first
223
+
224
+ ---
225
+
226
+ ## Related Standards
227
+
228
+ - [Spec-Driven Development](spec-driven-development.md) — Task structure integrates with SDD workflow
229
+ - [Anti-Hallucination Standards](anti-hallucination.md) — `read_first` implements evidence-based analysis
230
+ - [Testing Standards](testing-standards.md) — `verification` aligns with test pyramid
231
+ - [Check-in Standards](checkin-standards.md) — Tasks produce committable units of work
232
+
233
+ ---
234
+
235
+ ## Version History
236
+
237
+ | Version | Date | Changes |
238
+ |---------|------|---------|
239
+ | 1.0.0 | 2026-03-17 | Initial standard: 4 required fields (read_first, action, acceptance_criteria, verification) |
240
+
241
+ ---
242
+
243
+ ## License
244
+
245
+ This standard is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).