Skip to content

Commit 0ae3317

Browse files
committed
Initial release of spec-kit-cleanup extension v1.0.0
0 parents  commit 0ae3317

File tree

8 files changed

+789
-0
lines changed

8 files changed

+789
-0
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Local configuration (user-specific overrides)
2+
cleanup-config.yml
3+
*-config.local.yml
4+
5+
# IDE
6+
.idea/
7+
.vscode/
8+
*.swp
9+
*.swo
10+
11+
# OS
12+
.DS_Store
13+
Thumbs.db
14+
15+
# Python
16+
__pycache__/
17+
*.pyc
18+
.venv/
19+
venv/
20+
21+
# Node
22+
node_modules/

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Changelog
2+
3+
All notable changes to the Cleanup extension will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2026-02-22
9+
10+
### Added
11+
12+
- Initial release of the Cleanup extension
13+
- Post-implementation quality gate command (`/speckit.cleanup.run`)
14+
- Issue detection by severity (CRITICAL, LARGE, MEDIUM, SMALL)
15+
- Scout Rule implementation for small issues (auto-fix with confirmation)
16+
- Tech debt task creation for medium issues
17+
- Tech debt report generation for large issues
18+
- Constitution validation for all cleanup actions
19+
- Linter and test runner integration
20+
- `after_implement` hook for automatic cleanup prompting
21+
- Alias support (`/speckit.cleanup``/speckit.cleanup.run`)
22+
- Configuration template for customization

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Dominik Srednicki
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Spec-Kit Cleanup Extension
2+
3+
Post-implementation quality gate that reviews changes, fixes small issues (scout rule), creates tasks for medium issues, and generates analysis for large issues.
4+
5+
## Installation
6+
7+
```bash
8+
specify extension add cleanup
9+
```
10+
11+
Or install from repository directly:
12+
13+
```bash
14+
specify extension add --from https://github.com/dsrednicki/spec-kit-cleanup/archive/refs/tags/v1.0.0.zip
15+
```
16+
17+
## Usage
18+
19+
After completing implementation with `/speckit.implement`, run the cleanup command:
20+
21+
```bash
22+
/speckit.cleanup
23+
```
24+
25+
Or use the full command name:
26+
27+
```bash
28+
/speckit.cleanup.run
29+
```
30+
31+
## What It Does
32+
33+
The cleanup command performs a final quality gate after implementation:
34+
35+
1. **Reviews all implementation changes** - Analyzes files modified during implementation
36+
2. **Detects issues by severity**:
37+
- **CRITICAL**: Security vulnerabilities requiring immediate attention (halts execution)
38+
- **LARGE**: Architecture concerns requiring team discussion
39+
- **MEDIUM**: Code quality issues requiring follow-up tasks
40+
- **SMALL**: Mechanical fixes that can be applied immediately
41+
3. **Applies fixes with user confirmation** - Small issues are fixed following the Scout Rule
42+
4. **Creates tech debt tasks** - Medium issues become follow-up tasks in tasks.md
43+
5. **Generates analysis reports** - Large issues get detailed analysis in tech-debt-report.md
44+
45+
## Issue Detection
46+
47+
### Small Issues (Auto-fixable)
48+
49+
| Category | Patterns |
50+
|----------|----------|
51+
| Debug statements | `console.log`, `print()`, `debugger`, `breakpoint()`, `pdb.set_trace()` |
52+
| Dead code | Unused imports, unreachable code after `return`/`throw` |
53+
| Dev remnants | `localhost` URLs, `TODO` without ticket reference |
54+
55+
### Medium Issues (Task Creation)
56+
57+
- Missing error handling on external calls
58+
- Code duplication (same logic in 2-3 locations)
59+
- Missing documentation on public API
60+
- Disabled tests without explanation
61+
- Long functions (>50 lines with high complexity)
62+
63+
### Large Issues (Analysis Required)
64+
65+
- Circular dependencies between modules
66+
- Business logic in wrong layer
67+
- Performance anti-patterns (N+1 queries, missing pagination)
68+
- Security design issues (SQL injection patterns, unsanitized HTML)
69+
70+
### Critical Issues (Halt)
71+
72+
- Hardcoded credentials/secrets
73+
- Disabled authentication checks
74+
75+
## Outputs
76+
77+
| Artifact | Description |
78+
|----------|-------------|
79+
| Direct fixes | Small issues fixed in-place (with user confirmation) |
80+
| tasks.md | Tech Debt Tasks section appended for medium issues |
81+
| tech-debt-report.md | Detailed analysis for large issues with options |
82+
83+
## Configuration
84+
85+
Copy `config-template.yml` to `cleanup-config.yml` and customize:
86+
87+
```yaml
88+
severity_thresholds:
89+
long_function_lines: 50
90+
deep_nesting_levels: 4
91+
92+
auto_fix:
93+
debug_statements: true
94+
unused_imports: true
95+
dead_code: false
96+
```
97+
98+
## Workflow Integration
99+
100+
The cleanup command integrates with the Spec Kit workflow:
101+
102+
```
103+
/speckit.specify → /speckit.plan → /speckit.tasks → /speckit.implement → /speckit.cleanup
104+
105+
106+
/speckit.implement (for tech debt tasks)
107+
```
108+
109+
## Operating Principles
110+
111+
- **Scout Rule**: "Always leave the code cleaner than you found it"
112+
- **Constitution Compliance**: All actions respect project constitution principles
113+
- **Non-Destructive**: Always confirms before modifying, rolls back on validation failure
114+
- **Idempotent**: Safe to run multiple times
115+
116+
## Requirements
117+
118+
- Spec Kit >= 0.1.0
119+
- Completed implementation (tasks.md with completed tasks)
120+
121+
## License
122+
123+
MIT License - Copyright (c) 2026 Dominik Srednicki

catalog-entry.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "Cleanup Extension",
3+
"id": "cleanup",
4+
"description": "Post-implementation quality gate that reviews changes, fixes small issues (scout rule), creates tasks for medium issues, and generates analysis for large issues.",
5+
"author": "dsrednicki",
6+
"version": "1.0.0",
7+
"download_url": "https://github.com/dsrednicki/spec-kit-cleanup/archive/refs/tags/v1.0.0.zip",
8+
"repository": "https://github.com/dsrednicki/spec-kit-cleanup",
9+
"license": "MIT",
10+
"requires": {
11+
"speckit_version": ">=0.1.0"
12+
},
13+
"provides": {
14+
"commands": 1,
15+
"hooks": 1
16+
},
17+
"tags": [
18+
"quality",
19+
"tech-debt",
20+
"review",
21+
"cleanup",
22+
"scout-rule"
23+
],
24+
"verified": false,
25+
"created_at": "2026-02-22T00:00:00Z",
26+
"updated_at": "2026-02-22T00:00:00Z",
27+
"statistics": {
28+
"downloads": 0,
29+
"stars": 0
30+
}
31+
}

0 commit comments

Comments
 (0)