prjct-cli 3.47.0 → 3.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/LICENSE +2 -2
- package/NOTICE +25 -0
- package/README.md +6 -2
- package/dist/bin/prjct-core.mjs +528 -527
- package/dist/bin/prjct-hooks.mjs +277 -276
- package/dist/bin/prjct.mjs +2 -2
- package/dist/daemon/entry.mjs +419 -418
- package/dist/mcp/server.mjs +225 -224
- package/dist/templates.json +1 -1
- package/package.json +18 -2
- package/templates/global/STORAGE-SPEC.md +0 -327
- package/templates/planning-methodology-deep.md +0 -195
- package/templates/sdd-canonical-sequence.md +0 -85
- package/templates/spec-reviewer-rubrics/architecture.md +0 -47
- package/templates/spec-reviewer-rubrics/design.md +0 -38
- package/templates/spec-reviewer-rubrics/strategic.md +0 -32
- package/templates/spec-template.md +0 -97
- /package/templates/crew/{CLAUDE-leader-mode.md → leader-mode.md} +0 -0
- /package/templates/crew/{agents → roles}/implementer.md +0 -0
- /package/templates/crew/{agents → roles}/leader.md +0 -0
- /package/templates/crew/{agents → roles}/reviewer.md +0 -0
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# Software Planning Methodology for prjct
|
|
2
|
-
|
|
3
|
-
This methodology guides the AI through developing ideas into complete technical specifications.
|
|
4
|
-
|
|
5
|
-
## Phase 1: Discovery & Problem Definition
|
|
6
|
-
|
|
7
|
-
### Questions to Ask
|
|
8
|
-
- What specific problem does this solve?
|
|
9
|
-
- Who is the target user?
|
|
10
|
-
- What's the budget and timeline?
|
|
11
|
-
- What happens if this problem isn't solved?
|
|
12
|
-
|
|
13
|
-
### Output
|
|
14
|
-
- Problem statement
|
|
15
|
-
- User personas
|
|
16
|
-
- Business constraints
|
|
17
|
-
- Success metrics
|
|
18
|
-
|
|
19
|
-
## Phase 2: User Flows & Journeys
|
|
20
|
-
|
|
21
|
-
### Process
|
|
22
|
-
1. Map primary user journey
|
|
23
|
-
2. Identify entry points
|
|
24
|
-
3. Define success states
|
|
25
|
-
4. Document error states
|
|
26
|
-
5. Note edge cases
|
|
27
|
-
|
|
28
|
-
### Jobs-to-be-Done
|
|
29
|
-
When [situation], I want to [motivation], so I can [expected outcome]
|
|
30
|
-
|
|
31
|
-
## Phase 3: Domain Modeling
|
|
32
|
-
|
|
33
|
-
### Entity Definition
|
|
34
|
-
For each entity, define:
|
|
35
|
-
- Description
|
|
36
|
-
- Attributes (name, type, constraints)
|
|
37
|
-
- Relationships
|
|
38
|
-
- Business rules
|
|
39
|
-
- Lifecycle states
|
|
40
|
-
|
|
41
|
-
### Bounded Contexts
|
|
42
|
-
Group entities into logical boundaries with:
|
|
43
|
-
- Owned entities
|
|
44
|
-
- External dependencies
|
|
45
|
-
- Events published/consumed
|
|
46
|
-
|
|
47
|
-
## Phase 4: API Contract Design
|
|
48
|
-
|
|
49
|
-
### Style Selection
|
|
50
|
-
| Style | Best For |
|
|
51
|
-
|----------|----------|
|
|
52
|
-
| REST | Simple CRUD, broad compatibility |
|
|
53
|
-
| GraphQL | Complex data requirements |
|
|
54
|
-
| tRPC | Full-stack TypeScript |
|
|
55
|
-
| gRPC | Microservices |
|
|
56
|
-
|
|
57
|
-
### Endpoint Specification
|
|
58
|
-
- Method/Type
|
|
59
|
-
- Path/Name
|
|
60
|
-
- Authentication
|
|
61
|
-
- Input/Output schemas
|
|
62
|
-
- Error responses
|
|
63
|
-
|
|
64
|
-
## Phase 5: System Architecture
|
|
65
|
-
|
|
66
|
-
### Pattern Selection
|
|
67
|
-
| Pattern | Best For |
|
|
68
|
-
|---------|----------|
|
|
69
|
-
| Modular Monolith | Small team, fast iteration |
|
|
70
|
-
| Serverless-First | Variable load, event-driven |
|
|
71
|
-
| Microservices | Large team, complex domain |
|
|
72
|
-
|
|
73
|
-
### C4 Model
|
|
74
|
-
1. Context - System and external actors
|
|
75
|
-
2. Container - Major components
|
|
76
|
-
3. Component - Internal structure
|
|
77
|
-
|
|
78
|
-
## Phase 6: Data Architecture
|
|
79
|
-
|
|
80
|
-
### Database Selection
|
|
81
|
-
| Type | Options | Best For |
|
|
82
|
-
|------|---------|----------|
|
|
83
|
-
| Relational | PostgreSQL | ACID, structured data |
|
|
84
|
-
| Document | MongoDB | Flexible schema |
|
|
85
|
-
| Key-Value | Redis | Caching, sessions |
|
|
86
|
-
|
|
87
|
-
### Schema Design
|
|
88
|
-
- Tables and columns
|
|
89
|
-
- Indexes
|
|
90
|
-
- Constraints
|
|
91
|
-
- Relationships
|
|
92
|
-
|
|
93
|
-
## Phase 7: Tech Stack Decision
|
|
94
|
-
|
|
95
|
-
### Frontend Stack
|
|
96
|
-
- Framework (Next.js, Remix, SvelteKit)
|
|
97
|
-
- Styling (Tailwind, CSS Modules)
|
|
98
|
-
- State management (Zustand, Jotai)
|
|
99
|
-
- Data fetching (TanStack Query, SWR)
|
|
100
|
-
|
|
101
|
-
### Backend Stack
|
|
102
|
-
- Runtime (Node.js, Bun)
|
|
103
|
-
- Framework (Next.js API, Hono)
|
|
104
|
-
- ORM (Drizzle, Prisma)
|
|
105
|
-
- Validation (Zod, Valibot)
|
|
106
|
-
|
|
107
|
-
### Infrastructure
|
|
108
|
-
- Hosting (Vercel, Railway, Fly.io)
|
|
109
|
-
- Database (Neon, PlanetScale)
|
|
110
|
-
- Cache (Upstash, Redis)
|
|
111
|
-
- Monitoring (Sentry, Axiom)
|
|
112
|
-
|
|
113
|
-
## Phase 8: Implementation Roadmap
|
|
114
|
-
|
|
115
|
-
### MVP Scope Definition
|
|
116
|
-
- Must-have features (P0)
|
|
117
|
-
- Should-have features (P1)
|
|
118
|
-
- Nice-to-have features (P2)
|
|
119
|
-
- Future considerations (P3)
|
|
120
|
-
|
|
121
|
-
### Development Phases
|
|
122
|
-
1. Foundation - Setup, core infrastructure
|
|
123
|
-
2. Core Features - Primary functionality
|
|
124
|
-
3. Polish & Launch - Optimization, deployment
|
|
125
|
-
|
|
126
|
-
### Risk Assessment
|
|
127
|
-
- Technical risks and mitigation
|
|
128
|
-
- Business risks and mitigation
|
|
129
|
-
- Dependencies and assumptions
|
|
130
|
-
|
|
131
|
-
## Output Structure
|
|
132
|
-
|
|
133
|
-
When complete, generate:
|
|
134
|
-
|
|
135
|
-
1. **Executive Summary** - Problem, solution, key decisions
|
|
136
|
-
2. **Architecture Documents** - All phases detailed
|
|
137
|
-
3. **Implementation Plan** - Prioritized tasks with estimates
|
|
138
|
-
4. **Decision Log** - Key choices and reasoning
|
|
139
|
-
|
|
140
|
-
## Interactive Development Process
|
|
141
|
-
|
|
142
|
-
1. **Classification**: Determine if idea needs full architecture
|
|
143
|
-
2. **Discovery**: Ask clarifying questions
|
|
144
|
-
3. **Generation**: Create architecture phase by phase
|
|
145
|
-
4. **Validation**: Review with user at key points
|
|
146
|
-
5. **Refinement**: Iterate based on feedback
|
|
147
|
-
6. **Output**: Save complete specification
|
|
148
|
-
|
|
149
|
-
## Success Criteria
|
|
150
|
-
|
|
151
|
-
A complete architecture includes:
|
|
152
|
-
- Clear problem definition
|
|
153
|
-
- User flows mapped
|
|
154
|
-
- Domain model defined
|
|
155
|
-
- API contracts specified
|
|
156
|
-
- Tech stack chosen
|
|
157
|
-
- Database schema designed
|
|
158
|
-
- Implementation roadmap created
|
|
159
|
-
- Risk assessment completed
|
|
160
|
-
|
|
161
|
-
## Templates
|
|
162
|
-
|
|
163
|
-
### Entity Template
|
|
164
|
-
```
|
|
165
|
-
Entity: [Name]
|
|
166
|
-
├── Description: [What it represents]
|
|
167
|
-
├── Attributes:
|
|
168
|
-
│ ├── id: uuid (primary key)
|
|
169
|
-
│ └── [field]: [type] ([constraints])
|
|
170
|
-
├── Relationships: [connections]
|
|
171
|
-
├── Rules: [invariants]
|
|
172
|
-
└── States: [lifecycle]
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### API Endpoint Template
|
|
176
|
-
```
|
|
177
|
-
Operation: [Name]
|
|
178
|
-
├── Method: [GET/POST/PUT/DELETE]
|
|
179
|
-
├── Path: [/api/resource]
|
|
180
|
-
├── Auth: [Required/Optional]
|
|
181
|
-
├── Input: {schema}
|
|
182
|
-
├── Output: {schema}
|
|
183
|
-
└── Errors: [codes and descriptions]
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### Phase Template
|
|
187
|
-
```
|
|
188
|
-
Phase: [Name]
|
|
189
|
-
├── Duration: [timeframe]
|
|
190
|
-
├── Tasks:
|
|
191
|
-
│ ├── [Task 1]
|
|
192
|
-
│ └── [Task 2]
|
|
193
|
-
├── Deliverable: [outcome]
|
|
194
|
-
└── Dependencies: [prerequisites]
|
|
195
|
-
```
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# SDD canonical sequence — prjct
|
|
2
|
-
|
|
3
|
-
Spec-Driven Development is prjct's default flow for substantive work. The six stations:
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
spec ─→ audit-spec ─→ task (--spec <id>) ─→ implement ─→ ship (acceptance gate)
|
|
7
|
-
└─→ remember learning
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## Stations
|
|
11
|
-
|
|
12
|
-
### 1. `spec`
|
|
13
|
-
|
|
14
|
-
The user describes a feature, fix, or initiative WITH goals or stakes. You don't run `task` yet. You run `prjct spec "<title>"` and walk the forcing questions:
|
|
15
|
-
|
|
16
|
-
- goal (1–3 sentences)
|
|
17
|
-
- eli10 (2–4 sentences)
|
|
18
|
-
- stakes if we ship the wrong thing
|
|
19
|
-
- acceptance criteria (testable, observable list)
|
|
20
|
-
- scope (what's IN)
|
|
21
|
-
- out_of_scope (what's OUT)
|
|
22
|
-
- risks (each with mitigation)
|
|
23
|
-
- test plan
|
|
24
|
-
|
|
25
|
-
The CLI persists this in the `specs` SQLite table.
|
|
26
|
-
|
|
27
|
-
### 2. `audit-spec`
|
|
28
|
-
|
|
29
|
-
Before writing any code: harden the spec. Run `prjct audit-spec <id>` — it emits a dispatch prompt for THREE review subagents that you run IN PARALLEL (one tool-use block per reviewer in the SAME message):
|
|
30
|
-
|
|
31
|
-
- **strategic** — scope sanity. Worth doing? Right size?
|
|
32
|
-
- **architecture** — feasibility. Data flow, failure modes, dependencies.
|
|
33
|
-
- **design** — UX/DX quality. Four dimensions rated 0–10.
|
|
34
|
-
|
|
35
|
-
Each returns a verdict (pass | fail) + notes. You write each back via `prjct spec record-review`. When all three pass, the spec auto-promotes from `draft` → `reviewed`.
|
|
36
|
-
|
|
37
|
-
If any reviewer fails: revise the spec via `prjct spec update`, re-audit. The cost of iteration is minutes; the cost of mid-implementation rework is hours-to-days.
|
|
38
|
-
|
|
39
|
-
### 3. `task --spec <id>`
|
|
40
|
-
|
|
41
|
-
Now create the task. The `--spec` flag wires the task to its spec via `linked_spec_id`. Without it, `ship` later has nothing to gate against.
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
prjct work "implement rate-limit middleware" --spec <id>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 4. implement
|
|
48
|
-
|
|
49
|
-
Normal coding loop. Mid-flight workflows (`review`, `qa`, `investigate`) still apply. The spec is your anti-creep shield: when the user pivots into out-of-scope territory, surface the spec and ask whether to update it or defer.
|
|
50
|
-
|
|
51
|
-
### 5. `ship` (with the spec gate)
|
|
52
|
-
|
|
53
|
-
`prjct ship` reads the linked spec's `acceptance_criteria` and surfaces them as a checklist in the PR description. Walk each one — pass / fail / N/A. If any criterion is unmet → STOP and surface to the user.
|
|
54
|
-
|
|
55
|
-
Override path: `prjct ship --no-spec-gate` (use only when the user explicitly accepts).
|
|
56
|
-
|
|
57
|
-
### 6. `remember learning`
|
|
58
|
-
|
|
59
|
-
After ship, capture what the spec got right and wrong:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
prjct remember learning "spec missed the clock-skew edge case; future rate-limit specs should call out time-source"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
The next spec is sharper. Compounding effect: the vault accumulates spec-shaped lessons.
|
|
66
|
-
|
|
67
|
-
## When to bypass SDD
|
|
68
|
-
|
|
69
|
-
Not every keystroke goes through six stations. Routine work skips `spec`:
|
|
70
|
-
|
|
71
|
-
- single-file fix with known scope
|
|
72
|
-
- doc tweak / typo
|
|
73
|
-
- inbox capture / GTD dump
|
|
74
|
-
- conversational Q&A
|
|
75
|
-
- re-running a failing test
|
|
76
|
-
- bug fix where root cause is already known
|
|
77
|
-
|
|
78
|
-
Rule of thumb: if the work touches >1 file, ships to users, or takes >30 minutes, default to `spec` first.
|
|
79
|
-
|
|
80
|
-
## Anti-patterns
|
|
81
|
-
|
|
82
|
-
- **Skipping straight to `task` because the user said "let's build X".** If they said it WITH stakes, the spec is what protects them from scope creep mid-implementation.
|
|
83
|
-
- **Auditing AFTER implementing.** Pre-implementation review is the whole point. Post-hoc review of code-against-spec is the `review` workflow, not `audit-spec`.
|
|
84
|
-
- **Treating the spec as immutable.** Specs evolve. When implementation surfaces a missing acceptance criterion or a wrong scope assumption, update the spec — `prjct spec update` — don't ship around it.
|
|
85
|
-
- **Marking `acceptance_criteria` met without proof.** The criterion exists to be tested. If the test wasn't run, the criterion isn't met.
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
# Architecture reviewer rubric — `audit-spec`
|
|
2
|
-
|
|
3
|
-
You are reviewing a `prjct` spec for engineering feasibility. You receive the spec body verbatim. Apply the questions below; return a structured verdict.
|
|
4
|
-
|
|
5
|
-
## Questions to ask
|
|
6
|
-
|
|
7
|
-
1. **Can this be built?** With the team's stack and skill set, in the implied timeframe. If "no" or "yes but only by replacing the database", fail.
|
|
8
|
-
2. **Is the data flow coherent?** Trace input → state → output. Where does data live? Who writes it? Who reads it? Failure modes at each hop.
|
|
9
|
-
3. **Is the state machine implicit or explicit?** Explicit > implicit. If acceptance criteria reference behavior that depends on state transitions, the spec should name them.
|
|
10
|
-
4. **What edge cases / failure modes are missing?** Concurrency, partial writes, retries, network blips, auth failures, rate-limit collisions, clock skew. Name the top 1–2 that the spec doesn't address.
|
|
11
|
-
5. **What dependencies does this introduce?** New runtime dep? New infra (Redis, queue, cron)? Document it. New deps that aren't named in the spec are the #1 source of mid-implementation surprise.
|
|
12
|
-
6. **Test plan adequate?** A test plan that says "tests added" is not a plan. Look for: unit, integration, manual reproduction, performance (when relevant).
|
|
13
|
-
|
|
14
|
-
## Output format
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
verdict: pass | fail
|
|
18
|
-
notes: 2–4 sentences + (when applicable) a short ASCII data flow / state diagram.
|
|
19
|
-
If pass, name the most load-bearing architectural choice.
|
|
20
|
-
If fail, name the SINGLE biggest gap and how to close it.
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Examples
|
|
24
|
-
|
|
25
|
-
**Pass with diagram:**
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
verdict: pass
|
|
29
|
-
notes: Token-bucket per IP with 5-minute Redis TTL is the right call — survives restarts, no GC pressure, easy to extend to user-id keys later. The spec correctly limits scope to /auth (no /api yet). One missing edge: clock-skew between Node process and Redis on bucket refill — recommend storing absolute timestamps server-side.
|
|
30
|
-
|
|
31
|
-
request → middleware → Redis GETSET (token, ts)
|
|
32
|
-
├── allowed → next()
|
|
33
|
-
└── refused → 429 + Retry-After
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Fail:**
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
verdict: fail
|
|
40
|
-
notes: Spec references "real-time updates" in acceptance_criteria but is silent on transport (WebSocket? SSE? polling?). Each has different failure modes (reconnect storms, head-of-line blocking, server load). Pick one explicitly and re-spec — current acceptance criteria are vacuously true for a 60-second polling loop, which probably isn't what the user wants.
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Anti-patterns to refuse
|
|
44
|
-
|
|
45
|
-
- Architectural cosplay: "consider using DDD/hexagonal/CQRS" without showing why this spec demands it.
|
|
46
|
-
- Failing because "the spec doesn't say which framework" when framework is obvious from the project's stack (skill body's project context tells you).
|
|
47
|
-
- Skipping the data flow trace — the most useful thing this rubric produces.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Design reviewer rubric — `audit-spec`
|
|
2
|
-
|
|
3
|
-
You are reviewing a `prjct` spec for design quality (UX for user-facing surfaces, DX for developer-facing surfaces — same rubric, different surface).
|
|
4
|
-
|
|
5
|
-
## Questions to ask
|
|
6
|
-
|
|
7
|
-
Rate each dimension 0–10 against the spec's described surface (UI, API, CLI, library):
|
|
8
|
-
|
|
9
|
-
1. **Clarity** — would a new user / developer know what this does without reading code or docs? 0 = inscrutable; 10 = self-documenting.
|
|
10
|
-
2. **Ergonomics** — is the common case fast and the rare case possible? 0 = forces the rare case into every flow; 10 = invisible until needed.
|
|
11
|
-
3. **Consistency** — does it match the surrounding system's conventions? 0 = a foreign body; 10 = indistinguishable from neighboring features.
|
|
12
|
-
4. **Accessibility** — for UI: keyboard / screen-reader / contrast / motion. For API/CLI: discoverability, error messages, --help, machine-readable output. 0 = unusable for entire categories of users; 10 = enables everyone.
|
|
13
|
-
|
|
14
|
-
## Verdict rule
|
|
15
|
-
|
|
16
|
-
- All four dimensions ≥ 6 → `pass`.
|
|
17
|
-
- Any dimension < 6 → `fail`.
|
|
18
|
-
|
|
19
|
-
## Output format
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
verdict: pass | fail
|
|
23
|
-
notes: clarity=N ergonomics=N consistency=N accessibility=N
|
|
24
|
-
Lowest-scoring dimension first, with the SINGLE concrete change that would raise it.
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Examples
|
|
28
|
-
|
|
29
|
-
**Pass:** "clarity=8 ergonomics=7 consistency=9 accessibility=6. Lowest is accessibility — the new endpoint returns errors as JSON only; recommend adding `Accept: text/plain` fallback for grep-the-pipeline operators. Otherwise the surface matches the existing `/api/v2` shape and ergonomics are right (single required field, sensible defaults)."
|
|
30
|
-
|
|
31
|
-
**Fail:** "clarity=4 ergonomics=6 consistency=7 accessibility=7. Clarity tanks because the verb name `prjct shimmer` doesn't telegraph the action; rename to `prjct refresh` or `prjct rebuild` and re-rate. Other dimensions are healthy."
|
|
32
|
-
|
|
33
|
-
## Anti-patterns to refuse
|
|
34
|
-
|
|
35
|
-
- Vague "looks good" — every dimension needs a number.
|
|
36
|
-
- Ignoring accessibility for "internal tools" — internal users include the colorblind and the blind.
|
|
37
|
-
- Failing on aesthetic taste alone (color, typography). Design rubric is about USE, not opinion.
|
|
38
|
-
- Over-indexing on novelty. Surfaces that surprise users score LOW on consistency, not high.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Strategic reviewer rubric — `audit-spec`
|
|
2
|
-
|
|
3
|
-
You are reviewing a `prjct` spec for strategic soundness. You receive the spec body verbatim. Apply the questions below; return a single structured verdict.
|
|
4
|
-
|
|
5
|
-
## Questions to ask
|
|
6
|
-
|
|
7
|
-
1. **Is the goal real?** Does this solve a problem the user (or org) actually has? Or is it a tools-team-flavored solution looking for a problem?
|
|
8
|
-
2. **Is the goal worth the cost?** Crude estimate of build cost vs. impact. If goal is small but cost is large, fail.
|
|
9
|
-
3. **Is `out_of_scope` coherent with `goal`?** Goal that says "fix onboarding" with `out_of_scope: ["welcome email", "first-login flow"]` — what's left? Fail if scope evaporates the goal.
|
|
10
|
-
4. **Is the spec OVER-scoped?** Trying to ship a quarter's work in one PR. Boil-the-lake principle says completeness is cheap when it costs minutes — fail when it costs months.
|
|
11
|
-
5. **Is the spec UNDER-scoped?** Acceptance criteria so narrow that shipping doesn't move the needle. Fail when meeting all criteria still leaves the user's problem unsolved.
|
|
12
|
-
6. **Are stakes honest?** "Users will be frustrated" is too vague. "Auth fails for 3% of sessions during peak load" is testable.
|
|
13
|
-
|
|
14
|
-
## Output format
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
verdict: pass | fail
|
|
18
|
-
notes: 2–4 sentences. If pass, name the strongest framing element. If fail, name the SINGLE
|
|
19
|
-
biggest gap and how to close it.
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Examples
|
|
23
|
-
|
|
24
|
-
**Pass:** "Goal is concrete (sub-200ms p95 on dashboard) and the stakes are measurable (lost engagement on slow widgets). Scope and out_of_scope draw a clean line. The strongest element is the explicit 'no caching layer in this PR' — that's the right anti-creep."
|
|
25
|
-
|
|
26
|
-
**Fail:** "Goal says 'improve auth UX' but acceptance_criteria all measure backend latency. Either rewrite the goal (this is a perf spec, not UX) or rewrite the criteria (add a usability metric). Currently the spec would pass review on a perf change that didn't move UX at all."
|
|
27
|
-
|
|
28
|
-
## Anti-patterns to refuse
|
|
29
|
-
|
|
30
|
-
- Praising the spec without naming a strength (`pass: looks good!` — useless).
|
|
31
|
-
- Failing without proposing a fix (the next iteration of the spec needs a path forward).
|
|
32
|
-
- Auto-failing because the spec is "ambitious" — strategic review measures soundness, not size.
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Spec template — `prjct spec`
|
|
2
|
-
|
|
3
|
-
A spec frames a piece of work BEFORE implementation. Cheap to write, cheap to revise; un-doing implementation isn't.
|
|
4
|
-
|
|
5
|
-
The fields below match `core/types/spec.ts`. Validation is enforced by Zod at write time.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Title (one line)
|
|
10
|
-
|
|
11
|
-
What you'd say to a coworker walking by your desk.
|
|
12
|
-
|
|
13
|
-
## Goal (1–3 sentences)
|
|
14
|
-
|
|
15
|
-
What success looks like. Concrete. Observable.
|
|
16
|
-
|
|
17
|
-
## ELI10 (2–4 sentences)
|
|
18
|
-
|
|
19
|
-
Plain English a 16-year-old could follow. Forces you to articulate why this matters without jargon.
|
|
20
|
-
|
|
21
|
-
## Stakes if we ship the wrong thing (1 sentence)
|
|
22
|
-
|
|
23
|
-
What breaks. Who notices. How fast.
|
|
24
|
-
|
|
25
|
-
## Acceptance criteria (testable, observable list)
|
|
26
|
-
|
|
27
|
-
Each line is a sentence ending in a verifiable claim:
|
|
28
|
-
|
|
29
|
-
- the new endpoint returns 429 after the 11th request in a minute from the same IP
|
|
30
|
-
- the dashboard widget renders within 200ms p95 on a synthetic 4G profile
|
|
31
|
-
- `prjct spec audit <id>` blocks if any reviewer returns `fail`
|
|
32
|
-
|
|
33
|
-
Anti-patterns:
|
|
34
|
-
|
|
35
|
-
- "the system should be fast" — what threshold, measured how?
|
|
36
|
-
- "users will love it" — not testable
|
|
37
|
-
- "follow industry best practices" — what specifically?
|
|
38
|
-
|
|
39
|
-
## Scope (what's IN)
|
|
40
|
-
|
|
41
|
-
The pieces this spec commits to. Be specific about file paths, surfaces, modules.
|
|
42
|
-
|
|
43
|
-
## Out of scope (what's OUT)
|
|
44
|
-
|
|
45
|
-
The pieces this spec explicitly DOES NOT cover. This is your anti-creep shield mid-implementation.
|
|
46
|
-
|
|
47
|
-
## Risks
|
|
48
|
-
|
|
49
|
-
Each risk has a mitigation. A risk without a mitigation is just a complaint.
|
|
50
|
-
|
|
51
|
-
- **risk:** legacy endpoints rely on the same rate-limit middleware → **mitigation:** scope key separates `/auth` from `/api`
|
|
52
|
-
- **risk:** Redis dependency raises ops cost → **mitigation:** start with in-memory token bucket; swap to Redis only above 5 RPS
|
|
53
|
-
|
|
54
|
-
## Test plan
|
|
55
|
-
|
|
56
|
-
How you'll prove the acceptance criteria. Includes the unhappy path.
|
|
57
|
-
|
|
58
|
-
- unit tests for the token bucket math
|
|
59
|
-
- integration test: 11 requests, 11th returns 429
|
|
60
|
-
- load test: 100 RPS sustained for 60s, no memory growth
|
|
61
|
-
- manual: trigger via `curl` and inspect response headers
|
|
62
|
-
|
|
63
|
-
## Notes (optional)
|
|
64
|
-
|
|
65
|
-
Things that don't fit anywhere else but matter for context.
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Lifecycle
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
draft → reviewed → in_progress → shipped
|
|
73
|
-
→ archived
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
- `draft` — created, not yet audited.
|
|
77
|
-
- `reviewed` — `prjct audit-spec` returned pass on all three reviewers.
|
|
78
|
-
- `in_progress` — at least one task with `linked_spec_id` exists.
|
|
79
|
-
- `shipped` — code merged, criteria met (or override accepted).
|
|
80
|
-
- `archived` — superseded or abandoned.
|
|
81
|
-
|
|
82
|
-
## Verb cheatsheet
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
prjct spec "<title>" # draft — NO `draft` subverb, pass title directly
|
|
86
|
-
prjct spec list [--status <s>]
|
|
87
|
-
prjct spec show <id>
|
|
88
|
-
prjct spec update <id> --json '{...}' # PATCH content (shallow merge)
|
|
89
|
-
prjct spec audit <id> # emit subagent dispatch
|
|
90
|
-
prjct spec record-review <id> --reviewer <name> --verdict <pass|fail> --notes "..."
|
|
91
|
-
prjct spec link-task <id> --task-id <task>
|
|
92
|
-
prjct spec ship <id> [--pr <n>]
|
|
93
|
-
prjct spec set-status <id> --status archived
|
|
94
|
-
prjct spec inventory [--md|--json] # coverage map per module
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
> **No `draft` subverb.** `prjct spec "<title>"` already creates a draft. The CLI tolerates `prjct spec draft|new|create "<title>"` as friendly aliases (the leading word is stripped) so `prjct spec draft "rate limiting"` and `prjct spec "rate limiting"` produce the same spec — but the canonical form has no leading verb.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|