Skip to content

Commit c802c02

Browse files
InfantLabclaude
andcommitted
chore: update speckit tooling, Claude commands, and agent instructions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fc8fff6 commit c802c02

28 files changed

+2341
-173
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
2+
3+
## User Input
4+
5+
```text
6+
$ARGUMENTS
7+
```
8+
9+
You **MUST** consider the user input before proceeding (if not empty).
10+
11+
## Outline
12+
13+
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
14+
15+
This clarification workflow runs BEFORE `/speckit-plan`. If the user explicitly states they are skipping clarification, warn that downstream rework risk increases.
16+
17+
1. Run the prerequisites script from repo root once:
18+
```bash
19+
bash .specify/scripts/bash/check-prerequisites.sh --json --paths-only
20+
```
21+
Parse: `FEATURE_DIR`, `FEATURE_SPEC`. If JSON parsing fails, abort and instruct user to re-run `/speckit-specify`.
22+
23+
2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy (mark each: Clear / Partial / Missing):
24+
25+
- Functional Scope & Behavior (core goals, out-of-scope, user roles)
26+
- Domain & Data Model (entities, attributes, relationships, lifecycle, scale)
27+
- Interaction & UX Flow (critical journeys, error/empty/loading states, accessibility)
28+
- Non-Functional Quality Attributes (performance, scalability, reliability, observability, security, compliance)
29+
- Integration & External Dependencies (services/APIs, failure modes, formats)
30+
- Edge Cases & Failure Handling (negative scenarios, rate limiting, conflicts)
31+
- Constraints & Tradeoffs (technical constraints, rejected alternatives)
32+
- Terminology & Consistency (canonical terms, avoided synonyms)
33+
- Completion Signals (acceptance criteria testability, Definition of Done)
34+
- Misc / Placeholders (TODOs, vague adjectives lacking quantification)
35+
36+
3. Generate a prioritized queue of max 5 clarification questions. Each must be answerable with multiple-choice (2-5 options) or short answer (<=5 words). Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX, operational readiness, or compliance.
37+
38+
4. **Sequential questioning** — present ONE question at a time:
39+
- For multiple-choice: Present **Recommended** option prominently with reasoning, then all options as a table. User can reply with letter, "yes"/"recommended", or own answer.
40+
- For short-answer: Present **Suggested** answer with reasoning. User can accept or provide own.
41+
- Stop when: all critical ambiguities resolved, user signals "done", or 5 questions asked.
42+
43+
5. **After EACH accepted answer**, update the spec:
44+
- Ensure `## Clarifications` section exists (create after overview if missing)
45+
- Add `### Session YYYY-MM-DD` subheading
46+
- Append bullet: `- Q: <question> → A: <answer>`
47+
- Apply clarification to the appropriate spec section(s)
48+
- Save the spec file after each integration
49+
50+
6. Validate after each write: no duplicates, no contradictions, no lingering placeholders, consistent terminology.
51+
52+
7. Report completion: questions asked/answered, path to updated spec, sections touched, coverage summary table (Resolved/Deferred/Clear/Outstanding), suggested next command.
53+
54+
If no meaningful ambiguities found, respond: "No critical ambiguities detected" and suggest proceeding to `/speckit-plan`.
55+
56+
Context for prioritization: $ARGUMENTS
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
2+
3+
## User Input
4+
5+
```text
6+
$ARGUMENTS
7+
```
8+
9+
You **MUST** consider the user input before proceeding (if not empty).
10+
11+
## Pre-Execution Checks
12+
13+
Check if `.specify/extensions.yml` exists. If so, check `hooks.before_implement` for enabled hooks. Execute mandatory hooks; display optional hooks.
14+
15+
## Outline
16+
17+
1. **Setup**: Run from repo root:
18+
```bash
19+
bash .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks
20+
```
21+
Parse FEATURE_DIR and AVAILABLE_DOCS.
22+
23+
2. **Check checklists** (if FEATURE_DIR/checklists/ exists):
24+
- Count total/completed/incomplete items per checklist
25+
- If incomplete: STOP and ask user to proceed or halt
26+
- If all complete: proceed automatically
27+
28+
3. **Load context**: tasks.md (required), plan.md (required), plus data-model.md, contracts/, research.md, quickstart.md if they exist.
29+
30+
4. **Project setup verification**: Create/verify ignore files (.gitignore, .dockerignore, etc.) based on detected tech stack.
31+
32+
5. **Parse tasks.md**: Extract phases, dependencies, parallel markers.
33+
34+
6. **Execute phase-by-phase**:
35+
- Complete each phase before moving to next
36+
- Respect sequential dependencies; run parallel [P] tasks together
37+
- Follow TDD if tests exist
38+
- Mark completed tasks as `[X]` in tasks.md
39+
40+
7. **Progress tracking**: Report after each task. Halt on non-parallel failures. Clear error messages.
41+
42+
8. **Completion validation**: Verify all tasks done, features match spec, tests pass.
43+
44+
9. Check `hooks.after_implement` if extensions.yml exists.

