ralphctl 0.6.3 → 0.7.1

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 (45) hide show
  1. package/README.md +250 -138
  2. package/dist/cli.mjs +20665 -21131
  3. package/dist/manifest.json +17 -19
  4. package/dist/prompts/_partials/signals-evaluation.md +14 -0
  5. package/dist/prompts/_partials/signals-task.md +26 -0
  6. package/dist/prompts/_partials/validation-checklist.md +24 -0
  7. package/dist/prompts/apply-feedback/template.md +118 -0
  8. package/dist/prompts/detect-scripts/template.md +118 -0
  9. package/dist/prompts/detect-skills/template.md +136 -0
  10. package/dist/prompts/evaluate/template.md +236 -0
  11. package/dist/prompts/ideate/template.md +172 -0
  12. package/dist/prompts/implement/template.md +203 -0
  13. package/dist/prompts/plan/template.md +347 -0
  14. package/dist/prompts/readiness/template.md +132 -0
  15. package/dist/prompts/refine/template.md +254 -0
  16. package/dist/skills/{default/abstraction-first → ralphctl-abstraction-first}/SKILL.md +1 -1
  17. package/dist/skills/{default/alignment → ralphctl-alignment}/SKILL.md +1 -1
  18. package/dist/skills/{default/iterative-review → ralphctl-iterative-review}/SKILL.md +1 -1
  19. package/package.json +25 -28
  20. package/dist/absolute-path-WUTZQ37D.mjs +0 -8
  21. package/dist/chunk-6RDMCLWU.mjs +0 -108
  22. package/dist/chunk-HIU74KTO.mjs +0 -1046
  23. package/dist/chunk-S3PTDH57.mjs +0 -78
  24. package/dist/chunk-WV4D2CPG.mjs +0 -26
  25. package/dist/prompt-adapter-JQICGVX7.mjs +0 -7
  26. package/dist/prompts/ideate.md +0 -204
  27. package/dist/prompts/plan-auto.md +0 -182
  28. package/dist/prompts/plan-common-examples.md +0 -82
  29. package/dist/prompts/plan-common.md +0 -200
  30. package/dist/prompts/plan-interactive.md +0 -212
  31. package/dist/prompts/repo-onboard.md +0 -201
  32. package/dist/prompts/signals-evaluation.md +0 -6
  33. package/dist/prompts/signals-planning.md +0 -5
  34. package/dist/prompts/signals-task.md +0 -10
  35. package/dist/prompts/sprint-feedback.md +0 -64
  36. package/dist/prompts/task-evaluation.md +0 -276
  37. package/dist/prompts/task-execution.md +0 -233
  38. package/dist/prompts/ticket-refine.md +0 -242
  39. package/dist/prompts/validation-checklist.md +0 -19
  40. package/dist/skills/exec/.gitkeep +0 -0
  41. package/dist/skills/plan/.gitkeep +0 -0
  42. package/dist/skills/refine/.gitkeep +0 -0
  43. package/dist/storage-paths-IPNZZM5D.mjs +0 -15
  44. package/dist/validation-error-QT6Q7FYU.mjs +0 -7
  45. /package/dist/prompts/{harness-context.md → _partials/harness-context.md} +0 -0
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ValidationError
4
- } from "./chunk-WV4D2CPG.mjs";
5
-
6
- // src/domain/values/absolute-path.ts
7
- import { isAbsolute } from "path";
8
- import { Result } from "typescript-result";
9
- var ENV_VAR_REGEX = /\$\{[^}]*\}|\$[A-Za-z_][A-Za-z0-9_]*/;
10
- function validate(input) {
11
- if (typeof input !== "string") {
12
- return Result.error(
13
- new ValidationError({
14
- field: "absolute-path",
15
- value: input,
16
- message: "absolute path must be a string"
17
- })
18
- );
19
- }
20
- if (input.trim().length === 0) {
21
- return Result.error(
22
- new ValidationError({
23
- field: "absolute-path",
24
- value: input,
25
- message: "absolute path must not be empty or whitespace-only"
26
- })
27
- );
28
- }
29
- if (input.includes("~")) {
30
- return Result.error(
31
- new ValidationError({
32
- field: "absolute-path",
33
- value: input,
34
- message: 'absolute path must not contain "~"',
35
- hint: "expand the home directory before constructing an AbsolutePath"
36
- })
37
- );
38
- }
39
- if (ENV_VAR_REGEX.test(input)) {
40
- return Result.error(
41
- new ValidationError({
42
- field: "absolute-path",
43
- value: input,
44
- message: "absolute path must not contain environment variable references",
45
- hint: "expand $VAR / ${VAR} via process.env before constructing an AbsolutePath"
46
- })
47
- );
48
- }
49
- if (!isAbsolute(input)) {
50
- return Result.error(
51
- new ValidationError({
52
- field: "absolute-path",
53
- value: input,
54
- message: "path must be absolute",
55
- hint: "use path.resolve() to convert a relative path before construction"
56
- })
57
- );
58
- }
59
- return Result.ok(input);
60
- }
61
- var AbsolutePath = {
62
- parse(input) {
63
- return validate(input);
64
- },
65
- /**
66
- * Internal escape hatch for already-validated strings (e.g. paths read
67
- * from persisted JSON that has already passed schema validation).
68
- *
69
- * **Do not call from business code; persistence layer only.**
70
- */
71
- trustString(s) {
72
- return s;
73
- }
74
- };
75
-
76
- export {
77
- AbsolutePath
78
- };
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/domain/values/validation-error.ts
4
- var ValidationError = class extends Error {
5
- /** Discriminator. `as const` keeps it narrow at the type level. */
6
- code = "invalid-value";
7
- /** Logical field — usually the value-object name (e.g. "sprint-id"). */
8
- field;
9
- /** The raw input that failed validation. Kept untyped on purpose. */
10
- value;
11
- /** Optional human-readable repair hint. */
12
- hint;
13
- constructor(opts) {
14
- super(opts.message);
15
- this.name = "ValidationError";
16
- this.field = opts.field;
17
- this.value = opts.value;
18
- if (opts.hint !== void 0) {
19
- this.hint = opts.hint;
20
- }
21
- }
22
- };
23
-
24
- export {
25
- ValidationError
26
- };
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- InkPromptAdapter
4
- } from "./chunk-HIU74KTO.mjs";
5
- export {
6
- InkPromptAdapter
7
- };
@@ -1,204 +0,0 @@
1
- # Quick Ideation to Implementation
2
-
3
- You are a combined requirements analyst and task planner. Turn a rough idea into refined requirements and a
4
- dependency-ordered set of implementation tasks in a single session. Think carefully and step-by-step about the idea and
5
- its implications before asking questions or writing tasks; ambiguity caught now saves a failed plan later.
6
-
7
- {{HARNESS_CONTEXT}}
8
-
9
- When finished, emit a signal from the `<signals>` block below.
10
-
11
- ## Two-Phase Protocol
12
-
13
- ### Phase 1: Refine Requirements (WHAT)
14
-
15
- Focus: Clarify WHAT needs to be built (implementation-agnostic)
16
-
17
- <constraints>
18
-
19
- - Focus exclusively on requirements, acceptance criteria, and scope — codebase exploration happens in Phase 2
20
- - Frame requirements as observable behavior, not implementation details — this keeps Phase 2 flexible
21
- - Repositories are already selected; repository selection is not part of this phase
22
-
23
- </constraints>
24
-
25
- **Steps:**
26
-
27
- 1. **Analyze the idea** — Read the idea description below and identify what is clear vs ambiguous
28
- 2. **Interview the user** — Ask focused questions one at a time using AskUserQuestion:
29
- - What problem are we solving and for whom?
30
- - What is in scope vs explicitly out of scope?
31
- - What should the system do? (Describe behavior, not implementation)
32
- - What are the acceptance criteria? (Given/When/Then format)
33
- - What edge cases and error states need handling?
34
- - What are the business constraints? (performance, compatibility, etc.)
35
- 3. **Stop when ready** — Stop asking questions when ALL of these are true:
36
- - The problem statement is clear and agreed upon
37
- - Every functional requirement has at least one acceptance criterion
38
- - Scope boundaries (in/out) are explicitly defined
39
- - Major edge cases and error states are addressed
40
- - No remaining ambiguity about what the feature should do — two developers reading these requirements would build
41
- the same observable behavior
42
-
43
- If the idea description already answers all of these, skip directly to Step 4 — state "All clarifying questions answered by the description" so the user knows the interview was intentionally skipped.
44
-
45
- 4. **Present requirements** — Show the complete refined requirements in readable markdown, then ask for approval using
46
- AskUserQuestion:
47
- ```
48
- Question: "Does this look correct? Any changes needed?"
49
- Header: "Approval"
50
- Options:
51
- - "Approved, continue" — "Requirements are complete and accurate"
52
- - "Needs changes" — "I'll describe what to adjust"
53
- ```
54
- 5. **Iterate if needed** — If user requests changes, edit and re-present until approved
55
-
56
- **Requirements Format:**
57
-
58
- ```markdown
59
- ## Problem
60
-
61
- [Clear problem statement]
62
-
63
- ## Requirements
64
-
65
- - [Functional requirement 1]
66
- - [Functional requirement 2]
67
-
68
- ## Acceptance Criteria
69
-
70
- - Given [precondition], When [action], Then [expected result]
71
- - [Additional criteria...]
72
-
73
- ## Scope
74
-
75
- **In scope:**
76
-
77
- - [What's included]
78
-
79
- **Out of scope:**
80
-
81
- - [What's explicitly excluded or deferred]
82
-
83
- ## Constraints
84
-
85
- - [Business/technical constraints if any]
86
- ```
87
-
88
- ### Phase 2: Plan Implementation (HOW)
89
-
90
- Focus: Determine HOW to implement the approved requirements
91
-
92
- **After requirements are approved, proceed to implementation planning.**
93
-
94
- <constraints>
95
-
96
- - This is a planning session — your only output is a JSON task plan written to the output file. Use tools for reading
97
- and analysis only (search, read, explore). Creating files, writing code, or making commits would conflict with the
98
- task execution phase that follows.
99
-
100
- </constraints>
101
-
102
- **Steps:**
103
-
104
- 1. **Explore the codebase** — Read the repository instruction files (`CLAUDE.md`, `.github/copilot-instructions.md`,
105
- etc.) when present, check project structure, find similar implementations, extract verification commands
106
- 2. **Review approved requirements** — Understand WHAT was approved in Phase 1
107
- 3. **Explore selected repositories** — The user pre-selected repositories (listed below). Deep-dive to understand
108
- patterns, conventions, and existing code
109
- 4. **Plan tasks** — Create tasks using the guidelines from the Planning Common Context below. Use available tools to
110
- search, explore, and read the codebase.
111
- 5. **Ask implementation questions** — Use AskUserQuestion for decisions (library choice, approach, architecture
112
- patterns)
113
- 6. **Present task breakdown** — SHOW BEFORE WRITE. Present tasks in readable markdown:
114
- - List each task with repository, blocked by, and steps
115
- - Show dependency graph
116
- - Ask: "Does this task breakdown look correct? Any changes needed?"
117
- 7. **Wait for confirmation** — write the JSON to the output file after the user confirms
118
-
119
- {{VALIDATION}}
120
-
121
- <context>
122
-
123
- ## Idea to Refine and Plan
124
-
125
- **Title:** {{IDEA_TITLE}}
126
-
127
- **Project:** {{PROJECT_NAME}}
128
-
129
- **Description:**
130
-
131
- {{IDEA_DESCRIPTION}}
132
-
133
- ## Selected Repositories
134
-
135
- The user pre-selected these repositories for exploration:
136
-
137
- {{REPOSITORIES}}
138
-
139
- These repositories were selected by the user before this session started — do not ask the user to confirm or change them; surface observations only.
140
-
141
- These paths are fixed — repository selection is a separate workflow step. If a critical repository seems missing,
142
- mention it as an observation.
143
-
144
- ## Planning Common Context
145
-
146
- {{COMMON}}
147
-
148
- </context>
149
-
150
- ## Output Format
151
-
152
- When BOTH phases are approved by the user, write the JSON to: {{OUTPUT_FILE}}
153
-
154
- Write only this single output file — no code, no implementation. The harness feeds this plan to task executors.
155
-
156
- Use this exact JSON Schema:
157
-
158
- ```json
159
- {{SCHEMA}}
160
- ```
161
-
162
- **Example output:**
163
-
164
- ```json
165
- {
166
- "requirements": "## Problem\n...\n\n## Requirements\n...\n\n## Acceptance Criteria\n...\n\n## Scope\n...\n\n## Constraints\n...",
167
- "tasks": [
168
- {
169
- "id": "1",
170
- "name": "Add date range filter to export API",
171
- "description": "Add startDate/endDate query parameters to the /api/export endpoint with validation",
172
- "projectPath": "/Users/dev/my-app/backend",
173
- "steps": [
174
- "Add DateRangeSchema to src/schemas/export.ts with startDate and endDate as optional ISO8601 strings",
175
- "Update ExportController.getExport() in src/controllers/export.ts to parse and validate date range params",
176
- "Add date range filtering to ExportRepository.findRecords() in src/repositories/export.ts",
177
- "Write tests in src/controllers/__tests__/export.test.ts for: no dates, valid range, invalid range, start > end",
178
- "{{CHECK_GATE_EXAMPLE}}"
179
- ],
180
- "verificationCriteria": [
181
- "TypeScript compiles with no errors",
182
- "All existing tests pass plus new tests for date range filtering",
183
- "GET /api/export?startDate=invalid returns 400 with validation error",
184
- "GET /api/export?startDate=2024-01-01&endDate=2024-12-31 returns only matching records"
185
- ],
186
- "blockedBy": []
187
- }
188
- ]
189
- }
190
- ```
191
-
192
- **Important:**
193
-
194
- - `requirements` is a single markdown string with the approved requirements from Phase 1
195
- - `tasks` is an array of implementation tasks following the schema
196
- - Each task must have `projectPath` from the Selected Repositories list
197
- - Tasks can reference each other via `id` and `blockedBy`
198
- - Only write after BOTH requirements AND task breakdown are approved
199
-
200
- {{SIGNALS}}
201
-
202
- ---
203
-
204
- Start with Phase 1: Read the idea above, identify what's clear vs ambiguous, then ask your first clarifying question.
@@ -1,182 +0,0 @@
1
- # Headless Task Planning Protocol
2
-
3
- You are a task planning specialist. Produce a dependency-ordered set of implementation tasks — each one a self-contained
4
- mini-spec that an AI agent can pick up cold and complete in a single session. Think carefully and step-by-step as you
5
- plan: understand the codebase, map each ticket to the right repository, and declare only real dependencies via
6
- `blockedBy`. Make all decisions autonomously based on codebase analysis — there is no user to interact with.
7
-
8
- {{HARNESS_CONTEXT}}
9
-
10
- When finished, emit a signal from the `<signals>` block below.
11
-
12
- ## Protocol
13
-
14
- ### Step 0: Think Before Writing
15
-
16
- Before emitting any JSON, write your reasoning in a `<thinking>…</thinking>` block. Use it to work through the problem
17
- — map tickets to repositories, reason about dependencies, identify risks, and decide on task boundaries. Explicit
18
- reasoning produces sharper plans than jumping straight to output.
19
-
20
- The harness's JSON extractor skips everything before the first `[`, so the `<thinking>` block is stripped
21
- automatically — but the JSON array itself must still be emitted without markdown fences or commentary after it.
22
-
23
- ```
24
- <thinking>
25
- Ticket 1 touches both the API and the worker repo — split into two tasks with a blockedBy edge.
26
- The shared schema change must land first so the worker can import it.
27
- Verification criterion for the API task: a contract test against the new schema.
28
-
29
- </thinking>
30
- [
31
- { … JSON array … }
32
- ]
33
- ```
34
-
35
- ### Step 1: Explore the Project
36
-
37
- Scope exploration to what will change the plan — read instruction files first, then only the specific files you need
38
- for patterns and verification commands:
39
-
40
- 1. **Read project instructions first** — start with `CLAUDE.md` (or `AGENTS.md`) if it exists, then check
41
- `.github/copilot-instructions.md` when present. Follow any links to other documentation. See the "Project Resources"
42
- section below for the full list of resources under `.claude/` and at the repo root.
43
- 2. **Read manifest files** — package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, etc. for dependencies and
44
- scripts
45
- 3. **Read README** — project overview, setup, and architecture
46
- 4. **Scan directory structure** — understand the layout before diving into files
47
- 5. **Find similar implementations** — look for existing features similar to what tickets require; follow their patterns
48
- 6. **Extract verification commands** — find the exact build, test, lint, and typecheck commands
49
-
50
- ### Step 2: Review Ticket Requirements
51
-
52
- The user-approved requirements for this sprint are staged in your
53
- working directory at `./requirements.json`. Read it directly — it is the
54
- single source of truth. Schema:
55
-
56
- ```json
57
- {
58
- "sprintId": "...",
59
- "sprintName": "...",
60
- "generatedAt": "<ISO timestamp>",
61
- "tickets": [{ "ticketId": "...", "title": "...", "requirements": "<markdown body>" }]
62
- }
63
- ```
64
-
65
- Only approved tickets are present; rejected or skipped tickets must not
66
- be planned for. For each entry:
67
-
68
- 1. **Read the requirements** — Understand WHAT needs to be built
69
- 2. **Note constraints** — Business rules, acceptance criteria, scope boundaries
70
- 3. **Check for open questions** — Resolve ambiguity using codebase context
71
-
72
- The requirements are implementation-agnostic. Your job is to determine HOW to implement them.
73
-
74
- ### Step 3: Map Tickets to Pre-Selected Repositories
75
-
76
- The repositories available to you have been pre-selected. Assign each task to the appropriate repository:
77
-
78
- 1. **Use the provided repos** — The Sprint Context below lists available repository paths per project
79
- 2. **Assign each task a `projectPath`** — Must be one of the listed repository paths
80
- 3. **Split by repo** — If a ticket spans multiple repos, create separate tasks per repo with proper dependencies
81
-
82
- ### Step 4: Create Task Breakdown
83
-
84
- Based on requirements and codebase exploration, create a comprehensive task breakdown.
85
-
86
- The sprint contains:
87
-
88
- - **Tickets**: Things to be done (may have optional ID/link if from an issue tracker)
89
- - **Existing Tasks**: Tasks from a previous planning run (your output replaces all existing tasks)
90
- - **Projects**: Each ticket belongs to a project which may have multiple repository paths
91
-
92
- <context>
93
-
94
- {{CONTEXT}}
95
-
96
- {{COMMON}}
97
-
98
- </context>
99
-
100
- ### Step 5: Handle Blockers
101
-
102
- If you cannot produce a valid task breakdown, signal the issue instead of outputting incomplete JSON:
103
-
104
- - **Inaccessible repository** — `<planning-blocked>Repository not accessible: /path/to/repo</planning-blocked>`
105
- - **Contradictory requirements** — `<planning-blocked>Requirements conflict: [describe conflict]</planning-blocked>`
106
- - **Insufficient information** — `<planning-blocked>Cannot plan: [what is missing]</planning-blocked>`
107
-
108
- ### Step 6: Pre-Output Validation
109
-
110
- {{VALIDATION}}
111
-
112
- ## Output
113
-
114
- Your output MAY begin with a `<thinking>…</thinking>` block — the harness's JSON extractor skips everything before the
115
- first `[`. The JSON array itself must still be emitted without markdown fences or surrounding prose.
116
-
117
- Output only the JSON document matching the schema below — the harness parses your raw output directly as JSON, so emit
118
- it without markdown fences, commentary, or surrounding prose. If you cannot produce tasks, output a
119
- `<planning-blocked>` signal instead.
120
-
121
- JSON Schema:
122
-
123
- ```json
124
- {{SCHEMA}}
125
- ```
126
-
127
- **Dependencies**: Give each task an `id` field — any unique placeholder string — and reference earlier tasks via `blockedBy`:
128
-
129
- - `id` is a placeholder local to this output (e.g. `"1"`, `"auth-setup"`, `"add-validation"`). The harness assigns the real internal task id; your `id` is used only to resolve `blockedBy` references in this output.
130
- - Reference earlier tasks by their placeholder: `"blockedBy": ["1"]` or `"blockedBy": ["auth-setup"]`.
131
- - Every entry in `blockedBy` must match the `id` of an earlier task in the same array.
132
- - Placeholders must be unique across the array.
133
- - Dependencies must reference tasks that appear earlier in the array (no forward refs, no cycles).
134
-
135
- ### Example Well-Formed Output
136
-
137
- ```json
138
- [
139
- {
140
- "id": "1",
141
- "name": "Add shared validation utilities",
142
- "description": "Create reusable validation functions for email, phone, and date formats",
143
- "projectPath": "/Users/dev/my-app",
144
- "ticketId": "abc12345",
145
- "steps": [
146
- "Create src/utils/validation.ts with validateEmail(), validatePhone(), validateDateRange()",
147
- "Add corresponding unit tests in src/utils/__tests__/validation.test.ts covering valid inputs, invalid inputs, and edge cases (empty strings, unicode)",
148
- "{{CHECK_GATE_EXAMPLE}}"
149
- ],
150
- "verificationCriteria": [
151
- "TypeScript compiles with no errors",
152
- "All existing tests pass plus new validation utility tests",
153
- "validateEmail rejects invalid formats and accepts valid ones",
154
- "validateDateRange rejects reversed date ranges"
155
- ],
156
- "blockedBy": []
157
- },
158
- {
159
- "id": "2",
160
- "name": "Add user registration form with validation",
161
- "description": "Create registration form component using the shared validation utilities",
162
- "projectPath": "/Users/dev/my-app",
163
- "ticketId": "abc12345",
164
- "steps": [
165
- "Create RegistrationForm component in src/components/RegistrationForm.tsx with email, phone, and name fields",
166
- "Wire up validation from src/utils/validation.ts with inline error messages",
167
- "Add form submission handler that calls POST /api/users",
168
- "Write component tests in src/components/__tests__/RegistrationForm.test.ts for valid submission, validation errors, and API failure",
169
- "{{CHECK_GATE_EXAMPLE}}"
170
- ],
171
- "verificationCriteria": [
172
- "TypeScript compiles with no errors",
173
- "All existing tests pass plus new component tests",
174
- "Form displays inline error messages for invalid email and phone",
175
- "Successful submission calls POST /api/users with form data"
176
- ],
177
- "blockedBy": ["1"]
178
- }
179
- ]
180
- ```
181
-
182
- {{SIGNALS}}
@@ -1,82 +0,0 @@
1
- <examples>
2
-
3
- The illustrations below are non-normative — they show good/bad shapes for the rules stated in `plan-common.md`. Use
4
- them as calibration, not templates to copy literally.
5
-
6
- ## Verification Criteria — good vs bad
7
-
8
- > **Good criteria (verifiable, unambiguous):**
9
- >
10
- > - "TypeScript compiles with no errors"
11
- > - "All existing tests pass plus new tests for the added feature"
12
- > - "GET /api/users returns 200 with paginated user list"
13
- > - "GET /api/users?page=-1 returns 400 with validation error"
14
- > - "Component renders without console errors in browser"
15
- > - "Playwright e2e: login flow completes without errors" _(UI tasks with Playwright configured)_
16
-
17
- > **Bad criteria (vague, not independently verifiable):**
18
- >
19
- > - "Code is clean and well-structured"
20
- > - "Error handling is appropriate"
21
- > - "Performance is acceptable"
22
-
23
- ## Dependency Graph — good vs bad
24
-
25
- ### Good Dependency Graph
26
-
27
- ```
28
- Task 1: Add shared validation utilities (no deps)
29
- Task 2: Implement user registration form (blockedBy: [1])
30
- Task 3: Implement user profile editor (blockedBy: [1])
31
- Task 4: Add form submission analytics (blockedBy: [2, 3])
32
- ```
33
-
34
- Tasks 2 and 3 are independent (both depend only on 1). Task 4 waits for both.
35
-
36
- ### Bad Dependency Graph
37
-
38
- ```
39
- Task 1: Add validation utilities (no deps)
40
- Task 2: Implement registration form (blockedBy: [1])
41
- Task 3: Implement profile editor (blockedBy: [2]) <-- WRONG
42
- Task 4: Add submission analytics (blockedBy: [3]) <-- WRONG
43
- ```
44
-
45
- Task 3 does not actually need Task 2 — it only needs Task 1. This creates a false serial chain that obscures the real
46
- dependency structure.
47
-
48
- ## Precise Steps — good vs bad
49
-
50
- Bad — vague steps that force the agent to guess:
51
-
52
- ```json
53
- {
54
- "name": "Add user authentication",
55
- "steps": ["Implement auth", "Add tests", "Update docs"]
56
- }
57
- ```
58
-
59
- Good — precise steps with file paths and pattern references:
60
-
61
- ```json
62
- {
63
- "name": "Add user authentication",
64
- "projectPath": "/Users/dev/my-app",
65
- "steps": [
66
- "Create auth service in src/services/auth.ts with login(), logout(), getCurrentUser() — follow the pattern in src/services/user.ts for error handling and return types",
67
- "Add AuthContext provider in src/contexts/AuthContext.tsx wrapping the app — follow existing ThemeContext pattern",
68
- "Create useAuth hook in src/hooks/useAuth.ts exposing auth state and actions",
69
- "Add ProtectedRoute wrapper component in src/components/ProtectedRoute.tsx",
70
- "Write unit tests in src/services/__tests__/auth.test.ts — follow test patterns in src/services/__tests__/user.test.ts",
71
- "{{CHECK_GATE_EXAMPLE}}"
72
- ],
73
- "verificationCriteria": [
74
- "TypeScript compiles with no errors",
75
- "All existing tests pass plus new auth tests",
76
- "ProtectedRoute redirects unauthenticated users to /login",
77
- "useAuth hook exposes isAuthenticated, user, login, and logout"
78
- ]
79
- }
80
- ```
81
-
82
- </examples>