codeforge-dev 1.9.0 → 1.11.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 +3 -0
- package/.devcontainer/CHANGELOG.md +125 -0
- package/.devcontainer/CLAUDE.md +41 -11
- package/.devcontainer/README.md +73 -3
- package/.devcontainer/config/defaults/main-system-prompt.md +187 -201
- package/.devcontainer/config/defaults/rules/session-search.md +66 -0
- package/.devcontainer/config/defaults/rules/spec-workflow.md +48 -13
- package/.devcontainer/config/defaults/settings.json +2 -1
- package/.devcontainer/config/defaults/writing-system-prompt.md +143 -0
- package/.devcontainer/config/file-manifest.json +12 -0
- package/.devcontainer/connect-external-terminal.sh +17 -17
- package/.devcontainer/devcontainer.json +150 -144
- package/.devcontainer/features/ccms/README.md +50 -0
- package/.devcontainer/features/ccms/devcontainer-feature.json +21 -0
- package/.devcontainer/features/ccms/install.sh +105 -0
- package/.devcontainer/features/ccstatusline/install.sh +24 -2
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +8 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/architect.md +5 -3
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/claude-guide.md +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/doc-writer.md +7 -7
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/generalist.md +1 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/spec-writer.md +22 -12
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/hooks/hooks.json +11 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/skill-suggester.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/advisory-test-runner.py +186 -13
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/git-state-injector.py +15 -4
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/inject-cwd.py +37 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/skill-suggester.py +24 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/spec-reminder.py +4 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/SKILL.md +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-build/SKILL.md +353 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-build/references/review-checklist.md +175 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-check/SKILL.md +28 -15
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/SKILL.md +16 -13
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/backlog-template.md +19 -3
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/milestones-template.md +32 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/SKILL.md +28 -20
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-new/references/template.md +35 -6
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-refine/SKILL.md +194 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-review/SKILL.md +229 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-update/SKILL.md +24 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/SKILL.md +20 -13
- package/.devcontainer/plugins/devs-marketplace/plugins/codeforge-lsp/.claude-plugin/plugin.json +38 -5
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/.claude-plugin/plugin.json +7 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/hooks/hooks.json +17 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/scripts/__pycache__/guard-workspace-scope.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workspace-scope-guard/scripts/guard-workspace-scope.py +132 -0
- package/.devcontainer/scripts/check-setup.sh +24 -25
- package/.devcontainer/scripts/setup-aliases.sh +95 -90
- package/.devcontainer/scripts/setup-projects.sh +172 -131
- package/.devcontainer/scripts/setup-terminal.sh +48 -0
- package/.devcontainer/scripts/setup-update-claude.sh +49 -107
- package/.devcontainer/scripts/setup.sh +4 -17
- package/README.md +2 -2
- package/package.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/spec-init/references/roadmap-template.md +0 -13
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# ccms - Claude Code Message Searcher
|
|
2
|
+
|
|
3
|
+
Installs [ccms](https://github.com/mkusaka/ccms), a high-performance CLI for searching Claude Code session JSONL files.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- SIMD-accelerated JSON parsing with parallel file processing
|
|
8
|
+
- Boolean query syntax: AND, OR, NOT, regex, quoted literals
|
|
9
|
+
- Filter by role (user/assistant/system), session ID, timestamp ranges, project paths
|
|
10
|
+
- Interactive fzf-like TUI mode (when run without arguments)
|
|
11
|
+
- Multiple output formats: text, JSON, JSONL
|
|
12
|
+
- Shell completion for bash, zsh, fish
|
|
13
|
+
|
|
14
|
+
## Options
|
|
15
|
+
|
|
16
|
+
| Option | Type | Default | Description |
|
|
17
|
+
|--------|------|---------|-------------|
|
|
18
|
+
| `version` | string | `latest` | `latest` builds from main, `none` skips, or a git commit hash |
|
|
19
|
+
| `username` | string | `automatic` | Container user to install for |
|
|
20
|
+
|
|
21
|
+
## Dependencies
|
|
22
|
+
|
|
23
|
+
Requires the Rust devcontainer feature:
|
|
24
|
+
```json
|
|
25
|
+
"ghcr.io/devcontainers/features/rust:1": {}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Search current project (recommended)
|
|
32
|
+
ccms --project $(pwd) "query"
|
|
33
|
+
|
|
34
|
+
# Filter by who said it
|
|
35
|
+
ccms -r assistant "architecture decision"
|
|
36
|
+
ccms -r user "auth approach"
|
|
37
|
+
|
|
38
|
+
# Boolean queries
|
|
39
|
+
ccms "error AND connection"
|
|
40
|
+
ccms "(auth OR authentication) AND NOT test"
|
|
41
|
+
|
|
42
|
+
# Time-scoped
|
|
43
|
+
ccms --since "1 day ago" "recent work"
|
|
44
|
+
|
|
45
|
+
# JSON output for scripting
|
|
46
|
+
ccms -f json "query" -n 10
|
|
47
|
+
|
|
48
|
+
# Interactive TUI
|
|
49
|
+
ccms
|
|
50
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "ccms",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"name": "ccms - Claude Code Message Searcher",
|
|
5
|
+
"description": "Installs ccms CLI for searching Claude Code session JSONL files with boolean queries, role filtering, and JSON output",
|
|
6
|
+
"maintainer": "AnExiledDev",
|
|
7
|
+
"documentationURL": "https://github.com/mkusaka/ccms",
|
|
8
|
+
"options": {
|
|
9
|
+
"version": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "ccms version to install ('latest' builds from main, 'none' skips installation, or a git ref/commit hash)",
|
|
12
|
+
"default": "latest"
|
|
13
|
+
},
|
|
14
|
+
"username": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Container user to install for",
|
|
17
|
+
"default": "automatic"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"installsAfter": ["ghcr.io/devcontainers/features/rust:1"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# === SETUP ===
|
|
5
|
+
cleanup() {
|
|
6
|
+
:
|
|
7
|
+
}
|
|
8
|
+
trap cleanup EXIT
|
|
9
|
+
|
|
10
|
+
# === IMPORT OPTIONS ===
|
|
11
|
+
CCMS_VERSION="${VERSION:-latest}"
|
|
12
|
+
USERNAME="${USERNAME:-automatic}"
|
|
13
|
+
|
|
14
|
+
# Skip installation if version is "none"
|
|
15
|
+
if [ "${CCMS_VERSION}" = "none" ]; then
|
|
16
|
+
echo "[ccms] Skipping installation (version=none)"
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
echo "[ccms] Starting ccms installation..."
|
|
21
|
+
|
|
22
|
+
# === VALIDATE DEPENDENCIES ===
|
|
23
|
+
# Source cargo env if available (Rust feature installs via rustup)
|
|
24
|
+
if [ -f /usr/local/cargo/env ]; then
|
|
25
|
+
source /usr/local/cargo/env
|
|
26
|
+
elif [ -f "${HOME}/.cargo/env" ]; then
|
|
27
|
+
source "${HOME}/.cargo/env"
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if ! command -v cargo &>/dev/null; then
|
|
31
|
+
echo "[ccms] ERROR: cargo is not available"
|
|
32
|
+
echo " Ensure the Rust devcontainer feature is installed first:"
|
|
33
|
+
echo " \"ghcr.io/devcontainers/features/rust:1\": {}"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
echo "[ccms] Using cargo: $(cargo --version)"
|
|
38
|
+
|
|
39
|
+
# === DETECT USER ===
|
|
40
|
+
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
|
|
41
|
+
USERNAME=""
|
|
42
|
+
for CURRENT_USER in vscode node codespace; do
|
|
43
|
+
if id -u "${CURRENT_USER}" >/dev/null 2>&1; then
|
|
44
|
+
USERNAME=${CURRENT_USER}
|
|
45
|
+
break
|
|
46
|
+
fi
|
|
47
|
+
done
|
|
48
|
+
[ -z "${USERNAME}" ] && USERNAME=root
|
|
49
|
+
elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then
|
|
50
|
+
USERNAME=root
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
echo "[ccms] Installing for user: ${USERNAME}"
|
|
54
|
+
|
|
55
|
+
# === INSTALL ===
|
|
56
|
+
REPO_URL="https://github.com/mkusaka/ccms"
|
|
57
|
+
|
|
58
|
+
if [ "${CCMS_VERSION}" = "latest" ]; then
|
|
59
|
+
echo "[ccms] Building from main branch..."
|
|
60
|
+
cargo install --git "${REPO_URL}" 2>&1 | tail -5
|
|
61
|
+
else
|
|
62
|
+
echo "[ccms] Building from ref: ${CCMS_VERSION}..."
|
|
63
|
+
cargo install --git "${REPO_URL}" --rev "${CCMS_VERSION}" 2>&1 | tail -5
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# === ENSURE BINARY IS ON PATH ===
|
|
67
|
+
# cargo install puts binaries in $CARGO_HOME/bin or ~/.cargo/bin
|
|
68
|
+
# Symlink to /usr/local/bin so it's available to all users
|
|
69
|
+
CARGO_BIN="${CARGO_HOME:-$HOME/.cargo}/bin/ccms"
|
|
70
|
+
if [ -f "${CARGO_BIN}" ] && [ ! -f /usr/local/bin/ccms ]; then
|
|
71
|
+
ln -s "${CARGO_BIN}" /usr/local/bin/ccms
|
|
72
|
+
echo "[ccms] Symlinked ${CARGO_BIN} → /usr/local/bin/ccms"
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
# === VERIFICATION ===
|
|
76
|
+
echo "[ccms] Verifying installation..."
|
|
77
|
+
if command -v ccms &>/dev/null; then
|
|
78
|
+
INSTALLED_VERSION=$(ccms --version 2>/dev/null || echo "unknown")
|
|
79
|
+
echo "[ccms] ✓ ccms installed: ${INSTALLED_VERSION}"
|
|
80
|
+
else
|
|
81
|
+
echo "[ccms] WARNING: ccms not found on PATH after installation"
|
|
82
|
+
echo " Binary location: ${CARGO_BIN}"
|
|
83
|
+
echo " You may need to add cargo bin to PATH"
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# === SUMMARY ===
|
|
87
|
+
echo ""
|
|
88
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
89
|
+
echo " ccms Installation Complete"
|
|
90
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
91
|
+
echo ""
|
|
92
|
+
echo "Configuration:"
|
|
93
|
+
echo " • User: ${USERNAME}"
|
|
94
|
+
echo " • Version: ${CCMS_VERSION}"
|
|
95
|
+
echo " • Binary: $(which ccms 2>/dev/null || echo "${CARGO_BIN}")"
|
|
96
|
+
echo ""
|
|
97
|
+
echo "Usage:"
|
|
98
|
+
echo " ccms \"query\" # Search all sessions"
|
|
99
|
+
echo " ccms --project \$(pwd) \"query\" # Search current project"
|
|
100
|
+
echo " ccms -r user \"query\" # Filter by role"
|
|
101
|
+
echo " ccms -f json \"query\" -n 10 # JSON output, limited"
|
|
102
|
+
echo " ccms --since \"1 day ago\" \"q\" # Time-scoped search"
|
|
103
|
+
echo " ccms # Interactive TUI mode"
|
|
104
|
+
echo ""
|
|
105
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
@@ -100,6 +100,9 @@ CONFIG_JSON=$(jq -n '{
|
|
|
100
100
|
[
|
|
101
101
|
{id: "cc-resume-session", type: "custom-command", commandPath: "/usr/local/bin/ccstatusline-session-resume", timeout: 500, preserveColors: false, maxWidth: 50, color: "cyan", backgroundColor: "bgBrightBlack"}
|
|
102
102
|
],
|
|
103
|
+
[
|
|
104
|
+
{id: "cc-cwd", type: "custom-command", commandPath: "/usr/local/bin/ccstatusline-cwd", timeout: 500, preserveColors: false, maxWidth: 40, color: "brightWhite", backgroundColor: "bgBrightBlack"}
|
|
105
|
+
],
|
|
103
106
|
[
|
|
104
107
|
{id: "ccburn-compact", type: "custom-command", commandPath: "/usr/local/bin/ccburn-statusline", timeout: 8000, preserveColors: true, maxWidth: 80, color: "green", backgroundColor: "bgBlack"}
|
|
105
108
|
]
|
|
@@ -181,6 +184,24 @@ SESSION_EOF
|
|
|
181
184
|
chmod +x /usr/local/bin/ccstatusline-session-resume
|
|
182
185
|
echo "[ccstatusline] ✓ Session resume helper installed at /usr/local/bin/ccstatusline-session-resume"
|
|
183
186
|
|
|
187
|
+
# Create CWD helper script for custom-command widget
|
|
188
|
+
# Reads Claude Code JSON from stdin, outputs the last path segment of cwd
|
|
189
|
+
echo "[ccstatusline] Creating CWD helper..."
|
|
190
|
+
cat > /usr/local/bin/ccstatusline-cwd <<'CWD_EOF'
|
|
191
|
+
#!/bin/bash
|
|
192
|
+
# Reads Claude Code JSON from stdin, outputs basename of cwd
|
|
193
|
+
# Used by ccstatusline custom-command widget
|
|
194
|
+
CWD=$(jq -r '.cwd // empty' 2>/dev/null)
|
|
195
|
+
if [ -n "$CWD" ]; then
|
|
196
|
+
basename "$CWD"
|
|
197
|
+
else
|
|
198
|
+
echo "..."
|
|
199
|
+
fi
|
|
200
|
+
CWD_EOF
|
|
201
|
+
|
|
202
|
+
chmod +x /usr/local/bin/ccstatusline-cwd
|
|
203
|
+
echo "[ccstatusline] ✓ CWD helper installed at /usr/local/bin/ccstatusline-cwd"
|
|
204
|
+
|
|
184
205
|
# Create wrapper script to protect configuration
|
|
185
206
|
echo "[ccstatusline] Creating wrapper script..."
|
|
186
207
|
cat > /usr/local/bin/ccstatusline-wrapper <<'WRAPPER_EOF'
|
|
@@ -302,7 +323,7 @@ echo ""
|
|
|
302
323
|
echo "Configuration:"
|
|
303
324
|
echo " • Config file: ${CONFIG_FILE}"
|
|
304
325
|
echo " • User: ${USERNAME}"
|
|
305
|
-
echo " • Theme: Powerline (
|
|
326
|
+
echo " • Theme: Powerline (8 lines, 17 widgets, ANSI colors)"
|
|
306
327
|
echo " • Protected by: /usr/local/bin/ccstatusline-wrapper"
|
|
307
328
|
echo ""
|
|
308
329
|
echo "Display:"
|
|
@@ -312,7 +333,8 @@ echo " Line 3: Git Branch | Git Changes | Git Worktree"
|
|
|
312
333
|
echo " Line 4: Session Clock | Session Cost | Block Timer"
|
|
313
334
|
echo " Line 5: Tokens Total | Version"
|
|
314
335
|
echo " Line 6: Session ID"
|
|
315
|
-
echo " Line 7:
|
|
336
|
+
echo " Line 7: Working Directory"
|
|
337
|
+
echo " Line 8: Burn Rate (ccburn compact)"
|
|
316
338
|
echo ""
|
|
317
339
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
318
340
|
echo " Next Steps"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
"name": "code-directive",
|
|
93
|
-
"description": "17 custom agents,
|
|
93
|
+
"description": "17 custom agents, 28 coding skills, agent redirection, syntax validation, and skill auto-suggestion",
|
|
94
94
|
"version": "1.0.0",
|
|
95
95
|
"source": "./plugins/code-directive",
|
|
96
96
|
"category": "development"
|
|
@@ -101,6 +101,13 @@
|
|
|
101
101
|
"version": "1.0.0",
|
|
102
102
|
"source": "./plugins/auto-code-quality",
|
|
103
103
|
"category": "development"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "workspace-scope-guard",
|
|
107
|
+
"description": "Enforces working directory scope — blocks writes and warns on reads outside the project",
|
|
108
|
+
"version": "1.0.0",
|
|
109
|
+
"source": "./plugins/workspace-scope-guard",
|
|
110
|
+
"category": "safety"
|
|
104
111
|
}
|
|
105
112
|
]
|
|
106
113
|
}
|
|
@@ -18,6 +18,7 @@ skills:
|
|
|
18
18
|
- spec-new
|
|
19
19
|
- spec-update
|
|
20
20
|
- spec-init
|
|
21
|
+
- spec-review
|
|
21
22
|
hooks:
|
|
22
23
|
PreToolUse:
|
|
23
24
|
- matcher: Bash
|
|
@@ -171,8 +172,9 @@ Based on your exploration:
|
|
|
171
172
|
or update. Distinguish:
|
|
172
173
|
- **Roadmap entry**: one-line description of what the version delivers (no
|
|
173
174
|
implementation detail — that belongs in specs)
|
|
174
|
-
- **Feature spec**:
|
|
175
|
-
Status, Intent, Acceptance Criteria, Key Files, Schema, API, Dependencies)
|
|
175
|
+
- **Feature spec**: file following the standard template (Version,
|
|
176
|
+
Status, Intent, Acceptance Criteria, Key Files, Schema, API, Dependencies).
|
|
177
|
+
Aim for ~200 lines; split into sub-specs if significantly longer.
|
|
176
178
|
- **As-built update**: if modifying an existing feature, identify which spec
|
|
177
179
|
to update post-implementation
|
|
178
180
|
Plans that mix roadmap-level and spec-level detail produce artifacts too
|
|
@@ -239,7 +241,7 @@ List the 3-7 files most critical for implementing this plan:
|
|
|
239
241
|
- `/path/to/test_file.py` — Brief reason (e.g., "Test patterns to follow")
|
|
240
242
|
|
|
241
243
|
### Documentation Outputs
|
|
242
|
-
- New spec: `.specs/vX.Y.0/feature-name.md`
|
|
244
|
+
- New spec: `.specs/vX.Y.0/feature-name.md`
|
|
243
245
|
- Updated spec: `.specs/vX.Y.0/existing-feature.md` — changes: [list]
|
|
244
246
|
- Roadmap update: `.specs/roadmap.md` — add `[ ] feature` to vX.Y.0
|
|
245
247
|
|
package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/claude-guide.md
CHANGED
|
@@ -66,7 +66,7 @@ Direct model interaction via the Claude API (formerly Anthropic API). Covers Mes
|
|
|
66
66
|
# Project-level configuration (relative to workspace root)
|
|
67
67
|
.claude/settings.json # Active settings
|
|
68
68
|
.claude/keybindings.json # Active keybindings
|
|
69
|
-
.claude/system-prompt.md
|
|
69
|
+
.claude/main-system-prompt.md # Active system prompt
|
|
70
70
|
CLAUDE.md # Project instructions
|
|
71
71
|
|
|
72
72
|
# DevContainer configuration
|
|
@@ -160,9 +160,9 @@ For large codebases, focus on the public API surface rather than trying to docum
|
|
|
160
160
|
|
|
161
161
|
Produce documentation that serves the target audience. Different doc types have different readers.
|
|
162
162
|
|
|
163
|
-
**Sizing
|
|
164
|
-
should
|
|
165
|
-
independently useful without requiring other docs in the same context window.
|
|
163
|
+
**Sizing guideline:** Documentation files consumed by AI (CLAUDE.md, specs, architecture docs)
|
|
164
|
+
should aim for ~200 lines each. Split large documents by concern when practical. Each file
|
|
165
|
+
should be independently useful without requiring other docs in the same context window.
|
|
166
166
|
|
|
167
167
|
## Documentation Types
|
|
168
168
|
|
|
@@ -267,10 +267,10 @@ Follow these principles in all documentation:
|
|
|
267
267
|
- **Architecture docs requested**: Trace the system's component boundaries, data flows, and key decisions. Produce a document that would onboard a new developer effectively.
|
|
268
268
|
- **No specific request**: Ask the user what documentation they need. If they point to a file or module, offer to add inline documentation to its public API.
|
|
269
269
|
- **Behavior unclear**: If you read a function and cannot determine its exact behavior, document what you can verify and add a `TODO: verify — [specific question]` annotation so a human can fill in the gap.
|
|
270
|
-
- **
|
|
271
|
-
for the
|
|
272
|
-
into
|
|
273
|
-
don't accumulate snapshot documents. Update the relevant
|
|
270
|
+
- **Milestone ships** (e.g., "consolidate milestone docs"): Read all build-time artifacts
|
|
271
|
+
for the milestone (architecture docs, decision records, phase plans). Consolidate
|
|
272
|
+
into as-built specs. Delete or merge superseded planning artifacts —
|
|
273
|
+
don't accumulate snapshot documents. Update the relevant specs in place.
|
|
274
274
|
- **Always report** what was documented, what was verified versus assumed, and what needs human review.
|
|
275
275
|
|
|
276
276
|
## Output Format
|
|
@@ -20,6 +20,8 @@ skills:
|
|
|
20
20
|
- spec-update
|
|
21
21
|
- spec-check
|
|
22
22
|
- spec-init
|
|
23
|
+
- spec-refine
|
|
24
|
+
- spec-review
|
|
23
25
|
---
|
|
24
26
|
|
|
25
27
|
# Spec Writer Agent
|
|
@@ -57,10 +59,13 @@ When uncertain, investigate first — read the code, check the docs — rather t
|
|
|
57
59
|
- **NEVER** make assumptions about behavior without checking the codebase. Use `Read`, `Glob`, and `Grep` to understand the current system before specifying changes.
|
|
58
60
|
- **NEVER** write vague requirements like "the system should be fast" or "the UI should be user-friendly." Every requirement must be specific, measurable, and testable.
|
|
59
61
|
- **NEVER** combine multiple independent requirements into a single statement. One requirement per line — this makes requirements individually testable and trackable.
|
|
60
|
-
- **NEVER**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
- **NEVER** present decisions as settled facts unless the user explicitly approved them. Tech choices, architecture decisions, scope boundaries, performance targets, and behavioral defaults that you chose without user input MUST go in `## Open Questions` with options and trade-offs — not in Requirements as decided items.
|
|
63
|
+
- **ALL** requirements you generate MUST be tagged `[assumed]`. You never produce `[user-approved]` requirements — only `/spec-refine` does that after explicit user validation.
|
|
64
|
+
- **ALL** specs you produce MUST carry `**Approval:** draft`. After presenting a draft, state: "This spec requires `/spec-refine` before implementation can begin. All requirements are marked [assumed] until user-approved."
|
|
65
|
+
- **Aim for ~200 lines per spec.** When a spec grows beyond that, recommend
|
|
66
|
+
splitting into separate specs in the domain folder. Shorter specs are
|
|
67
|
+
easier to consume and maintain, but complex features sometimes need more
|
|
68
|
+
space — don't sacrifice completeness for an arbitrary cap.
|
|
64
69
|
- **NEVER** reproduce source code, SQL schemas, or type definitions inline.
|
|
65
70
|
Reference file paths instead (e.g., "see `src/engine/db/migrations/002.sql`
|
|
66
71
|
lines 48-70"). The code is the source of truth; duplicated snippets go stale.
|
|
@@ -116,9 +121,10 @@ Write the specification using the formats below.
|
|
|
116
121
|
3. **Write acceptance criteria** — Given/When/Then scenarios that define "done."
|
|
117
122
|
4. **Define non-functional requirements** — Performance, security, accessibility where relevant.
|
|
118
123
|
5. **List open questions** — Any unresolved decisions or unknowns that need stakeholder input.
|
|
119
|
-
6. **Check length** —
|
|
120
|
-
|
|
121
|
-
|
|
124
|
+
6. **Check length** — If the draft exceeds ~200 lines, consider whether it
|
|
125
|
+
would be clearer as separate specs in the domain folder. Each spec
|
|
126
|
+
should be independently loadable. If the length is justified by
|
|
127
|
+
complexity, note it and proceed.
|
|
122
128
|
7. **Reference, don't reproduce** — Scan your draft for inline code blocks
|
|
123
129
|
containing schemas, SQL, type definitions, or configuration. Replace with
|
|
124
130
|
file path references and brief descriptions of what's there.
|
|
@@ -232,9 +238,10 @@ Present specifications in this structure:
|
|
|
232
238
|
|
|
233
239
|
```markdown
|
|
234
240
|
# Feature: [Name]
|
|
235
|
-
**
|
|
241
|
+
**Domain:** [domain-name]
|
|
236
242
|
**Status:** planned
|
|
237
243
|
**Last Updated:** YYYY-MM-DD
|
|
244
|
+
**Approval:** draft
|
|
238
245
|
|
|
239
246
|
## Intent
|
|
240
247
|
[Problem statement + why — what exists now, what should change, who is affected]
|
|
@@ -258,18 +265,21 @@ Present specifications in this structure:
|
|
|
258
265
|
## Requirements
|
|
259
266
|
|
|
260
267
|
### Functional Requirements
|
|
261
|
-
FR-1: [EARS requirement]
|
|
262
|
-
FR-2: [EARS requirement]
|
|
268
|
+
FR-1 [assumed]: [EARS requirement]
|
|
269
|
+
FR-2 [assumed]: [EARS requirement]
|
|
263
270
|
...
|
|
264
271
|
|
|
265
272
|
### Non-Functional Requirements
|
|
266
|
-
NFR-1: [EARS requirement]
|
|
267
|
-
NFR-2: [EARS requirement]
|
|
273
|
+
NFR-1 [assumed]: [EARS requirement]
|
|
274
|
+
NFR-2 [assumed]: [EARS requirement]
|
|
268
275
|
...
|
|
269
276
|
|
|
270
277
|
## Dependencies
|
|
271
278
|
- [External system or module this feature depends on]
|
|
272
279
|
|
|
280
|
+
## Resolved Questions
|
|
281
|
+
[Populated by `/spec-refine`. Decisions explicitly approved by the user.]
|
|
282
|
+
|
|
273
283
|
## Open Questions
|
|
274
284
|
[Group related unknowns. For each question, provide:]
|
|
275
285
|
1. [Question] — **Type**: missing info / ambiguous behavior / policy decision
|
|
@@ -40,6 +40,16 @@
|
|
|
40
40
|
"timeout": 3
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"matcher": "",
|
|
46
|
+
"hooks": [
|
|
47
|
+
{
|
|
48
|
+
"type": "command",
|
|
49
|
+
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/inject-cwd.py",
|
|
50
|
+
"timeout": 3
|
|
51
|
+
}
|
|
52
|
+
]
|
|
43
53
|
}
|
|
44
54
|
],
|
|
45
55
|
"Stop": [
|
|
@@ -49,7 +59,7 @@
|
|
|
49
59
|
{
|
|
50
60
|
"type": "command",
|
|
51
61
|
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/advisory-test-runner.py",
|
|
52
|
-
"timeout":
|
|
62
|
+
"timeout": 20
|
|
53
63
|
},
|
|
54
64
|
{
|
|
55
65
|
"type": "command",
|