Skip to content

Commit 98c1bbc

Browse files
committed
refactor: remove OpenAPI/GraphQL bias from templates (github#1652)
Cherry-pick of upstream 12405c0. Kept local PRD/AR/SEC discovery logic in tasks.md while accepting upstream's interface contracts terminology change.
1 parent 0544dca commit 98c1bbc

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

templates/commands/plan.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ You **MUST** consider the user input before proceeding (if not empty).
146146
- Validation rules from requirements
147147
- State transitions if applicable
148148

149-
2. **Generate API contracts** from functional requirements:
150-
- For each user action → endpoint
151-
- Use standard REST/GraphQL patterns
152-
- Output OpenAPI/GraphQL schema to `/contracts/`
149+
2. **Define interface contracts** (if project has external interfaces) → `/contracts/`:
150+
- Identify what interfaces the project exposes to users or other systems
151+
- Document the contract format appropriate for the project type
152+
- Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
153+
- Skip if project is purely internal (build scripts, one-off tools, etc.)
153154

154155
3. **Agent context update**:
155156
- Run `{AGENT_SCRIPT}`

templates/commands/specify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ When creating this spec from a user prompt:
277277
- Performance targets: Standard web/mobile app expectations unless specified
278278
- Error handling: User-friendly messages with appropriate fallbacks
279279
- Authentication method: Standard session-based or OAuth2 for web apps
280-
- Integration patterns: RESTful APIs unless specified otherwise
280+
- Integration patterns: Use project-appropriate patterns (REST/GraphQL for web services, function calls for libraries, CLI args for tools, etc.)
281281
282282
### Success Criteria Guidelines
283283

templates/commands/tasks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ You **MUST** consider the user input before proceeding (if not empty).
4343
- PRD: Check if the `PRD` path from the script exists; if not, try `FEATURE_DIR/prd.md`, then check `AVAILABLE_DOCS` for `prd.md`, then try `docs/PRD/<feature-prefix>-*.md`
4444
- AR: Check if the `ARD` path from the script exists; if not, try `FEATURE_DIR/ar.md`, then check `AVAILABLE_DOCS` for `ar.md`, then try `docs/AR/<feature-prefix>-*.md`
4545
- SEC: Check if the `SEC` path from the script exists; if not, try `FEATURE_DIR/sec.md`, then check `AVAILABLE_DOCS` for `sec.md`, then try `docs/SEC/<feature-prefix>-*.md`
46-
- data-model.md (entities), contracts/ (API endpoints), research.md (decisions), quickstart.md (test scenarios)
46+
- data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
4747
- Note: Not all projects have all documents. Generate tasks based on what's available.
4848

4949
5. **Execute task generation workflow**:
@@ -53,7 +53,7 @@ You **MUST** consider the user input before proceeding (if not empty).
5353
- If ar.md exists: Extract component architecture, implementation guardrails, and selected option constraints
5454
- If sec.md exists: Extract security requirements (SEC-*) and generate security-specific tasks (e.g., input validation, auth checks, data encryption)
5555
- If data-model.md exists: Extract entities and map to user stories
56-
- If contracts/ exists: Map endpoints to user stories
56+
- If contracts/ exists: Map interface contracts to user stories
5757
- If research.md exists: Extract decisions for setup tasks
5858
- Generate tasks organized by user story (see Task Generation Rules below)
5959
- Generate dependency graph showing user story completion order
@@ -130,13 +130,13 @@ Every task MUST strictly follow this format:
130130
- Map all related components to their story:
131131
- Models needed for that story
132132
- Services needed for that story
133-
- Endpoints/UI needed for that story
133+
- Interfaces/UI needed for that story
134134
- If tests requested: Tests specific to that story
135135
- Mark story dependencies (most stories should be independent)
136136

137137
2. **From Contracts**:
138-
- Map each contract/endpoint → to the user story it serves
139-
- If tests requested: Each contract → contract test task [P] before implementation in that story's phase
138+
- Map each interface contract → to the user story it serves
139+
- If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
140140

141141
3. **From Data Model**:
142142
- Map each entity to the user story(ies) that need it

templates/plan-template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
**Storage**: [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
2323
**Testing**: [e.g., pytest, XCTest, cargo test or NEEDS CLARIFICATION]
2424
**Target Platform**: [e.g., Linux server, iOS 15+, WASM or NEEDS CLARIFICATION]
25-
**Project Type**: [single/web/mobile - determines source structure]
25+
**Project Type**: [e.g., library/cli/web-service/mobile-app/compiler/desktop-app or NEEDS CLARIFICATION]
2626
**Performance Goals**: [domain-specific, e.g., 1000 req/s, 10k lines/sec, 60 fps or NEEDS CLARIFICATION]
2727
**Constraints**: [domain-specific, e.g., <200ms p95, <100MB memory, offline-capable or NEEDS CLARIFICATION]
2828
**Scale/Scope**: [domain-specific, e.g., 10k users, 1M LOC, 50 screens or NEEDS CLARIFICATION]

0 commit comments

Comments
 (0)