@kienha/anti-chaotic 1.0.2 → 1.0.6
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/rules/{documentation.md → documents.md} +1 -1
- package/.agent/skills/backend-developer/SKILL.md +4 -14
- package/.agent/skills/business-analysis/SKILL.md +2 -4
- package/.agent/skills/designer/SKILL.md +36 -58
- package/.agent/skills/devops-engineer/SKILL.md +0 -9
- package/.agent/skills/frontend-developer/SKILL.md +17 -3
- package/.agent/skills/frontend-developer/react/SKILL.md +16 -12
- package/.agent/skills/lead-architect/SKILL.md +2 -2
- package/.agent/skills/rules-workflows/SKILL.md +22 -112
- package/.agent/skills/rules-workflows/assets/workflow-basic.md +112 -0
- package/.agent/skills/rules-workflows/references/orchestration-patterns.md +13 -3
- package/.agent/skills/rules-workflows/references/rules-guide.md +82 -65
- package/.agent/skills/rules-workflows/references/workflows-guide.md +95 -26
- package/.agent/skills/skill-creator/SKILL.md +18 -20
- package/.agent/skills/skill-creator/assets/skill-questionnaire.md +8 -0
- 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 +146 -0
- package/.agent/workflows/ui-ux-design.md +70 -51
- package/README.md +55 -354
- package/bin/{ag.js → anti-chaotic.js} +17 -0
- package/package.json +5 -4
- package/.agent/skills/frontend-developer/references/react-next.md +0 -67
- package/.agent/skills/frontend-developer/references/react.md +0 -91
- package/.agent/skills/rules-workflows/assets/example-workflow.md +0 -37
- package/.agent/skills/rules-workflows/assets/templates/rule-project-context.md +0 -26
- package/.agent/skills/rules-workflows/assets/templates/workflow-agile-feature.md +0 -62
- 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/generate-docs-from-codebase.md +0 -335
- package/.agent/workflows/requirement-analysis.md +0 -336
- package/.agent/workflows/setup-codebase.md +0 -97
- package/.agent/workflows/workflow-rule-from-codebase.md +0 -43
- package/.agent/workflows/workflow-rule-from-feedback.md +0 -38
- /package/.agent/skills/rules-workflows/assets/{example-rule-always-on.md → rule-always-on.md} +0 -0
- /package/.agent/skills/rules-workflows/assets/{example-rule-glob.md → rule-glob.md} +0 -0
- /package/.agent/skills/rules-workflows/assets/{example-rule-manual.md → rule-manual.md} +0 -0
- /package/.agent/skills/rules-workflows/assets/{example-rule-model-decision.md → rule-model-decision.md} +0 -0
|
@@ -1,101 +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").
|
|
14
13
|
|
|
15
|
-
|
|
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` |
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
## 2. Activation Strategy (Context Management)
|
|
18
21
|
|
|
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 |
|
|
22
|
+
The key to a responsive Agent is _Selective Activation_. Loading 100 rules confuses the context. Use activation types strategically.
|
|
25
23
|
|
|
26
|
-
###
|
|
24
|
+
### A. The "Always On" (Global Constitution)
|
|
27
25
|
|
|
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)
|
|
26
|
+
**Use sparingly.** Only for rules that apply to _every_ single keystroke.
|
|
32
27
|
|
|
33
|
-
|
|
28
|
+
- **Triggers**: `always_on`
|
|
29
|
+
- **Use Case**: Safety checks, Tone of Voice, Core Documentation links.
|
|
30
|
+
- **Cost**: Consumes context window on every turn.
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
### B. The "Just-in-Time" (Context-Aware)
|
|
36
33
|
|
|
37
|
-
|
|
34
|
+
**The Gold Standard.** Rules that activate only when relevant.
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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`.
|
|
43
40
|
|
|
44
|
-
|
|
41
|
+
### C. The "Surgical" (Manual Override)
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
```
|
|
43
|
+
**For heavy-duty tasks.**
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
- **Triggers**: `manual`
|
|
46
|
+
- **Use Case**: "Refactor this legacy code." -> User explicitly calls `@refactoring-rules`.
|
|
50
47
|
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
trigger: model_decision
|
|
54
|
-
description: Apply when working with authentication or security features
|
|
55
|
-
---
|
|
48
|
+
## 3. Designing Effective Rules
|
|
56
49
|
|
|
57
|
-
|
|
50
|
+
A rule is a **Directive**, not a suggestion.
|
|
58
51
|
|
|
59
|
-
|
|
60
|
-
```
|
|
52
|
+
### ❌ Weak Rule
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
> "Try to write good variable names and maybe use TypeScript if you can."
|
|
63
55
|
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
trigger: glob
|
|
67
|
-
glob: src/**/*.tsx
|
|
68
|
-
---
|
|
56
|
+
### ✅ Strong Rule
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
> **Constraint**: All variables MUST follow `camelCase`.
|
|
59
|
+
> **Requirement**: TypeScript `strict` mode is MANDATORY. `any` type is strictly FORBIDDEN.
|
|
71
60
|
|
|
72
|
-
|
|
73
|
-
```
|
|
61
|
+
## 4. Governance & Lifecycle
|
|
74
62
|
|
|
75
|
-
|
|
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.
|
|
76
72
|
|
|
77
73
|
```markdown
|
|
78
74
|
---
|
|
79
|
-
|
|
75
|
+
description:
|
|
76
|
+
[When should this apply? e.g., "Applied when editing Database Schema"]
|
|
77
|
+
globs: ["prisma/schema.prisma"]
|
|
80
78
|
---
|
|
81
79
|
|
|
82
|
-
# [Rule Name]
|
|
80
|
+
# [Rule Name, e.g., Database Schema Standards]
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
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()`.
|
|
86
90
|
|
|
87
|
-
##
|
|
91
|
+
## 3. Code Patterns (The "How")
|
|
92
|
+
|
|
93
|
+
### Naming
|
|
94
|
+
|
|
95
|
+
- Tables: `snake_case` (plural), e.g., `users`, `order_items`.
|
|
96
|
+
- Foreign Keys: `noun_id`, e.g., `user_id`.
|
|
97
|
+
|
|
98
|
+
### Example
|
|
99
|
+
|
|
100
|
+
✅ **Good**:
|
|
101
|
+
model User {
|
|
102
|
+
id String @id @default(uuid())
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
❌ **Bad**:
|
|
106
|
+
model User {
|
|
107
|
+
id Int @id @default(autoincrement())
|
|
108
|
+
}
|
|
109
|
+
```
|
|
88
110
|
|
|
89
|
-
|
|
90
|
-
2. **Use descriptive names** - Rule filename becomes its identifier
|
|
91
|
-
3. **Leverage glob patterns** - Auto-apply rules to relevant files
|
|
92
|
-
4. **Reference external files** - Use `@filename` to include context
|
|
93
|
-
5. **Stay under 12,000 chars** - Split into multiple files if needed
|
|
111
|
+
## 6. Advanced Context Injection
|
|
94
112
|
|
|
95
|
-
|
|
113
|
+
You can "hydrate" rules with dynamic context using `@` references.
|
|
96
114
|
|
|
97
|
-
|
|
115
|
+
- **`@/docs/api-spec.md`**: "Enforce the API contract defined in this file."
|
|
116
|
+
- **`@../shared/types.ts`**: "Use these exact types."
|
|
98
117
|
|
|
99
|
-
|
|
100
|
-
- `@/docs/api.md` - Absolute from workspace root
|
|
101
|
-
- `@../shared/types.ts` - Relative path traversal
|
|
118
|
+
This allows the rule to remain static (the _policy_) while referencing dynamic content (the _data_).
|
|
@@ -1,54 +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
|
|
8
|
+
|
|
9
|
+
Effective workflows shift the Agent from "Ad-hoc Assistant" to "Autonomous Operator".
|
|
10
|
+
|
|
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** |
|
|
16
|
+
|
|
17
|
+
## 2. Anatomy of an Effective Workflow
|
|
18
|
+
|
|
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:
|
|
10
55
|
|
|
11
56
|
```markdown
|
|
12
57
|
---
|
|
13
|
-
description:
|
|
58
|
+
description:
|
|
59
|
+
[Action-oriented description, e.g., "End-to-end Feature Implementation"]
|
|
14
60
|
---
|
|
15
61
|
|
|
16
|
-
# Workflow
|
|
62
|
+
# [Workflow Name]
|
|
63
|
+
|
|
64
|
+
## 1. Initialization
|
|
65
|
+
|
|
66
|
+
1. Load Global Rules: `documents.md`.
|
|
67
|
+
2. Analyze Context: Identify touched files.
|
|
17
68
|
|
|
18
|
-
|
|
69
|
+
## 2. Phase I: Definition (The "PM" Phase)
|
|
19
70
|
|
|
20
|
-
|
|
71
|
+
> 💡 **Tip**: Clarify before coding.
|
|
21
72
|
|
|
22
|
-
[
|
|
73
|
+
1. Invoke **[product-manager]** to refine requirements.
|
|
74
|
+
// turbo
|
|
75
|
+
2. Create `docs/specs/feature-x.md`.
|
|
76
|
+
3. **WAIT** for user approval.
|
|
23
77
|
|
|
24
|
-
##
|
|
78
|
+
## 3. Phase II: Execution (The "Dev" Phase)
|
|
25
79
|
|
|
26
|
-
|
|
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.
|
|
27
84
|
|
|
28
|
-
##
|
|
85
|
+
## 4. Phase III: Verification (The "QA" Phase)
|
|
29
86
|
|
|
30
|
-
[
|
|
87
|
+
1. Invoke **[qa-tester]** to run test suite.
|
|
88
|
+
2. Verify all tests pass.
|
|
31
89
|
```
|
|
32
90
|
|
|
33
|
-
##
|
|
91
|
+
## 5. Advanced Orchestration Patterns
|
|
34
92
|
|
|
35
|
-
|
|
93
|
+
### Chaining Workflows
|
|
94
|
+
|
|
95
|
+
Don't build monoliths. Compose small, focused workflows.
|
|
36
96
|
|
|
37
97
|
```markdown
|
|
38
|
-
## Step
|
|
98
|
+
## Step 5: Deployment
|
|
39
99
|
|
|
40
100
|
Call /deploy-staging
|
|
41
101
|
```
|
|
42
102
|
|
|
43
|
-
|
|
103
|
+
### Dynamic Branching (via Logic)
|
|
104
|
+
|
|
105
|
+
Workflows are linear, but the _Agent_ is dynamic. Use logic in steps:
|
|
106
|
+
|
|
107
|
+
```markdown
|
|
108
|
+
## Step 2: Determine Path
|
|
109
|
+
|
|
110
|
+
IF requirements are unclear:
|
|
44
111
|
|
|
45
|
-
|
|
112
|
+
- Call [business-analysis]
|
|
113
|
+
ELSE:
|
|
114
|
+
- Proceed to Step 3
|
|
115
|
+
```
|
|
46
116
|
|
|
47
|
-
|
|
117
|
+
## 6. Maintenance & KPI
|
|
48
118
|
|
|
49
|
-
|
|
119
|
+
Treat workflows like products.
|
|
50
120
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
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.
|
|
@@ -60,10 +60,24 @@ Markdown instructions for the agent. Keep under **5000 tokens** for optimal cont
|
|
|
60
60
|
|
|
61
61
|
Include:
|
|
62
62
|
|
|
63
|
-
-
|
|
63
|
+
- **Tool Usage Standards**: Standard patterns for using Antigravity tools (`run_command`, `read_file`) within this domain.
|
|
64
|
+
- Step-by-step workflows (Procedures, not Lifecycle Workflows)
|
|
64
65
|
- Code examples
|
|
65
66
|
- Edge cases and troubleshooting
|
|
66
67
|
|
|
68
|
+
## Skill Design Principles
|
|
69
|
+
|
|
70
|
+
**Strict Separation of Concerns**:
|
|
71
|
+
|
|
72
|
+
- **Skill = Knowledge**: Capabilities, Standards, Best Practices, Reference Data.
|
|
73
|
+
- **Workflow = Process**: Steps, Sequences, Lifecycles, Timelines.
|
|
74
|
+
|
|
75
|
+
> [!WARNING]
|
|
76
|
+
> **Do NOT embed Workflows in Skills.**
|
|
77
|
+
>
|
|
78
|
+
> - ❌ Bad: A `backend-developer` skill defining a "Feature Implementation" lifecycle.
|
|
79
|
+
> - ✅ Good: A `backend-developer` skill defining "API Design Standards" and asking the user to use a generic Workflow to execute it.
|
|
80
|
+
|
|
67
81
|
## Progressive Disclosure
|
|
68
82
|
|
|
69
83
|
Skills use three-level loading to manage context efficiently:
|
|
@@ -88,29 +102,12 @@ Skills use three-level loading to manage context efficiently:
|
|
|
88
102
|
Use available tools to understand the full picture:
|
|
89
103
|
|
|
90
104
|
1. **Search tools**: Use `search_web`, `read_url_content` to research official documentation
|
|
91
|
-
2. **
|
|
92
|
-
3. **Codebase analysis**: Use `grep_search`, `find_by_name` to understand existing patterns
|
|
93
|
-
|
|
94
|
-
**Use MCP Sequential Thinking for complex analysis:**
|
|
95
|
-
|
|
96
|
-
For complex problems, use `mcp_sequential-thinking_sequentialthinking` to:
|
|
97
|
-
|
|
98
|
-
- Break down problems into reasoning steps
|
|
99
|
-
- Consider multiple angles, revise if needed
|
|
100
|
-
- Generate hypotheses and verify step-by-step
|
|
101
|
-
- Ensure no edge cases are missed
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
Thought 1: Identify core requirements
|
|
105
|
-
Thought 2: Analyze dependencies
|
|
106
|
-
Thought 3: Consider edge cases
|
|
107
|
-
...
|
|
108
|
-
Final: Synthesize conclusions
|
|
109
|
-
```
|
|
105
|
+
2. **Codebase analysis**: Use `grep_search`, `find_by_name` to understand existing patterns
|
|
110
106
|
|
|
111
107
|
**Analyze step-by-step:**
|
|
112
108
|
|
|
113
109
|
- What are the core capabilities needed?
|
|
110
|
+
- **What standard Antigravity tools are most relevant?** (e.g., read_file for docs, run_command for CLI)
|
|
114
111
|
- What are common use cases and edge cases?
|
|
115
112
|
- What scripts or references would be reusable?
|
|
116
113
|
|
|
@@ -196,6 +193,7 @@ Instead of generic "What constraints?", ask specific questions like:
|
|
|
196
193
|
|
|
197
194
|
- What is the specific domain? (frontend, backend, devops, AI, etc.)
|
|
198
195
|
- What tech stack or frameworks are involved?
|
|
196
|
+
- **What standard tool patterns apply?** (e.g., File system ops vs Command line ops)
|
|
199
197
|
- What constraints must be followed? (time, resources, team size)
|
|
200
198
|
|
|
201
199
|
### Phase 3: Scope (Define Boundaries)
|
|
@@ -73,6 +73,14 @@
|
|
|
73
73
|
|
|
74
74
|
<!-- Options: junior, senior, expert (20+ years) -->
|
|
75
75
|
|
|
76
|
+
### Design Principle: Separation of Concerns
|
|
77
|
+
|
|
78
|
+
<!-- Reminder:
|
|
79
|
+
- Skill = Knowledge (Capabilities, Standards, Best Practices)
|
|
80
|
+
- Workflow = Process (Steps, Sequences, Lifecycles)
|
|
81
|
+
Do NOT ask for "Process" definitions here. Focus on "Knowledge".
|
|
82
|
+
-->
|
|
83
|
+
|
|
76
84
|
### Which best practices must be followed?
|
|
77
85
|
|
|
78
86
|
<!-- Example: "Follow Testing Trophy pattern, AAA structure for tests" -->
|
|
@@ -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 |
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze ideas with the user and create preliminary high-level documents (Roadmap, PRD).
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Brainstorm Workflow
|
|
6
|
+
|
|
7
|
+
> [!IMPORTANT]
|
|
8
|
+
> **MANDATORY**: Read `.agent/rules/documents.md` before creating any document.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## MCP Usage Guidelines
|
|
13
|
+
|
|
14
|
+
| MCP Tool | When to Use | Example |
|
|
15
|
+
| :------------------------------------------- | :----------------------------------------------------- | :-------------------------------- |
|
|
16
|
+
| `mcp_sequential-thinking_sequentialthinking` | Analyze requirements, feature dependencies, trade-offs | Break down ambiguous requests |
|
|
17
|
+
| `mcp_context7_resolve-library-id` | Find library ID before querying | "mermaid js" |
|
|
18
|
+
| `mcp_context7_query-docs` | Research tech stack options, diagram syntax | "Mermaid sequence diagram syntax" |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Document Priority Order
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Priority 0: Roadmap ← Project Planning & Timeline
|
|
26
|
+
Priority 1: PRD ← Strategic Overview
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 0: Clarification & Understanding
|
|
32
|
+
|
|
33
|
+
**Role: Product Manager**
|
|
34
|
+
|
|
35
|
+
> [!NOTE]
|
|
36
|
+
> This step is **MANDATORY**. Do NOT proceed without user confirmation.
|
|
37
|
+
|
|
38
|
+
> 💡 **MCP**: Use `sequential-thinking` to analyze ambiguous or complex requests
|
|
39
|
+
|
|
40
|
+
1. **Invoke `[product-manager]` skill** to:
|
|
41
|
+
- Summarize understanding
|
|
42
|
+
- Create clarification questions
|
|
43
|
+
2. Create `clarification-questions.md` artifact
|
|
44
|
+
3. **WAIT** for user to review and confirm
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Step 1: Create Roadmap
|
|
49
|
+
|
|
50
|
+
// turbo
|
|
51
|
+
|
|
52
|
+
> 💡 **MCP**: Use `sequential-thinking` for phased planning and risk assessment
|
|
53
|
+
|
|
54
|
+
1. **Invoke `[product-manager]` skill** to draft:
|
|
55
|
+
- Project timeline and milestones
|
|
56
|
+
- Phase breakdown (MVP, v1.0, v2.0)
|
|
57
|
+
- Key deliverables per phase
|
|
58
|
+
2. Create `draft-roadmap.md` artifact
|
|
59
|
+
3. After approval → Save to `docs/010-Planning/Roadmap-{ProjectName}.md`
|
|
60
|
+
4. **WAIT** for user response
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Step 2: Create PRD
|
|
65
|
+
|
|
66
|
+
// turbo
|
|
67
|
+
|
|
68
|
+
1. **Invoke `[product-manager]` skill** to draft:
|
|
69
|
+
- Business objectives and success metrics
|
|
70
|
+
- Target audience/user personas
|
|
71
|
+
- Feature prioritization (MoSCoW)
|
|
72
|
+
2. Create `draft-prd.md` artifact
|
|
73
|
+
3. After approval → Save to `docs/020-Requirements/PRD-{ProjectName}.md`
|
|
74
|
+
4. **WAIT** for user response
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 3: Transition to Documentation
|
|
79
|
+
|
|
80
|
+
1. Present summary of created artifacts (Roadmap, PRD).
|
|
81
|
+
2. Suggest next step: Run `/documentation` to generate detailed specifications (SDD, Epics, Stories).
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Workflow for safely customizing Agent rules and workflows with impact analysis and user confirmation.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Custom Behavior Workflow
|
|
6
|
+
|
|
7
|
+
## Tool Usage Guidelines
|
|
8
|
+
|
|
9
|
+
| Tool | When to Use | Example Query |
|
|
10
|
+
| --------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
|
|
11
|
+
| `find_by_name` | Step 1: To find if a rule/workflow already exists | `Pattern="*security*", SearchDirectory=".agent/rules"` |
|
|
12
|
+
| `view_file` | Step 2: To read the existing content for comparison | `AbsolutePath="/.../.agent/rules/security.md"` |
|
|
13
|
+
| `notify_user` | Step 3: To present analysis and ask for confirmation | `Message="I found an existing rule. Do you want to overwrite?"` |
|
|
14
|
+
| `write_to_file` | Step 4: To create or overwrite the file | `Overwrite=true` |
|
|
15
|
+
|
|
16
|
+
## Step 1: Identification & Search
|
|
17
|
+
|
|
18
|
+
// turbo
|
|
19
|
+
|
|
20
|
+
> 💡 **Tip**: Don't assume the file doesn't exist. Always search first.
|
|
21
|
+
|
|
22
|
+
1. Analyze the user's request to identify the _intent_ (e.g., "Add stricter linting", "Skip tests in deployment").
|
|
23
|
+
2. Search for existing Rules or Workflows that might already cover this.
|
|
24
|
+
- Rules: search in `.agent/rules/`
|
|
25
|
+
- Workflows: search in `.agent/workflows/`
|
|
26
|
+
|
|
27
|
+
## Step 2: Impact Analysis
|
|
28
|
+
|
|
29
|
+
> 💡 **Tip**: If a file exists, you MUST read it and compare it with the request.
|
|
30
|
+
|
|
31
|
+
**Condition A: Target does NOT exist:**
|
|
32
|
+
|
|
33
|
+
1. Verify if a template exists in `.agent/assets/` or `references/` that could be used as a base.
|
|
34
|
+
2. Draft the new content in your memory.
|
|
35
|
+
|
|
36
|
+
**Condition B: Target ALREADY exists:**
|
|
37
|
+
|
|
38
|
+
1. **Read** the current content of the file.
|
|
39
|
+
2. **Compare** the User's request vs the Current Content.
|
|
40
|
+
3. **Identify Conflicts**:
|
|
41
|
+
- Will this break existing constraints?
|
|
42
|
+
- Is this a "Breaking Change" or just an "Enhancement"?
|
|
43
|
+
4. **Formulate Recommendation**:
|
|
44
|
+
- _Adapt_: "I recommend creating a new file `custom-X.md` to avoid breaking standard X."
|
|
45
|
+
- _Override_: "This helps matches your specific need, but removes the safety check Y."
|
|
46
|
+
|
|
47
|
+
## Step 3: User Confirmation
|
|
48
|
+
|
|
49
|
+
> 💡 **Tip**: You must be explicit about what will change.
|
|
50
|
+
|
|
51
|
+
1. **Notify User** with a summary of your analysis.
|
|
52
|
+
- If **New**: "I will create a new rule [filename] that [does X]."
|
|
53
|
+
- If **modifying**: "I will modify [filename]. \n**Current**: [Summary of old]\n**Proposed**: [Summary of new]\n**Impact**: [Warning about side effects]"
|
|
54
|
+
2. **WAIT** for user approval.
|
|
55
|
+
|
|
56
|
+
## Step 4: Execution
|
|
57
|
+
|
|
58
|
+
1. Perform the file operation (`write_to_file` or `replace_file_content`).
|
|
59
|
+
2. **Validate**: Read the file back to ensure syntax is correct (Markdown/YAML frontmatter).
|
|
60
|
+
3. **Register**: If it's a rule, remind the user if they need to manually activate it (unless it's `always_on`).
|
|
61
|
+
|
|
62
|
+
## Step 5: Verification
|
|
63
|
+
|
|
64
|
+
1. Check if the customization works as expected (if possible, by running a dry-run or asking user to test).
|