duaer-spec 0.1.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/.cursor/rules/agents-workflow.mdc +50 -0
- package/.cursor/rules/ai-ui-copy.mdc +12 -0
- package/.cursor/rules/duaer-spec.mdc +33 -0
- package/.cursor/skills/duaer-analyze/SKILL.md +259 -0
- package/.cursor/skills/duaer-checklist/SKILL.md +383 -0
- package/.cursor/skills/duaer-clarify/SKILL.md +291 -0
- package/.cursor/skills/duaer-constitution/SKILL.md +177 -0
- package/.cursor/skills/duaer-converge/SKILL.md +277 -0
- package/.cursor/skills/duaer-git-commit/SKILL.md +68 -0
- package/.cursor/skills/duaer-git-feature/SKILL.md +94 -0
- package/.cursor/skills/duaer-git-initialize/SKILL.md +54 -0
- package/.cursor/skills/duaer-git-remote/SKILL.md +50 -0
- package/.cursor/skills/duaer-git-validate/SKILL.md +54 -0
- package/.cursor/skills/duaer-implement/SKILL.md +226 -0
- package/.cursor/skills/duaer-plan/SKILL.md +166 -0
- package/.cursor/skills/duaer-specify/SKILL.md +345 -0
- package/.cursor/skills/duaer-tasks/SKILL.md +214 -0
- package/.cursor/skills/duaer-taskstoissues/SKILL.md +109 -0
- package/.duaer/extensions/.registry +23 -0
- package/.duaer/extensions/git/README.md +119 -0
- package/.duaer/extensions/git/commands/duaer.git.commit.md +63 -0
- package/.duaer/extensions/git/commands/duaer.git.feature.md +82 -0
- package/.duaer/extensions/git/commands/duaer.git.initialize.md +49 -0
- package/.duaer/extensions/git/commands/duaer.git.remote.md +45 -0
- package/.duaer/extensions/git/commands/duaer.git.validate.md +49 -0
- package/.duaer/extensions/git/config-template.yml +79 -0
- package/.duaer/extensions/git/extension.yml +142 -0
- package/.duaer/extensions/git/git-config.yml +79 -0
- package/.duaer/extensions/git/scripts/bash/auto-commit.sh +211 -0
- package/.duaer/extensions/git/scripts/bash/create-new-feature-branch.sh +626 -0
- package/.duaer/extensions/git/scripts/bash/git-common.sh +56 -0
- package/.duaer/extensions/git/scripts/bash/initialize-repo.sh +54 -0
- package/.duaer/extensions/git/scripts/powershell/auto-commit.ps1 +230 -0
- package/.duaer/extensions/git/scripts/powershell/create-new-feature-branch.ps1 +592 -0
- package/.duaer/extensions/git/scripts/powershell/git-common.ps1 +52 -0
- package/.duaer/extensions/git/scripts/powershell/initialize-repo.ps1 +69 -0
- package/.duaer/extensions/git/scripts/python/auto_commit.py +195 -0
- package/.duaer/extensions/git/scripts/python/create_new_feature_branch.py +634 -0
- package/.duaer/extensions/git/scripts/python/git_common.py +81 -0
- package/.duaer/extensions/git/scripts/python/initialize_repo.py +89 -0
- package/.duaer/extensions.yml +167 -0
- package/.duaer/init-options.json +9 -0
- package/.duaer/integration.json +15 -0
- package/.duaer/integrations/cursor-agent.manifest.json +17 -0
- package/.duaer/integrations/duaer.manifest.json +19 -0
- package/.duaer/memory/.constitution-template.json +4 -0
- package/.duaer/memory/constitution.md +37 -0
- package/.duaer/memory/project-context.md +24 -0
- package/.duaer/memory/testing.md +14 -0
- package/.duaer/scripts/bash/check-prerequisites.sh +243 -0
- package/.duaer/scripts/bash/common.sh +926 -0
- package/.duaer/scripts/bash/create-new-feature.sh +407 -0
- package/.duaer/scripts/bash/resolve-template.sh +57 -0
- package/.duaer/scripts/bash/setup-plan.sh +85 -0
- package/.duaer/scripts/bash/setup-tasks.sh +94 -0
- package/.duaer/templates/checklist-template.md +45 -0
- package/.duaer/templates/constitution-template.md +50 -0
- package/.duaer/templates/plan-template.md +113 -0
- package/.duaer/templates/spec-template.md +131 -0
- package/.duaer/templates/tasks-template.md +252 -0
- package/.duaer/workflows/duaer/workflow.yml +78 -0
- package/.duaer/workflows/workflow-registry.json +13 -0
- package/ADOPT.md +75 -0
- package/AGENTS.md +290 -0
- package/CHANGELOG.md +28 -0
- package/DUADER.md +57 -0
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/bin/duaer.mjs +298 -0
- package/docs/agent/README.md +12 -0
- package/docs/agent/change-checklist.md +130 -0
- package/docs/agent/e2e-test-plan.md +33 -0
- package/docs/agent/workflow.md +127 -0
- package/docs/baseline.md +10 -0
- package/package.json +49 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Consolidated prerequisite checking script
|
|
4
|
+
#
|
|
5
|
+
# This script provides unified prerequisite checking for Spec-Driven Development workflow.
|
|
6
|
+
# It replaces the functionality previously spread across multiple scripts.
|
|
7
|
+
#
|
|
8
|
+
# Usage: ./check-prerequisites.sh [OPTIONS]
|
|
9
|
+
#
|
|
10
|
+
# OPTIONS:
|
|
11
|
+
# --json Output in JSON format
|
|
12
|
+
# --require-spec Require spec.md to exist (for analysis phase)
|
|
13
|
+
# --require-tasks Require tasks.md to exist (for implementation phase)
|
|
14
|
+
# --include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
15
|
+
# --paths-only Only output path variables (no validation)
|
|
16
|
+
# --template NAME Include composed template content in JSON output
|
|
17
|
+
# --help, -h Show help message
|
|
18
|
+
#
|
|
19
|
+
# OUTPUTS:
|
|
20
|
+
# JSON mode: {"FEATURE_DIR":"...", "AVAILABLE_DOCS":["..."]}
|
|
21
|
+
# Text mode: FEATURE_DIR:... \n AVAILABLE_DOCS: \n ✓/✗ file.md
|
|
22
|
+
# Paths only: REPO_ROOT: ... \n BRANCH: ... \n FEATURE_DIR: ... etc.
|
|
23
|
+
|
|
24
|
+
set -e
|
|
25
|
+
|
|
26
|
+
# Parse command line arguments
|
|
27
|
+
JSON_MODE=false
|
|
28
|
+
REQUIRE_SPEC=false
|
|
29
|
+
REQUIRE_TASKS=false
|
|
30
|
+
INCLUDE_TASKS=false
|
|
31
|
+
PATHS_ONLY=false
|
|
32
|
+
TEMPLATE_NAME=""
|
|
33
|
+
|
|
34
|
+
while [[ $# -gt 0 ]]; do
|
|
35
|
+
case "$1" in
|
|
36
|
+
--json)
|
|
37
|
+
JSON_MODE=true
|
|
38
|
+
;;
|
|
39
|
+
--require-spec)
|
|
40
|
+
REQUIRE_SPEC=true
|
|
41
|
+
;;
|
|
42
|
+
--require-tasks)
|
|
43
|
+
REQUIRE_TASKS=true
|
|
44
|
+
;;
|
|
45
|
+
--include-tasks)
|
|
46
|
+
INCLUDE_TASKS=true
|
|
47
|
+
;;
|
|
48
|
+
--paths-only)
|
|
49
|
+
PATHS_ONLY=true
|
|
50
|
+
;;
|
|
51
|
+
--template)
|
|
52
|
+
shift
|
|
53
|
+
if [[ $# -eq 0 ]]; then
|
|
54
|
+
echo "ERROR: --template requires a template name" >&2
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
TEMPLATE_NAME="$1"
|
|
58
|
+
;;
|
|
59
|
+
--help|-h)
|
|
60
|
+
cat << 'EOF'
|
|
61
|
+
Usage: check-prerequisites.sh [OPTIONS]
|
|
62
|
+
|
|
63
|
+
Consolidated prerequisite checking for Spec-Driven Development workflow.
|
|
64
|
+
|
|
65
|
+
OPTIONS:
|
|
66
|
+
--json Output in JSON format
|
|
67
|
+
--require-spec Require spec.md to exist (for analysis phase)
|
|
68
|
+
--require-tasks Require tasks.md to exist (for implementation phase)
|
|
69
|
+
--include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
70
|
+
--paths-only Only output path variables (no prerequisite validation)
|
|
71
|
+
--template NAME Include composed template content in JSON output
|
|
72
|
+
--help, -h Show this help message
|
|
73
|
+
|
|
74
|
+
EXAMPLES:
|
|
75
|
+
# Check task prerequisites (plan.md required)
|
|
76
|
+
./check-prerequisites.sh --json
|
|
77
|
+
|
|
78
|
+
# Check implementation prerequisites (plan.md + tasks.md required)
|
|
79
|
+
./check-prerequisites.sh --json --require-tasks --include-tasks
|
|
80
|
+
|
|
81
|
+
# Get feature paths only (no validation)
|
|
82
|
+
./check-prerequisites.sh --paths-only
|
|
83
|
+
|
|
84
|
+
EOF
|
|
85
|
+
exit 0
|
|
86
|
+
;;
|
|
87
|
+
*)
|
|
88
|
+
echo "ERROR: Unknown option '$1'. Use --help for usage information." >&2
|
|
89
|
+
exit 1
|
|
90
|
+
;;
|
|
91
|
+
esac
|
|
92
|
+
shift
|
|
93
|
+
done
|
|
94
|
+
|
|
95
|
+
# Source common functions
|
|
96
|
+
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
97
|
+
source "$SCRIPT_DIR/common.sh"
|
|
98
|
+
|
|
99
|
+
# Get feature paths.
|
|
100
|
+
# In --paths-only mode this is pure resolution, so pass --no-persist to opt out
|
|
101
|
+
# of the feature.json write side effect (issue #3025).
|
|
102
|
+
if $PATHS_ONLY; then
|
|
103
|
+
_paths_output=$(get_feature_paths --no-persist) || { echo "ERROR: Failed to resolve feature paths" >&2; exit 1; }
|
|
104
|
+
else
|
|
105
|
+
_paths_output=$(get_feature_paths) || { echo "ERROR: Failed to resolve feature paths" >&2; exit 1; }
|
|
106
|
+
fi
|
|
107
|
+
eval "$_paths_output"
|
|
108
|
+
unset _paths_output
|
|
109
|
+
|
|
110
|
+
# If paths-only mode, output paths and exit (no validation)
|
|
111
|
+
if $PATHS_ONLY; then
|
|
112
|
+
if $JSON_MODE; then
|
|
113
|
+
# Minimal JSON paths payload (no validation performed)
|
|
114
|
+
if has_jq; then
|
|
115
|
+
jq -cn \
|
|
116
|
+
--arg repo_root "$REPO_ROOT" \
|
|
117
|
+
--arg branch "$CURRENT_BRANCH" \
|
|
118
|
+
--arg feature_dir "$FEATURE_DIR" \
|
|
119
|
+
--arg feature_spec "$FEATURE_SPEC" \
|
|
120
|
+
--arg impl_plan "$IMPL_PLAN" \
|
|
121
|
+
--arg tasks "$TASKS" \
|
|
122
|
+
'{REPO_ROOT:$repo_root,BRANCH:$branch,FEATURE_DIR:$feature_dir,FEATURE_SPEC:$feature_spec,IMPL_PLAN:$impl_plan,TASKS:$tasks}'
|
|
123
|
+
else
|
|
124
|
+
printf '{"REPO_ROOT":"%s","BRANCH":"%s","FEATURE_DIR":"%s","FEATURE_SPEC":"%s","IMPL_PLAN":"%s","TASKS":"%s"}\n' \
|
|
125
|
+
"$(json_escape "$REPO_ROOT")" "$(json_escape "$CURRENT_BRANCH")" "$(json_escape "$FEATURE_DIR")" "$(json_escape "$FEATURE_SPEC")" "$(json_escape "$IMPL_PLAN")" "$(json_escape "$TASKS")"
|
|
126
|
+
fi
|
|
127
|
+
else
|
|
128
|
+
echo "REPO_ROOT: $REPO_ROOT"
|
|
129
|
+
echo "BRANCH: $CURRENT_BRANCH"
|
|
130
|
+
echo "FEATURE_DIR: $FEATURE_DIR"
|
|
131
|
+
echo "FEATURE_SPEC: $FEATURE_SPEC"
|
|
132
|
+
echo "IMPL_PLAN: $IMPL_PLAN"
|
|
133
|
+
echo "TASKS: $TASKS"
|
|
134
|
+
fi
|
|
135
|
+
exit 0
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# Validate required directories and files
|
|
139
|
+
if [[ ! -d "$FEATURE_DIR" ]]; then
|
|
140
|
+
echo "ERROR: Feature directory not found: $FEATURE_DIR" >&2
|
|
141
|
+
echo "Run /duaer-specify first to create the feature structure." >&2
|
|
142
|
+
exit 1
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
if [[ ! -f "$IMPL_PLAN" ]]; then
|
|
146
|
+
echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
|
|
147
|
+
echo "Run /duaer-plan first to create the implementation plan." >&2
|
|
148
|
+
exit 1
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
# Check for spec.md if required
|
|
152
|
+
if $REQUIRE_SPEC && [[ ! -f "$FEATURE_SPEC" ]]; then
|
|
153
|
+
echo "ERROR: spec.md not found in $FEATURE_DIR" >&2
|
|
154
|
+
echo "Run /duaer-specify first to create the feature specification." >&2
|
|
155
|
+
exit 1
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Check for tasks.md if required
|
|
159
|
+
if $REQUIRE_TASKS && [[ ! -f "$TASKS" ]]; then
|
|
160
|
+
echo "ERROR: tasks.md not found in $FEATURE_DIR" >&2
|
|
161
|
+
echo "Run /duaer-tasks first to create the task list." >&2
|
|
162
|
+
exit 1
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Build list of available documents
|
|
166
|
+
docs=()
|
|
167
|
+
|
|
168
|
+
# Always check these optional docs
|
|
169
|
+
[[ -f "$RESEARCH" ]] && docs+=("research.md")
|
|
170
|
+
[[ -f "$DATA_MODEL" ]] && docs+=("data-model.md")
|
|
171
|
+
|
|
172
|
+
# Check contracts directory (only if it exists and has files)
|
|
173
|
+
if [[ -d "$CONTRACTS_DIR" ]] && [[ -n "$(ls -A "$CONTRACTS_DIR" 2>/dev/null)" ]]; then
|
|
174
|
+
docs+=("contracts/")
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
[[ -f "$QUICKSTART" ]] && docs+=("quickstart.md")
|
|
178
|
+
|
|
179
|
+
# Include tasks.md if requested and it exists
|
|
180
|
+
if $INCLUDE_TASKS && [[ -f "$TASKS" ]]; then
|
|
181
|
+
docs+=("tasks.md")
|
|
182
|
+
fi
|
|
183
|
+
|
|
184
|
+
TEMPLATE_CONTENT=""
|
|
185
|
+
if [[ -n "$TEMPLATE_NAME" ]]; then
|
|
186
|
+
if TEMPLATE_CONTENT=$(resolve_template_content "$TEMPLATE_NAME" "$REPO_ROOT"; status=$?; printf x; exit "$status"); then
|
|
187
|
+
TEMPLATE_CONTENT="${TEMPLATE_CONTENT%x}"
|
|
188
|
+
else
|
|
189
|
+
echo "ERROR: Could not resolve required $TEMPLATE_NAME from the template override stack for $REPO_ROOT" >&2
|
|
190
|
+
exit 1
|
|
191
|
+
fi
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
# Output results
|
|
195
|
+
if $JSON_MODE; then
|
|
196
|
+
# Build JSON array of documents
|
|
197
|
+
if has_jq; then
|
|
198
|
+
if [[ ${#docs[@]} -eq 0 ]]; then
|
|
199
|
+
json_docs="[]"
|
|
200
|
+
else
|
|
201
|
+
json_docs=$(printf '%s\n' "${docs[@]}" | jq -R . | jq -s .)
|
|
202
|
+
fi
|
|
203
|
+
if [[ -n "$TEMPLATE_NAME" ]]; then
|
|
204
|
+
jq -cn \
|
|
205
|
+
--arg feature_dir "$FEATURE_DIR" \
|
|
206
|
+
--argjson docs "$json_docs" \
|
|
207
|
+
--arg template_content "$TEMPLATE_CONTENT" \
|
|
208
|
+
'{FEATURE_DIR:$feature_dir,AVAILABLE_DOCS:$docs,TEMPLATE_CONTENT:$template_content}'
|
|
209
|
+
else
|
|
210
|
+
jq -cn \
|
|
211
|
+
--arg feature_dir "$FEATURE_DIR" \
|
|
212
|
+
--argjson docs "$json_docs" \
|
|
213
|
+
'{FEATURE_DIR:$feature_dir,AVAILABLE_DOCS:$docs}'
|
|
214
|
+
fi
|
|
215
|
+
else
|
|
216
|
+
if [[ ${#docs[@]} -eq 0 ]]; then
|
|
217
|
+
json_docs="[]"
|
|
218
|
+
else
|
|
219
|
+
json_docs=$(for d in "${docs[@]}"; do printf '"%s",' "$(json_escape "$d")"; done)
|
|
220
|
+
json_docs="[${json_docs%,}]"
|
|
221
|
+
fi
|
|
222
|
+
if [[ -n "$TEMPLATE_NAME" ]]; then
|
|
223
|
+
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s,"TEMPLATE_CONTENT":"%s"}\n' \
|
|
224
|
+
"$(json_escape "$FEATURE_DIR")" "$json_docs" "$(json_escape "$TEMPLATE_CONTENT")"
|
|
225
|
+
else
|
|
226
|
+
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$(json_escape "$FEATURE_DIR")" "$json_docs"
|
|
227
|
+
fi
|
|
228
|
+
fi
|
|
229
|
+
else
|
|
230
|
+
# Text output
|
|
231
|
+
echo "FEATURE_DIR:$FEATURE_DIR"
|
|
232
|
+
echo "AVAILABLE_DOCS:"
|
|
233
|
+
|
|
234
|
+
# Show status of each potential document
|
|
235
|
+
check_file "$RESEARCH" "research.md"
|
|
236
|
+
check_file "$DATA_MODEL" "data-model.md"
|
|
237
|
+
check_dir "$CONTRACTS_DIR" "contracts/"
|
|
238
|
+
check_file "$QUICKSTART" "quickstart.md"
|
|
239
|
+
|
|
240
|
+
if $INCLUDE_TASKS; then
|
|
241
|
+
check_file "$TASKS" "tasks.md"
|
|
242
|
+
fi
|
|
243
|
+
fi
|