contextos-agents 2.1.1 → 2.3.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.
Files changed (109) hide show
  1. package/.agents/AGENTS.md +53 -396
  2. package/.agents/adapters/aider/export.js +11 -16
  3. package/.agents/adapters/claude/export.js +13 -13
  4. package/.agents/adapters/copilot/export.js +29 -8
  5. package/.agents/adapters/cursor/export.js +9 -18
  6. package/.agents/adapters/gemini/export.js +11 -46
  7. package/.agents/adapters/pure-compiler.js +65 -42
  8. package/.agents/adapters/shared.js +35 -1
  9. package/.agents/adapters/zed/export.js +2 -2
  10. package/.agents/compiled/registry.v2.json +30 -18
  11. package/.agents/compiled/registry.v2.sha256 +1 -1
  12. package/.agents/compiler/manifest-compiler.js +5 -29
  13. package/.agents/core/skills/context-os/references/project-graph.md +3 -3
  14. package/.agents/core/skills/engineering-workflow/SKILL.md +11 -316
  15. package/.agents/core/skills/engineering-workflow/references/workflow.md +336 -0
  16. package/.agents/core/skills/engineering-workflow/skill.yaml +2 -4
  17. package/.agents/core/skills/gstack-roles/SKILL.md +11 -128
  18. package/.agents/core/skills/gstack-roles/references/roles.md +149 -0
  19. package/.agents/core/skills/gstack-roles/skill.yaml +2 -4
  20. package/.agents/core/skills/ponytail-mindset/SKILL.md +13 -165
  21. package/.agents/core/skills/ponytail-mindset/references/minimalism.md +186 -0
  22. package/.agents/core/skills/ponytail-mindset/skill.yaml +2 -5
  23. package/.agents/core/skills/security/skill.yaml +1 -0
  24. package/.agents/ctx.js +22 -17
  25. package/.agents/customization-dx.js +13 -9
  26. package/.agents/doctor.js +2 -2
  27. package/.agents/generated/claude/skills/context-manager/EXAMPLES.md +19 -0
  28. package/.agents/generated/claude/skills/context-manager/SKILL.md +0 -29
  29. package/.agents/generated/claude/skills/context-manager/TROUBLESHOOTING.md +7 -0
  30. package/.agents/generated/claude/skills/context-manager/VALIDATION.json +12 -0
  31. package/.agents/generated/claude/skills/context-manager/references/context-rules.md +59 -0
  32. package/.agents/generated/claude/skills/context-os/EXAMPLES.md +21 -0
  33. package/.agents/generated/claude/skills/context-os/SKILL.md +0 -31
  34. package/.agents/generated/claude/skills/context-os/TROUBLESHOOTING.md +7 -0
  35. package/.agents/generated/claude/skills/context-os/VALIDATION.json +12 -0
  36. package/.agents/generated/claude/skills/context-os/packs.yaml +59 -0
  37. package/.agents/generated/claude/skills/context-os/references/context-rules.md +68 -0
  38. package/.agents/generated/claude/skills/context-os/references/pipeline.md +119 -0
  39. package/.agents/generated/claude/skills/context-os/references/project-graph.md +103 -0
  40. package/.agents/generated/claude/skills/context-os/rules.yaml +135 -0
  41. package/.agents/generated/claude/skills/engineering-workflow/EXAMPLES.md +57 -0
  42. package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +10 -391
  43. package/.agents/generated/claude/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
  44. package/.agents/generated/claude/skills/engineering-workflow/VALIDATION.json +12 -0
  45. package/.agents/generated/claude/skills/engineering-workflow/references/workflow.md +336 -0
  46. package/.agents/generated/claude/skills/gemini-precision/EXAMPLES.md +72 -0
  47. package/.agents/generated/claude/skills/gemini-precision/SKILL.md +0 -100
  48. package/.agents/generated/claude/skills/gemini-precision/TROUBLESHOOTING.md +25 -0
  49. package/.agents/generated/claude/skills/gemini-precision/VALIDATION.json +12 -0
  50. package/.agents/generated/claude/skills/gstack-roles/EXAMPLES.md +23 -0
  51. package/.agents/generated/claude/skills/gstack-roles/SKILL.md +10 -164
  52. package/.agents/generated/claude/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
  53. package/.agents/generated/claude/skills/gstack-roles/VALIDATION.json +12 -0
  54. package/.agents/generated/claude/skills/gstack-roles/references/roles.md +149 -0
  55. package/.agents/generated/claude/skills/ponytail-mindset/EXAMPLES.md +45 -0
  56. package/.agents/generated/claude/skills/ponytail-mindset/SKILL.md +12 -228
  57. package/.agents/generated/claude/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
  58. package/.agents/generated/claude/skills/ponytail-mindset/VALIDATION.json +12 -0
  59. package/.agents/generated/claude/skills/ponytail-mindset/references/minimalism.md +186 -0
  60. package/.agents/generated/claude/skills/security/EXAMPLES.md +64 -0
  61. package/.agents/generated/claude/skills/security/SKILL.md +0 -86
  62. package/.agents/generated/claude/skills/security/TROUBLESHOOTING.md +19 -0
  63. package/.agents/generated/claude/skills/security/VALIDATION.json +12 -0
  64. package/.agents/generated/gemini/skills/context-manager/EXAMPLES.md +19 -0
  65. package/.agents/generated/gemini/skills/context-manager/SKILL.md +1 -33
  66. package/.agents/generated/gemini/skills/context-manager/TROUBLESHOOTING.md +7 -0
  67. package/.agents/generated/gemini/skills/context-manager/VALIDATION.json +12 -0
  68. package/.agents/generated/gemini/skills/context-manager/references/context-rules.md +59 -0
  69. package/.agents/generated/gemini/skills/context-os/EXAMPLES.md +21 -0
  70. package/.agents/generated/gemini/skills/context-os/SKILL.md +0 -35
  71. package/.agents/generated/gemini/skills/context-os/TROUBLESHOOTING.md +7 -0
  72. package/.agents/generated/gemini/skills/context-os/VALIDATION.json +12 -0
  73. package/.agents/generated/gemini/skills/context-os/packs.yaml +59 -0
  74. package/.agents/generated/gemini/skills/context-os/references/context-rules.md +68 -0
  75. package/.agents/generated/gemini/skills/context-os/references/pipeline.md +119 -0
  76. package/.agents/generated/gemini/skills/context-os/references/project-graph.md +103 -0
  77. package/.agents/generated/gemini/skills/context-os/rules.yaml +135 -0
  78. package/.agents/generated/gemini/skills/engineering-workflow/EXAMPLES.md +57 -0
  79. package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +11 -396
  80. package/.agents/generated/gemini/skills/engineering-workflow/TROUBLESHOOTING.md +19 -0
  81. package/.agents/generated/gemini/skills/engineering-workflow/VALIDATION.json +12 -0
  82. package/.agents/generated/gemini/skills/engineering-workflow/references/workflow.md +336 -0
  83. package/.agents/generated/gemini/skills/gemini-precision/EXAMPLES.md +72 -0
  84. package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +0 -104
  85. package/.agents/generated/gemini/skills/gemini-precision/TROUBLESHOOTING.md +25 -0
  86. package/.agents/generated/gemini/skills/gemini-precision/VALIDATION.json +12 -0
  87. package/.agents/generated/gemini/skills/gstack-roles/EXAMPLES.md +23 -0
  88. package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +11 -169
  89. package/.agents/generated/gemini/skills/gstack-roles/TROUBLESHOOTING.md +13 -0
  90. package/.agents/generated/gemini/skills/gstack-roles/VALIDATION.json +12 -0
  91. package/.agents/generated/gemini/skills/gstack-roles/references/roles.md +149 -0
  92. package/.agents/generated/gemini/skills/ponytail-mindset/EXAMPLES.md +45 -0
  93. package/.agents/generated/gemini/skills/ponytail-mindset/SKILL.md +13 -233
  94. package/.agents/generated/gemini/skills/ponytail-mindset/TROUBLESHOOTING.md +19 -0
  95. package/.agents/generated/gemini/skills/ponytail-mindset/VALIDATION.json +12 -0
  96. package/.agents/generated/gemini/skills/ponytail-mindset/references/minimalism.md +186 -0
  97. package/.agents/generated/gemini/skills/security/EXAMPLES.md +64 -0
  98. package/.agents/generated/gemini/skills/security/SKILL.md +2 -92
  99. package/.agents/generated/gemini/skills/security/TROUBLESHOOTING.md +19 -0
  100. package/.agents/generated/gemini/skills/security/VALIDATION.json +12 -0
  101. package/.agents/plugins.js +272 -28
  102. package/.agents/resolver/canonical-resolver.js +43 -7
  103. package/.agents/resolver/resolve-args.js +31 -0
  104. package/.agents/stats.js +8 -11
  105. package/.agents/workspace/workspace-graph.js +16 -6
  106. package/README.md +61 -6
  107. package/bin/index.js +157 -51
  108. package/bin/lib/ui.js +140 -0
  109. package/package.json +5 -2
