confluence-exporter 1.0.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.
Files changed (91) hide show
  1. package/.eslintrc.cjs +18 -0
  2. package/.github/copilot-instructions.md +3 -0
  3. package/.github/prompts/analyze.prompt.md +101 -0
  4. package/.github/prompts/clarify.prompt.md +158 -0
  5. package/.github/prompts/constitution.prompt.md +73 -0
  6. package/.github/prompts/implement.prompt.md +56 -0
  7. package/.github/prompts/plan.prompt.md +50 -0
  8. package/.github/prompts/specify.prompt.md +21 -0
  9. package/.github/prompts/tasks.prompt.md +69 -0
  10. package/LICENSE +21 -0
  11. package/README.md +332 -0
  12. package/agents.md +1174 -0
  13. package/dist/api.d.ts +73 -0
  14. package/dist/api.js +387 -0
  15. package/dist/api.js.map +1 -0
  16. package/dist/commands/download.command.d.ts +18 -0
  17. package/dist/commands/download.command.js +257 -0
  18. package/dist/commands/download.command.js.map +1 -0
  19. package/dist/commands/executor.d.ts +22 -0
  20. package/dist/commands/executor.js +52 -0
  21. package/dist/commands/executor.js.map +1 -0
  22. package/dist/commands/help.command.d.ts +8 -0
  23. package/dist/commands/help.command.js +68 -0
  24. package/dist/commands/help.command.js.map +1 -0
  25. package/dist/commands/index.command.d.ts +14 -0
  26. package/dist/commands/index.command.js +95 -0
  27. package/dist/commands/index.command.js.map +1 -0
  28. package/dist/commands/index.d.ts +13 -0
  29. package/dist/commands/index.js +13 -0
  30. package/dist/commands/index.js.map +1 -0
  31. package/dist/commands/plan.command.d.ts +54 -0
  32. package/dist/commands/plan.command.js +272 -0
  33. package/dist/commands/plan.command.js.map +1 -0
  34. package/dist/commands/registry.d.ts +12 -0
  35. package/dist/commands/registry.js +32 -0
  36. package/dist/commands/registry.js.map +1 -0
  37. package/dist/commands/transform.command.d.ts +69 -0
  38. package/dist/commands/transform.command.js +951 -0
  39. package/dist/commands/transform.command.js.map +1 -0
  40. package/dist/commands/types.d.ts +12 -0
  41. package/dist/commands/types.js +5 -0
  42. package/dist/commands/types.js.map +1 -0
  43. package/dist/commands/update.command.d.ts +10 -0
  44. package/dist/commands/update.command.js +201 -0
  45. package/dist/commands/update.command.js.map +1 -0
  46. package/dist/constants.d.ts +1 -0
  47. package/dist/constants.js +2 -0
  48. package/dist/constants.js.map +1 -0
  49. package/dist/index.d.ts +5 -0
  50. package/dist/index.js +110 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/logger.d.ts +15 -0
  53. package/dist/logger.js +52 -0
  54. package/dist/logger.js.map +1 -0
  55. package/dist/types.d.ts +167 -0
  56. package/dist/types.js +5 -0
  57. package/dist/types.js.map +1 -0
  58. package/dist/utils.d.ts +56 -0
  59. package/dist/utils.js +178 -0
  60. package/dist/utils.js.map +1 -0
  61. package/eslint.config.js +29 -0
  62. package/jest.config.cjs +25 -0
  63. package/migrate-meta.js +132 -0
  64. package/package.json +53 -0
  65. package/src/api.ts +469 -0
  66. package/src/commands/download.command.ts +324 -0
  67. package/src/commands/executor.ts +62 -0
  68. package/src/commands/help.command.ts +72 -0
  69. package/src/commands/index.command.ts +111 -0
  70. package/src/commands/index.ts +14 -0
  71. package/src/commands/plan.command.ts +318 -0
  72. package/src/commands/registry.ts +39 -0
  73. package/src/commands/transform.command.ts +1103 -0
  74. package/src/commands/types.ts +16 -0
  75. package/src/commands/update.command.ts +229 -0
  76. package/src/constants.ts +0 -0
  77. package/src/index.ts +120 -0
  78. package/src/logger.ts +60 -0
  79. package/src/test.sh +66 -0
  80. package/src/types.ts +176 -0
  81. package/src/utils.ts +204 -0
  82. package/tests/commands/README.md +123 -0
  83. package/tests/commands/download.command.test.ts +8 -0
  84. package/tests/commands/help.command.test.ts +8 -0
  85. package/tests/commands/index.command.test.ts +8 -0
  86. package/tests/commands/plan.command.test.ts +15 -0
  87. package/tests/commands/transform.command.test.ts +8 -0
  88. package/tests/fixtures/_index.yaml +38 -0
  89. package/tests/fixtures/mock-pages.ts +62 -0
  90. package/tsconfig.json +25 -0
  91. package/vite.config.ts +45 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { node: true, es2022: true, jest: true },
