Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
700c360
perf: optimize startup performance with metadata tracking and update …
djm81 Jan 27, 2026
4b167dd
Merge branch 'main' into dev
djm81 Jan 27, 2026
e4782ea
fix: add missing ADO field mappings and assignee display (#145)
djm81 Jan 27, 2026
a2f6ac7
Merge branch 'main' into dev
djm81 Jan 27, 2026
c74a773
fix: mitigate code scanning vulnerabilities (#148)
djm81 Jan 27, 2026
af030dc
fix: detect GitHub remotes using ssh:// and git:// URLs
djm81 Jan 27, 2026
db827a0
chore: bump version to 0.26.9 and update changelog
djm81 Jan 27, 2026
1ade334
Merge branch 'main' into dev
djm81 Jan 27, 2026
5c1cb41
fix: compare GitHub SSH hostnames case-insensitively
djm81 Jan 27, 2026
68cc345
Merge branch 'main' into dev
djm81 Jan 27, 2026
dfeb7ca
Add openspec and workflow commands for transparency
djm81 Jan 27, 2026
9e1f22d
Add specs from openspec
djm81 Jan 27, 2026
115e402
Remove aisp change which wasn't implemented
djm81 Jan 27, 2026
2675361
Fix openspec gitignore pattern
djm81 Jan 27, 2026
573fb7b
Update gitignore
djm81 Jan 27, 2026
907501e
Update contribution standards to use openspec for SDD
djm81 Jan 27, 2026
568000c
Merge branch 'main' into dev
djm81 Jan 27, 2026
fe082f6
Migrate to new opsx openspec commands
djm81 Jan 27, 2026
036afbe
Migrate workflow and openspec config
djm81 Jan 28, 2026
5a1493f
fix: bump version to 0.26.10 for PyPI publish
djm81 Jan 28, 2026
da606a1
Update version and changelog
djm81 Jan 28, 2026
608f317
Add canonical user-friendly workitem url for ado workitems
djm81 Jan 28, 2026
719256c
Update to support OSPX
djm81 Jan 28, 2026
1f94d7c
Merge branch 'main' into dev
djm81 Jan 28, 2026
bbf730a
feat(backlog): implement refine --import-from-tmp and fix type-check …
djm81 Jan 28, 2026
080743a
Merge branch 'main' into dev
djm81 Jan 28, 2026
5ab46a5
Merge branch 'main' into dev
djm81 Jan 28, 2026
1cdfc66
feat: debug logs under ~/.specfact/logs and release 0.26.13 (#159)
djm81 Jan 29, 2026
6bd9d7f
Potential fix for pull request finding 'Empty except'
djm81 Jan 29, 2026
d7d194b
Fix unused variable review
djm81 Jan 29, 2026
39563fc
Fix unused variable review
djm81 Jan 29, 2026
d15485a
Fix type and test errors
djm81 Jan 29, 2026
6c9c9b9
Merge branch 'main' into dev
djm81 Jan 29, 2026
bd9b96a
Finalize change
djm81 Jan 29, 2026
c7e4546
Change for debug logs archived
djm81 Jan 29, 2026
09e8040
Merge branch 'main' into dev
djm81 Jan 29, 2026
642e1a9
fix: improve ADO backlog refine error logging and user-facing error U…
djm81 Jan 29, 2026
64365db
Merge branch 'main' into dev
djm81 Jan 29, 2026
0d0abba
feat: backlog refine --ignore-refined and --id, startup docs (fixes #…
djm81 Jan 30, 2026
aad02cd
Add change proposals for full scrum support
djm81 Jan 30, 2026
a3c3fb4
Merge branch 'main' into dev
djm81 Jan 30, 2026
1f054c5
Add support for systematic, structured issue creation with copilot help
djm81 Jan 30, 2026
899b9c2
feat(backlog): daily standup defaults, iteration/sprint, unassigned i…
djm81 Feb 3, 2026
b596766
Issue 179 resolution (#180)
djm81 Feb 3, 2026
bb7214f
Merge branch 'main' into dev
djm81 Feb 3, 2026
61a820c
fix(backlog): address CodeQL/Codex PR 181 findings
djm81 Feb 3, 2026
10fee30
Update openspec enforcement rules
djm81 Feb 3, 2026
8e770dc
Structure openspec changes
djm81 Feb 3, 2026
5782860
Fix ruff finding
djm81 Feb 3, 2026
05c592d
Fix linter issues with StrEnum and parameters
djm81 Feb 3, 2026
f7e3d0f
Fix tests and depcreation warnings
djm81 Feb 3, 2026
15d710b
Improve sync script
djm81 Feb 3, 2026
b223161
Merge branch 'main' into dev
djm81 Feb 3, 2026
870db6a
Add change for modular command registry
djm81 Feb 3, 2026
5404c18
Fix review finding on dev sync script
djm81 Feb 3, 2026
e4650dd
Update modular change proposal
djm81 Feb 4, 2026
c44013e
feat: CLI modular command registry and lazy load (arch-01) (#196)
djm81 Feb 4, 2026
542183c
docs: document CLI modules design; sync version and cleanup
djm81 Feb 4, 2026
c4b10d8
Archive modular change and specs
djm81 Feb 4, 2026
a7a83c2
Merge branch 'main' into dev
djm81 Feb 4, 2026
2faf547
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 4, 2026
b5d2680
Fix banner display on help screen
djm81 Feb 4, 2026
077ff3f
Improve action runner on main
djm81 Feb 4, 2026
7567149
Merge branch 'main' into dev
djm81 Feb 4, 2026
8a0a38f
Setup claude skills and instructions
djm81 Feb 5, 2026
336efb5
feat: module package separation for command implementations (#200)
djm81 Feb 6, 2026
ad023f5
Merge branch 'main' into dev
djm81 Feb 6, 2026
8b4adcb
fix: address CodeQL and Codex review findings from PR #201
djm81 Feb 6, 2026
b44ce9c
Merge branch 'main' into dev
djm81 Feb 6, 2026
a6b9d32
feat: module lifecycle management, init split, and interactive module…
djm81 Feb 6, 2026
de89bba
archived change for module improvements
djm81 Feb 6, 2026
b4edcfb
Merge branch 'main' into dev
djm81 Feb 6, 2026
bc71080
fix: address review feedback in init and boundary tests
djm81 Feb 6, 2026
e5d7002
Fix test setup for tmpfiles
djm81 Feb 6, 2026
c97080b
Merge branch 'main' into dev
djm81 Feb 6, 2026
46b1357
docs: add openspec change arch-05 bridge registry (#210)
djm81 Feb 8, 2026
20410a6
docs: add openspec change arch-06 manifest security (#211)
djm81 Feb 8, 2026
04aba4b
feat: Core Contracts and Module Interface Formalization (#209)
djm81 Feb 8, 2026
0f492f6
Update specs and archive arch-04 change
djm81 Feb 8, 2026
7656d7c
Fix changelog format
djm81 Feb 8, 2026
b826fb6
docs: align arch-05 scope with protocol migration cleanup (#212)
djm81 Feb 8, 2026
c8ec9bb
docs: add OpenSpec changes for module marketplace phases
djm81 Feb 9, 2026
b6e1fe1
feat: apply arch-05 bridge registry implementation (#216)
djm81 Feb 10, 2026
f10e14e
Archive arch-05 change after implementation
djm81 Feb 10, 2026
285a9ff
Merge branch 'main' into dev
djm81 Feb 10, 2026
5075d0c
fix: address post-merge review findings and restore lazy registration
djm81 Feb 10, 2026
31e6924
fix: refresh project console per invocation in tests
djm81 Feb 10, 2026
d7ca6af
fix: detect runtime interface protocol ops in source scan
djm81 Feb 10, 2026
0e5463f
fix: harden project console refresh and protocol source scan
djm81 Feb 10, 2026
57c729b
fix: refresh import command console for each invocation
djm81 Feb 10, 2026
e270e09
fix: resolve type-check errors and harden protocol scanning
djm81 Feb 10, 2026
7cc1c48
fix: stabilize module protocol scan and project console lifecycle
djm81 Feb 10, 2026
5996a1d
Merge branch 'main' into dev
djm81 Feb 10, 2026
81527a5
Refine pending changes for new modular ecosystem and marketplace inte…
djm81 Feb 10, 2026
6fd151a
fix: update stale spec-delta paths in tasks.md after change renames
djm81 Feb 10, 2026
22640fa
docs: rewrite CHANGE_ORDER.md for module-scoped changes and full depe…
djm81 Feb 10, 2026
e7d69d6
Merge branch 'main' into dev
djm81 Feb 10, 2026
9a7f9f6
feat(backlog): daily/refine comment context, interactive standup post…
djm81 Feb 11, 2026
e61d56b
fix(backlog): satisfy interactive daily adapter typing
djm81 Feb 11, 2026
fff65e9
fix(backlog): bypass default daily limit for issue-window flags
djm81 Feb 11, 2026
b2a8ab5
Merge branch 'main' into dev
djm81 Feb 11, 2026
88ea93c
fix: parse backlog refine writeback fields and refactor refine comman…
djm81 Feb 12, 2026
f3c5759
fix: avoid raw label fallback when description block is missing
djm81 Feb 12, 2026
f9f2fcc
Merge branch 'main' into dev
djm81 Feb 12, 2026
1870cfe
fix: harden backlog refine prompt scaffold and mixed-format parsing (…
djm81 Feb 12, 2026
16db526
Finish change
djm81 Feb 12, 2026
a3e8ff2
chore: bump version to 0.30.4 and update changelog
djm81 Feb 12, 2026
1bdcbc9
Merge branch 'main' into dev
djm81 Feb 12, 2026
998ab59
Add MEMORY.md for claude code
djm81 Feb 12, 2026
bedf75c
Archive backlog writeback field split change
djm81 Feb 12, 2026
6e66806
Archived flask support sidecar change
djm81 Feb 12, 2026
7d6c550
feat: add backlog-core module — dependency analysis and command suite…
djm81 Feb 13, 2026
4d1f950
Merge branch 'main' into dev
djm81 Feb 13, 2026
47ea3f4
fix(backlog-core): remove unused module io contract global
djm81 Feb 13, 2026
2509412
Fixed conflict
djm81 Feb 14, 2026
d8d17a5
fix: rename LICENSE.md to LICENSE for GitHub license detection (#233)
djm81 Feb 14, 2026
100c94f
fix: restore standard Apache 2.0 license text for GitHub detection (#…
djm81 Feb 14, 2026
002cf19
Merge branch 'main' into dev
djm81 Feb 14, 2026
ee0b766
Add openspec changes for architecture level enhancement
djm81 Feb 15, 2026
540c96a
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 15, 2026
ea430ab
Merge branch 'main' into dev
djm81 Feb 15, 2026
6dc73ca
Merge branch 'main' into dev
djm81 Feb 16, 2026
d621e91
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 16, 2026
1b06427
feat(ci): attach test and repro log artifacts to PR orchestrator runs…
djm81 Feb 16, 2026
0bc52a5
feat: enhanced module manifest security and integrity (arch-06) (#263)
djm81 Feb 16, 2026
3f09ee7
feat: Schema Extension System for Modular ProjectBundle Extensions (a…
djm81 Feb 16, 2026
e959e61
Merge branch 'main' into dev
djm81 Feb 16, 2026
ba08744
Fix codeql findings
djm81 Feb 16, 2026
a3a3b6a
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 16, 2026
87a499f
Merge branch 'main' into dev
djm81 Feb 17, 2026
faf3b2e
feat(workflow): standardize worktree-first development flow (#268)
djm81 Feb 17, 2026
5c72c9f
Fix review finding
djm81 Feb 17, 2026
c51e96e
Merge branch 'main' into dev
djm81 Feb 17, 2026
deb176a
feat: implement policy-engine-01 unified policy framework (#270)
djm81 Feb 18, 2026
22a19a9
fix: harden policy module imports and snapshot path resolution
djm81 Feb 18, 2026
2724dbd
Merge branch 'main' into dev
djm81 Feb 18, 2026
1970266
Update backlog core change to cover workspace level modules
djm81 Feb 18, 2026
806f765
feat(init): align init module discovery with registry (backlog-core-0…
djm81 Feb 18, 2026
87dafba
feat: add thorough codebase validation (validation-01, #163) (#272)
djm81 Feb 18, 2026
1aac44f
feat: add patch apply (local + --write with confirmation) [#177] (#273)
djm81 Feb 18, 2026
d835ffb
feat: add bundle-mapper module (bundle-mapper-01, #121) (#274)
djm81 Feb 18, 2026
85576de
Archive finished changes
djm81 Feb 18, 2026
94a8ed1
fix: implement verification-01 wave1 delta closure (#277)
djm81 Feb 18, 2026
0f4a77c
Archive delta validation change and update specs
djm81 Feb 18, 2026
e2c93d1
Update patch version
djm81 Feb 18, 2026
c1c41f5
Potential fix for pull request finding 'Empty except'
djm81 Feb 19, 2026
27063ba
apply review fixes
djm81 Feb 19, 2026
6350aa8
Merge branch 'main' into dev
djm81 Feb 19, 2026
767d5b8
Add cli validation changes
djm81 Feb 19, 2026
3f4e1a3
Merge branch 'main' into dev
djm81 Feb 19, 2026
4f4b2ff
feat: launch central module marketplace lifecycle (#287)
djm81 Feb 21, 2026
78ddf06
Merge branch 'main' into dev
djm81 Feb 21, 2026
6772f0a
fix: resolve bundle-mapper review defects with TDD evidence (#290)
djm81 Feb 22, 2026
4529df1
feat:Add architecture review docs and findings to mitigate
djm81 Feb 22, 2026
cc50388
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 22, 2026
53a0fce
feat(backlog): add backlog add for interactive issue creation (#289)
djm81 Feb 22, 2026
c651c42
chore(openspec): archive completed changes and align architecture doc…
djm81 Feb 22, 2026
d7e8199
docs(change): Archive architecture discrepancy remediation change
djm81 Feb 22, 2026
aa4a9fb
fix(codeql): preserve module contract marker and document fallback ex…
djm81 Feb 22, 2026
176cd09
Merge branch 'main' into dev
djm81 Feb 22, 2026
30e2bbe
fix(backlog): restore installed-runtime discovery parity and add back…
djm81 Feb 23, 2026
9f479e4
fix(version): sync manifests to 0.36.1 and archive backlog-core-04 (#…
djm81 Feb 23, 2026
37a4a30
Merge branch 'main' into dev
djm81 Feb 23, 2026
991d568
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 23, 2026
15194b8
fix: harden module lifecycle bootstrap and signing workflows (#299)
djm81 Feb 24, 2026
a819852
test: simplify monkeypatch callables in module_security tests
djm81 Feb 24, 2026
67cd7e9
Merge branch 'main' into dev
djm81 Feb 24, 2026
078012f
Fix duplicate with statement
djm81 Feb 24, 2026
fa0604a
Merge branch 'main' into dev
djm81 Feb 24, 2026
c3f5bb6
chore(release): bump to v0.37.1 and harden signature gates
djm81 Feb 24, 2026
c0692e9
test: fix init command regression assertions
djm81 Feb 24, 2026
7787ba7
Merge branch 'main' into dev
djm81 Feb 24, 2026
db8d153
fix: release v0.37.2 with runtime crypto deps
djm81 Feb 24, 2026
cce4cf7
fix: address signature-backend warning and module version drift
djm81 Feb 24, 2026
297fb6c
fix: use hatch build in PyPI publish workflow script (#304)
djm81 Feb 24, 2026
e63669c
Merge branch 'main' into dev
djm81 Feb 24, 2026
dad2381
fix: resolve startup module freshness home path dynamically (#306)
djm81 Feb 24, 2026
0e1ac55
Merge branch 'main' into dev
djm81 Feb 24, 2026
764e5c9
Merge branch 'main' into dev
djm81 Feb 24, 2026
fa8708c
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 24, 2026
5d90ced
fix: harden module signing workflow and reduce startup log noise
djm81 Feb 24, 2026
276830e
test: align module migration compatibility with decoupled module vers…
djm81 Feb 24, 2026
effd96f
fix: fail fast on invalid base ref in changed-only module signing
djm81 Feb 24, 2026
798fc1a
fix: stabilize module precedence and backlog github mapping flow
djm81 Feb 25, 2026
f72d6e8
merge: resolve main into dev and retain module/backlog updates
djm81 Feb 25, 2026
c6a05f5
fix(module-registry): persist disables and correct bundled availability
djm81 Feb 25, 2026
c9db837
Re-sign module registry and fix / ignore local temp artifacts
djm81 Feb 25, 2026
db4da83
bump module registry version to 0.1.3
djm81 Feb 25, 2026
48ae89b
fix(registry): restore protocol reporting logs in debug mode
djm81 Feb 25, 2026
c87c2d0
Merge branch 'main' into dev
djm81 Feb 25, 2026
619f2a3
fix(backlog): harden refine writeback, prompts, and any-filter semant…
djm81 Feb 25, 2026
818dd32
fix(hooks,ado): correct format gate and enforce iteration on direct
djm81 Feb 25, 2026
954ff76
Apply review findings and fix tests
djm81 Feb 26, 2026
9825acd
Merge branch 'main' into dev
djm81 Feb 26, 2026
27b4078
Pin virtualenv < 21 to avoid incaopatibility failure
djm81 Feb 26, 2026
f9e9d74
Merge branch 'main' into dev
djm81 Feb 26, 2026
567a303
fix: finalize backlog-core-06 ado comment API versioning (#314)
djm81 Feb 26, 2026
a95e89f
feat: Advanced marketplace features (marketplace-02) - dependency res…
djm81 Feb 27, 2026
4a0620a
Merge branch 'main' into dev
djm81 Feb 27, 2026
c5635c9
fix: complete marketplace publish registry PR flow and bump (#320)
djm81 Feb 27, 2026
4ec9bdc
Merge branch 'main' into dev
djm81 Feb 27, 2026
f48631d
fix: update init ide hint and repair publish workflow
djm81 Feb 27, 2026
37d8475
Merge branch 'main' into dev
djm81 Feb 27, 2026
8be301e
feat(backlog): normalize daily summarize Markdown output (#323)
djm81 Feb 27, 2026
a6dcab0
Update version
djm81 Feb 27, 2026
0b99c6c
Merge branch 'dev' of https://github.com/nold-ai/specfact-cli into dev
djm81 Feb 27, 2026
073ae36
Merge branch 'main' into dev
djm81 Feb 27, 2026
2f13173
Add github skills
djm81 Feb 27, 2026
1e743b5
Add new marketplace changes
djm81 Feb 27, 2026
da80932
feat(cli): category groups and flat shims using real module Typer (#331)
djm81 Feb 28, 2026
c480e19
Update docs regarding module migration change
djm81 Feb 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/skills/openspec-workflows/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: openspec-workflows
description: Create OpenSpec changes from implementation plans, and validate existing changes before implementation. Use when the user wants to turn a plan document into an OpenSpec change proposal, or validate that a change is safe to implement (breaking changes, dependency analysis).
license: MIT
metadata:
author: openspec
version: "1.0"
---

Two workflows for managing OpenSpec changes at the proposal stage.

**Input**: Optionally specify a workflow name (`create` or `validate`) and a target (plan path or change ID). If omitted, ask the user which workflow they need.

## Workflow Selection

Determine which workflow to run:

| User Intent | Workflow | Reference |
|---|---|---|
| Turn a plan into an OpenSpec change | **Create Change from Plan** | `references/create-change-from-plan.md` |
| Validate a change before implementation | **Validate Change** | `references/validate-change.md` |

If the user's intent is unclear, use **AskUserQuestion** to ask which workflow they need.

## Create Change from Plan

Turns an implementation plan document into a fully formed OpenSpec change with proposal, specs, design, and tasks — including GitHub issue creation for public repos.

**When to use**: The user has a plan document (typically in `specfact-cli-internal/docs/internal/implementation/`) and wants to create an OpenSpec change from it.

**Load** `references/create-change-from-plan.md` and follow the full workflow.

**Key steps**:
1. Select and parse the plan document
2. Cross-reference against existing plans and validate targets
3. Resolve any issues interactively
4. Create the OpenSpec change via `opsx:ff` skill
5. Review and improve: enforce TDD-first, add git worktree tasks (worktree creation first, PR last, cleanup after merge), validate against `openspec/config.yaml`
6. Create GitHub issue (public repos only)

## Validate Change

Performs dry-run simulation to detect breaking changes, analyze dependencies, and verify format compliance before implementation begins.

**When to use**: The user wants to validate that an existing change is safe to implement — check for breaking interface changes, missing dependency updates, and format compliance.

**Load** `references/validate-change.md` and follow the full workflow.

**Key steps**:
1. Select the change (by ID or interactive list)
2. Parse all change artifacts (proposal, tasks, design, spec deltas)
3. Simulate interface changes in a temporary workspace
4. Analyze dependencies and detect breaking changes
5. Present findings and get user decision if breaking changes found
6. Run `openspec validate <change-id> --strict`
7. Create `CHANGE_VALIDATION.md` report

## Guardrails

- Read `openspec/config.yaml` for project context and rules
- Read `CLAUDE.md` for project conventions
- Never modify production code during validation — use temp workspaces
- Never proceed with ambiguities — ask for clarification
- Enforce TDD-first ordering in tasks (per config.yaml)
- Enforce git worktree workflow: worktree creation first task, PR creation last task, worktree cleanup after merge — never switch the primary checkout away from `dev`
- Only create GitHub issues in the target repository specified by the plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,312 @@
# Workflow: Create OpenSpec Change from Plan

## Table of Contents

- [Guardrails](#guardrails)
- [Step 1: Plan Selection](#step-1-plan-selection)
- [Step 2: Plan Review and Alignment](#step-2-plan-review-and-alignment)
- [Step 3: Integrity Re-Check](#step-3-integrity-re-check)
- [Step 4: OpenSpec Change Creation](#step-4-openspec-change-creation)
- [Step 5: Proposal Review and Improvement](#step-5-proposal-review-and-improvement)
- [Step 6: GitHub Issue Creation](#step-6-github-issue-creation)
- [Step 7: Create GitHub Issue via gh CLI](#step-7-create-github-issue-via-gh-cli)
- [Step 8: Completion](#step-8-completion)

## Guardrails

- Read `openspec/config.yaml` during the workflow (before or at Step 5) for project context and TDD/SDD rules.
- Favor straightforward, minimal implementations. Keep changes tightly scoped.
- Never proceed with ambiguities or conflicts — ask for clarification interactively.
- Do not write code during the proposal stage. Only create design documents (proposal.md, tasks.md, design.md, spec deltas).
- Always validate alignment against existing plans and implementation reality before proceeding.
- **CRITICAL**: Only create GitHub issues in the target repository specified by the plan.
- **CRITICAL Git Workflow (Worktree Policy)**: Use git worktrees for parallel development — never switch the primary checkout away from `dev`. Add a worktree creation task as the FIRST task, and PR creation as the LAST task. Never work on protected branches (`main`/`dev`) directly. Branch naming: `<branch-type>/<change-id>`. Worktree path: `../specfact-cli-worktrees/<branch-type>/<change-id>`. All subsequent tasks execute inside the worktree directory.
- **CRITICAL TDD**: Per config.yaml, test tasks MUST come before implementation tasks.

## Step 1: Plan Selection

**If plan path provided**: Resolve to absolute path, verify file exists.

**If no plan path provided**:
1. Search for plans in:
- `specfact-cli-internal/docs/internal/brownfield-strategy/` (`*.md`)
- `specfact-cli-internal/docs/internal/implementation/` (`*.md`)
- `specfact-cli/docs/` (if accessible)
2. Display numbered list with file path, title (first heading), last modified date.
3. Prompt user to select.

## Step 2: Plan Review and Alignment

### 2.1: Read and Parse Plan

1. Read plan file completely.
2. Extract:
- Title and purpose (first H1)
- **Target repository** (look for `**Repository**:` in header metadata, e.g. `` `nold-ai/specfact-cli` ``)
- Phases/tasks with descriptions
- Files to create/modify (note repository prefixes)
- Dependencies, success metrics, estimated effort
3. Identify referenced targets (files, directories, repositories).

### 2.2: Cross-Reference Check

1. Search `specfact-cli-internal/docs/internal/brownfield-strategy/` for overlapping plans.
2. Search `specfact-cli-internal/docs/internal/implementation/` for conflicting implementation plans.
3. Extract conflicting info, overlapping scope, dependency relationships, timeline conflicts.

### 2.3: Target Validation

For each target in the plan:
- **Files**: Check existence, readability, location, structure matches assumptions.
- **Directories**: Check existence, structure.
- **Repositories**: Verify in workspace, structure matches, access ok.
- **Code refs**: Verify functions/classes exist, structure matches.

### 2.4: Alignment Analysis

Check:
1. **Accuracy**: File paths correct? Repos referenced accurately? Commands valid?
2. **Correctness**: Technical details accurate? Implementation approaches align with codebase?
3. **Ambiguities**: Unclear requirements, vague acceptance criteria, missing context.
4. **Conflicts**: With other plans, overlapping scope, timeline/resource conflicts.
5. **Consistency**: With CLAUDE.md conventions, OpenSpec conventions, existing patterns.

### 2.5: Issue Detection and Interactive Resolution

**If issues found**:
1. Categorize: Critical (must resolve), Warning (should resolve), Info (non-blocking).
2. Present: `[CRITICAL/WARNING/INFO] <category>: <description>` with context and suggested resolutions.
3. Resolve interactively: For critical issues, prompt for clarification. For warnings, ask resolve or skip.
4. Re-validate after resolution. Loop until all critical issues resolved.

## Step 3: Integrity Re-Check

1. Re-run all checks from Step 2 with updated understanding.
2. Verify user clarifications are consistent.
3. Check for new issues introduced by clarifications.
4. If misalignments remain, go back to Step 2.5.

## Step 4: OpenSpec Change Creation

### 4.1: Determine Change Name

1. Extract from plan title, convert to kebab-case.
2. Ensure unique (check existing changes in `openspec/changes/`).

### 4.2: Execute OPSX Fast-Forward

Invoke the `opsx:ff` skill with the change name:
- Use the plan as source of requirements.
- Map plan phases/tasks to OpenSpec capabilities.
- The opsx:ff workflow creates: change directory, proposal.md, specs/, design.md, tasks.md.
- It reads `openspec/config.yaml` for project context and per-artifact rules.

### 4.3: Extract Change ID

1. Identify created change ID.
2. Verify change directory: `openspec/changes/<change-id>/`.
3. Verify artifacts created: proposal.md, tasks.md, specs/.

## Step 5: Proposal Review and Improvement

### 5.1: Review Against Config and Project Rules

1. **Read `openspec/config.yaml`**:
- Project context: Tech stack, constraints, architecture patterns.
- Development discipline (SDD + TDD): (1) Specs first, (2) Tests second (expect failure), (3) Code last.
- Per-artifact rules: `rules.tasks` — TDD order, test-before-code.

2. **Read and apply project rules** from CLAUDE.md:
- Contract-first development, testing requirements, code conventions.

3. **Verify config.yaml rules applied**:
- Source Tracking section (if public-facing).
- GitHub issue creation task (if public repo).
- 2-hour maximum chunks.
- TDD: test tasks before implementation.

### 5.2: Update Tasks with Quality Standards and Git Workflow

#### 5.2.1: Determine Branch Type

- `add-*`, `create-*`, `implement-*`, `enhance-*` -> `feature/`
- `fix-*`, `correct-*`, `repair-*` -> `bugfix/`
- `update-*`, `modify-*`, `refactor-*` -> `feature/`
- `hotfix-*`, `urgent-*` -> `hotfix/`
- Default: `feature/`

Branch name: `<branch-type>/<change-id>`. Target: `dev`.

#### 5.2.2: Add Git Worktree Creation Task (FIRST TASK)

Add as first task in tasks.md:

```markdown
## 1. Create git worktree for this change

- [ ] 1.1 Fetch latest and create a worktree with a new branch from `origin/dev`.
- [ ] 1.1.1 `git fetch origin`
- [ ] 1.1.2 `git worktree add ../specfact-cli-worktrees/<branch-type>/<change-id> -b <branch-type>/<change-id> origin/dev`
- [ ] 1.1.3 Change into the worktree: `cd ../specfact-cli-worktrees/<branch-type>/<change-id>`
- [ ] 1.1.4 Create a virtual environment: `python -m venv .venv && source .venv/bin/activate && pip install -e ".[dev]"`
- [ ] 1.1.5 `git branch --show-current` (verify correct branch)
```

**If a GitHub issue exists**, use `gh issue develop` to link the branch before creating the worktree:

```markdown
- [ ] 1.1.2a `gh issue develop <issue-number> --repo <target-repo> --name <branch-type>/<change-id>` (creates remote branch linked to issue)
- [ ] 1.1.2b `git fetch origin && git worktree add ../specfact-cli-worktrees/<branch-type>/<change-id> <branch-type>/<change-id>`
```

All remaining tasks in tasks.md MUST run inside the worktree directory, not the primary checkout.

#### 5.2.3: Update Tasks with Quality Standards

For each task, ensure:
- Testing requirements (unit, contract, integration, E2E).
- Code quality checks: `hatch run format`, `hatch run type-check`, `hatch run contract-test`.
- Validation: `openspec validate <change-id> --strict`.

#### 5.2.4: Enforce TDD-first in tasks.md

1. **Add "TDD / SDD order (enforced)" section** at top of tasks.md (after title, before first numbered task):
- State: per config.yaml, tests before code for any behavior-changing task.
- Order: (1) Spec deltas, (2) Tests from scenarios (expect failure), (3) Code last.
- "Do not implement production code until tests exist and have been run (expecting failure)."
- Separate with `---`.

2. **Reorder each behavior-changing section**: Test tasks before implementation tasks.

3. **Verify**: Scan tasks.md — any section with both test and implementation tasks must have tests first.

#### 5.2.5: Add PR Creation Task (LAST TASK)

Add as last task in tasks.md. Only create PR if target repo is public (specfact-cli, platform-frontend).

Key steps (run from inside the worktree directory):
1. Prepare commit: `git add .`, commit with conventional message, push with `-u`: `git push -u origin <branch-type>/<change-id>`.
2. Create PR body from `.github/pull_request_template.md`:
- Use full repo path format for issue refs: `Fixes nold-ai/specfact-cli#<number>`
- Include OpenSpec change ID in description.
3. Create PR: `gh pr create --repo <target-repo> --base dev --head <branch> --title "<type>: <desc>" --body-file <body-file>`
4. Link to project (specfact-cli only): `gh project item-add 1 --owner nold-ai --url <PR_URL>`
5. Verify Development link on issue, project board.
6. Update project status to "In Progress" (if applicable).

PR title format: `feat:` for feature/, `fix:` for bugfix/, etc.

#### 5.2.6: Add Worktree Cleanup Task (AFTER MERGE)

Add a note after the PR task for post-merge cleanup:

```markdown
## Post-merge cleanup (after PR is merged)

- [ ] Return to primary checkout: `cd .../specfact-cli`
- [ ] `git fetch origin`
- [ ] `git worktree remove ../specfact-cli-worktrees/<branch-type>/<change-id>`
- [ ] `git branch -d <branch-type>/<change-id>`
- [ ] `git worktree prune`
- [ ] (Optional) `git push origin --delete <branch-type>/<change-id>`
```

### 5.3: Update Proposal with Quality Gates

Update proposal.md with: quality standards section, git workflow requirements, acceptance criteria (branch created, tests pass, contracts validated, docs updated, PR created).

### 5.4: Validate with OpenSpec

1. Verify format: proposal.md has `# Change:` title, `## Why`, `## What Changes`, `## Impact`. Tasks.md uses `## 1.` numbered format.
2. Check status: `openspec status --change "<change-id>" --json`.
3. Run: `openspec validate <change-id> --strict`. Fix and re-run until passing.

### 5.5: Markdown Linting

Run `markdownlint --config .markdownlint.json --fix` on all `.md` files in the change directory. Fix remaining issues manually.

## Step 6: GitHub Issue Creation

### 6.1: Determine Target Repository

1. Extract target repo from plan header (`**Repository**:` field).
2. Decision:
- `specfact-cli` or `platform-frontend` (public) -> create issue, proceed to 6.2.
- `specfact-cli-internal` (internal) -> skip issue creation, go to Step 8.
- Not specified -> ask user.

### 6.2: Sanitize Proposal Content

For public issues:
- **Remove**: Competitive analysis, market positioning, internal strategy, effort estimates.
- **Preserve**: User-facing value, feature descriptions, acceptance criteria, API changes.

Format per config.yaml:
- Title: `[Change] <Brief Description>`
- Labels: `enhancement`, `change-proposal`
- Body: `## Why`, `## What Changes`, `## Acceptance Criteria`
- Footer: `*OpenSpec Change Proposal: <change-id>*`

Show sanitized content to user for approval before creating.

## Step 7: Create GitHub Issue via gh CLI

1. Write sanitized content to temp file.
2. Create issue:

```bash
gh issue create \
--repo <target-repo> \
--title "[Change] <title>" \
--body-file /tmp/github-issue-<change-id>.md \
--label "enhancement" \
--label "change-proposal"
```

3. For specfact-cli: link to project `gh project item-add 1 --owner nold-ai --url <ISSUE_URL>`.
4. Update `proposal.md` Source Tracking section:

```markdown
## Source Tracking

<!-- source_repo: <target-repo> -->
- **GitHub Issue**: #<number>
- **Issue URL**: <url>
- **Last Synced Status**: proposed
```

5. Cleanup temp file.

## Step 8: Completion

Display summary:

```
Change ID: <change-id>
Location: openspec/changes/<change-id>/

Validation:
- OpenSpec validation passed
- Markdown linting passed
- Config.yaml rules applied (TDD-first enforced)
- Git workflow tasks added (branch + PR)

GitHub Issue (if public):
- Issue #<number> created: <url>
- Source tracking updated

Next Steps:
1. Review: openspec/changes/<change-id>/proposal.md
2. Review: openspec/changes/<change-id>/tasks.md
3. Verify TDD order and git workflow in tasks
4. Apply when ready: invoke opsx:apply skill
```

## Error Handling

- **Plan not found**: Search and suggest alternatives.
- **Validation failures**: Present clearly, allow interactive resolution.
- **OpenSpec validation fails**: Fix and re-validate, don't proceed until passing.
- **gh CLI unavailable**: Inform user, provide manual creation instructions.
- **Issue creation fails**: Log error, allow retry, don't fail entire workflow.
- **Project linking fails**: Log warning, continue (non-critical).
Loading
Loading