@codename_inc/spectre 3.7.0 → 4.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 +3 -4
- 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 +2 -1
- 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/{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/{commands/scope.md → skills/scope/SKILL.md} +9 -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/{commands/ux_spec.md → skills/ux_spec/SKILL.md} +9 -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/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 +128 -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_spec/SKILL.md +100 -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/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,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "scope"
|
|
3
|
+
description: "👻 | Interactively scope a feature or improvement, generating a complete Scope document that clarifies what's IN and OUT -- primary agent"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# scope
|
|
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
|
+
# scope: Interactive Feature Scoping
|
|
14
|
+
|
|
15
|
+
Collaborative workflow for structuring unstructured thoughts into clear scope boundaries through contextual brainstorming and targeted clarifications. Focuses on user value and scope boundaries before technical considerations. Output: comprehensive scope document with clear boundaries, user value, and key decisions saved to `{OUT_DIR}/concepts/scope.md`.
|
|
16
|
+
|
|
17
|
+
## ARGUMENTS
|
|
18
|
+
|
|
19
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
20
|
+
|
|
21
|
+
## Step 1: Immediate Reply & Gather Context
|
|
22
|
+
|
|
23
|
+
- **Action** — ImmediateReply: Respond before any tools.
|
|
24
|
+
- **If** `FROM_KICKOFF=true` → acknowledge kickoff context, read `KICKOFF_DOC`, extract (Core Problem, User Value, Decisions Made, Remaining Ambiguities, Key Code Refs), **SKIP to Step 3**
|
|
25
|
+
- **Else If** ARGUMENTS empty → probe for context enthusiastically
|
|
26
|
+
- **Else** → proceed to Step 2
|
|
27
|
+
- **CRITICAL**: No tool calls except reading kickoff doc when FROM_KICKOFF=true
|
|
28
|
+
|
|
29
|
+
## Step 2: Interactive Scope Exploration
|
|
30
|
+
|
|
31
|
+
**SKIP IF FROM_KICKOFF=true**
|
|
32
|
+
|
|
33
|
+
- **Action** — ExploreScope: Collaborative dialogue focused on boundaries and user experience.
|
|
34
|
+
|
|
35
|
+
**CRITICAL**: Focus on WHAT, not HOW. Defer all technical/implementation questions until scope boundaries are finalized. Only ask technical questions if the scope itself is inherently technical (e.g., "migrate database from X to Y").
|
|
36
|
+
|
|
37
|
+
**PATTERN**: Lead with a rich initial exploration. In your FIRST response, propose concrete hypotheses AND ask 5-8 questions across multiple dimensions. Give the user a full landscape to react to, not a single thread to follow.
|
|
38
|
+
|
|
39
|
+
**FIRST RESPONSE FORMAT**:
|
|
40
|
+
|
|
41
|
+
> Here's my initial read on this, plus questions to help us explore the bounds:
|
|
42
|
+
>
|
|
43
|
+
> **My hypothesis**: [problem statement, who it affects, proposed IN/OUT]
|
|
44
|
+
>
|
|
45
|
+
> **Questions to explore**:
|
|
46
|
+
> 1. [User problem question]
|
|
47
|
+
> 2. [UX flow question]
|
|
48
|
+
> 3. [Boundary edge question]
|
|
49
|
+
> 4. [Alternative approach question]
|
|
50
|
+
> 5. [Success criteria question]
|
|
51
|
+
> 6. [Edge case question]
|
|
52
|
+
> ...
|
|
53
|
+
>
|
|
54
|
+
> Answer any/all that spark thoughts. Skip what's obvious.
|
|
55
|
+
|
|
56
|
+
**Question types to include** (aim for 5-8 total, mix from these):
|
|
57
|
+
|
|
58
|
+
- **User & Problem**: Who feels this most? What triggers the need? What's the cost of not solving it?
|
|
59
|
+
- **UX & Feel**: Should this feel fast or thorough? Guided or flexible? What's the ideal flow?
|
|
60
|
+
- **Boundaries**: What about [adjacent thing]—IN or OUT? If unlimited time, what else? What's essential for v1?
|
|
61
|
+
- **Alternatives**: I could see this as [A] or [B]. Which direction?
|
|
62
|
+
- **Edge cases**: What happens when [unusual situation]? Should we handle [error state]?
|
|
63
|
+
- **Success**: What makes you say "this shipped well"? What's the one thing we can't get wrong?
|
|
64
|
+
|
|
65
|
+
**DO NOT ask about**: implementation approach, technical trade-offs, architecture, or integration details until boundaries are confirmed.
|
|
66
|
+
|
|
67
|
+
- **Action** — IterateBoundaries: After user responds, refine boundaries and ask targeted follow-ups on gaps.
|
|
68
|
+
|
|
69
|
+
> **Current Boundaries**: ✅ **IN**: \[list\] ❌ **OUT**: \[list\] ⚠️ **Unsure**: \[edge cases\]
|
|
70
|
+
>
|
|
71
|
+
> Any items to move? Add exclusions? Clarify edges? Reply 'looks good' to continue.
|
|
72
|
+
|
|
73
|
+
- **Wait** — User confirms Scope boundaries are accurate
|
|
74
|
+
|
|
75
|
+
## Step 3: Generate Targeted Clarifications
|
|
76
|
+
|
|
77
|
+
- **Action** — DetermineOutputDir:
|
|
78
|
+
|
|
79
|
+
- **If** FROM_KICKOFF → use same dir as kickoff doc
|
|
80
|
+
- **Else** → `OUT_DIR = user_specified || docs/tasks/{branch_name}`
|
|
81
|
+
- `mkdir -p "$OUT_DIR"`
|
|
82
|
+
|
|
83
|
+
- **Action** — GenerateTargetedQuestions: Create 3-6 questions based ONLY on remaining scope ambiguities from Step 2 (or kickoff's "Remaining Ambiguities").
|
|
84
|
+
|
|
85
|
+
**CRITICAL**: Only ask about unresolved scope ambiguities. Technical questions (architecture, trade-offs, integration) belong in `plan`, not here.
|
|
86
|
+
|
|
87
|
+
- **Action** — SaveClarifications: Create `{OUT_DIR}/clarifications/scope_clarifications_{timestamp}.md`:
|
|
88
|
+
|
|
89
|
+
- Header: concept name, confirmed boundaries so far
|
|
90
|
+
- Questions: Each focused on a scope edge case with `<response></response>` block
|
|
91
|
+
|
|
92
|
+
- **Action** — PromptUser: "Saved clarifications to `{path}`. Answer in `<response>` blocks. Reply 'Read it' when ready."
|
|
93
|
+
|
|
94
|
+
- **Wait** — User replies
|
|
95
|
+
|
|
96
|
+
- **Action** — ReadClarifications: Read file, use responses (proceed with assumptions if empty)
|
|
97
|
+
|
|
98
|
+
## Step 4: Create Scope Document
|
|
99
|
+
|
|
100
|
+
- **Action** — CreateScopeDoc: Generate `{OUT_DIR}/concepts/scope.md` (use scoped filename if exists).
|
|
101
|
+
|
|
102
|
+
**Priority**: User value and boundaries BEFORE technical details.
|
|
103
|
+
|
|
104
|
+
**Sections**: The Problem (pain, impact, current state) → Target Users (primary, secondary, needs) → Success Criteria (outcomes, metrics) → User Experience (journeys, principles, trade-offs) → Scope Boundaries (in/out/maybe/future) → Constraints (platform, perf, a11y, scale) → Integration (touches, avoids, dependencies) → Decisions (from clarifications + rationale) → Risks (UX, scope creep, open questions) → Next Steps (`plan` or `create_tasks`, complexity S/M/L)
|
|
105
|
+
|
|
106
|
+
## Step 5: Light Technical Context (Optional)
|
|
107
|
+
|
|
108
|
+
**Only if scope identifies specific technical/architecture integration points.**
|
|
109
|
+
|
|
110
|
+
- **Action** — IdentifyTouchpoints: Identify desired areas of research, and dispatch parallel @analyst subagents to research each area. Surface-level only (component names, NOT implementation). List features this interacts with, constraints worth documenting, areas to avoid.
|
|
111
|
+
|
|
112
|
+
- **Action** — UpdateScopeDoc: Add findings to Integration & Constraints sections if relevant.
|
|
113
|
+
|
|
114
|
+
## Step 6: Final Review & Next Steps
|
|
115
|
+
|
|
116
|
+
- **Action** — PresentDocForReview: Show final boundaries and next steps together.
|
|
117
|
+
|
|
118
|
+
> **Scope Complete**: `{OUT_DIR}/concepts/scope.md`
|
|
119
|
+
>
|
|
120
|
+
> **Final Boundaries**: ✅ **IN**: \[from doc\] ❌ **OUT**: \[from doc\] ⚠️ **Maybe/Future**: \[from doc\]
|
|
121
|
+
>
|
|
122
|
+
> Docs saved: `{OUT_DIR}/concepts/scope.md`, `{OUT_DIR}/clarifications/scope_clarifications_{timestamp}.md`
|
|
123
|
+
>
|
|
124
|
+
> Reply with any edits, updates, or clarifications — otherwise pick a next step:
|
|
125
|
+
|
|
126
|
+
- **Action** — RenderFooter: Render Next Steps using `Skill(spectre-guide)` skill.
|
|
127
|
+
|
|
128
|
+
> **NOTE**: Do NOT wait for explicit approval. Present next steps immediately inline with the review. User can reply with scope edits OR jump straight into a next step command. If user replies with edits, apply them to the scope doc and re-present.
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "ship"
|
|
3
|
+
description: "👻 | Autonomous end-to-end: brain dump -> scope -> TDD -> commit -> rebase -> PR"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ship
|
|
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
|
+
# ship: Autonomous End-to-End Delivery
|
|
14
|
+
|
|
15
|
+
Take a brain dump and autonomously produce a reviewable PR. Zero confirmation gates — scope, implement with TDD, sweep, rebase, and open a PR.
|
|
16
|
+
|
|
17
|
+
**Execution Style**: Fully autonomous. No user approval gates. Parse intent, build it, ship the PR.
|
|
18
|
+
|
|
19
|
+
## ARGUMENTS
|
|
20
|
+
|
|
21
|
+
<ARGUMENTS> $ARGUMENTS </ARGUMENTS>
|
|
22
|
+
|
|
23
|
+
## Step (1/8) - Parse Context
|
|
24
|
+
|
|
25
|
+
- **Action** — ParseBrainDump: Extract from ARGUMENTS:
|
|
26
|
+
- `INTENT_TYPE`: `feat` or `fix` (infer from context — new behavior = feat, broken behavior = fix)
|
|
27
|
+
- `TARGET_BRANCH`: Extract if specified (e.g., "rebase onto develop"), default `origin/main`
|
|
28
|
+
- `SCOPE_SUMMARY`: 1-2 sentence distillation of what to build/fix
|
|
29
|
+
- `RELEVANT_FILES`: Any files, components, or areas mentioned
|
|
30
|
+
- `CONTEXT`: Remaining context, constraints, preferences
|
|
31
|
+
- **Action** — ValidateInput:
|
|
32
|
+
- **If** ARGUMENTS empty → ask user for brain dump, then proceed autonomously
|
|
33
|
+
- **Else** → proceed
|
|
34
|
+
|
|
35
|
+
## Step (2/8) - Ensure Worktree
|
|
36
|
+
|
|
37
|
+
- **Action** — DetectBranch: `git rev-parse --abbrev-ref HEAD`
|
|
38
|
+
- **If** already in a worktree or on a non-main branch (not `main`, not `master`) → use current context, proceed
|
|
39
|
+
- **If** on `main` or `master` → use `EnterWorktree` to create an isolated worktree
|
|
40
|
+
- **Action** — SetBranchName: Capture current branch name as `BRANCH_NAME` for artifact paths
|
|
41
|
+
|
|
42
|
+
## Step (3/8) - Quick Scope
|
|
43
|
+
|
|
44
|
+
- **Action** — DispatchResearch: Spawn parallel lightweight agents:
|
|
45
|
+
|
|
46
|
+
- `@finder` — Locate files related to `RELEVANT_FILES` and `SCOPE_SUMMARY`
|
|
47
|
+
- `@analyst` — Understand the relevant code area, key interfaces, existing patterns
|
|
48
|
+
|
|
49
|
+
- **Action** — WriteScopeDoc: Create `docs/tasks/{BRANCH_NAME}/concepts/scope.md`:
|
|
50
|
+
|
|
51
|
+
```markdown
|
|
52
|
+
# Scope: {SCOPE_SUMMARY}
|
|
53
|
+
|
|
54
|
+
## Objective
|
|
55
|
+
{1-2 sentences from brain dump}
|
|
56
|
+
|
|
57
|
+
## Type
|
|
58
|
+
{feat or fix}
|
|
59
|
+
|
|
60
|
+
## In Scope
|
|
61
|
+
- {bullet list of what will be done}
|
|
62
|
+
|
|
63
|
+
## Out of Scope
|
|
64
|
+
- {what this explicitly won't touch}
|
|
65
|
+
|
|
66
|
+
## Target Branch
|
|
67
|
+
{TARGET_BRANCH}
|
|
68
|
+
|
|
69
|
+
## Key Files
|
|
70
|
+
{from research — relevant files and their roles}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Keep it \~20 lines. This is a lightweight scope, not full `scope`.
|
|
74
|
+
|
|
75
|
+
## Step (4/8) - Create Tasks
|
|
76
|
+
|
|
77
|
+
- **Action** — CreateTasks: Use `TaskCreate` to create 3-8 tasks proportional to scope complexity.
|
|
78
|
+
- Each task gets: clear `subject` (imperative), `description` (what to do + acceptance criteria), `activeForm` (present continuous)
|
|
79
|
+
- Order tasks by dependency — foundational work first
|
|
80
|
+
- Tasks are ephemeral and operational — no file artifact needed
|
|
81
|
+
|
|
82
|
+
## Step (5/8) - Execute with TDD
|
|
83
|
+
|
|
84
|
+
- **Action** — ExecuteLoop: For each task sequentially:
|
|
85
|
+
|
|
86
|
+
1. `TaskUpdate` → `in_progress`
|
|
87
|
+
2. Load `Skill(spectre-tdd)` for TDD methodology
|
|
88
|
+
3. Execute: RED (write failing test) → GREEN (minimal implementation) → REFACTOR (clean up)
|
|
89
|
+
4. Commit with conventional format: `{INTENT_TYPE}({scope}): {description}`
|
|
90
|
+
5. `TaskUpdate` → `completed`
|
|
91
|
+
|
|
92
|
+
**Rules**:
|
|
93
|
+
|
|
94
|
+
- One commit per task minimum
|
|
95
|
+
- Conventional commit format always
|
|
96
|
+
- TDD methodology for implementation tasks (skip for config/doc-only tasks)
|
|
97
|
+
- If a task reveals new work, create additional tasks rather than scope-creeping the current one
|
|
98
|
+
|
|
99
|
+
## Step (6/8) - Sweep
|
|
100
|
+
|
|
101
|
+
Inline sweep — same checklist as `sweep`, no subagents:
|
|
102
|
+
|
|
103
|
+
### 6.1 Diff Sanity Check
|
|
104
|
+
|
|
105
|
+
- Review full diff for unintentional changes (whitespace-only edits, merge artifacts)
|
|
106
|
+
- Verify no accidentally staged files outside the intended scope
|
|
107
|
+
- Confirm no secrets, API keys, credentials, or sensitive data in diff
|
|
108
|
+
|
|
109
|
+
### 6.2 Logging Audit
|
|
110
|
+
|
|
111
|
+
- Remove temporary/debug logging (console.log, print, debug flags)
|
|
112
|
+
- Preserve intentional logs: errors, critical warnings, key state transitions
|
|
113
|
+
- Verify log levels are appropriate for production context
|
|
114
|
+
|
|
115
|
+
### 6.3 Code Hygiene
|
|
116
|
+
|
|
117
|
+
- Remove commented-out code (it's in git history if needed)
|
|
118
|
+
- Resolve or document any TODO/FIXME/HACK introduced in this session
|
|
119
|
+
- Remove hardcoded test values that should be config/env
|
|
120
|
+
|
|
121
|
+
### 6.4 Opportunistic Dead Code Cleanup
|
|
122
|
+
|
|
123
|
+
- Orphaned imports with no usage in the file
|
|
124
|
+
- Unused variables or functions declared but never referenced
|
|
125
|
+
- Debug artifacts (debugger statements, leftover TODO/FIXME from this work)
|
|
126
|
+
|
|
127
|
+
### 6.5 Lint (Strict)
|
|
128
|
+
|
|
129
|
+
- Run the project linter and **fix all violations** — no skipping, no eslint-disable
|
|
130
|
+
- Address structural lint issues by refactoring, not suppressing
|
|
131
|
+
|
|
132
|
+
### 6.6 Test
|
|
133
|
+
|
|
134
|
+
- Run affected tests + full test suite
|
|
135
|
+
- Fix any failures caused by the changes
|
|
136
|
+
- Do NOT write new tests here — that was done in Step 5
|
|
137
|
+
|
|
138
|
+
### 6.7 Commit Sweep Fixes
|
|
139
|
+
|
|
140
|
+
- If sweep produced changes, commit: `chore({scope}): sweep cleanup`
|
|
141
|
+
|
|
142
|
+
## Step (7/8) - Rebase
|
|
143
|
+
|
|
144
|
+
- **Action** — FetchLatest: `git fetch origin`
|
|
145
|
+
- **Action** — CreateSafetyRef: `git branch backup/ship-$(date +%Y%m%d-%H%M%S)`
|
|
146
|
+
- **Action** — Rebase: `git rebase {TARGET_BRANCH}`
|
|
147
|
+
- **If** conflicts → resolve automatically, favoring target branch conventions
|
|
148
|
+
- Track resolution decisions for PR summary
|
|
149
|
+
- **Action** — VerifyPostRebase:
|
|
150
|
+
- Run linter — fix violations
|
|
151
|
+
- Run full test suite — fix failures
|
|
152
|
+
- Confirm commit count and no unexpected changes
|
|
153
|
+
|
|
154
|
+
## Step (8/8) - Create PR
|
|
155
|
+
|
|
156
|
+
- **Action** — PushBranch: `git push -u origin {BRANCH_NAME}`
|
|
157
|
+
|
|
158
|
+
- **Action** — CreatePR: `gh pr create` with:
|
|
159
|
+
|
|
160
|
+
**Title**: `{INTENT_TYPE}({scope}): {SCOPE_SUMMARY}` (under 70 chars)
|
|
161
|
+
|
|
162
|
+
**Body**:
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
## Summary
|
|
166
|
+
{From scope doc — objective and what was done}
|
|
167
|
+
|
|
168
|
+
## Changes
|
|
169
|
+
{Bulleted list derived from completed tasks}
|
|
170
|
+
|
|
171
|
+
## Test Plan
|
|
172
|
+
{Bulleted checklist — what was tested, what to verify manually}
|
|
173
|
+
|
|
174
|
+
Shipped autonomously via `ship`
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
- **Action** — OutputPRUrl: Display the PR URL as the final deliverable
|
|
178
|
+
|
|
179
|
+
## Next Steps
|
|
180
|
+
|
|
181
|
+
Use `Skill(spectre-guide)` skill to render the Next Steps footer.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "sweep"
|
|
3
|
+
description: "👻 | Light pass cleanup - clean, lint, test, commit"
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# sweep
|
|
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
|
+
|
|
14
|
+
## Pre-Commit Sweep
|
|
15
|
+
|
|
16
|
+
You are preparing uncommitted or recently committed changes for check-in. Perform a systematic cleanup, then commit with descriptive conventional commits.
|
|
17
|
+
|
|
18
|
+
**Execution Style**: Fast, formulaic checklist. No subagents, no user approval gates. Execute each step and move on.
|
|
19
|
+
|
|
20
|
+
### 1. Diff Sanity Check
|
|
21
|
+
|
|
22
|
+
- Review full diff for unintentional changes (whitespace-only edits, merge artifacts)
|
|
23
|
+
- Verify no accidentally staged files outside the intended scope
|
|
24
|
+
- Confirm no secrets, API keys, credentials, or sensitive data in diff
|
|
25
|
+
|
|
26
|
+
### 2. Logging Audit
|
|
27
|
+
|
|
28
|
+
- Remove temporary/debug logging (console.log, print, debug flags, etc.)
|
|
29
|
+
- Preserve intentional logs: errors, critical warnings, key state transitions
|
|
30
|
+
- Verify log levels are appropriate for production context
|
|
31
|
+
|
|
32
|
+
### 3. Code Hygiene
|
|
33
|
+
|
|
34
|
+
- Remove commented-out code (it's in git history if needed)
|
|
35
|
+
- Resolve or document any TODO/FIXME/HACK introduced in this session
|
|
36
|
+
- Remove hardcoded test values that should be config/env
|
|
37
|
+
|
|
38
|
+
### 4. Opportunistic Dead Code Cleanup
|
|
39
|
+
|
|
40
|
+
Quick scan of changed files only — remove anything obviously dead, no deep investigation:
|
|
41
|
+
|
|
42
|
+
- Orphaned imports with no usage in the file
|
|
43
|
+
- Unused variables or functions declared but never referenced
|
|
44
|
+
- Commented-out code blocks
|
|
45
|
+
- Debug artifacts (debugger statements, leftover TODO/FIXME from this work)
|
|
46
|
+
|
|
47
|
+
Do not hunt for dead code beyond the changed files. This is opportunistic, not forensic.
|
|
48
|
+
|
|
49
|
+
### 5. Lint (Strict)
|
|
50
|
+
|
|
51
|
+
- Run the project linter and **fix all violations** — no skipping, no eslint-disable
|
|
52
|
+
- Address structural lint issues (file size, complexity thresholds) by refactoring, not suppressing
|
|
53
|
+
- Verify .gitignore coverage (no temp files, build artifacts, IDE configs)
|
|
54
|
+
|
|
55
|
+
### 6. Test
|
|
56
|
+
|
|
57
|
+
- Identify test files related to the changed files (co-located tests, imports, shared modules)
|
|
58
|
+
- Run those tests and the broader test suite
|
|
59
|
+
- Fix any failures caused by the changes
|
|
60
|
+
- Do NOT write new tests in this step — this is a sweep, not a test authoring pass
|
|
61
|
+
|
|
62
|
+
### 7. Commit
|
|
63
|
+
|
|
64
|
+
Group changes into logical conventional commits. Commits are project history and critical context for LLMs and future developers — invest in making them descriptive.
|
|
65
|
+
|
|
66
|
+
**Format**: `type(scope): description`
|
|
67
|
+
|
|
68
|
+
**Types**: feat, fix, refactor, test, chore, docs, style, perf
|
|
69
|
+
|
|
70
|
+
**Grouping** — separate commits by concern:
|
|
71
|
+
- Feature/behavior additions → `feat`
|
|
72
|
+
- Refactors/cleanup with no behavior change → `refactor`
|
|
73
|
+
- Bug fixes → `fix`
|
|
74
|
+
- Test additions/updates → `test`
|
|
75
|
+
- Config/dependency changes → `chore`
|
|
76
|
+
- Documentation → `docs`
|
|
77
|
+
|
|
78
|
+
**Commit message quality**:
|
|
79
|
+
- Subject line answers: what changed and why (not "fix stuff" or "update files")
|
|
80
|
+
- Include scope to locate the change: `feat(auth): add token refresh on 401 response`
|
|
81
|
+
- If the commit touches multiple concerns, it's too big — split it
|
|
82
|
+
- Body (optional) adds context: motivation, trade-offs, what was considered and rejected
|
|
83
|
+
|
|
84
|
+
**Anti-patterns**:
|
|
85
|
+
- `fix: updates` — says nothing
|
|
86
|
+
- `refactor: clean up` — clean up what? why?
|
|
87
|
+
- One giant commit for unrelated changes
|
|
88
|
+
|
|
89
|
+
### 8. Render Footer
|
|
90
|
+
|
|
91
|
+
Use `Skill(spectre-guide)` skill for Next Steps footer.
|