.claude/commands/speckit-plan.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Execute the implementation planning workflow to generate design artifacts.
2+
3+
## User Input
4+
5+
```text
6+
$ARGUMENTS
7+
```
8+
9+
You **MUST** consider the user input before proceeding (if not empty).
10+
11+
## Outline
12+
13+
1. **Setup**: Run from repo root and parse JSON:
14+
```bash
15+
bash .specify/scripts/bash/setup-plan.sh --json
16+
```
17+
Extract: FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH.
18+
19+
2. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template.
20+
21+
3. **Execute plan workflow** following the IMPL_PLAN template:
22+
- Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
23+
- Fill Constitution Check section
24+
- Evaluate gates (ERROR if violations unjustified)
25+
- Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
26+
- Phase 1: Generate data-model.md, contracts/, quickstart.md
27+
- Phase 1: Update agent context by running:
28+
```bash
29+
bash .specify/scripts/bash/update-agent-context.sh __AGENT__
30+
```
31+
- Re-evaluate Constitution Check post-design
32+
33+
4. **Stop and report**: Command ends after Phase 1. Report branch, IMPL_PLAN path, and generated artifacts.
34+
35+
### Phase 0: Outline & Research
36+
37+
- Extract unknowns from Technical Context → research tasks
38+
- For each dependency → best practices task
39+
- Consolidate findings in `research.md` (Decision, Rationale, Alternatives)
40+
41+
### Phase 1: Design & Contracts
42+
43+
- Extract entities from spec → `data-model.md`
44+
- Define interface contracts (if applicable) → `/contracts/`
45+
- Generate `quickstart.md`
46+
- Run agent context update script
47+
48+
## Key rules
49+
50+
- Use absolute paths
51+
- ERROR on gate failures or unresolved clarifications
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Create or update the feature specification from a natural language feature description.
2+
3+
## User Input
4+
5+
```text
6+
$ARGUMENTS
7+
```
8+
9+
You **MUST** consider the user input before proceeding (if not empty).
10+
11+
## Outline
12+
13+
The text the user typed after the command **is** the feature description.
14+
15+
Given that feature description:
16+
17+
1. **Generate a concise short name** (2-4 words) for the branch in action-noun format.
18+
19+
2. **Create the feature branch** (do NOT pass `--number` — auto-detected):
20+
```bash
21+
bash .specify/scripts/bash/create-new-feature.sh --json --short-name "short-name" "Feature description"
22+
```
23+
24+
3. Load `.specify/templates/spec-template.md` for required sections.
25+
26+
4. Parse description, extract actors/actions/data/constraints. Make informed guesses for unclear aspects. Mark max 3 items with `[NEEDS CLARIFICATION]` only if the choice significantly impacts scope, has multiple reasonable interpretations, and no reasonable default exists.
27+
28+
5. Write the spec to SPEC_FILE using the template. Focus on **WHAT** and **WHY**, not HOW. Written for business stakeholders.
29+
30+
6. **Validate** against quality criteria. Create checklist at `FEATURE_DIR/checklists/requirements.md`. If items fail, fix and re-validate (max 3 iterations). If clarifications remain (max 3), present questions with options.
31+
32+
7. Report completion with branch name, spec file path, checklist results, and next step (`/speckit-clarify` or `/speckit-plan`).
33+
34+
**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.

