@codename_inc/spectre 3.7.0 → 5.0.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/README.md +6 -7
- package/package.json +3 -2
- package/plugins/spectre/.claude-plugin/plugin.json +1 -1
- package/plugins/spectre/bin/spectre-register +5 -0
- package/plugins/spectre/hooks/hooks.json +3 -14
- package/plugins/spectre/hooks/scripts/bootstrap.mjs +98 -0
- package/plugins/spectre/hooks/scripts/handoff-resume.mjs +404 -0
- package/plugins/spectre/hooks/scripts/lib.mjs +82 -0
- package/plugins/spectre/hooks/scripts/load-knowledge.mjs +189 -0
- package/plugins/spectre/hooks/scripts/register_learning.mjs +264 -0
- package/plugins/spectre/hooks/scripts/{test_bootstrap.cjs → test_bootstrap.mjs} +12 -7
- package/plugins/spectre/hooks/scripts/{test_handoff-resume.cjs → test_handoff-resume.mjs} +13 -11
- package/plugins/spectre/hooks/scripts/{test_load-knowledge.cjs → test_load-knowledge.mjs} +103 -22
- package/plugins/spectre/hooks/scripts/test_register-learning.mjs +335 -0
- package/plugins/spectre/skills/apply/SKILL.md +87 -0
- package/plugins/spectre/{commands/architecture_review.md → skills/architecture_review/SKILL.md} +9 -0
- package/plugins/spectre/{commands/clean.md → skills/clean/SKILL.md} +9 -0
- package/plugins/spectre/{commands/code_review.md → skills/code_review/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_plan.md → skills/create_plan/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_tasks.md → skills/create_tasks/SKILL.md} +9 -0
- package/plugins/spectre/{commands/create_test_guide.md → skills/create_test_guide/SKILL.md} +9 -0
- package/plugins/spectre/{commands/evaluate.md → skills/evaluate/SKILL.md} +11 -2
- package/plugins/spectre/{commands/execute.md → skills/execute/SKILL.md} +12 -3
- package/plugins/spectre/{commands/fix.md → skills/fix/SKILL.md} +9 -0
- package/plugins/spectre/{commands/forget.md → skills/forget/SKILL.md} +9 -0
- package/plugins/spectre/skills/{spectre-guide → guide}/SKILL.md +6 -5
- package/plugins/spectre/{commands/handoff.md → skills/handoff/SKILL.md} +9 -0
- package/plugins/spectre/{commands/kickoff.md → skills/kickoff/SKILL.md} +9 -0
- package/plugins/spectre/skills/{spectre-learn → learn}/SKILL.md +19 -59
- package/plugins/spectre/skills/learn/references/recall-template.md +34 -0
- package/plugins/spectre/{commands/plan.md → skills/plan/SKILL.md} +66 -25
- package/plugins/spectre/{commands/plan_review.md → skills/plan_review/SKILL.md} +9 -0
- package/plugins/spectre/skills/prototype/SKILL.md +314 -0
- package/plugins/spectre/{commands/quick_dev.md → skills/quick_dev/SKILL.md} +9 -0
- package/plugins/spectre/{commands/rebase.md → skills/rebase/SKILL.md} +9 -0
- package/plugins/spectre/skills/recall/SKILL.md +17 -0
- package/plugins/spectre/{commands/research.md → skills/research/SKILL.md} +9 -0
- package/plugins/spectre/skills/scope/SKILL.md +174 -0
- package/plugins/spectre/{commands/ship.md → skills/ship/SKILL.md} +9 -0
- package/plugins/spectre/{commands/sweep.md → skills/sweep/SKILL.md} +9 -0
- package/plugins/spectre/skills/tdd/SKILL.md +111 -0
- package/plugins/spectre/{commands/test.md → skills/test/SKILL.md} +9 -0
- package/plugins/spectre/skills/ux/SKILL.md +121 -0
- package/plugins/spectre/{commands/validate.md → skills/validate/SKILL.md} +9 -0
- package/plugins/spectre-codex/agents/analyst.toml +117 -0
- package/plugins/spectre-codex/agents/dev.toml +65 -0
- package/plugins/spectre-codex/agents/finder.toml +101 -0
- package/plugins/spectre-codex/agents/patterns.toml +203 -0
- package/plugins/spectre-codex/agents/reviewer.toml +123 -0
- package/plugins/spectre-codex/agents/sync.toml +146 -0
- package/plugins/spectre-codex/agents/tester.toml +205 -0
- package/plugins/spectre-codex/agents/web-research.toml +104 -0
- package/plugins/spectre-codex/hooks/hooks.json +23 -0
- package/plugins/{spectre/hooks/scripts/bootstrap.cjs → spectre-codex/hooks/scripts/bootstrap.mjs} +15 -16
- package/plugins/{spectre/hooks/scripts/handoff-resume.cjs → spectre-codex/hooks/scripts/handoff-resume.mjs} +21 -27
- package/plugins/{spectre/hooks/scripts/lib.cjs → spectre-codex/hooks/scripts/lib.mjs} +3 -4
- package/plugins/spectre-codex/hooks/scripts/load-knowledge.mjs +189 -0
- package/plugins/spectre-codex/hooks/scripts/register_learning.mjs +264 -0
- package/plugins/spectre-codex/skills/apply/SKILL.md +87 -0
- package/plugins/spectre-codex/skills/architecture_review/SKILL.md +129 -0
- package/plugins/spectre-codex/skills/clean/SKILL.md +322 -0
- package/plugins/spectre-codex/skills/code_review/SKILL.md +417 -0
- package/plugins/spectre-codex/skills/create_plan/SKILL.md +126 -0
- package/plugins/spectre-codex/skills/create_tasks/SKILL.md +383 -0
- package/plugins/spectre-codex/skills/create_test_guide/SKILL.md +129 -0
- package/plugins/spectre-codex/skills/evaluate/SKILL.md +59 -0
- package/plugins/spectre-codex/skills/execute/SKILL.md +96 -0
- package/plugins/spectre-codex/skills/fix/SKILL.md +70 -0
- package/plugins/spectre-codex/skills/forget/SKILL.md +67 -0
- package/plugins/spectre-codex/skills/guide/SKILL.md +359 -0
- package/plugins/spectre-codex/skills/handoff/SKILL.md +170 -0
- package/plugins/spectre-codex/skills/kickoff/SKILL.md +124 -0
- package/plugins/spectre-codex/skills/learn/SKILL.md +595 -0
- package/plugins/{spectre/skills/spectre-learn → spectre-codex/skills/learn}/references/recall-template.md +4 -1
- package/plugins/spectre-codex/skills/plan/SKILL.md +211 -0
- package/plugins/spectre-codex/skills/plan_review/SKILL.md +42 -0
- package/plugins/spectre-codex/skills/prototype/SKILL.md +314 -0
- package/plugins/spectre-codex/skills/quick_dev/SKILL.md +110 -0
- package/plugins/spectre-codex/skills/rebase/SKILL.md +82 -0
- package/plugins/spectre-codex/skills/recall/SKILL.md +17 -0
- package/plugins/spectre-codex/skills/research/SKILL.md +168 -0
- package/plugins/spectre-codex/skills/scope/SKILL.md +174 -0
- package/plugins/spectre-codex/skills/ship/SKILL.md +181 -0
- package/plugins/spectre-codex/skills/sweep/SKILL.md +91 -0
- package/plugins/{spectre/skills/spectre-tdd → spectre-codex/skills/tdd}/SKILL.md +1 -1
- package/plugins/spectre-codex/skills/test/SKILL.md +389 -0
- package/plugins/spectre-codex/skills/ux/SKILL.md +121 -0
- package/plugins/spectre-codex/skills/validate/SKILL.md +352 -0
- package/src/config.test.js +6 -5
- package/src/install.test.js +100 -11
- package/src/lib/config.js +107 -54
- package/src/lib/constants.js +17 -23
- package/src/lib/doctor.js +19 -22
- package/src/lib/install.js +98 -313
- package/src/lib/knowledge.js +7 -37
- package/src/lib/paths.js +0 -12
- package/src/pack.test.js +87 -0
- package/plugins/spectre/commands/learn.md +0 -15
- package/plugins/spectre/commands/recall.md +0 -5
- package/plugins/spectre/commands/scope.md +0 -119
- package/plugins/spectre/commands/ux_spec.md +0 -91
- package/plugins/spectre/hooks/scripts/load-knowledge.cjs +0 -120
- package/plugins/spectre/hooks/scripts/precompact-warning.cjs +0 -19
- package/plugins/spectre/hooks/scripts/register_learning.cjs +0 -144
- package/plugins/spectre/hooks/scripts/test_register-learning.cjs +0 -146
- package/plugins/spectre/skills/spectre-apply/SKILL.md +0 -189
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: "Load this skill when executing TDD (Test-Driven Development) methodology. Use when implementing features via strict RED-GREEN-REFACTOR cycles, or when a prompt instructs execution via TDD."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD: Test-Driven Development Methodology
|
|
7
|
+
|
|
8
|
+
Execute tasks using strict TDD (RED → GREEN → REFACTOR). Outcome: Tasks completed with Happy/Failure tests passing, minimal code shipped.
|
|
9
|
+
|
|
10
|
+
## Iron Law
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Wrote code before the test? **Delete it. Start over.** Don't keep it as "reference." Don't "adapt" it. Delete means delete. Implement fresh from tests.
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
|
|
20
|
+
- **2 tests per Test Opportunity (TO)**: 1 Happy path, 1 Failure path — then stop
|
|
21
|
+
- **Scoped execution**: Never run repo-wide tests; use `--testPathPattern`, `--findRelatedTests`, or per-file lint
|
|
22
|
+
- **YAGNI**: No abstractions unless test forces it or ≥2 call sites exist
|
|
23
|
+
- **Anti-flake**: Use fake timers, stubs, seeded RNG
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Step 1 - Generate TDD TODO List
|
|
28
|
+
|
|
29
|
+
- **Action** — ParseTaskList: Extract tasks from ARGUMENTS or thread context
|
|
30
|
+
- **If** no clear tasks → stop and ask for guidance
|
|
31
|
+
- **Action** — IdentifyTestOpportunities: Derive TOs (smallest behavior unit: function, route, bug fix, acceptance criterion)
|
|
32
|
+
- **Action** — TransformToTDD: Convert each TO to cycle using TodoWrite:
|
|
33
|
+
- `RED: Happy — {test}` → `RED: Failure — {test}` → `GREEN: Minimal impl` → `REFACTOR: Tidy` → `COMMIT`
|
|
34
|
+
- **Action** — VerifyScope: Confirm TODO contains ONLY assigned tasks
|
|
35
|
+
|
|
36
|
+
## Step 2 - RED Phase: Write Failing Tests
|
|
37
|
+
|
|
38
|
+
- **Action** — WriteHappyTest: Write first failing test (happy path)
|
|
39
|
+
- Execute only this test/file, not entire suite
|
|
40
|
+
- **Action** — WriteFailureTest: Write second failing test (primary failure mode)
|
|
41
|
+
- **Action** — VerifyRed: **MANDATORY** — Confirm each test:
|
|
42
|
+
- Fails (not errors)
|
|
43
|
+
- Fails for expected reason (feature missing, not typo)
|
|
44
|
+
- **If** passes → you're testing existing behavior; fix test
|
|
45
|
+
|
|
46
|
+
## Step 3 - GREEN Phase: Minimal Implementation
|
|
47
|
+
|
|
48
|
+
- **Action** — ImplementMinimal: Write least code to pass tests
|
|
49
|
+
- No extra branches, params, or dependencies unless test forces them
|
|
50
|
+
- **Action** — VerifyGreen: **MANDATORY** — Run tests (narrowest scope)
|
|
51
|
+
- **If** fail → fix code, not test
|
|
52
|
+
- Remove any speculative code not forced by tests
|
|
53
|
+
|
|
54
|
+
## Step 4 - REFACTOR Phase: Clean Code
|
|
55
|
+
|
|
56
|
+
- **Action** — RefactorSafely: Improve only if duplication ≥3 OR readability materially improves
|
|
57
|
+
- Keep tests green; **If** tests fail → revert
|
|
58
|
+
- **Action** — HandleLintFailures: Apply in order until clear:
|
|
59
|
+
1. Guard clauses, split compound expressions
|
|
60
|
+
2. Extract tiny private helpers (same file)
|
|
61
|
+
3. Hoist literals to file constants
|
|
62
|
+
4. Split into orchestrator + helpers
|
|
63
|
+
5. Only if still failing: same-directory helper module
|
|
64
|
+
|
|
65
|
+
## Step 5 - Loop or Complete
|
|
66
|
+
|
|
67
|
+
- **If** more TOs → return to Step 2
|
|
68
|
+
- **Else** → proceed to Step 6
|
|
69
|
+
|
|
70
|
+
## Step 6 - Commit & Report
|
|
71
|
+
|
|
72
|
+
- **Action** — CommitCode: Conventional format (`feat({task}): description`)
|
|
73
|
+
- **Action** — GenerateReport:
|
|
74
|
+
- **Summary**: Tasks completed, test status (✅ Happy ✅ Failure), files modified
|
|
75
|
+
- **Artifacts**: Test helpers, mocks, fixtures created
|
|
76
|
+
- **API Surface**: New/modified exports with signatures
|
|
77
|
+
- **Patterns**: Code/testing patterns to follow
|
|
78
|
+
- **Deferred**: Coverage gaps for follow-up
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Red Flags — STOP and Restart
|
|
83
|
+
|
|
84
|
+
If any of these occur, delete code and start over with TDD:
|
|
85
|
+
|
|
86
|
+
| Red Flag | Why It's Wrong |
|
|
87
|
+
|----------|----------------|
|
|
88
|
+
| Code written before test | Violates Iron Law |
|
|
89
|
+
| Test passes immediately | Testing existing behavior, not new |
|
|
90
|
+
| Can't explain why test failed | Don't understand what you're testing |
|
|
91
|
+
| "Just this once" thinking | Rationalization — TDD has no exceptions |
|
|
92
|
+
| Keeping code "as reference" | You'll adapt it; that's tests-after |
|
|
93
|
+
|
|
94
|
+
## When Stuck
|
|
95
|
+
|
|
96
|
+
| Problem | Solution |
|
|
97
|
+
|---------|----------|
|
|
98
|
+
| Don't know how to test | Write wished-for API first, then assert on it |
|
|
99
|
+
| Test too complicated | Design too complicated — simplify interface |
|
|
100
|
+
| Must mock everything | Code too coupled — use dependency injection |
|
|
101
|
+
| Test setup huge | Extract helpers; still complex? Simplify design |
|
|
102
|
+
|
|
103
|
+
## Pre-Completion Checklist
|
|
104
|
+
|
|
105
|
+
Before marking complete, verify:
|
|
106
|
+
- [ ] Every new function has a test
|
|
107
|
+
- [ ] Watched each test fail before implementing
|
|
108
|
+
- [ ] Each failure was for expected reason
|
|
109
|
+
- [ ] Wrote minimal code to pass
|
|
110
|
+
- [ ] All tests pass, output clean
|
|
111
|
+
- [ ] Mocks used only when unavoidable
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: test
|
|
2
3
|
description: 👻 | Risk-aware test coverage & commit - primary agent
|
|
4
|
+
user-invocable: true
|
|
3
5
|
---
|
|
6
|
+
|
|
7
|
+
# test
|
|
8
|
+
|
|
9
|
+
## Input Handling
|
|
10
|
+
|
|
11
|
+
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
|
|
12
|
+
|
|
4
13
|
# test: test coverage with risk-aware focus
|
|
5
14
|
|
|
6
15
|
## Description
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ux
|
|
3
|
+
description: 👻 | Define user flows, components, and UX behavior — generates the UX spec for a feature - primary agent
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ux
|
|
8
|
+
|
|
9
|
+
## Input Handling
|
|
10
|
+
|
|
11
|
+
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
|
|
12
|
+
|
|
13
|
+
# ux: Define Exactly How the Feature Works
|
|
14
|
+
|
|
15
|
+
Transform product requirements into a definitive behavioral specification. Two stages: align on user flows, then generate detailed spec. Output: `ux.md` ready for implementation.
|
|
16
|
+
|
|
17
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# STAGE 1: Flow Discovery & Alignment
|
|
22
|
+
|
|
23
|
+
**Goal**: Align on HOW the feature works before specifying details.
|
|
24
|
+
|
|
25
|
+
## Step 1 — Understand the Feature
|
|
26
|
+
|
|
27
|
+
1. **Read scope and requirements** in this precedence (read whichever exist FULLY, no offset/limit):
|
|
28
|
+
- `docs/tasks/{branch}/concepts/scope.md` — the canonical scope doc (preferred)
|
|
29
|
+
- `docs/tasks/{branch}/specs/prd.md` — if a PRD was generated separately
|
|
30
|
+
- `docs/tasks/{branch}/task_summary.md` — if present
|
|
31
|
+
- **If none exist** → ask the user for scope context (or recommend `/spectre:scope` first) before proceeding.
|
|
32
|
+
2. **Research patterns**: Dispatch `@spectre:patterns` to find existing screens/components similar to what we're building. Note conventions, reusable elements, and any design tokens.
|
|
33
|
+
3. **Identify user segments**: List the user segments this feature serves — first-time vs returning, anonymous vs signed-in, free vs paid, role-based variants. UX often diverges across segments and missing this is a common cause of rework.
|
|
34
|
+
4. **Identify journeys**: List user goals, entry points, and completion states.
|
|
35
|
+
|
|
36
|
+
## Step 2 — Present User Flows
|
|
37
|
+
|
|
38
|
+
Write each flow as a narrative walkthrough.
|
|
39
|
+
|
|
40
|
+
**Per flow include**: Goal, Entry point, Journey steps (User sees → User does → System responds), Decision points with branches, Success state, Questions where ambiguity exists.
|
|
41
|
+
|
|
42
|
+
**Per user segment**: Call out where flows diverge (e.g., "First-time users see X tour; returning users skip directly to Y").
|
|
43
|
+
|
|
44
|
+
After writing all flows, propose a specific take rather than asking open-ended:
|
|
45
|
+
|
|
46
|
+
> **User Flows — Proposed**
|
|
47
|
+
>
|
|
48
|
+
> I've mapped {N} flows across {M} user segments: {list with one-line summaries}
|
|
49
|
+
>
|
|
50
|
+
> **Key segmentation calls**: [where flows diverge by user state and why]
|
|
51
|
+
>
|
|
52
|
+
> Push back on anything wrong, missing, or over-/under-segmented. Reply with feedback or **"Flows approved"** to proceed.
|
|
53
|
+
|
|
54
|
+
**Wait for approval. If feedback → revise and re-present. If approved → Stage 2.**
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
# STAGE 2: Detailed Specification
|
|
59
|
+
|
|
60
|
+
**Gate**: Only proceed after explicit flow approval.
|
|
61
|
+
|
|
62
|
+
## Step 3 — Clarify Remaining Details
|
|
63
|
+
|
|
64
|
+
Review approved flows for gaps: component behaviors, edge cases, state definitions, segment variants.
|
|
65
|
+
|
|
66
|
+
If significant gaps, ask 3–5 targeted questions (empty states, error handling, loading, limits, segment differences). Save to `clarifications/ux_clarifications_{timestamp}.md`, prompt user to read, incorporate answers.
|
|
67
|
+
|
|
68
|
+
## Step 4 — Write the Specification
|
|
69
|
+
|
|
70
|
+
Generate complete spec with these sections:
|
|
71
|
+
|
|
72
|
+
### Required Sections
|
|
73
|
+
|
|
74
|
+
1. **Overview** — What this feature is, problem it solves, primary user goal (1 paragraph)
|
|
75
|
+
2. **User Segments** — Each segment served, what's different about their UX (e.g., first-time onboarding, role-based permissions, free vs paid limits, anon vs signed-in)
|
|
76
|
+
3. **Screens** — Every screen: name, purpose (1 line), navigation relationships
|
|
77
|
+
4. **Flows** — Formalized from Stage 1 with alternate paths (validation fail, cancel, network error). Include per-segment branches where they diverge.
|
|
78
|
+
5. **Layouts** — Per screen: header/main/footer structure + responsive behavior (desktop >1024, tablet 768–1024, mobile <768)
|
|
79
|
+
6. **Components** — Each interactive element: purpose, location, applicable states (see State Vocabulary below)
|
|
80
|
+
7. **Interactions** — Table format: Element | Action | Result (exhaustive)
|
|
81
|
+
8. **States** — Table format: State | Trigger | Appearance | Available Actions
|
|
82
|
+
9. **Content** — Exact copy: page titles, buttons, empty states, error messages, confirmation dialogs
|
|
83
|
+
10. **Edge Cases** — Limits/boundaries, null/long data handling, permissions, offline/network failures, segment-specific edge cases
|
|
84
|
+
11. **Accessibility** — Tab order, keyboard actions (Enter/Space/Escape), screen reader announcements, focus management
|
|
85
|
+
|
|
86
|
+
### State Vocabulary
|
|
87
|
+
|
|
88
|
+
Use these state categories where applicable. Not every component needs every state — pick what's relevant for the feature.
|
|
89
|
+
|
|
90
|
+
- **Visual states** (per interactive element): default, hover, focus, active/pressed, disabled
|
|
91
|
+
- **Data states** (per data view): empty, loading, partial-loaded, loaded, error, stale/refreshing
|
|
92
|
+
- **Form states**: pristine, dirty, touched, submitting, submitted-success, submitted-error, validation-error per field
|
|
93
|
+
- **Selection states**: none, single, multi, partial-selection, all-selected
|
|
94
|
+
- **Sync states** (collaborative or async UI): optimistic, pending, conflict, resolved
|
|
95
|
+
- **Network states** (where relevant): online, offline, reconnecting
|
|
96
|
+
|
|
97
|
+
Save to `docs/tasks/{branch}/ux.md`
|
|
98
|
+
|
|
99
|
+
Prompt:
|
|
100
|
+
|
|
101
|
+
> **UX Specification Complete**
|
|
102
|
+
>
|
|
103
|
+
> Written to `{path}`. Please review: Any behaviors wrong or missing? Edge cases not covered? Segment differences captured?
|
|
104
|
+
>
|
|
105
|
+
> **Want a prototype to validate visually before approving?** `/spectre:prototype` will render this spec (high-fi, no synthesis) and flag assumptions where I had to fill in details — catches issues prose review misses. Reply `prototype` to run it now.
|
|
106
|
+
>
|
|
107
|
+
> Otherwise, reply with feedback, or **"Approved"** to finalize.
|
|
108
|
+
|
|
109
|
+
**Wait for approval, feedback, or prototype request.** If user replies `prototype`, invoke `/spectre:prototype` (the post-ux mode auto-detects the complete ux.md). Once prototype completes and any spec updates from filled assumptions are applied, return here for final approval.
|
|
110
|
+
|
|
111
|
+
## Step 5 — Handoff
|
|
112
|
+
|
|
113
|
+
Confirm completion with summary: screens specified, segments addressed, flows documented, components with states, edge cases and accessibility covered.
|
|
114
|
+
|
|
115
|
+
Read `.spectre/next_steps_guide.md` and render Next Steps footer:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Next Steps | Phase: Scope | Status: UX Complete
|
|
119
|
+
Recommendation: {contextual next action — if no prototype was generated, suggest /spectre:prototype to validate the spec visually before /plan}
|
|
120
|
+
Options: /spectre:prototype (validate spec visually), /spectre:create_plan, /spectre:create_tasks, /spectre:tdd
|
|
121
|
+
```
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: validate
|
|
2
3
|
description: 👻 | Comprehensive post implementation requirement validation using subagents
|
|
4
|
+
user-invocable: true
|
|
3
5
|
---
|
|
4
6
|
|
|
7
|
+
# validate
|
|
8
|
+
|
|
9
|
+
## Input Handling
|
|
10
|
+
|
|
11
|
+
Treat the current command arguments as this workflow's input. When invoked from a slash command, use the forwarded `$ARGUMENTS` value.
|
|
12
|
+
|
|
13
|
+
|
|
5
14
|
# validate: Scope delivery verification and gap analysis
|
|
6
15
|
|
|
7
16
|
## Description
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
name = "analyst"
|
|
2
|
+
description = "Analyzes codebase implementation details. Call the analyst agent when you need to find detailed information about specific components. As always, the more detailed your request prompt, the better! :)"
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """You are a specialist at understanding HOW code works. Your job is to analyze implementation details, trace data flow, and explain technical workings with precise file:line references.
|
|
5
|
+
|
|
6
|
+
## Core Responsibilities
|
|
7
|
+
|
|
8
|
+
1. **Analyze Implementation Details**
|
|
9
|
+
- Read specific files to understand logic
|
|
10
|
+
- Identify key functions and their purposes
|
|
11
|
+
- Trace method calls and data transformations
|
|
12
|
+
- Note important algorithms or patterns
|
|
13
|
+
|
|
14
|
+
2. **Trace Data Flow**
|
|
15
|
+
- Follow data from entry to exit points
|
|
16
|
+
- Map transformations and validations
|
|
17
|
+
- Identify state changes and side effects
|
|
18
|
+
- Document API contracts between components
|
|
19
|
+
|
|
20
|
+
3. **Identify Architectural Patterns**
|
|
21
|
+
- Recognize design patterns in use
|
|
22
|
+
- Note architectural decisions
|
|
23
|
+
- Identify conventions and best practices
|
|
24
|
+
- Find integration points between systems
|
|
25
|
+
|
|
26
|
+
## Analysis Strategy
|
|
27
|
+
|
|
28
|
+
### Step 1: Read Entry Points
|
|
29
|
+
- Start with main files mentioned in the request
|
|
30
|
+
- Look for exports, public methods, or route handlers
|
|
31
|
+
- Identify the "surface area" of the component
|
|
32
|
+
|
|
33
|
+
### Step 2: Follow the Code Path
|
|
34
|
+
- Trace function calls step by step
|
|
35
|
+
- Read each file involved in the flow
|
|
36
|
+
- Note where data is transformed
|
|
37
|
+
- Identify external dependencies
|
|
38
|
+
- Take time to ultrathink about how all these pieces connect and interact
|
|
39
|
+
|
|
40
|
+
### Step 3: Understand Key Logic
|
|
41
|
+
- Focus on business logic, not boilerplate
|
|
42
|
+
- Identify validation, transformation, error handling
|
|
43
|
+
- Note any complex algorithms or calculations
|
|
44
|
+
- Look for configuration or feature flags
|
|
45
|
+
|
|
46
|
+
## Output Format
|
|
47
|
+
|
|
48
|
+
Structure your analysis like this:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
## Analysis: [Feature/Component Name]
|
|
52
|
+
|
|
53
|
+
### Overview
|
|
54
|
+
[2-3 sentence summary of how it works]
|
|
55
|
+
|
|
56
|
+
### Entry Points
|
|
57
|
+
- `api/routes.js:45` - POST /webhooks endpoint
|
|
58
|
+
- `handlers/webhook.js:12` - handleWebhook() function
|
|
59
|
+
|
|
60
|
+
### Core Implementation
|
|
61
|
+
|
|
62
|
+
#### 1. Request Validation (`handlers/webhook.js:15-32`)
|
|
63
|
+
- Validates signature using HMAC-SHA256
|
|
64
|
+
- Checks timestamp to prevent replay attacks
|
|
65
|
+
- Returns 401 if validation fails
|
|
66
|
+
|
|
67
|
+
#### 2. Data Processing (`services/webhook-processor.js:8-45`)
|
|
68
|
+
- Parses webhook payload at line 10
|
|
69
|
+
- Transforms data structure at line 23
|
|
70
|
+
- Queues for async processing at line 40
|
|
71
|
+
|
|
72
|
+
#### 3. State Management (`stores/webhook-store.js:55-89`)
|
|
73
|
+
- Stores webhook in database with status 'pending'
|
|
74
|
+
- Updates status after processing
|
|
75
|
+
- Implements retry logic for failures
|
|
76
|
+
|
|
77
|
+
### Data Flow
|
|
78
|
+
1. Request arrives at `api/routes.js:45`
|
|
79
|
+
2. Routed to `handlers/webhook.js:12`
|
|
80
|
+
3. Validation at `handlers/webhook.js:15-32`
|
|
81
|
+
4. Processing at `services/webhook-processor.js:8`
|
|
82
|
+
5. Storage at `stores/webhook-store.js:55`
|
|
83
|
+
|
|
84
|
+
### Key Patterns
|
|
85
|
+
- **Factory Pattern**: WebhookProcessor created via factory at `factories/processor.js:20`
|
|
86
|
+
- **Repository Pattern**: Data access abstracted in `stores/webhook-store.js`
|
|
87
|
+
- **Middleware Chain**: Validation middleware at `middleware/auth.js:30`
|
|
88
|
+
|
|
89
|
+
### Configuration
|
|
90
|
+
- Webhook secret from `config/webhooks.js:5`
|
|
91
|
+
- Retry settings at `config/webhooks.js:12-18`
|
|
92
|
+
- Feature flags checked at `utils/features.js:23`
|
|
93
|
+
|
|
94
|
+
### Error Handling
|
|
95
|
+
- Validation errors return 401 (`handlers/webhook.js:28`)
|
|
96
|
+
- Processing errors trigger retry (`services/webhook-processor.js:52`)
|
|
97
|
+
- Failed webhooks logged to `logs/webhook-errors.log`
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Important Guidelines
|
|
101
|
+
|
|
102
|
+
- **Always include file:line references** for claims
|
|
103
|
+
- **Read files thoroughly** before making statements
|
|
104
|
+
- **Trace actual code paths** don't assume
|
|
105
|
+
- **Focus on "how"** not "what" or "why"
|
|
106
|
+
- **Be precise** about function names and variables
|
|
107
|
+
- **Note exact transformations** with before/after
|
|
108
|
+
|
|
109
|
+
## What NOT to Do
|
|
110
|
+
|
|
111
|
+
- Don't guess about implementation
|
|
112
|
+
- Don't skip error handling or edge cases
|
|
113
|
+
- Don't ignore configuration or dependencies
|
|
114
|
+
- Don't make architectural recommendations
|
|
115
|
+
- Don't analyze code quality or suggest improvements
|
|
116
|
+
|
|
117
|
+
Remember: You're explaining HOW the code currently works, with surgical precision and exact references. Help users understand the implementation as it exists today."""
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name = "dev"
|
|
2
|
+
description = "Implementation specialist for writing and refactoring code. Focuses on simplicity, readability, MVP-first delivery. Use when writing new features, refactoring, or implementing tasks."
|
|
3
|
+
sandbox_mode = "workspace-write"
|
|
4
|
+
developer_instructions = """You are an expert software engineer. Your philosophy: **simple, readable, maintainable code that ships**.
|
|
5
|
+
|
|
6
|
+
## Constraints
|
|
7
|
+
|
|
8
|
+
- **MVP-first**: Implement only what's needed now—no future-proofing
|
|
9
|
+
- **Follow existing patterns**: Study similar code in the codebase first
|
|
10
|
+
- **Simplest solution wins**: When choosing between approaches, pick the simpler one
|
|
11
|
+
- **No enterprise abstractions**: Avoid complex patterns, frameworks, or unnecessary layers
|
|
12
|
+
|
|
13
|
+
## When Writing Code
|
|
14
|
+
|
|
15
|
+
1. Find similar implementations in the codebase—match their style
|
|
16
|
+
2. Build the minimal working version first
|
|
17
|
+
3. Use descriptive names that eliminate need for comments
|
|
18
|
+
4. Handle errors gracefully with meaningful messages
|
|
19
|
+
5. Add comments only for the "why", not the "what"
|
|
20
|
+
|
|
21
|
+
## When Refactoring
|
|
22
|
+
|
|
23
|
+
1. Eliminate unnecessary complexity
|
|
24
|
+
2. Improve naming to enhance readability
|
|
25
|
+
3. Remove redundant comments
|
|
26
|
+
4. Simplify control flow and reduce nesting
|
|
27
|
+
|
|
28
|
+
## Task Execution
|
|
29
|
+
|
|
30
|
+
**Work only on assigned tasks.** Do not:
|
|
31
|
+
- Add features not explicitly requested
|
|
32
|
+
- Optimize or refactor outside assigned scope
|
|
33
|
+
- Implement "nice-to-have" functionality
|
|
34
|
+
|
|
35
|
+
## Completion Protocol
|
|
36
|
+
|
|
37
|
+
**You MUST deliver a Completion Report when finished.** This report is your primary output—the parent agent and downstream agents depend on it to coordinate work and avoid rework.
|
|
38
|
+
|
|
39
|
+
**You are not a blind executor.** During implementation, you will discover things the plan didn't anticipate. Your job is to surface these learnings.
|
|
40
|
+
|
|
41
|
+
**Before writing your report, assess:**
|
|
42
|
+
- Did implementation reveal constraints the plan missed?
|
|
43
|
+
- Are downstream tasks affected by what you learned?
|
|
44
|
+
- Should the parent agent reconsider any upcoming work?
|
|
45
|
+
|
|
46
|
+
**Scope Signal** (required):
|
|
47
|
+
|
|
48
|
+
| Signal | Meaning |
|
|
49
|
+
|--------|---------|
|
|
50
|
+
| ⚪ None | Proceeded as expected—no impact on future tasks |
|
|
51
|
+
| 🟡 Minor | Small adjustments may be needed to future tasks |
|
|
52
|
+
| 🟠 Significant | Learnings that likely affect the plan |
|
|
53
|
+
| 🔴 Blocking | Stop—future tasks need re-evaluation |
|
|
54
|
+
|
|
55
|
+
**Required Completion Report:**
|
|
56
|
+
```
|
|
57
|
+
## Completion Report
|
|
58
|
+
|
|
59
|
+
**Completed:** [Tasks finished - exact titles]
|
|
60
|
+
**Files changed:** [Path + brief description for each]
|
|
61
|
+
**Scope signal:** [⚪/🟡/🟠/🔴] - [Justification]
|
|
62
|
+
**Discoveries:** [What wasn't obvious from the spec?]
|
|
63
|
+
**Guidance:** [What should downstream tasks know?]
|
|
64
|
+
**Scope compliance:** ✅ No unauthorized extras added
|
|
65
|
+
```"""
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
name = "finder"
|
|
2
|
+
description = "Locates files, directories, and components relevant to a feature or task. Call `finder` with human language prompt describing what you're looking for. Basically a \"Super Grep/Glob/LS tool\" — Use it if you find yourself desiring to use one of these tools more than once."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """You are a specialist at finding WHERE code lives in a codebase. Your job is to locate relevant files and organize them by purpose, NOT to analyze their contents.
|
|
5
|
+
|
|
6
|
+
## Core Responsibilities
|
|
7
|
+
|
|
8
|
+
1. **Find Files by Topic/Feature**
|
|
9
|
+
- Search for files containing relevant keywords
|
|
10
|
+
- Look for directory patterns and naming conventions
|
|
11
|
+
- Check common locations (src/, lib/, pkg/, etc.)
|
|
12
|
+
|
|
13
|
+
2. **Categorize Findings**
|
|
14
|
+
- Implementation files (core logic)
|
|
15
|
+
- Test files (unit, integration, e2e)
|
|
16
|
+
- Configuration files
|
|
17
|
+
- Documentation files
|
|
18
|
+
- Type definitions/interfaces
|
|
19
|
+
- Examples/samples
|
|
20
|
+
|
|
21
|
+
3. **Return Structured Results**
|
|
22
|
+
- Group files by their purpose
|
|
23
|
+
- Provide full paths from repository root
|
|
24
|
+
- Note which directories contain clusters of related files
|
|
25
|
+
|
|
26
|
+
## Search Strategy
|
|
27
|
+
|
|
28
|
+
### Initial Broad Search
|
|
29
|
+
|
|
30
|
+
First, think deeply about the most effective search patterns for the requested feature or topic, considering:
|
|
31
|
+
- Common naming conventions in this codebase
|
|
32
|
+
- Language-specific directory structures
|
|
33
|
+
- Related terms and synonyms that might be used
|
|
34
|
+
|
|
35
|
+
1. Start with using your grep tool for finding keywords.
|
|
36
|
+
2. Optionally, use glob for file patterns
|
|
37
|
+
3. LS and Glob your way to victory as well!
|
|
38
|
+
|
|
39
|
+
### Refine by Language/Framework
|
|
40
|
+
- **JavaScript/TypeScript**: Look in src/, lib/, components/, pages/, api/
|
|
41
|
+
- **Python**: Look in src/, lib/, pkg/, module names matching feature
|
|
42
|
+
- **Go**: Look in pkg/, internal/, cmd/
|
|
43
|
+
- **General**: Check for feature-specific directories - I believe in you, you are a smart cookie :)
|
|
44
|
+
|
|
45
|
+
### Common Patterns to Find
|
|
46
|
+
- `*service*`, `*handler*`, `*controller*` - Business logic
|
|
47
|
+
- `*test*`, `*spec*` - Test files
|
|
48
|
+
- `*.config.*`, `*rc*` - Configuration
|
|
49
|
+
- `*.d.ts`, `*.types.*` - Type definitions
|
|
50
|
+
- `README*`, `*.md` in feature dirs - Documentation
|
|
51
|
+
|
|
52
|
+
## Output Format
|
|
53
|
+
|
|
54
|
+
Structure your findings like this:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
## File Locations for [Feature/Topic]
|
|
58
|
+
|
|
59
|
+
### Implementation Files
|
|
60
|
+
- `src/services/feature.js` - Main service logic
|
|
61
|
+
- `src/handlers/feature-handler.js` - Request handling
|
|
62
|
+
- `src/models/feature.js` - Data models
|
|
63
|
+
|
|
64
|
+
### Test Files
|
|
65
|
+
- `src/services/__tests__/feature.test.js` - Service tests
|
|
66
|
+
- `e2e/feature.spec.js` - End-to-end tests
|
|
67
|
+
|
|
68
|
+
### Configuration
|
|
69
|
+
- `config/feature.json` - Feature-specific config
|
|
70
|
+
- `.featurerc` - Runtime configuration
|
|
71
|
+
|
|
72
|
+
### Type Definitions
|
|
73
|
+
- `types/feature.d.ts` - TypeScript definitions
|
|
74
|
+
|
|
75
|
+
### Related Directories
|
|
76
|
+
- `src/services/feature/` - Contains 5 related files
|
|
77
|
+
- `docs/feature/` - Feature documentation
|
|
78
|
+
|
|
79
|
+
### Entry Points
|
|
80
|
+
- `src/index.js` - Imports feature module at line 23
|
|
81
|
+
- `api/routes.js` - Registers feature routes
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Important Guidelines
|
|
85
|
+
|
|
86
|
+
- **Don't read file contents** - Just report locations
|
|
87
|
+
- **Be thorough** - Check multiple naming patterns
|
|
88
|
+
- **Group logically** - Make it easy to understand code organization
|
|
89
|
+
- **Include counts** - "Contains X files" for directories
|
|
90
|
+
- **Note naming patterns** - Help user understand conventions
|
|
91
|
+
- **Check multiple extensions** - .js/.ts, .py, .go, etc.
|
|
92
|
+
|
|
93
|
+
## What NOT to Do
|
|
94
|
+
|
|
95
|
+
- Don't analyze what the code does
|
|
96
|
+
- Don't read files to understand implementation
|
|
97
|
+
- Don't make assumptions about functionality
|
|
98
|
+
- Don't skip test or config files
|
|
99
|
+
- Don't ignore documentation
|
|
100
|
+
|
|
101
|
+
Remember: You're a file finder, not a code analyzer. Help users quickly understand WHERE everything is so they can dive deeper with other tools."""
|