codeforge-dev 1.7.0 → 1.9.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/.devcontainer/.env +4 -6
- package/.devcontainer/.env.example +29 -0
- package/.devcontainer/.gitignore +8 -0
- package/.devcontainer/.secrets.example +12 -0
- package/.devcontainer/CHANGELOG.md +181 -0
- package/.devcontainer/CLAUDE.md +57 -20
- package/.devcontainer/README.md +111 -56
- package/.devcontainer/config/{main-system-prompt.md → defaults/main-system-prompt.md} +72 -0
- package/.devcontainer/config/defaults/rules/spec-workflow.md +67 -0
- package/.devcontainer/config/defaults/rules/workspace-scope.md +7 -0
- package/.devcontainer/config/defaults/settings.json +67 -0
- package/.devcontainer/config/file-manifest.json +32 -0
- package/.devcontainer/devcontainer.json +20 -0
- package/.devcontainer/docs/configuration-reference.md +90 -0
- package/.devcontainer/docs/keybindings.md +100 -0
- package/.devcontainer/docs/optional-features.md +129 -0
- package/.devcontainer/docs/plugins.md +154 -0
- package/.devcontainer/docs/troubleshooting.md +128 -0
- package/.devcontainer/features/agent-browser/install.sh +6 -0
- package/.devcontainer/features/ast-grep/install.sh +6 -0
- package/.devcontainer/features/biome/README.md +27 -0
- package/.devcontainer/features/biome/install.sh +6 -0
- package/.devcontainer/features/ccburn/install.sh +6 -0
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +5 -0
- package/.devcontainer/features/ccstatusline/install.sh +7 -0
- package/.devcontainer/features/ccusage/install.sh +6 -0
- package/.devcontainer/features/claude-monitor/install.sh +6 -0
- package/.devcontainer/features/dprint/README.md +30 -0
- package/.devcontainer/features/dprint/devcontainer-feature.json +18 -0
- package/.devcontainer/features/dprint/install.sh +131 -0
- package/.devcontainer/features/hadolint/README.md +35 -0
- package/.devcontainer/features/hadolint/devcontainer-feature.json +13 -0
- package/.devcontainer/features/hadolint/install.sh +86 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +5 -0
- package/.devcontainer/features/lsp-servers/install.sh +7 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +5 -0
- package/.devcontainer/features/mcp-qdrant/install.sh +13 -6
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +5 -0
- package/.devcontainer/features/mcp-reasoner/install.sh +8 -1
- package/.devcontainer/features/notify-hook/devcontainer-feature.json +5 -0
- package/.devcontainer/features/notify-hook/install.sh +7 -0
- package/.devcontainer/features/ruff/README.md +26 -0
- package/.devcontainer/features/ruff/devcontainer-feature.json +21 -0
- package/.devcontainer/features/ruff/install.sh +74 -0
- package/.devcontainer/features/shellcheck/README.md +38 -0
- package/.devcontainer/features/shellcheck/devcontainer-feature.json +13 -0
- package/.devcontainer/features/shellcheck/install.sh +24 -0
- package/.devcontainer/features/shfmt/README.md +37 -0
- package/.devcontainer/features/shfmt/devcontainer-feature.json +13 -0
- package/.devcontainer/features/shfmt/install.sh +85 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +5 -0
- package/.devcontainer/features/splitrail/install.sh +7 -0
- package/.devcontainer/features/tmux/install.sh +8 -0
- package/.devcontainer/features/tree-sitter/install.sh +6 -0
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +104 -104
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/README.md +158 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/hooks/hooks.json +39 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/scripts/collect-edited-files.py +47 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/scripts/format-on-stop.py +297 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/scripts/lint-file.py +536 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/scripts/syntax-validator.py +146 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/__pycache__/format-on-stop.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-on-stop.py +114 -9
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/hooks/hooks.json +4 -5
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/__pycache__/lint-file.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/lint-file.py +478 -76
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/AGENT-REDIRECTION.md +226 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/architect.md +94 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/bash-exec.md +4 -4
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/claude-guide.md +14 -23
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/debug-logs.md +20 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/dependency-analyst.md +20 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/doc-writer.md +99 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/explorer.md +20 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/generalist.md +152 -9
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/git-archaeologist.md +18 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/migrator.md +114 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/perf-profiler.md +24 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/refactorer.md +101 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/researcher.md +33 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/security-auditor.md +24 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/spec-writer.md +65 -24
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/statusline-config.md +3 -3
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/test-writer.md +99 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/hooks/hooks.json +100 -56
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/advisory-test-runner.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/collect-edited-files.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/commit-reminder.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/git-state-injector.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/redirect-builtin-agents.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/ticket-linker.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/todo-harvester.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/advisory-test-runner.py +174 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/collect-edited-files.py +8 -6
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/commit-reminder.py +90 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/git-state-injector.py +114 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/skill-suggester.py +61 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/spec-reminder.py +121 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/ticket-linker.py +137 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/todo-harvester.py +130 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/SKILL.md +224 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/references/error-handling.md +166 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/references/rest-conventions.md +215 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/ast-grep-patterns/SKILL.md +211 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/ast-grep-patterns/references/language-patterns.md +327 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/SKILL.md +134 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/references/ecosystem-commands.md +264 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/references/license-compliance.md +80 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/SKILL.md +153 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/references/api-doc-templates.md +221 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/references/docstring-formats.md +296 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/SKILL.md +150 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/references/javascript-migrations.md +179 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/references/python-migrations.md +141 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-check/SKILL.md +86 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/SKILL.md +97 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/backlog-template.md +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/roadmap-template.md +13 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/SKILL.md +101 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/references/template.md +110 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-update/SKILL.md +124 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/SKILL.md +32 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/scripts/__pycache__/block-dangerous.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/hooks/hooks.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/__pycache__/guard-protected.cpython-314.pyc +0 -0
- package/.devcontainer/scripts/check-setup.sh +72 -0
- package/.devcontainer/scripts/setup-aliases.sh +43 -3
- package/.devcontainer/scripts/setup-auth.sh +74 -0
- package/.devcontainer/scripts/setup-config.sh +117 -24
- package/.devcontainer/scripts/setup-update-claude.sh +8 -0
- package/.devcontainer/scripts/setup.sh +46 -13
- package/README.md +23 -190
- package/package.json +42 -42
- package/setup.js +245 -71
- package/.devcontainer/config/settings.json +0 -70
- package/.devcontainer/features/claude-code/README.md +0 -498
- package/.devcontainer/features/claude-code/config/settings.json +0 -72
- package/.devcontainer/features/claude-code/config/system-prompt.md +0 -118
- package/.devcontainer/features/claude-code/config/world-building-sp.md +0 -1432
- package/.devcontainer/features/claude-code/devcontainer-feature.json +0 -42
- package/.devcontainer/features/claude-code/install.sh +0 -466
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/.claude-plugin/plugin.json +0 -7
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/hooks/hooks.json +0 -17
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/.claude-plugin/plugin.json +0 -6
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/config/planning-instructions.md +0 -14
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/functional-conjuring-map.md +0 -989
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/hooks/hooks.json +0 -33
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/__pycache__/post-enhance-task.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhance-planning.py +0 -71
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-plan.sh +0 -68
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-task.sh +0 -120
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-plan.py +0 -133
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-task.py +0 -253
- /package/.devcontainer/config/{keybindings.json → defaults/keybindings.json} +0 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# JavaScript / TypeScript Migration Patterns
|
|
2
|
+
|
|
3
|
+
## Express → Fastify
|
|
4
|
+
|
|
5
|
+
### Route Mapping
|
|
6
|
+
|
|
7
|
+
| Express | Fastify | Notes |
|
|
8
|
+
|---------|---------|-------|
|
|
9
|
+
| `app.get('/path', handler)` | `fastify.get('/path', handler)` | Similar signature |
|
|
10
|
+
| `app.post('/path', handler)` | `fastify.post('/path', handler)` | Similar signature |
|
|
11
|
+
| `app.use(middleware)` | `fastify.register(plugin)` | Middleware → plugin model |
|
|
12
|
+
| `app.use('/prefix', router)` | `fastify.register(plugin, { prefix: '/prefix' })` | Router → registered plugin |
|
|
13
|
+
|
|
14
|
+
### Request / Response API
|
|
15
|
+
|
|
16
|
+
| Express | Fastify | Notes |
|
|
17
|
+
|---------|---------|-------|
|
|
18
|
+
| `req.body` | `request.body` | Same concept, different naming convention |
|
|
19
|
+
| `req.params.id` | `request.params.id` | Same |
|
|
20
|
+
| `req.query.page` | `request.query.page` | Same |
|
|
21
|
+
| `req.headers` | `request.headers` | Same |
|
|
22
|
+
| `res.status(200).json(data)` | `reply.code(200).send(data)` | `status` → `code`, `json` → `send` |
|
|
23
|
+
| `res.send('text')` | `reply.send('text')` | Same |
|
|
24
|
+
| `res.redirect('/url')` | `reply.redirect('/url')` | Same |
|
|
25
|
+
| `res.set('header', 'value')` | `reply.header('header', 'value')` | `set` → `header` |
|
|
26
|
+
|
|
27
|
+
### Middleware → Plugin Conversion
|
|
28
|
+
|
|
29
|
+
```javascript
|
|
30
|
+
// Express middleware
|
|
31
|
+
app.use((req, res, next) => {
|
|
32
|
+
req.startTime = Date.now();
|
|
33
|
+
next();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Fastify equivalent (using hooks)
|
|
37
|
+
fastify.addHook('onRequest', async (request, reply) => {
|
|
38
|
+
request.startTime = Date.now();
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Error Handling
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
// Express error handler
|
|
46
|
+
app.use((err, req, res, next) => {
|
|
47
|
+
res.status(err.status || 500).json({ error: err.message });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Fastify error handler
|
|
51
|
+
fastify.setErrorHandler((error, request, reply) => {
|
|
52
|
+
reply.code(error.statusCode || 500).send({ error: error.message });
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Migration Steps
|
|
57
|
+
|
|
58
|
+
1. Install Fastify: `npm install fastify`
|
|
59
|
+
2. Create Fastify app instance to replace Express app
|
|
60
|
+
3. Convert middleware to Fastify plugins/hooks
|
|
61
|
+
4. Convert route handlers (update request/response API calls)
|
|
62
|
+
5. Convert error handling
|
|
63
|
+
6. Update tests to use `fastify.inject()` instead of `supertest`
|
|
64
|
+
7. Remove Express: `npm uninstall express`
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## React Version Upgrades
|
|
69
|
+
|
|
70
|
+
### React 17 → 18
|
|
71
|
+
|
|
72
|
+
| Change | Action |
|
|
73
|
+
|--------|--------|
|
|
74
|
+
| `ReactDOM.render()` | Replace with `createRoot().render()` |
|
|
75
|
+
| `ReactDOM.hydrate()` | Replace with `hydrateRoot()` |
|
|
76
|
+
| Automatic batching | No code change — now batches all state updates by default |
|
|
77
|
+
| `useId()` hook | New — use for accessible server/client IDs |
|
|
78
|
+
| Strict Mode double-rendering | Now also double-invokes effects in dev mode |
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
// React 17
|
|
82
|
+
import ReactDOM from 'react-dom';
|
|
83
|
+
ReactDOM.render(<App />, document.getElementById('root'));
|
|
84
|
+
|
|
85
|
+
// React 18
|
|
86
|
+
import { createRoot } from 'react-dom/client';
|
|
87
|
+
const root = createRoot(document.getElementById('root'));
|
|
88
|
+
root.render(<App />);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### React 18 → 19
|
|
92
|
+
|
|
93
|
+
| Change | Action |
|
|
94
|
+
|--------|--------|
|
|
95
|
+
| `forwardRef` | No longer needed — `ref` is a regular prop |
|
|
96
|
+
| `React.lazy` | Now supports server components |
|
|
97
|
+
| Context | `<Context>` replaces `<Context.Provider>` |
|
|
98
|
+
| `use()` hook | New — reads resources (promises, context) during render |
|
|
99
|
+
| `ref` callbacks | Now support cleanup functions (return from callback) |
|
|
100
|
+
| Metadata tags | `<title>`, `<meta>`, `<link>` in components hoist to `<head>` |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## TypeScript Version Upgrades
|
|
105
|
+
|
|
106
|
+
### Key Changes by Version
|
|
107
|
+
|
|
108
|
+
| Version | Notable Changes |
|
|
109
|
+
|---------|----------------|
|
|
110
|
+
| 4.7 → 4.8 | Stricter type narrowing in `in` operator |
|
|
111
|
+
| 4.8 → 4.9 | `satisfies` operator |
|
|
112
|
+
| 4.9 → 5.0 | Decorators (TC39 standard), `bundler` module resolution |
|
|
113
|
+
| 5.0 → 5.1 | Easier implicit returns for `undefined`, linked cursors |
|
|
114
|
+
| 5.1 → 5.2 | `using` declarations (explicit resource management) |
|
|
115
|
+
| 5.2 → 5.3 | Import attributes, narrowing in `switch(true)` |
|
|
116
|
+
| 5.3 → 5.4 | `NoInfer<T>` utility type, improved narrowing in closures |
|
|
117
|
+
| 5.4 → 5.5 | Inferred type predicates, regex syntax checking |
|
|
118
|
+
|
|
119
|
+
### tsconfig Changes
|
|
120
|
+
|
|
121
|
+
| Old Option | New Option | Version |
|
|
122
|
+
|-----------|-----------|---------|
|
|
123
|
+
| `moduleResolution: "node"` | `moduleResolution: "bundler"` | 5.0+ (for bundled apps) |
|
|
124
|
+
| `target: "es2020"` | `target: "es2022"` | 5.0+ (enables native decorators) |
|
|
125
|
+
| `importsNotUsedAsValues` | `verbatimModuleSyntax` | 5.0 (consolidates 3 flags into 1) |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## CommonJS → ESM Migration
|
|
130
|
+
|
|
131
|
+
### Step-by-Step
|
|
132
|
+
|
|
133
|
+
1. **Update `package.json`**: Add `"type": "module"`
|
|
134
|
+
2. **Rename if needed**: `.js` files become ESM by default; use `.cjs` for files that must stay CommonJS
|
|
135
|
+
3. **Convert imports**:
|
|
136
|
+
|
|
137
|
+
| CommonJS | ESM |
|
|
138
|
+
|----------|-----|
|
|
139
|
+
| `const x = require('pkg')` | `import x from 'pkg'` |
|
|
140
|
+
| `const { a, b } = require('pkg')` | `import { a, b } from 'pkg'` |
|
|
141
|
+
| `module.exports = x` | `export default x` |
|
|
142
|
+
| `module.exports = { a, b }` | `export { a, b }` |
|
|
143
|
+
| `exports.a = x` | `export const a = x` |
|
|
144
|
+
|
|
145
|
+
4. **Fix path imports**: ESM requires file extensions in relative imports: `import x from './utils.js'` (not `'./utils'`)
|
|
146
|
+
5. **Replace `__dirname` / `__filename`**:
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
// CommonJS
|
|
150
|
+
const dir = __dirname;
|
|
151
|
+
const file = __filename;
|
|
152
|
+
|
|
153
|
+
// ESM
|
|
154
|
+
import { fileURLToPath } from 'url';
|
|
155
|
+
import { dirname } from 'path';
|
|
156
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
157
|
+
const __dirname = dirname(__filename);
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
6. **Replace `require.resolve`**:
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
// CommonJS
|
|
164
|
+
const resolved = require.resolve('pkg');
|
|
165
|
+
|
|
166
|
+
// ESM
|
|
167
|
+
import { createRequire } from 'module';
|
|
168
|
+
const require = createRequire(import.meta.url);
|
|
169
|
+
const resolved = require.resolve('pkg');
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
7. **Update tooling configs**: Jest, ESLint, and other tools may need config changes for ESM support.
|
|
173
|
+
|
|
174
|
+
### Common Gotchas
|
|
175
|
+
|
|
176
|
+
- JSON imports require import assertions: `import data from './data.json' with { type: 'json' }`
|
|
177
|
+
- Dynamic imports (`import()`) return a module namespace object with a `.default` property
|
|
178
|
+
- Top-level `await` is available in ESM (not in CommonJS)
|
|
179
|
+
- Some packages only export CommonJS — use `import pkg from 'pkg'` (default import) or dynamic `import()`
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Python Migration Patterns
|
|
2
|
+
|
|
3
|
+
## Python Version Upgrades (3.8 → 3.12)
|
|
4
|
+
|
|
5
|
+
### Typing Modernization
|
|
6
|
+
|
|
7
|
+
| Old Pattern (3.8) | New Pattern (3.10+) | Search Pattern |
|
|
8
|
+
|-------------------|---------------------|----------------|
|
|
9
|
+
| `Optional[X]` | `X \| None` | `from typing import Optional` |
|
|
10
|
+
| `Union[X, Y]` | `X \| Y` | `from typing import Union` |
|
|
11
|
+
| `List[str]` | `list[str]` | `from typing import List` |
|
|
12
|
+
| `Dict[str, int]` | `dict[str, int]` | `from typing import Dict` |
|
|
13
|
+
| `Tuple[int, ...]` | `tuple[int, ...]` | `from typing import Tuple` |
|
|
14
|
+
| `Set[str]` | `set[str]` | `from typing import Set` |
|
|
15
|
+
| `FrozenSet[str]` | `frozenset[str]` | `from typing import FrozenSet` |
|
|
16
|
+
| `Type[X]` | `type[X]` | `from typing import Type` |
|
|
17
|
+
|
|
18
|
+
**Migration step**: Replace all `typing` imports of built-in generics with lowercase equivalents. Remove unused `typing` imports after replacement.
|
|
19
|
+
|
|
20
|
+
### Deprecated / Removed Modules
|
|
21
|
+
|
|
22
|
+
| Module | Removed In | Replacement |
|
|
23
|
+
|--------|-----------|-------------|
|
|
24
|
+
| `distutils` | 3.12 | `setuptools`, `shutil` |
|
|
25
|
+
| `imp` | 3.12 | `importlib` |
|
|
26
|
+
| `lib2to3` | 3.13 | `libcst` or manual |
|
|
27
|
+
| `aifc` | 3.13 | Third-party audio libraries |
|
|
28
|
+
| `cgi` | 3.13 | `urllib.parse`, `email.message` |
|
|
29
|
+
| `cgitb` | 3.13 | `traceback` |
|
|
30
|
+
|
|
31
|
+
### collections.abc Migration
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
# Old (deprecated in 3.9, removed warning in 3.10+)
|
|
35
|
+
from collections import MutableMapping, Sequence, Iterable
|
|
36
|
+
|
|
37
|
+
# New
|
|
38
|
+
from collections.abc import MutableMapping, Sequence, Iterable
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Search for: `from collections import` and check if any imported names are ABCs.
|
|
42
|
+
|
|
43
|
+
### asyncio Changes
|
|
44
|
+
|
|
45
|
+
| Old Pattern | New Pattern (3.10+) | Version |
|
|
46
|
+
|------------|---------------------|---------|
|
|
47
|
+
| `asyncio.get_event_loop()` | `asyncio.get_running_loop()` (in async context) | 3.10 |
|
|
48
|
+
| `@asyncio.coroutine` / `yield from` | `async def` / `await` | 3.8 (removed 3.11) |
|
|
49
|
+
| `loop.create_task()` | `asyncio.create_task()` | 3.7 |
|
|
50
|
+
| `asyncio.wait(tasks)` | `asyncio.wait(tasks)` (must pass set) | 3.11 |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Pydantic v1 → v2
|
|
55
|
+
|
|
56
|
+
### Complete API Mapping
|
|
57
|
+
|
|
58
|
+
| Pydantic v1 | Pydantic v2 | Notes |
|
|
59
|
+
|-------------|-------------|-------|
|
|
60
|
+
| `@validator('field')` | `@field_validator('field')` | Import from `pydantic` |
|
|
61
|
+
| `@validator('field', pre=True)` | `@field_validator('field', mode='before')` | `mode='before'` replaces `pre=True` |
|
|
62
|
+
| `@validator('field', always=True)` | `@field_validator('field')` + `@model_validator` | `always` removed; use model validator for defaults |
|
|
63
|
+
| `@root_validator` | `@model_validator` | Import from `pydantic` |
|
|
64
|
+
| `@root_validator(pre=True)` | `@model_validator(mode='before')` | Mode parameter |
|
|
65
|
+
| `.dict()` | `.model_dump()` | Method renamed |
|
|
66
|
+
| `.json()` | `.model_dump_json()` | Method renamed |
|
|
67
|
+
| `.parse_obj(data)` | `.model_validate(data)` | Class method renamed |
|
|
68
|
+
| `.parse_raw(json_str)` | `.model_validate_json(json_str)` | Class method renamed |
|
|
69
|
+
| `.schema()` | `.model_json_schema()` | Class method renamed |
|
|
70
|
+
| `.construct()` | `.model_construct()` | Class method renamed |
|
|
71
|
+
| `.copy()` | `.model_copy()` | Method renamed |
|
|
72
|
+
| `class Config:` | `model_config = ConfigDict(...)` | Inline config dict |
|
|
73
|
+
| `Config.schema_extra` | `model_config = ConfigDict(json_schema_extra=...)` | Renamed field |
|
|
74
|
+
| `Config.orm_mode = True` | `model_config = ConfigDict(from_attributes=True)` | Renamed field |
|
|
75
|
+
| `Config.allow_population_by_field_name` | `model_config = ConfigDict(populate_by_name=True)` | Renamed field |
|
|
76
|
+
| `Field(regex=...)` | `Field(pattern=...)` | Parameter renamed |
|
|
77
|
+
|
|
78
|
+
### Migration Steps
|
|
79
|
+
|
|
80
|
+
1. Update `pydantic` version in manifest: `pydantic>=2.0`
|
|
81
|
+
2. Convert `class Config:` blocks to `model_config = ConfigDict(...)` — add `from pydantic import ConfigDict`
|
|
82
|
+
3. Convert `@validator` to `@field_validator` — update signatures (first arg is now `cls`, values accessed differently)
|
|
83
|
+
4. Convert `@root_validator` to `@model_validator` — update mode parameter
|
|
84
|
+
5. Replace `.dict()` → `.model_dump()`, `.json()` → `.model_dump_json()`
|
|
85
|
+
6. Replace `.parse_obj()` → `.model_validate()`, `.parse_raw()` → `.model_validate_json()`
|
|
86
|
+
7. Run `pytest` after each step
|
|
87
|
+
|
|
88
|
+
### Validator Signature Change
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
# v1
|
|
92
|
+
@validator('name')
|
|
93
|
+
def validate_name(cls, v, values):
|
|
94
|
+
return v.strip()
|
|
95
|
+
|
|
96
|
+
# v2
|
|
97
|
+
@field_validator('name')
|
|
98
|
+
@classmethod
|
|
99
|
+
def validate_name(cls, v: str, info: ValidationInfo) -> str:
|
|
100
|
+
return v.strip()
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Note: In v2, `info.data` replaces `values` for accessing other fields.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Django Version Upgrades
|
|
108
|
+
|
|
109
|
+
### Common Breaking Changes by Version
|
|
110
|
+
|
|
111
|
+
| Version | Key Changes |
|
|
112
|
+
|---------|------------|
|
|
113
|
+
| 3.2 → 4.0 | `default_app_config` removed, `USE_L10N` default changed to True |
|
|
114
|
+
| 4.0 → 4.1 | Async view support expanded, `assertFormError` signature changed |
|
|
115
|
+
| 4.1 → 4.2 | `CSRF_TRUSTED_ORIGINS` requires scheme, psycopg3 support |
|
|
116
|
+
| 4.2 → 5.0 | `DEFAULT_AUTO_FIELD` required, `logout()` changed to POST-only |
|
|
117
|
+
| 5.0 → 5.1 | `LoginRequiredMiddleware` added, `HttpResponse.content` stricter |
|
|
118
|
+
|
|
119
|
+
### Migration Steps
|
|
120
|
+
|
|
121
|
+
1. Run `python -m django check --deploy` to identify deprecation warnings.
|
|
122
|
+
2. Read the release notes for each version between current and target.
|
|
123
|
+
3. Upgrade one minor version at a time (4.0→4.1→4.2, not 4.0→4.2).
|
|
124
|
+
4. Run `python manage.py migrate` and `python manage.py test` after each version bump.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## SQLAlchemy 1.x → 2.x
|
|
129
|
+
|
|
130
|
+
### Key Changes
|
|
131
|
+
|
|
132
|
+
| SQLAlchemy 1.x | SQLAlchemy 2.x | Notes |
|
|
133
|
+
|----------------|----------------|-------|
|
|
134
|
+
| `session.query(Model)` | `select(Model)` + `session.execute()` | New select() style |
|
|
135
|
+
| `query.filter()` | `select().where()` | Method renamed |
|
|
136
|
+
| `query.all()` | `session.execute(stmt).scalars().all()` | Execution separated from query building |
|
|
137
|
+
| `Column(Integer)` | `mapped_column(Integer)` | New declarative style |
|
|
138
|
+
| `relationship()` | `relationship()` | Mostly compatible |
|
|
139
|
+
| `engine.execute()` | Removed | Use `with engine.connect() as conn: conn.execute()` |
|
|
140
|
+
|
|
141
|
+
Run with `SQLALCHEMY_WARN_20=1` environment variable to get deprecation warnings for 1.x patterns before migrating.
|
package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-check/SKILL.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-check
|
|
3
|
+
description: >-
|
|
4
|
+
This skill should be used when the user asks to "check spec status",
|
|
5
|
+
"audit specs", "which specs are stale", "spec health", "find missing
|
|
6
|
+
specs", "review spec quality", or needs a comprehensive audit of all
|
|
7
|
+
specifications in the project.
|
|
8
|
+
version: 0.1.0
|
|
9
|
+
context: fork
|
|
10
|
+
agent: explorer
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Spec Health Audit
|
|
14
|
+
|
|
15
|
+
Audit all specifications in the current project and report their health status.
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### Step 1: Discover Specs
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Glob: .specs/**/*.md
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If `.specs/` does not exist, report: "No specification directory found. Use `/spec-new` to create your first spec."
|
|
26
|
+
|
|
27
|
+
Exclude non-spec files:
|
|
28
|
+
- `ROADMAP.md`
|
|
29
|
+
- `BACKLOG.md`
|
|
30
|
+
- `LESSONS_LEARNED.md`
|
|
31
|
+
- Files in `archive/`
|
|
32
|
+
- `_overview.md` files (report them separately as parent specs)
|
|
33
|
+
|
|
34
|
+
### Step 2: Read Each Spec
|
|
35
|
+
|
|
36
|
+
For each spec file, extract:
|
|
37
|
+
- **Feature name** from the `# Feature: [Name]` header
|
|
38
|
+
- **Version** from the `**Version:**` field
|
|
39
|
+
- **Status** from the `**Status:**` field
|
|
40
|
+
- **Last Updated** from the `**Last Updated:**` field
|
|
41
|
+
- **Line count** (wc -l)
|
|
42
|
+
- **Sections present** — check for each required section header
|
|
43
|
+
- **Acceptance criteria** — count total, count checked `[x]`
|
|
44
|
+
- **Discrepancies** — check if section has content
|
|
45
|
+
|
|
46
|
+
### Step 3: Flag Issues
|
|
47
|
+
|
|
48
|
+
For each spec, check these conditions:
|
|
49
|
+
|
|
50
|
+
| Issue | Condition | Severity |
|
|
51
|
+
|-------|-----------|----------|
|
|
52
|
+
| **Stale** | Status is `planned` but Last Updated is >30 days ago | High |
|
|
53
|
+
| **Incomplete** | Missing required sections (Intent, Acceptance Criteria, Key Files, Requirements, Out of Scope) | High |
|
|
54
|
+
| **Oversized** | Exceeds 200 lines | Medium |
|
|
55
|
+
| **No criteria** | Acceptance Criteria section is empty or has no checkboxes | High |
|
|
56
|
+
| **Open discrepancies** | Discrepancies section has content | Medium |
|
|
57
|
+
| **Missing as-built** | Status is `implemented` but Implementation Notes is empty | Medium |
|
|
58
|
+
| **Stale paths** | Key Files references paths that don't exist | Low |
|
|
59
|
+
|
|
60
|
+
### Step 4: Report
|
|
61
|
+
|
|
62
|
+
Output a summary table:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
## Spec Health Report
|
|
66
|
+
|
|
67
|
+
| Feature | Version | Status | Updated | Lines | Issues |
|
|
68
|
+
|---------|---------|--------|---------|-------|--------|
|
|
69
|
+
| Session History | v0.2.0 | implemented | 2026-02-08 | 74 | None |
|
|
70
|
+
| Auth Flow | v0.3.0 | planned | 2026-01-15 | 45 | Stale (26 days) |
|
|
71
|
+
| Settings Page | v0.2.0 | partial | 2026-02-05 | 210 | Oversized |
|
|
72
|
+
|
|
73
|
+
## Issues Found
|
|
74
|
+
|
|
75
|
+
### High Priority
|
|
76
|
+
- **Auth Flow** (`.specs/v0.3.0/auth-flow.md`): Status is `planned` but last updated 26 days ago. Either implementation is stalled or the spec needs an as-built update.
|
|
77
|
+
|
|
78
|
+
### Medium Priority
|
|
79
|
+
- **Settings Page** (`.specs/v0.2.0/settings-page.md`): 210 lines exceeds the 200-line limit. Split into sub-specs.
|
|
80
|
+
|
|
81
|
+
### Suggested Actions
|
|
82
|
+
1. Run `/spec-update auth-flow` to update the auth flow spec
|
|
83
|
+
2. Split settings-page.md into sub-specs
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If no issues are found, report: "All specs healthy. N specs across M versions."
|
package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/SKILL.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-init
|
|
3
|
+
description: >-
|
|
4
|
+
This skill should be used when the user asks to "initialize specs",
|
|
5
|
+
"set up specs", "bootstrap specs", "start using specs", "create spec
|
|
6
|
+
directory", "init specs for this project", or needs to set up the
|
|
7
|
+
.specs/ directory structure for a project that doesn't have one yet.
|
|
8
|
+
version: 0.1.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Initialize Specification Directory
|
|
12
|
+
|
|
13
|
+
## Mental Model
|
|
14
|
+
|
|
15
|
+
Before any spec can be created, the project needs a `.specs/` directory with its supporting files: a ROADMAP (what each version delivers) and a BACKLOG (deferred items). This skill bootstraps that structure so `/spec-new` has a home.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
### Step 1: Check Existing State
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Glob: .specs/**/*.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**If `.specs/` already exists:**
|
|
28
|
+
- Report current state: how many specs, versions, whether ROADMAP.md and BACKLOG.md exist
|
|
29
|
+
- Suggest `/spec-check` to audit health instead
|
|
30
|
+
- Do NOT recreate or overwrite anything
|
|
31
|
+
- Stop here
|
|
32
|
+
|
|
33
|
+
**If `.specs/` does not exist:** proceed to Step 2.
|
|
34
|
+
|
|
35
|
+
### Step 2: Create Directory Structure
|
|
36
|
+
|
|
37
|
+
Create the `.specs/` directory at the project root.
|
|
38
|
+
|
|
39
|
+
### Step 3: Create ROADMAP.md
|
|
40
|
+
|
|
41
|
+
Write `.specs/ROADMAP.md` using the template from `references/roadmap-template.md`.
|
|
42
|
+
|
|
43
|
+
### Step 4: Create BACKLOG.md
|
|
44
|
+
|
|
45
|
+
Write `.specs/BACKLOG.md` using the template from `references/backlog-template.md`.
|
|
46
|
+
|
|
47
|
+
### Step 5: Retroactive Documentation
|
|
48
|
+
|
|
49
|
+
Ask the user:
|
|
50
|
+
|
|
51
|
+
> "Are there existing features in this project that should be documented retroactively? I can help create specs for them using `/spec-new`."
|
|
52
|
+
|
|
53
|
+
If yes, guide the user through creating a spec for each feature using `/spec-new`.
|
|
54
|
+
|
|
55
|
+
If no, proceed to Step 6.
|
|
56
|
+
|
|
57
|
+
### Step 6: Report
|
|
58
|
+
|
|
59
|
+
Summarize what was created:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
## Spec Directory Initialized
|
|
63
|
+
|
|
64
|
+
Created:
|
|
65
|
+
- `.specs/` directory
|
|
66
|
+
- `.specs/ROADMAP.md` — version tracking table
|
|
67
|
+
- `.specs/BACKLOG.md` — deferred items list
|
|
68
|
+
|
|
69
|
+
Next steps:
|
|
70
|
+
- Use `/spec-new <feature-name> <version>` to create your first feature spec
|
|
71
|
+
- Use `/spec-check` to audit spec health at any time
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Hard Constraints
|
|
77
|
+
|
|
78
|
+
- **Never overwrite** an existing `.specs/` directory or its contents.
|
|
79
|
+
- **ROADMAP.md** must stay under 30 lines (it's a summary, not a plan document).
|
|
80
|
+
- **BACKLOG.md** must stay under 15 lines (it grows as items are added).
|
|
81
|
+
- Templates are starting points — the user will extend them.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Ambiguity Policy
|
|
86
|
+
|
|
87
|
+
- If the user runs this in a workspace root with multiple projects, ask which project to initialize.
|
|
88
|
+
- If `.specs/` exists but is missing ROADMAP.md or BACKLOG.md, offer to create only the missing files.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Reference Files
|
|
93
|
+
|
|
94
|
+
| File | Contents |
|
|
95
|
+
|------|----------|
|
|
96
|
+
| `references/roadmap-template.md` | Starter ROADMAP with version table format |
|
|
97
|
+
| `references/backlog-template.md` | Starter BACKLOG with item format |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
What each version delivers and why.
|
|
4
|
+
|
|
5
|
+
| Version | Status | Summary |
|
|
6
|
+
|---------|--------|---------|
|
|
7
|
+
| v0.1.0 | planned | [Initial release — describe core features] |
|
|
8
|
+
|
|
9
|
+
## Versioning
|
|
10
|
+
|
|
11
|
+
- **Major**: Breaking changes to public APIs or data models
|
|
12
|
+
- **Minor**: New features, non-breaking changes
|
|
13
|
+
- **Patch**: Bug fixes, documentation, internal refactors
|
package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/SKILL.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-new
|
|
3
|
+
description: >-
|
|
4
|
+
This skill should be used when the user asks to "create a spec",
|
|
5
|
+
"new feature spec", "write a spec for", "spec this feature",
|
|
6
|
+
"start a new spec", "plan a feature", or needs to create a new
|
|
7
|
+
specification file from the standard template.
|
|
8
|
+
version: 0.1.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Create New Feature Specification
|
|
12
|
+
|
|
13
|
+
## Mental Model
|
|
14
|
+
|
|
15
|
+
A specification is a contract between the person requesting a feature and the person building it. Writing the spec BEFORE implementation forces you to think through edge cases, acceptance criteria, and scope boundaries while changes are cheap — before any code exists.
|
|
16
|
+
|
|
17
|
+
Every project uses `.specs/` as the specification directory. Specs are version-organized, independently loadable, and capped at 200 lines.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Step 1: Parse Arguments
|
|
24
|
+
|
|
25
|
+
Extract the feature name and version from `$ARGUMENTS`:
|
|
26
|
+
- **Feature name**: kebab-case identifier (e.g., `session-history`, `auth-flow`)
|
|
27
|
+
- **Version**: semver string (e.g., `v0.3.0`)
|
|
28
|
+
|
|
29
|
+
If arguments are missing, ask the user for:
|
|
30
|
+
1. Feature name (what is being built)
|
|
31
|
+
2. Target version (which release this belongs to)
|
|
32
|
+
|
|
33
|
+
### Step 2: Determine File Path
|
|
34
|
+
|
|
35
|
+
- **Multi-feature version** (directory already exists or multiple features planned):
|
|
36
|
+
`.specs/{version}/{feature-name}.md`
|
|
37
|
+
- **Single-feature version** (one spec covers the whole version):
|
|
38
|
+
`.specs/{version}.md`
|
|
39
|
+
|
|
40
|
+
If `.specs/` does not exist at the project root, create it.
|
|
41
|
+
|
|
42
|
+
If `.specs/{version}/` does not exist and you're using the directory form, create it.
|
|
43
|
+
|
|
44
|
+
### Step 3: Create the Spec File
|
|
45
|
+
|
|
46
|
+
Write the file using the standard template from `references/template.md`.
|
|
47
|
+
|
|
48
|
+
Pre-fill:
|
|
49
|
+
- **Version**: from arguments
|
|
50
|
+
- **Status**: `planned`
|
|
51
|
+
- **Last Updated**: today's date (YYYY-MM-DD)
|
|
52
|
+
- **Feature name**: from arguments
|
|
53
|
+
|
|
54
|
+
Leave all other sections as placeholders for the user to fill.
|
|
55
|
+
|
|
56
|
+
### Step 4: Guide Content Creation
|
|
57
|
+
|
|
58
|
+
After creating the file, guide the user through filling it out:
|
|
59
|
+
|
|
60
|
+
1. **Intent** — What problem does this solve? Who has this problem? (2-3 sentences)
|
|
61
|
+
2. **Acceptance Criteria** — Use the `specification-writing` skill for EARS format and Given/When/Then patterns
|
|
62
|
+
3. **Key Files** — Glob the codebase to identify existing files relevant to this feature
|
|
63
|
+
4. **Schema / Data Model** — Reference file paths only, never inline schemas
|
|
64
|
+
5. **API Endpoints** — Table format: Method | Path | Description
|
|
65
|
+
6. **Requirements** — EARS format, numbered FR-1, FR-2, NFR-1, etc.
|
|
66
|
+
7. **Dependencies** — What this feature depends on
|
|
67
|
+
8. **Out of Scope** — Explicit non-goals to prevent scope creep
|
|
68
|
+
|
|
69
|
+
### Step 5: Validate
|
|
70
|
+
|
|
71
|
+
Before finishing:
|
|
72
|
+
- [ ] File is ≤200 lines
|
|
73
|
+
- [ ] No source code, SQL, or type definitions reproduced inline
|
|
74
|
+
- [ ] Status is `planned`
|
|
75
|
+
- [ ] All required sections present (even if some are "N/A" or "TBD")
|
|
76
|
+
- [ ] Acceptance criteria are testable
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Hard Constraints
|
|
81
|
+
|
|
82
|
+
- **≤200 lines per spec.** If a feature needs more, split into sub-specs with a parent `_overview.md` (≤50 lines) linking them.
|
|
83
|
+
- **Reference, don't reproduce.** Write `see src/engine/db/migrations/002.sql lines 48-70` — never paste the SQL.
|
|
84
|
+
- **Independently loadable.** Each spec file must be useful without loading any other file.
|
|
85
|
+
- **EARS format for requirements.** Use the `specification-writing` skill for templates and examples.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Ambiguity Policy
|
|
90
|
+
|
|
91
|
+
- If the user doesn't specify a version, ask — do not assume.
|
|
92
|
+
- If the feature scope is unclear, write a minimal spec with `## Open Questions` listing what needs clarification.
|
|
93
|
+
- If a spec already exists for this feature, inform the user and suggest `/spec-update` instead.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Reference Files
|
|
98
|
+
|
|
99
|
+
| File | Contents |
|
|
100
|
+
|------|----------|
|
|
101
|
+
| `references/template.md` | Full standard template with field descriptions and examples |
|