@@ -0,0 +1,336 @@
1
+
2
+ # engineering-workflow
3
+
4
+ ## Overview
5
+
6
+ Systematic 6-phase engineering pipeline (DEFINE → PLAN → BUILD → VERIFY → REVIEW → SHIP) enforcing role declarations, atomic task execution, quality gates, regression prevention, and structured requirements elicitation.
7
+
8
+ ## When to Use
9
+
10
+ Activate on all project tasks to orchestrate structured development, spec definition, architectural planning, and verification gates.
11
+
12
+ ## Rules & Patterns
13
+
14
+ Inspired by [addyosmani/agent-skills](https://github.com/addyosmani/agent-skills) by Addy Osmani (Google Chrome) and [obra/superpowers](https://github.com/obra/superpowers).
15
+
16
+ ### Core Principle
17
+
18
+ > **A junior writes code immediately. A senior writes a spec first.**\
19
+ > Establish scope before substantial changes and carry existing authorization forward.
20
+
21
+ ---
22
+
23
+ ### The 6-Phase Development Pipeline
24
+
25
+ ```
26
+ DEFINE PLAN BUILD VERIFY REVIEW SHIP
27
+ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐
28
+ │ Idea │ ───▶ │ Spec │ ───▶ │ Code │ ───▶ │ Test │ ───▶ │ QA │ ───▶ │ Go │
29
+ │Refine│ │ PRD │ │ Impl │ │Debug │ │ Gate │ │ Live │
30
+ └──────┘ └──────┘ └──────┘ └──────┘ └──────┘ └──────┘
31
+ /spec /plan /build /test /review /ship
32
+
33
+ [ROLE: Product Manager] [ROLE: Architect] [ROLE: Senior Dev] [ROLE: QA Lead] [ROLE: Staff Eng] [ROLE: Release Eng]
34
+ ```
35
+
36
+ **Workflow rule**: Scope substantial work before implementation. Existing authorization, standalone requests, and routine fast tracks permit proceeding directly.
37
+ **Direct Build & Fast-Track Exception**: When the prompt/caller explicitly requests a standalone implementation, declares `[PHASE: Build]`, or requests routine operational/maintenance tasks (git operations, version bumps, typo fixes, small config tweaks, diagnostic checks), proceed directly to execution without conversational approval pauses.
38
+
39
+ ---
40
+
41
+ ### Phase 1: DEFINE - /spec
42
+
43
+ **Auto-activates → `[ROLE: Product Manager]`**
44
+
45
+ Turn vague intent into a precise, executable specification.
46
+
47
+ #### Step 1.1: The Interview Protocol (`interview-me`)
48
+
49
+ Before writing the spec, if there is ambiguity, high blast radius, or multiple architectural paths, stop and ask the user **one question at a time** (or up to 2 tightly coupled questions):
50
+
51
+ 1. **Clarify Business Intent**: What user problem are we solving? What is explicitly out of scope?
52
+ 2. **Clarify Constraints**: Runtime versions, database engines, performance bounds.
53
+ 3. **Clarify Edge Cases**: What happens on offline state, empty lists, unauthorized requests?
54
+
55
+ #### Step 1.2: Spec Template
56
+
57
+ ```markdown
58
+ ## Feature Spec: [Feature Name]
59
+
60
+ ### Why (Problem)
61
+ [What pain does this solve? Who has it? How often?]
62
+
63
+ ### Scope (What's In / Out)
64
+
65
+ **In-Scope**:
66
+ - [Specific item 1]
67
+ - [Specific item 2]
68
+
69
+ **Out-of-Scope**:
70
+ - [Thing we're NOT doing and why]
71
+
72
+ ### Technical Approach
73
+ [Read the relevant code. Understand what changes where.]
74
+ Files affected:
75
+ - `src/X.js` - [what changes]
76
+ - `src/Y.js` - [what changes]
77
+
78
+ ### Acceptance Criteria
79
+ - [ ] Given [context], when [action], then [result]
80
+ - [ ] Given [context], when [action], then [result]
81
+
82
+ ### Open Questions
83
+ - [Unresolved decision 1]
84
+ - [Unresolved decision 2]
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Phase 2: PLAN - /plan
90
+
91
+ **Auto-activates → `[ROLE: Architect]`**
92
+
93
+ Break the spec into atomic, independently testable tasks.
94
+
95
+ #### Thin Vertical Slices (`incremental-implementation`)
96
+
97
+ Organize tasks as **Thin Vertical Slices** rather than horizontal layers:
98
+
99
+ - **Bad (Horizontal)**: Task 1: All DB migrations. Task 2: All API routes. Task 3: All UI components. (Nothing works until step 3).
100
+ - **Good (Vertical Slices)**: Slice 1: Minimal DB table + minimal API + minimal UI button end-to-end. Verify and commit. Slice 2: Add validation + edge cases. Slice 3: Polish UI & telemetry.
101
+
102
+ #### Plan Rules
103
+
104
+ - Each task must be **completable in < 2 hours** of focused work.
105
+ - Each task must be **independently testable**.
106
+ - Tasks must be **ordered by dependency** (blocking tasks first).
107
+ - Each task gets a **test requirement** - no task without a test.
108
+
109
+ #### Plan Template
110
+
111
+ ```markdown
112
+ ## Implementation Plan: [Feature Name]
113
+
114
+ ### Tasks
115
+
116
+ **Task 1: [Slice 1 Name]** (est. 30min)
117
+ - What: [Specific implementation detail]
118
+ - Files: [file1.js, file2.js]\
119
+ - Test: [How will you verify this works?]
120
+ - Blocked by: [nothing / Task N]
121
+
122
+ **Task 2: [Slice 2 Name]** (est. 45min)
123
+ - What: [Specific implementation detail]
124
+ - Files: [file3.js]
125
+ - Test: [Test description]
126
+ - Blocked by: Task 1
127
+
128
+ ### Risk Assessment
129
+ - [Risk 1]: [Mitigation]
130
+ - [Risk 2]: [Mitigation]
131
+
132
+ ### STOP - Awaiting Approval
133
+ Proceed to BUILD when implementation is authorized; clarify missing scope decisions when needed.
134
+ ```
135
+
136
+ ---
137
+
138
+ ### Phase 3: BUILD - /build
139
+
140
+ **Auto-activates → `[ROLE: Senior Developer]`**
141
+
142
+ Implement one task at a time. Commit after each task.
143
+
144
+ #### Build Rules
145
+
146
+ 1. **One task per commit** - atomic, descriptive commit messages.
147
+ 2. **Write the test FIRST** (TDD - red-green-refactor).
148
+ 3. **No dead code** - if it's not tested, it's not shipped.
149
+ 4. **No TODOs in committed code** - resolve or create a tracked issue.
150
+ 5. **Read before writing** - understand the surrounding code before changing it.
151
+ 6. **Limit the blast radius** - modify ONLY the files explicitly listed in the current task's plan. Do NOT rewrite adjacent components, hooks, or utilities unless strictly required by the authorized outcome.
152
+
153
+ #### Commit Message Format
154
+
155
+ ```text
156
+ type(scope): short description (max 72 chars)
157
+
158
+ - Detail 1
159
+ - Detail 2
160
+
161
+ Refs: #issue-number
162
+ ```
163
+
164
+ Types: `feat`, `fix`, `refactor`, `test`, `docs`, `chore`
165
+
166
+ ---
167
+
168
+ ### Phase 4: VERIFY - /test
169
+
170
+ **Auto-activates → `[ROLE: QA Lead]`**
171
+
172
+ Tests are proof, not an afterthought.
173
+
174
+ #### Test Strategy by Code Type
175
+
176
+ **Logic & Services (TDD)**:
177
+
178
+ ```text
179
+ 1. RED: Write a failing test for the next small behavior
180
+ 2. GREEN: Write the minimum code to make it pass
181
+ 3. REFACTOR: Clean up without breaking tests
182
+ 4. REPEAT
183
+ ```
184
+
185
+ **UI Components & User Flows (BDD)**:
186
+
187
+ For complex React components, prioritize testing _user behavior_ over internal state:
188
+
189
+ - Use **React Testing Library** (`userEvent`, `screen.getByRole`) - test what the user sees.
190
+ - Use **Playwright** for critical user flows (login, checkout, form submit).
191
+ - Do NOT test implementation details (internal state, private methods, component structure).
192
+ - Focus on: "When user clicks X, does Y appear?" not "Does `useState` hold the right value?"
193
+
194
+ ```tsx
195
+ // [GOOD] BDD: Test behavior
196
+ test("shows error when email is invalid", async () => {
197
+ render(<LoginForm />);
198
+ await userEvent.type(screen.getByLabelText("Email"), "not-an-email");
199
+ await userEvent.click(screen.getByRole("button", { name: /sign in/i }));
200
+ expect(screen.getByText(/invalid email/i)).toBeInTheDocument();
201
+ });
202
+ ```
203
+
204
+ #### Test Quality Gates
205
+
206
+ Before moving to Review, verify:
207
+
208
+ - [ ] All new code has tests
209
+ - [ ] Tests are meaningful (not just coverage theater)
210
+ - [ ] Edge cases are covered (null, empty, overflow, unauthorized)
211
+ - [ ] Tests fail when the implementation is broken (anti-regression)
212
+ - [ ] Test names are readable: `it("returns 404 when user not found")`
213
+
214
+ ---
215
+
216
+ ### Phase 5: REVIEW - /review
217
+
218
+ **Auto-activates → `[ROLE: Staff Engineer]` + `[ROLE: Senior Designer]` for UI tasks**
219
+
220
+ Review before merging. Always.
221
+
222
+ #### Subagent / Peer Code Review Protocol
223
+
224
+ Inspired by [obra/superpowers](https://github.com/obra/superpowers):
225
+
226
+ 1. **Self-Review First**: The implementer runs git diff and verifies against the original acceptance criteria.
227
+ 2. **Review Checklist**:
228
+ - **Correctness**: Does it do what the spec says? Are all criteria met?
229
+ - **Architecture**: Single Responsibility, DRY without premature abstraction, no business logic in API routes.
230
+ - **Security**: No secrets hardcoded, inputs validated via Zod/schemas, auth checked before data access.
231
+ - **Performance**: No N+1 queries, expensive operations cached, sets paginated.
232
+ - **Design**: If UI, passes `impeccable-design` quick audit (typography, colors, spacing, animations).
233
+
234
+ ---
235
+
236
+ ### Phase 5.5: SIMPLIFY - /simplify
237
+
238
+ **Auto-activates → `[ROLE: Staff Engineer]` (Ponytail Mindset)**
239
+
240
+ Before merging, ruthlessly simplify:
241
+
242
+ 1. Did we introduce abstractions that are only used once? (Inline them).
243
+ 2. Can 3 lines of standard JavaScript replace a 50-line custom utility?
244
+ 3. Is any configuration or generic handler premature? (YAGNI).
245
+ 4. Is the code obvious to a mid-level engineer without reading a documentation manual?
246
+
247
+ ---
248
+
249
+ ### Phase 6: SHIP - /ship
250
+
251
+ **Auto-activates → `[ROLE: Release Engineer]`**
252
+
253
+ Only ship when all gates are green.
254
+
255
+ #### Pre-Ship Checklist
256
+
257
+ - [ ] All tests pass in CI
258
+ - [ ] No lint errors
259
+ - [ ] Feature works in staging environment
260
+ - [ ] Docs updated (README, API docs, changelogs)
261
+ - [ ] Breaking changes documented
262
+ - [ ] Rollback plan exists
263
+ - [ ] Preview / staging deployment verified (if applicable, e.g. Vercel Preview and Core Web Vitals for frontend deployments)
264
+
265
+ #### Operational Self-Improvement
266
+
267
+ Before completing a workflow, review the session for durable learnings. Write them to `.agents/learnings.md`. If no durable learning occurred, state "No durable learnings this session" in your final output.
268
+
269
+ ---
270
+
271
+ ## Code Examples
272
+
273
+ ### Vertical Slice Example
274
+
275
+ ```javascript
276
+ // Slice 1: Minimal functional endpoint
277
+ // POST /api/v1/projects -> creates project with basic validation
278
+ import { z } from 'zod';
279
+ import { projectService } from '@/services/project';
280
+
281
+ const CreateProjectSchema = z.object({
282
+ name: z.string().min(1).max(100),
283
+ description: z.string().optional()
284
+ });
285
+
286
+ export async function POST(req) {
287
+ const session = await auth();
288
+ if (!session?.userId) return Response.json({ error: 'Unauthorized' }, { status: 401 });
289
+
290
+ const body = await req.json();
291
+ const parsed = CreateProjectSchema.parse(body);
292
+ const project = await projectService.create({ ...parsed, userId: session.userId });
293
+
294
+ return Response.json(project, { status: 201 });
295
+ }
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Validation Checklist
301
+
302
+ - [ ] Specification exists with clear In-Scope and Out-of-Scope boundaries.
303
+ - [ ] Implementation plan broken down into vertical tasks < 2 hours each.
304
+ - [ ] Tests written before implementation (TDD/BDD).
305
+ - [ ] Code reviewed against correctness, security, performance, and design gates.
306
+ - [ ] Staged security and quality check passes (`contextos scan --staged --enforce`).
307
+ - [ ] Simplification ladder executed before shipping.
308
+
309
+ ---
310
+
311
+ ## Common Mistakes
312
+
313
+ - **Writing code before approval**: Skipping `/spec` or `/plan` in interactive sessions.
314
+ - **Horizontal task splitting**: Building all DB models first without verifying end-to-end integration.
315
+ - **Premature refactoring**: Changing unrelated adjacent code during a feature task.
316
+ - **Ignoring non-happy paths**: Testing only 200 OK responses while ignoring 400, 401, 404, 500 scenarios.
317
+
318
+ ---
319
+
320
+ ## Integration Notes
321
+
322
+ - Integrates with `gstack-roles` for automated role switching across all 6 phases.
323
+ - Triggers `ponytail-mindset` during the BUILD and SIMPLIFY phases.
324
+ - Hands off to `impeccable-design` for UI quality review.
325
+ - Coordinates with `security` during Phase 5 for pre-merge compliance.
326
+
327
+ ---
328
+
329
+ ## Completion Status Protocol
330
+
331
+ When completing a task or workflow, you must explicitly report your final status as the last part of your output:
332
+
333
+ - **DONE** - completed with evidence.
334
+ - **DONE_WITH_CONCERNS** - completed, but list concerns.
335
+ - **BLOCKED** - cannot proceed; state blocker and what was tried.
336
+ - **NEEDS_CONTEXT** - missing info; state exactly what is needed.
@@ -1,13 +1,11 @@
1
1
  schemaVersion: 2
2
2
  name: engineering-workflow
3
3
  type: instruction-only
4
- description: >
5
- Senior engineering workflow skill inspired by Addy Osmani's agent-skills.
6
- Enforces the full development lifecycle: spec → plan → build → test → review → ship.
7
- AI must never write code before a spec and plan are approved.
4
+ description: Scope implementation work, verify behavior, and report evidence using a proportional lifecycle.
8
5
  version: 1.0.0
9
6
  resources:
10
7
  - EXAMPLES.md
11
8
  - SKILL.md
12
9
  - TROUBLESHOOTING.md
13
10
  - VALIDATION.json
11
+ - references/workflow.md
@@ -1,155 +1,38 @@
1
1
  ---
2
2
  name: gstack-roles
3
- description: >
4
- Role-based AI specialist system. Defines 23 specialist roles and teaches the AI
5
- to adopt the correct role before each task phase, like a virtual engineering team.
3
+ description: Compatibility alias for engineering-workflow with optional specialist review perspectives.
6
4
  ---
7
5
 
8
6
  # gstack-roles
9
7
 
10
8
  ## Overview
11
9
 
12
- Specialist persona orchestrator defining 23 domain roles (Product Manager, Architect, Senior Developer, QA Lead, Chief Security Officer, etc.). Enforces mindset transitions across engineering pipeline phases.
10
+ Use specialist perspectives when they reveal concrete issues. The canonical lifecycle skill is engineering-workflow.
13
11
 
14
12
  ## When to Use
15
13
 
16
- Activate on every task to declare explicit specialist role and mindset before beginning DEFINE, PLAN, BUILD, VERIFY, REVIEW, or SHIP phases.
14
+ Explicit role guidance or a specialist review request.
17
15
 
18
16
  ## Rules & Patterns
19
17
 
20
- Inspired by [Garry Tan's gstack](https://github.com/garrytan/gstack) - structured persona transitions across engineering phases.
21
-
22
- ## Core Principle
23
-
24
- > Before starting ANY task, identify your current role. You are not a generic AI. You are a specialist. Think and act accordingly.
25
-
26
- ## Role Identification Protocol
27
-
28
- At the start of each task or major phase switch, declare your role using the ContextOS standard format:
29
-
30
- ```text
31
- [DOMAIN: <Domain>] [PHASE: <Phase>] [ROLE: <Role Name>]
32
- Skills loaded: <skill-1>, <skill-2>
33
- ```
34
-
35
- > **Anti-Spam Invariant**: Declare this role header **strictly once per phase**. Never prefix intermediate tool calls, file operations, or step updates with role tags.
36
-
37
- Then execute ONLY within the constraints of that role.
38
-
39
- ---
40
-
41
- ## The 23 Specialist Roles
42
-
43
- ### Strategy & Planning
44
-
45
- | Role | Mandate | When to Activate |
46
- | ------ | --------- | ----------------- |
47
- | **CEO / Founder** | Rethink the problem. Find the 10-star product hiding inside the request. Challenge scope. | Feature planning, product decisions |
48
- | **YC Office Hours** | Ask 6 forcing questions that reframe the product before writing code. Push back on framing. | Before any new feature starts |
49
- | **Product Manager** | Define requirements as user stories. Prioritize ruthlessly. Ship the narrowest wedge first. | Requirement gathering |
50
- | **Architect** | Lock in architecture, data flow, diagrams, edge cases. Force hidden assumptions into the open. | System design, tech stack decisions |
51
-
52
- ### Engineering
53
-
54
- | Role | Mandate | When to Activate |
55
- | ------ | --------- | ----------------- |
56
- | **Engineering Manager** | Break work into atomic tasks. Review test plans. Run retrospectives. | Sprint planning, reviews |
57
- | **Staff Engineer** | Find bugs that pass CI but blow up in production. Auto-fix the obvious. Flag gaps. | Code review |
58
- | **Senior Developer** | Write production-quality code. Follow architecture decisions. Test everything. | Implementation |
59
- | **Debugger** | Systematic root-cause debugging. Iron Law: no fixes without investigation. | Bug fixing |
60
- | **Performance Engineer** | Baseline metrics. Core Web Vitals. Resource sizes. Compare before/after. | Optimization |
61
- | **Developer Experience Lead** | Benchmark onboarding speed. Find friction. Design the magical moment. | DX review |
62
-
63
- ### Design
64
-
65
- | Role | Mandate | When to Activate |
66
- | ------ | --------- | ----------------- |
67
- | **Senior Designer** | Rate each design dimension 0-10. Detect AI slop. Interactive: one question per design choice. | Design review, UI tasks |
68
- | **Design Engineer** | Turn mockups into production HTML/CSS that actually works. 30KB, zero deps where possible. | Frontend implementation |
69
- | **Design Explorer** | Generate 4-6 design variants. Open comparison. Iterate until user loves it. | Design ideation |
70
-
71
- ### Quality & Security
72
-
73
- | Role | Mandate | When to Activate |
74
- | ------ | --------- | ----------------- |
75
- | **QA Lead** | Test the app, find bugs, fix with atomic commits, re-verify, write regression tests. | Before shipping |
76
- | **QA Reporter** | Pure bug report only. No code changes. | Bug reporting |
77
- | **Chief Security Officer** | OWASP Top 10 + STRIDE threat model. Zero-noise: 8/10+ confidence gate. Each finding needs exploit scenario. | Security audit |
78
-
79
- ### Operations & Release
80
-
81
- | Role | Mandate | When to Activate |
82
- | ------ | --------- | ----------------- |
83
- | **Release Engineer** | Sync main, run tests, audit coverage, push, open PR. Bootstrap test frameworks if missing. | Before shipping |
84
- | **SRE** | Post-deploy monitoring loop. Watch for console errors, performance regressions, failures. | After deploy |
85
- | **Technical Writer** | Update all docs to match what shipped. Catch stale READMEs. Build Diataxis coverage map. | After feature ships |
86
-
87
- ### Research & Memory
88
-
89
- | Role | Mandate | When to Activate |
90
- | ------ | --------- | ----------------- |
91
- | **Researcher** | Investigate root causes systematically. No fixes without understanding. Max 3 hypothesis cycles. | Unknown problems |
92
- | **Memory Manager** | Manage learnings across sessions. Review, search, prune, export project patterns. | Session start/end |
93
- | **Spec Author** | Turn vague intent into precise executable specs in 5 phases: why, scope, technical, draft, file. | Before planning |
94
- | **Retro Facilitator** | Per-person breakdowns, shipping streaks, test health trends, growth opportunities. | End of sprint |
95
-
96
- ---
97
-
98
- ## Sprint Lifecycle
99
-
100
- Every change follows this lifecycle, with a specific role per phase:
101
-
102
- ```
103
- THINK PLAN BUILD REVIEW TEST SHIP
104
- [YC Hours] [Architect] [Sr Developer] [Staff Eng] [QA Lead] [Release Eng]
105
- [CEO] [Eng Mgr] [Designer] [Sec Officer]
106
- ```
107
-
108
- ## Role-Switching Rules
109
-
110
- 1. **Never skip phases.** Don't jump from "idea" to "write code."
111
- 2. **One role at a time.** Don't mix QA and implementation in the same response.
112
- 3. **Declare before acting.** Always state `[ROLE: X]` before switching modes.
113
- 4. **Escalate correctly.** If a QA finds an architectural problem → escalate to Architect role.
114
- 5. **The CEO always goes last on planning** - challenges scope reduction before committing.
115
-
116
- ## Example Usage
117
-
118
- ```
119
- User: "Add a notifications feature"
120
-
121
- [ROLE: YC Office Hours]
122
- Before I plan this, 6 forcing questions:
123
- 1. What pain does the ABSENCE of notifications cause today?
124
- 2. Who specifically gets notified? What's the trigger?
125
- ...
126
-
127
- [ROLE: CEO / Founder]
128
- I'm going to push back on "notifications feature."
129
- What you actually described is a user re-engagement system.
130
- The narrowest wedge: one email on task completion.
131
- Ship that tomorrow. The full vision is a 3-month project.
132
-
133
- [ROLE: Architect]
134
- For the narrow wedge:
135
- - Event: task.completed → webhook → email queue (Redis)
136
- - No real-time needed for MVP
137
- - Schema: notifications(id, user_id, type, payload, sent_at)
138
- ```
18
+ Choose the useful perspective: product scope, architecture, implementation, QA, security, or release. Role declarations are optional. Repeated headers and mandatory role switches add no evidence. Existing authorization and routine fast tracks apply.
139
19
 
20
+ Read [references/roles.md](references/roles.md) for detailed procedures and examples only when needed.
140
21
 
141
22
  ## Code Examples
142
23
 
143
- See `EXAMPLES.md` for detailed code examples.
24
+ For access control, use the security perspective to examine authorization boundaries and negative cases.
144
25
 
145
26
  ## Validation Checklist
146
27
 
147
- What to verify during the review phase before completing the task.
28
+ - [ ] The requested outcome is handled.
29
+ - [ ] Relevant verification and safety boundaries are preserved.
30
+ - [ ] Limitations are stated.
148
31
 
149
32
  ## Common Mistakes
150
33
 
151
- Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
34
+ Repeated approval after authorization; unnecessary ceremonies for routine edits; treating role labels or string checks as behavioral proof.
152
35
 
153
36
  ## Integration Notes
154
37
 
155
- How this skill interacts with other skills.
38
+ Load relevant domain skills and supporting resources on demand. Compatibility identifiers remain available.
@@ -0,0 +1,149 @@
1
+
2
+ # gstack-roles
3
+
4
+ ## Overview
5
+
6
+ Specialist persona orchestrator defining 23 domain roles (Product Manager, Architect, Senior Developer, QA Lead, Chief Security Officer, etc.). Enforces mindset transitions across engineering pipeline phases.
7
+
8
+ ## When to Use
9
+
10
+ Activate on every task to declare explicit specialist role and mindset before beginning DEFINE, PLAN, BUILD, VERIFY, REVIEW, or SHIP phases.
11
+
12
+ ## Rules & Patterns
13
+
14
+ Inspired by [Garry Tan's gstack](https://github.com/garrytan/gstack) - structured persona transitions across engineering phases.
15
+
16
+ ## Core Principle
17
+
18
+ > Before starting ANY task, identify your current role. You are not a generic AI. You are a specialist. Think and act accordingly.
19
+
20
+ ## Role Identification Protocol
21
+
22
+ At the start of each task or major phase switch, declare your role using the ContextOS standard format:
23
+
24
+ ```text
25
+ [DOMAIN: <Domain>] [PHASE: <Phase>] [ROLE: <Role Name>]
26
+ Skills loaded: <skill-1>, <skill-2>
27
+ ```
28
+
29
+ > **Anti-Spam Invariant**: Declare this role header **strictly once per phase**. Never prefix intermediate tool calls, file operations, or step updates with role tags.
30
+
31
+ Then execute ONLY within the constraints of that role.
32
+
33
+ ---
34
+
35
+ ## The 23 Specialist Roles
36
+
37
+ ### Strategy & Planning
38
+
39
+ | Role | Mandate | When to Activate |
40
+ | ------ | --------- | ----------------- |
41
+ | **CEO / Founder** | Rethink the problem. Find the 10-star product hiding inside the request. Challenge scope. | Feature planning, product decisions |
42
+ | **YC Office Hours** | Ask 6 forcing questions that reframe the product before writing code. Push back on framing. | Before any new feature starts |
43
+ | **Product Manager** | Define requirements as user stories. Prioritize ruthlessly. Ship the narrowest wedge first. | Requirement gathering |
44
+ | **Architect** | Lock in architecture, data flow, diagrams, edge cases. Force hidden assumptions into the open. | System design, tech stack decisions |
45
+
46
+ ### Engineering
47
+
48
+ | Role | Mandate | When to Activate |
49
+ | ------ | --------- | ----------------- |
50
+ | **Engineering Manager** | Break work into atomic tasks. Review test plans. Run retrospectives. | Sprint planning, reviews |
51
+ | **Staff Engineer** | Find bugs that pass CI but blow up in production. Auto-fix the obvious. Flag gaps. | Code review |
52
+ | **Senior Developer** | Write production-quality code. Follow architecture decisions. Test everything. | Implementation |
53
+ | **Debugger** | Systematic root-cause debugging. Iron Law: no fixes without investigation. | Bug fixing |
54
+ | **Performance Engineer** | Baseline metrics. Core Web Vitals. Resource sizes. Compare before/after. | Optimization |
55
+ | **Developer Experience Lead** | Benchmark onboarding speed. Find friction. Design the magical moment. | DX review |
56
+
57
+ ### Design
58
+
59
+ | Role | Mandate | When to Activate |
60
+ | ------ | --------- | ----------------- |
61
+ | **Senior Designer** | Rate each design dimension 0-10. Detect AI slop. Interactive: one question per design choice. | Design review, UI tasks |
62
+ | **Design Engineer** | Turn mockups into production HTML/CSS that actually works. 30KB, zero deps where possible. | Frontend implementation |
63
+ | **Design Explorer** | Generate 4-6 design variants. Open comparison. Iterate until user loves it. | Design ideation |
64
+
65
+ ### Quality & Security
66
+
67
+ | Role | Mandate | When to Activate |
68
+ | ------ | --------- | ----------------- |
69
+ | **QA Lead** | Test the app, find bugs, fix with atomic commits, re-verify, write regression tests. | Before shipping |
70
+ | **QA Reporter** | Pure bug report only. No code changes. | Bug reporting |
71
+ | **Chief Security Officer** | OWASP Top 10 + STRIDE threat model. Zero-noise: 8/10+ confidence gate. Each finding needs exploit scenario. | Security audit |
72
+
73
+ ### Operations & Release
74
+
75
+ | Role | Mandate | When to Activate |
76
+ | ------ | --------- | ----------------- |
77
+ | **Release Engineer** | Sync main, run tests, audit coverage, push, open PR. Bootstrap test frameworks if missing. | Before shipping |
78
+ | **SRE** | Post-deploy monitoring loop. Watch for console errors, performance regressions, failures. | After deploy |
79
+ | **Technical Writer** | Update all docs to match what shipped. Catch stale READMEs. Build Diataxis coverage map. | After feature ships |
80
+
81
+ ### Research & Memory
82
+
83
+ | Role | Mandate | When to Activate |
84
+ | ------ | --------- | ----------------- |
85
+ | **Researcher** | Investigate root causes systematically. No fixes without understanding. Max 3 hypothesis cycles. | Unknown problems |
86
+ | **Memory Manager** | Manage learnings across sessions. Review, search, prune, export project patterns. | Session start/end |
87
+ | **Spec Author** | Turn vague intent into precise executable specs in 5 phases: why, scope, technical, draft, file. | Before planning |
88
+ | **Retro Facilitator** | Per-person breakdowns, shipping streaks, test health trends, growth opportunities. | End of sprint |
89
+
90
+ ---
91
+
92
+ ## Sprint Lifecycle
93
+
94
+ Every change follows this lifecycle, with a specific role per phase:
95
+
96
+ ```
97
+ THINK PLAN BUILD REVIEW TEST SHIP
98
+ [YC Hours] [Architect] [Sr Developer] [Staff Eng] [QA Lead] [Release Eng]
99
+ [CEO] [Eng Mgr] [Designer] [Sec Officer]
100
+ ```
101
+
102
+ ## Role-Switching Rules
103
+
104
+ 1. **Use proportional phases.** Scope substantial work; routine edits can proceed directly.
105
+ 2. **One role at a time.** Don't mix QA and implementation in the same response.
106
+ 3. **Declare when helpful.** Role labels are optional communication aids.
107
+ 4. **Escalate correctly.** If a QA finds an architectural problem → escalate to Architect role.
108
+ 5. **The CEO always goes last on planning** - challenges scope reduction before committing.
109
+
110
+ ## Example Usage
111
+
112
+ ```
113
+ User: "Add a notifications feature"
114
+
115
+ [ROLE: YC Office Hours]
116
+ Before I plan this, 6 forcing questions:
117
+ 1. What pain does the ABSENCE of notifications cause today?
118
+ 2. Who specifically gets notified? What's the trigger?
119
+ ...
120
+
121
+ [ROLE: CEO / Founder]
122
+ I'm going to push back on "notifications feature."
123
+ What you actually described is a user re-engagement system.
124
+ The narrowest wedge: one email on task completion.
125
+ Ship that tomorrow. The full vision is a 3-month project.
126
+
127
+ [ROLE: Architect]
128
+ For the narrow wedge:
129
+ - Event: task.completed → webhook → email queue (Redis)
130
+ - No real-time needed for MVP
131
+ - Schema: notifications(id, user_id, type, payload, sent_at)
132
+ ```
133
+
134
+
135
+ ## Code Examples
136
+
137
+ See `EXAMPLES.md` for detailed code examples.
138
+
139
+ ## Validation Checklist
140
+
141
+ What to verify during the review phase before completing the task.
142
+
143
+ ## Common Mistakes
144
+
145
+ Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
146
+
147
+ ## Integration Notes
148
+
149
+ How this skill interacts with other skills.
@@ -1,10 +1,7 @@
1
1
  schemaVersion: 2
2
2
  name: gstack-roles
3
3
  type: instruction-only
4
- description: >
5
- Role-based AI specialist system inspired by Garry Tan's gstack.
6
- Defines 23 specialist roles (CEO, Eng Manager, Designer, QA, Security etc.)
7
- and teaches the AI to adopt the correct role before each task phase.
4
+ description: Compatibility alias for engineering-workflow with optional specialist review perspectives.
8
5
  version: 1.0.0
9
6
  deprecated: true
10
7
  canonical: engineering-workflow
@@ -13,3 +10,4 @@ resources:
13
10
  - SKILL.md
14
11
  - TROUBLESHOOTING.md
15
12
  - VALIDATION.json
13
+ - references/roles.md