.claude/commands/speckit-tasks.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
2+
3+
## User Input
4+
5+
```text
6+
$ARGUMENTS
7+
```
8+
9+
You **MUST** consider the user input before proceeding (if not empty).
10+
11+
## Pre-Execution Checks
12+
13+
Check if `.specify/extensions.yml` exists. If so, check `hooks.before_tasks` for enabled hooks. Execute mandatory hooks before proceeding; display optional hooks.
14+
15+
## Outline
16+
17+
1. **Setup**: Run from repo root:
18+
```bash
19+
bash .specify/scripts/bash/check-prerequisites.sh --json
20+
```
21+
Parse FEATURE_DIR and AVAILABLE_DOCS.
22+
23+
2. **Load design documents** from FEATURE_DIR:
24+
- **Required**: plan.md, spec.md
25+
- **Optional**: data-model.md, contracts/, research.md, quickstart.md
26+
27+
3. **Generate tasks** organized by user story:
28+
- Extract tech stack and user stories with priorities
29+
- Map entities and contracts to stories
30+
- Generate dependency graph and parallel execution examples
31+
32+
4. **Write tasks.md** using `.specify/templates/tasks-template.md`:
33+
- Phase 1: Setup (project init)
34+
- Phase 2: Foundational (blocking prerequisites)
35+
- Phase 3+: One phase per user story (priority order)
36+
- Final: Polish & cross-cutting
37+
38+
5. **Task format** (REQUIRED):
39+
```
40+
- [ ] [TaskID] [P?] [Story?] Description with file path
41+
```
42+
- Checkbox always starts with `- [ ]`
43+
- Sequential ID: T001, T002...
44+
- `[P]` only if parallelizable
45+
- `[US1]`, `[US2]` etc. for user story phases only
46+
- Clear file path in description
47+
48+
6. **Report**: Path, total count, per-story count, parallel opportunities, MVP scope.
49+
50+
7. Check `hooks.after_tasks` if extensions.yml exists.

.claude/settings.json

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,43 @@
3838
"Bash(npm ls:*)",
3939
"Bash(npx tsc:*)",
4040
"Bash(npx vue-tsc:*)",
41-
"Bash(echo $?)"
41+
"Bash(echo $?)",
42+
"Bash(bunx eslint:*)",
43+
"Bash(then echo:*)",
44+
"Bash(DATABASE_URL=file:../data/db.sqlite timeout 90 bun vitest --run --reporter=verbose)",
45+
"Bash(DATABASE_URL=file:../data/db.sqlite bun vitest --run)",
46+
"Bash(npm run:*)",
47+
"Bash(DATABASE_URL=file:../data/db.sqlite timeout 180 bun vitest --run --reporter=verbose)",
48+
"Bash(npx eslint:*)",
49+
"Bash(node_modules/.bin/eslint tests/server/api/admin.test.ts tests/server/api/auth.test.ts tests/server/api/entries.test.ts tests/server/services/stripe.test.ts tests/server/services/syncEngine.test.ts registry/entryTypes.test.ts)",
50+
"Bash(node_modules/.bin/nuxi typecheck:*)",
51+
"Bash(while read:*)",
52+
"Bash(do sed:*)",
53+
"Bash(done)",
54+
"Bash(git tag -a v0.5.0 -m \"v0.5.0: Housekeeping & Infrastructure:*)",
55+
"WebFetch(domain:docs.docker.com)",
56+
"WebFetch(domain:releasebot.io)",
57+
"Bash(wsl --version)",
58+
"Bash(wsl --status)",
59+
"Read(//c/Users/caspar/code/tada/$USERPROFILE/**)",
60+
"Read(//c/Users/caspar/code/tada/$APPDATA/Docker/**)",
61+
"Bash(powershell.exe -Command \"Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, OsBuildNumber, OsHardwareAbstractionLayer, CsModel, CsManufacturer | Format-List\")",
62+
"Bash(python -m json.tool)",
63+
"Bash(powershell.exe -Command \"Get-WinEvent -FilterHashtable @{LogName=''System''; ProviderName=''Microsoft-Windows-Kernel-Power''; Id=107,507} -MaxEvents 10 2>&1 | Format-Table TimeCreated, Id, Message -Wrap\")",
64+
"Bash(bunx @spec-kit/cli@latest)",
65+
"Bash(cp -r /tmp/spec-kit-latest/templates/* /workspaces/tada/.specify/templates/)",
66+
"Bash(cp -r /tmp/spec-kit-latest/scripts/* /workspaces/tada/.specify/scripts/)",
67+
"Bash(bash .specify/scripts/bash/create-new-feature.sh --json --short-name \"weekly-rhythms\" \"Weekly Rhythms — Encouragement & Celebration: Thursday mid-week nudge and Sunday end-of-week celebration summary with tiered AI options\")",
68+
"Bash(bash .specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks)",
69+
"Bash(DATABASE_URL=file:../data/db.sqlite drizzle-kit push)",
70+
"Bash(DATABASE_URL=file:../data/db.sqlite bun drizzle-kit push --config=drizzle.config.ts)"
4271
],
4372
"additionalDirectories": [
4473
"/tmp",
45-
"/workspaces/tada/specs"
74+
"/workspaces/tada/specs",
75+
"C:\\Users\\caspar\\scripts",
76+
"/workspaces/tada/.claude",
77+
"/workspaces/tada/app/server/api/weekly-rhythms/messages"
4678
]
4779
}
4880
}

