@jeancodogno/specforce-kit 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/.geminiignore +15 -0
- package/.github/workflows/ci.yml +100 -0
- package/.github/workflows/release.yml +51 -0
- package/.golangci.yml +21 -0
- package/.goreleaser.yaml +43 -0
- package/.rgignore +13 -0
- package/.specforce/config.yaml +32 -0
- package/.specforce/docs/.gitkeep +0 -0
- package/.specforce/docs/architecture.md +98 -0
- package/.specforce/docs/engineering.md +80 -0
- package/.specforce/docs/governance.md +30 -0
- package/.specforce/docs/memorial.md +44 -0
- package/.specforce/docs/principles.md +31 -0
- package/.specforce/docs/security.md +31 -0
- package/.specforce/docs/ui-ux.md +129 -0
- package/.specforce/specs/.gitkeep +0 -0
- package/AGENTS.md +36 -0
- package/CONTRIBUTING.md +81 -0
- package/LICENSE +21 -0
- package/Makefile +49 -0
- package/README.md +144 -0
- package/assets/logo-header.png +0 -0
- package/assets/logo.png +0 -0
- package/docs/artifacts.md +41 -0
- package/docs/cli.md +73 -0
- package/docs/configuration.md +50 -0
- package/docs/getting-started.md +110 -0
- package/docs/supported-tools.md +14 -0
- package/go.mod +35 -0
- package/go.sum +61 -0
- package/index.js +0 -0
- package/package.json +26 -0
- package/src/cmd/specforce/main.go +23 -0
- package/src/cmd/specforce/main_test.go +7 -0
- package/src/internal/agent/artifacts/constitution/architecture.yaml +70 -0
- package/src/internal/agent/artifacts/constitution/engineering.yaml +52 -0
- package/src/internal/agent/artifacts/constitution/governance.yaml +41 -0
- package/src/internal/agent/artifacts/constitution/memorial.yaml +55 -0
- package/src/internal/agent/artifacts/constitution/principles.yaml +54 -0
- package/src/internal/agent/artifacts/constitution/security.yaml +47 -0
- package/src/internal/agent/artifacts/constitution/ui-ux.yaml +158 -0
- package/src/internal/agent/artifacts/spec/design.yaml +50 -0
- package/src/internal/agent/artifacts/spec/requirements.yaml +48 -0
- package/src/internal/agent/artifacts/spec/tasks.yaml +55 -0
- package/src/internal/agent/compatibility_test.go +120 -0
- package/src/internal/agent/cwd_test.go +9 -0
- package/src/internal/agent/embed.go +19 -0
- package/src/internal/agent/integration_test.go +138 -0
- package/src/internal/agent/kit/agents/product-analyst.yaml +31 -0
- package/src/internal/agent/kit/agents/technical-developer.yaml +28 -0
- package/src/internal/agent/kit/agents/technical-project-planner.yaml +30 -0
- package/src/internal/agent/kit/agents/technical-qa-engineer.yaml +36 -0
- package/src/internal/agent/kit/agents/technical-solution-architect.yaml +32 -0
- package/src/internal/agent/kit/commands/archive.yaml +25 -0
- package/src/internal/agent/kit/commands/constitution.yaml +132 -0
- package/src/internal/agent/kit/commands/implement.yaml +96 -0
- package/src/internal/agent/kit/commands/spec.yaml +94 -0
- package/src/internal/agent/kit/instructions/archive.md +68 -0
- package/src/internal/agent/kit/kit.yaml +111 -0
- package/src/internal/agent/kit/skills/opportunity-framing/SKILL.yaml +56 -0
- package/src/internal/agent/kit/skills/pragmatic-product-owner/SKILL.yaml +58 -0
- package/src/internal/agent/kit/skills/pragmatic-product-owner/references/spec-artifacts.yaml +38 -0
- package/src/internal/agent/kit/skills/spec-clarification-interview/SKILL.yaml +52 -0
- package/src/internal/agent/kit/skills/task-atomic-decomposition/SKILL.yaml +137 -0
- package/src/internal/agent/kit/skills/task-atomic-decomposition/references/roadmap-patterns.yaml +103 -0
- package/src/internal/agent/kit_manifests_test.go +58 -0
- package/src/internal/agent/manifest.go +15 -0
- package/src/internal/agent/registry.go +69 -0
- package/src/internal/agent/registry_test.go +51 -0
- package/src/internal/agent/translator.go +334 -0
- package/src/internal/agent/translator_test.go +734 -0
- package/src/internal/cli/archive.go +91 -0
- package/src/internal/cli/archive_test.go +67 -0
- package/src/internal/cli/cli.go +259 -0
- package/src/internal/cli/cli_test.go +130 -0
- package/src/internal/cli/cobra/archive.go +26 -0
- package/src/internal/cli/cobra/console.go +21 -0
- package/src/internal/cli/cobra/constitution.go +44 -0
- package/src/internal/cli/cobra/dummy_test.go +7 -0
- package/src/internal/cli/cobra/implementation.go +50 -0
- package/src/internal/cli/cobra/init.go +23 -0
- package/src/internal/cli/cobra/install.go +21 -0
- package/src/internal/cli/cobra/root.go +47 -0
- package/src/internal/cli/cobra/spec.go +91 -0
- package/src/internal/cli/console.go +48 -0
- package/src/internal/cli/constitution.go +190 -0
- package/src/internal/cli/constitution_test.go +50 -0
- package/src/internal/cli/implementation.go +153 -0
- package/src/internal/cli/implementation_test.go +165 -0
- package/src/internal/cli/spec.go +369 -0
- package/src/internal/cli/spec_test.go +85 -0
- package/src/internal/constitution/registry.go +139 -0
- package/src/internal/constitution/registry_test.go +97 -0
- package/src/internal/constitution/status.go +70 -0
- package/src/internal/constitution/status_test.go +160 -0
- package/src/internal/core/blueprint.go +49 -0
- package/src/internal/core/blueprint_test.go +58 -0
- package/src/internal/core/config.go +124 -0
- package/src/internal/core/config_test.go +145 -0
- package/src/internal/core/constants.go +13 -0
- package/src/internal/core/errors.go +31 -0
- package/src/internal/core/errors_test.go +48 -0
- package/src/internal/core/hooks.go +89 -0
- package/src/internal/core/hooks_test.go +51 -0
- package/src/internal/core/kit.go +15 -0
- package/src/internal/core/kit_test.go +65 -0
- package/src/internal/core/path.go +115 -0
- package/src/internal/core/path_test.go +101 -0
- package/src/internal/core/ui.go +19 -0
- package/src/internal/installer/dependencies.go +23 -0
- package/src/internal/installer/install.go +89 -0
- package/src/internal/installer/installer.go +45 -0
- package/src/internal/installer/installer_test.go +96 -0
- package/src/internal/project/agents_md.go +108 -0
- package/src/internal/project/agents_md_test.go +101 -0
- package/src/internal/project/bootstrapper.go +64 -0
- package/src/internal/project/bootstrapper_test.go +89 -0
- package/src/internal/project/detector.go +35 -0
- package/src/internal/project/detector_test.go +96 -0
- package/src/internal/project/refresh_integration_test.go +86 -0
- package/src/internal/project/service.go +93 -0
- package/src/internal/project/service_test.go +135 -0
- package/src/internal/spec/archive.go +49 -0
- package/src/internal/spec/archive_test.go +55 -0
- package/src/internal/spec/discovery.go +53 -0
- package/src/internal/spec/discovery_test.go +60 -0
- package/src/internal/spec/implementation.go +296 -0
- package/src/internal/spec/implementation_test.go +253 -0
- package/src/internal/spec/registry.go +142 -0
- package/src/internal/spec/registry_test.go +105 -0
- package/src/internal/spec/scanner.go +219 -0
- package/src/internal/spec/scanner_test.go +243 -0
- package/src/internal/spec/service.go +157 -0
- package/src/internal/spec/service_test.go +238 -0
- package/src/internal/spec/status.go +94 -0
- package/src/internal/spec/status_test.go +146 -0
- package/src/internal/spec/tasks.go +103 -0
- package/src/internal/spec/tasks_test.go +137 -0
- package/src/internal/tui/components.go +132 -0
- package/src/internal/tui/console.go +247 -0
- package/src/internal/tui/console_test.go +19 -0
- package/src/internal/tui/constitution.go +36 -0
- package/src/internal/tui/constitution_test.go +32 -0
- package/src/internal/tui/implementation.go +151 -0
- package/src/internal/tui/logo.go +89 -0
- package/src/internal/tui/multiselect.go +199 -0
- package/src/internal/tui/progressbar.go +37 -0
- package/src/internal/tui/progressbar_test.go +30 -0
- package/src/internal/tui/spec.go +35 -0
- package/src/internal/tui/spinner.go +66 -0
- package/src/internal/tui/terminal.go +18 -0
- package/src/internal/tui/theme.go +125 -0
- package/src/internal/tui/ui.go +52 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
description: "Visual direction, interaction patterns, accessibility posture, and aesthetic DNA."
|
|
2
|
+
instruction: |
|
|
3
|
+
Generate the UI/UX document strictly using the provided template. You are filling in a blueprint for a Spec-Driven Development (SDD) framework. Do not output any placeholder text; replace all sections with concrete project decisions.
|
|
4
|
+
|
|
5
|
+
Adhere to the following rules for each section:
|
|
6
|
+
|
|
7
|
+
1. Visual Theme:
|
|
8
|
+
- Explicitly define the primary UI/CSS framework (e.g., Tailwind CSS, custom Vue components, or Bubbletea for TUI) to ground the design.
|
|
9
|
+
- Define the mood, density, and design philosophy without vague adjectives.
|
|
10
|
+
|
|
11
|
+
2. Color Palette & Roles:
|
|
12
|
+
- Provide EXACT, valid Hex codes.
|
|
13
|
+
- CRITICAL: The AI MUST ensure WCAG AA minimum contrast between Text colors and Canvas/Surface colors.
|
|
14
|
+
|
|
15
|
+
3. Typography Rules:
|
|
16
|
+
- Specify real, web-safe, or modern Google fonts (e.g., Inter, Roboto, Fira Code).
|
|
17
|
+
- Fill the hierarchy table with exact CSS values (e.g., rem or px, explicit font weights).
|
|
18
|
+
|
|
19
|
+
4. Component Stylings:
|
|
20
|
+
- Describe stylings using the terminology of the chosen CSS framework (e.g., using Tailwind utility concepts like `rounded-md`, `shadow-sm`).
|
|
21
|
+
|
|
22
|
+
5 & 6. Layout & Depth:
|
|
23
|
+
- Define exact spacing scales (e.g., 4px baseline grid).
|
|
24
|
+
- Define shadow and elevation rules logically (e.g., Modals have highest z-index and shadow-2xl).
|
|
25
|
+
|
|
26
|
+
7. Do's and Don'ts:
|
|
27
|
+
- Provide 3 strict actionable rules for "Do" and 3 for "Don't" to prevent AI hallucination in UI generation.
|
|
28
|
+
|
|
29
|
+
8. Responsive Behavior:
|
|
30
|
+
- Fill the exact pixel ranges for breakpoints. Define strict collapsing strategies for mobile (e.g., "Sidebar becomes a hamburger menu").
|
|
31
|
+
|
|
32
|
+
9. Agent Prompt Guide (CRITICAL FOR SDD):
|
|
33
|
+
- Generate concise, reusable system prompts that will instruct an LLM on how to build a component (e.g., Vue 3) matching this exact visual DNA.
|
|
34
|
+
|
|
35
|
+
CRITICAL: The final output must be pure Markdown, ready to be saved as `ui-ux.md`.
|
|
36
|
+
template: |
|
|
37
|
+
# UI/UX
|
|
38
|
+
|
|
39
|
+
## 1. Visual Theme & Atmosphere
|
|
40
|
+
- **Framework/Base:** [e.g., Tailwind CSS, custom SCSS, etc.]
|
|
41
|
+
- **Theme:** [e.g., Industrial Mission Control / Editorial Luxury / Quiet Utility]
|
|
42
|
+
- **Atmosphere:** [How the product should feel emotionally and operationally]
|
|
43
|
+
- **Density Posture:** [airy / balanced / compact / high-density]
|
|
44
|
+
- **Design Philosophy:** [What the interface optimizes for and what it deliberately avoids]
|
|
45
|
+
- **Signature Moves:** [1-3 recurring visual behaviors or motifs]
|
|
46
|
+
|
|
47
|
+
## 2. Color Palette & Roles
|
|
48
|
+
### Brand & Accent
|
|
49
|
+
- **Primary Brand:** `#` | [Usage]
|
|
50
|
+
- **Secondary Brand:** `#` | [Usage]
|
|
51
|
+
|
|
52
|
+
### Text & Feedback
|
|
53
|
+
- **Primary Text:** `#` | [Usage]
|
|
54
|
+
- **Secondary Text:** `#` | [Usage]
|
|
55
|
+
- **Error:** `#` | [Usage]
|
|
56
|
+
- **Success:** `#` | [Usage]
|
|
57
|
+
- **Warning:** `#` | [Usage]
|
|
58
|
+
- **Info:** `#` | [Usage]
|
|
59
|
+
|
|
60
|
+
### Surface & Border
|
|
61
|
+
- **Canvas:** `#` | [Usage]
|
|
62
|
+
- **Surface:** `#` | [Usage]
|
|
63
|
+
- **Muted Surface:** `#` | [Usage]
|
|
64
|
+
- **Border:** `#` | [Usage]
|
|
65
|
+
|
|
66
|
+
## 3. Typography Rules
|
|
67
|
+
### Font Family
|
|
68
|
+
- **Primary:**
|
|
69
|
+
- **Secondary:**
|
|
70
|
+
- **Usage Logic:**
|
|
71
|
+
|
|
72
|
+
### Hierarchy
|
|
73
|
+
| Role | Font | Size | Weight | Line Height | Letter Spacing | Notes |
|
|
74
|
+
|---|---|---|---|---|---|---|
|
|
75
|
+
| Display | | | | | | |
|
|
76
|
+
| Heading | | | | | | |
|
|
77
|
+
| Subheading | | | | | | |
|
|
78
|
+
| Body | | | | | | |
|
|
79
|
+
| UI Label | | | | | | |
|
|
80
|
+
| Caption | | | | | | |
|
|
81
|
+
|
|
82
|
+
### Content Voice
|
|
83
|
+
- **Headlines:**
|
|
84
|
+
- **Buttons & Actions:**
|
|
85
|
+
- **Form Guidance:**
|
|
86
|
+
|
|
87
|
+
## 4. Component Stylings
|
|
88
|
+
### Buttons
|
|
89
|
+
- **Primary:**
|
|
90
|
+
- **Secondary:**
|
|
91
|
+
- **Destructive:**
|
|
92
|
+
|
|
93
|
+
### Cards & Panels
|
|
94
|
+
- **Container Style:**
|
|
95
|
+
- **State Behavior:**
|
|
96
|
+
|
|
97
|
+
### Inputs & Forms
|
|
98
|
+
- **Input Baseline:**
|
|
99
|
+
- **Focus Style:**
|
|
100
|
+
- **Error Style:**
|
|
101
|
+
|
|
102
|
+
### Navigation
|
|
103
|
+
- **Primary Navigation:**
|
|
104
|
+
- **Active State:**
|
|
105
|
+
- **Secondary Navigation:**
|
|
106
|
+
|
|
107
|
+
## 5. Layout Principles
|
|
108
|
+
- **Spacing Scale:**
|
|
109
|
+
- **Grid Logic:**
|
|
110
|
+
- **Whitespace Philosophy:**
|
|
111
|
+
- **Page Structure Bias:**
|
|
112
|
+
- **Navigation Distribution:**
|
|
113
|
+
|
|
114
|
+
## 6. Depth & Elevation
|
|
115
|
+
| Level | Treatment | Use |
|
|
116
|
+
|---|---|---|
|
|
117
|
+
| Flat | | backgrounds, passive surfaces |
|
|
118
|
+
| Raised | | cards, popovers, controls |
|
|
119
|
+
| Interactive Hover | | buttons, cards, nav items |
|
|
120
|
+
| Modal / Priority | | dialogs, overlays, blocking UI |
|
|
121
|
+
|
|
122
|
+
- **Shadow Philosophy:**
|
|
123
|
+
- **Surface Hierarchy:**
|
|
124
|
+
|
|
125
|
+
## 7. Do's and Don'ts
|
|
126
|
+
### Do
|
|
127
|
+
-
|
|
128
|
+
-
|
|
129
|
+
-
|
|
130
|
+
|
|
131
|
+
### Don't
|
|
132
|
+
-
|
|
133
|
+
-
|
|
134
|
+
-
|
|
135
|
+
|
|
136
|
+
## 8. Responsive Behavior
|
|
137
|
+
| Breakpoint | Width | Key Changes |
|
|
138
|
+
|---|---|---|
|
|
139
|
+
| Mobile | | |
|
|
140
|
+
| Tablet | | |
|
|
141
|
+
| Desktop | | |
|
|
142
|
+
| Large Desktop | | |
|
|
143
|
+
|
|
144
|
+
- **Touch Targets:**
|
|
145
|
+
- **Collapsing Strategy:**
|
|
146
|
+
- **Responsive Priority:**
|
|
147
|
+
|
|
148
|
+
## 9. Agent Prompt Guide
|
|
149
|
+
### Quick Reference
|
|
150
|
+
- **Theme Summary:**
|
|
151
|
+
- **Primary Colors:**
|
|
152
|
+
- **Typography Summary:**
|
|
153
|
+
- **Key Surface Rules:**
|
|
154
|
+
|
|
155
|
+
### Example Prompts
|
|
156
|
+
- "Build a component using..."
|
|
157
|
+
- "Build a form using..."
|
|
158
|
+
- "When making this responsive, ensure that..."
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
description: "Technical blueprint, data models, API contracts, and file inventory."
|
|
2
|
+
dependency: requirements
|
|
3
|
+
instruction: |
|
|
4
|
+
Generate a deterministic technical blueprint based on the Requirements document. Adhere strictly to the following execution rules:
|
|
5
|
+
|
|
6
|
+
1. **Zero Philosophy:** DO NOT write architectural rationale or debate alternatives. Your output must be a strict, actionable blueprint.
|
|
7
|
+
2. **Visual Architecture:** You MUST generate a Mermaid.js diagram (`graph TB` or `erDiagram`) representing the data flow or persistence model.
|
|
8
|
+
3. **Strict API Contracts:** API Contracts MUST be exact, including HTTP methods, JSON payload structures, and expected HTTP status codes. This is critical for downstream Developer TDD.
|
|
9
|
+
4. **Standardized Inventory:** The File & Component Inventory must use explicit file paths and map core responsibilities clearly.
|
|
10
|
+
5. **Conditional Omission:** If the `lens` is "UI-heavy" and requires no backend changes, you MUST completely delete the `Persistence` and `API` sections. Do not leave placeholders.
|
|
11
|
+
template: |
|
|
12
|
+
---
|
|
13
|
+
slug: {FEATURE_SLUG}
|
|
14
|
+
lens: [UI-heavy | Backend-heavy | Integration | Migration | Balanced full-stack]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Technical Design: {FEATURE_NAME}
|
|
18
|
+
|
|
19
|
+
## 1. Architecture Blueprint
|
|
20
|
+
*A visual representation of the data flow or entity relationships for this feature.*
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
graph TB
|
|
24
|
+
User((User)) --> UI[Frontend]
|
|
25
|
+
UI --> API[API Layer]
|
|
26
|
+
API --> Domain[Domain Logic]
|
|
27
|
+
Domain --> DB[(Database)]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 2. Persistence & Data Modeling
|
|
31
|
+
*(Render this section ONLY if the database schema is changing. Otherwise, omit entirely).*
|
|
32
|
+
- **Schema Changes:** [e.g., Add `status` column to `users` table].
|
|
33
|
+
- **Indexes & Constraints:** [e.g., Unique index on `email`].
|
|
34
|
+
|
|
35
|
+
## 3. API & Interfaces (The Contract)
|
|
36
|
+
*(Render this section ONLY if new APIs or external contracts are created/modified. Otherwise, omit entirely).*
|
|
37
|
+
- **Endpoint:** `[METHOD] /api/path`
|
|
38
|
+
- **AuthZ / Roles:** [Who can access this endpoint?]
|
|
39
|
+
- **Request Payload:** [JSON structure or Query Params]
|
|
40
|
+
- **Response (200 OK):** [JSON structure]
|
|
41
|
+
- **Response (4xx/5xx):** [Error mapping]
|
|
42
|
+
|
|
43
|
+
## 4. File & Component Inventory
|
|
44
|
+
*The exact files that the Developer must create or modify. Map the core responsibility.*
|
|
45
|
+
|
|
46
|
+
**Backend:**
|
|
47
|
+
- `[src/Domain/Path/File.ext]` -> [Core responsibility]
|
|
48
|
+
|
|
49
|
+
**Frontend:**
|
|
50
|
+
- `[src/components/Path/File.ext]` -> [Core responsibility]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
description: "Functional requirements, business rules, and strict BDD acceptance criteria."
|
|
2
|
+
instruction: |
|
|
3
|
+
Generate a high-fidelity business specification focusing entirely on the "What" and "Why", never the "How". Adhere strictly to the following execution rules:
|
|
4
|
+
|
|
5
|
+
1. **Zero Code Mandate:** DO NOT write technical implementation details, JSON payloads, or database schemas. Stick to pure business domain and user value.
|
|
6
|
+
2. **BDD Rigor:** Acceptance Criteria MUST follow the strict GIVEN/WHEN/THEN syntax. For every requirement, you MUST define at least one "Edge Case" or failure state.
|
|
7
|
+
3. **Scope Containment:** Pay heavy attention to the "Out of Scope" section. Explicitly list features or edge cases that downstream agents MUST NOT build.
|
|
8
|
+
4. **Conditional Omission:** If the `lens` is "Backend-heavy" or "Integration", you MUST completely delete the `## 5. UI/UX Contract` section. Do not leave placeholders or write "Not applicable".
|
|
9
|
+
5. **YAML Frontmatter:** Ensure the top YAML block is correctly populated with the `slug` and the correct `lens`.
|
|
10
|
+
template: |
|
|
11
|
+
---
|
|
12
|
+
slug: {FEATURE_SLUG}
|
|
13
|
+
lens: [UI-heavy | Backend-heavy | Integration | Migration | Balanced full-stack]
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Feature: {FEATURE_NAME}
|
|
17
|
+
|
|
18
|
+
## 1. Context & Value
|
|
19
|
+
[Briefly describe the business value and the core problem being solved. Max 3 sentences.]
|
|
20
|
+
|
|
21
|
+
## 2. Out of Scope (Anti-Goals)
|
|
22
|
+
*Explicitly state what MUST NOT be built in this specific feature to prevent scope creep.*
|
|
23
|
+
- [e.g., Do not implement the email notification flow in this spec]
|
|
24
|
+
- [e.g., Do not build the admin panel UI yet]
|
|
25
|
+
|
|
26
|
+
## 3. Acceptance Criteria (BDD)
|
|
27
|
+
*Every requirement MUST be testable. Define success and failure.*
|
|
28
|
+
|
|
29
|
+
### [REQ-1] {Title}
|
|
30
|
+
**User Story:** AS A [persona], I WANT TO [action], SO THAT [value].
|
|
31
|
+
|
|
32
|
+
**Scenarios:**
|
|
33
|
+
1. **[Happy Path]** GIVEN [context] WHEN [action] THEN [outcome].
|
|
34
|
+
2. **[Edge Case]** GIVEN [context] WHEN [exception/error] THEN [fallback/behavior].
|
|
35
|
+
3. **[Ambiguity]** [Explicitly state what is unclear, or define the ASSUMPTION made].
|
|
36
|
+
|
|
37
|
+
### [REQ-2] {Title}
|
|
38
|
+
*(Repeat structure as needed)*
|
|
39
|
+
|
|
40
|
+
## 4. Business Invariants
|
|
41
|
+
*Strict domain rules that the system must never violate, regardless of the user story. These must be technically testable.*
|
|
42
|
+
- [e.g., A user cannot be deleted if they have active invoices].
|
|
43
|
+
|
|
44
|
+
## 5. UI/UX Contract
|
|
45
|
+
*(Render this section ONLY if the lens includes UI. Otherwise, omit entirely).*
|
|
46
|
+
- **Visual Posture:** [e.g., High-density data table, minimal modal].
|
|
47
|
+
- **State Behavior:** [Rules for loading, empty, error, and recovery states].
|
|
48
|
+
- **Accessibility:** [Expected standard, e.g., ARIA labels, tab navigation].
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
description: "Atomic, sequential implementation roadmap and TDD verification steps in a strict, CLI-scannable format."
|
|
2
|
+
dependency: design
|
|
3
|
+
instruction: |
|
|
4
|
+
Generate the Tasks/Implementation Roadmap for the feature based on the Design and Requirements.
|
|
5
|
+
|
|
6
|
+
1. DO NOT write actual implementation code. You write the INTENT and the ACTION.
|
|
7
|
+
2. Tasks MUST be strictly sequential. Do not use parallel execution flags.
|
|
8
|
+
3. **Phases**: Group tasks into logical phases using `### Phase {N}: [Phase Name]` headers.
|
|
9
|
+
4. STRICT FORMATTING: Use `#### T{Phase}.{Task}:` as the header for EVERY task. The immediate next line MUST be the state tracker.
|
|
10
|
+
- ENUM CONSTRAINT: The state MUST be exactly `**State:** [PENDING]`.
|
|
11
|
+
- DO NOT invent new states. DO NOT use [TODO], [IN_PROGRESS], or [WAITING].
|
|
12
|
+
5. Target Flexibility: If a task is a global operation, set the Target to the CLI command (e.g., `CLI (npm run lint)`) or `Global Scope`.
|
|
13
|
+
template: |
|
|
14
|
+
---
|
|
15
|
+
slug: {FEATURE_SLUG}
|
|
16
|
+
lens: [UI-heavy | Backend-heavy | Integration | Migration | Balanced full-stack]
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Implementation Roadmap: {FEATURE_NAME}
|
|
20
|
+
|
|
21
|
+
## 1. Execution Strategy
|
|
22
|
+
- **Gravity Order:** [Briefly explain the sequence, e.g., DB Migration -> Domain Logic -> API Controllers -> UI]
|
|
23
|
+
|
|
24
|
+
## 2. Tasks
|
|
25
|
+
|
|
26
|
+
### Phase 1: [Phase Name]
|
|
27
|
+
|
|
28
|
+
#### T1.1: [SCAFFOLD/CLI] {Task Title}
|
|
29
|
+
**State:** `[PENDING]`
|
|
30
|
+
**Target:** `{Exact/File/Path.ext | CLI Command | Global Scope}`
|
|
31
|
+
**Context:** [REQ-X]
|
|
32
|
+
|
|
33
|
+
**Action Steps:**
|
|
34
|
+
- [Step 1: Concrete change]
|
|
35
|
+
- [Step 2: Concrete change]
|
|
36
|
+
|
|
37
|
+
**Verification (TDD):**
|
|
38
|
+
[MANDATORY: Define the exact test scenario or CLI command the developer MUST write/run to prove this task works.]
|
|
39
|
+
|
|
40
|
+
### Phase 2: [Phase Name]
|
|
41
|
+
|
|
42
|
+
#### T2.1: [CODE] {Task Title}
|
|
43
|
+
**State:** `[PENDING]`
|
|
44
|
+
**Target:** `{Exact/File/Path.ext | CLI Command | Global Scope}`
|
|
45
|
+
**Context:** [REQ-X]
|
|
46
|
+
|
|
47
|
+
**Action Steps:**
|
|
48
|
+
- [Step 1: Concrete change]
|
|
49
|
+
|
|
50
|
+
**Verification (TDD):**
|
|
51
|
+
[Explicit test scenario or CLI command]
|
|
52
|
+
|
|
53
|
+
## 3. Pre-emptive Mitigations
|
|
54
|
+
*(Render this section ONLY if there are high-impact execution risks, otherwise omit).*
|
|
55
|
+
- **Risk:** [e.g., Concurrent DB writes] -> **Mitigation:** [e.g., Use pessimistic locking].
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
package agent
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"io/fs"
|
|
6
|
+
"os"
|
|
7
|
+
"path/filepath"
|
|
8
|
+
"testing"
|
|
9
|
+
|
|
10
|
+
"github.com/jeancodogno/specforce-kit/src/internal/core"
|
|
11
|
+
"github.com/jeancodogno/specforce-kit/src/internal/installer"
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
func getTestKitConfig() *core.KitConfig {
|
|
15
|
+
return &core.KitConfig{
|
|
16
|
+
Tools: map[string]core.ToolRoute{
|
|
17
|
+
"qwen": {
|
|
18
|
+
Target: ".qwen",
|
|
19
|
+
Mappings: map[string]core.MappingConfig{
|
|
20
|
+
"agents": {Path: "agents", Ext: ".md"},
|
|
21
|
+
"skills": {Path: "skills", Ext: ".md"},
|
|
22
|
+
"commands": {Path: "commands/spf", Ext: ".md"},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
"open-code": {
|
|
26
|
+
Target: ".opencode",
|
|
27
|
+
Mappings: map[string]core.MappingConfig{
|
|
28
|
+
"agents": {Path: "agents", Ext: ".md"},
|
|
29
|
+
"skills": {Path: "skills", Ext: ".md"},
|
|
30
|
+
"commands": {Path: "commands", Ext: ".md"},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
"kilo-code": {
|
|
34
|
+
Target: ".kilocode",
|
|
35
|
+
Mappings: map[string]core.MappingConfig{
|
|
36
|
+
"agents": {Path: "agents", Ext: ".md"},
|
|
37
|
+
"skills": {Path: "skills", Ext: ".md"},
|
|
38
|
+
"commands": {Path: "commands", Ext: ".md"},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
"codex": {
|
|
42
|
+
Target: ".codex",
|
|
43
|
+
Mappings: map[string]core.MappingConfig{
|
|
44
|
+
"agents": {Path: "agents", Ext: ".md"},
|
|
45
|
+
"skills": {Path: "skills", Ext: ".md"},
|
|
46
|
+
"commands": {Path: "commands/spf", Ext: ".md"},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
func TestNewAgentMappings(t *testing.T) {
|
|
54
|
+
tmpDir, err := os.MkdirTemp("", "specforce-test-compat-*")
|
|
55
|
+
if err != nil {
|
|
56
|
+
t.Fatalf("failed to create temp dir: %v", err)
|
|
57
|
+
}
|
|
58
|
+
defer func() { _ = os.RemoveAll(tmpDir) }()
|
|
59
|
+
|
|
60
|
+
projectRoot := filepath.Join(tmpDir, "project")
|
|
61
|
+
kitFS, err := GetKitFS()
|
|
62
|
+
if err != nil {
|
|
63
|
+
t.Fatalf("failed to get kit FS: %v", err)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
kitConfig := getTestKitConfig()
|
|
67
|
+
agents := []struct {
|
|
68
|
+
id string
|
|
69
|
+
folder string
|
|
70
|
+
}{
|
|
71
|
+
{"qwen", ".qwen"},
|
|
72
|
+
{"open-code", ".opencode"},
|
|
73
|
+
{"kilo-code", ".kilocode"},
|
|
74
|
+
{"codex", ".codex"},
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
for _, agent := range agents {
|
|
78
|
+
t.Run(agent.id, func(t *testing.T) {
|
|
79
|
+
testAgentMappings(t, projectRoot, kitFS, kitConfig, agent.id, agent.folder)
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
func testAgentMappings(t *testing.T, projectRoot string, kitFS fs.FS, kitConfig *core.KitConfig, agentID, folder string) {
|
|
85
|
+
// Test agent mapping
|
|
86
|
+
err := processBlueprint(context.Background(), projectRoot, kitFS, kitConfig, "agents/technical-developer.yaml", agentID, installer.Options{})
|
|
87
|
+
if err != nil {
|
|
88
|
+
t.Fatalf("processBlueprint failed for %s: %v", agentID, err)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
expectedPath := filepath.Join(projectRoot, folder, "agents/technical-developer.md")
|
|
92
|
+
if _, err := os.Stat(expectedPath); os.IsNotExist(err) {
|
|
93
|
+
t.Errorf("expected file %s to exist", expectedPath)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Test skill mapping
|
|
97
|
+
err = processBlueprint(context.Background(), projectRoot, kitFS, kitConfig, "skills/task-atomic-decomposition/SKILL.yaml", agentID, installer.Options{})
|
|
98
|
+
if err != nil {
|
|
99
|
+
t.Fatalf("processBlueprint failed for skill on %s: %v", agentID, err)
|
|
100
|
+
}
|
|
101
|
+
expectedSkillPath := filepath.Join(projectRoot, folder, "skills/task-atomic-decomposition/SKILL.md")
|
|
102
|
+
if _, err := os.Stat(expectedSkillPath); os.IsNotExist(err) {
|
|
103
|
+
t.Errorf("expected skill file %s to exist", expectedSkillPath)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Test command mapping
|
|
107
|
+
err = processBlueprint(context.Background(), projectRoot, kitFS, kitConfig, "commands/archive.yaml", agentID, installer.Options{})
|
|
108
|
+
if err != nil {
|
|
109
|
+
t.Fatalf("processBlueprint failed for command on %s: %v", agentID, err)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
expectedCmdPath := filepath.Join(projectRoot, folder, "commands/spf/archive.md")
|
|
113
|
+
if agentID == "open-code" || agentID == "kilo-code" {
|
|
114
|
+
expectedCmdPath = filepath.Join(projectRoot, folder, "commands/spf.archive.md")
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if _, err := os.Stat(expectedCmdPath); os.IsNotExist(err) {
|
|
118
|
+
t.Errorf("expected command file %s to exist", expectedCmdPath)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package agent
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"embed"
|
|
5
|
+
"io/fs"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
//go:embed kit/* artifacts/*
|
|
9
|
+
var EmbeddedResources embed.FS
|
|
10
|
+
|
|
11
|
+
// GetKitFS returns a sub-filesystem rooted at kit.
|
|
12
|
+
func GetKitFS() (fs.FS, error) {
|
|
13
|
+
return fs.Sub(EmbeddedResources, "kit")
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// GetArtifactsFS returns a sub-filesystem rooted at artifacts.
|
|
17
|
+
func GetArtifactsFS() (fs.FS, error) {
|
|
18
|
+
return fs.Sub(EmbeddedResources, "artifacts")
|
|
19
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
package agent
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"context"
|
|
5
|
+
"os"
|
|
6
|
+
"path/filepath"
|
|
7
|
+
"testing"
|
|
8
|
+
|
|
9
|
+
"github.com/jeancodogno/specforce-kit/src/internal/core"
|
|
10
|
+
"github.com/jeancodogno/specforce-kit/src/internal/installer"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func TestIntegration_CodexGlobalExport(t *testing.T) {
|
|
14
|
+
tmpDir, err := os.MkdirTemp("", "specforce-int-codex-*")
|
|
15
|
+
if err != nil {
|
|
16
|
+
t.Fatalf("failed to create temp dir: %v", err)
|
|
17
|
+
}
|
|
18
|
+
defer func() { _ = os.RemoveAll(tmpDir) }()
|
|
19
|
+
|
|
20
|
+
promptsDir := filepath.Join(tmpDir, "global-prompts")
|
|
21
|
+
if err := os.Setenv("CODEX_PROMPTS_DIR", promptsDir); err != nil {
|
|
22
|
+
t.Fatalf("failed to set env var: %v", err)
|
|
23
|
+
}
|
|
24
|
+
defer func() { _ = os.Unsetenv("CODEX_PROMPTS_DIR") }()
|
|
25
|
+
|
|
26
|
+
projectRoot := filepath.Join(tmpDir, "project")
|
|
27
|
+
_ = os.MkdirAll(projectRoot, 0755)
|
|
28
|
+
|
|
29
|
+
// Mock kitFS with the actual kit.yaml we just modified
|
|
30
|
+
kitFS := os.DirFS("kit")
|
|
31
|
+
|
|
32
|
+
kitConfig, err := LoadKitConfig(kitFS, projectRoot)
|
|
33
|
+
if err != nil {
|
|
34
|
+
t.Fatalf("failed to load kit config: %v", err)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Create a dummy blueprint
|
|
38
|
+
kitDir := filepath.Join(tmpDir, "mock-kit")
|
|
39
|
+
_ = os.MkdirAll(filepath.Join(kitDir, "commands"), 0755)
|
|
40
|
+
blueprintYAML := "description: Test Integration\ncontent: |\n # Integrated\n"
|
|
41
|
+
_ = os.WriteFile(filepath.Join(kitDir, "commands/test-int.yaml"), []byte(blueprintYAML), 0644)
|
|
42
|
+
|
|
43
|
+
blueprintFS := os.DirFS(kitDir)
|
|
44
|
+
|
|
45
|
+
err = processBlueprint(context.Background(), projectRoot, blueprintFS, kitConfig, "commands/test-int.yaml", "codex", installer.Options{})
|
|
46
|
+
if err != nil {
|
|
47
|
+
t.Fatalf("processBlueprint failed: %v", err)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Expected: promptsDir/spf-test-int.md
|
|
51
|
+
expectedPath := filepath.Join(promptsDir, "spf-test-int.md")
|
|
52
|
+
if _, err := os.Stat(expectedPath); os.IsNotExist(err) {
|
|
53
|
+
t.Errorf("expected integrated file %s to exist", expectedPath)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
func TestIntegration_AntigravityFlatExport(t *testing.T) {
|
|
58
|
+
tmpDir, err := os.MkdirTemp("", "specforce-int-antigravity-*")
|
|
59
|
+
if err != nil {
|
|
60
|
+
t.Fatalf("failed to create temp dir: %v", err)
|
|
61
|
+
}
|
|
62
|
+
defer func() { _ = os.RemoveAll(tmpDir) }()
|
|
63
|
+
|
|
64
|
+
projectRoot := filepath.Join(tmpDir, "project")
|
|
65
|
+
_ = os.MkdirAll(projectRoot, 0755)
|
|
66
|
+
|
|
67
|
+
kitConfig := &core.KitConfig{
|
|
68
|
+
Tools: map[string]core.ToolRoute{
|
|
69
|
+
"antigravity": {
|
|
70
|
+
Target: ".agent/",
|
|
71
|
+
Mappings: map[string]core.MappingConfig{
|
|
72
|
+
"commands": {
|
|
73
|
+
Path: ".",
|
|
74
|
+
Name: "spf-*",
|
|
75
|
+
Ext: ".md",
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
kitDir := filepath.Join(tmpDir, "mock-kit")
|
|
83
|
+
_ = os.MkdirAll(filepath.Join(kitDir, "commands"), 0755)
|
|
84
|
+
_ = os.WriteFile(filepath.Join(kitDir, "commands/wf.yaml"), []byte("description: wf"), 0644)
|
|
85
|
+
blueprintFS := os.DirFS(kitDir)
|
|
86
|
+
|
|
87
|
+
err = processBlueprint(context.Background(), projectRoot, blueprintFS, kitConfig, "commands/wf.yaml", "antigravity", installer.Options{})
|
|
88
|
+
if err != nil {
|
|
89
|
+
t.Fatalf("processBlueprint failed: %v", err)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Expected: .agent/spf-wf.md (Flat, no subfolder)
|
|
93
|
+
expectedPath := filepath.Join(projectRoot, ".agent/spf-wf.md")
|
|
94
|
+
if _, err := os.Stat(expectedPath); os.IsNotExist(err) {
|
|
95
|
+
t.Errorf("expected flat file %s to exist", expectedPath)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
func TestIntegration_SecurityConstraint(t *testing.T) {
|
|
100
|
+
tmpDir, err := os.MkdirTemp("", "specforce-int-security-*")
|
|
101
|
+
if err != nil {
|
|
102
|
+
t.Fatalf("failed to create temp dir: %v", err)
|
|
103
|
+
}
|
|
104
|
+
defer func() { _ = os.RemoveAll(tmpDir) }()
|
|
105
|
+
|
|
106
|
+
projectRoot := filepath.Join(tmpDir, "project")
|
|
107
|
+
_ = os.MkdirAll(projectRoot, 0755)
|
|
108
|
+
|
|
109
|
+
globalTmp, _ := os.MkdirTemp("", "specforce-global-attack-*")
|
|
110
|
+
defer func() { _ = os.RemoveAll(globalTmp) }()
|
|
111
|
+
|
|
112
|
+
// Configure 'claude' (non-global) with an absolute path
|
|
113
|
+
kitConfig := &core.KitConfig{
|
|
114
|
+
Tools: map[string]core.ToolRoute{
|
|
115
|
+
"claude": {
|
|
116
|
+
Target: globalTmp,
|
|
117
|
+
Mappings: map[string]core.MappingConfig{
|
|
118
|
+
"commands": {Path: "spf", Ext: ".md"},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
kitDir := filepath.Join(tmpDir, "mock-kit")
|
|
125
|
+
_ = os.MkdirAll(filepath.Join(kitDir, "commands"), 0755)
|
|
126
|
+
_ = os.WriteFile(filepath.Join(kitDir, "commands/attack.yaml"), []byte("description: attack"), 0644)
|
|
127
|
+
blueprintFS := os.DirFS(kitDir)
|
|
128
|
+
|
|
129
|
+
err = processBlueprint(context.Background(), projectRoot, blueprintFS, kitConfig, "commands/attack.yaml", "claude", installer.Options{})
|
|
130
|
+
|
|
131
|
+
// Should fail with security error
|
|
132
|
+
if err == nil {
|
|
133
|
+
t.Error("expected processBlueprint to fail for non-global agent with absolute path, but it succeeded")
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: product-analyst
|
|
2
|
+
description: Senior Product Strategist & PO. Specializes in value-driven requirements
|
|
3
|
+
and binary acceptance criteria.
|
|
4
|
+
skills:
|
|
5
|
+
- pragmatic-product-owner
|
|
6
|
+
- opportunity-framing
|
|
7
|
+
- spec-clarification-interview
|
|
8
|
+
content: |
|
|
9
|
+
# ROLE: Senior Product Analyst (PO)
|
|
10
|
+
|
|
11
|
+
You are the Senior Product Owner. Your mission is to bridge the gap between user needs and technical execution by defining pragmatic, unambiguous, and value-driven requirements.
|
|
12
|
+
|
|
13
|
+
## 1. The Constitution is the Law
|
|
14
|
+
Before taking any action, you MUST align your thinking with the project's Core Constitution (specifically `principles.md` and `domain.md` located in `.specforce/docs/`). You are the guardian of the "Out of Scope" (Anti-Goals) defined in the principles.
|
|
15
|
+
|
|
16
|
+
## 2. Skill Discovery & Utilization Protocol
|
|
17
|
+
You have access to a library of specialized skills/heuristics. You MUST NOT rely on generic LLM behavior. For every task, follow this loop:
|
|
18
|
+
|
|
19
|
+
- **Analyze:** Break down the user's request. Is it a discovery phase? A refinement of a vague idea? Writing final specs?
|
|
20
|
+
- **Search & Identify:** Query your environment/tooling for available specialized "Skills" (e.g., opportunity framing, spec clarification, UX definition). Select the ONE skill most appropriate for the current phase of the task.
|
|
21
|
+
- **Adopt & Execute:** Load the rules of the chosen skill and apply its exact methodology to complete the task.
|
|
22
|
+
|
|
23
|
+
## 3. Operational Mandates
|
|
24
|
+
When operating, you must adhere to these product axioms:
|
|
25
|
+
- **Binary Acceptance Criteria (BDD):** Write scenarios that are strictly Pass/Fail. Ambiguity is a failure of your role.
|
|
26
|
+
- **Expose Real Ambiguity:** Do not silently resolve missing business logic just to finish a prompt. If permissions, edge cases, or destructive actions are underspecified, explicitly halt and mark them as `[UNCLEAR: Requires user definition]`.
|
|
27
|
+
- **Scenario-First Context:** Identify the nature of the feature (UI-heavy, Backend-heavy, Integration) and tailor the depth of your specs accordingly.
|
|
28
|
+
|
|
29
|
+
## 4. Strict Constraints (Non-Negotiable)
|
|
30
|
+
- **NO CODE:** You are a Product Owner, not a Software Engineer. You MUST NEVER write, suggest, or review implementation code (no PHP, TS, Go, etc.). You write business rules, data boundaries, and API contracts (JSON), nothing lower-level.
|
|
31
|
+
- **Interrogate Before Assuming:** If you are asked to draft a new feature but lack critical context (user volume, role access), you must use your available tools to ask the user one focused question before proceeding.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: technical-developer
|
|
2
|
+
description: "Senior Staff Engineer. Specializes in precise implementation, strict TDD (Red-Green-Refactor), and self-healing execution loops."
|
|
3
|
+
content: |
|
|
4
|
+
# ROLE: Senior Staff Engineer
|
|
5
|
+
|
|
6
|
+
You are the methodical implementation specialist for this project. Your mission is to translate approved Specifications into production-ready code. Your primary engine for writing and verifying code is Test-Driven Development (TDD) running within the project's test harness.
|
|
7
|
+
|
|
8
|
+
## 1. Specification Fidelity & Context
|
|
9
|
+
Your absolute source of truth is the Feature Spec assigned to you. You MUST NOT invent requirements, add unrequested features, or "gold-plate" the implementation. Execute exactly what is defined.
|
|
10
|
+
|
|
11
|
+
## 2. Skill Discovery & Stack Protocol (CRITICAL)
|
|
12
|
+
You must not rely on generic coding habits. You have access to a library of specialized engineering skills (e.g., framework-specific rules, database optimization techniques). Before writing code, follow this loop:
|
|
13
|
+
- **Analyze:** Read the task and identify the required technical domain (Frontend UI, API Backend, Infrastructure, Database Migration).
|
|
14
|
+
- **Search & Identify:** Query your environment/tooling for available technical "Skills". Select the ONE skill that best matches the current stack requirements.
|
|
15
|
+
- **Adopt & Execute:** Load the specific typing rules, linters, and architectural patterns of that skill. Apply them strictly during your implementation.
|
|
16
|
+
|
|
17
|
+
## 3. The TDD & Harness Protocol
|
|
18
|
+
You do not write code blindly. You rely on the test harness to prove your work. For every task, execute this strict loop:
|
|
19
|
+
1. **RED (Test First):** Write an automated test (Unit or Integration) for the exact behavior described in the Spec. Run the test harness. It MUST fail, proving the test is valid and the feature is missing.
|
|
20
|
+
2. **GREEN (Implement):** Write the absolute minimum code required to make the test pass. Run the test harness.
|
|
21
|
+
3. **REFACTOR (Clean):** Once passing, clean up the code, ensure strict typing, and verify architectural boundaries are respected.
|
|
22
|
+
4. **SELF-HEALING (The Loop):** If a test fails during the Green or Refactor phase, DO NOT immediately halt and ask the user for help. You MUST read the stack trace/error output, analyze the failure, modify your code, and re-run the harness. You have a mandate to attempt self-correction up to 3 times before escalating a failure to the user.
|
|
23
|
+
|
|
24
|
+
## 4. Engineering Guardrails (Non-Negotiable)
|
|
25
|
+
- **Fail Loudly (Spec Conflict):** If a task is technically impossible, unsafe, or fundamentally conflicts with the established architecture, you MUST HALT. Do not "hack" a workaround. Escalate the issue.
|
|
26
|
+
- **No Architectural Drift:** Do NOT introduce new frameworks, external packages, or structural state-managers just to make a test pass easier. Use the approved baseline stack.
|
|
27
|
+
- **Codebase Respect:** When modifying existing code, do NOT remove human-written comments unless explicitly obsolete, and do NOT silence exceptions without proper logging.
|
|
28
|
+
- **Security by Default:** Assume all new endpoints or data mutations are protected. Enforce authorization checks before executing any domain logic.
|