@rrgarciach/flow-spec 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/init.js +91 -0
- package/package.json +28 -0
- package/template/.cursor/rules/use-base-rules.mdc +37 -0
- package/template/ai-specs/agents/backend-developer.md +121 -0
- package/template/ai-specs/agents/frontend-developer.md +134 -0
- package/template/ai-specs/agents/product-strategy-analyst.md +53 -0
- package/template/ai-specs/flow-spec-instructions.md +389 -0
- package/template/ai-specs/scripts/code_review.sh +35 -0
- package/template/ai-specs/skills/code-auditing/SKILL.md +155 -0
- package/template/ai-specs/skills/code-auditing/references/audit-methodology.md +371 -0
- package/template/ai-specs/skills/code-auditing/references/dead-code-methodology.md +261 -0
- package/template/ai-specs/skills/commit/SKILL.md +101 -0
- package/template/ai-specs/skills/enrich-us/SKILL.md +42 -0
- package/template/ai-specs/skills/explain/SKILL.md +84 -0
- package/template/ai-specs/skills/meta-prompt/SKILL.md +19 -0
- package/template/ai-specs/skills/update-docs/SKILL.md +13 -0
- package/template/ai-specs/skills/using-git-worktrees/SKILL.md +375 -0
- package/template/ai-specs/skills/writing-skills/SKILL.md +655 -0
- package/template/ai-specs/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/template/ai-specs/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/template/ai-specs/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/template/ai-specs/skills/writing-skills/persuasion-principles.md +187 -0
- package/template/ai-specs/skills/writing-skills/render-graphs.js +168 -0
- package/template/ai-specs/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/template/docs/api-spec.yml +29 -0
- package/template/docs/backend-standards.md +53 -0
- package/template/docs/base-standards.md +114 -0
- package/template/docs/data-model.md +26 -0
- package/template/docs/development_guide.md +36 -0
- package/template/docs/documentation-standards.md +49 -0
- package/template/docs/frontend-standards.md +45 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: This document contains all development rules and guidelines for this project, applicable to all AI agents (Claude, Cursor, Codex, Gemini, etc.).
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## 1. Core Principles
|
|
7
|
+
|
|
8
|
+
- **Small tasks, one at a time**: Always work in baby steps, one at a time. Never go forward more than one step.
|
|
9
|
+
- **Test-Driven Development**: Start with failing tests for any new functionality (TDD), according to the task details.
|
|
10
|
+
- **Type Safety**: All code must be fully typed.
|
|
11
|
+
- **Clear Naming**: Use clear, descriptive names for all variables and functions.
|
|
12
|
+
- **Incremental Changes**: Prefer incremental, focused changes over large, complex modifications.
|
|
13
|
+
- **Question Assumptions**: Always question assumptions and inferences.
|
|
14
|
+
- **Pattern Detection**: Detect and highlight repeated code patterns.
|
|
15
|
+
|
|
16
|
+
## 2. Language Standards
|
|
17
|
+
- **English Only**: All technical artifacts must always use English, including:
|
|
18
|
+
- Code (variables, functions, classes, comments, error messages, log messages)
|
|
19
|
+
- Documentation (README, guides, API docs)
|
|
20
|
+
- Monday.com items (titles, updates, comments)
|
|
21
|
+
- Data schemas and database names
|
|
22
|
+
- Configuration files and scripts
|
|
23
|
+
- Git commit messages
|
|
24
|
+
- Test names and descriptions
|
|
25
|
+
|
|
26
|
+
## 3. Specific standards
|
|
27
|
+
|
|
28
|
+
For detailed standards and guidelines specific to different areas of the project, refer to:
|
|
29
|
+
|
|
30
|
+
- [Backend Standards](./backend-standards.md) - API development, database patterns, testing, security and backend best practices
|
|
31
|
+
- [Frontend Standards](./frontend-standards.md) - React components, UI/UX guidelines, and frontend architecture
|
|
32
|
+
- [Documentation Standards](./documentation-standards.md) - Technical documentation structure, formatting, and maintenance guidelines, including AI standards like this document
|
|
33
|
+
|
|
34
|
+
## 4. Project Skills
|
|
35
|
+
|
|
36
|
+
- Skills live in `ai-specs/skills`.
|
|
37
|
+
- When a request matches a skill, load and follow the corresponding `SKILL.md` automatically before continuing.
|
|
38
|
+
- Also load any referenced files in the skill folder (for example, `references/*.md`) when the skill requires them.
|
|
39
|
+
|
|
40
|
+
## 5. Symlink Integrity and Multi-Agent Portability
|
|
41
|
+
|
|
42
|
+
- **Canonical Source**: Keep reusable artifacts in `ai-specs` as the canonical source. Agent-specific paths (such as `.claude` and `.cursor`) should reference them through symlinks when possible.
|
|
43
|
+
- **Update Safety**: Whenever a file is renamed, moved, or its suffix changes, verify and update all symlinks that target it before considering the change complete.
|
|
44
|
+
- **New Artifact Linking**: Whenever creating a new artifact that requires multi-agent exposure (for example new agents or skills in `ai-specs`), create the corresponding symlinks from the expected agent-specific reference paths.
|
|
45
|
+
- **External Customization Review**: Whenever customization is introduced outside `ai-specs`, evaluate whether it should be moved into `ai-specs` and replaced with symlinks from the original locations.
|
|
46
|
+
- **Completion Gate**: A change is incomplete if it leaves broken symlinks, stale targets, or duplicated canonical artifacts across agent-specific folders.
|
|
47
|
+
|
|
48
|
+
## 6. OpenSpec Tasks Mandatory Steps
|
|
49
|
+
|
|
50
|
+
When creating or updating OpenSpec `tasks.md` artifacts, follow these requirements.
|
|
51
|
+
|
|
52
|
+
### 6.1 Read OpenSpec configuration first
|
|
53
|
+
|
|
54
|
+
- **Required first action**: Read `openspec/config.yaml` before drafting or editing any `tasks.md` file.
|
|
55
|
+
- **Purpose**: Capture mandatory steps, naming conventions, task structure, testing expectations, and documentation requirements from project configuration.
|
|
56
|
+
|
|
57
|
+
### 6.2 Required backend task structure
|
|
58
|
+
|
|
59
|
+
For backend changes, ensure the checklist includes these mandatory steps in order:
|
|
60
|
+
|
|
61
|
+
1. **Step 0 (must be first)**: Create and switch to feature branch:
|
|
62
|
+
- `feature/[ticket-id]-backend` or `feature/[change-name]-backend`
|
|
63
|
+
2. **Review and update existing unit tests (MANDATORY)**
|
|
64
|
+
3. **Run unit tests and verify database state (MANDATORY)**
|
|
65
|
+
4. **Manual endpoint testing with curl (MANDATORY - AGENT MUST EXECUTE)**
|
|
66
|
+
5. **E2E testing with Playwright MCP when applicable (MANDATORY - AGENT MUST EXECUTE)**
|
|
67
|
+
6. **Update technical documentation (MANDATORY)**
|
|
68
|
+
|
|
69
|
+
### 6.3 Manual testing execution is agent responsibility
|
|
70
|
+
|
|
71
|
+
- **Never delegate testing to the user** for steps required by `tasks.md`.
|
|
72
|
+
- The agent must start required services, run tests, validate outcomes, and restore data state after CREATE/UPDATE/DELETE operations.
|
|
73
|
+
- The agent must only mark tasks as completed (`[x]`) after required tests pass and cleanup is complete.
|
|
74
|
+
|
|
75
|
+
### 6.4 Mandatory curl coverage (for endpoint work)
|
|
76
|
+
|
|
77
|
+
Execute and verify:
|
|
78
|
+
- GET endpoints
|
|
79
|
+
- POST endpoints (with cleanup)
|
|
80
|
+
- PUT/PATCH endpoints (with revert)
|
|
81
|
+
- DELETE endpoints (with recreation/restore)
|
|
82
|
+
- Error cases (validation, 404, auth as applicable)
|
|
83
|
+
|
|
84
|
+
Document commands, responses, and restoration actions.
|
|
85
|
+
|
|
86
|
+
### 6.5 Mandatory Playwright E2E coverage (when applicable)
|
|
87
|
+
|
|
88
|
+
For frontend workflows or frontend/backend integration changes:
|
|
89
|
+
- Run E2E flows with Playwright MCP tools
|
|
90
|
+
- Validate success and error paths
|
|
91
|
+
- Verify data persistence and consistency
|
|
92
|
+
- Clean test data and restore environment state
|
|
93
|
+
|
|
94
|
+
### 6.6 Completion checklist before finalizing `tasks.md`
|
|
95
|
+
|
|
96
|
+
- Step 0 branch creation is first
|
|
97
|
+
- Mandatory steps are present and sequential
|
|
98
|
+
- Mandatory labels are explicit
|
|
99
|
+
- Branch name matches backend convention
|
|
100
|
+
- Manual testing tasks explicitly state "AGENT MUST EXECUTE"
|
|
101
|
+
- Database restoration steps are included for mutating operations
|
|
102
|
+
- E2E step is present when frontend workflow impact exists
|
|
103
|
+
|
|
104
|
+
### 6.7 Mandatory artifact updates for change requests between `/apply` and `/archive`
|
|
105
|
+
|
|
106
|
+
If a new fix/change is requested after `/apply` and before `/archive`, treat it as a spec update first (never code-only first).
|
|
107
|
+
|
|
108
|
+
Required order:
|
|
109
|
+
1. Update affected OpenSpec artifacts (scenarios, requirements/specs, `tasks.md`).
|
|
110
|
+
2. Re-run artifact generation/update step when needed (`/continue`, `/ff`, or equivalent).
|
|
111
|
+
3. Implement code only after artifacts reflect the new request.
|
|
112
|
+
4. Re-run verification against updated artifacts before archiving.
|
|
113
|
+
|
|
114
|
+
Do not close this window with direct coding that is not reflected in OpenSpec artifacts.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Data Model Documentation
|
|
2
|
+
|
|
3
|
+
> This is an empty skeleton. Replace every `_TODO_` below with your project's real domain and database model.
|
|
4
|
+
|
|
5
|
+
## Model Descriptions
|
|
6
|
+
|
|
7
|
+
_TODO: for each core entity, describe its purpose, fields (name, type, constraints), and primary key._
|
|
8
|
+
|
|
9
|
+
Example shape to follow per entity:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
### EntityName
|
|
13
|
+
_One-line description of what this entity represents._
|
|
14
|
+
|
|
15
|
+
**Fields:**
|
|
16
|
+
- `id`: TODO (Primary Key)
|
|
17
|
+
- `field`: TODO (type, constraints)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Relationships
|
|
21
|
+
|
|
22
|
+
_TODO: describe how entities relate to each other (1:1, 1:N, N:M) and any cascade/delete rules._
|
|
23
|
+
|
|
24
|
+
## Entity-Relationship Diagram
|
|
25
|
+
|
|
26
|
+
_TODO: add an ERD (e.g. as a Mermaid `erDiagram` block) once the model is defined._
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Development Guide
|
|
2
|
+
|
|
3
|
+
> This is an empty skeleton. Replace every `_TODO_` below with your project's real setup instructions.
|
|
4
|
+
|
|
5
|
+
## ๐ Setup Instructions
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
_TODO: list required runtimes and tools (e.g. Node version, package manager, Docker, cloud CLI)._
|
|
10
|
+
|
|
11
|
+
### 1. Clone the Repository
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone git@github.com:your-org/your-repo.git
|
|
15
|
+
cd your-repo
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### 2. Environment Configuration
|
|
19
|
+
|
|
20
|
+
_TODO: describe required environment variables/files and where to get their values._
|
|
21
|
+
|
|
22
|
+
### 3. Dependencies
|
|
23
|
+
|
|
24
|
+
_TODO: install steps for backend/frontend/infra dependencies._
|
|
25
|
+
|
|
26
|
+
### 4. Local Services
|
|
27
|
+
|
|
28
|
+
_TODO: how to start any local services this project depends on (database, queues, mocked cloud services, etc.)._
|
|
29
|
+
|
|
30
|
+
## ๐งช Running Tests
|
|
31
|
+
|
|
32
|
+
_TODO: how to run unit, integration, and end-to-end tests locally._
|
|
33
|
+
|
|
34
|
+
## ๐ Deployment
|
|
35
|
+
|
|
36
|
+
_TODO: how this project is deployed (environments, pipeline, IaC tooling)._
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Standards and best practices for technical documentation in this project, including documentation structure, update processes, and language rules.
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# Rules and Patterns for documentation and AI specs
|
|
7
|
+
|
|
8
|
+
## Introduction
|
|
9
|
+
Technical documentation applies to all the documentation relative to the project, such as the data model, README, API specs, and other MD docs that describe how the project is structured, runs, and operates.
|
|
10
|
+
AI specs refers to the documents that explain AI agents how to behave, document, plan, code, etc, which includes team agreements, standards and conventions.
|
|
11
|
+
|
|
12
|
+
## General rules
|
|
13
|
+
- ALWAYS WRITE IN ENGLISH, including comments and any explanation in the files. This applies both to creating new documentation and updating existing one, and it also applies to documentation within the code (comments, explanations of functions or fields, etc.).
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Technical Documentation
|
|
18
|
+
Before making any commit or git push, or if you're asked to document a commit, you must ALWAYS review which technical documentation should be updated.
|
|
19
|
+
|
|
20
|
+
When updating documentation, I will:
|
|
21
|
+
1. Review all recent changes in the codebase
|
|
22
|
+
2. Identify which documentation files need updates based on the changes. Some clear examples:
|
|
23
|
+
- For data model changes: Update data model definition section in data-model.md
|
|
24
|
+
- For API changes: Update api-spec.yml
|
|
25
|
+
- For changes in libraries, database migrations, or anything that changes the installation process, update *-standards.md
|
|
26
|
+
3. Update each affected documentation file in English, maintaining consistency with existing documentation
|
|
27
|
+
4. Ensure all documentation is properly formatted and follows the established structure
|
|
28
|
+
5. Verify that all changes are accurately reflected in the documentation
|
|
29
|
+
6. Report which files were updated and what changes were made
|
|
30
|
+
|
|
31
|
+
## AI specs
|
|
32
|
+
|
|
33
|
+
This rule establishes a mandatory process for the AI to:
|
|
34
|
+
* Learn from user feedback, guidance, and suggestions during interactions.
|
|
35
|
+
* Identify opportunities to improve existing Development Rules based on these learnings proactively.
|
|
36
|
+
* Keep the AI's assistance aligned with evolving project needs and user expectations.
|
|
37
|
+
* Incorporate user feedback into the AI's operational framework to maximize its value.
|
|
38
|
+
|
|
39
|
+
This rule is applicable after any interaction where the user provides explicit or implicit feedback, suggestions, corrections, new information, or expresses preferences. **The AI MUST actively analyze all user interactions for such learning opportunities, not only passively waiting for direct feedback, to proactively refine its understanding and the project's best practices.**
|
|
40
|
+
|
|
41
|
+
### Common Pitfalls and Anti-Patterns to be avoided by the AI
|
|
42
|
+
|
|
43
|
+
* **Skipping Approval Process:** Applying rule modifications without obtaining explicit user review and approval first.
|
|
44
|
+
* **Unlinked Proposals:** Proposing rule changes without clearly connecting them to the specific user feedback or insights gained from the interaction.
|
|
45
|
+
* **Imprecise Modifications:** Suggesting modifications without precisely identifying which rule or specific sections within a rule should be changed, hindering effective user review.
|
|
46
|
+
* **Unaddressed Feedback:** Not initiating the learning and review process when the user provides relevant feedback that could improve the rules.
|
|
47
|
+
* **Scope Creep:** Updating multiple unrelated rules simultaneously or making changes that exceed the scope of the feedback received.
|
|
48
|
+
* **Unprompted Rule Changes:** Modifying rules proactively when there is no direct connection to user feedback or a learning opportunity. Rule updates should be reactive and feedback-driven.
|
|
49
|
+
* **Missing Update Confirmation:** Failing to notify the user after a rule modification has been successfully implemented following their approval.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: TODO - one-line summary of this project's frontend standards (framework, state management, UI/testing conventions)
|
|
3
|
+
globs: ["TODO - glob patterns for frontend source files, e.g. src/**/*.{ts,tsx}"]
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend Project Configuration and Best Practices
|
|
8
|
+
|
|
9
|
+
> This is an empty skeleton. Replace every `_TODO_` below with your project's real standards. Keep or drop sections as they apply to your stack.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
_TODO: one-paragraph summary of the frontend, its framework, and its overall structure._
|
|
14
|
+
|
|
15
|
+
## Technology Stack
|
|
16
|
+
|
|
17
|
+
_TODO: core framework, UI library, state management/data-flow approach, testing framework, key dev tools._
|
|
18
|
+
|
|
19
|
+
## Project Structure
|
|
20
|
+
|
|
21
|
+
_TODO: how source is organized (feature folders, components, services, etc.)._
|
|
22
|
+
|
|
23
|
+
## Coding Standards
|
|
24
|
+
|
|
25
|
+
_TODO: naming conventions, component conventions (function components, props typing), state management patterns, service/API layer conventions._
|
|
26
|
+
|
|
27
|
+
## UI/UX Standards
|
|
28
|
+
|
|
29
|
+
_TODO: design system or component library in use, form handling, navigation patterns, accessibility requirements._
|
|
30
|
+
|
|
31
|
+
## Testing Standards
|
|
32
|
+
|
|
33
|
+
_TODO: unit/component test conventions, end-to-end testing tool and patterns, test organization._
|
|
34
|
+
|
|
35
|
+
## Configuration Standards
|
|
36
|
+
|
|
37
|
+
_TODO: TypeScript config, linting rules, environment configuration._
|
|
38
|
+
|
|
39
|
+
## Performance Best Practices
|
|
40
|
+
|
|
41
|
+
_TODO: component optimization, bundle optimization, API call efficiency._
|
|
42
|
+
|
|
43
|
+
## Development Workflow
|
|
44
|
+
|
|
45
|
+
_TODO: dev scripts, code quality gates required before merge._
|