.github/agents/copilot-instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# tada Development Guidelines
22

3-
Auto-generated from all feature plans. Last updated: 2026-01-14
3+
Auto-generated from all feature plans. Last updated: 2026-03-18
44

55
## Active Technologies
66
- TypeScript 5.x, Vue 3.4+, Nuxt 3.x + Drizzle ORM, TailwindCSS, Lucia Auth (002-graceful-rhythms)
@@ -9,6 +9,8 @@ Auto-generated from all feature plans. Last updated: 2026-01-14
99
- SQLite (Drizzle), IndexedDB (audio blobs, model cache) (003-voice-input-llm)
1010
- TypeScript 5.x, Vue 3.4+, Nuxt 3.x + Nuxt 3, Vue 3, Drizzle ORM, SQLite, Zod (validation) (004-better-add)
1111
- SQLite via Drizzle ORM (`app/server/db/schema.ts`) (004-better-add)
12+
- TypeScript 5.9, Vue 3, Nuxt 4 + Drizzle ORM, Zod, Nodemailer, existing rhythm calculators, existing email templates, provider adapter for cloud AI, direct `croner` dependency during implementation for scheduler sweeps (009-weekly-rhythms)
13+
- SQLite via Drizzle, plus existing environment-variable based SMTP/AI credentials (009-weekly-rhythms)
1214

1315
- TypeScript 5.x (strict mode), Vue 3 Composition API + Nuxt 3, Drizzle ORM, TailwindCSS (001-v020-completion)
1416

@@ -28,9 +30,9 @@ npm test && npm run lint
2830
TypeScript 5.x (strict mode), Vue 3 Composition API: Follow standard conventions
2931

3032
## Recent Changes
33+
- 009-weekly-rhythms: Added TypeScript 5.9, Vue 3, Nuxt 4 + Drizzle ORM, Zod, Nodemailer, existing rhythm calculators, existing email templates, provider adapter for cloud AI, direct `croner` dependency during implementation for scheduler sweeps
3134
- 004-better-add: Added [if applicable, e.g., PostgreSQL, CoreData, files or N/A]
3235
- 004-better-add: Added TypeScript 5.x, Vue 3.4+, Nuxt 3.x + Nuxt 3, Vue 3, Drizzle ORM, SQLite, Zod (validation)
33-
- 003-voice-input-llm: Added TypeScript 5.x, Node.js 20 (production), Bun (development) + Nuxt 3, Vue 3, Drizzle ORM, Whisper.cpp (WASM), WebLLM
3436

