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,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"extensions": {
|
|
4
|
+
"git": {
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"source": "local",
|
|
7
|
+
"manifest_hash": "sha256:89711dec9716473fba4afc54f7224bcb28ebd3c55fb5aaa30df854ab02b07a75",
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"priority": 10,
|
|
10
|
+
"registered_commands": {
|
|
11
|
+
"cursor-agent": [
|
|
12
|
+
"speckit.git.feature",
|
|
13
|
+
"speckit.git.validate",
|
|
14
|
+
"speckit.git.remote",
|
|
15
|
+
"speckit.git.initialize",
|
|
16
|
+
"speckit.git.commit"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"registered_skills": [],
|
|
20
|
+
"installed_at": "2026-09-03T21:13:31.329149+00:00"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Git Branching Workflow Extension
|
|
2
|
+
|
|
3
|
+
Git repository initialization, feature branch creation, numbering (sequential/timestamp), validation, remote detection, and auto-commit for Duaer.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This extension provides Git operations as an optional, self-contained module. It manages:
|
|
8
|
+
|
|
9
|
+
- **Repository initialization** with configurable commit messages
|
|
10
|
+
- **Feature branch creation** with sequential (`001-feature-name`) or timestamp (`20260319-143022-feature-name`) numbering and optional templates for branch namespaces
|
|
11
|
+
- **Branch validation** to ensure branches follow naming conventions
|
|
12
|
+
- **Git remote detection** for GitHub integration (e.g., issue creation)
|
|
13
|
+
- **Auto-commit** after core commands (configurable per-command with custom messages, or Conventional Commit messages generated by the agent)
|
|
14
|
+
|
|
15
|
+
## Commands
|
|
16
|
+
|
|
17
|
+
| Command | Description |
|
|
18
|
+
|---------|-------------|
|
|
19
|
+
| `duaer.git.initialize` | Initialize a Git repository with a configurable commit message |
|
|
20
|
+
| `duaer.git.feature` | Create a feature branch with sequential or timestamp numbering |
|
|
21
|
+
| `duaer.git.validate` | Validate current branch follows feature branch naming conventions |
|
|
22
|
+
| `duaer.git.remote` | Detect Git remote URL for GitHub integration |
|
|
23
|
+
| `duaer.git.commit` | Auto-commit changes (configurable per-command enable/disable and messages) |
|
|
24
|
+
|
|
25
|
+
## Hooks
|
|
26
|
+
|
|
27
|
+
| Event | Command | Optional | Description |
|
|
28
|
+
|-------|---------|----------|-------------|
|
|
29
|
+
| `before_constitution` | `duaer.git.initialize` | No | Init git repo before constitution |
|
|
30
|
+
| `before_specify` | `duaer.git.feature` | No | Create feature branch before specification |
|
|
31
|
+
| `before_clarify` | `duaer.git.commit` | Yes | Commit outstanding changes before clarification |
|
|
32
|
+
| `before_plan` | `duaer.git.commit` | Yes | Commit outstanding changes before planning |
|
|
33
|
+
| `before_tasks` | `duaer.git.commit` | Yes | Commit outstanding changes before task generation |
|
|
34
|
+
| `before_implement` | `duaer.git.commit` | Yes | Commit outstanding changes before implementation |
|
|
35
|
+
| `before_checklist` | `duaer.git.commit` | Yes | Commit outstanding changes before checklist |
|
|
36
|
+
| `before_analyze` | `duaer.git.commit` | Yes | Commit outstanding changes before analysis |
|
|
37
|
+
| `before_taskstoissues` | `duaer.git.commit` | Yes | Commit outstanding changes before issue sync |
|
|
38
|
+
| `after_constitution` | `duaer.git.commit` | Yes | Auto-commit after constitution update |
|
|
39
|
+
| `after_specify` | `duaer.git.commit` | Yes | Auto-commit after specification |
|
|
40
|
+
| `after_clarify` | `duaer.git.commit` | Yes | Auto-commit after clarification |
|
|
41
|
+
| `after_plan` | `duaer.git.commit` | Yes | Auto-commit after planning |
|
|
42
|
+
| `after_tasks` | `duaer.git.commit` | Yes | Auto-commit after task generation |
|
|
43
|
+
| `after_implement` | `duaer.git.commit` | Yes | Auto-commit after implementation |
|
|
44
|
+
| `after_checklist` | `duaer.git.commit` | Yes | Auto-commit after checklist |
|
|
45
|
+
| `after_analyze` | `duaer.git.commit` | Yes | Auto-commit after analysis |
|
|
46
|
+
| `after_taskstoissues` | `duaer.git.commit` | Yes | Auto-commit after issue sync |
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
Configuration is stored in `.duaer/extensions/git/git-config.yml`:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
# Branch numbering strategy: "sequential" or "timestamp"
|
|
54
|
+
branch_numbering: sequential
|
|
55
|
+
|
|
56
|
+
# Optional branch name template. Leave empty for the default "{number}-{slug}".
|
|
57
|
+
# Supported tokens: {author}, {app}, {number}, {slug}; {slug} must not appear
|
|
58
|
+
# before {number}, and the final path segment must start with {number}-.
|
|
59
|
+
# Example for monorepos: "{author}/{app}/{number}-{slug}"
|
|
60
|
+
branch_template: ""
|
|
61
|
+
|
|
62
|
+
# Optional shorthand namespace. Leave empty to use branch_template/default behavior.
|
|
63
|
+
# Example: "features/{app}" expands to "features/{app}/{number}-{slug}"
|
|
64
|
+
branch_prefix: ""
|
|
65
|
+
|
|
66
|
+
# Custom commit message for git init
|
|
67
|
+
init_commit_message: "[Duaer] Initial commit"
|
|
68
|
+
|
|
69
|
+
# Commit message style for auto-commit hooks: "fixed" (default) uses the
|
|
70
|
+
# messages below; "conventional" asks the agent to generate a Conventional
|
|
71
|
+
# Commit message (e.g. "feat: add OAuth spec") from the diff instead.
|
|
72
|
+
commit_style: fixed
|
|
73
|
+
|
|
74
|
+
# Auto-commit per command (all disabled by default)
|
|
75
|
+
# Example: enable auto-commit after specify
|
|
76
|
+
auto_commit:
|
|
77
|
+
default: false
|
|
78
|
+
after_specify:
|
|
79
|
+
enabled: true
|
|
80
|
+
message: "[Duaer] Add specification"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`{author}` is derived from Git config and sanitized for branch names. `{app}` is derived from the Duaer init directory name. Custom templates must not put `{slug}` before `{number}`, and must put `{number}-` at the start of the final path segment so generated names remain valid feature branches. For a monorepo project at `apps/web/.duaer/`, a template such as `{author}/{app}/{number}-{slug}` produces branches like `jdoe/web/008-guided-tour`.
|
|
84
|
+
|
|
85
|
+
For simple namespace-only customization, `branch_prefix` is also accepted as a shorthand and expands to `<branch_prefix>/{number}-{slug}`.
|
|
86
|
+
|
|
87
|
+
## Installation
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Install the bundled git extension (no network required)
|
|
91
|
+
specify extension add git
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Disabling
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Disable the git extension (spec creation continues without branching)
|
|
98
|
+
specify extension disable git
|
|
99
|
+
|
|
100
|
+
# Re-enable it
|
|
101
|
+
specify extension enable git
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Graceful Degradation
|
|
105
|
+
|
|
106
|
+
When Git is not installed or the directory is not a Git repository:
|
|
107
|
+
- Spec directories are still created under `specs/`
|
|
108
|
+
- Branch creation is skipped with a warning
|
|
109
|
+
- Branch validation is skipped with a warning
|
|
110
|
+
- Remote detection returns empty results
|
|
111
|
+
|
|
112
|
+
## Scripts
|
|
113
|
+
|
|
114
|
+
The extension bundles cross-platform scripts:
|
|
115
|
+
|
|
116
|
+
- `scripts/bash/create-new-feature-branch.sh` — Bash implementation (branch creation only)
|
|
117
|
+
- `scripts/bash/git-common.sh` — Shared Git utilities (Bash)
|
|
118
|
+
- `scripts/powershell/create-new-feature-branch.ps1` — PowerShell implementation (branch creation only)
|
|
119
|
+
- `scripts/powershell/git-common.ps1` — Shared Git utilities (PowerShell)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Auto-commit changes after a Duaer command completes"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Auto-Commit Changes
|
|
6
|
+
|
|
7
|
+
Automatically stage and commit all changes after a Duaer command completes.
|
|
8
|
+
|
|
9
|
+
## Behavior
|
|
10
|
+
|
|
11
|
+
This command is invoked as a hook after (or before) core commands. It:
|
|
12
|
+
|
|
13
|
+
1. Determines the event name from the hook context (e.g., if invoked as an `after_specify` hook, the event is `after_specify`; if `before_plan`, the event is `before_plan`)
|
|
14
|
+
2. Checks `.duaer/extensions/git/git-config.yml` for the `auto_commit` section
|
|
15
|
+
3. Looks up the specific event key to see if auto-commit is enabled
|
|
16
|
+
4. Falls back to `auto_commit.default` if no event-specific key exists
|
|
17
|
+
5. Determines the commit message based on `commit_style` (see below)
|
|
18
|
+
6. If enabled and there are uncommitted changes, runs `git add .` + `git commit`
|
|
19
|
+
|
|
20
|
+
## Commit Message Styles
|
|
21
|
+
|
|
22
|
+
Controlled by the `commit_style` key in `.duaer/extensions/git/git-config.yml`:
|
|
23
|
+
|
|
24
|
+
- **`fixed`** (default): use the per-command `message` if configured, otherwise a generic `[Duaer] Auto-commit <phase> <command>` message.
|
|
25
|
+
- **`conventional`**: inspect the actual changes (`git diff` / `git status`) since the last commit and generate a single-line [Conventional Commit](https://www.conventionalcommits.org/) message (`type(scope): subject`, e.g. `feat: add OAuth specification` or `docs: update implementation plan`) that accurately summarizes the change. Write this message to a temporary file and pass the file's path to the script (see Execution below). The configured `message` values are ignored in this mode.
|
|
26
|
+
|
|
27
|
+
## Execution
|
|
28
|
+
|
|
29
|
+
Determine the event name from the hook that triggered this command, then run the script:
|
|
30
|
+
|
|
31
|
+
- **Bash**: `.duaer/extensions/git/scripts/bash/auto-commit.sh <event_name> [--message-file <path>]`
|
|
32
|
+
- **PowerShell**: `.duaer/extensions/git/scripts/powershell/auto-commit.ps1 <event_name> [-MessageFile <path>]`
|
|
33
|
+
|
|
34
|
+
Replace `<event_name>` with the actual hook event (e.g., `after_specify`, `before_plan`, `after_implement`). Only pass a generated message when `commit_style: conventional` is configured — first check `.duaer/extensions/git/git-config.yml` for the value of `commit_style`:
|
|
35
|
+
|
|
36
|
+
- If `conventional`: inspect the diff and generate a Conventional Commit message. **Do not interpolate the generated message directly into a shell command string** — its content is derived from repository changes and may contain characters (quotes, `$(...)`, backticks) that a shell would execute or that would break command quoting. Instead, write the message to a temporary file using your file-editing tool (not a shell `echo`/`printf`), then pass that file's path via `--message-file <path>` (Bash) or `-MessageFile <path>` (PowerShell).
|
|
37
|
+
- If `fixed` or absent: run the script with just `<event_name>`; it uses the configured/static message.
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
In `.duaer/extensions/git/git-config.yml`:
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
# "fixed" (default) uses the messages below; "conventional" asks the agent
|
|
45
|
+
# to generate a Conventional Commit message from the diff instead.
|
|
46
|
+
commit_style: fixed
|
|
47
|
+
|
|
48
|
+
auto_commit:
|
|
49
|
+
default: false # Global toggle — set true to enable for all commands
|
|
50
|
+
after_specify:
|
|
51
|
+
enabled: true # Override per-command
|
|
52
|
+
message: "[Duaer] Add specification"
|
|
53
|
+
after_plan:
|
|
54
|
+
enabled: false
|
|
55
|
+
message: "[Duaer] Add implementation plan"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Graceful Degradation
|
|
59
|
+
|
|
60
|
+
- If Git is not available or the current directory is not a repository: skips with a warning
|
|
61
|
+
- If no config file exists: skips (disabled by default)
|
|
62
|
+
- If no changes to commit: skips with a message
|
|
63
|
+
- If `commit_style: conventional` is set and no generated message was supplied: fails with a clear error instead of silently falling back to the fixed message format
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Create a feature branch with sequential or timestamp numbering"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Create Feature Branch
|
|
6
|
+
|
|
7
|
+
Create and switch to a new git feature branch for the given specification. This command handles **branch creation only** — the spec directory and files are created by the core `__SPECKIT_COMMAND_SPECIFY__` workflow.
|
|
8
|
+
|
|
9
|
+
## User Input
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
16
|
+
|
|
17
|
+
## Environment Variable Override
|
|
18
|
+
|
|
19
|
+
If the user explicitly provided `GIT_BRANCH_NAME` (e.g., via environment variable, argument, or in their request), pass it through to the script by setting the `GIT_BRANCH_NAME` environment variable before invoking the script. When `GIT_BRANCH_NAME` is set:
|
|
20
|
+
- The script uses the exact value as the branch name, bypassing all prefix/suffix generation
|
|
21
|
+
- `--short-name`, `--number`, and `--timestamp` flags are ignored
|
|
22
|
+
- `FEATURE_NUM` is extracted when the final path segment starts with a numeric or timestamp feature marker (for example `042-name`, `feat/042-name`, or `jdoe/app/042-name`), otherwise set to the full branch name
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
- Verify Git is available by running `git rev-parse --is-inside-work-tree 2>/dev/null`
|
|
27
|
+
- If Git is not available, warn the user and skip branch creation
|
|
28
|
+
|
|
29
|
+
## Branch Numbering Mode
|
|
30
|
+
|
|
31
|
+
Determine the branch numbering strategy by checking configuration in this order:
|
|
32
|
+
|
|
33
|
+
1. Check `.duaer/extensions/git/git-config.yml` for `branch_numbering` value
|
|
34
|
+
2. Check `.duaer/init-options.json` for `feature_numbering` value (inherit from core)
|
|
35
|
+
3. Check `.duaer/init-options.json` for `branch_numbering` value (deprecated, backward compatibility — will be removed in a future release)
|
|
36
|
+
4. Default to `sequential` if none of the above exist
|
|
37
|
+
|
|
38
|
+
## Branch Name Template
|
|
39
|
+
|
|
40
|
+
Check `.duaer/extensions/git/git-config.yml` for an optional `branch_template` value. If it is empty or missing, use the default branch shape `{number}-{slug}`. If it is set, `{slug}` must not appear before `{number}`, its final path segment must start with `{number}-`, and the script expands these tokens:
|
|
41
|
+
|
|
42
|
+
- `{author}`: sanitized Git config author (`user.name`, falling back to the email local part)
|
|
43
|
+
- `{app}`: sanitized Duaer init directory name
|
|
44
|
+
- `{number}`: sequential number or timestamp
|
|
45
|
+
- `{slug}`: generated short branch slug
|
|
46
|
+
|
|
47
|
+
For monorepos, a template such as `{author}/{app}/{number}-{slug}` creates names like `jdoe/web/008-guided-tour` while preserving per-project feature numbering.
|
|
48
|
+
|
|
49
|
+
The script also accepts `branch_prefix` as a shorthand for simple namespaces; it expands to `<branch_prefix>/{number}-{slug}`.
|
|
50
|
+
|
|
51
|
+
## Execution
|
|
52
|
+
|
|
53
|
+
Generate a concise short name (2-4 words) for the branch:
|
|
54
|
+
- Analyze the feature description and extract the most meaningful keywords
|
|
55
|
+
- Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
|
|
56
|
+
- Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
|
|
57
|
+
|
|
58
|
+
Run the appropriate script based on your platform:
|
|
59
|
+
|
|
60
|
+
- **Bash**: `.duaer/extensions/git/scripts/bash/create-new-feature-branch.sh --json --short-name "<short-name>" "<feature description>"`
|
|
61
|
+
- **Bash (timestamp)**: `.duaer/extensions/git/scripts/bash/create-new-feature-branch.sh --json --timestamp --short-name "<short-name>" "<feature description>"`
|
|
62
|
+
- **PowerShell**: `.duaer/extensions/git/scripts/powershell/create-new-feature-branch.ps1 -Json -ShortName "<short-name>" "<feature description>"`
|
|
63
|
+
- **PowerShell (timestamp)**: `.duaer/extensions/git/scripts/powershell/create-new-feature-branch.ps1 -Json -Timestamp -ShortName "<short-name>" "<feature description>"`
|
|
64
|
+
|
|
65
|
+
**IMPORTANT**:
|
|
66
|
+
- Do NOT pass `--number` — the script determines the correct next number automatically
|
|
67
|
+
- Always include the JSON flag (`--json` for Bash, `-Json` for PowerShell) so the output can be parsed reliably
|
|
68
|
+
- You must only ever run this script once per feature
|
|
69
|
+
- The JSON output will contain `BRANCH_NAME` and `FEATURE_NUM`
|
|
70
|
+
- Do not manually expand `branch_template`; the script reads the git extension config and applies it consistently
|
|
71
|
+
|
|
72
|
+
## Graceful Degradation
|
|
73
|
+
|
|
74
|
+
If Git is not installed or the current directory is not a Git repository:
|
|
75
|
+
- Branch creation is skipped with a warning: `[specify] Warning: Git repository not detected; skipped branch creation`
|
|
76
|
+
- The script still outputs `BRANCH_NAME` and `FEATURE_NUM` so the caller can reference them
|
|
77
|
+
|
|
78
|
+
## Output
|
|
79
|
+
|
|
80
|
+
The script outputs JSON with:
|
|
81
|
+
- `BRANCH_NAME`: The branch name (e.g., `003-user-auth`, `20260319-143022-user-auth`, or `jdoe/web/003-user-auth`)
|
|
82
|
+
- `FEATURE_NUM`: The numeric or timestamp prefix used
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Initialize a Git repository with an initial commit"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Initialize Git Repository
|
|
6
|
+
|
|
7
|
+
Initialize a Git repository in the current project directory if one does not already exist.
|
|
8
|
+
|
|
9
|
+
## Execution
|
|
10
|
+
|
|
11
|
+
Run the appropriate script from the project root:
|
|
12
|
+
|
|
13
|
+
- **Bash**: `.duaer/extensions/git/scripts/bash/initialize-repo.sh`
|
|
14
|
+
- **PowerShell**: `.duaer/extensions/git/scripts/powershell/initialize-repo.ps1`
|
|
15
|
+
|
|
16
|
+
If the extension scripts are not found, fall back to:
|
|
17
|
+
- **Bash**: `git init && git add . && git commit -m "Initial commit from Specify template"`
|
|
18
|
+
- **PowerShell**: `git init; git add .; git commit -m "Initial commit from Specify template"`
|
|
19
|
+
|
|
20
|
+
The script handles all checks internally:
|
|
21
|
+
- Skips if Git is not available
|
|
22
|
+
- Skips if already inside a Git repository
|
|
23
|
+
- Runs `git init`, `git add .`, and `git commit` with an initial commit message
|
|
24
|
+
|
|
25
|
+
## Customization
|
|
26
|
+
|
|
27
|
+
Replace the script to add project-specific Git initialization steps:
|
|
28
|
+
- Custom `.gitignore` templates
|
|
29
|
+
- Default branch naming (`git config init.defaultBranch`)
|
|
30
|
+
- Git LFS setup
|
|
31
|
+
- Git hooks installation
|
|
32
|
+
- Commit signing configuration
|
|
33
|
+
- Git Flow initialization
|
|
34
|
+
|
|
35
|
+
## Output
|
|
36
|
+
|
|
37
|
+
On success:
|
|
38
|
+
- `[OK] Git repository initialized`
|
|
39
|
+
|
|
40
|
+
## Graceful Degradation
|
|
41
|
+
|
|
42
|
+
If Git is not installed:
|
|
43
|
+
- Warn the user
|
|
44
|
+
- Skip repository initialization
|
|
45
|
+
- The project continues to function without Git (specs can still be created under `specs/`)
|
|
46
|
+
|
|
47
|
+
If Git is installed but `git init`, `git add .`, or `git commit` fails:
|
|
48
|
+
- Surface the error to the user
|
|
49
|
+
- Stop this command rather than continuing with a partially initialized repository
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Detect Git remote URL for GitHub integration"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Detect Git Remote URL
|
|
6
|
+
|
|
7
|
+
Detect the Git remote URL for integration with GitHub services (e.g., issue creation).
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- Check if Git is available by running `git rev-parse --is-inside-work-tree 2>/dev/null`
|
|
12
|
+
- If Git is not available, output a warning and return empty:
|
|
13
|
+
```
|
|
14
|
+
[specify] Warning: Git repository not detected; cannot determine remote URL
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Execution
|
|
18
|
+
|
|
19
|
+
Run the following command to get the remote URL:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git config --get remote.origin.url
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
|
|
27
|
+
Parse the remote URL and determine:
|
|
28
|
+
|
|
29
|
+
1. **Repository owner**: Extract from the URL (e.g., `github` from `https://github.com/github/duaer-spec.git`)
|
|
30
|
+
2. **Repository name**: Extract from the URL (e.g., `duaer-spec` from `https://github.com/github/duaer-spec.git`)
|
|
31
|
+
3. **Is GitHub**: Whether the remote points to a GitHub repository
|
|
32
|
+
|
|
33
|
+
Supported URL formats:
|
|
34
|
+
- HTTPS: `https://github.com/<owner>/<repo>.git`
|
|
35
|
+
- SSH: `git@github.com:<owner>/<repo>.git`
|
|
36
|
+
|
|
37
|
+
> [!CAUTION]
|
|
38
|
+
> ONLY report a GitHub repository if the remote URL actually points to github.com.
|
|
39
|
+
> Do NOT assume the remote is GitHub if the URL format doesn't match.
|
|
40
|
+
|
|
41
|
+
## Graceful Degradation
|
|
42
|
+
|
|
43
|
+
If Git is not installed, the directory is not a Git repository, or no remote is configured:
|
|
44
|
+
- Return an empty result
|
|
45
|
+
- Do NOT error — other workflows should continue without Git remote information
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Validate current branch follows feature branch naming conventions"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Validate Feature Branch
|
|
6
|
+
|
|
7
|
+
Validate that the current Git branch follows the expected feature branch naming conventions.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
- Check if Git is available by running `git rev-parse --is-inside-work-tree 2>/dev/null`
|
|
12
|
+
- If Git is not available, output a warning and skip validation:
|
|
13
|
+
```
|
|
14
|
+
[specify] Warning: Git repository not detected; skipped branch validation
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Validation Rules
|
|
18
|
+
|
|
19
|
+
Get the current branch name:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git rev-parse --abbrev-ref HEAD
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The branch name's final path segment must start with one of these feature markers:
|
|
26
|
+
|
|
27
|
+
1. **Sequential**: `[0-9]{3,}-` (e.g., `001-feature-name`, `042-fix-bug`, `1000-big-feature`, `jdoe/web/008-guided-tour`)
|
|
28
|
+
2. **Timestamp**: `[0-9]{8}-[0-9]{6}-` (e.g., `20260319-143022-feature-name`, `jdoe/web/20260319-143022-feature-name`)
|
|
29
|
+
|
|
30
|
+
## Execution
|
|
31
|
+
|
|
32
|
+
If on a feature branch (matches either pattern):
|
|
33
|
+
- Output: `✓ On feature branch: <branch-name>`
|
|
34
|
+
- Check if the corresponding spec directory exists under `specs/`:
|
|
35
|
+
- For sequential branches, look for `specs/<prefix>-*` where prefix matches the numeric portion, regardless of branch namespace prefixes
|
|
36
|
+
- For timestamp branches, look for `specs/<prefix>-*` where prefix matches the `YYYYMMDD-HHMMSS` portion, regardless of branch namespace prefixes
|
|
37
|
+
- If spec directory exists: `✓ Spec directory found: <path>`
|
|
38
|
+
- If spec directory missing: `⚠ No spec directory found for prefix <prefix>`
|
|
39
|
+
|
|
40
|
+
If NOT on a feature branch:
|
|
41
|
+
- Output: `✗ Not on a feature branch. Current branch: <branch-name>`
|
|
42
|
+
- Output: `Feature branches should be named like: 001-feature-name, 20260319-143022-feature-name, or <namespace>/001-feature-name`
|
|
43
|
+
|
|
44
|
+
## Graceful Degradation
|
|
45
|
+
|
|
46
|
+
If Git is not installed or the directory is not a Git repository:
|
|
47
|
+
- Check the `SPECIFY_FEATURE` environment variable as a fallback
|
|
48
|
+
- If set, validate that value against the naming patterns
|
|
49
|
+
- If not set, skip validation with a warning
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Git Branching Workflow Extension Configuration
|
|
2
|
+
# Copied to .duaer/extensions/git/git-config.yml on install
|
|
3
|
+
|
|
4
|
+
# Branch numbering strategy: "sequential" (001, 002, ...) or "timestamp" (YYYYMMDD-HHMMSS)
|
|
5
|
+
branch_numbering: sequential
|
|
6
|
+
|
|
7
|
+
# Optional branch name template. Leave empty for the default "{number}-{slug}".
|
|
8
|
+
# Supported tokens: {author}, {app}, {number}, {slug}
|
|
9
|
+
# {slug} must not appear before {number}; final path segment must start with {number}-.
|
|
10
|
+
# Example for monorepos: "{author}/{app}/{number}-{slug}"
|
|
11
|
+
branch_template: ""
|
|
12
|
+
|
|
13
|
+
# Optional shorthand namespace. Leave empty to use branch_template/default behavior.
|
|
14
|
+
# Example: "features/{app}" expands to "features/{app}/{number}-{slug}"
|
|
15
|
+
branch_prefix: ""
|
|
16
|
+
|
|
17
|
+
# Commit message used by `git commit` during repository initialization
|
|
18
|
+
init_commit_message: "[Duaer] Initial commit"
|
|
19
|
+
|
|
20
|
+
# Commit message style used by auto-commit hooks (duaer.git.commit):
|
|
21
|
+
# "fixed" - default; use the configured/static messages below.
|
|
22
|
+
# "conventional" - ask the agent to inspect the diff and generate a
|
|
23
|
+
# Conventional Commit message (e.g. "feat: add OAuth spec")
|
|
24
|
+
# instead of using the messages configured below.
|
|
25
|
+
commit_style: fixed
|
|
26
|
+
|
|
27
|
+
# Auto-commit before/after core commands.
|
|
28
|
+
# Set "default" to enable for all commands, then override per-command.
|
|
29
|
+
# Each key can be true/false. Message is customizable per-command.
|
|
30
|
+
auto_commit:
|
|
31
|
+
default: false
|
|
32
|
+
before_clarify:
|
|
33
|
+
enabled: false
|
|
34
|
+
message: "[Duaer] Save progress before clarification"
|
|
35
|
+
before_plan:
|
|
36
|
+
enabled: false
|
|
37
|
+
message: "[Duaer] Save progress before planning"
|
|
38
|
+
before_tasks:
|
|
39
|
+
enabled: false
|
|
40
|
+
message: "[Duaer] Save progress before task generation"
|
|
41
|
+
before_implement:
|
|
42
|
+
enabled: false
|
|
43
|
+
message: "[Duaer] Save progress before implementation"
|
|
44
|
+
before_checklist:
|
|
45
|
+
enabled: false
|
|
46
|
+
message: "[Duaer] Save progress before checklist"
|
|
47
|
+
before_analyze:
|
|
48
|
+
enabled: false
|
|
49
|
+
message: "[Duaer] Save progress before analysis"
|
|
50
|
+
before_taskstoissues:
|
|
51
|
+
enabled: false
|
|
52
|
+
message: "[Duaer] Save progress before issue sync"
|
|
53
|
+
after_constitution:
|
|
54
|
+
enabled: false
|
|
55
|
+
message: "[Duaer] Add project constitution"
|
|
56
|
+
after_specify:
|
|
57
|
+
enabled: false
|
|
58
|
+
message: "[Duaer] Add specification"
|
|
59
|
+
after_clarify:
|
|
60
|
+
enabled: false
|
|
61
|
+
message: "[Duaer] Clarify specification"
|
|
62
|
+
after_plan:
|
|
63
|
+
enabled: false
|
|
64
|
+
message: "[Duaer] Add implementation plan"
|
|
65
|
+
after_tasks:
|
|
66
|
+
enabled: false
|
|
67
|
+
message: "[Duaer] Add tasks"
|
|
68
|
+
after_implement:
|
|
69
|
+
enabled: false
|
|
70
|
+
message: "[Duaer] Implementation progress"
|
|
71
|
+
after_checklist:
|
|
72
|
+
enabled: false
|
|
73
|
+
message: "[Duaer] Add checklist"
|
|
74
|
+
after_analyze:
|
|
75
|
+
enabled: false
|
|
76
|
+
message: "[Duaer] Add analysis report"
|
|
77
|
+
after_taskstoissues:
|
|
78
|
+
enabled: false
|
|
79
|
+
message: "[Duaer] Sync tasks to issues"
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
schema_version: "1.0"
|
|
2
|
+
|
|
3
|
+
extension:
|
|
4
|
+
id: git
|
|
5
|
+
name: "Git Branching Workflow"
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
description: "Feature branch creation, numbering (sequential/timestamp), templating, validation, and Git remote detection"
|
|
8
|
+
author: duaer-spec-core
|
|
9
|
+
repository: https://github.com/github/duaer-spec
|
|
10
|
+
license: MIT
|
|
11
|
+
|
|
12
|
+
requires:
|
|
13
|
+
speckit_version: ">=0.2.0"
|
|
14
|
+
tools:
|
|
15
|
+
- name: git
|
|
16
|
+
required: false
|
|
17
|
+
|
|
18
|
+
provides:
|
|
19
|
+
commands:
|
|
20
|
+
- name: duaer.git.feature
|
|
21
|
+
file: commands/duaer.git.feature.md
|
|
22
|
+
description: "Create a feature branch with sequential or timestamp numbering and optional templates"
|
|
23
|
+
- name: duaer.git.validate
|
|
24
|
+
file: commands/duaer.git.validate.md
|
|
25
|
+
description: "Validate current branch follows feature branch naming conventions"
|
|
26
|
+
- name: duaer.git.remote
|
|
27
|
+
file: commands/duaer.git.remote.md
|
|
28
|
+
description: "Detect Git remote URL for GitHub integration"
|
|
29
|
+
- name: duaer.git.initialize
|
|
30
|
+
file: commands/duaer.git.initialize.md
|
|
31
|
+
description: "Initialize a Git repository with an initial commit"
|
|
32
|
+
- name: duaer.git.commit
|
|
33
|
+
file: commands/duaer.git.commit.md
|
|
34
|
+
description: "Auto-commit changes after a Duaer command completes"
|
|
35
|
+
|
|
36
|
+
config:
|
|
37
|
+
- name: "git-config.yml"
|
|
38
|
+
template: "config-template.yml"
|
|
39
|
+
description: "Git branching configuration"
|
|
40
|
+
required: false
|
|
41
|
+
|
|
42
|
+
hooks:
|
|
43
|
+
before_constitution:
|
|
44
|
+
command: duaer.git.initialize
|
|
45
|
+
optional: false
|
|
46
|
+
description: "Initialize Git repository before constitution setup"
|
|
47
|
+
before_specify:
|
|
48
|
+
command: duaer.git.feature
|
|
49
|
+
optional: false
|
|
50
|
+
description: "Create feature branch before specification"
|
|
51
|
+
before_clarify:
|
|
52
|
+
command: duaer.git.commit
|
|
53
|
+
optional: true
|
|
54
|
+
prompt: "Commit outstanding changes before clarification?"
|
|
55
|
+
description: "Auto-commit before spec clarification"
|
|
56
|
+
before_plan:
|
|
57
|
+
command: duaer.git.commit
|
|
58
|
+
optional: true
|
|
59
|
+
prompt: "Commit outstanding changes before planning?"
|
|
60
|
+
description: "Auto-commit before implementation planning"
|
|
61
|
+
before_tasks:
|
|
62
|
+
command: duaer.git.commit
|
|
63
|
+
optional: true
|
|
64
|
+
prompt: "Commit outstanding changes before task generation?"
|
|
65
|
+
description: "Auto-commit before task generation"
|
|
66
|
+
before_implement:
|
|
67
|
+
command: duaer.git.commit
|
|
68
|
+
optional: true
|
|
69
|
+
prompt: "Commit outstanding changes before implementation?"
|
|
70
|
+
description: "Auto-commit before implementation"
|
|
71
|
+
before_checklist:
|
|
72
|
+
command: duaer.git.commit
|
|
73
|
+
optional: true
|
|
74
|
+
prompt: "Commit outstanding changes before checklist?"
|
|
75
|
+
description: "Auto-commit before checklist generation"
|
|
76
|
+
before_analyze:
|
|
77
|
+
command: duaer.git.commit
|
|
78
|
+
optional: true
|
|
79
|
+
prompt: "Commit outstanding changes before analysis?"
|
|
80
|
+
description: "Auto-commit before analysis"
|
|
81
|
+
before_taskstoissues:
|
|
82
|
+
command: duaer.git.commit
|
|
83
|
+
optional: true
|
|
84
|
+
prompt: "Commit outstanding changes before issue sync?"
|
|
85
|
+
description: "Auto-commit before tasks-to-issues conversion"
|
|
86
|
+
after_constitution:
|
|
87
|
+
command: duaer.git.commit
|
|
88
|
+
optional: true
|
|
89
|
+
prompt: "Commit constitution changes?"
|
|
90
|
+
description: "Auto-commit after constitution update"
|
|
91
|
+
after_specify:
|
|
92
|
+
command: duaer.git.commit
|
|
93
|
+
optional: true
|
|
94
|
+
prompt: "Commit specification changes?"
|
|
95
|
+
description: "Auto-commit after specification"
|
|
96
|
+
after_clarify:
|
|
97
|
+
command: duaer.git.commit
|
|
98
|
+
optional: true
|
|
99
|
+
prompt: "Commit clarification changes?"
|
|
100
|
+
description: "Auto-commit after spec clarification"
|
|
101
|
+
after_plan:
|
|
102
|
+
command: duaer.git.commit
|
|
103
|
+
optional: true
|
|
104
|
+
prompt: "Commit plan changes?"
|
|
105
|
+
description: "Auto-commit after implementation planning"
|
|
106
|
+
after_tasks:
|
|
107
|
+
command: duaer.git.commit
|
|
108
|
+
optional: true
|
|
109
|
+
prompt: "Commit task changes?"
|
|
110
|
+
description: "Auto-commit after task generation"
|
|
111
|
+
after_implement:
|
|
112
|
+
command: duaer.git.commit
|
|
113
|
+
optional: true
|
|
114
|
+
prompt: "Commit implementation changes?"
|
|
115
|
+
description: "Auto-commit after implementation"
|
|
116
|
+
after_checklist:
|
|
117
|
+
command: duaer.git.commit
|
|
118
|
+
optional: true
|
|
119
|
+
prompt: "Commit checklist changes?"
|
|
120
|
+
description: "Auto-commit after checklist generation"
|
|
121
|
+
after_analyze:
|
|
122
|
+
command: duaer.git.commit
|
|
123
|
+
optional: true
|
|
124
|
+
prompt: "Commit analysis results?"
|
|
125
|
+
description: "Auto-commit after analysis"
|
|
126
|
+
after_taskstoissues:
|
|
127
|
+
command: duaer.git.commit
|
|
128
|
+
optional: true
|
|
129
|
+
prompt: "Commit after syncing issues?"
|
|
130
|
+
description: "Auto-commit after tasks-to-issues conversion"
|
|
131
|
+
|
|
132
|
+
tags:
|
|
133
|
+
- "git"
|
|
134
|
+
- "branching"
|
|
135
|
+
- "workflow"
|
|
136
|
+
|
|
137
|
+
config:
|
|
138
|
+
defaults:
|
|
139
|
+
branch_numbering: sequential
|
|
140
|
+
branch_template: ""
|
|
141
|
+
branch_prefix: ""
|
|
142
|
+
init_commit_message: "[Duaer] Initial commit"
|