nurosys-agents 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/INSTRUCTIONS.md +82 -0
- package/.agent/README.md +483 -0
- package/.agent/backend/skills/architect/SKILL.md +436 -0
- package/.agent/backend/skills/auth-and-permissions/SKILL.md +168 -0
- package/.agent/backend/skills/brainstorm/SKILL.md +127 -0
- package/.agent/backend/skills/code-reviewer/SKILL.md +324 -0
- package/.agent/backend/skills/create-blueprint/SKILL.md +650 -0
- package/.agent/backend/skills/debug-issue/SKILL.md +53 -0
- package/.agent/backend/skills/explore-codebase/SKILL.md +45 -0
- package/.agent/backend/skills/quick-execute/SKILL.md +99 -0
- package/.agent/backend/skills/refactor-safely/SKILL.md +46 -0
- package/.agent/backend/skills/security-assessment/SKILL.md +174 -0
- package/.agent/backend/workflows/module-runner.claude.md +226 -0
- package/.agent/backend/workflows/module-runner.codex.md +155 -0
- package/.agent/backend/workflows/module-runner.cursor.md +212 -0
- package/.agent/frontend/skills/architect/SKILL.md +644 -0
- package/.agent/frontend/skills/auth-and-permissions/SKILL.md +43 -0
- package/.agent/frontend/skills/create-blueprint/SKILL.md +635 -0
- package/.agent/frontend/skills/debug-issue/SKILL.md +28 -0
- package/.agent/frontend/skills/explore-codebase/SKILL.md +29 -0
- package/.agent/frontend/skills/feature-workflow/SKILL.md +61 -0
- package/.agent/frontend/skills/react-quality-review/SKILL.md +126 -0
- package/.agent/frontend/skills/react-quality-review/examples.md +24 -0
- package/.agent/frontend/skills/react-quality-review/rules/_sections.md +26 -0
- package/.agent/frontend/skills/react-quality-review/rules/_template.md +28 -0
- package/.agent/frontend/skills/react-quality-review/rules/advanced-event-handler-refs.md +55 -0
- package/.agent/frontend/skills/react-quality-review/rules/advanced-init-once.md +42 -0
- package/.agent/frontend/skills/react-quality-review/rules/react-rules-calling.md +66 -0
- package/.agent/frontend/skills/react-quality-review/rules/react-rules-hooks.md +91 -0
- package/.agent/frontend/skills/react-quality-review/rules/react-rules-purity.md +121 -0
- package/.agent/frontend/skills/react-quality-review/rules/rendering-activity.md +26 -0
- package/.agent/frontend/skills/react-quality-review/rules/rendering-conditional-render.md +40 -0
- package/.agent/frontend/skills/react-quality-review/rules/rendering-content-visibility.md +38 -0
- package/.agent/frontend/skills/react-quality-review/rules/rendering-hoist-jsx.md +46 -0
- package/.agent/frontend/skills/react-quality-review/rules/rendering-usetransition-loading.md +75 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-defer-reads.md +39 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-dependencies.md +45 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-derived-state-no-effect.md +40 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-derived-state.md +29 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-functional-setstate.md +74 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-lazy-state-init.md +58 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-memo-with-default-value.md +38 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-memo.md +44 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-move-effect-to-event.md +45 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-no-inline-components.md +82 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-simple-expression-in-memo.md +35 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-transitions.md +40 -0
- package/.agent/frontend/skills/react-quality-review/rules/rerender-use-ref-transient-values.md +73 -0
- package/.agent/frontend/skills/refactor-safely/SKILL.md +29 -0
- package/.agent/frontend/skills/vuexy-component-guide/SKILL.md +369 -0
- package/.agent/frontend/skills/vuexy-component-guide/examples.md +662 -0
- package/.agent/frontend/skills/vuexy-component-guide/reference.md +1036 -0
- package/.agent/frontend/workflows/build-feature-react.workflow.md +82 -0
- package/.agent/frontend/workflows/feature-module-runner.md +101 -0
- package/.agent/monolith/skills/architect/SKILL.md +648 -0
- package/.agent/monolith/skills/auth-and-permissions/SKILL.md +43 -0
- package/.agent/monolith/skills/code-reviewer/SKILL.md +281 -0
- package/.agent/monolith/skills/create-blueprint/SKILL.md +635 -0
- package/.agent/monolith/skills/debug-issue/SKILL.md +28 -0
- package/.agent/monolith/skills/explore-codebase/SKILL.md +29 -0
- package/.agent/monolith/skills/feature-workflow/SKILL.md +61 -0
- package/.agent/monolith/skills/react-quality-review/SKILL.md +126 -0
- package/.agent/monolith/skills/react-quality-review/examples.md +24 -0
- package/.agent/monolith/skills/react-quality-review/rules/_sections.md +26 -0
- package/.agent/monolith/skills/react-quality-review/rules/_template.md +28 -0
- package/.agent/monolith/skills/react-quality-review/rules/advanced-event-handler-refs.md +55 -0
- package/.agent/monolith/skills/react-quality-review/rules/advanced-init-once.md +42 -0
- package/.agent/monolith/skills/react-quality-review/rules/react-rules-calling.md +66 -0
- package/.agent/monolith/skills/react-quality-review/rules/react-rules-hooks.md +91 -0
- package/.agent/monolith/skills/react-quality-review/rules/react-rules-purity.md +121 -0
- package/.agent/monolith/skills/react-quality-review/rules/rendering-activity.md +26 -0
- package/.agent/monolith/skills/react-quality-review/rules/rendering-conditional-render.md +40 -0
- package/.agent/monolith/skills/react-quality-review/rules/rendering-content-visibility.md +38 -0
- package/.agent/monolith/skills/react-quality-review/rules/rendering-hoist-jsx.md +46 -0
- package/.agent/monolith/skills/react-quality-review/rules/rendering-usetransition-loading.md +75 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-defer-reads.md +39 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-dependencies.md +45 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-derived-state-no-effect.md +40 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-derived-state.md +29 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-functional-setstate.md +74 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-lazy-state-init.md +58 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-memo-with-default-value.md +38 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-memo.md +44 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-move-effect-to-event.md +45 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-no-inline-components.md +82 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-simple-expression-in-memo.md +35 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-transitions.md +40 -0
- package/.agent/monolith/skills/react-quality-review/rules/rerender-use-ref-transient-values.md +73 -0
- package/.agent/monolith/skills/refactor-safely/SKILL.md +29 -0
- package/.agent/monolith/skills/vuexy-component-guide/SKILL.md +369 -0
- package/.agent/monolith/skills/vuexy-component-guide/examples.md +662 -0
- package/.agent/monolith/skills/vuexy-component-guide/reference.md +1036 -0
- package/.agent/monolith/workflows/add-new-api-feature-module.md +63 -0
- package/.agent/monolith/workflows/backend-quality-review.md +27 -0
- package/.agent/monolith/workflows/build-feature-backend.workflow.md +91 -0
- package/.agent/monolith/workflows/build-feature-react.workflow.md +82 -0
- package/.agent/monolith/workflows/feature-module-runner.md +97 -0
- package/.agent/templates/FEATURE_PLAN.md +42 -0
- package/.agent/templates/MODULE.md +45 -0
- package/.agent/templates/REVIEW_REPORT.md +44 -0
- package/.agent/templates/SECURITY_REPORT.md +70 -0
- package/.agent/templates/TEST_PLAN.md +49 -0
- package/README.md +131 -0
- package/package.json +42 -0
- package/scripts/setup-rules.js +224 -0
- package/scripts/setup.js +518 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<!-- nurosys-agents — global instructions wired into CLAUDE.md / AGENTS.md / GEMINI.md -->
|
|
2
|
+
|
|
3
|
+
# nurosys-agents — Working Rules
|
|
4
|
+
|
|
5
|
+
This file is wired into your IDE (Claude Code, Cursor, Codex, Antigravity) by `npm exec nurosys-agent-setup`. It tells the agent how to use the skills and the Serena MCP that ship with this package.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## MCP Tools: Serena (symbolic code analysis)
|
|
10
|
+
|
|
11
|
+
**IMPORTANT: This project uses Serena for symbol-level code intelligence. ALWAYS prefer Serena's symbolic tools over Grep / Glob / raw Read for exploring code.** Symbol-level navigation is faster, cheaper in tokens, and gives you structural context (callers, references, definitions) that raw file scanning cannot.
|
|
12
|
+
|
|
13
|
+
Serena docs: https://github.com/oraios/serena
|
|
14
|
+
|
|
15
|
+
### When to use Serena FIRST
|
|
16
|
+
|
|
17
|
+
- **Exploring code** — `get_symbols_overview` on a file or directory before reading anything
|
|
18
|
+
- **Finding a function/class/method by name** — `find_symbol(name_path="...", include_body=false)`
|
|
19
|
+
- **Reading a single symbol** — `find_symbol(name_path="...", include_body=true)` instead of reading the whole file
|
|
20
|
+
- **Impact analysis / who depends on this?** — `find_referencing_symbols(name_path="...", relative_path="...")`
|
|
21
|
+
- **Refactors** — `rename_symbol`, `replace_symbol_body`, `safe_delete_symbol`, `insert_after_symbol`, `insert_before_symbol`
|
|
22
|
+
- **Prior-session notes** — `list_memories` then `read_memory` for project-specific context Serena has accumulated
|
|
23
|
+
|
|
24
|
+
Fall back to `Grep` / `Glob` / `Read` only when the question is genuinely not symbolic (e.g. searching configs, migrations, markdown).
|
|
25
|
+
|
|
26
|
+
### Key Serena tools
|
|
27
|
+
|
|
28
|
+
| Tool | Use when |
|
|
29
|
+
|------|----------|
|
|
30
|
+
| `get_symbols_overview` | First look at a file or directory — see what's there without reading bodies |
|
|
31
|
+
| `find_symbol` | Locate or read a specific symbol (class, function, method) |
|
|
32
|
+
| `find_referencing_symbols` | Find every caller / reference site of a symbol |
|
|
33
|
+
| `rename_symbol` | Rename a symbol + all references in one call |
|
|
34
|
+
| `replace_symbol_body` | Replace a function/method body symbolically |
|
|
35
|
+
| `safe_delete_symbol` | Delete a symbol after verifying no remaining references |
|
|
36
|
+
| `replace_content` | Regex/string replace for non-symbol edits (small in-line changes) |
|
|
37
|
+
| `list_memories` / `read_memory` | Project-specific notes from prior sessions |
|
|
38
|
+
|
|
39
|
+
### Token efficiency targets
|
|
40
|
+
|
|
41
|
+
- For exploration: ≤5 Serena calls
|
|
42
|
+
- For code review: ≤8 Serena calls
|
|
43
|
+
- For refactors: ≤6 Serena calls (locate + impact + edit + verify)
|
|
44
|
+
- For debugging: ≤6 Serena calls (entry + body + callers + callees + verify)
|
|
45
|
+
|
|
46
|
+
If you exceed these, narrow scope or escalate to one targeted `Read`. Don't fan out across the whole repo.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Skills shipped by this package
|
|
51
|
+
|
|
52
|
+
Slash commands (Claude Code, Cursor) or natural-language triggers:
|
|
53
|
+
|
|
54
|
+
| Skill | Purpose |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `/create-blueprint` | Bootstrap `project-memory/` — run FIRST on a new project |
|
|
57
|
+
| `/brainstorm` | Explore 3-5 distinct approaches to a problem (no code) |
|
|
58
|
+
| `/architect` | Plan a multi-module feature (pure planner, NEVER writes code) |
|
|
59
|
+
| `/module-runner` | Autonomously execute an architected feature, module by module |
|
|
60
|
+
| `/code-reviewer` | Review changed code against constitution + quality playbook |
|
|
61
|
+
| `/security-assessment` | Standalone security audit (auth, input, injection, deps, data exposure) |
|
|
62
|
+
| `/auth-and-permissions` | Audit a change against the project's documented auth model |
|
|
63
|
+
| `/quick-execute` | Fast execution for small tasks (no planning gate) |
|
|
64
|
+
| `/explore-codebase` | Navigate and understand the codebase symbolically |
|
|
65
|
+
| `/refactor-safely` | Symbol-level refactors with bounded blast radius |
|
|
66
|
+
| `/debug-issue` | Systematically trace a bug from its stack trace |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## The end-to-end developer journey
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
1. /create-blueprint all → seeds project-memory/
|
|
74
|
+
2. /brainstorm <problem> → explore approaches
|
|
75
|
+
3. /architect <chosen approach> → plan, modules, approval gate
|
|
76
|
+
4. /module-runner <feature-folder>→ autonomous build, review, security, commit per module
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Quick utilities usable anywhere:
|
|
80
|
+
- `/quick-execute <small task>` for one-off fixes
|
|
81
|
+
- `/code-reviewer` to manually review the current branch
|
|
82
|
+
- `/security-assessment diff` for a targeted security pass
|
package/.agent/README.md
ADDED
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
# Agent Skills & Workflows
|
|
2
|
+
|
|
3
|
+
This folder contains reusable agent skills and workflows for building, reviewing, and maintaining your codebase with Claude. All skills reference your project's `project-memory/` documentation as the single source of truth for architectural decisions, patterns, and constraints.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Skills
|
|
8
|
+
|
|
9
|
+
Skills are specialized tools you can invoke in Claude Code. Use them by typing `/skill-name` in the chat (e.g., `/code-reviewer`).
|
|
10
|
+
|
|
11
|
+
### Core Skills
|
|
12
|
+
|
|
13
|
+
#### 1. **code-reviewer** — Full-stack code review
|
|
14
|
+
**What it does**: Audits all uncommitted or branch-level changes against your project's constitution, quality playbook, auth model, and architecture.
|
|
15
|
+
|
|
16
|
+
**When to use**: After implementing a feature or fixing a bug, before merging.
|
|
17
|
+
|
|
18
|
+
**How it works**:
|
|
19
|
+
1. Uses code-review-graph to analyze changed files and impact radius
|
|
20
|
+
2. Loads all project-memory docs (constitution, auth-model, repo-map, etc.)
|
|
21
|
+
3. Reviews code against 11 checklist categories (security, validation, DI, etc.)
|
|
22
|
+
4. Generates a structured REVIEW_REPORT with blockers, highs, mediums, and suggestions
|
|
23
|
+
5. Reports recommendation: APPROVE / APPROVE WITH CONDITIONS / REQUEST CHANGES
|
|
24
|
+
|
|
25
|
+
**Example**:
|
|
26
|
+
```
|
|
27
|
+
/code-reviewer
|
|
28
|
+
```
|
|
29
|
+
Output: `documentation/reports/REVIEW_REPORT_<feature>_<milestone>.md`
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
#### 2. **architect** — Design multi-module feature implementation
|
|
34
|
+
**What it does**: Decomposes a feature or system change into logically independent modules with clear dependencies, then generates implementation prompts for autonomous execution.
|
|
35
|
+
|
|
36
|
+
**When to use**: Starting a new feature that spans multiple modules or requires architectural decisions.
|
|
37
|
+
|
|
38
|
+
**How it works**:
|
|
39
|
+
1. Phase 1: Research existing architecture using code-review-graph tools
|
|
40
|
+
2. Phase 2: Decompose the feature into self-contained, independently deployable modules
|
|
41
|
+
3. Phase 3: Determine implementation order based on dependencies
|
|
42
|
+
4. Phase 4: Generate a master plan (`_MODULE_WISE_PLAN.md`) and ask for user approval
|
|
43
|
+
5. Phase 5: Generate per-module implementation prompts (`_MODULE_<N>_<NAME>.md`)
|
|
44
|
+
|
|
45
|
+
**Example**:
|
|
46
|
+
```
|
|
47
|
+
/architect
|
|
48
|
+
|
|
49
|
+
User: "design a new feature for user invitations with team management"
|
|
50
|
+
|
|
51
|
+
Output:
|
|
52
|
+
documentation/features/user_invitations/user_invitations_MODULE_WISE_PLAN.md
|
|
53
|
+
documentation/features/user_invitations/user_invitations_MODULE_1_INVITE_FLOW.md
|
|
54
|
+
documentation/features/user_invitations/user_invitations_MODULE_2_TEAM_MANAGEMENT.md
|
|
55
|
+
...
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
#### 3. **create-blueprint** — Create/update project-memory artifacts
|
|
61
|
+
**What it does**: Generates or refreshes project-memory documentation (constitution, auth-model, repo-map, core-memory, models, architecture, quality-playbook) to keep them in sync with your codebase.
|
|
62
|
+
|
|
63
|
+
**When to use**: Setting up project-memory for the first time, or after major codebase changes to refresh documentation.
|
|
64
|
+
|
|
65
|
+
**How it works**:
|
|
66
|
+
1. Phase 1: Parse intent (create vs update, which artifact type)
|
|
67
|
+
2. Phase 2: Analyze codebase with code-review-graph tools (≤8 calls, minimal detail)
|
|
68
|
+
3. Phase 3: Read only relevant files the graph identified
|
|
69
|
+
4. Phase 4: Generate artifact from standard template
|
|
70
|
+
5. Phase 5: Compare with existing (if update), preserve manual decisions
|
|
71
|
+
6. Phase 6: Present changes to user for approval
|
|
72
|
+
7. Phase 7: Write to `project-memory/` and set up symlinks
|
|
73
|
+
8. Phase 7.3: Ensure `scripts/run-feature-modules.sh` symlink exists
|
|
74
|
+
|
|
75
|
+
**Example**:
|
|
76
|
+
```
|
|
77
|
+
/create-blueprint
|
|
78
|
+
|
|
79
|
+
User: "create-blueprint auth-model"
|
|
80
|
+
|
|
81
|
+
Output:
|
|
82
|
+
project-memory/auth-model.md (created)
|
|
83
|
+
.claude/docs/auth-model.md (symlink created)
|
|
84
|
+
.cursor/docs/auth-model.md (symlink created)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
#### 4. **auth-and-permissions** — Auth/authorization guardrails
|
|
90
|
+
**What it does**: Audits backend auth/authorization changes against your project's auth model invariants and review checklists.
|
|
91
|
+
|
|
92
|
+
**When to use**: Adding or modifying endpoints, guards, middleware, or auth-sensitive service logic.
|
|
93
|
+
|
|
94
|
+
**How it works**:
|
|
95
|
+
1. Reads your `project-memory/auth-model.md` to understand the guard chain and RBAC structure
|
|
96
|
+
2. Maps endpoint security explicitly (auth mechanism, required permissions, ownership checks)
|
|
97
|
+
3. Validates input surfaces and permission decorators
|
|
98
|
+
4. Checks request-context propagation
|
|
99
|
+
5. Enforces minimal, explicit fixes with file locations
|
|
100
|
+
|
|
101
|
+
**Checklist**:
|
|
102
|
+
- [ ] Endpoint auth decision is explicit (protected/public)
|
|
103
|
+
- [ ] `@CanPermissions` present for protected business actions
|
|
104
|
+
- [ ] Service/query layer enforces ownership/tenant scope
|
|
105
|
+
- [ ] Auth-sensitive inputs validated at controller boundary
|
|
106
|
+
- [ ] No controller-level assumption that guard alone authorizes mutations
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
#### 5. **explore-codebase** — Fast codebase navigation
|
|
111
|
+
**What it does**: Quickly searches and explores code using the code-review-graph, finding functions, classes, files, and relationships without reading entire codebase.
|
|
112
|
+
|
|
113
|
+
**When to use**: Answering "where is X?", "who calls Y?", "what imports Z?" questions.
|
|
114
|
+
|
|
115
|
+
**How it works**:
|
|
116
|
+
1. Uses semantic_search_nodes for name/keyword matching
|
|
117
|
+
2. Uses query_graph patterns (callers_of, callees_of, imports_of, tests_for)
|
|
118
|
+
3. Returns relevant code locations without loading full files
|
|
119
|
+
4. Traverses the graph to show relationships and dependencies
|
|
120
|
+
|
|
121
|
+
**Example**:
|
|
122
|
+
```
|
|
123
|
+
/explore-codebase
|
|
124
|
+
|
|
125
|
+
User: "find all services that handle authentication"
|
|
126
|
+
Output: List of auth-related services with file locations and brief context
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
#### 6. **debug-issue** — Structured issue diagnosis
|
|
132
|
+
**What it does**: Systematically diagnoses bugs and issues by analyzing code flow, tracing root causes, and suggesting fixes.
|
|
133
|
+
|
|
134
|
+
**When to use**: When something is broken or behaving unexpectedly.
|
|
135
|
+
|
|
136
|
+
**How it works**:
|
|
137
|
+
1. Phase 1: Understand the symptom and get the error/failure description
|
|
138
|
+
2. Phase 2: Trace execution flow using code-review-graph (query callers, callees)
|
|
139
|
+
3. Phase 3: Identify root cause by reading relevant files
|
|
140
|
+
4. Phase 4: Propose minimal fix with exact file locations and line numbers
|
|
141
|
+
5. Phase 5: Verify fix and test
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
#### 7. **refactor-safely** — Code refactoring with impact analysis
|
|
146
|
+
**What it does**: Plans and executes refactors (renames, dead code removal, restructuring) with blast-radius awareness and automated safety checks.
|
|
147
|
+
|
|
148
|
+
**When to use**: Renaming functions/classes, removing dead code, restructuring modules, or cleaning up code debt.
|
|
149
|
+
|
|
150
|
+
**How it works**:
|
|
151
|
+
1. Phase 1: Use code-review-graph to find all references (callers, imports, tests)
|
|
152
|
+
2. Phase 2: Generate a refactor preview showing all affected files
|
|
153
|
+
3. Phase 3: Test the refactor in isolated changes
|
|
154
|
+
4. Phase 4: Apply the refactor with verification
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Workflows
|
|
159
|
+
|
|
160
|
+
Workflows are semi-autonomous processes that combine multiple skills and structured steps. They guide you through complex tasks.
|
|
161
|
+
|
|
162
|
+
### Available Workflows
|
|
163
|
+
|
|
164
|
+
#### 1. **build-feature-backend.workflow.md** — End-to-end feature implementation
|
|
165
|
+
**What it does**: Orchestrates the complete lifecycle of implementing a backend feature from design to merge.
|
|
166
|
+
|
|
167
|
+
**When to use**: Starting a new feature that needs full cycle support (plan → implement → test → review → merge).
|
|
168
|
+
|
|
169
|
+
**Phases**:
|
|
170
|
+
1. **Plan** — Use `/architect` to design modules
|
|
171
|
+
2. **Implement** — Use `feature-module-runner` to execute per-module implementation
|
|
172
|
+
3. **Test** — Write and run tests for each module
|
|
173
|
+
4. **Review** — Use `/code-reviewer` for full code review
|
|
174
|
+
5. **Fix** — Address review findings
|
|
175
|
+
6. **Merge** — Prepare for merge (update docs, feature flags, deployment)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
#### 2. **feature-module-runner.md** — Sequential module implementation
|
|
180
|
+
**What it does**: Autonomously implements all modules in a feature sequentially, running implement → test → review → fix cycles for each.
|
|
181
|
+
|
|
182
|
+
**When to use**: After `/architect` generates module prompts. Executes the entire feature build automatically.
|
|
183
|
+
|
|
184
|
+
**How it works**:
|
|
185
|
+
1. Reads the feature folder and loads per-module implementation prompts
|
|
186
|
+
2. For each module (in dependency order):
|
|
187
|
+
- Implement the module
|
|
188
|
+
- Run tests
|
|
189
|
+
- Generate a feature plan
|
|
190
|
+
- Self-approve the plan
|
|
191
|
+
- Run full tests (`npm run build && npm test`)
|
|
192
|
+
- Generate a code review
|
|
193
|
+
- Fix any issues found
|
|
194
|
+
- Update `project-memory/core-memory.md` with module progress
|
|
195
|
+
3. Complete when all modules are done
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
#### 3. **backend-quality-review.md** — Post-implementation quality gate
|
|
200
|
+
**What it does**: Runs a full backend quality gate after implementation is complete, before merge.
|
|
201
|
+
|
|
202
|
+
**When to use**: End of implementation phase, when ready to merge.
|
|
203
|
+
|
|
204
|
+
**How it works**:
|
|
205
|
+
1. Delegates to `/code-reviewer` skill for full structured review
|
|
206
|
+
2. Generates REVIEW_REPORT with all findings
|
|
207
|
+
3. Reports recommendation
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
#### 4. **add-new-api-feature-module.md** — Single API feature module template
|
|
212
|
+
**What it does**: Provides structured scaffolding for implementing a single API feature module (controller, service, DTO, model, tests).
|
|
213
|
+
|
|
214
|
+
**When to use**: Implementing a single module of an API feature in isolation.
|
|
215
|
+
|
|
216
|
+
**How it works**:
|
|
217
|
+
1. Defines required files and structure per your repo-map
|
|
218
|
+
2. Provides step-by-step implementation guidance
|
|
219
|
+
3. Ensures all patterns (validation, auth, error handling) are followed
|
|
220
|
+
4. Includes testing strategy
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Architecture
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
User runs skill (e.g., /code-reviewer)
|
|
228
|
+
↓
|
|
229
|
+
Skill loads project-memory/ docs (single source of truth)
|
|
230
|
+
↓
|
|
231
|
+
Skill uses code-review-graph MCP tools for efficient analysis
|
|
232
|
+
↓
|
|
233
|
+
Skill reads only relevant files (targeted, not exhaustive)
|
|
234
|
+
↓
|
|
235
|
+
Skill generates report/artifact/implementation
|
|
236
|
+
↓
|
|
237
|
+
User reviews and approves changes
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Project-Memory (Single Source of Truth)
|
|
241
|
+
|
|
242
|
+
Your project-memory folder contains:
|
|
243
|
+
- **constitution.md** — Non-negotiable rules (security, validation, DI, auth, SQL, logging)
|
|
244
|
+
- **auth-model.md** — JWT flow, guard chain, RBAC, identity propagation, tenant scoping
|
|
245
|
+
- **repo-map.md** — Module layout, naming conventions, reusable components, entry points
|
|
246
|
+
- **core-memory.md** — Historical decisions, completed modules, design lessons, patterns
|
|
247
|
+
- **models.md** — Domain model inventory (entities, associations, constraints)
|
|
248
|
+
- **architecture.md** — System layers, module topology, data flow, integration points
|
|
249
|
+
- **quality-playbook.md** — High-signal patterns, anti-patterns, preferred fixes
|
|
250
|
+
|
|
251
|
+
All skills reference these docs to make decisions. If docs are missing or stale, run:
|
|
252
|
+
```bash
|
|
253
|
+
/create-blueprint <artifact-type>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Quick Start
|
|
259
|
+
|
|
260
|
+
### 1. Set up project-memory (first time only)
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
/create-blueprint constitution
|
|
264
|
+
/create-blueprint auth-model
|
|
265
|
+
/create-blueprint repo-map
|
|
266
|
+
/create-blueprint models
|
|
267
|
+
/create-blueprint architecture
|
|
268
|
+
/create-blueprint core-memory
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Edit each file to match your actual codebase. Use `/code-reviewer` to validate that your docs match reality.
|
|
272
|
+
|
|
273
|
+
### 2. Implement a new feature
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
/architect
|
|
277
|
+
|
|
278
|
+
# User: "design a new user invitation feature"
|
|
279
|
+
# Architect generates: user_invitations_MODULE_WISE_PLAN.md + per-module prompts
|
|
280
|
+
|
|
281
|
+
# Approve the plan, then run:
|
|
282
|
+
feature-module-runner documentation/features/user_invitations/
|
|
283
|
+
|
|
284
|
+
# Automatically implements all modules, tests, reviews, and fixes
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### 3. Review changes before merging
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
/code-reviewer
|
|
291
|
+
|
|
292
|
+
# Generates: documentation/reports/REVIEW_REPORT_<feature>_<milestone>.md
|
|
293
|
+
# Reports: blockers, highs, mediums, lows + recommendation
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### 4. Add auth to an endpoint
|
|
297
|
+
|
|
298
|
+
Edit the endpoint, then:
|
|
299
|
+
```bash
|
|
300
|
+
/auth-and-permissions
|
|
301
|
+
|
|
302
|
+
# Checklist: guards, permissions, ownership checks, input validation
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### 5. Debug a failing test
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
/debug-issue
|
|
309
|
+
|
|
310
|
+
# User: "test is failing with 'tenant not found'"
|
|
311
|
+
# Debug traces flow, identifies root cause, suggests fix
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### 6. Rename a service safely
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
/refactor-safely
|
|
318
|
+
|
|
319
|
+
# User: "rename PaymentService to PaymentProcessingService"
|
|
320
|
+
# Refactor shows all 47 places it's used, applies rename, runs tests
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## How This Integrates with Your IDE
|
|
326
|
+
|
|
327
|
+
### Claude Code (Claude.ai)
|
|
328
|
+
- Skills are available as `/skill-name` (e.g., `/code-reviewer`)
|
|
329
|
+
- Workflows are referenced in skill documentation
|
|
330
|
+
- You approve changes before they're written to disk
|
|
331
|
+
|
|
332
|
+
### VSCode & JetBrains (via extensions)
|
|
333
|
+
- Same skills available
|
|
334
|
+
- Extension shows skill suggestions based on context
|
|
335
|
+
- Symlinks in `.claude/skills/` make skills discoverable
|
|
336
|
+
|
|
337
|
+
### Cursor
|
|
338
|
+
- Skills available as `/skill-name` (just like Claude Code)
|
|
339
|
+
- Symlinks in `.cursor/agents/` make skills discoverable
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Common Workflows by Task
|
|
344
|
+
|
|
345
|
+
### "I'm starting a new feature"
|
|
346
|
+
```
|
|
347
|
+
1. /architect (design modules)
|
|
348
|
+
2. Approve the plan
|
|
349
|
+
3. feature-module-runner (auto-implement all modules)
|
|
350
|
+
4. /code-reviewer (review changes)
|
|
351
|
+
5. Address findings
|
|
352
|
+
6. Merge!
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### "I need to review my changes"
|
|
356
|
+
```
|
|
357
|
+
1. /code-reviewer (full audit)
|
|
358
|
+
2. Fix blockers/highs
|
|
359
|
+
3. Address mediums
|
|
360
|
+
4. Merge!
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### "Something is broken"
|
|
364
|
+
```
|
|
365
|
+
1. /debug-issue (diagnose root cause)
|
|
366
|
+
2. Implement fix
|
|
367
|
+
3. /code-reviewer (review fix)
|
|
368
|
+
4. Merge!
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
### "I need to refactor something"
|
|
372
|
+
```
|
|
373
|
+
1. /refactor-safely (preview impact)
|
|
374
|
+
2. Apply refactor
|
|
375
|
+
3. npm run build && npm test (verify)
|
|
376
|
+
4. /code-reviewer (review refactor)
|
|
377
|
+
5. Merge!
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### "My project-memory is out of date"
|
|
381
|
+
```
|
|
382
|
+
1. /create-blueprint <artifact-type> (auto-generate)
|
|
383
|
+
2. Review changes
|
|
384
|
+
3. Approve and write
|
|
385
|
+
4. Done! (Docs now match codebase)
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Best Practices
|
|
391
|
+
|
|
392
|
+
### 1. Keep project-memory current
|
|
393
|
+
- After each completed feature, run `feature-module-runner` which auto-updates `core-memory.md`
|
|
394
|
+
- Every 2–3 weeks, run `/create-blueprint repo-map` to refresh module inventory
|
|
395
|
+
- When auth patterns change, run `/create-blueprint auth-model`
|
|
396
|
+
|
|
397
|
+
### 2. Let code-review-graph do the heavy lifting
|
|
398
|
+
- Skills use graph tools first (get_minimal_context, semantic_search_nodes, query_graph)
|
|
399
|
+
- Graph analysis is fast (structural, not textual) and gives context
|
|
400
|
+
- Only relevant files are read, saving tokens and time
|
|
401
|
+
|
|
402
|
+
### 3. Use targeted skills for specific concerns
|
|
403
|
+
- Auth changes? Use `/auth-and-permissions`
|
|
404
|
+
- Renaming? Use `/refactor-safely`
|
|
405
|
+
- Debug? Use `/debug-issue`
|
|
406
|
+
- General review? Use `/code-reviewer`
|
|
407
|
+
|
|
408
|
+
### 4. Approve plans before implementation
|
|
409
|
+
- `/architect` stops after generating the master plan for user approval
|
|
410
|
+
- Don't skip the plan review — it catches architectural issues early
|
|
411
|
+
- Once approved, `feature-module-runner` executes autonomously
|
|
412
|
+
|
|
413
|
+
### 5. Make skills portable
|
|
414
|
+
- Skills are generic and portable across projects
|
|
415
|
+
- Each project has its own `project-memory/` docs
|
|
416
|
+
- If copying to another project, run `/create-blueprint <all artifact types>` to customize
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Architecture Decisions
|
|
421
|
+
|
|
422
|
+
### Why code-review-graph?
|
|
423
|
+
- **Faster**: Structural graph analysis beats file scanning
|
|
424
|
+
- **Cheaper**: Fewer tokens (minimal detail level by default)
|
|
425
|
+
- **Smarter**: Returns context (callers, tests, impact) that text search can't
|
|
426
|
+
|
|
427
|
+
### Why project-memory as single source of truth?
|
|
428
|
+
- **Authoritative**: If project-memory conflicts with code, code is wrong
|
|
429
|
+
- **Curated**: Only important patterns/decisions, not every detail
|
|
430
|
+
- **Actionable**: Team members can follow rules without asking questions
|
|
431
|
+
|
|
432
|
+
### Why modular feature implementation?
|
|
433
|
+
- **Independent deployability**: Each module ships without breaking existing code
|
|
434
|
+
- **Incremental value**: Each module delivers testable value
|
|
435
|
+
- **Parallel understanding**: Smaller modules are easier to review and test
|
|
436
|
+
- **Fault isolation**: A bug in module N doesn't block modules 1–N−1
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## Troubleshooting
|
|
441
|
+
|
|
442
|
+
### "Graph doesn't have results for my search"
|
|
443
|
+
→ Run `code-review-graph build_or_update_graph` to refresh the graph (usually automatic)
|
|
444
|
+
|
|
445
|
+
### "A skill is giving generic advice instead of project-specific guidance"
|
|
446
|
+
→ Update your `project-memory/` docs. Skills read them to make decisions. If docs are missing, skills fall back to generic patterns.
|
|
447
|
+
|
|
448
|
+
### "I want to customize a skill"
|
|
449
|
+
→ You shouldn't need to. Skills read `project-memory/` to adapt to your project. If a skill doesn't fit your architecture, update project-memory instead.
|
|
450
|
+
|
|
451
|
+
### "Can I share skills across projects?"
|
|
452
|
+
→ Yes! Skills are generic. Copy `.agent/skills/` and `.agent/workflows/` to another project. Each project has its own `project-memory/`.
|
|
453
|
+
|
|
454
|
+
---
|
|
455
|
+
|
|
456
|
+
## Manifest
|
|
457
|
+
|
|
458
|
+
| File | Purpose |
|
|
459
|
+
|------|---------|
|
|
460
|
+
| `.agent/INSTRUCTIONS.md` | Meta-instructions for all tools (code-review-graph, authentication, etc.) |
|
|
461
|
+
| `.agent/skills/architect/` | Design multi-module features |
|
|
462
|
+
| `.agent/skills/auth-and-permissions/` | Auth/authorization review |
|
|
463
|
+
| `.agent/skills/code-reviewer/` | Full code review |
|
|
464
|
+
| `.agent/skills/create-blueprint/` | Generate/update project-memory |
|
|
465
|
+
| `.agent/skills/debug-issue/` | Diagnose bugs |
|
|
466
|
+
| `.agent/skills/explore-codebase/` | Navigate code |
|
|
467
|
+
| `.agent/skills/refactor-safely/` | Refactor with impact analysis |
|
|
468
|
+
| `.agent/workflows/build-feature-backend.workflow.md` | End-to-end feature implementation |
|
|
469
|
+
| `.agent/workflows/feature-module-runner.md` | Auto-execute per-module implementations |
|
|
470
|
+
| `.agent/workflows/backend-quality-review.md` | Post-implementation quality gate |
|
|
471
|
+
| `.agent/workflows/add-new-api-feature-module.md` | Single API module template |
|
|
472
|
+
| `.agent/scripts/run-feature-modules.sh` | Script to execute feature modules |
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Next Steps
|
|
477
|
+
|
|
478
|
+
1. **Set up project-memory**: Run `/create-blueprint <artifact-type>` for each artifact
|
|
479
|
+
2. **Review against reality**: Use `/code-reviewer` on your current branch to validate docs match code
|
|
480
|
+
3. **Implement a feature**: Use `/architect` to design, then `feature-module-runner` to execute
|
|
481
|
+
4. **Keep docs fresh**: After each feature, run `/create-blueprint` on affected artifacts
|
|
482
|
+
5. **Share with team**: Copy this `.agent/` folder to other projects; each gets its own `project-memory/`
|
|
483
|
+
|