3537

3638
<!-- MANUAL ADDITIONS START -->

.specify/scripts/bash/check-prerequisites.sh

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,28 @@ SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7979
source "$SCRIPT_DIR/common.sh"
8080

8181
# Get feature paths and validate branch
82-
eval $(get_feature_paths)
82+
_paths_output=$(get_feature_paths) || { echo "ERROR: Failed to resolve feature paths" >&2; exit 1; }
83+
eval "$_paths_output"
84+
unset _paths_output
8385
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1
8486

8587
# If paths-only mode, output paths and exit (support JSON + paths-only combined)
8688
if $PATHS_ONLY; then
8789
if $JSON_MODE; then
8890
# Minimal JSON paths payload (no validation performed)
89-
printf '{"REPO_ROOT":"%s","BRANCH":"%s","FEATURE_DIR":"%s","FEATURE_SPEC":"%s","IMPL_PLAN":"%s","TASKS":"%s"}\n' \
90-
"$REPO_ROOT" "$CURRENT_BRANCH" "$FEATURE_DIR" "$FEATURE_SPEC" "$IMPL_PLAN" "$TASKS"
91+
if has_jq; then
92+
jq -cn \
93+
--arg repo_root "$REPO_ROOT" \
94+
--arg branch "$CURRENT_BRANCH" \
95+
--arg feature_dir "$FEATURE_DIR" \
96+
--arg feature_spec "$FEATURE_SPEC" \
97+
--arg impl_plan "$IMPL_PLAN" \
98+
--arg tasks "$TASKS" \
99+
'{REPO_ROOT:$repo_root,BRANCH:$branch,FEATURE_DIR:$feature_dir,FEATURE_SPEC:$feature_spec,IMPL_PLAN:$impl_plan,TASKS:$tasks}'
100+
else
101+
printf '{"REPO_ROOT":"%s","BRANCH":"%s","FEATURE_DIR":"%s","FEATURE_SPEC":"%s","IMPL_PLAN":"%s","TASKS":"%s"}\n' \
102+
"$(json_escape "$REPO_ROOT")" "$(json_escape "$CURRENT_BRANCH")" "$(json_escape "$FEATURE_DIR")" "$(json_escape "$FEATURE_SPEC")" "$(json_escape "$IMPL_PLAN")" "$(json_escape "$TASKS")"
103+
fi
91104
else
92105
echo "REPO_ROOT: $REPO_ROOT"
93106
echo "BRANCH: $CURRENT_BRANCH"
@@ -141,14 +154,25 @@ fi
141154
# Output results
142155
if $JSON_MODE; then
143156
# Build JSON array of documents
144-
if [[ ${#docs[@]} -eq 0 ]]; then
145-
json_docs="[]"
157+
if has_jq; then
158+
if [[ ${#docs[@]} -eq 0 ]]; then
159+
json_docs="[]"
160+
else
161+
json_docs=$(printf '%s\n' "${docs[@]}" | jq -R . | jq -s .)
162+
fi
163+
jq -cn \
164+
--arg feature_dir "$FEATURE_DIR" \
165+
--argjson docs "$json_docs" \
166+
'{FEATURE_DIR:$feature_dir,AVAILABLE_DOCS:$docs}'
146167
else
147-
json_docs=$(printf '"%s",' "${docs[@]}")
148-
json_docs="[${json_docs%,}]"
168+
if [[ ${#docs[@]} -eq 0 ]]; then
169+
json_docs="[]"
170+
else
171+
json_docs=$(for d in "${docs[@]}"; do printf '"%s",' "$(json_escape "$d")"; done)
172+
json_docs="[${json_docs%,}]"
173+
fi
174+
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$(json_escape "$FEATURE_DIR")" "$json_docs"
149175
fi
150-
151-
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$FEATURE_DIR" "$json_docs"
152176
else
153177
# Text output
154178
echo "FEATURE_DIR:$FEATURE_DIR"

0 commit comments

Comments
 (0)