agentme 0.19.0 → 0.20.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/.filedist-package.yml +1 -36
- package/.xdrs/agentme/edrs/application/skills/001-create-javascript-project/SKILL.md +1 -1
- package/.xdrs/agentme/edrs/application/skills/003-create-golang-project/SKILL.md +1 -1
- package/.xdrs/agentme/edrs/application/skills/004-select-relevant-xdrs/SKILL.md +18 -44
- package/.xdrs/agentme/edrs/application/skills/005-create-python-project/SKILL.md +1 -1
- package/.xdrs/agentme/edrs/devops/skills/002-monorepo-setup/SKILL.md +1 -1
- package/README.md +3 -16
- package/package.json +4 -8
- package/.github/agents/speckit.analyze.agent.md +0 -184
- package/.github/agents/speckit.checklist.agent.md +0 -295
- package/.github/agents/speckit.clarify.agent.md +0 -181
- package/.github/agents/speckit.constitution.agent.md +0 -84
- package/.github/agents/speckit.implement.agent.md +0 -198
- package/.github/agents/speckit.plan.agent.md +0 -90
- package/.github/agents/speckit.specify.agent.md +0 -237
- package/.github/agents/speckit.tasks.agent.md +0 -200
- package/.github/agents/speckit.taskstoissues.agent.md +0 -30
- package/.github/prompts/speckit.analyze.prompt.md +0 -3
- package/.github/prompts/speckit.checklist.prompt.md +0 -3
- package/.github/prompts/speckit.clarify.prompt.md +0 -3
- package/.github/prompts/speckit.constitution.prompt.md +0 -3
- package/.github/prompts/speckit.implement.prompt.md +0 -3
- package/.github/prompts/speckit.plan.prompt.md +0 -3
- package/.github/prompts/speckit.specify.prompt.md +0 -3
- package/.github/prompts/speckit.tasks.prompt.md +0 -3
- package/.github/prompts/speckit.taskstoissues.prompt.md +0 -3
- package/.specify/memory/constitution.md +0 -99
- package/.specify/scripts/bash/check-prerequisites.sh +0 -190
- package/.specify/scripts/bash/common.sh +0 -253
- package/.specify/scripts/bash/create-new-feature.sh +0 -333
- package/.specify/scripts/bash/setup-plan.sh +0 -73
- package/.specify/scripts/bash/update-agent-context.sh +0 -808
- package/.specify/templates/agent-file-template.md +0 -28
- package/.specify/templates/checklist-template.md +0 -40
- package/.specify/templates/constitution-template.md +0 -50
- package/.specify/templates/plan-template.md +0 -110
- package/.specify/templates/spec-template.md +0 -115
- package/.specify/templates/tasks-template.md +0 -251
- package/.vscode/settings.json +0 -14
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
|
|
3
|
-
handoffs:
|
|
4
|
-
- label: Analyze For Consistency
|
|
5
|
-
agent: speckit.analyze
|
|
6
|
-
prompt: Run a project analysis for consistency
|
|
7
|
-
send: true
|
|
8
|
-
- label: Implement Project
|
|
9
|
-
agent: speckit.implement
|
|
10
|
-
prompt: Start the implementation in phases
|
|
11
|
-
send: true
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## User Input
|
|
15
|
-
|
|
16
|
-
```text
|
|
17
|
-
$ARGUMENTS
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
You **MUST** consider the user input before proceeding (if not empty).
|
|
21
|
-
|
|
22
|
-
## Pre-Execution Checks
|
|
23
|
-
|
|
24
|
-
**Check for extension hooks (before tasks generation)**:
|
|
25
|
-
- Check if `.specify/extensions.yml` exists in the project root.
|
|
26
|
-
- If it exists, read it and look for entries under the `hooks.before_tasks` key
|
|
27
|
-
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
28
|
-
- Filter to only hooks where `enabled: true`
|
|
29
|
-
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
30
|
-
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
31
|
-
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
32
|
-
- For each executable hook, output the following based on its `optional` flag:
|
|
33
|
-
- **Optional hook** (`optional: true`):
|
|
34
|
-
```
|
|
35
|
-
## Extension Hooks
|
|
36
|
-
|
|
37
|
-
**Optional Pre-Hook**: {extension}
|
|
38
|
-
Command: `/{command}`
|
|
39
|
-
Description: {description}
|
|
40
|
-
|
|
41
|
-
Prompt: {prompt}
|
|
42
|
-
To execute: `/{command}`
|
|
43
|
-
```
|
|
44
|
-
- **Mandatory hook** (`optional: false`):
|
|
45
|
-
```
|
|
46
|
-
## Extension Hooks
|
|
47
|
-
|
|
48
|
-
**Automatic Pre-Hook**: {extension}
|
|
49
|
-
Executing: `/{command}`
|
|
50
|
-
EXECUTE_COMMAND: {command}
|
|
51
|
-
|
|
52
|
-
Wait for the result of the hook command before proceeding to the Outline.
|
|
53
|
-
```
|
|
54
|
-
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
|
|
55
|
-
|
|
56
|
-
## Outline
|
|
57
|
-
|
|
58
|
-
1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
|
|
59
|
-
|
|
60
|
-
2. **Load design documents**: Read from FEATURE_DIR:
|
|
61
|
-
- **Required**: plan.md (tech stack, libraries, structure), spec.md (user stories with priorities)
|
|
62
|
-
- **Optional**: data-model.md (entities), contracts/ (interface contracts), research.md (decisions), quickstart.md (test scenarios)
|
|
63
|
-
- Note: Not all projects have all documents. Generate tasks based on what's available.
|
|
64
|
-
|
|
65
|
-
3. **Execute task generation workflow**:
|
|
66
|
-
- Load plan.md and extract tech stack, libraries, project structure
|
|
67
|
-
- Load spec.md and extract user stories with their priorities (P1, P2, P3, etc.)
|
|
68
|
-
- If data-model.md exists: Extract entities and map to user stories
|
|
69
|
-
- If contracts/ exists: Map interface contracts to user stories
|
|
70
|
-
- If research.md exists: Extract decisions for setup tasks
|
|
71
|
-
- Generate tasks organized by user story (see Task Generation Rules below)
|
|
72
|
-
- Generate dependency graph showing user story completion order
|
|
73
|
-
- Create parallel execution examples per user story
|
|
74
|
-
- Validate task completeness (each user story has all needed tasks, independently testable)
|
|
75
|
-
|
|
76
|
-
4. **Generate tasks.md**: Use `.specify/templates/tasks-template.md` as structure, fill with:
|
|
77
|
-
- Correct feature name from plan.md
|
|
78
|
-
- Phase 1: Setup tasks (project initialization)
|
|
79
|
-
- Phase 2: Foundational tasks (blocking prerequisites for all user stories)
|
|
80
|
-
- Phase 3+: One phase per user story (in priority order from spec.md)
|
|
81
|
-
- Each phase includes: story goal, independent test criteria, tests (if requested), implementation tasks
|
|
82
|
-
- Final Phase: Polish & cross-cutting concerns
|
|
83
|
-
- All tasks must follow the strict checklist format (see Task Generation Rules below)
|
|
84
|
-
- Clear file paths for each task
|
|
85
|
-
- Dependencies section showing story completion order
|
|
86
|
-
- Parallel execution examples per story
|
|
87
|
-
- Implementation strategy section (MVP first, incremental delivery)
|
|
88
|
-
|
|
89
|
-
5. **Report**: Output path to generated tasks.md and summary:
|
|
90
|
-
- Total task count
|
|
91
|
-
- Task count per user story
|
|
92
|
-
- Parallel opportunities identified
|
|
93
|
-
- Independent test criteria for each story
|
|
94
|
-
- Suggested MVP scope (typically just User Story 1)
|
|
95
|
-
- Format validation: Confirm ALL tasks follow the checklist format (checkbox, ID, labels, file paths)
|
|
96
|
-
|
|
97
|
-
6. **Check for extension hooks**: After tasks.md is generated, check if `.specify/extensions.yml` exists in the project root.
|
|
98
|
-
- If it exists, read it and look for entries under the `hooks.after_tasks` key
|
|
99
|
-
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
|
|
100
|
-
- Filter to only hooks where `enabled: true`
|
|
101
|
-
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
|
|
102
|
-
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
|
|
103
|
-
- If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation
|
|
104
|
-
- For each executable hook, output the following based on its `optional` flag:
|
|
105
|
-
- **Optional hook** (`optional: true`):
|
|
106
|
-
```
|
|
107
|
-
## Extension Hooks
|
|
108
|
-
|
|
109
|
-
**Optional Hook**: {extension}
|
|
110
|
-
Command: `/{command}`
|
|
111
|
-
Description: {description}
|
|
112
|
-
|
|
113
|
-
Prompt: {prompt}
|
|
114
|
-
To execute: `/{command}`
|
|
115
|
-
```
|
|
116
|
-
- **Mandatory hook** (`optional: false`):
|
|
117
|
-
```
|
|
118
|
-
## Extension Hooks
|
|
119
|
-
|
|
120
|
-
**Automatic Hook**: {extension}
|
|
121
|
-
Executing: `/{command}`
|
|
122
|
-
EXECUTE_COMMAND: {command}
|
|
123
|
-
```
|
|
124
|
-
- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently
|
|
125
|
-
|
|
126
|
-
Context for task generation: $ARGUMENTS
|
|
127
|
-
|
|
128
|
-
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
|
|
129
|
-
|
|
130
|
-
## Task Generation Rules
|
|
131
|
-
|
|
132
|
-
**CRITICAL**: Tasks MUST be organized by user story to enable independent implementation and testing.
|
|
133
|
-
|
|
134
|
-
**Tests are OPTIONAL**: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
|
|
135
|
-
|
|
136
|
-
### Checklist Format (REQUIRED)
|
|
137
|
-
|
|
138
|
-
Every task MUST strictly follow this format:
|
|
139
|
-
|
|
140
|
-
```text
|
|
141
|
-
- [ ] [TaskID] [P?] [Story?] Description with file path
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Format Components**:
|
|
145
|
-
|
|
146
|
-
1. **Checkbox**: ALWAYS start with `- [ ]` (markdown checkbox)
|
|
147
|
-
2. **Task ID**: Sequential number (T001, T002, T003...) in execution order
|
|
148
|
-
3. **[P] marker**: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
|
|
149
|
-
4. **[Story] label**: REQUIRED for user story phase tasks only
|
|
150
|
-
- Format: [US1], [US2], [US3], etc. (maps to user stories from spec.md)
|
|
151
|
-
- Setup phase: NO story label
|
|
152
|
-
- Foundational phase: NO story label
|
|
153
|
-
- User Story phases: MUST have story label
|
|
154
|
-
- Polish phase: NO story label
|
|
155
|
-
5. **Description**: Clear action with exact file path
|
|
156
|
-
|
|
157
|
-
**Examples**:
|
|
158
|
-
|
|
159
|
-
- ✅ CORRECT: `- [ ] T001 Create project structure per implementation plan`
|
|
160
|
-
- ✅ CORRECT: `- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py`
|
|
161
|
-
- ✅ CORRECT: `- [ ] T012 [P] [US1] Create User model in src/models/user.py`
|
|
162
|
-
- ✅ CORRECT: `- [ ] T014 [US1] Implement UserService in src/services/user_service.py`
|
|
163
|
-
- ❌ WRONG: `- [ ] Create User model` (missing ID and Story label)
|
|
164
|
-
- ❌ WRONG: `T001 [US1] Create model` (missing checkbox)
|
|
165
|
-
- ❌ WRONG: `- [ ] [US1] Create User model` (missing Task ID)
|
|
166
|
-
- ❌ WRONG: `- [ ] T001 [US1] Create model` (missing file path)
|
|
167
|
-
|
|
168
|
-
### Task Organization
|
|
169
|
-
|
|
170
|
-
1. **From User Stories (spec.md)** - PRIMARY ORGANIZATION:
|
|
171
|
-
- Each user story (P1, P2, P3...) gets its own phase
|
|
172
|
-
- Map all related components to their story:
|
|
173
|
-
- Models needed for that story
|
|
174
|
-
- Services needed for that story
|
|
175
|
-
- Interfaces/UI needed for that story
|
|
176
|
-
- If tests requested: Tests specific to that story
|
|
177
|
-
- Mark story dependencies (most stories should be independent)
|
|
178
|
-
|
|
179
|
-
2. **From Contracts**:
|
|
180
|
-
- Map each interface contract → to the user story it serves
|
|
181
|
-
- If tests requested: Each interface contract → contract test task [P] before implementation in that story's phase
|
|
182
|
-
|
|
183
|
-
3. **From Data Model**:
|
|
184
|
-
- Map each entity to the user story(ies) that need it
|
|
185
|
-
- If entity serves multiple stories: Put in earliest story or Setup phase
|
|
186
|
-
- Relationships → service layer tasks in appropriate story phase
|
|
187
|
-
|
|
188
|
-
4. **From Setup/Infrastructure**:
|
|
189
|
-
- Shared infrastructure → Setup phase (Phase 1)
|
|
190
|
-
- Foundational/blocking tasks → Foundational phase (Phase 2)
|
|
191
|
-
- Story-specific setup → within that story's phase
|
|
192
|
-
|
|
193
|
-
### Phase Structure
|
|
194
|
-
|
|
195
|
-
- **Phase 1**: Setup (project initialization)
|
|
196
|
-
- **Phase 2**: Foundational (blocking prerequisites - MUST complete before user stories)
|
|
197
|
-
- **Phase 3+**: User Stories in priority order (P1, P2, P3...)
|
|
198
|
-
- Within each story: Tests (if requested) → Models → Services → Endpoints → Integration
|
|
199
|
-
- Each phase should be a complete, independently testable increment
|
|
200
|
-
- **Final Phase**: Polish & Cross-Cutting Concerns
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.
|
|
3
|
-
tools: ['github/github-mcp-server/issue_write']
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## User Input
|
|
7
|
-
|
|
8
|
-
```text
|
|
9
|
-
$ARGUMENTS
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
You **MUST** consider the user input before proceeding (if not empty).
|
|
13
|
-
|
|
14
|
-
## Outline
|
|
15
|
-
|
|
16
|
-
1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
|
|
17
|
-
1. From the executed script, extract the path to **tasks**.
|
|
18
|
-
1. Get the Git remote by running:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
git config --get remote.origin.url
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
> [!CAUTION]
|
|
25
|
-
> ONLY PROCEED TO NEXT STEPS IF THE REMOTE IS A GITHUB URL
|
|
26
|
-
|
|
27
|
-
1. For each task in the list, use the GitHub MCP server to create a new issue in the repository that is representative of the Git remote.
|
|
28
|
-
|
|
29
|
-
> [!CAUTION]
|
|
30
|
-
> UNDER NO CIRCUMSTANCES EVER CREATE ISSUES IN REPOSITORIES THAT DO NOT MATCH THE REMOTE URL
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
SYNC IMPACT REPORT
|
|
3
|
-
==================
|
|
4
|
-
Version change: (none) → 1.0.0 (MINOR: initial population of constitution)
|
|
5
|
-
|
|
6
|
-
Added sections:
|
|
7
|
-
- Core Principles (I through V)
|
|
8
|
-
- Quality Requirements
|
|
9
|
-
- Development Workflow
|
|
10
|
-
- Governance
|
|
11
|
-
|
|
12
|
-
Modified principles: N/A (first version)
|
|
13
|
-
Removed sections: N/A (first version)
|
|
14
|
-
|
|
15
|
-
Templates checked:
|
|
16
|
-
- .specify/templates/plan-template.md ✅ "Constitution Check" gate already present
|
|
17
|
-
- .specify/templates/spec-template.md ✅ no constitution-specific sections required
|
|
18
|
-
- .specify/templates/tasks-template.md ✅ generic task categories compatible
|
|
19
|
-
|
|
20
|
-
Related XDRs created:
|
|
21
|
-
- .xdrs/_local/bdrs/index.md ✅ created
|
|
22
|
-
- .xdrs/_local/bdrs/principles/001-agentme-product-purpose.md ✅ created
|
|
23
|
-
|
|
24
|
-
Follow-up TODOs: none
|
|
25
|
-
-->
|
|
26
|
-
|
|
27
|
-
# agentme Constitution
|
|
28
|
-
|
|
29
|
-
## Core Principles
|
|
30
|
-
|
|
31
|
-
### I. XDR-First Knowledge Base
|
|
32
|
-
|
|
33
|
-
Every design decision, product requirement, and engineering convention MUST be captured in an XDR
|
|
34
|
-
before it is acted on. Specs and plans produced by speckit are temporary work products and may be
|
|
35
|
-
deleted after a feature ships. XDRs are permanent and form the living knowledge base used for
|
|
36
|
-
vibe coding, onboarding, and future feature development.
|
|
37
|
-
|
|
38
|
-
- BDRs capture product purpose, business rules, and consumer workflows.
|
|
39
|
-
- ADRs capture architectural context and cross-cutting patterns.
|
|
40
|
-
- EDRs capture concrete engineering decisions: tooling, structure, practices.
|
|
41
|
-
- Every non-trivial implementation decision MUST have a corresponding XDR entry before the implementation task is marked complete. Create new XDRs if necessary.
|
|
42
|
-
|
|
43
|
-
### II. XDR as the Single Source of Truth for All Policies
|
|
44
|
-
|
|
45
|
-
All quality standards, business policies, architectural policies, and engineering policies that
|
|
46
|
-
specs, plans, and implementations must follow MUST be captured exclusively in XDRs. The
|
|
47
|
-
constitution does not restate those rules; it defers to them.
|
|
48
|
-
|
|
49
|
-
- Quality gates (testing, linting, coverage thresholds, file-size limits) → EDRs.
|
|
50
|
-
- Business rules, consumer workflows, versioning contracts → BDRs.
|
|
51
|
-
- Architectural patterns, cross-cutting concerns, dependency strategies → ADRs.
|
|
52
|
-
- If a policy is not in an XDR, it is not an enforceable policy. Write the XDR first.
|
|
53
|
-
- Agents and humans MUST consult the XDR index before starting any work and MUST follow every
|
|
54
|
-
relevant XDR found there without exception.
|
|
55
|
-
|
|
56
|
-
## Development Workflow
|
|
57
|
-
|
|
58
|
-
1. Before starting a feature: check existing XDRs for applicable decisions.
|
|
59
|
-
2. During specifying (`speckit.specify`): capture business requirements as BDRs in `_local`.
|
|
60
|
-
**After every `speckit.specify` run the agent MUST offer to run `speckit.clarify` (refine)
|
|
61
|
-
before proceeding to planning. This is non-negotiable.**
|
|
62
|
-
3. During planning (`speckit.plan`): update or create ADRs and EDRs in `_local` that reflect
|
|
63
|
-
architectural and engineering decisions made during the planning phase.
|
|
64
|
-
**After every `speckit.plan` run the agent MUST propose running `speckit.checklist` to enrich
|
|
65
|
-
the plan with domain-specific quality checks before generating tasks.**
|
|
66
|
-
4. During implementation: follow XDRs; create new `_local` XDRs for decisions not yet captured.
|
|
67
|
-
5. After implementation: delete feature specs and plans; XDRs remain permanently.
|
|
68
|
-
6. Runtime guidance: see `.xdrs/index.md` and all linked scope indexes.
|
|
69
|
-
|
|
70
|
-
## XDR Compliance Check (Mandatory at Every Stage)
|
|
71
|
-
|
|
72
|
-
Every Spec, Refinement (clarify), Plan, Checklist, and Implementation task MUST include an
|
|
73
|
-
explicit step that verifies compliance with the XDRs present in the repository:
|
|
74
|
-
|
|
75
|
-
1. Read `.xdrs/index.md` and all linked scope indexes (`_local`, `agentme`, `_core`).
|
|
76
|
-
2. Identify every XDR relevant to the work being performed.
|
|
77
|
-
3. Confirm that the artifact (spec, plan, task list, or code change) does not contradict any
|
|
78
|
-
relevant XDR.
|
|
79
|
-
4. If a contradiction or gap is found: either update the artifact to comply, or create/update the
|
|
80
|
-
relevant XDR to reflect the new decision before continuing.
|
|
81
|
-
5. Document the compliance check result in the artifact (e.g., a "XDR Compliance" section or
|
|
82
|
-
comment) so reviewers can audit it.
|
|
83
|
-
|
|
84
|
-
No artifact may be considered complete without a passed XDR compliance check.
|
|
85
|
-
|
|
86
|
-
## Governance
|
|
87
|
-
|
|
88
|
-
This constitution supersedes all other development practices within this repository. Amendments
|
|
89
|
-
require:
|
|
90
|
-
1. A version bump following semantic versioning rules stated in the relevant BDR/ADR/EDR.
|
|
91
|
-
2. An updated `LAST_AMENDED_DATE` in this file.
|
|
92
|
-
3. A review of all principles for continued non-conflict.
|
|
93
|
-
4. An updated Sync Impact Report (HTML comment at the top of this file).
|
|
94
|
-
|
|
95
|
-
All PRs MUST include a "Constitution Check" section confirming compliance with all principles.
|
|
96
|
-
Complexity MUST be justified; if a solution requires deviation from a principle, that deviation
|
|
97
|
-
MUST be documented in a new or updated XDR in `_local`.
|
|
98
|
-
|
|
99
|
-
**Version**: 1.0.0 | **Ratified**: 2026-03-14 | **Last Amended**: 2026-03-14
|
|
@@ -1,190 +0,0 @@
|
|
|
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-tasks Require tasks.md to exist (for implementation phase)
|
|
13
|
-
# --include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
14
|
-
# --paths-only Only output path variables (no validation)
|
|
15
|
-
# --help, -h Show help message
|
|
16
|
-
#
|
|
17
|
-
# OUTPUTS:
|
|
18
|
-
# JSON mode: {"FEATURE_DIR":"...", "AVAILABLE_DOCS":["..."]}
|
|
19
|
-
# Text mode: FEATURE_DIR:... \n AVAILABLE_DOCS: \n ✓/✗ file.md
|
|
20
|
-
# Paths only: REPO_ROOT: ... \n BRANCH: ... \n FEATURE_DIR: ... etc.
|
|
21
|
-
|
|
22
|
-
set -e
|
|
23
|
-
|
|
24
|
-
# Parse command line arguments
|
|
25
|
-
JSON_MODE=false
|
|
26
|
-
REQUIRE_TASKS=false
|
|
27
|
-
INCLUDE_TASKS=false
|
|
28
|
-
PATHS_ONLY=false
|
|
29
|
-
|
|
30
|
-
for arg in "$@"; do
|
|
31
|
-
case "$arg" in
|
|
32
|
-
--json)
|
|
33
|
-
JSON_MODE=true
|
|
34
|
-
;;
|
|
35
|
-
--require-tasks)
|
|
36
|
-
REQUIRE_TASKS=true
|
|
37
|
-
;;
|
|
38
|
-
--include-tasks)
|
|
39
|
-
INCLUDE_TASKS=true
|
|
40
|
-
;;
|
|
41
|
-
--paths-only)
|
|
42
|
-
PATHS_ONLY=true
|
|
43
|
-
;;
|
|
44
|
-
--help|-h)
|
|
45
|
-
cat << 'EOF'
|
|
46
|
-
Usage: check-prerequisites.sh [OPTIONS]
|
|
47
|
-
|
|
48
|
-
Consolidated prerequisite checking for Spec-Driven Development workflow.
|
|
49
|
-
|
|
50
|
-
OPTIONS:
|
|
51
|
-
--json Output in JSON format
|
|
52
|
-
--require-tasks Require tasks.md to exist (for implementation phase)
|
|
53
|
-
--include-tasks Include tasks.md in AVAILABLE_DOCS list
|
|
54
|
-
--paths-only Only output path variables (no prerequisite validation)
|
|
55
|
-
--help, -h Show this help message
|
|
56
|
-
|
|
57
|
-
EXAMPLES:
|
|
58
|
-
# Check task prerequisites (plan.md required)
|
|
59
|
-
./check-prerequisites.sh --json
|
|
60
|
-
|
|
61
|
-
# Check implementation prerequisites (plan.md + tasks.md required)
|
|
62
|
-
./check-prerequisites.sh --json --require-tasks --include-tasks
|
|
63
|
-
|
|
64
|
-
# Get feature paths only (no validation)
|
|
65
|
-
./check-prerequisites.sh --paths-only
|
|
66
|
-
|
|
67
|
-
EOF
|
|
68
|
-
exit 0
|
|
69
|
-
;;
|
|
70
|
-
*)
|
|
71
|
-
echo "ERROR: Unknown option '$arg'. Use --help for usage information." >&2
|
|
72
|
-
exit 1
|
|
73
|
-
;;
|
|
74
|
-
esac
|
|
75
|
-
done
|
|
76
|
-
|
|
77
|
-
# Source common functions
|
|
78
|
-
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
79
|
-
source "$SCRIPT_DIR/common.sh"
|
|
80
|
-
|
|
81
|
-
# Get feature paths and validate branch
|
|
82
|
-
_paths_output=$(get_feature_paths) || { echo "ERROR: Failed to resolve feature paths" >&2; exit 1; }
|
|
83
|
-
eval "$_paths_output"
|
|
84
|
-
unset _paths_output
|
|
85
|
-
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1
|
|
86
|
-
|
|
87
|
-
# If paths-only mode, output paths and exit (support JSON + paths-only combined)
|
|
88
|
-
if $PATHS_ONLY; then
|
|
89
|
-
if $JSON_MODE; then
|
|
90
|
-
# Minimal JSON paths payload (no validation performed)
|
|
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
|
|
104
|
-
else
|
|
105
|
-
echo "REPO_ROOT: $REPO_ROOT"
|
|
106
|
-
echo "BRANCH: $CURRENT_BRANCH"
|
|
107
|
-
echo "FEATURE_DIR: $FEATURE_DIR"
|
|
108
|
-
echo "FEATURE_SPEC: $FEATURE_SPEC"
|
|
109
|
-
echo "IMPL_PLAN: $IMPL_PLAN"
|
|
110
|
-
echo "TASKS: $TASKS"
|
|
111
|
-
fi
|
|
112
|
-
exit 0
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
# Validate required directories and files
|
|
116
|
-
if [[ ! -d "$FEATURE_DIR" ]]; then
|
|
117
|
-
echo "ERROR: Feature directory not found: $FEATURE_DIR" >&2
|
|
118
|
-
echo "Run /speckit.specify first to create the feature structure." >&2
|
|
119
|
-
exit 1
|
|
120
|
-
fi
|
|
121
|
-
|
|
122
|
-
if [[ ! -f "$IMPL_PLAN" ]]; then
|
|
123
|
-
echo "ERROR: plan.md not found in $FEATURE_DIR" >&2
|
|
124
|
-
echo "Run /speckit.plan first to create the implementation plan." >&2
|
|
125
|
-
exit 1
|
|
126
|
-
fi
|
|
127
|
-
|
|
128
|
-
# Check for tasks.md if required
|
|
129
|
-
if $REQUIRE_TASKS && [[ ! -f "$TASKS" ]]; then
|
|
130
|
-
echo "ERROR: tasks.md not found in $FEATURE_DIR" >&2
|
|
131
|
-
echo "Run /speckit.tasks first to create the task list." >&2
|
|
132
|
-
exit 1
|
|
133
|
-
fi
|
|
134
|
-
|
|
135
|
-
# Build list of available documents
|
|
136
|
-
docs=()
|
|
137
|
-
|
|
138
|
-
# Always check these optional docs
|
|
139
|
-
[[ -f "$RESEARCH" ]] && docs+=("research.md")
|
|
140
|
-
[[ -f "$DATA_MODEL" ]] && docs+=("data-model.md")
|
|
141
|
-
|
|
142
|
-
# Check contracts directory (only if it exists and has files)
|
|
143
|
-
if [[ -d "$CONTRACTS_DIR" ]] && [[ -n "$(ls -A "$CONTRACTS_DIR" 2>/dev/null)" ]]; then
|
|
144
|
-
docs+=("contracts/")
|
|
145
|
-
fi
|
|
146
|
-
|
|
147
|
-
[[ -f "$QUICKSTART" ]] && docs+=("quickstart.md")
|
|
148
|
-
|
|
149
|
-
# Include tasks.md if requested and it exists
|
|
150
|
-
if $INCLUDE_TASKS && [[ -f "$TASKS" ]]; then
|
|
151
|
-
docs+=("tasks.md")
|
|
152
|
-
fi
|
|
153
|
-
|
|
154
|
-
# Output results
|
|
155
|
-
if $JSON_MODE; then
|
|
156
|
-
# Build JSON array of documents
|
|
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}'
|
|
167
|
-
else
|
|
168
|
-
if [[ ${#docs[@]} -eq 0 ]]; then
|
|
169
|
-
json_docs="[]"
|
|
170
|
-
else
|
|
171
|
-
json_docs=$(printf '"%s",' "${docs[@]}")
|
|
172
|
-
json_docs="[${json_docs%,}]"
|
|
173
|
-
fi
|
|
174
|
-
printf '{"FEATURE_DIR":"%s","AVAILABLE_DOCS":%s}\n' "$(json_escape "$FEATURE_DIR")" "$json_docs"
|
|
175
|
-
fi
|
|
176
|
-
else
|
|
177
|
-
# Text output
|
|
178
|
-
echo "FEATURE_DIR:$FEATURE_DIR"
|
|
179
|
-
echo "AVAILABLE_DOCS:"
|
|
180
|
-
|
|
181
|
-
# Show status of each potential document
|
|
182
|
-
check_file "$RESEARCH" "research.md"
|
|
183
|
-
check_file "$DATA_MODEL" "data-model.md"
|
|
184
|
-
check_dir "$CONTRACTS_DIR" "contracts/"
|
|
185
|
-
check_file "$QUICKSTART" "quickstart.md"
|
|
186
|
-
|
|
187
|
-
if $INCLUDE_TASKS; then
|
|
188
|
-
check_file "$TASKS" "tasks.md"
|
|
189
|
-
fi
|
|
190
|
-
fi
|