@kienha/anti-chaotic 1.0.5 → 1.0.7
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/.agent/skills/rules-workflows/SKILL.md +22 -155
- package/.agent/skills/rules-workflows/assets/workflow-basic.md +1 -1
- package/.agent/skills/rules-workflows/references/orchestration-patterns.md +11 -13
- package/.agent/skills/rules-workflows/references/rules-guide.md +97 -39
- package/.agent/skills/rules-workflows/references/workflows-guide.md +103 -26
- package/.agent/workflows/bootstrap.md +96 -0
- package/.agent/workflows/brainstorm.md +81 -0
- package/.agent/workflows/custom-behavior.md +64 -0
- package/.agent/workflows/documentation.md +123 -0
- package/.agent/workflows/implement-feature.md +2 -4
- package/.agent/workflows/ui-ux-design.md +2 -4
- package/README.md +44 -23
- package/bin/anti-chaotic.js +32 -0
- package/package.json +1 -1
- package/.agent/skills/skill-creator/scripts/__pycache__/encoding_utils.cpython-312.pyc +0 -0
- package/.agent/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/.agent/workflows/docs-from-codebase.md +0 -104
- package/.agent/workflows/requirement-analysis.md +0 -200
- package/.agent/workflows/setup-codebase.md +0 -90
- /package/.agent/rules/{documentation.md → documents.md} +0 -0
|
@@ -16,172 +16,39 @@ This skill empowers the Agent to act as an **Autonomous Process Orchestrator**,
|
|
|
16
16
|
|
|
17
17
|
Before creating any rule or workflow, the Agent MUST:
|
|
18
18
|
|
|
19
|
-
1. **Analyze the Goal**: What is the user trying to achieve?
|
|
20
|
-
2. **Orchestrate Capabilities**: Identify which _other_ skills (Frontend, Backend, QA) needed
|
|
19
|
+
1. **Analyze the Goal**: What is the user trying to achieve?
|
|
20
|
+
2. **Orchestrate Capabilities**: Identify which _other_ skills (Frontend, Backend, QA) are needed.
|
|
21
|
+
3. **Separate Concerns**:
|
|
22
|
+
- **Workflows** = Process (Steps, Sequences)
|
|
23
|
+
- **Skills** = Knowledge (Standards, Implementation)
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
## 📚 Reference Library
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
- **Workflows are NOT Knowledge**: They should NOT contain hardcoded rules (e.g., WCAG 2.1 ratios, specific library versions).
|
|
26
|
-
- **Delegation**: Workflows must **delegate** to Skills/Roles for execution standards.
|
|
27
|
-
- ❌ Bad: `Step 3: Check accessibility using 4.5:1 contrast ratio.`
|
|
28
|
-
- ✅ Good: `Step 3: Verify accessibility compliance using [designer] skill.`
|
|
27
|
+
This skill relies on specialized guides located in the `references/` directory. **You MUST consult these files for specific tasks.**
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- `workflows-guide.md`: **Workflow Creation Guide**. Contains the standard Feature Implementation workflow template.
|
|
36
|
-
|
|
37
|
-
### Workflows (`../../workflows/`)
|
|
38
|
-
|
|
39
|
-
- `workflow-rule-from-feedback.md`: **Learn from User**. Use to enable persistent memory of user preferences.
|
|
40
|
-
- `workflow-rule-from-codebase.md`: **Learn from Project**. Use to standardize behavior on existing codebases.
|
|
41
|
-
|
|
42
|
-
### References (`references/`)
|
|
43
|
-
|
|
44
|
-
- `orchestration-patterns.md`: **Skill Chaining**. Guides on how to sequence skills (e.g., PM -> Architect -> Dev).
|
|
29
|
+
| Task | Reference File | Purpose |
|
|
30
|
+
| :---------------------------- | :------------------------------------- | :------------------------------------------------------------------------------ |
|
|
31
|
+
| **Creating & Managing Rules** | `references/rules-guide.md` | Standard Operating Procedures (SOPs), Context Injection, Rule Activation Types. |
|
|
32
|
+
| **Building Workflows** | `references/workflows-guide.md` | High-Performance Workflow Design, "Turbo" Execution, Checkpoints. |
|
|
33
|
+
| **Orchestrating Skills** | `references/orchestration-patterns.md` | Skill Chaining Patterns (e.g., Spec-First, TDD), Conflict Resolution. |
|
|
45
34
|
|
|
46
35
|
---
|
|
47
36
|
|
|
48
|
-
## 1.
|
|
49
|
-
|
|
50
|
-
Rules are persistent instructions that guide _how_ the Agent thinks and acts. Workspace rules live in the `.agent/rules` folder.
|
|
51
|
-
|
|
52
|
-
### Rule Activation Types
|
|
53
|
-
|
|
54
|
-
At the rule level, you can define **how** a rule should be activated:
|
|
55
|
-
|
|
56
|
-
| Type | Trigger Value | Description |
|
|
57
|
-
| ------------------ | ---------------- | -------------------------------------------------------------------- |
|
|
58
|
-
| **Manual** | `manual` | Activated via `@mention` in Agent's input box |
|
|
59
|
-
| **Always On** | `always_on` | Always applied to every interaction |
|
|
60
|
-
| **Model Decision** | `model_decision` | Model decides based on natural language `description` in frontmatter |
|
|
61
|
-
| **Glob** | `glob` | Applied to files matching the `glob` pattern (e.g., `src/**/*.tsx`) |
|
|
62
|
-
|
|
63
|
-
### Examples
|
|
64
|
-
|
|
65
|
-
Refer to `references/rules-guide.md` for a comprehensive list of rule pattern examples and templates.
|
|
66
|
-
|
|
67
|
-
### Creation Process
|
|
68
|
-
|
|
69
|
-
1. **Ask**: "What specific behaviors or constraints must be enforced?"
|
|
70
|
-
2. **Choose Activation Type**: Select the appropriate trigger based on when the rule should apply
|
|
71
|
-
3. **Draft**: Refer to templates in `references/rules-guide.md`.
|
|
72
|
-
4. **Refine**: Ensure rules are actionable (e.g., "Use Zod for input" vs "Write good code")
|
|
73
|
-
|
|
74
|
-
### Best Practices
|
|
75
|
-
|
|
76
|
-
- **Global vs Workspace**: Use valid paths (`~/.gemini/` for global, `.agent/rules/` for workspace)
|
|
77
|
-
- **Activation Selection**:
|
|
78
|
-
- Use `always_on` for critical project constraints
|
|
79
|
-
- Use `glob` for file-type specific rules
|
|
80
|
-
- Use `model_decision` for context-aware rules with clear description
|
|
81
|
-
- Use `manual` for intensive operations (@mention to activate)
|
|
82
|
-
- **Fail on Error**: Rule syntax is strict. A bad rule can break the Agent. Validate always.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 2. Workflows: Automating Process
|
|
87
|
-
|
|
88
|
-
Workflows are structured "recipes" for complex tasks.
|
|
89
|
-
|
|
90
|
-
### usage: The Agile Way
|
|
91
|
-
|
|
92
|
-
Instead of generic "write code", use structured flows:
|
|
93
|
-
|
|
94
|
-
> User: "Implement the login feature"
|
|
95
|
-
|
|
96
|
-
**Agent Response (Internal Monologue):**
|
|
97
|
-
|
|
98
|
-
1. _Trigger_: `workflow-agile-feature.md`.
|
|
99
|
-
2. _Step 1 (PM)_: Analyze requirements for "Login".
|
|
100
|
-
3. _Step 2 (Arch)_: Design Auth schema in Supabase.
|
|
101
|
-
4. _Step 3 (Dev)_: Implement components.
|
|
102
|
-
5. _Step 4 (QA)_: Verify login flow.
|
|
37
|
+
## 1. Orchestration Strategy
|
|
103
38
|
|
|
104
|
-
|
|
39
|
+
**👉 For best practices on sequencing skills, refer to `references/orchestration-patterns.md`**.
|
|
105
40
|
|
|
106
|
-
|
|
107
|
-
2. **Select Pattern**: Consult `references/orchestration-patterns.md`.
|
|
108
|
-
3. **Draft**: Refer to the template in `references/workflows-guide.md`.
|
|
41
|
+
Key principles:
|
|
109
42
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### 1. Header & Prereqs
|
|
115
|
-
|
|
116
|
-
- **Description**: Clear, action-oriented.
|
|
117
|
-
- **Rules**: Mandatory reference to global rules (e.g., `documentation.md`).
|
|
118
|
-
- **Tool Guidelines**: A table defining _which_ tools (Antigravity native or MCP) to use, _when_, and with _what queries_.
|
|
119
|
-
|
|
120
|
-
```markdown
|
|
121
|
-
## Tool Usage Guidelines
|
|
122
|
-
|
|
123
|
-
| Tool | When to Use | Example Query |
|
|
124
|
-
| ---- | ----------- | ------------- |
|
|
125
|
-
| ... | ... | ... |
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### 2. Step Structure
|
|
129
|
-
|
|
130
|
-
Each step should be structured for maximum context and autonomy:
|
|
131
|
-
|
|
132
|
-
1. **Turbo Annotation**: `// turbo` if the step involves safe, auto-runnable commands.
|
|
133
|
-
2. **Tool Context**: `> 💡 **Tip**: ...` block to guide specific tool usage for this step.
|
|
134
|
-
3. **Skill Actions**: key functionality delegated to skills via `**Invoke [skill-name] skill**`.
|
|
135
|
-
4. **Artifacts**: Explicitly name output files.
|
|
136
|
-
5. **Checkpoints**: Explicit `**WAIT**` states for user confirmation.
|
|
137
|
-
|
|
138
|
-
**Example Step:**
|
|
139
|
-
|
|
140
|
-
```markdown
|
|
141
|
-
## Step 1: Analyze Requirements
|
|
142
|
-
|
|
143
|
-
// turbo
|
|
144
|
-
|
|
145
|
-
> 💡 **Tip**: Use `sequential-thinking` (if available) or `read_file` to parse requirements.
|
|
146
|
-
|
|
147
|
-
1. **Invoke [product-manager] skill** to refine the request.
|
|
148
|
-
2. Create `requirements.md` artifact.
|
|
149
|
-
3. **WAIT** for user confirmation.
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 3. Summary
|
|
153
|
-
|
|
154
|
-
- **Quick Reference**: A table at the bottom tracking Step -> Skill -> Output.
|
|
43
|
+
1. **Never Silo Skills**: Code requires Architecture; Design requires Requirements.
|
|
44
|
+
2. **Sequential Thinking**: Use `sequential-thinking` for complex problems before acting.
|
|
45
|
+
3. **Process vs. Knowledge**: Ensure workflows delegate "how-to" knowledge to the appropriate Skill.
|
|
155
46
|
|
|
156
47
|
---
|
|
157
48
|
|
|
158
|
-
##
|
|
159
|
-
|
|
160
|
-
### Rule 1: Cross-Skill Collaboration
|
|
161
|
-
|
|
162
|
-
- **Never** silo skills. A "Code" task usually requires "Architect" input first.
|
|
163
|
-
- **Always** check `reference/orchestration-patterns.md` for the correct sequence.
|
|
164
|
-
|
|
165
|
-
### Rule 2: Sequential Thinking
|
|
166
|
-
|
|
167
|
-
- **Mandatory** for: Debugging, Architecture Design, and Requirement Analysis.
|
|
168
|
-
- **Usage**: Break down problems step-by-step _before_ writing code.
|
|
169
|
-
|
|
170
|
-
### Rule 3: Strict Validation
|
|
171
|
-
|
|
172
|
-
- Verify all generated rules/workflows against the official documentation.
|
|
173
|
-
- If a workflow fails, **stop**, analyze step-by-step, and propose a fix.
|
|
174
|
-
|
|
175
|
-
### Rule 4: Process vs Knowledge Separation
|
|
176
|
-
|
|
177
|
-
- **Strict Enforcement**: When designing, Skills MUST contain Knowledge (Standards, Templates) and Workflows MUST contain Process (Steps, Sequences).
|
|
178
|
-
- **No Overlap**: Never hardcode standards in a workflow. Never bury a lifecycle process in a skill.
|
|
179
|
-
|
|
180
|
-
## 4. Self-Correction & Learning
|
|
181
|
-
|
|
182
|
-
The Agent can now modify its own rules (Meta-Programming).
|
|
49
|
+
## 2. Self-Correction & Learning
|
|
183
50
|
|
|
184
|
-
|
|
51
|
+
The Agent can modify its own rules (Meta-Programming).
|
|
185
52
|
|
|
186
|
-
- **User Correction**: "Don't do X anymore" -> Trigger `workflow-rule-from-feedback`.
|
|
187
|
-
- **New Project**: "Read this codebase" -> Trigger `workflow-rule-from-codebase`.
|
|
53
|
+
- **User Correction**: "Don't do X anymore" -> Trigger `workflow-rule-from-feedback.md`.
|
|
54
|
+
- **New Project**: "Read this codebase" -> Trigger `workflow-rule-from-codebase.md`.
|
|
@@ -7,7 +7,7 @@ description: [End-to-end feature implementation workflow]
|
|
|
7
7
|
Orchestrates feature implementation from specification to deployment.
|
|
8
8
|
|
|
9
9
|
> [!IMPORTANT]
|
|
10
|
-
> **MANDATORY**: Read `.agent/rules/
|
|
10
|
+
> **MANDATORY**: Read `.agent/rules/documents.md` before creating any document.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -30,19 +30,17 @@ These patterns guide how to combine multiple specialized skills to solve complex
|
|
|
30
30
|
1. **Designer**: creating the look & feel, animations, and component structure.
|
|
31
31
|
2. **Dev**: Translates the design into React/CSS code.
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
43: ## 5. The "Reasoning" Bridge
|
|
45
|
-
44:
|
|
33
|
+
## 4. The "Delegation" Pattern (Process vs Knowledge)
|
|
34
|
+
|
|
35
|
+
**Best for**: Enforcing standards within workflows.
|
|
36
|
+
**Sequence**: `Workflow` (Process) -> `Skill` (Knowledge).
|
|
37
|
+
|
|
38
|
+
**Rule**: Workflows define _when_ to do something. Skills define _how_ to do it.
|
|
39
|
+
|
|
40
|
+
- ❌ **Bad Workflow**: "Step 4: Check that contrast is 4.5:1." (Hardcoded)
|
|
41
|
+
- ✅ **Good Workflow**: "Step 4: Verify accessibility using [designer] skill." (Delegated)
|
|
42
|
+
|
|
43
|
+
## 5. The "Reasoning" Bridge
|
|
46
44
|
|
|
47
45
|
**Best for**: Ambiguity, complex debugging.
|
|
48
46
|
**Approach**: Break down the problem step-by-step before switching skills.
|
|
@@ -1,60 +1,118 @@
|
|
|
1
|
-
#
|
|
1
|
+
# High-Performance Rule Governance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> "Rules are the automated guardrails that ensure consistency without micromanagement."
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This guide establishes the framework for defining, enforcing, and managing Agent behavior standards across the organization.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## 1. The Core Philosophy
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
2. Navigate to **Rules** panel
|
|
11
|
-
3. Select **+ Global** (cross-workspace) or **+ Workspace** (project-specific)
|
|
9
|
+
In a high-functioning AI-driven organization, Rules serve two critical functions:
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
1. **Context Injection**: Instantly downloading "Senior Engineer" context into the Agent's specific session.
|
|
12
|
+
2. **Operational Guardrails**: Preventing known anti-patterns (e.g., "Never commit secrets", "Always use strict TS").
|
|
13
|
+
|
|
14
|
+
| Level | Purpose | Example |
|
|
15
|
+
| :-------------------- | :------------------------------------- | :------------------------- |
|
|
16
|
+
| **L1: Critical** | Security & Compliance (Non-negotiable) | `security-policy.md` |
|
|
17
|
+
| **L2: Architectural** | Tech Stack Standards | `nextjs-best-practices.md` |
|
|
18
|
+
| **L3: Stylistic** | Team preferences | `naming-conventions.md` |
|
|
19
|
+
|
|
20
|
+
## 2. Activation Strategy (Context Management)
|
|
21
|
+
|
|
22
|
+
The key to a responsive Agent is _Selective Activation_. Loading 100 rules confuses the context. Use activation types strategically.
|
|
23
|
+
|
|
24
|
+
### A. The "Always On" (Global Constitution)
|
|
25
|
+
|
|
26
|
+
**Use sparingly.** Only for rules that apply to _every_ single keystroke.
|
|
27
|
+
|
|
28
|
+
- **Triggers**: `always_on`
|
|
29
|
+
- **Use Case**: Safety checks, Tone of Voice, Core Documentation links.
|
|
30
|
+
- **Cost**: Consumes context window on every turn.
|
|
31
|
+
|
|
32
|
+
### B. The "Just-in-Time" (Context-Aware)
|
|
33
|
+
|
|
34
|
+
**The Gold Standard.** Rules that activate only when relevant.
|
|
35
|
+
|
|
36
|
+
- **Triggers**: `model_decision` (based on description) or `glob` (based on files).
|
|
37
|
+
- **Use Case**:
|
|
38
|
+
- If user asks about "Auth" -> Load `auth-guidelines.md`.
|
|
39
|
+
- If editing `.tsx` files -> Load `react-component-standards.md`.
|
|
40
|
+
|
|
41
|
+
### C. The "Surgical" (Manual Override)
|
|
42
|
+
|
|
43
|
+
**For heavy-duty tasks.**
|
|
44
|
+
|
|
45
|
+
- **Triggers**: `manual`
|
|
46
|
+
- **Use Case**: "Refactor this legacy code." -> User explicitly calls `@refactoring-rules`.
|
|
14
47
|
|
|
15
|
-
##
|
|
48
|
+
## 3. Designing Effective Rules
|
|
16
49
|
|
|
17
|
-
|
|
50
|
+
A rule is a **Directive**, not a suggestion.
|
|
18
51
|
|
|
19
|
-
|
|
20
|
-
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
-
| **Manual** | The rule is manually activated via `@mention` in Agent's input box |
|
|
22
|
-
| **Always On** | The rule is always applied to every interaction |
|
|
23
|
-
| **Model Decision** | Based on a natural language description of the rule, the model decides whether to apply the rule |
|
|
24
|
-
| **Glob** | Based on the glob pattern you define (e.g., `.js`, `src/**/*.ts`), the rule will be applied to all files that match the pattern |
|
|
52
|
+
### ❌ Weak Rule
|
|
25
53
|
|
|
26
|
-
|
|
54
|
+
> "Try to write good variable names and maybe use TypeScript if you can."
|
|
27
55
|
|
|
28
|
-
|
|
29
|
-
- **Always On**: For critical project constraints, coding standards, and domain knowledge that must be enforced on every interaction
|
|
30
|
-
- **Model Decision**: For context-aware rules that should only apply when relevant (e.g., security guidelines only when working with auth)
|
|
31
|
-
- **Glob**: For file-type-specific standards (e.g., React component standards for `.tsx` files)
|
|
56
|
+
### ✅ Strong Rule
|
|
32
57
|
|
|
58
|
+
> **Constraint**: All variables MUST follow `camelCase`.
|
|
59
|
+
> **Requirement**: TypeScript `strict` mode is MANDATORY. `any` type is strictly FORBIDDEN.
|
|
60
|
+
|
|
61
|
+
## 4. Governance & Lifecycle
|
|
62
|
+
|
|
63
|
+
Avoid "Rule Bloat" (Bureaucracy).
|
|
64
|
+
|
|
65
|
+
1. **Consolidate**: Don't have `button-rules.md` and `input-rules.md`. Have `ui-components.md`.
|
|
66
|
+
2. **Review**: If the Agent frequently ignores a rule, it is likely too vague or conflicting. Clarify or Delete it.
|
|
67
|
+
3. **Hierarchy**: Workspace Rules override Global Rules. Specific Rules override General Rules.
|
|
68
|
+
|
|
69
|
+
## 5. Standard Rule Template
|
|
70
|
+
|
|
71
|
+
Use this structure to create enforceable, high-clarity rules.
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
---
|
|
75
|
+
description:
|
|
76
|
+
[When should this apply? e.g., "Applied when editing Database Schema"]
|
|
77
|
+
globs: ["prisma/schema.prisma"]
|
|
33
78
|
---
|
|
34
79
|
|
|
35
|
-
|
|
80
|
+
# [Rule Name, e.g., Database Schema Standards]
|
|
81
|
+
|
|
82
|
+
## 1. Executive Summary
|
|
83
|
+
|
|
84
|
+
All database changes must preserve backward compatibility and follow 3NF normalization.
|
|
85
|
+
|
|
86
|
+
## 2. Critical Constraints (The "Musts")
|
|
87
|
+
|
|
88
|
+
- 🔴 **NEVER** delete columns in a migration. Mark as `@deprecated` instead.
|
|
89
|
+
- 🔴 **NEVER** use `autoincrement()` for publicly exposed IDs. Use `uuid()`.
|
|
90
|
+
|
|
91
|
+
## 3. Code Patterns (The "How")
|
|
92
|
+
|
|
93
|
+
### Naming
|
|
36
94
|
|
|
37
|
-
|
|
95
|
+
- Tables: `snake_case` (plural), e.g., `users`, `order_items`.
|
|
96
|
+
- Foreign Keys: `noun_id`, e.g., `user_id`.
|
|
38
97
|
|
|
39
|
-
|
|
40
|
-
- **Model-Decision Rule**: `../assets/rule-model-decision.md`
|
|
41
|
-
- **Glob-Pattern Rule**: `../assets/rule-glob.md`
|
|
42
|
-
- **Manual Rule**: `../assets/rule-manual.md`
|
|
98
|
+
### Example
|
|
43
99
|
|
|
44
|
-
|
|
100
|
+
✅ **Good**:
|
|
101
|
+
model User {
|
|
102
|
+
id String @id @default(uuid())
|
|
103
|
+
}
|
|
45
104
|
|
|
46
|
-
|
|
105
|
+
❌ **Bad**:
|
|
106
|
+
model User {
|
|
107
|
+
id Int @id @default(autoincrement())
|
|
108
|
+
}
|
|
109
|
+
```
|
|
47
110
|
|
|
48
|
-
|
|
49
|
-
2. **Use descriptive names** - Rule filename becomes its identifier
|
|
50
|
-
3. **Leverage glob patterns** - Auto-apply rules to relevant files
|
|
51
|
-
4. **Reference external files** - Use `@filename` to include context
|
|
52
|
-
5. **Stay under 12,000 chars** - Split into multiple files if needed
|
|
111
|
+
## 6. Advanced Context Injection
|
|
53
112
|
|
|
54
|
-
|
|
113
|
+
You can "hydrate" rules with dynamic context using `@` references.
|
|
55
114
|
|
|
56
|
-
|
|
115
|
+
- **`@/docs/api-spec.md`**: "Enforce the API contract defined in this file."
|
|
116
|
+
- **`@../shared/types.ts`**: "Use these exact types."
|
|
57
117
|
|
|
58
|
-
|
|
59
|
-
- `@/docs/api.md` - Absolute from workspace root
|
|
60
|
-
- `@../shared/types.ts` - Relative path traversal
|
|
118
|
+
This allows the rule to remain static (the _policy_) while referencing dynamic content (the _data_).
|
|
@@ -1,46 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Building High-Performance Workflows
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> "Workflows are the operating system of your delivery pipeline."
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. Navigate to **Workflows** panel
|
|
7
|
-
3. Click **+ Global** or **+ Workspace** to create workflow
|
|
5
|
+
This guide is designed for Project Managers, COOs, and Architects to codify operational excellence into executable Agent processes.
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## 1. The Core Philosophy
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Effective workflows shift the Agent from "Ad-hoc Assistant" to "Autonomous Operator".
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
| Ad-hoc Request | Systematized Workflow |
|
|
12
|
+
| :---------------------- | :---------------------------------------------------------------- |
|
|
13
|
+
| "Help me test this." | **Run `/qa-feature`**: Analyze -> Test Plan -> Execute -> Report. |
|
|
14
|
+
| "Deploy this." | **Run `/deploy`**: Lint -> Build -> Test -> Staging -> Prod. |
|
|
15
|
+
| **High Cognitive Load** | **Zero Cognitive Load** |
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## 2. Anatomy of an Effective Workflow
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
A workflow is not just a list of steps. It is a **Contract of Execution**.
|
|
20
|
+
|
|
21
|
+
### Key Components
|
|
22
|
+
|
|
23
|
+
1. **The Trigger**: Explicit starting condition (User request, file change, manual invocation).
|
|
24
|
+
2. **The Context**: Loading necessary rules (`rules/documents.md`) and skills (`[product-manager]`).
|
|
25
|
+
3. **The Process**: Sequential steps with explicit hand-offs.
|
|
26
|
+
4. **The Verification**: Mandatory checkpoints to prevent error propagation.
|
|
27
|
+
|
|
28
|
+
## 3. Designing for Efficiency (The "COO Mindset")
|
|
29
|
+
|
|
30
|
+
To build workflows that work at scale, apply these principles:
|
|
31
|
+
|
|
32
|
+
### A. Principle of Delegation (Process vs. Skill)
|
|
33
|
+
|
|
34
|
+
**Never hardcode specific technical knowledge in a workflow.**
|
|
35
|
+
|
|
36
|
+
- ❌ **Fragile**: "Step 1: Run `npm install react@18`."
|
|
37
|
+
- ✅ **Robust**: "Step 1: Install dependencies using standard practices defined in `[frontend-developer]` skill."
|
|
38
|
+
|
|
39
|
+
### B. Principle of "Turbo" execution
|
|
40
|
+
|
|
41
|
+
**Optimize for speed where safety allows.**
|
|
42
|
+
Use the `// turbo` annotation for steps that are read-only or safe to retry. This allows the Agent to execute without stopping for approval.
|
|
43
|
+
|
|
44
|
+
- **Use for**: Reading files, generating docs, running local tests.
|
|
45
|
+
- **Avoid for**: Deleting files, pushing to production, external API calls with costs.
|
|
46
|
+
|
|
47
|
+
### C. Principle of "Stop-the-Line" (Checkpoints)
|
|
48
|
+
|
|
49
|
+
**Fail early, fail loudly.**
|
|
50
|
+
Insert `**WAIT**` steps after critical actions (e.g., after Requirement Analysis, before Deployment). This is your quality gate.
|
|
51
|
+
|
|
52
|
+
## 4. Structural Template
|
|
53
|
+
|
|
54
|
+
Use this structure for all production-grade workflows:
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
---
|
|
58
|
+
description:
|
|
59
|
+
[Action-oriented description, e.g., "End-to-end Feature Implementation"]
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
# [Workflow Name]
|
|
63
|
+
|
|
64
|
+
## 1. Initialization
|
|
65
|
+
|
|
66
|
+
1. Load Global Rules: `documents.md`.
|
|
67
|
+
2. Analyze Context: Identify touched files.
|
|
68
|
+
|
|
69
|
+
## 2. Phase I: Definition (The "PM" Phase)
|
|
70
|
+
|
|
71
|
+
> 💡 **Tip**: Clarify before coding.
|
|
72
|
+
|
|
73
|
+
1. Invoke **[product-manager]** to refine requirements.
|
|
74
|
+
// turbo
|
|
75
|
+
2. Create `docs/specs/feature-x.md`.
|
|
76
|
+
3. **WAIT** for user approval.
|
|
77
|
+
|
|
78
|
+
## 3. Phase II: Execution (The "Dev" Phase)
|
|
79
|
+
|
|
80
|
+
1. Read `docs/specs/feature-x.md`.
|
|
81
|
+
2. Invoke **[lead-architect]** to update `implementation-plan.md`.
|
|
82
|
+
3. Invoke **[backend-developer]** for API changes.
|
|
83
|
+
4. Invoke **[frontend-developer]** for UI changes.
|
|
84
|
+
|
|
85
|
+
## 4. Phase III: Verification (The "QA" Phase)
|
|
86
|
+
|
|
87
|
+
1. Invoke **[qa-tester]** to run test suite.
|
|
88
|
+
2. Verify all tests pass.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## 5. Advanced Orchestration Patterns
|
|
92
|
+
|
|
93
|
+
### Chaining Workflows
|
|
94
|
+
|
|
95
|
+
Don't build monoliths. Compose small, focused workflows.
|
|
18
96
|
|
|
19
97
|
```markdown
|
|
20
|
-
## Step
|
|
98
|
+
## Step 5: Deployment
|
|
21
99
|
|
|
22
100
|
Call /deploy-staging
|
|
23
101
|
```
|
|
24
102
|
|
|
25
|
-
|
|
103
|
+
### Dynamic Branching (via Logic)
|
|
26
104
|
|
|
27
|
-
|
|
105
|
+
Workflows are linear, but the _Agent_ is dynamic. Use logic in steps:
|
|
28
106
|
|
|
29
|
-
|
|
107
|
+
```markdown
|
|
108
|
+
## Step 2: Determine Path
|
|
30
109
|
|
|
31
|
-
|
|
110
|
+
IF requirements are unclear:
|
|
32
111
|
|
|
33
|
-
|
|
112
|
+
- Call [business-analysis]
|
|
113
|
+
ELSE:
|
|
114
|
+
- Proceed to Step 3
|
|
115
|
+
```
|
|
34
116
|
|
|
35
|
-
|
|
36
|
-
2. **Refer to roles**: Use "As [Role]" or "Call [Skill]" instead of hardcoding instructions.
|
|
37
|
-
3. **Dynamic References**:
|
|
38
|
-
- ❌ `Ensure indentation is 2 spaces.` (Hardcoded knowledge)
|
|
39
|
-
- ✅ `Format code according to project standards defined in [frontend-developer] skill.` (Dynamic reference)
|
|
117
|
+
## 6. Maintenance & KPI
|
|
40
118
|
|
|
41
|
-
|
|
119
|
+
Treat workflows like products.
|
|
42
120
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
4. **Document prerequisites** - State what's needed before running
|
|
121
|
+
- **Review**: Does the workflow still match how the team works?
|
|
122
|
+
- **Optimize**: Are we stopping too often? (Add `// turbo`). Are we breaking things? (Add Checkpoints).
|
|
123
|
+
- **Refactor**: If a workflow steps become too complex, extract them into a dedicated Skill or a Sub-workflow.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Sets up project structure, installs dependencies, and configures environment based on architectural specs.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Bootstrap Workflow
|
|
6
|
+
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> **Prerequisite**: Ensure SDD exists in `docs/030-Specs/Architecture/`.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## MCP Usage Guidelines
|
|
13
|
+
|
|
14
|
+
| MCP Tool | When to Use |
|
|
15
|
+
| :-------------------------------- | :--------------------------------- |
|
|
16
|
+
| `mcp_context7_resolve-library-id` | Find correct package names |
|
|
17
|
+
| `mcp_context7_query-docs` | Research installation/config steps |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 1: Framework Initialization & Structure
|
|
22
|
+
|
|
23
|
+
// turbo
|
|
24
|
+
|
|
25
|
+
1. **Invoke `[lead-architect]` skill** to:
|
|
26
|
+
- Define the project root structure (Monorepo vs Polyrepo)
|
|
27
|
+
- Initialize the base project (e.g., `git init`, `npx create-next-app`)
|
|
28
|
+
- Create the directory skeleton based on SDD
|
|
29
|
+
2. **WAIT** for initialization
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Step 2: Maintenance & Quality Engineering Tools
|
|
34
|
+
|
|
35
|
+
// turbo
|
|
36
|
+
|
|
37
|
+
> 💡 **Role**: DevOps Engineer ensures the "Development Experience" (DX) is solid.
|
|
38
|
+
|
|
39
|
+
1. **Invoke `[devops-engineer]` skill** to install & configure:
|
|
40
|
+
- **Quality Tools**: ESLint, Prettier, TypeScript config
|
|
41
|
+
- **Git Hooks**: Husky, Lint-staged, Commitlint
|
|
42
|
+
- **CI/CD**: Github Actions (basic build/test)
|
|
43
|
+
2. Verify: Run `npm run lint` and ensure hooks fire on commit.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 3: Frontend Setup
|
|
48
|
+
|
|
49
|
+
// turbo
|
|
50
|
+
|
|
51
|
+
> 💡 **Role**: Frontend Developer manages the UI/Client side.
|
|
52
|
+
|
|
53
|
+
1. **Invoke `[frontend-developer]` skill** to:
|
|
54
|
+
- **UI Ecosystem**: Install TailwindCSS, Radix/Shadcn, Framer Motion
|
|
55
|
+
- **State Manager**: Zustand/Jotai/Redux
|
|
56
|
+
- **Structure**: Setup `src/components`, `src/hooks`, `src/pages` (or `app`)
|
|
57
|
+
- **Assets**: Configure font loaders, image optimization
|
|
58
|
+
2. **WAIT** for installation
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Step 4: Backend Setup
|
|
63
|
+
|
|
64
|
+
// turbo
|
|
65
|
+
|
|
66
|
+
> 💡 **Role**: Backend Developer manages the Data/Server side.
|
|
67
|
+
|
|
68
|
+
1. **Invoke `[backend-developer]` skill** to:
|
|
69
|
+
- **Database**: Setup Prisma/Drizzle/Supabase client
|
|
70
|
+
- **API**: Configure API routes/Server Actions
|
|
71
|
+
- **Validation**: Install Zod/Valibot
|
|
72
|
+
- **Environment**: Create `.env.example` and validate `.env` keys
|
|
73
|
+
2. **WAIT** for installation
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Step 5: Final Validation
|
|
78
|
+
|
|
79
|
+
// turbo
|
|
80
|
+
|
|
81
|
+
1. **Invoke `[devops-engineer]` skill** to:
|
|
82
|
+
- Run full build `npm run build`
|
|
83
|
+
- Test Type-checking `tsc --noEmit`
|
|
84
|
+
2. **Invoke `[product-manager]`** to update Roadmap status to "In Progress"
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Quick Reference
|
|
89
|
+
|
|
90
|
+
| Step | Skill | Action |
|
|
91
|
+
| :--- | :----------------- | :-------------------------- |
|
|
92
|
+
| 1 | lead-architect | Init Framework & Structure |
|
|
93
|
+
| 2 | devops-engineer | Husky, Linter, CI/CD |
|
|
94
|
+
| 3 | frontend-developer | Tailwind, Components, State |
|
|
95
|
+
| 4 | backend-developer | DB, API, Env |
|
|
96
|
+
| 5 | devops-engineer | Final Build Check |
|