@kienha/anti-chaotic 1.0.1 → 1.0.5
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 +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 +62 -19
- package/.agent/skills/rules-workflows/assets/workflow-basic.md +112 -0
- package/.agent/skills/rules-workflows/references/orchestration-patterns.md +15 -3
- package/.agent/skills/rules-workflows/references/rules-guide.md +6 -47
- package/.agent/skills/rules-workflows/references/workflows-guide.md +12 -20
- package/.agent/skills/skill-creator/SKILL.md +18 -20
- package/.agent/skills/skill-creator/assets/skill-questionnaire.md +8 -0
- package/.agent/workflows/docs-from-codebase.md +104 -0
- package/.agent/workflows/implement-feature.md +148 -0
- package/.agent/workflows/requirement-analysis.md +113 -249
- package/.agent/workflows/setup-codebase.md +51 -58
- package/.agent/workflows/ui-ux-design.md +72 -51
- package/README.md +23 -343
- package/bin/{ag.js → anti-chaotic.js} +23 -11
- 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/workflows/generate-docs-from-codebase.md +0 -335
- 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
|
@@ -17,7 +17,7 @@ You are an **Expert Senior Backend Engineer** with 20+ years of experience. You
|
|
|
17
17
|
|
|
18
18
|
**CORE PHILOSOPHY:**
|
|
19
19
|
|
|
20
|
-
1. **Documentation is Truth**: Never guess syntax or patterns. If unsure,
|
|
20
|
+
1. **Documentation is Truth**: Never guess syntax or patterns. If unsure, use `search_web` to find official docs.
|
|
21
21
|
2. **Security First**: Every input is malicious until validated. Every endpoint needs explicit AuthN/AuthZ.
|
|
22
22
|
3. **Simplicity**: Prefer boring technology that works. Complexity must be justified.
|
|
23
23
|
|
|
@@ -69,17 +69,7 @@ You are an **Expert Senior Backend Engineer** with 20+ years of experience. You
|
|
|
69
69
|
- **Unit**: Test logic in isolation. Mock dependencies.
|
|
70
70
|
- **Integration**: Test DB interactions and API endpoints.
|
|
71
71
|
|
|
72
|
-
## 3.
|
|
73
|
-
|
|
74
|
-
1. **Requirements**: Understand the data flow and constraints.
|
|
75
|
-
2. **Design**: Draft the API contract and DB schema.
|
|
76
|
-
3. **Implementation**:
|
|
77
|
-
- Create DTOs/Validators.
|
|
78
|
-
- Implement Service Layer (Business Logic).
|
|
79
|
-
- Implement Controller/Handler (HTTP Layer).
|
|
80
|
-
4. **Verification**: Write tests (Happy path + Edge cases).
|
|
81
|
-
|
|
82
|
-
## 4. Collaboration with Lead Architect
|
|
72
|
+
## 3. Collaboration with Lead Architect
|
|
83
73
|
|
|
84
74
|
**CRITICAL**: For high-stakes Architectural, Security, or Database Design decisions, you **MUST** align with the `lead-architect` skill.
|
|
85
75
|
|
|
@@ -91,8 +81,8 @@ You are an **Expert Senior Backend Engineer** with 20+ years of experience. You
|
|
|
91
81
|
|
|
92
82
|
**Action**: If the user asks for these, load the relevant `lead-architect` reference (e.g., `.agent/skills/lead-architect/references/system-architecture.md`) OR advise the user to "Consult the Lead Architect skill".
|
|
93
83
|
|
|
94
|
-
##
|
|
84
|
+
## 4. Interaction Rules
|
|
95
85
|
|
|
96
86
|
- **Code Reviews**: Be pedantic about security, performance (N+1 queries), and readability.
|
|
97
87
|
- **Explanations**: Explain _WHY_ an architectural decision was made (Trade-offs).
|
|
98
|
-
- **Unknowns**: If you encounter a library or tool you don't know detailed syntax for,
|
|
88
|
+
- **Unknowns**: If you encounter a library or tool you don't know detailed syntax for, use `search_web` immediately.
|
|
@@ -13,10 +13,9 @@ You are an **Expert Senior Business Analyst** with over 20 years of experience i
|
|
|
13
13
|
> **Document Output Location**: All generated documents (PRD, BRD, Technical Specs, User Stories, etc.) **MUST** be saved to the `docs/` folder in the project root. Do NOT create documents in other folders like `requirements/` or `specifications/`.
|
|
14
14
|
|
|
15
15
|
1. **Gap Analysis First**: Before prescribing a solution, deeply analyze the **Constraint Gap**. Ask: "What existing constraints (legacy code, budget, timeline) conflict with this new requirement?"
|
|
16
|
-
2. **Sequential Thinking**: For ANY complex logical flow,
|
|
16
|
+
2. **Sequential Thinking**: For ANY complex logical flow, break down the problem step-by-step. Do not guess; derive.
|
|
17
17
|
3. **Visuals First**: Text is ambiguous. Code is implementation details. **Diagrams are truth.**
|
|
18
|
-
-
|
|
19
|
-
- **Obsidian Updates**: Use `context7` (library: `obsidianmd/obsidian-api` or similar) to check for new graph features if unsure.
|
|
18
|
+
- Use `search_web` to retrieve the _latest_ Mermaid syntax and examples if unsure. Do not rely on internal training data.
|
|
20
19
|
4. **Obsidian Native**: Documentation should be **Graph-Ready**.
|
|
21
20
|
- Use `[[Wiki-links]]` for internal references.
|
|
22
21
|
- Create **MOCs (Maps of Content)** for major topics.
|
|
@@ -41,7 +40,6 @@ When a user asks for a new feature or system:
|
|
|
41
40
|
- Don't just ask "What do you want?". Ask specific constraints.
|
|
42
41
|
- Use the `requirements_questionnaire.md` pattern if the scope is large.
|
|
43
42
|
3. **Phase 3: Logic & Flow Analysis**
|
|
44
|
-
- **MANDATORY**: Use `mcp_sequential-thinking_sequentialthinking`.
|
|
45
43
|
- Map out the Happy Path, Negative Path, and Edge Cases.
|
|
46
44
|
4. **Phase 4: Diagramming**
|
|
47
45
|
- **Research**: Check latest Mermaid docs (State, Sequence, Class).
|
|
@@ -7,59 +7,6 @@ description: Expert designer (20+ years). Create distinctive interfaces OR revie
|
|
|
7
7
|
|
|
8
8
|
Expert-level design guidance for creating memorable, production-grade interfaces.
|
|
9
9
|
|
|
10
|
-
## References
|
|
11
|
-
|
|
12
|
-
Load references based on task context:
|
|
13
|
-
|
|
14
|
-
| Reference | Path | Purpose |
|
|
15
|
-
| -------------- | ------------------------------ | ------------------------------------------------- |
|
|
16
|
-
| Branding | `references/branding.md` | Creating logos, visual identity, brand guidelines |
|
|
17
|
-
| Color Theory | `references/color-theory.md` | Choosing palettes, dark mode, semantic colors |
|
|
18
|
-
| Typography | `references/typography.md` | Font pairing, scales, text rendering |
|
|
19
|
-
| Layout | `references/layout.md` | Grids, spacing, responsive design |
|
|
20
|
-
| Motion | `references/motion.md` | Micro-interactions, transitions, performance |
|
|
21
|
-
| Accessibility | `references/accessibility.md` | WCAG compliance, keyboard nav, screen readers |
|
|
22
|
-
| Design Systems | `references/design-systems.md` | Design tokens, component patterns, documentation |
|
|
23
|
-
| Trends | `references/trends.md` | 2024-2025 trends, emerging CSS features |
|
|
24
|
-
| Creation | `references/creation.md` | New components, pages, creative direction |
|
|
25
|
-
| Review | `references/review.md` | Code review, compliance checks, quality audit |
|
|
26
|
-
|
|
27
|
-
## Concepts
|
|
28
|
-
|
|
29
|
-
Distinct visual aesthetics to drive design direction:
|
|
30
|
-
|
|
31
|
-
| Concept | Path | Description |
|
|
32
|
-
| ------------------- | ------------------------------ | ------------------------------------------- |
|
|
33
|
-
| Apple Glassmorphism | `concepts/apple-glass.md` | Premium, translucent depth (VisionOS Style) |
|
|
34
|
-
| Neo-Brutalism | `concepts/neo-brutalism.md` | Raw, high-contrast, bold borders |
|
|
35
|
-
| Claymorphism | `concepts/claymorphism.md` | Soft 3D, inflated shapes, tactile feel |
|
|
36
|
-
| Aurora Gradients | `concepts/aurora-gradients.md` | Ethereal, moving blurred color meshes |
|
|
37
|
-
| Bento Grids | `concepts/bento-grids.md` | Modular, grid-based content layout |
|
|
38
|
-
|
|
39
|
-
## Modes of Operation
|
|
40
|
-
|
|
41
|
-
### 1. Creation Mode
|
|
42
|
-
|
|
43
|
-
Use when building something new.
|
|
44
|
-
|
|
45
|
-
**Process:**
|
|
46
|
-
|
|
47
|
-
1. Clarify purpose and audience
|
|
48
|
-
2. Choose aesthetic direction (bold, minimal, playful, etc.)
|
|
49
|
-
3. Load relevant references for decisions
|
|
50
|
-
4. Build with intentionality
|
|
51
|
-
|
|
52
|
-
### 2. Review Mode
|
|
53
|
-
|
|
54
|
-
Use when auditing existing code.
|
|
55
|
-
|
|
56
|
-
**Process:**
|
|
57
|
-
|
|
58
|
-
1. Load `references/review.md`
|
|
59
|
-
2. Fetch latest Web Interface Guidelines
|
|
60
|
-
3. Analyze target files
|
|
61
|
-
4. Report in `file:line` format
|
|
62
|
-
|
|
63
10
|
## Core Design Principles
|
|
64
11
|
|
|
65
12
|
### Intentionality Over Trends
|
|
@@ -86,16 +33,47 @@ High-quality design = high-quality code:
|
|
|
86
33
|
- Performance-minded animations
|
|
87
34
|
- Accessibility as foundation
|
|
88
35
|
|
|
36
|
+
## Tools
|
|
37
|
+
|
|
38
|
+
| Tool | Purpose | Rule |
|
|
39
|
+
| ---------------- | --------------------------------------------- | ------------------------------------ |
|
|
40
|
+
| `generate_image` | UI icons, avatars, backgrounds, illustrations | Follow `.agent/rules/nano-banana.md` |
|
|
41
|
+
|
|
89
42
|
## Integration
|
|
90
43
|
|
|
91
44
|
Works with `frontend-developer` skill for implementation handoff:
|
|
92
45
|
|
|
93
|
-
- **Designer Role**: Creates visual designs, tokens, and
|
|
46
|
+
- **Designer Role**: Creates visual designs, tokens, and Motion Specs.
|
|
94
47
|
- **Frontend Role**: Writes the actual CSS/JS code based on these specs.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
48
|
+
|
|
49
|
+
## References
|
|
50
|
+
|
|
51
|
+
Load references based on task context:
|
|
52
|
+
|
|
53
|
+
| Reference | Path | Purpose |
|
|
54
|
+
| -------------- | ------------------------------ | ------------------------------------------------- |
|
|
55
|
+
| Branding | `references/branding.md` | Creating logos, visual identity, brand guidelines |
|
|
56
|
+
| Color Theory | `references/color-theory.md` | Choosing palettes, dark mode, semantic colors |
|
|
57
|
+
| Typography | `references/typography.md` | Font pairing, scales, text rendering |
|
|
58
|
+
| Layout | `references/layout.md` | Grids, spacing, responsive design |
|
|
59
|
+
| Motion | `references/motion.md` | Micro-interactions, transitions, performance |
|
|
60
|
+
| Accessibility | `references/accessibility.md` | WCAG compliance, keyboard nav, screen readers |
|
|
61
|
+
| Design Systems | `references/design-systems.md` | Design tokens, component patterns, documentation |
|
|
62
|
+
| Trends | `references/trends.md` | 2024-2025 trends, emerging CSS features |
|
|
63
|
+
| Creation | `references/creation.md` | New components, pages, creative direction |
|
|
64
|
+
| Review | `references/review.md` | Code review, compliance checks, quality audit |
|
|
65
|
+
|
|
66
|
+
## Concepts
|
|
67
|
+
|
|
68
|
+
Distinct visual aesthetics to drive design direction:
|
|
69
|
+
|
|
70
|
+
| Concept | Path | Description |
|
|
71
|
+
| ------------------- | ------------------------------ | ------------------------------------------- |
|
|
72
|
+
| Apple Glassmorphism | `concepts/apple-glass.md` | Premium, translucent depth (VisionOS Style) |
|
|
73
|
+
| Neo-Brutalism | `concepts/neo-brutalism.md` | Raw, high-contrast, bold borders |
|
|
74
|
+
| Claymorphism | `concepts/claymorphism.md` | Soft 3D, inflated shapes, tactile feel |
|
|
75
|
+
| Aurora Gradients | `concepts/aurora-gradients.md` | Ethereal, moving blurred color meshes |
|
|
76
|
+
| Bento Grids | `concepts/bento-grids.md` | Modular, grid-based content layout |
|
|
99
77
|
|
|
100
78
|
## Templates
|
|
101
79
|
|
|
@@ -71,15 +71,6 @@ Before acting, determine the stack components using the **Comparison Tables** be
|
|
|
71
71
|
> [!TIP]
|
|
72
72
|
> **Long-tail Tools**: If a user asks for a tool NOT listed above (e.g., DigitalOcean, TravisCI), use `search_web` to find the official "Quick Start" and "Best Practices" documentation.
|
|
73
73
|
|
|
74
|
-
## 🛠️ Universal Workflow
|
|
75
|
-
|
|
76
|
-
1. **Plan**: Analyze requirements -> Select Stack (Matrix) -> Design Architecture.
|
|
77
|
-
2. **Setup**: Initialize Repo -> Configure Code Quality Tools (Husky/Lint-staged/Biom).
|
|
78
|
-
3. **Provision (IaC)**: Write Terraform/Pulumi code -> Plan -> Apply.
|
|
79
|
-
4. **Configure**: Setup Secrets (GH Secrets/Vault) -> Env Vars.
|
|
80
|
-
5. **Pipeline**: Create CI/CD workflow (Lint -> Test -> Build -> Deploy).
|
|
81
|
-
6. **Verify**: Check Logs/Metrics -> Smoke Test -> Rollback strategy.
|
|
82
|
-
|
|
83
74
|
## 🛡️ Security & Compliance Standards
|
|
84
75
|
|
|
85
76
|
- **Least Privilege**: IAM roles must be scoped strictly.
|
|
@@ -40,12 +40,23 @@ _If you cannot find a source, you must PAUSE and use `search_web` or ask the use
|
|
|
40
40
|
|
|
41
41
|
You are a Polyglot Expert. You adapt your specific advice based on the project's tech stack.
|
|
42
42
|
|
|
43
|
-
**ACTION**: At the start of every task, check `package.json` and load the corresponding
|
|
43
|
+
**ACTION**: At the start of every task, check `package.json` and load the corresponding knowledge source.
|
|
44
|
+
|
|
45
|
+
### Sub-Skills (Framework-Specific)
|
|
46
|
+
|
|
47
|
+
These are complete sub-skills with their own rules, examples, and guidelines. Load the entire sub-skill `SKILL.md` when working with these frameworks:
|
|
48
|
+
|
|
49
|
+
| Tech Stack | Sub-Skill Path | Key Focus |
|
|
50
|
+
| ------------------- | ---------------- | ----------------------------------------- |
|
|
51
|
+
| **React / Next.js** | `react/SKILL.md` | RSCs, Suspense, Streaming, Server Actions |
|
|
52
|
+
|
|
53
|
+
### Reference Files
|
|
54
|
+
|
|
55
|
+
General reference guides for frameworks without full sub-skills yet:
|
|
44
56
|
|
|
45
57
|
| Tech Stack | Reference File | Key Focus |
|
|
46
58
|
| --------------------- | -------------------------------- | -------------------------------------------- |
|
|
47
59
|
| **Universal Base** | `references/core-performance.md` | _Always load this._ Web Vitals, A11y, HTTP/3 |
|
|
48
|
-
| **React / Next.js** | `react/SKILL.md` | RSCs, Suspense, Streaming, Server Actions |
|
|
49
60
|
| **Vue / Nuxt** | `references/vue-nuxt.md` | Composition API, Nitro, Nuxt Modules |
|
|
50
61
|
| **Angular** | `references/angular.md` | Signals, Standalone Components, Zone-less |
|
|
51
62
|
| **Svelte/Solid/Qwik** | `references/modern-signals.md` | Fine-grained reactivity, Resumability |
|
|
@@ -55,7 +66,10 @@ You are a Polyglot Expert. You adapt your specific advice based on the project's
|
|
|
55
66
|
### Phase 1: Discovery & Citation
|
|
56
67
|
|
|
57
68
|
1. **Identify** the needed technology (e.g., "I need to optimize images in Next.js").
|
|
58
|
-
2. **Fetch Source**:
|
|
69
|
+
2. **Fetch Source**: Load the appropriate sub-skill OR reference file:
|
|
70
|
+
- For React/Next.js: Read `react/SKILL.md` and relevant rules in `react/rules/`
|
|
71
|
+
- For other frameworks: Read corresponding `references/*.md` file
|
|
72
|
+
- Or search official docs if not available.
|
|
59
73
|
3. **State Evidence**:
|
|
60
74
|
> "According to Next.js docs (referenced in `react/SKILL.md`), we should use the `<Image>` component with `sizes` to prevent layout shift."
|
|
61
75
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: React and Next.js performance optimization guidelines from Vercel Engineering.
|
|
2
|
+
name: react-nextjs
|
|
3
|
+
description: React and Next.js performance optimization guidelines from Vercel Engineering. Sub-skill of frontend-developer. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
+
parent-skill: frontend-developer
|
|
6
7
|
author: vercel
|
|
7
8
|
version: "1.0.0"
|
|
9
|
+
type: sub-skill
|
|
8
10
|
---
|
|
9
11
|
|
|
10
12
|
# Vercel React Best Practices
|
|
@@ -14,6 +16,7 @@ Comprehensive performance optimization guide for React and Next.js applications,
|
|
|
14
16
|
## When to Apply
|
|
15
17
|
|
|
16
18
|
Reference these guidelines when:
|
|
19
|
+
|
|
17
20
|
- Writing new React components or Next.js pages
|
|
18
21
|
- Implementing data fetching (client or server-side)
|
|
19
22
|
- Reviewing code for performance issues
|
|
@@ -22,16 +25,16 @@ Reference these guidelines when:
|
|
|
22
25
|
|
|
23
26
|
## Rule Categories by Priority
|
|
24
27
|
|
|
25
|
-
| Priority | Category
|
|
26
|
-
|
|
27
|
-
| 1
|
|
28
|
-
| 2
|
|
29
|
-
| 3
|
|
30
|
-
| 4
|
|
31
|
-
| 5
|
|
32
|
-
| 6
|
|
33
|
-
| 7
|
|
34
|
-
| 8
|
|
28
|
+
| Priority | Category | Impact | Prefix |
|
|
29
|
+
| -------- | ------------------------- | ----------- | ------------ |
|
|
30
|
+
| 1 | Eliminating Waterfalls | CRITICAL | `async-` |
|
|
31
|
+
| 2 | Bundle Size Optimization | CRITICAL | `bundle-` |
|
|
32
|
+
| 3 | Server-Side Performance | HIGH | `server-` |
|
|
33
|
+
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | `client-` |
|
|
34
|
+
| 5 | Re-render Optimization | MEDIUM | `rerender-` |
|
|
35
|
+
| 6 | Rendering Performance | MEDIUM | `rendering-` |
|
|
36
|
+
| 7 | JavaScript Performance | LOW-MEDIUM | `js-` |
|
|
37
|
+
| 8 | Advanced Patterns | LOW | `advanced-` |
|
|
35
38
|
|
|
36
39
|
## Quick Reference
|
|
37
40
|
|
|
@@ -115,6 +118,7 @@ rules/_sections.md
|
|
|
115
118
|
```
|
|
116
119
|
|
|
117
120
|
Each rule file contains:
|
|
121
|
+
|
|
118
122
|
- Brief explanation of why it matters
|
|
119
123
|
- Incorrect code example with explanation
|
|
120
124
|
- Correct code example with explanation
|
|
@@ -66,8 +66,8 @@ Once a path is chosen, offer to document it:
|
|
|
66
66
|
|
|
67
67
|
## Rules
|
|
68
68
|
|
|
69
|
-
1. **Mandatory Research**:
|
|
70
|
-
2. **Sequential Reasoning**: For any complex architectural decision
|
|
69
|
+
1. **Mandatory Research**: Use `search_web` to research trends/comparisons before providing advice. Do not rely solely on training data; ensure information is current (2024/2025+).
|
|
70
|
+
2. **Sequential Reasoning**: For any complex architectural decision:
|
|
71
71
|
- Analyze requirements depth.
|
|
72
72
|
- Evaluate trade-offs of proposed options.
|
|
73
73
|
- Anticipate failure modes and edge cases.
|
|
@@ -17,15 +17,22 @@ This skill empowers the Agent to act as an **Autonomous Process Orchestrator**,
|
|
|
17
17
|
Before creating any rule or workflow, the Agent MUST:
|
|
18
18
|
|
|
19
19
|
1. **Analyze the Goal**: What is the user trying to achieve? (e.g., "Add a feature", "Fix a bug").
|
|
20
|
-
2. **
|
|
21
|
-
|
|
20
|
+
2. **Orchestrate Capabilities**: Identify which _other_ skills (Frontend, Backend, QA) needed to execute the plan.
|
|
21
|
+
|
|
22
|
+
### Design Principle: Separation of Concerns
|
|
23
|
+
|
|
24
|
+
- **Workflows are Processes**: They define the sequence of steps (Step 1 -> Step 2).
|
|
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.`
|
|
22
29
|
|
|
23
30
|
## 📚 Resource Library
|
|
24
31
|
|
|
25
|
-
### Templates (`
|
|
32
|
+
### Guides & Templates (`references/`)
|
|
26
33
|
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
34
|
+
- `rules-guide.md`: **Rule Creation Guide**. Contains templates for Always-On, Glob, Manual, and Model Decision rules.
|
|
35
|
+
- `workflows-guide.md`: **Workflow Creation Guide**. Contains the standard Feature Implementation workflow template.
|
|
29
36
|
|
|
30
37
|
### Workflows (`../../workflows/`)
|
|
31
38
|
|
|
@@ -53,18 +60,15 @@ At the rule level, you can define **how** a rule should be activated:
|
|
|
53
60
|
| **Model Decision** | `model_decision` | Model decides based on natural language `description` in frontmatter |
|
|
54
61
|
| **Glob** | `glob` | Applied to files matching the `glob` pattern (e.g., `src/**/*.tsx`) |
|
|
55
62
|
|
|
56
|
-
### Examples
|
|
63
|
+
### Examples
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
- `example-rule-glob.md`: React component guidelines for `.tsx` files
|
|
60
|
-
- `example-rule-manual.md`: Deep code review activated via @mention
|
|
61
|
-
- `example-rule-model-decision.md`: Security guidelines auto-applied contextually
|
|
65
|
+
Refer to `references/rules-guide.md` for a comprehensive list of rule pattern examples and templates.
|
|
62
66
|
|
|
63
67
|
### Creation Process
|
|
64
68
|
|
|
65
69
|
1. **Ask**: "What specific behaviors or constraints must be enforced?"
|
|
66
70
|
2. **Choose Activation Type**: Select the appropriate trigger based on when the rule should apply
|
|
67
|
-
3. **Draft**:
|
|
71
|
+
3. **Draft**: Refer to templates in `references/rules-guide.md`.
|
|
68
72
|
4. **Refine**: Ensure rules are actionable (e.g., "Use Zod for input" vs "Write good code")
|
|
69
73
|
|
|
70
74
|
### Best Practices
|
|
@@ -101,20 +105,54 @@ Instead of generic "write code", use structured flows:
|
|
|
101
105
|
|
|
102
106
|
1. **Map the Process**: Identify the roles and steps involved.
|
|
103
107
|
2. **Select Pattern**: Consult `references/orchestration-patterns.md`.
|
|
104
|
-
3. **Draft**:
|
|
108
|
+
3. **Draft**: Refer to the template in `references/workflows-guide.md`.
|
|
109
|
+
|
|
110
|
+
## Workflow Design Standards
|
|
111
|
+
|
|
112
|
+
Follow the "Feature Implementation" pattern (see `references/workflows-guide.md` for full template details):
|
|
113
|
+
|
|
114
|
+
### 1. Header & Prereqs
|
|
105
115
|
|
|
106
|
-
|
|
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_.
|
|
107
119
|
|
|
108
120
|
```markdown
|
|
109
|
-
##
|
|
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:
|
|
110
131
|
|
|
111
|
-
|
|
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.
|
|
112
137
|
|
|
113
|
-
|
|
138
|
+
**Example Step:**
|
|
114
139
|
|
|
115
|
-
|
|
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.
|
|
116
150
|
```
|
|
117
151
|
|
|
152
|
+
### 3. Summary
|
|
153
|
+
|
|
154
|
+
- **Quick Reference**: A table at the bottom tracking Step -> Skill -> Output.
|
|
155
|
+
|
|
118
156
|
---
|
|
119
157
|
|
|
120
158
|
## 3. Orchestration & Autonomy Rules
|
|
@@ -127,12 +165,17 @@ Instead of generic "write code", use structured flows:
|
|
|
127
165
|
### Rule 2: Sequential Thinking
|
|
128
166
|
|
|
129
167
|
- **Mandatory** for: Debugging, Architecture Design, and Requirement Analysis.
|
|
130
|
-
- **Usage**:
|
|
168
|
+
- **Usage**: Break down problems step-by-step _before_ writing code.
|
|
131
169
|
|
|
132
170
|
### Rule 3: Strict Validation
|
|
133
171
|
|
|
134
172
|
- Verify all generated rules/workflows against the official documentation.
|
|
135
|
-
- If a workflow fails, **stop**, analyze
|
|
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.
|
|
136
179
|
|
|
137
180
|
## 4. Self-Correction & Learning
|
|
138
181
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: [End-to-end feature implementation workflow]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Feature Implementation Workflow
|
|
6
|
+
|
|
7
|
+
Orchestrates feature implementation from specification to deployment.
|
|
8
|
+
|
|
9
|
+
> [!IMPORTANT]
|
|
10
|
+
> **MANDATORY**: Read `.agent/rules/documentation.md` before creating any document.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Tool Usage Guidelines
|
|
15
|
+
|
|
16
|
+
| Tool | When to Use |
|
|
17
|
+
| --------------------------- | ------------------------------------------------- |
|
|
18
|
+
| `sequential-thinking` (MCP) | Complex decisions, debugging, architecture design |
|
|
19
|
+
| `search_web` | Researching libraries or documentation |
|
|
20
|
+
| `context7` (MCP) | Retrieving latest library documentation |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Step 0: Quick Specification
|
|
25
|
+
|
|
26
|
+
**Skip if**: Specs already exist.
|
|
27
|
+
|
|
28
|
+
> 💡 **Tip**: Use `sequential-thinking` to analyze ambiguous requirements.
|
|
29
|
+
|
|
30
|
+
1. **Invoke `[product-manager]` skill** to clarify requirements.
|
|
31
|
+
2. Create `feature-spec.md` artifact.
|
|
32
|
+
3. **WAIT** for user confirmation.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Step 1: Locate Existing Artifacts
|
|
37
|
+
|
|
38
|
+
// turbo
|
|
39
|
+
|
|
40
|
+
1. Search `docs/` for related stories/designs.
|
|
41
|
+
2. **Invoke `[lead-architect]` skill** to identify scope.
|
|
42
|
+
3. List files to create/modify.
|
|
43
|
+
4. **WAIT** for user to confirm scope.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 2: Implementation Plan
|
|
48
|
+
|
|
49
|
+
// turbo
|
|
50
|
+
|
|
51
|
+
1. **Invoke `[lead-architect]` skill** to create task breakdown.
|
|
52
|
+
2. Create `implementation-plan.md` artifact.
|
|
53
|
+
3. **WAIT** for user approval.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Step 3: Design Review (Optional)
|
|
58
|
+
|
|
59
|
+
// turbo
|
|
60
|
+
|
|
61
|
+
**Skip if**: Backend only.
|
|
62
|
+
|
|
63
|
+
1. Check `docs/040-Design/`.
|
|
64
|
+
2. **Invoke `[designer]` skill** for component specs.
|
|
65
|
+
3. **WAIT** for user confirmation.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 4: Backend Implementation
|
|
70
|
+
|
|
71
|
+
// turbo
|
|
72
|
+
|
|
73
|
+
1. **Invoke `[backend-developer]` skill** for:
|
|
74
|
+
- Schema/Migrations
|
|
75
|
+
- API endpoints
|
|
76
|
+
- Tests
|
|
77
|
+
2. **WAIT** for user checkpoint.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Step 5: Frontend Implementation
|
|
82
|
+
|
|
83
|
+
// turbo
|
|
84
|
+
|
|
85
|
+
1. **Invoke `[frontend-developer]` skill** for:
|
|
86
|
+
- Components
|
|
87
|
+
- Integration
|
|
88
|
+
- Tests
|
|
89
|
+
2. **WAIT** for user checkpoint.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Step 6: QA & Finalize
|
|
94
|
+
|
|
95
|
+
// turbo
|
|
96
|
+
|
|
97
|
+
1. **Invoke `[qa-tester]` skill** for E2E tests.
|
|
98
|
+
2. **Invoke `[lead-architect]` skill** to update docs/MOC.
|
|
99
|
+
3. Present completion summary.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Quick Reference
|
|
104
|
+
|
|
105
|
+
| Step | Skill | Output |
|
|
106
|
+
| ---- | ------------------ | ---------------------- |
|
|
107
|
+
| 0 | product-manager | feature-spec.md |
|
|
108
|
+
| 1-2 | lead-architect | implementation-plan.md |
|
|
109
|
+
| 3 | designer | Component specs |
|
|
110
|
+
| 4 | backend-developer | API, Tests |
|
|
111
|
+
| 5 | frontend-developer | Components, Tests |
|
|
112
|
+
| 6 | qa-tester | qa-report.md |
|
|
@@ -30,12 +30,24 @@ 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
|
-
|
|
33
|
+
32:
|
|
34
|
+
33: ## 4. The "Delegation" Pattern (Process vs Knowledge)
|
|
35
|
+
34:
|
|
36
|
+
35: **Best for**: Enforcing standards within workflows.
|
|
37
|
+
36: **Sequence**: `Workflow` (Process) -> `Skill` (Knowledge).
|
|
38
|
+
37:
|
|
39
|
+
38: **Rule**: Workflows define _when_ to do something. Skills define _how_ to do it.
|
|
40
|
+
39:
|
|
41
|
+
40: - ❌ **Bad Workflow**: "Step 4: Check that contrast is 4.5:1." (Hardcoded)
|
|
42
|
+
41: - ✅ **Good Workflow**: "Step 4: Verify accessibility using [designer] skill." (Delegated)
|
|
43
|
+
42:
|
|
44
|
+
43: ## 5. The "Reasoning" Bridge
|
|
45
|
+
44:
|
|
34
46
|
|
|
35
47
|
**Best for**: Ambiguity, complex debugging.
|
|
36
|
-
**
|
|
48
|
+
**Approach**: Break down the problem step-by-step before switching skills.
|
|
37
49
|
|
|
38
|
-
Use
|
|
50
|
+
Use step-by-step reasoning as a bridge whenever you get stuck or need to plan the next move.
|
|
39
51
|
|
|
40
52
|
- "I have the error log, but don't know the cause." -> **Think** -> "Hypothesis: DB connection timeout."
|
|
41
53
|
- "I have the requirements, but don't know which library to use." -> **Think** -> "Evaluate options A, B, C."
|
|
@@ -34,55 +34,14 @@ At the rule level, you can define **how** a rule should be activated:
|
|
|
34
34
|
|
|
35
35
|
## Rule File Templates
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Templates are available in the `../assets/` directory:
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# [Rule Name]
|
|
45
|
-
|
|
46
|
-
[Instructions that always apply to this workspace/globally]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Model-Decision Rule
|
|
50
|
-
|
|
51
|
-
```markdown
|
|
52
|
-
---
|
|
53
|
-
trigger: model_decision
|
|
54
|
-
description: Apply when working with authentication or security features
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
# Security Guidelines
|
|
58
|
-
|
|
59
|
-
[Security-related instructions for the agent]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Glob-Pattern Rule
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
---
|
|
66
|
-
trigger: glob
|
|
67
|
-
glob: src/**/*.tsx
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
# React Component Standards
|
|
71
|
-
|
|
72
|
-
[Standards to apply when editing React components]
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Manual Rule
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
---
|
|
79
|
-
trigger: manual
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
# [Rule Name]
|
|
39
|
+
- **Always-On Rule**: `../assets/rule-always-on.md`
|
|
40
|
+
- **Model-Decision Rule**: `../assets/rule-model-decision.md`
|
|
41
|
+
- **Glob-Pattern Rule**: `../assets/rule-glob.md`
|
|
42
|
+
- **Manual Rule**: `../assets/rule-manual.md`
|
|
83
43
|
|
|
84
|
-
|
|
85
|
-
```
|
|
44
|
+
Use these templates as a starting point for creating new rules.
|
|
86
45
|
|
|
87
46
|
## Best Practices
|
|
88
47
|
|