4
+ parser: '@typescript-eslint/parser',
5
+ parserOptions: { project: null, ecmaVersion: 'latest', sourceType: 'module' },
6
+ plugins: ['@typescript-eslint'],
7
+ extends: [
8
+ 'eslint:recommended',
9
+ 'plugin:@typescript-eslint/recommended'
10
+ ],
11
+ rules: {
12
+ 'no-unused-vars': 'off',
13
+ '@typescript-eslint/no-unused-vars': [ 'warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' } ],
14
+ 'complexity': [ 'warn', 10 ],
15
+ 'prefer-const': 'warn'
16
+ },
17
+ ignorePatterns: ['dist', 'node_modules']
18
+ };
@@ -0,0 +1,3 @@
1
+ when test commands, please follow these guidelines:
2
+ - never specify params about url, user, etc. All such params should be read from .env or config files.
3
+ example: instead of `npm run dev -- download -u https://site.atlassian.net -n user@example.com -p token123 -s PR000299 -l 5`, use `npm run dev -- download -l 5`.
@@ -0,0 +1,101 @@
1
+ ---
2
+ description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ Goal: Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
12
+
13
+ STRICTLY READ-ONLY: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
14
+
15
+ Constitution Authority: The project constitution (`.specify/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
16
+
17
+ Execution steps:
18
+
19
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
20
+ - SPEC = FEATURE_DIR/spec.md
21
+ - PLAN = FEATURE_DIR/plan.md
22
+ - TASKS = FEATURE_DIR/tasks.md
23
+ Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
24
+
25
+ 2. Load artifacts:
26
+ - Parse spec.md sections: Overview/Context, Functional Requirements, Non-Functional Requirements, User Stories, Edge Cases (if present).
27
+ - Parse plan.md: Architecture/stack choices, Data Model references, Phases, Technical constraints.
28
+ - Parse tasks.md: Task IDs, descriptions, phase grouping, parallel markers [P], referenced file paths.
29
+ - Load constitution `.specify/memory/constitution.md` for principle validation.
30
+
31
+ 3. Build internal semantic models:
32
+ - Requirements inventory: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" -> `user-can-upload-file`).
33
+ - User story/action inventory.
34
+ - Task coverage mapping: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases).
35
+ - Constitution rule set: Extract principle names and any MUST/SHOULD normative statements.
36
+
37
+ 4. Detection passes:
38
+ A. Duplication detection:
39
+ - Identify near-duplicate requirements. Mark lower-quality phrasing for consolidation.
40
+ B. Ambiguity detection:
41
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria.
42
+ - Flag unresolved placeholders (TODO, TKTK, ???, <placeholder>, etc.).
43
+ C. Underspecification:
44
+ - Requirements with verbs but missing object or measurable outcome.
45
+ - User stories missing acceptance criteria alignment.
46
+ - Tasks referencing files or components not defined in spec/plan.
47
+ D. Constitution alignment:
48
+ - Any requirement or plan element conflicting with a MUST principle.
49
+ - Missing mandated sections or quality gates from constitution.
50
+ E. Coverage gaps:
51
+ - Requirements with zero associated tasks.
52
+ - Tasks with no mapped requirement/story.
53
+ - Non-functional requirements not reflected in tasks (e.g., performance, security).
54
+ F. Inconsistency:
55
+ - Terminology drift (same concept named differently across files).
56
+ - Data entities referenced in plan but absent in spec (or vice versa).
57
+ - Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note).
58
+ - Conflicting requirements (e.g., one requires to use Next.js while other says to use Vue as the framework).
59
+
60
+ 5. Severity assignment heuristic:
61
+ - CRITICAL: Violates constitution MUST, missing core spec artifact, or requirement with zero coverage that blocks baseline functionality.
62
+ - HIGH: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion.
63
+ - MEDIUM: Terminology drift, missing non-functional task coverage, underspecified edge case.
64
+ - LOW: Style/wording improvements, minor redundancy not affecting execution order.
65
+
66
+ 6. Produce a Markdown report (no file writes) with sections:
67
+
68
+ ### Specification Analysis Report
69
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
70
+ |----|----------|----------|-------------|---------|----------------|
71
+ | A1 | Duplication | HIGH | spec.md:L120-134 | Two similar requirements ... | Merge phrasing; keep clearer version |
72
+ (Add one row per finding; generate stable IDs prefixed by category initial.)
73
+
74
+ Additional subsections:
75
+ - Coverage Summary Table:
76
+ | Requirement Key | Has Task? | Task IDs | Notes |
77
+ - Constitution Alignment Issues (if any)
78
+ - Unmapped Tasks (if any)
79
+ - Metrics:
80
+ * Total Requirements
81
+ * Total Tasks
82
+ * Coverage % (requirements with >=1 task)
83
+ * Ambiguity Count
84
+ * Duplication Count
85
+ * Critical Issues Count
86
+
87
+ 7. At end of report, output a concise Next Actions block:
88
+ - If CRITICAL issues exist: Recommend resolving before `/implement`.
89
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions.
90
+ - Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'".
91
+
92
+ 8. Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
93
+
94
+ Behavior rules:
95
+ - NEVER modify files.
96
+ - NEVER hallucinate missing sections—if absent, report them.
97
+ - KEEP findings deterministic: if rerun without changes, produce consistent IDs and counts.
98
+ - LIMIT total findings in the main table to 50; aggregate remainder in a summarized overflow note.
99
+ - If zero issues found, emit a success report with coverage statistics and proceed recommendation.
100
+
101
+ Context: $ARGUMENTS
@@ -0,0 +1,158 @@
1
+ ---
2
+ description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
12
+
13
+ Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
14
+
15
+ Execution steps:
16
+
17
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json --paths-only` from repo root **once** (combined `--json --paths-only` mode / `-Json -PathsOnly`). Parse minimal JSON payload fields:
18
+ - `FEATURE_DIR`
19
+ - `FEATURE_SPEC`
20
+ - (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
21
+ - If JSON parsing fails, abort and instruct user to re-run `/specify` or verify feature branch environment.
22
+
23
+ 2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).
24
+
25
+ Functional Scope & Behavior:
26
+ - Core user goals & success criteria
27
+ - Explicit out-of-scope declarations
28
+ - User roles / personas differentiation
29
+
30
+ Domain & Data Model:
31
+ - Entities, attributes, relationships
32
+ - Identity & uniqueness rules
33
+ - Lifecycle/state transitions
34
+ - Data volume / scale assumptions
35
+
36
+ Interaction & UX Flow:
37
+ - Critical user journeys / sequences
38
+ - Error/empty/loading states
39
+ - Accessibility or localization notes
40
+
41
+ Non-Functional Quality Attributes:
42
+ - Performance (latency, throughput targets)
43
+ - Scalability (horizontal/vertical, limits)
44
+ - Reliability & availability (uptime, recovery expectations)
45
+ - Observability (logging, metrics, tracing signals)
46
+ - Security & privacy (authN/Z, data protection, threat assumptions)
47
+ - Compliance / regulatory constraints (if any)
48
+
49
+ Integration & External Dependencies:
50
+ - External services/APIs and failure modes
51
+ - Data import/export formats
52
+ - Protocol/versioning assumptions
53
+
54
+ Edge Cases & Failure Handling:
55
+ - Negative scenarios
56
+ - Rate limiting / throttling
57
+ - Conflict resolution (e.g., concurrent edits)
58
+
59
+ Constraints & Tradeoffs:
60
+ - Technical constraints (language, storage, hosting)
61
+ - Explicit tradeoffs or rejected alternatives
62
+
63
+ Terminology & Consistency:
64
+ - Canonical glossary terms
65
+ - Avoided synonyms / deprecated terms
66
+
67
+ Completion Signals:
68
+ - Acceptance criteria testability
69
+ - Measurable Definition of Done style indicators
70
+
71
+ Misc / Placeholders:
72
+ - TODO markers / unresolved decisions
73
+ - Ambiguous adjectives ("robust", "intuitive") lacking quantification
74
+
75
+ For each category with Partial or Missing status, add a candidate question opportunity unless:
76
+ - Clarification would not materially change implementation or validation strategy
77
+ - Information is better deferred to planning phase (note internally)
78
+
79
+ 3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
80
+ - Maximum of 5 total questions across the whole session.
81
+ - Each question must be answerable with EITHER:
82
+ * A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
83
+ * A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
84
+ - Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
85
+ - Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
86
+ - Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
87
+ - Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
88
+ - If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.
89
+
90
+ 4. Sequential questioning loop (interactive):
91
+ - Present EXACTLY ONE question at a time.
92
+ - For multiple‑choice questions render options as a Markdown table:
93
+
94
+ | Option | Description |
95
+ |--------|-------------|
96
+ | A | <Option A description> |
97
+ | B | <Option B description> |
98
+ | C | <Option C description> | (add D/E as needed up to 5)
99
+ | Short | Provide a different short answer (<=5 words) | (Include only if free-form alternative is appropriate)
100
+
101
+ - For short‑answer style (no meaningful discrete options), output a single line after the question: `Format: Short answer (<=5 words)`.
102
+ - After the user answers:
103
+ * Validate the answer maps to one option or fits the <=5 word constraint.
104
+ * If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
105
+ * Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
106
+ - Stop asking further questions when:
107
+ * All critical ambiguities resolved early (remaining queued items become unnecessary), OR
108
+ * User signals completion ("done", "good", "no more"), OR
109
+ * You reach 5 asked questions.
110
+ - Never reveal future queued questions in advance.
111
+ - If no valid questions exist at start, immediately report no critical ambiguities.
112
+
113
+ 5. Integration after EACH accepted answer (incremental update approach):
114
+ - Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
115
+ - For the first integrated answer in this session:
116
+ * Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
117
+ * Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.
118
+ - Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`.
119
+ - Then immediately apply the clarification to the most appropriate section(s):
120
+ * Functional ambiguity → Update or add a bullet in Functional Requirements.
121
+ * User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
122
+ * Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
123
+ * Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target).
124
+ * Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
125
+ * Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once.
126
+ - If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
127
+ - Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
128
+ - Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
129
+ - Keep each inserted clarification minimal and testable (avoid narrative drift).
130
+
131
+ 6. Validation (performed after EACH write plus final pass):
132
+ - Clarifications session contains exactly one bullet per accepted answer (no duplicates).
133
+ - Total asked (accepted) questions ≤ 5.
134
+ - Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
135
+ - No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
136
+ - Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.
137
+ - Terminology consistency: same canonical term used across all updated sections.
138
+
139
+ 7. Write the updated spec back to `FEATURE_SPEC`.
140
+
141
+ 8. Report completion (after questioning loop ends or early termination):
142
+ - Number of questions asked & answered.
143
+ - Path to updated spec.
144
+ - Sections touched (list names).
145
+ - Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
146
+ - If any Outstanding or Deferred remain, recommend whether to proceed to `/plan` or run `/clarify` again later post-plan.
147
+ - Suggested next command.
148
+
149
+ Behavior rules:
150
+ - If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
151
+ - If spec file missing, instruct user to run `/specify` first (do not create a new spec here).
152
+ - Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
153
+ - Avoid speculative tech stack questions unless the absence blocks functional clarity.
154
+ - Respect user early termination signals ("stop", "done", "proceed").
155
+ - If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
156
+ - If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
157
+
158
+ Context for prioritization: $ARGUMENTS
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ You are updating the project constitution at `.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
12
+
13
+ Follow this execution flow:
14
+
15
+ 1. Load the existing constitution template at `.specify/memory/constitution.md`.
16
+ - Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
17
+ **IMPORTANT**: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.
18
+
19
+ 2. Collect/derive values for placeholders:
20
+ - If user input (conversation) supplies a value, use it.
21
+ - Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
22
+ - For governance dates: `RATIFICATION_DATE` is the original adoption date (if unknown ask or mark TODO), `LAST_AMENDED_DATE` is today if changes are made, otherwise keep previous.
23
+ - `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
24
+ * MAJOR: Backward incompatible governance/principle removals or redefinitions.
25
+ * MINOR: New principle/section added or materially expanded guidance.
26
+ * PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
27
+ - If version bump type ambiguous, propose reasoning before finalizing.
28
+
29
+ 3. Draft the updated constitution content:
30
+ - Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
31
+ - Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
32
+ - Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
33
+ - Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
34
+
35
+ 4. Consistency propagation checklist (convert prior checklist into active validations):
36
+ - Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
37
+ - Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
38
+ - Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
39
+ - Read each command file in `.specify/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
40
+ - Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
41
+
42
+ 5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
43
+ - Version change: old → new
44
+ - List of modified principles (old title → new title if renamed)
45
+ - Added sections
46
+ - Removed sections
47
+ - Templates requiring updates (✅ updated / ⚠ pending) with file paths
48
+ - Follow-up TODOs if any placeholders intentionally deferred.
49
+
50
+ 6. Validation before final output:
51
+ - No remaining unexplained bracket tokens.
52
+ - Version line matches report.
53
+ - Dates ISO format YYYY-MM-DD.
54
+ - Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
55
+
56
+ 7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
57
+
58
+ 8. Output a final summary to the user with:
59
+ - New version and bump rationale.
60
+ - Any files flagged for manual follow-up.
61
+ - Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
62
+
63
+ Formatting & Style Requirements:
64
+ - Use Markdown headings exactly as in the template (do not demote/promote levels).
65
+ - Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
66
+ - Keep a single blank line between sections.
67
+ - Avoid trailing whitespace.
68
+
69
+ If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
70
+
71
+ If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
72
+
73
+ Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
@@ -0,0 +1,56 @@
1
+ ---
2
+ description: Execute the implementation plan by processing and executing all tasks defined in tasks.md
3
+ ---
4
+
5
+ The user input can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ 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.
12
+
13
+ 2. Load and analyze the implementation context:
14
+ - **REQUIRED**: Read tasks.md for the complete task list and execution plan
15
+ - **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
16
+ - **IF EXISTS**: Read data-model.md for entities and relationships
17
+ - **IF EXISTS**: Read contracts/ for API specifications and test requirements
18
+ - **IF EXISTS**: Read research.md for technical decisions and constraints
19
+ - **IF EXISTS**: Read quickstart.md for integration scenarios
20
+
21
+ 3. Parse tasks.md structure and extract:
22
+ - **Task phases**: Setup, Tests, Core, Integration, Polish
23
+ - **Task dependencies**: Sequential vs parallel execution rules
24
+ - **Task details**: ID, description, file paths, parallel markers [P]
25
+ - **Execution flow**: Order and dependency requirements
26
+
27
+ 4. Execute implementation following the task plan:
28
+ - **Phase-by-phase execution**: Complete each phase before moving to the next
29
+ - **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
30
+ - **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
31
+ - **File-based coordination**: Tasks affecting the same files must run sequentially
32
+ - **Validation checkpoints**: Verify each phase completion before proceeding
33
+
34
+ 5. Implementation execution rules:
35
+ - **Setup first**: Initialize project structure, dependencies, configuration
36
+ - **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
37
+ - **Core development**: Implement models, services, CLI commands, endpoints
38
+ - **Integration work**: Database connections, middleware, logging, external services
39
+ - **Polish and validation**: Unit tests, performance optimization, documentation
40
+
41
+ 6. Progress tracking and error handling:
42
+ - Report progress after each completed task
43
+ - Halt execution if any non-parallel task fails
44
+ - For parallel tasks [P], continue with successful tasks, report failed ones
45
+ - Provide clear error messages with context for debugging
46
+ - Suggest next steps if implementation cannot proceed
47
+ - **IMPORTANT** For completed tasks, make sure to mark the task off as [X] in the tasks file.
48
+
49
+ 7. Completion validation:
50
+ - Verify all required tasks are completed
51
+ - Check that implemented features match the original specification
52
+ - Validate that tests pass and coverage meets requirements
53
+ - Confirm the implementation follows the technical plan
54
+ - Report final status with summary of completed work
55
+
56
+ Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/tasks` first to regenerate the task list.
@@ -0,0 +1,50 @@
1
+ ---
2
+ description: Execute the implementation planning workflow using the plan template to generate design artifacts.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ Given the implementation details provided as an argument, do this:
12
+
13
+ 1. Run `.specify/scripts/bash/setup-plan.sh --json` from the repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. All future file paths must be absolute.
14
+ - BEFORE proceeding, inspect FEATURE_SPEC for a `## Clarifications` section with at least one `Session` subheading. If missing or clearly ambiguous areas remain (vague adjectives, unresolved critical choices), PAUSE and instruct the user to run `/clarify` first to reduce rework. Only continue if: (a) Clarifications exist OR (b) an explicit user override is provided (e.g., "proceed without clarification"). Do not attempt to fabricate clarifications yourself.
15
+ 2. Read and analyze the feature specification to understand:
16
+ - The feature requirements and user stories
17
+ - Functional and non-functional requirements
18
+ - Success criteria and acceptance criteria
19
+ - Any technical constraints or dependencies mentioned
20
+
21
+ 3. Read and analyze the existing codebase to understand:
22
+ - How the feature is currently implemented (if at all)
23
+ - Relevant modules, classes, and functions
24
+ - Existing design patterns and architectural decisions
25
+ - Any technical debt or areas for improvement
26
+ - How to create a plan that aligns with the existing codebase and addresses the feature requirements effectively
27
+
28
+ 4. Read the constitution at `.specify/memory/constitution.md` to understand constitutional requirements.
29
+
30
+ 5. Execute the implementation plan template:
31
+ - Load `.specify/templates/plan-template.md` (already copied to IMPL_PLAN path)
32
+ - Set Input path to FEATURE_SPEC
33
+ - Run the Execution Flow (main) function steps 1-9
34
+ - The template is self-contained and executable
35
+ - Follow error handling and gate checks as specified
36
+ - Let the template guide artifact generation in $SPECS_DIR:
37
+ * Phase 0 generates research.md
38
+ * Phase 1 generates data-model.md, contracts/, quickstart.md
39
+ * Phase 2 generates tasks.md
40
+ - Incorporate user-provided details from arguments into Technical Context: $ARGUMENTS
41
+ - Update Progress Tracking as you complete each phase
42
+
43
+ 6. Verify execution completed:
44
+ - Check Progress Tracking shows all phases complete
45
+ - Ensure all required artifacts were generated
46
+ - Confirm no ERROR states in execution
47
+
48
+ 7. Report results with branch name, file paths, and generated artifacts.
49
+
50
+ Use absolute paths with the repository root for all file operations to avoid path issues.
@@ -0,0 +1,21 @@
1
+ ---
2
+ description: Create or update the feature specification from a natural language feature description.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ The text the user typed after `/specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `$ARGUMENTS` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
12
+
13
+ Given that feature description, do this:
14
+
15
+ 1. Run the script `.specify/scripts/bash/create-new-feature.sh --json "$ARGUMENTS"` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
16
+ **IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for.
17
+ 2. Load `.specify/templates/spec-template.md` to understand required sections.
18
+ 3. Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
19
+ 4. Report completion with branch name, spec file path, and readiness for the next phase.
20
+
21
+ Note: The script creates and checks out the new branch and initializes the spec file before writing.
@@ -0,0 +1,69 @@
1
+ ---
2
+ description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.
3
+ ---
4
+
5
+ The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
6
+
7
+ User input:
8
+
9
+ $ARGUMENTS
10
+
11
+ 1. Run `.specify/scripts/bash/check-prerequisites.sh --json` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
12
+ 2. Load and analyze available design documents:
13
+ - Always read plan.md for tech stack and libraries
14
+ - IF EXISTS: Read data-model.md for entities
15
+ - IF EXISTS: Read contracts/ for API endpoints
16
+ - IF EXISTS: Read research.md for technical decisions
17
+ - IF EXISTS: Read quickstart.md for test scenarios
18
+
19
+ Note: Not all projects have all documents. For example:
20
+ - CLI tools might not have contracts/
21
+ - Simple libraries might not need data-model.md
22
+ - Generate tasks based on what's available
23
+
24
+ 3. Generate tasks following the template:
25
+ - Use `.specify/templates/tasks-template.md` as the base
26
+ - Replace example tasks with actual tasks based on:
27
+ * **Setup tasks**: Project init, dependencies, linting
28
+ * **Test tasks [P]**: One per contract, one per integration scenario
29
+ * **Core tasks**: One per entity, service, CLI command, endpoint
30
+ * **Integration tasks**: DB connections, middleware, logging
31
+ * **Polish tasks [P]**: Unit tests, performance, docs
32
+
33
+ 4. Task generation rules:
34
+ - Each contract file → contract test task marked [P]
35
+ - Each entity in data-model → model creation task marked [P]
36
+ - Each endpoint → implementation task (not parallel if shared files)
37
+ - Each user story → integration test marked [P]
38
+ - Different files = can be parallel [P]
39
+ - Same file = sequential (no [P])
40
+
41
+ 5. Order tasks by dependencies:
42
+ - Setup before everything
43
+ - Tests before implementation (TDD)
44
+ - Models before services
45
+ - Services before endpoints
46
+ - Core before integration
47
+ - Everything before polish
48
+
49
+ 6. Include parallel execution examples:
50
+ - Group [P] tasks that can run together
51
+ - Show actual Task agent commands
52
+
53
+ 7. Create FEATURE_DIR/tasks.md with:
54
+ - Correct feature name from implementation plan
55
+ - Numbered tasks (T001, T002, etc.)
56
+ - Clear file paths for each task
57
+ - Dependency notes
58
+ - Parallel execution guidance
59
+
60
+ 8. Read and analyze the existing codebase to understand:
61
+ - If the feature is currently implemented (if at all)
62
+ - Relevant modules, classes, and functions
63
+ - Existing design patterns and architectural decisions
64
+ - Any technical debt or areas for improvement
65
+ - How to create a task that aligns with the existing codebase and addresses the feature requirements effectively
66
+
67
+ Context for task generation: $ARGUMENTS
68
+
69
+ The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.