specweave 1.0.215 → 1.0.217
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/CLAUDE.md +24 -24
- package/dist/plugins/specweave/lib/external-sync/duplicate-detector-base.d.ts +73 -0
- package/dist/plugins/specweave/lib/external-sync/duplicate-detector-base.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/external-sync/duplicate-detector-base.js +134 -0
- package/dist/plugins/specweave/lib/external-sync/duplicate-detector-base.js.map +1 -0
- package/dist/plugins/specweave/lib/external-sync/permission-gate.d.ts +36 -0
- package/dist/plugins/specweave/lib/external-sync/permission-gate.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/external-sync/permission-gate.js +81 -0
- package/dist/plugins/specweave/lib/external-sync/permission-gate.js.map +1 -0
- package/dist/src/adapters/README.md +3 -4
- package/dist/src/adapters/claude/README.md +0 -1
- package/dist/src/adapters/codex/adapter.d.ts.map +1 -1
- package/dist/src/adapters/codex/adapter.js +5 -6
- package/dist/src/adapters/codex/adapter.js.map +1 -1
- package/dist/src/adapters/cursor/.cursor/context/docs-context.md +7 -8
- package/dist/src/adapters/cursor/.cursor/context/increments-context.md +1 -18
- package/dist/src/adapters/cursor/README.md +1 -30
- package/dist/src/adapters/gemini/README.md +2 -2
- package/dist/src/adapters/gemini/adapter.d.ts.map +1 -1
- package/dist/src/adapters/gemini/adapter.js +3 -8
- package/dist/src/adapters/gemini/adapter.js.map +1 -1
- package/dist/src/adapters/generic/README.md +4 -42
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts +0 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-incremental-mapper.js +0 -14
- package/dist/src/integrations/jira/jira-incremental-mapper.js.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts +0 -1
- package/dist/src/integrations/jira/jira-mapper.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-mapper.js +1 -15
- package/dist/src/integrations/jira/jira-mapper.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/commands/auto-parallel.md +190 -0
- package/plugins/specweave/commands/auto.md +61 -683
- package/plugins/specweave/commands/translate.md +3 -4
- package/plugins/specweave/hooks/lib/resolve-package.sh +21 -1
- package/plugins/specweave/lib/external-sync/README.md +118 -0
- package/plugins/specweave/lib/external-sync/duplicate-detector-base.js +118 -0
- package/plugins/specweave/lib/external-sync/duplicate-detector-base.ts +205 -0
- package/plugins/specweave/lib/external-sync/hooks-common.sh +266 -0
- package/plugins/specweave/lib/external-sync/permission-gate.js +64 -0
- package/plugins/specweave/lib/external-sync/permission-gate.ts +109 -0
- package/plugins/specweave/lib/hooks/prepare-reflection-context.js +6 -6
- package/plugins/specweave/lib/hooks/prepare-reflection-context.ts +6 -6
- package/plugins/specweave/skills/architect/SKILL.md +0 -10
- package/plugins/specweave/skills/archive-increments/SKILL.md +1 -0
- package/plugins/specweave/skills/code-reviewer/SKILL.md +291 -187
- package/plugins/specweave/skills/code-simplifier/SKILL.md +150 -91
- package/plugins/specweave/skills/context-loader/SKILL.md +1 -0
- package/plugins/specweave/skills/detector/SKILL.md +1 -0
- package/plugins/specweave/skills/docs-updater/SKILL.md +1 -0
- package/plugins/specweave/skills/docs-writer/SKILL.md +0 -10
- package/plugins/specweave/skills/framework/SKILL.md +1 -0
- package/plugins/specweave/skills/increment-work-router/SKILL.md +1 -0
- package/plugins/specweave/skills/infrastructure/SKILL.md +0 -10
- package/plugins/specweave/skills/living-docs-navigator/SKILL.md +1 -0
- package/plugins/specweave/skills/lsp/SKILL.md +1 -0
- package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +1 -0
- package/plugins/specweave/skills/performance/SKILL.md +0 -10
- package/plugins/specweave/skills/progress-sync/SKILL.md +1 -0
- package/plugins/specweave/skills/qa-lead/SKILL.md +0 -10
- package/plugins/specweave/skills/reflect-check/SKILL.md +1 -0
- package/plugins/specweave/skills/security/SKILL.md +0 -10
- package/plugins/specweave/skills/security-patterns/SKILL.md +1 -0
- package/plugins/specweave/skills/self-validating-example/SKILL.md +1 -0
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +1 -0
- package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +1 -10
- package/plugins/specweave/skills/tech-lead/SKILL.md +0 -10
- package/plugins/specweave/skills/test-aware-planner/SKILL.md +0 -10
- package/plugins/specweave/skills/translator/SKILL.md +1 -0
- package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +1 -0
- package/plugins/specweave/skills/update-instructions/SKILL.md +1 -0
- package/plugins/specweave-ado/skills/ado-mapper/SKILL.md +1 -3
- package/plugins/specweave-infrastructure/skills/devops/SKILL.md +0 -2
- package/plugins/specweave-infrastructure/skills/observability/SKILL.md +0 -2
- package/plugins/specweave-jira/skills/jira-mapper/SKILL.md +2 -15
- package/plugins/specweave/commands/check-tests.md +0 -546
- package/plugins/specweave/commands/restore-feature.md +0 -91
- package/plugins/specweave/commands/skill-match.md +0 -69
- package/plugins/specweave/commands/sync-diagnostics.md +0 -227
- package/plugins/specweave/commands/sync-logs.md +0 -136
- package/plugins/specweave/commands/sync-monitor.md +0 -62
- package/plugins/specweave/commands/update-status.md +0 -151
- package/plugins/specweave/commands/workflow.md +0 -483
- package/plugins/specweave/skills/context-optimizer/SKILL.md +0 -600
package/CLAUDE.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- SW:META template="claude" version="1.0.
|
|
1
|
+
<!-- SW:META template="claude" version="1.0.216" sections="header,start,autodetect,metarule,rules,workflow,reflect,context,structure,taskformat,secrets,syncing,testing,tdd,api,limits,troubleshooting,lazyloading,principles,linking,mcp,auto,docs" -->
|
|
2
2
|
|
|
3
3
|
<!-- SW:SECTION:hook-priority version="1.0.171" -->
|
|
4
4
|
## ⛔ Hook Instructions Override Everything
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
**SKILL FIRST ≠ only one skill.** Chain: hook skill → `sw-frontend:*` / `sw-backend:*` / etc → implement.
|
|
14
14
|
<!-- SW:END:hook-priority -->
|
|
15
15
|
|
|
16
|
-
<!-- SW:SECTION:header version="1.0.
|
|
16
|
+
<!-- SW:SECTION:header version="1.0.216" -->
|
|
17
17
|
**Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
|
|
18
18
|
<!-- SW:END:header -->
|
|
19
19
|
|
|
@@ -123,7 +123,7 @@ claude plugin install sw@specweave --scope project # Team-shared
|
|
|
123
123
|
|
|
124
124
|
SpecWeave auto-installs: LSP → project scope, sw-* → user scope.
|
|
125
125
|
|
|
126
|
-
<!-- SW:SECTION:start version="1.0.
|
|
126
|
+
<!-- SW:SECTION:start version="1.0.216" -->
|
|
127
127
|
## Getting Started
|
|
128
128
|
|
|
129
129
|
**Initial increment**: `0001-project-setup` (auto-created by `specweave init`)
|
|
@@ -133,7 +133,7 @@ SpecWeave auto-installs: LSP → project scope, sw-* → user scope.
|
|
|
133
133
|
2. **Customize**: Edit spec.md and use for setup tasks
|
|
134
134
|
<!-- SW:END:start -->
|
|
135
135
|
|
|
136
|
-
<!-- SW:SECTION:autodetect version="1.0.
|
|
136
|
+
<!-- SW:SECTION:autodetect version="1.0.216" -->
|
|
137
137
|
## Auto-Detection
|
|
138
138
|
|
|
139
139
|
SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
@@ -143,7 +143,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
143
143
|
**Opt-out phrases**: "Just brainstorm first" | "Don't plan yet" | "Quick discussion" | "Let's explore ideas"
|
|
144
144
|
<!-- SW:END:autodetect -->
|
|
145
145
|
|
|
146
|
-
<!-- SW:SECTION:metarule version="1.0.
|
|
146
|
+
<!-- SW:SECTION:metarule version="1.0.216" -->
|
|
147
147
|
## Workflow Orchestration
|
|
148
148
|
|
|
149
149
|
### 1. Plan Mode Default
|
|
@@ -170,7 +170,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
170
170
|
```
|
|
171
171
|
<!-- SW:END:metarule -->
|
|
172
172
|
|
|
173
|
-
<!-- SW:SECTION:rules version="1.0.
|
|
173
|
+
<!-- SW:SECTION:rules version="1.0.216" -->
|
|
174
174
|
## Rules
|
|
175
175
|
|
|
176
176
|
1. **Files** → `.specweave/increments/####-name/` (see Structure section for details)
|
|
@@ -189,7 +189,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
|
|
|
189
189
|
Use next available number. **NEVER create duplicate prefixes.**
|
|
190
190
|
<!-- SW:END:rules -->
|
|
191
191
|
|
|
192
|
-
<!-- SW:SECTION:workflow version="1.0.
|
|
192
|
+
<!-- SW:SECTION:workflow version="1.0.216" -->
|
|
193
193
|
## Workflow
|
|
194
194
|
|
|
195
195
|
`/sw:increment "X"` → `/sw:do` → `/sw:progress` → `/sw:done 0001`
|
|
@@ -235,7 +235,7 @@ project/
|
|
|
235
235
|
**NEVER assume single-repo mode without scanning first!**
|
|
236
236
|
<!-- SW:END:save-nested-repos -->
|
|
237
237
|
|
|
238
|
-
<!-- SW:SECTION:reflect version="1.0.
|
|
238
|
+
<!-- SW:SECTION:reflect version="1.0.216" -->
|
|
239
239
|
## Skill Memories
|
|
240
240
|
|
|
241
241
|
SpecWeave learns from corrections. Learnings saved here automatically. Edit or delete as needed.
|
|
@@ -254,7 +254,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
254
254
|
- **2026-02-02**: Use subagents liberally for codebase analysis - up to 10+ concurrent for large-scale exploration
|
|
255
255
|
- **2026-02-02**: Prefer leaderboard-style reporting when analyzing usage patterns or identifying deletion candidates
|
|
256
256
|
|
|
257
|
-
<!-- SW:SECTION:context version="1.0.
|
|
257
|
+
<!-- SW:SECTION:context version="1.0.216" -->
|
|
258
258
|
## Context
|
|
259
259
|
|
|
260
260
|
**Before implementing**: Check ADRs at `.specweave/docs/internal/architecture/adr/`
|
|
@@ -262,7 +262,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
262
262
|
**Load context**: `/sw:context <topic>` loads relevant living docs into conversation
|
|
263
263
|
<!-- SW:END:context -->
|
|
264
264
|
|
|
265
|
-
<!-- SW:SECTION:structure version="1.0.
|
|
265
|
+
<!-- SW:SECTION:structure version="1.0.216" -->
|
|
266
266
|
## Structure
|
|
267
267
|
|
|
268
268
|
```
|
|
@@ -277,7 +277,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
277
277
|
**Everything else → subfolders**: `reports/` | `logs/` | `scripts/` | `backups/`
|
|
278
278
|
<!-- SW:END:structure -->
|
|
279
279
|
|
|
280
|
-
<!-- SW:SECTION:taskformat version="1.0.
|
|
280
|
+
<!-- SW:SECTION:taskformat version="1.0.216" -->
|
|
281
281
|
## Task Format
|
|
282
282
|
|
|
283
283
|
```markdown
|
|
@@ -287,7 +287,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
|
|
|
287
287
|
```
|
|
288
288
|
<!-- SW:END:taskformat -->
|
|
289
289
|
|
|
290
|
-
<!-- SW:SECTION:secrets version="1.0.
|
|
290
|
+
<!-- SW:SECTION:secrets version="1.0.216" -->
|
|
291
291
|
## Secrets Check
|
|
292
292
|
|
|
293
293
|
**BEFORE CLI tools**: Check existing config first!
|
|
@@ -301,7 +301,7 @@ gh auth status
|
|
|
301
301
|
**SECURITY**: NEVER use `grep TOKEN .env` without `-q` flag - it exposes credentials in terminal!
|
|
302
302
|
<!-- SW:END:secrets -->
|
|
303
303
|
|
|
304
|
-
<!-- SW:SECTION:syncing version="1.0.
|
|
304
|
+
<!-- SW:SECTION:syncing version="1.0.216" -->
|
|
305
305
|
## External Sync (GitHub/JIRA/ADO)
|
|
306
306
|
|
|
307
307
|
**Commands**: `/sw-github:sync {id}` (issues) | `/sw:sync-specs` (living docs only)
|
|
@@ -311,7 +311,7 @@ gh auth status
|
|
|
311
311
|
**Config**: Set `sync.github.enabled: true` + `canUpdateExternalItems: true` in config.json
|
|
312
312
|
<!-- SW:END:syncing -->
|
|
313
313
|
|
|
314
|
-
<!-- SW:SECTION:testing version="1.0.
|
|
314
|
+
<!-- SW:SECTION:testing version="1.0.216" -->
|
|
315
315
|
## Testing
|
|
316
316
|
|
|
317
317
|
BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
|
|
@@ -323,7 +323,7 @@ vi.mock('./module', () => ({ func: mockFn }));
|
|
|
323
323
|
```
|
|
324
324
|
<!-- SW:END:testing -->
|
|
325
325
|
|
|
326
|
-
<!-- SW:SECTION:tdd version="1.0.
|
|
326
|
+
<!-- SW:SECTION:tdd version="1.0.216" -->
|
|
327
327
|
## TDD Mode (Test-Driven Development)
|
|
328
328
|
|
|
329
329
|
**When `testing.defaultTestMode: "TDD"` is configured**, follow RED-GREEN-REFACTOR discipline:
|
|
@@ -384,7 +384,7 @@ When TDD is enabled, tasks include phase markers:
|
|
|
384
384
|
**Rule**: Complete dependencies BEFORE dependent tasks (RED before GREEN).
|
|
385
385
|
<!-- SW:END:tdd -->
|
|
386
386
|
|
|
387
|
-
<!-- SW:SECTION:api version="1.0.
|
|
387
|
+
<!-- SW:SECTION:api version="1.0.216" -->
|
|
388
388
|
## API Development (OpenAPI-First)
|
|
389
389
|
|
|
390
390
|
**For API projects only.** Commands: `/sw:api-docs --all` | `--openapi` | `--postman` | `--validate`
|
|
@@ -392,13 +392,13 @@ When TDD is enabled, tasks include phase markers:
|
|
|
392
392
|
Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
|
|
393
393
|
<!-- SW:END:api -->
|
|
394
394
|
|
|
395
|
-
<!-- SW:SECTION:limits version="1.0.
|
|
395
|
+
<!-- SW:SECTION:limits version="1.0.216" -->
|
|
396
396
|
## Limits
|
|
397
397
|
|
|
398
398
|
**Max 1500 lines/file** — extract before adding
|
|
399
399
|
<!-- SW:END:limits -->
|
|
400
400
|
|
|
401
|
-
<!-- SW:SECTION:troubleshooting version="1.0.
|
|
401
|
+
<!-- SW:SECTION:troubleshooting version="1.0.216" -->
|
|
402
402
|
## Troubleshooting
|
|
403
403
|
|
|
404
404
|
| Issue | Fix |
|
|
@@ -411,7 +411,7 @@ Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
|
|
|
411
411
|
| Session stuck | Kill + `rm -f .specweave/state/*.lock` + restart |
|
|
412
412
|
<!-- SW:END:troubleshooting -->
|
|
413
413
|
|
|
414
|
-
<!-- SW:SECTION:lazyloading version="1.0.
|
|
414
|
+
<!-- SW:SECTION:lazyloading version="1.0.216" -->
|
|
415
415
|
## Plugin Auto-Loading
|
|
416
416
|
|
|
417
417
|
Plugins load automatically based on project type and keywords. Manual install if needed:
|
|
@@ -425,7 +425,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-load
|
|
|
425
425
|
**Token savings**: Core ~3-5K tokens vs all plugins ~60K+
|
|
426
426
|
<!-- SW:END:lazyloading -->
|
|
427
427
|
|
|
428
|
-
<!-- SW:SECTION:principles version="1.0.
|
|
428
|
+
<!-- SW:SECTION:principles version="1.0.216" -->
|
|
429
429
|
## Principles
|
|
430
430
|
|
|
431
431
|
### SpecWeave Principles
|
|
@@ -441,7 +441,7 @@ export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-load
|
|
|
441
441
|
- **Demand Elegance**: For non-trivial changes, pause and ask "is there a more elegant way?" - but skip this for simple, obvious fixes (don't over-engineer).
|
|
442
442
|
<!-- SW:END:principles -->
|
|
443
443
|
|
|
444
|
-
<!-- SW:SECTION:linking version="1.0.
|
|
444
|
+
<!-- SW:SECTION:linking version="1.0.216" -->
|
|
445
445
|
## Bidirectional Linking
|
|
446
446
|
|
|
447
447
|
Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
@@ -449,7 +449,7 @@ Tasks ↔ User Stories auto-linked via AC-IDs: `AC-US1-01` → `US-001`
|
|
|
449
449
|
Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
|
|
450
450
|
<!-- SW:END:linking -->
|
|
451
451
|
|
|
452
|
-
<!-- SW:SECTION:mcp version="1.0.
|
|
452
|
+
<!-- SW:SECTION:mcp version="1.0.216" -->
|
|
453
453
|
## External Services
|
|
454
454
|
|
|
455
455
|
**Priority**: CLI tools first (simpler) → MCP for complex integrations
|
|
@@ -471,7 +471,7 @@ claude mcp add --transport stdio postgres -- npx -y @modelcontextprotocol/server
|
|
|
471
471
|
MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
|
|
472
472
|
<!-- SW:END:mcp -->
|
|
473
473
|
|
|
474
|
-
<!-- SW:SECTION:auto version="1.0.
|
|
474
|
+
<!-- SW:SECTION:auto version="1.0.216" -->
|
|
475
475
|
## Auto Mode
|
|
476
476
|
|
|
477
477
|
**Commands**: `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency only)
|
|
@@ -488,7 +488,7 @@ MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
|
|
|
488
488
|
**STOP & ASK** if: Spec conflicts | Task unnecessary | Requirement ambiguous
|
|
489
489
|
<!-- SW:END:auto -->
|
|
490
490
|
|
|
491
|
-
<!-- SW:SECTION:docs version="1.0.
|
|
491
|
+
<!-- SW:SECTION:docs version="1.0.216" -->
|
|
492
492
|
## Docs
|
|
493
493
|
|
|
494
494
|
[spec-weave.com](https://spec-weave.com)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for duplicate detection across external PM tools.
|
|
3
|
+
* Implements 3-phase protection identical across GitHub, JIRA, and ADO.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* class GitHubDuplicateDetector extends DuplicateDetectorBase<GitHubIssue> {
|
|
7
|
+
* async searchExisting(query: SearchQuery): Promise<GitHubIssue[]> { ... }
|
|
8
|
+
* async closeItem(itemId: string, reason: string): Promise<void> { ... }
|
|
9
|
+
* getItemId(item: GitHubIssue): string { ... }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
export interface SearchQuery {
|
|
13
|
+
incrementId: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
project?: string;
|
|
16
|
+
board?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface VerificationResult<T> {
|
|
19
|
+
success: boolean;
|
|
20
|
+
expectedCount: number;
|
|
21
|
+
actualCount: number;
|
|
22
|
+
duplicates: T[];
|
|
23
|
+
message: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DetectionResult<T> {
|
|
26
|
+
hasDuplicates: boolean;
|
|
27
|
+
existing: T[];
|
|
28
|
+
message: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Abstract base class for duplicate detection.
|
|
32
|
+
* Subclass per external tool (GitHub, JIRA, ADO).
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class DuplicateDetectorBase<T> {
|
|
35
|
+
protected toolName: string;
|
|
36
|
+
constructor(toolName: string);
|
|
37
|
+
/**
|
|
38
|
+
* Search for existing items that might be duplicates.
|
|
39
|
+
* Implementation is tool-specific (different APIs).
|
|
40
|
+
*/
|
|
41
|
+
protected abstract searchExisting(query: SearchQuery): Promise<T[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Close/archive a duplicate item.
|
|
44
|
+
* Implementation is tool-specific (different APIs).
|
|
45
|
+
*/
|
|
46
|
+
protected abstract closeItem(itemId: string, reason: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Get the unique ID of an item.
|
|
49
|
+
*/
|
|
50
|
+
protected abstract getItemId(item: T): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get the title/summary of an item for display.
|
|
53
|
+
*/
|
|
54
|
+
protected abstract getItemTitle(item: T): string;
|
|
55
|
+
/**
|
|
56
|
+
* Check for existing items before creating a new one.
|
|
57
|
+
* Returns existing items if found, preventing duplicate creation.
|
|
58
|
+
*/
|
|
59
|
+
detectBeforeCreate(query: SearchQuery): Promise<DetectionResult<T>>;
|
|
60
|
+
/**
|
|
61
|
+
* Verify that creation didn't accidentally create duplicates.
|
|
62
|
+
* Called after a create operation to ensure only expected items exist.
|
|
63
|
+
*/
|
|
64
|
+
verifyAfterCreate(query: SearchQuery, expectedCount: number): Promise<VerificationResult<T>>;
|
|
65
|
+
/**
|
|
66
|
+
* Automatically close duplicate items.
|
|
67
|
+
* Called when duplicates are detected to clean them up.
|
|
68
|
+
*/
|
|
69
|
+
closeDuplicates(duplicates: T[]): Promise<void>;
|
|
70
|
+
private formatDetectionMessage;
|
|
71
|
+
private formatVerificationMessage;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=duplicate-detector-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-detector-base.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/external-sync/duplicate-detector-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,CAAC,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,8BAAsB,qBAAqB,CAAC,CAAC;IAC3C,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEf,QAAQ,EAAE,MAAM;IAI5B;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAEnE;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3E;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM;IAE7C;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,MAAM;IAMhD;;;OAGG;IACG,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAsBzE;;;OAGG;IACG,iBAAiB,CACrB,KAAK,EAAE,WAAW,EAClB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAuCjC;;;OAGG;IACG,eAAe,CAAC,UAAU,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBrD,OAAO,CAAC,sBAAsB;IAiB9B,OAAO,CAAC,yBAAyB;CAoBlC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for duplicate detection across external PM tools.
|
|
3
|
+
* Implements 3-phase protection identical across GitHub, JIRA, and ADO.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* class GitHubDuplicateDetector extends DuplicateDetectorBase<GitHubIssue> {
|
|
7
|
+
* async searchExisting(query: SearchQuery): Promise<GitHubIssue[]> { ... }
|
|
8
|
+
* async closeItem(itemId: string, reason: string): Promise<void> { ... }
|
|
9
|
+
* getItemId(item: GitHubIssue): string { ... }
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Abstract base class for duplicate detection.
|
|
14
|
+
* Subclass per external tool (GitHub, JIRA, ADO).
|
|
15
|
+
*/
|
|
16
|
+
export class DuplicateDetectorBase {
|
|
17
|
+
constructor(toolName) {
|
|
18
|
+
this.toolName = toolName;
|
|
19
|
+
}
|
|
20
|
+
// =========================================================================
|
|
21
|
+
// PHASE 1: Detection (Before Create)
|
|
22
|
+
// =========================================================================
|
|
23
|
+
/**
|
|
24
|
+
* Check for existing items before creating a new one.
|
|
25
|
+
* Returns existing items if found, preventing duplicate creation.
|
|
26
|
+
*/
|
|
27
|
+
async detectBeforeCreate(query) {
|
|
28
|
+
const existing = await this.searchExisting(query);
|
|
29
|
+
if (existing.length > 0) {
|
|
30
|
+
return {
|
|
31
|
+
hasDuplicates: true,
|
|
32
|
+
existing,
|
|
33
|
+
message: this.formatDetectionMessage(existing, query)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
hasDuplicates: false,
|
|
38
|
+
existing: [],
|
|
39
|
+
message: `No existing ${this.toolName} items found for increment ${query.incrementId}`
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// =========================================================================
|
|
43
|
+
// PHASE 2: Verification (After Create)
|
|
44
|
+
// =========================================================================
|
|
45
|
+
/**
|
|
46
|
+
* Verify that creation didn't accidentally create duplicates.
|
|
47
|
+
* Called after a create operation to ensure only expected items exist.
|
|
48
|
+
*/
|
|
49
|
+
async verifyAfterCreate(query, expectedCount) {
|
|
50
|
+
const existing = await this.searchExisting(query);
|
|
51
|
+
const actualCount = existing.length;
|
|
52
|
+
if (actualCount === expectedCount) {
|
|
53
|
+
return {
|
|
54
|
+
success: true,
|
|
55
|
+
expectedCount,
|
|
56
|
+
actualCount,
|
|
57
|
+
duplicates: [],
|
|
58
|
+
message: `Verification passed: ${actualCount} items as expected`
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (actualCount > expectedCount) {
|
|
62
|
+
const duplicates = existing.slice(expectedCount);
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
expectedCount,
|
|
66
|
+
actualCount,
|
|
67
|
+
duplicates,
|
|
68
|
+
message: this.formatVerificationMessage(expectedCount, actualCount, duplicates)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
// Fewer items than expected (unlikely but possible)
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
expectedCount,
|
|
75
|
+
actualCount,
|
|
76
|
+
duplicates: [],
|
|
77
|
+
message: `Warning: Expected ${expectedCount} items but found ${actualCount}`
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
// =========================================================================
|
|
81
|
+
// PHASE 3: Auto-Correction (Close Duplicates)
|
|
82
|
+
// =========================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Automatically close duplicate items.
|
|
85
|
+
* Called when duplicates are detected to clean them up.
|
|
86
|
+
*/
|
|
87
|
+
async closeDuplicates(duplicates) {
|
|
88
|
+
for (const duplicate of duplicates) {
|
|
89
|
+
const itemId = this.getItemId(duplicate);
|
|
90
|
+
const title = this.getItemTitle(duplicate);
|
|
91
|
+
try {
|
|
92
|
+
await this.closeItem(itemId, `Closed as duplicate by SpecWeave auto-correction`);
|
|
93
|
+
console.log(`✅ Closed duplicate ${this.toolName} item #${itemId}: ${title}`);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
console.error(`❌ Failed to close duplicate #${itemId}: ${error}`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// =========================================================================
|
|
101
|
+
// Message Formatting (Consistent across tools)
|
|
102
|
+
// =========================================================================
|
|
103
|
+
formatDetectionMessage(existing, query) {
|
|
104
|
+
const itemList = existing
|
|
105
|
+
.map(item => ` - #${this.getItemId(item)}: ${this.getItemTitle(item)}`)
|
|
106
|
+
.join('\n');
|
|
107
|
+
return `
|
|
108
|
+
⚠️ Existing ${this.toolName} items found for increment ${query.incrementId}:
|
|
109
|
+
|
|
110
|
+
${itemList}
|
|
111
|
+
|
|
112
|
+
Options:
|
|
113
|
+
1. Link to existing: Use --link-existing to connect without creating new items
|
|
114
|
+
2. Force create: Use --force to create anyway (not recommended)
|
|
115
|
+
3. Skip: Cancel this operation
|
|
116
|
+
`.trim();
|
|
117
|
+
}
|
|
118
|
+
formatVerificationMessage(expected, actual, duplicates) {
|
|
119
|
+
const itemList = duplicates
|
|
120
|
+
.map(item => ` - #${this.getItemId(item)}: ${this.getItemTitle(item)}`)
|
|
121
|
+
.join('\n');
|
|
122
|
+
return `
|
|
123
|
+
⚠️ Duplicate ${this.toolName} items detected!
|
|
124
|
+
|
|
125
|
+
Expected: ${expected} items
|
|
126
|
+
Found: ${actual} items
|
|
127
|
+
Duplicates:
|
|
128
|
+
${itemList}
|
|
129
|
+
|
|
130
|
+
Auto-correction: These duplicates will be closed automatically.
|
|
131
|
+
`.trim();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=duplicate-detector-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-detector-base.js","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/external-sync/duplicate-detector-base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuBH;;;GAGG;AACH,MAAM,OAAgB,qBAAqB;IAGzC,YAAY,QAAgB;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAwBD,4EAA4E;IAC5E,qCAAqC;IACrC,4EAA4E;IAE5E;;;OAGG;IACH,KAAK,CAAC,kBAAkB,CAAC,KAAkB;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO;gBACL,aAAa,EAAE,IAAI;gBACnB,QAAQ;gBACR,OAAO,EAAE,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,KAAK,CAAC;aACtD,CAAC;QACJ,CAAC;QAED,OAAO;YACL,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,EAAE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gate for external sync operations (GitHub, JIRA, ADO)
|
|
3
|
+
* Extracts the identical permission checking pattern from all sync plugins.
|
|
4
|
+
*/
|
|
5
|
+
export interface SyncPermissionResult {
|
|
6
|
+
canRead: boolean;
|
|
7
|
+
canWrite: boolean;
|
|
8
|
+
message: string;
|
|
9
|
+
configPath: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SyncConfig {
|
|
12
|
+
sync?: {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
settings?: {
|
|
15
|
+
canUpdateExternalItems?: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Check if external sync operations are permitted.
|
|
21
|
+
* Used by GitHub, JIRA, and ADO sync commands.
|
|
22
|
+
*
|
|
23
|
+
* @param projectRoot - Root directory of the project
|
|
24
|
+
* @param toolName - Display name of the tool (e.g., "GitHub", "JIRA", "Azure DevOps")
|
|
25
|
+
* @returns Permission result with read/write capabilities
|
|
26
|
+
*/
|
|
27
|
+
export declare function checkSyncPermissions(projectRoot: string, toolName: string): SyncPermissionResult;
|
|
28
|
+
/**
|
|
29
|
+
* Format a consistent permission denied message for all external tools.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatPermissionDeniedMessage(toolName: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Check if sync is enabled at all for this project.
|
|
34
|
+
*/
|
|
35
|
+
export declare function isSyncEnabled(projectRoot: string): boolean;
|
|
36
|
+
//# sourceMappingURL=permission-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-gate.d.ts","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/external-sync/permission-gate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE;QACL,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE;YACT,sBAAsB,CAAC,EAAE,OAAO,CAAC;SAClC,CAAC;KACH,CAAC;CACH;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,GACf,oBAAoB,CA4BtB;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAsBtE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAa1D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared permission gate for external sync operations (GitHub, JIRA, ADO)
|
|
3
|
+
* Extracts the identical permission checking pattern from all sync plugins.
|
|
4
|
+
*/
|
|
5
|
+
import { existsSync, readFileSync } from 'fs';
|
|
6
|
+
import { join } from 'path';
|
|
7
|
+
/**
|
|
8
|
+
* Check if external sync operations are permitted.
|
|
9
|
+
* Used by GitHub, JIRA, and ADO sync commands.
|
|
10
|
+
*
|
|
11
|
+
* @param projectRoot - Root directory of the project
|
|
12
|
+
* @param toolName - Display name of the tool (e.g., "GitHub", "JIRA", "Azure DevOps")
|
|
13
|
+
* @returns Permission result with read/write capabilities
|
|
14
|
+
*/
|
|
15
|
+
export function checkSyncPermissions(projectRoot, toolName) {
|
|
16
|
+
const configPath = join(projectRoot, '.specweave', 'config.json');
|
|
17
|
+
// Default: read-only
|
|
18
|
+
const result = {
|
|
19
|
+
canRead: true,
|
|
20
|
+
canWrite: false,
|
|
21
|
+
message: '',
|
|
22
|
+
configPath
|
|
23
|
+
};
|
|
24
|
+
if (!existsSync(configPath)) {
|
|
25
|
+
result.message = `Config not found at ${configPath}`;
|
|
26
|
+
return result;
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
30
|
+
result.canWrite = config?.sync?.settings?.canUpdateExternalItems ?? false;
|
|
31
|
+
if (!result.canWrite) {
|
|
32
|
+
result.message = formatPermissionDeniedMessage(toolName);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
result.message = `Failed to read config at ${configPath}`;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format a consistent permission denied message for all external tools.
|
|
42
|
+
*/
|
|
43
|
+
export function formatPermissionDeniedMessage(toolName) {
|
|
44
|
+
const toolLower = toolName.toLowerCase().replace(/\s+/g, '-');
|
|
45
|
+
return `
|
|
46
|
+
❌ Permission Denied: ${toolName} Write Operations Disabled
|
|
47
|
+
|
|
48
|
+
Cannot push changes to ${toolName} (sync.settings.canUpdateExternalItems = false).
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
1. Enable writes: Set canUpdateExternalItems to true in config.json
|
|
52
|
+
{
|
|
53
|
+
"sync": {
|
|
54
|
+
"settings": {
|
|
55
|
+
"canUpdateExternalItems": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
2. Pull-only mode: /sw-${toolLower}:sync \${incrementId} --direction from-${toolLower}
|
|
61
|
+
|
|
62
|
+
3. View status: /sw-${toolLower}:status \${incrementId}
|
|
63
|
+
`.trim();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check if sync is enabled at all for this project.
|
|
67
|
+
*/
|
|
68
|
+
export function isSyncEnabled(projectRoot) {
|
|
69
|
+
const configPath = join(projectRoot, '.specweave', 'config.json');
|
|
70
|
+
if (!existsSync(configPath)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
75
|
+
return config?.sync?.enabled !== false; // Default to enabled
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=permission-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-gate.js","sourceRoot":"","sources":["../../../../../plugins/specweave/lib/external-sync/permission-gate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAkB5B;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAmB,EACnB,QAAgB;IAEhB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;IAElE,qBAAqB;IACrB,MAAM,MAAM,GAAyB;QACnC,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,EAAE;QACX,UAAU;KACX,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,CAAC,OAAO,GAAG,uBAAuB,UAAU,EAAE,CAAC;QACrD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAe,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,QAAQ,GAAG,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,sBAAsB,IAAI,KAAK,CAAC;QAE1E,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,CAAC,OAAO,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,OAAO,GAAG,4BAA4B,UAAU,EAAE,CAAC;IAC5D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,6BAA6B,CAAC,QAAgB;IAC5D,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE9D,OAAO;uBACc,QAAQ;;yBAEN,QAAQ;;;;;;;;;;;;yBAYR,SAAS,0CAA0C,SAAS;;sBAE/D,SAAS;CAC9B,CAAC,IAAI,EAAE,CAAC;AACT,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,WAAmB;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;IAElE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,MAAM,MAAM,GAAe,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;QACzE,OAAO,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,KAAK,CAAC,CAAC,qBAAqB;IAC/D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -100,9 +100,8 @@ interface IAdapter {
|
|
|
100
100
|
1. Check if increment exists in `.specweave/increments/####-name/`
|
|
101
101
|
2. If not, create: spec.md, plan.md, tasks.md
|
|
102
102
|
|
|
103
|
-
## Context Loading
|
|
104
|
-
|
|
105
|
-
Only load files listed in manifest.
|
|
103
|
+
## Context Loading
|
|
104
|
+
Load spec.md, plan.md, tasks.md from the increment folder.
|
|
106
105
|
```
|
|
107
106
|
|
|
108
107
|
**Detection**: Checks for Cursor editor process or .cursor/ directory
|
|
@@ -134,7 +133,7 @@ mkdir -p .specweave/increments/0001-feature-name
|
|
|
134
133
|
[Detailed template and instructions]
|
|
135
134
|
|
|
136
135
|
## Step 3: Load Context
|
|
137
|
-
Copy
|
|
136
|
+
Copy spec.md, plan.md, and tasks.md from your increment folder.
|
|
138
137
|
```
|
|
139
138
|
|
|
140
139
|
**Detection**: Always returns `true` (universal fallback)
|
|
@@ -129,7 +129,6 @@ npm run install:agents
|
|
|
129
129
|
5. ✅ `increment-planner` invokes `architect` agent
|
|
130
130
|
6. ✅ `architect` agent creates `plan.md` (HOW)
|
|
131
131
|
7. ✅ `increment-planner` creates `tasks.md` (implementation steps)
|
|
132
|
-
8. ✅ `context-loader` creates `context-manifest.yaml` (70%+ token savings)
|
|
133
132
|
|
|
134
133
|
**Result**: Complete increment ready for implementation!
|
|
135
134
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/codex/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtE,qBAAa,YAAa,SAAQ,WAAW;IAC3C,IAAI,SAAW;IACf,WAAW,SAAoF;IAC/F,eAAe,EAAG,MAAM,CAAU;IAElC;;;;;;;OAOG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACH,QAAQ,IAAI,WAAW,EAAE;IAezB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrD;;OAEG;YACW,gBAAgB;IAgB9B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACH,eAAe,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../src/adapters/codex/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtE,qBAAa,YAAa,SAAQ,WAAW;IAC3C,IAAI,SAAW;IACf,WAAW,SAAoF;IAC/F,eAAe,EAAG,MAAM,CAAU;IAElC;;;;;;;OAOG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAQhC;;OAEG;IACH,QAAQ,IAAI,WAAW,EAAE;IAezB;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrD;;OAEG;YACW,gBAAgB;IAgB9B;;OAEG;IACG,WAAW,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACH,eAAe,IAAI,MAAM;CAsN1B"}
|
|
@@ -176,18 +176,17 @@ codex "Following the PM role in AGENTS.md, create requirements for payments"
|
|
|
176
176
|
2. Reference it: "Following AGENTS.md, create increment for..."
|
|
177
177
|
3. Download or copy-paste generated files
|
|
178
178
|
|
|
179
|
-
CONTEXT LOADING
|
|
179
|
+
CONTEXT LOADING:
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
Load spec.md, plan.md, and tasks.md from your increment folder.
|
|
182
182
|
|
|
183
183
|
\`\`\`bash
|
|
184
184
|
# CLI:
|
|
185
|
-
codex "Read
|
|
185
|
+
codex "Read spec.md, plan.md, tasks.md from increment 0001, then implement task T001"
|
|
186
186
|
|
|
187
187
|
# Web:
|
|
188
|
-
# 1. Upload
|
|
189
|
-
# 2.
|
|
190
|
-
# 3. Request task implementation
|
|
188
|
+
# 1. Upload spec.md, plan.md, tasks.md from increment folder
|
|
189
|
+
# 2. Request task implementation
|
|
191
190
|
\`\`\`
|
|
192
191
|
|
|
193
192
|
FEATURES:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../src/adapters/codex/adapter.ts"],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,CAAC;QACnC,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,OAAuB;QACxE,MAAM,SAAS,GAAG,IAAI,iBAAiB,CACrC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,EACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,EACpC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CACvC,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC;YACvC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAC;QAEH,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,OAAuB;QACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmNN,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -42,14 +42,13 @@ When `@docs` is used, Cursor should load:
|
|
|
42
42
|
**Don't load everything!**
|
|
43
43
|
|
|
44
44
|
If working on specific module (e.g., authentication):
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
```
|
|
45
|
+
Load ONLY auth-related docs:
|
|
46
|
+
```
|
|
47
|
+
.specweave/docs/internal/architecture/auth/
|
|
48
|
+
├── design.md
|
|
49
|
+
├── adr/0005-auth-method.md
|
|
50
|
+
└── diagrams/auth-flow.mmd
|
|
51
|
+
```
|
|
53
52
|
|
|
54
53
|
## Example Workflow
|
|
55
54
|
|