red64-cli 0.1.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/README.md +454 -0
- package/dist/cli/parseArgs.d.ts +16 -0
- package/dist/cli/parseArgs.d.ts.map +1 -0
- package/dist/cli/parseArgs.js +172 -0
- package/dist/cli/parseArgs.js.map +1 -0
- package/dist/cli/validateFlags.d.ts +22 -0
- package/dist/cli/validateFlags.d.ts.map +1 -0
- package/dist/cli/validateFlags.js +24 -0
- package/dist/cli/validateFlags.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +90 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/App.d.ts +20 -0
- package/dist/components/App.d.ts.map +1 -0
- package/dist/components/App.js +35 -0
- package/dist/components/App.js.map +1 -0
- package/dist/components/CommandRouter.d.ts +21 -0
- package/dist/components/CommandRouter.d.ts.map +1 -0
- package/dist/components/CommandRouter.js +30 -0
- package/dist/components/CommandRouter.js.map +1 -0
- package/dist/components/GlobalConfig.d.ts +26 -0
- package/dist/components/GlobalConfig.d.ts.map +1 -0
- package/dist/components/GlobalConfig.js +30 -0
- package/dist/components/GlobalConfig.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/init/CompleteStep.d.ts +11 -0
- package/dist/components/init/CompleteStep.d.ts.map +1 -0
- package/dist/components/init/CompleteStep.js +15 -0
- package/dist/components/init/CompleteStep.js.map +1 -0
- package/dist/components/init/ErrorStep.d.ts +14 -0
- package/dist/components/init/ErrorStep.d.ts.map +1 -0
- package/dist/components/init/ErrorStep.js +36 -0
- package/dist/components/init/ErrorStep.js.map +1 -0
- package/dist/components/init/FetchStep.d.ts +15 -0
- package/dist/components/init/FetchStep.d.ts.map +1 -0
- package/dist/components/init/FetchStep.js +33 -0
- package/dist/components/init/FetchStep.js.map +1 -0
- package/dist/components/init/SetupStep.d.ts +14 -0
- package/dist/components/init/SetupStep.d.ts.map +1 -0
- package/dist/components/init/SetupStep.js +78 -0
- package/dist/components/init/SetupStep.js.map +1 -0
- package/dist/components/init/SteeringStep.d.ts +12 -0
- package/dist/components/init/SteeringStep.d.ts.map +1 -0
- package/dist/components/init/SteeringStep.js +43 -0
- package/dist/components/init/SteeringStep.js.map +1 -0
- package/dist/components/init/WelcomeStep.d.ts +12 -0
- package/dist/components/init/WelcomeStep.d.ts.map +1 -0
- package/dist/components/init/WelcomeStep.js +52 -0
- package/dist/components/init/WelcomeStep.js.map +1 -0
- package/dist/components/init/index.d.ts +11 -0
- package/dist/components/init/index.d.ts.map +1 -0
- package/dist/components/init/index.js +10 -0
- package/dist/components/init/index.js.map +1 -0
- package/dist/components/init/types.d.ts +98 -0
- package/dist/components/init/types.d.ts.map +1 -0
- package/dist/components/init/types.js +6 -0
- package/dist/components/init/types.js.map +1 -0
- package/dist/components/screens/AbortScreen.d.ts +14 -0
- package/dist/components/screens/AbortScreen.d.ts.map +1 -0
- package/dist/components/screens/AbortScreen.js +181 -0
- package/dist/components/screens/AbortScreen.js.map +1 -0
- package/dist/components/screens/ApprovalScreen.d.ts +24 -0
- package/dist/components/screens/ApprovalScreen.d.ts.map +1 -0
- package/dist/components/screens/ApprovalScreen.js +82 -0
- package/dist/components/screens/ApprovalScreen.js.map +1 -0
- package/dist/components/screens/HelpScreen.d.ts +20 -0
- package/dist/components/screens/HelpScreen.d.ts.map +1 -0
- package/dist/components/screens/HelpScreen.js +70 -0
- package/dist/components/screens/HelpScreen.js.map +1 -0
- package/dist/components/screens/InitScreen.d.ts +15 -0
- package/dist/components/screens/InitScreen.d.ts.map +1 -0
- package/dist/components/screens/InitScreen.js +420 -0
- package/dist/components/screens/InitScreen.js.map +1 -0
- package/dist/components/screens/ListScreen.d.ts +14 -0
- package/dist/components/screens/ListScreen.d.ts.map +1 -0
- package/dist/components/screens/ListScreen.js +57 -0
- package/dist/components/screens/ListScreen.js.map +1 -0
- package/dist/components/screens/ProgressScreen.d.ts +26 -0
- package/dist/components/screens/ProgressScreen.d.ts.map +1 -0
- package/dist/components/screens/ProgressScreen.js +64 -0
- package/dist/components/screens/ProgressScreen.js.map +1 -0
- package/dist/components/screens/ResumeScreen.d.ts +14 -0
- package/dist/components/screens/ResumeScreen.d.ts.map +1 -0
- package/dist/components/screens/ResumeScreen.js +108 -0
- package/dist/components/screens/ResumeScreen.js.map +1 -0
- package/dist/components/screens/ScreenProps.d.ts +12 -0
- package/dist/components/screens/ScreenProps.d.ts.map +1 -0
- package/dist/components/screens/ScreenProps.js +5 -0
- package/dist/components/screens/ScreenProps.js.map +1 -0
- package/dist/components/screens/StartScreen.d.ts +26 -0
- package/dist/components/screens/StartScreen.d.ts.map +1 -0
- package/dist/components/screens/StartScreen.js +1021 -0
- package/dist/components/screens/StartScreen.js.map +1 -0
- package/dist/components/screens/StatusScreen.d.ts +14 -0
- package/dist/components/screens/StatusScreen.d.ts.map +1 -0
- package/dist/components/screens/StatusScreen.js +115 -0
- package/dist/components/screens/StatusScreen.js.map +1 -0
- package/dist/components/screens/index.d.ts +15 -0
- package/dist/components/screens/index.d.ts.map +1 -0
- package/dist/components/screens/index.js +12 -0
- package/dist/components/screens/index.js.map +1 -0
- package/dist/components/ui/ErrorBoundary.d.ts +34 -0
- package/dist/components/ui/ErrorBoundary.d.ts.map +1 -0
- package/dist/components/ui/ErrorBoundary.js +37 -0
- package/dist/components/ui/ErrorBoundary.js.map +1 -0
- package/dist/components/ui/ErrorDisplay.d.ts +20 -0
- package/dist/components/ui/ErrorDisplay.d.ts.map +1 -0
- package/dist/components/ui/ErrorDisplay.js +12 -0
- package/dist/components/ui/ErrorDisplay.js.map +1 -0
- package/dist/components/ui/ErrorRecoveryPrompt.d.ts +30 -0
- package/dist/components/ui/ErrorRecoveryPrompt.d.ts.map +1 -0
- package/dist/components/ui/ErrorRecoveryPrompt.js +66 -0
- package/dist/components/ui/ErrorRecoveryPrompt.js.map +1 -0
- package/dist/components/ui/FeatureSidebar.d.ts +27 -0
- package/dist/components/ui/FeatureSidebar.d.ts.map +1 -0
- package/dist/components/ui/FeatureSidebar.js +166 -0
- package/dist/components/ui/FeatureSidebar.js.map +1 -0
- package/dist/components/ui/FlowTable.d.ts +21 -0
- package/dist/components/ui/FlowTable.d.ts.map +1 -0
- package/dist/components/ui/FlowTable.js +105 -0
- package/dist/components/ui/FlowTable.js.map +1 -0
- package/dist/components/ui/Header.d.ts +20 -0
- package/dist/components/ui/Header.d.ts.map +1 -0
- package/dist/components/ui/Header.js +11 -0
- package/dist/components/ui/Header.js.map +1 -0
- package/dist/components/ui/OutputRegion.d.ts +20 -0
- package/dist/components/ui/OutputRegion.d.ts.map +1 -0
- package/dist/components/ui/OutputRegion.js +14 -0
- package/dist/components/ui/OutputRegion.js.map +1 -0
- package/dist/components/ui/PhaseProgressView.d.ts +23 -0
- package/dist/components/ui/PhaseProgressView.d.ts.map +1 -0
- package/dist/components/ui/PhaseProgressView.js +117 -0
- package/dist/components/ui/PhaseProgressView.js.map +1 -0
- package/dist/components/ui/ProgressBar.d.ts +20 -0
- package/dist/components/ui/ProgressBar.d.ts.map +1 -0
- package/dist/components/ui/ProgressBar.js +12 -0
- package/dist/components/ui/ProgressBar.js.map +1 -0
- package/dist/components/ui/SelectMenu.d.ts +27 -0
- package/dist/components/ui/SelectMenu.d.ts.map +1 -0
- package/dist/components/ui/SelectMenu.js +21 -0
- package/dist/components/ui/SelectMenu.js.map +1 -0
- package/dist/components/ui/Spinner.d.ts +18 -0
- package/dist/components/ui/Spinner.d.ts.map +1 -0
- package/dist/components/ui/Spinner.js +10 -0
- package/dist/components/ui/Spinner.js.map +1 -0
- package/dist/components/ui/StatusLine.d.ts +21 -0
- package/dist/components/ui/StatusLine.d.ts.map +1 -0
- package/dist/components/ui/StatusLine.js +30 -0
- package/dist/components/ui/StatusLine.js.map +1 -0
- package/dist/components/ui/index.d.ts +16 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +16 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/services/AgentInvoker.d.ts +20 -0
- package/dist/services/AgentInvoker.d.ts.map +1 -0
- package/dist/services/AgentInvoker.js +282 -0
- package/dist/services/AgentInvoker.js.map +1 -0
- package/dist/services/BranchService.d.ts +28 -0
- package/dist/services/BranchService.d.ts.map +1 -0
- package/dist/services/BranchService.js +114 -0
- package/dist/services/BranchService.js.map +1 -0
- package/dist/services/CacheService.d.ts +57 -0
- package/dist/services/CacheService.d.ts.map +1 -0
- package/dist/services/CacheService.js +208 -0
- package/dist/services/CacheService.js.map +1 -0
- package/dist/services/ClaudeErrorDetector.d.ts +45 -0
- package/dist/services/ClaudeErrorDetector.d.ts.map +1 -0
- package/dist/services/ClaudeErrorDetector.js +207 -0
- package/dist/services/ClaudeErrorDetector.js.map +1 -0
- package/dist/services/ClaudeHealthCheck.d.ts +37 -0
- package/dist/services/ClaudeHealthCheck.d.ts.map +1 -0
- package/dist/services/ClaudeHealthCheck.js +197 -0
- package/dist/services/ClaudeHealthCheck.js.map +1 -0
- package/dist/services/CommitService.d.ts +36 -0
- package/dist/services/CommitService.d.ts.map +1 -0
- package/dist/services/CommitService.js +159 -0
- package/dist/services/CommitService.js.map +1 -0
- package/dist/services/ConfigService.d.ts +49 -0
- package/dist/services/ConfigService.d.ts.map +1 -0
- package/dist/services/ConfigService.js +57 -0
- package/dist/services/ConfigService.js.map +1 -0
- package/dist/services/DockerRunner.d.ts +45 -0
- package/dist/services/DockerRunner.d.ts.map +1 -0
- package/dist/services/DockerRunner.js +170 -0
- package/dist/services/DockerRunner.js.map +1 -0
- package/dist/services/ExtendedFlowStateMachine.d.ts +31 -0
- package/dist/services/ExtendedFlowStateMachine.d.ts.map +1 -0
- package/dist/services/ExtendedFlowStateMachine.js +302 -0
- package/dist/services/ExtendedFlowStateMachine.js.map +1 -0
- package/dist/services/FeatureValidator.d.ts +26 -0
- package/dist/services/FeatureValidator.d.ts.map +1 -0
- package/dist/services/FeatureValidator.js +48 -0
- package/dist/services/FeatureValidator.js.map +1 -0
- package/dist/services/FlowStateMachine.d.ts +26 -0
- package/dist/services/FlowStateMachine.d.ts.map +1 -0
- package/dist/services/FlowStateMachine.js +177 -0
- package/dist/services/FlowStateMachine.js.map +1 -0
- package/dist/services/GitHubService.d.ts +72 -0
- package/dist/services/GitHubService.d.ts.map +1 -0
- package/dist/services/GitHubService.js +150 -0
- package/dist/services/GitHubService.js.map +1 -0
- package/dist/services/GitStatusChecker.d.ts +29 -0
- package/dist/services/GitStatusChecker.d.ts.map +1 -0
- package/dist/services/GitStatusChecker.js +127 -0
- package/dist/services/GitStatusChecker.js.map +1 -0
- package/dist/services/PRCreatorService.d.ts +59 -0
- package/dist/services/PRCreatorService.d.ts.map +1 -0
- package/dist/services/PRCreatorService.js +212 -0
- package/dist/services/PRCreatorService.js.map +1 -0
- package/dist/services/PRStatusFetcher.d.ts +39 -0
- package/dist/services/PRStatusFetcher.d.ts.map +1 -0
- package/dist/services/PRStatusFetcher.js +144 -0
- package/dist/services/PRStatusFetcher.js.map +1 -0
- package/dist/services/PhaseExecutor.d.ts +29 -0
- package/dist/services/PhaseExecutor.d.ts.map +1 -0
- package/dist/services/PhaseExecutor.js +125 -0
- package/dist/services/PhaseExecutor.js.map +1 -0
- package/dist/services/SpecInitService.d.ts +33 -0
- package/dist/services/SpecInitService.d.ts.map +1 -0
- package/dist/services/SpecInitService.js +168 -0
- package/dist/services/SpecInitService.js.map +1 -0
- package/dist/services/StateStore.d.ts +24 -0
- package/dist/services/StateStore.d.ts.map +1 -0
- package/dist/services/StateStore.js +171 -0
- package/dist/services/StateStore.js.map +1 -0
- package/dist/services/TaskParser.d.ts +44 -0
- package/dist/services/TaskParser.d.ts.map +1 -0
- package/dist/services/TaskParser.js +167 -0
- package/dist/services/TaskParser.js.map +1 -0
- package/dist/services/TaskRunner.d.ts +52 -0
- package/dist/services/TaskRunner.d.ts.map +1 -0
- package/dist/services/TaskRunner.js +135 -0
- package/dist/services/TaskRunner.js.map +1 -0
- package/dist/services/TemplateService.d.ts +73 -0
- package/dist/services/TemplateService.d.ts.map +1 -0
- package/dist/services/TemplateService.js +263 -0
- package/dist/services/TemplateService.js.map +1 -0
- package/dist/services/WorktreeService.d.ts +51 -0
- package/dist/services/WorktreeService.d.ts.map +1 -0
- package/dist/services/WorktreeService.js +204 -0
- package/dist/services/WorktreeService.js.map +1 -0
- package/dist/services/index.d.ts +25 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +25 -0
- package/dist/services/index.js.map +1 -0
- package/dist/types/extended-flow.d.ts +167 -0
- package/dist/types/extended-flow.d.ts.map +1 -0
- package/dist/types/extended-flow.js +103 -0
- package/dist/types/extended-flow.js.map +1 -0
- package/dist/types/index.d.ts +210 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +28 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/git.d.ts +41 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +68 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/paths.d.ts +30 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +43 -0
- package/dist/utils/paths.js.map +1 -0
- package/framework/.red64/settings/rules/design-discovery-full.md +93 -0
- package/framework/.red64/settings/rules/design-discovery-light.md +49 -0
- package/framework/.red64/settings/rules/design-principles.md +182 -0
- package/framework/.red64/settings/rules/design-review.md +110 -0
- package/framework/.red64/settings/rules/ears-format.md +49 -0
- package/framework/.red64/settings/rules/gap-analysis.md +144 -0
- package/framework/.red64/settings/rules/steering-principles.md +90 -0
- package/framework/.red64/settings/rules/tasks-generation.md +131 -0
- package/framework/.red64/settings/rules/tasks-parallel-analysis.md +34 -0
- package/framework/.red64/settings/templates/flow-state.json +48 -0
- package/framework/.red64/settings/templates/specs/design.md +276 -0
- package/framework/.red64/settings/templates/specs/init.json +24 -0
- package/framework/.red64/settings/templates/specs/requirements-init.md +9 -0
- package/framework/.red64/settings/templates/specs/requirements.md +26 -0
- package/framework/.red64/settings/templates/specs/research.md +61 -0
- package/framework/.red64/settings/templates/specs/tasks.md +21 -0
- package/framework/.red64/settings/templates/steering/product.md +18 -0
- package/framework/.red64/settings/templates/steering/structure.md +41 -0
- package/framework/.red64/settings/templates/steering/tech.md +45 -0
- package/framework/.red64/settings/templates/steering-custom/api-standards.md +69 -0
- package/framework/.red64/settings/templates/steering-custom/authentication.md +67 -0
- package/framework/.red64/settings/templates/steering-custom/database.md +46 -0
- package/framework/.red64/settings/templates/steering-custom/deployment.md +54 -0
- package/framework/.red64/settings/templates/steering-custom/error-handling.md +59 -0
- package/framework/.red64/settings/templates/steering-custom/security.md +55 -0
- package/framework/.red64/settings/templates/steering-custom/testing.md +47 -0
- package/framework/agents/claude/.claude/agents/red64/spec-design.md +174 -0
- package/framework/agents/claude/.claude/agents/red64/spec-impl.md +120 -0
- package/framework/agents/claude/.claude/agents/red64/spec-requirements.md +102 -0
- package/framework/agents/claude/.claude/agents/red64/spec-tasks.md +141 -0
- package/framework/agents/claude/.claude/agents/red64/steering-custom.md +147 -0
- package/framework/agents/claude/.claude/agents/red64/steering.md +163 -0
- package/framework/agents/claude/.claude/agents/red64/validate-design.md +98 -0
- package/framework/agents/claude/.claude/agents/red64/validate-gap.md +99 -0
- package/framework/agents/claude/.claude/agents/red64/validate-impl.md +146 -0
- package/framework/agents/claude/.claude/commands/red64/spec-design.md +64 -0
- package/framework/agents/claude/.claude/commands/red64/spec-impl.md +68 -0
- package/framework/agents/claude/.claude/commands/red64/spec-init.md +65 -0
- package/framework/agents/claude/.claude/commands/red64/spec-quick.md +360 -0
- package/framework/agents/claude/.claude/commands/red64/spec-requirements.md +62 -0
- package/framework/agents/claude/.claude/commands/red64/spec-status.md +87 -0
- package/framework/agents/claude/.claude/commands/red64/spec-tasks.md +75 -0
- package/framework/agents/claude/.claude/commands/red64/steering-custom.md +59 -0
- package/framework/agents/claude/.claude/commands/red64/steering.md +62 -0
- package/framework/agents/claude/.claude/commands/red64/validate-design.md +59 -0
- package/framework/agents/claude/.claude/commands/red64/validate-gap.md +53 -0
- package/framework/agents/claude/.claude/commands/red64/validate-impl.md +68 -0
- package/framework/agents/claude/docs/CLAUDE.md +45 -0
- package/framework/agents/codex/.codex/agents/red64/spec-design.md +174 -0
- package/framework/agents/codex/.codex/agents/red64/spec-impl.md +120 -0
- package/framework/agents/codex/.codex/agents/red64/spec-requirements.md +102 -0
- package/framework/agents/codex/.codex/agents/red64/spec-tasks.md +141 -0
- package/framework/agents/codex/.codex/agents/red64/steering-custom.md +147 -0
- package/framework/agents/codex/.codex/agents/red64/steering.md +163 -0
- package/framework/agents/codex/.codex/agents/red64/validate-design.md +98 -0
- package/framework/agents/codex/.codex/agents/red64/validate-gap.md +99 -0
- package/framework/agents/codex/.codex/agents/red64/validate-impl.md +146 -0
- package/framework/agents/codex/.codex/commands/red64/spec-design.md +64 -0
- package/framework/agents/codex/.codex/commands/red64/spec-impl.md +68 -0
- package/framework/agents/codex/.codex/commands/red64/spec-init.md +65 -0
- package/framework/agents/codex/.codex/commands/red64/spec-quick.md +360 -0
- package/framework/agents/codex/.codex/commands/red64/spec-requirements.md +62 -0
- package/framework/agents/codex/.codex/commands/red64/spec-status.md +87 -0
- package/framework/agents/codex/.codex/commands/red64/spec-tasks.md +75 -0
- package/framework/agents/codex/.codex/commands/red64/steering-custom.md +59 -0
- package/framework/agents/codex/.codex/commands/red64/steering.md +62 -0
- package/framework/agents/codex/.codex/commands/red64/validate-design.md +59 -0
- package/framework/agents/codex/.codex/commands/red64/validate-gap.md +53 -0
- package/framework/agents/codex/.codex/commands/red64/validate-impl.md +68 -0
- package/framework/agents/codex/docs/AGENTS.md +68 -0
- package/framework/agents/gemini/commands.toml +607 -0
- package/framework/agents/gemini/docs/GEMINI.md +45 -0
- package/framework/stacks/generic/product.md +27 -0
- package/framework/stacks/generic/structure.md +46 -0
- package/framework/stacks/generic/tech.md +47 -0
- package/framework/stacks/node/product.md +27 -0
- package/framework/stacks/node/structure.md +82 -0
- package/framework/stacks/node/tech.md +63 -0
- package/framework/stacks/python/product.md +27 -0
- package/framework/stacks/python/structure.md +78 -0
- package/framework/stacks/python/tech.md +64 -0
- package/framework/stacks/react/product.md +27 -0
- package/framework/stacks/react/structure.md +76 -0
- package/framework/stacks/react/tech.md +65 -0
- package/package.json +47 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Project Structure
|
|
2
|
+
|
|
3
|
+
## Organization Philosophy
|
|
4
|
+
|
|
5
|
+
[Describe approach: feature-first, layered, domain-driven, etc.]
|
|
6
|
+
|
|
7
|
+
## Directory Patterns
|
|
8
|
+
|
|
9
|
+
### [Pattern Name]
|
|
10
|
+
**Location**: `/path/`
|
|
11
|
+
**Purpose**: [What belongs here]
|
|
12
|
+
**Example**: [Brief example]
|
|
13
|
+
|
|
14
|
+
### [Pattern Name]
|
|
15
|
+
**Location**: `/path/`
|
|
16
|
+
**Purpose**: [What belongs here]
|
|
17
|
+
**Example**: [Brief example]
|
|
18
|
+
|
|
19
|
+
## Naming Conventions
|
|
20
|
+
|
|
21
|
+
- **Files**: [Pattern, e.g., PascalCase, kebab-case]
|
|
22
|
+
- **Components**: [Pattern]
|
|
23
|
+
- **Functions**: [Pattern]
|
|
24
|
+
|
|
25
|
+
## Import Organization
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// Example import patterns
|
|
29
|
+
import { Something } from '@/path' // Absolute
|
|
30
|
+
import { Local } from './local' // Relative
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Path Aliases**:
|
|
34
|
+
- `@/`: [Maps to]
|
|
35
|
+
|
|
36
|
+
## Code Organization Principles
|
|
37
|
+
|
|
38
|
+
[Key architectural patterns and dependency rules]
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
_Document patterns, not file trees. New files following patterns shouldn't require updates_
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Technology Stack
|
|
2
|
+
|
|
3
|
+
## Architecture
|
|
4
|
+
|
|
5
|
+
[High-level system design approach]
|
|
6
|
+
|
|
7
|
+
## Core Technologies
|
|
8
|
+
|
|
9
|
+
- **Language**: [e.g., TypeScript, Python]
|
|
10
|
+
- **Framework**: [e.g., React, Next.js, Django]
|
|
11
|
+
- **Runtime**: [e.g., Node.js 20+]
|
|
12
|
+
|
|
13
|
+
## Key Libraries
|
|
14
|
+
|
|
15
|
+
[Only major libraries that influence development patterns]
|
|
16
|
+
|
|
17
|
+
## Development Standards
|
|
18
|
+
|
|
19
|
+
### Type Safety
|
|
20
|
+
[e.g., TypeScript strict mode, no `any`]
|
|
21
|
+
|
|
22
|
+
### Code Quality
|
|
23
|
+
[e.g., ESLint, Prettier rules]
|
|
24
|
+
|
|
25
|
+
### Testing
|
|
26
|
+
[e.g., Jest, coverage requirements]
|
|
27
|
+
|
|
28
|
+
## Development Environment
|
|
29
|
+
|
|
30
|
+
### Required Tools
|
|
31
|
+
[Key tools and version requirements]
|
|
32
|
+
|
|
33
|
+
### Common Commands
|
|
34
|
+
```bash
|
|
35
|
+
# Dev: [command]
|
|
36
|
+
# Build: [command]
|
|
37
|
+
# Test: [command]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Key Technical Decisions
|
|
41
|
+
|
|
42
|
+
[Important architectural choices and rationale]
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
_Document standards and patterns, not every dependency_
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# API Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: consistent API patterns for naming, structure, auth, versioning, and errors]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Prefer predictable, resource-oriented design
|
|
7
|
+
- Be explicit in contracts; minimize breaking changes
|
|
8
|
+
- Secure by default (auth first, least privilege)
|
|
9
|
+
|
|
10
|
+
## Endpoint Pattern
|
|
11
|
+
```
|
|
12
|
+
/{version}/{resource}[/{id}][/{sub-resource}]
|
|
13
|
+
```
|
|
14
|
+
Examples:
|
|
15
|
+
- `/api/v1/users`
|
|
16
|
+
- `/api/v1/users/:id`
|
|
17
|
+
- `/api/v1/users/:id/posts`
|
|
18
|
+
|
|
19
|
+
HTTP verbs:
|
|
20
|
+
- GET (read, safe, idempotent)
|
|
21
|
+
- POST (create)
|
|
22
|
+
- PUT/PATCH (update)
|
|
23
|
+
- DELETE (remove, idempotent)
|
|
24
|
+
|
|
25
|
+
## Request/Response
|
|
26
|
+
|
|
27
|
+
Request (typical):
|
|
28
|
+
```json
|
|
29
|
+
{ "data": { ... }, "metadata": { "requestId": "..." } }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Success:
|
|
33
|
+
```json
|
|
34
|
+
{ "data": { ... }, "meta": { "timestamp": "...", "version": "..." } }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Error:
|
|
38
|
+
```json
|
|
39
|
+
{ "error": { "code": "ERROR_CODE", "message": "...", "field": "optional" } }
|
|
40
|
+
```
|
|
41
|
+
(See error-handling for rules.)
|
|
42
|
+
|
|
43
|
+
## Status Codes (pattern)
|
|
44
|
+
- 2xx: Success (200 read, 201 create, 204 delete)
|
|
45
|
+
- 4xx: Client issues (400 validation, 401/403 auth, 404 missing)
|
|
46
|
+
- 5xx: Server issues (500 generic, 503 unavailable)
|
|
47
|
+
Choose the status that best reflects the outcome.
|
|
48
|
+
|
|
49
|
+
## Authentication
|
|
50
|
+
- Credentials in standard location
|
|
51
|
+
```
|
|
52
|
+
Authorization: Bearer {token}
|
|
53
|
+
```
|
|
54
|
+
- Reject unauthenticated before business logic
|
|
55
|
+
|
|
56
|
+
## Versioning
|
|
57
|
+
- Version via URL/header/media-type
|
|
58
|
+
- Breaking change → new version
|
|
59
|
+
- Non-breaking → same version
|
|
60
|
+
- Provide deprecation window and comms
|
|
61
|
+
|
|
62
|
+
## Pagination/Filtering (if applicable)
|
|
63
|
+
- Pagination: `page`, `pageSize` or cursor-based
|
|
64
|
+
- Filtering: explicit query params
|
|
65
|
+
- Sorting: `sort=field:asc|desc`
|
|
66
|
+
Return pagination metadata in `meta`.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
_Focus on patterns and decisions, not endpoint catalogs._
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Authentication & Authorization Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: unify auth model, token/session lifecycle, permission checks, and security]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Clear separation: authentication (who) vs authorization (what)
|
|
7
|
+
- Secure by default: least privilege, fail closed, short-lived tokens
|
|
8
|
+
- UX-aware: friction where risk is high, smooth otherwise
|
|
9
|
+
|
|
10
|
+
## Authentication
|
|
11
|
+
|
|
12
|
+
### Method (choose + rationale)
|
|
13
|
+
- Options: JWT, Session, OAuth2, hybrid
|
|
14
|
+
- Choice: [our method] because [reason]
|
|
15
|
+
|
|
16
|
+
### Flow (high-level)
|
|
17
|
+
```
|
|
18
|
+
1) User proves identity (credentials or provider)
|
|
19
|
+
2) Server verifies and issues token/session
|
|
20
|
+
3) Client sends token per request
|
|
21
|
+
4) Server verifies token and proceeds
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Token/Session Lifecycle
|
|
25
|
+
- Storage: httpOnly cookie or Authorization header
|
|
26
|
+
- Expiration: short-lived access, longer refresh (if used)
|
|
27
|
+
- Refresh: rotate tokens; respect revocation
|
|
28
|
+
- Revocation: blacklist/rotate on logout/compromise
|
|
29
|
+
|
|
30
|
+
### Security Pattern
|
|
31
|
+
- Enforce TLS; never expose tokens to JS when avoidable
|
|
32
|
+
- Bind token to audience/issuer; include minimal claims
|
|
33
|
+
- Consider device binding and IP/risk checks for sensitive actions
|
|
34
|
+
|
|
35
|
+
## Authorization
|
|
36
|
+
|
|
37
|
+
### Permission Model
|
|
38
|
+
- Choose one: RBAC / ABAC / ownership-based / hybrid
|
|
39
|
+
- Define roles/attributes centrally; avoid hardcoding across codebase
|
|
40
|
+
|
|
41
|
+
### Checks (where to enforce)
|
|
42
|
+
- Route/middleware: coarse-grained gate
|
|
43
|
+
- Domain/service: fine-grained decisions
|
|
44
|
+
- UI: conditional rendering (no security reliance)
|
|
45
|
+
|
|
46
|
+
Example pattern:
|
|
47
|
+
```typescript
|
|
48
|
+
requirePermission('resource:action'); // route
|
|
49
|
+
if (!user.can('resource:action')) throw ForbiddenError(); // domain
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Ownership
|
|
53
|
+
- Pattern: owner OR privileged role can act
|
|
54
|
+
- Verify on entity boundary before mutation
|
|
55
|
+
|
|
56
|
+
## Passwords & MFA
|
|
57
|
+
- Passwords: strong policy, hashed (bcrypt/argon2), never plaintext
|
|
58
|
+
- Reset: time-limited token, single-use, notify user
|
|
59
|
+
- MFA: step-up for risky operations (policy-driven)
|
|
60
|
+
|
|
61
|
+
## API-to-API Auth
|
|
62
|
+
- Use API keys or OAuth client credentials
|
|
63
|
+
- Scope keys minimally; rotate and audit usage
|
|
64
|
+
- Rate limit by identity (user/key)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
_Focus on patterns and decisions. No library-specific code._
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Database Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: guide schema design, queries, migrations, and integrity]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Model the domain first; optimize after correctness
|
|
7
|
+
- Prefer explicit constraints; let database enforce invariants
|
|
8
|
+
- Query only what you need; measure before optimizing
|
|
9
|
+
|
|
10
|
+
## Naming & Types
|
|
11
|
+
- Tables: `snake_case`, plural (`users`, `order_items`)
|
|
12
|
+
- Columns: `snake_case` (`created_at`, `user_id`)
|
|
13
|
+
- FKs: `{table}_id` referencing `{table}.id`
|
|
14
|
+
- Types: timezone-aware timestamps; strong IDs; precise money types
|
|
15
|
+
|
|
16
|
+
## Relationships
|
|
17
|
+
- 1:N: FK in child
|
|
18
|
+
- N:N: join table with compound key
|
|
19
|
+
- 1:1: FK + UNIQUE
|
|
20
|
+
|
|
21
|
+
## Migrations
|
|
22
|
+
- Immutable migrations; always add rollback
|
|
23
|
+
- Small, focused steps; test on non-prod first
|
|
24
|
+
- Naming: `{seq}_{action}_{object}` (e.g., `002_add_email_index`)
|
|
25
|
+
|
|
26
|
+
## Query Patterns
|
|
27
|
+
- ORM for simple CRUD and safety; raw SQL for complex/perf-critical
|
|
28
|
+
- Avoid N+1 (eager load/batching); paginate large sets
|
|
29
|
+
- Index FKs and frequently filtered/sorted columns
|
|
30
|
+
|
|
31
|
+
## Connection & Transactions
|
|
32
|
+
- Use pooling (size/timeouts based on workload)
|
|
33
|
+
- One connection per unit of work; close/return promptly
|
|
34
|
+
- Wrap multi-step changes in transactions
|
|
35
|
+
|
|
36
|
+
## Data Integrity
|
|
37
|
+
- Use NOT NULL/UNIQUE/CHECK/FK constraints
|
|
38
|
+
- Validate at DB when appropriate (defense in depth)
|
|
39
|
+
- Prefer generated columns for consistent derivations
|
|
40
|
+
|
|
41
|
+
## Backup & Recovery
|
|
42
|
+
- Regular backups with retention; test restores
|
|
43
|
+
- Document RPO/RTO targets; monitor backup jobs
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
_Focus on patterns and decisions. No environment-specific settings._
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Deployment Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: safe, repeatable releases with clear environment and pipeline patterns]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Automate; test before deploy; verify after deploy
|
|
7
|
+
- Prefer incremental rollout with fast rollback
|
|
8
|
+
- Production changes must be observable and reversible
|
|
9
|
+
|
|
10
|
+
## Environments
|
|
11
|
+
- Dev: fast iteration; debugging enabled
|
|
12
|
+
- Staging: mirrors prod; release validation
|
|
13
|
+
- Prod: hardened; monitored; least privilege
|
|
14
|
+
|
|
15
|
+
## CI/CD Flow
|
|
16
|
+
```
|
|
17
|
+
Code → Test → Build → Scan → Deploy (staged) → Verify
|
|
18
|
+
```
|
|
19
|
+
Principles:
|
|
20
|
+
- Fail fast on tests/scans; block deploy
|
|
21
|
+
- Artifact builds are reproducible (lockfiles, pinned versions)
|
|
22
|
+
- Manual approval for prod; auditable trail
|
|
23
|
+
|
|
24
|
+
## Deployment Strategies
|
|
25
|
+
- Rolling: gradual instance replacement
|
|
26
|
+
- Blue-Green: switch traffic between two pools
|
|
27
|
+
- Canary: small % users first, expand on health
|
|
28
|
+
Choose per risk profile; document default.
|
|
29
|
+
|
|
30
|
+
## Zero-Downtime & Migrations
|
|
31
|
+
- Health checks gate traffic; graceful shutdown
|
|
32
|
+
- Backwards-compatible DB changes during rollout
|
|
33
|
+
- Separate migration step; test rollback paths
|
|
34
|
+
|
|
35
|
+
## Rollback
|
|
36
|
+
- Keep previous version ready; automate revert
|
|
37
|
+
- Rollback faster than fix-forward; document triggers
|
|
38
|
+
|
|
39
|
+
## Configuration & Secrets
|
|
40
|
+
- 12-factor config via env; never commit secrets
|
|
41
|
+
- Secret manager; rotate; least privilege; audit access
|
|
42
|
+
- Validate required env vars at startup
|
|
43
|
+
|
|
44
|
+
## Health & Monitoring
|
|
45
|
+
- Endpoints: `/health`, `/health/live`, `/health/ready`
|
|
46
|
+
- Monitor latency, error rate, throughput, saturation
|
|
47
|
+
- Alerts on SLO breaches/spikes; tune to avoid fatigue
|
|
48
|
+
|
|
49
|
+
## Incident Response & DR
|
|
50
|
+
- Standard playbook: detect → assess → mitigate → communicate → resolve → post-mortem
|
|
51
|
+
- Backups with retention; test restore; defined RPO/RTO
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
_Focus on rollout patterns and safeguards. No provider-specific steps._
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Error Handling Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: unify how errors are classified, shaped, propagated, logged, and monitored]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Fail fast where possible; degrade gracefully at system boundaries
|
|
7
|
+
- Consistent error shape across the stack (human + machine readable)
|
|
8
|
+
- Handle known errors close to source; surface unknowns to a global handler
|
|
9
|
+
|
|
10
|
+
## Classification (decide handling by source)
|
|
11
|
+
- Client: Input/validation/user action issues → 4xx
|
|
12
|
+
- Server: System failures/unexpected exceptions → 5xx
|
|
13
|
+
- Business: Rule/state violations → 4xx (e.g., 409)
|
|
14
|
+
- External: 3rd-party/network failures → map to 5xx or 4xx with context
|
|
15
|
+
|
|
16
|
+
## Error Shape (single canonical format)
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"error": {
|
|
20
|
+
"code": "ERROR_CODE",
|
|
21
|
+
"message": "Human-readable message",
|
|
22
|
+
"requestId": "trace-id",
|
|
23
|
+
"timestamp": "ISO-8601"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
Principles: stable code enums, no secrets, include trace info.
|
|
28
|
+
|
|
29
|
+
## Propagation (where to convert)
|
|
30
|
+
- API layer: Convert domain errors → HTTP status + canonical body
|
|
31
|
+
- Service layer: Throw typed business errors, avoid stringly-typed errors
|
|
32
|
+
- Data/external layer: Wrap provider errors with safe, actionable codes
|
|
33
|
+
- Unknown errors: Bubble to global handler → 500 + generic message
|
|
34
|
+
|
|
35
|
+
Example pattern:
|
|
36
|
+
```typescript
|
|
37
|
+
try { return await useCase(); }
|
|
38
|
+
catch (e) {
|
|
39
|
+
if (e instanceof BusinessError) return respondMapped(e);
|
|
40
|
+
logError(e); return respondInternal();
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Logging (context over noise)
|
|
45
|
+
Log: operation, userId (if available), code, message, stack, requestId, minimal context.
|
|
46
|
+
Do not log: passwords, tokens, secrets, full PII, full bodies with sensitive data.
|
|
47
|
+
Levels: ERROR (failures), WARN (recoverable/edge), INFO (key events), DEBUG (diagnostics).
|
|
48
|
+
|
|
49
|
+
## Retry (only when safe)
|
|
50
|
+
Retry when: network/timeouts/transient 5xx AND operation is idempotent.
|
|
51
|
+
Do not retry: 4xx, business errors, non-idempotent flows.
|
|
52
|
+
Strategy: exponential backoff + jitter, capped attempts; require idempotency keys.
|
|
53
|
+
|
|
54
|
+
## Monitoring & Health
|
|
55
|
+
Track: error rates by code/category, latency, saturation; alert on spikes/SLI breaches.
|
|
56
|
+
Expose health: `/health` (live), `/health/ready` (ready). Link errors to traces.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
_Focus on patterns and decisions. No implementation details or exhaustive lists._
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Security Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: define security posture with patterns for validation, authz, secrets, and data]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Defense in depth; least privilege; secure by default; fail closed
|
|
7
|
+
- Validate at boundaries; sanitize for context; never trust input
|
|
8
|
+
- Separate authentication (who) and authorization (what)
|
|
9
|
+
|
|
10
|
+
## Input & Output
|
|
11
|
+
- Validate at API boundaries and UI forms; enforce types and constraints
|
|
12
|
+
- Sanitize/escape based on destination (HTML, SQL, shell, logs)
|
|
13
|
+
- Prefer allow-lists over block-lists; reject early with minimal detail
|
|
14
|
+
|
|
15
|
+
## Authentication & Authorization
|
|
16
|
+
- Authentication: verify identity; issue short-lived tokens/sessions
|
|
17
|
+
- Authorization: check permissions before actions; deny by default
|
|
18
|
+
- Centralize policies; avoid duplicating checks across code
|
|
19
|
+
|
|
20
|
+
Pattern:
|
|
21
|
+
```typescript
|
|
22
|
+
if (!user.hasPermission('resource:action')) throw ForbiddenError();
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Secrets & Configuration
|
|
26
|
+
- Never commit secrets; store in secret manager or env
|
|
27
|
+
- Rotate regularly; audit access; scope minimal
|
|
28
|
+
- Validate required env vars at startup; fail fast on missing
|
|
29
|
+
|
|
30
|
+
## Sensitive Data
|
|
31
|
+
- Minimize collection; mask/redact in logs; encrypt at rest and in transit
|
|
32
|
+
- Restrict access by role/need-to-know; track access to sensitive records
|
|
33
|
+
|
|
34
|
+
## Session/Token Security
|
|
35
|
+
- httpOnly + secure cookies where possible; TLS everywhere
|
|
36
|
+
- Short expiration; rotate on refresh; revoke on logout/compromise
|
|
37
|
+
- Bind tokens to audience/issuer; include minimal claims
|
|
38
|
+
|
|
39
|
+
## Logging (security-aware)
|
|
40
|
+
- Log auth attempts, permission denials, and sensitive operations
|
|
41
|
+
- Never log passwords, tokens, secrets, full PII; avoid full bodies
|
|
42
|
+
- Include requestId and context to correlate events
|
|
43
|
+
|
|
44
|
+
## Headers & Transport
|
|
45
|
+
- Enforce TLS; HSTS
|
|
46
|
+
- Set security headers (CSP, X-Frame-Options, X-Content-Type-Options)
|
|
47
|
+
- Prefer modern crypto; disable weak protocols/ciphers
|
|
48
|
+
|
|
49
|
+
## Vulnerability Posture
|
|
50
|
+
- Prefer secure libraries; keep dependencies updated
|
|
51
|
+
- Static/dynamic scans in CI; track and remediate
|
|
52
|
+
- Educate team on common classes; encode as patterns above
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
_Focus on patterns and principles. Link concrete configs to ops docs._
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Testing Standards
|
|
2
|
+
|
|
3
|
+
[Purpose: guide what to test, where tests live, and how to structure them]
|
|
4
|
+
|
|
5
|
+
## Philosophy
|
|
6
|
+
- Test behavior, not implementation
|
|
7
|
+
- Prefer fast, reliable tests; minimize brittle mocks
|
|
8
|
+
- Cover critical paths deeply; breadth over 100% pursuit
|
|
9
|
+
|
|
10
|
+
## Organization
|
|
11
|
+
Options:
|
|
12
|
+
- Co-located: `component.tsx` + `component.test.tsx`
|
|
13
|
+
- Separate: `/src/...` and `/tests/...`
|
|
14
|
+
Pick one as default; allow exceptions with rationale.
|
|
15
|
+
|
|
16
|
+
Naming:
|
|
17
|
+
- Files: `*.test.*` or `*.spec.*`
|
|
18
|
+
- Suites: what is under test; Cases: expected behavior
|
|
19
|
+
|
|
20
|
+
## Test Types
|
|
21
|
+
- Unit: single unit, mocked dependencies, very fast
|
|
22
|
+
- Integration: multiple units together, mock externals only
|
|
23
|
+
- E2E: full flows, minimal mocks, only for critical journeys
|
|
24
|
+
|
|
25
|
+
## Structure (AAA)
|
|
26
|
+
```typescript
|
|
27
|
+
it('does X when Y', () => {
|
|
28
|
+
// Arrange
|
|
29
|
+
const input = setup();
|
|
30
|
+
// Act
|
|
31
|
+
const result = act(input);
|
|
32
|
+
// Assert
|
|
33
|
+
expect(result).toEqual(expected);
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Mocking & Data
|
|
38
|
+
- Mock externals (API/DB); never mock the system under test
|
|
39
|
+
- Use factories/fixtures; reset state between tests
|
|
40
|
+
- Keep test data minimal and intention-revealing
|
|
41
|
+
|
|
42
|
+
## Coverage
|
|
43
|
+
- Target: [% overall]; higher for critical domains
|
|
44
|
+
- Enforce thresholds in CI; exceptions require review rationale
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
_Focus on patterns and decisions. Tool-specific config lives elsewhere._
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-design-agent
|
|
3
|
+
description: Generate comprehensive technical design translating requirements (WHAT) into architecture (HOW) with discovery process
|
|
4
|
+
tools: Read, Write, Edit, Grep, Glob, WebSearch, WebFetch
|
|
5
|
+
model: inherit
|
|
6
|
+
color: purple
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# spec-design Agent
|
|
10
|
+
|
|
11
|
+
## Role
|
|
12
|
+
You are a specialized agent for generating comprehensive technical design documents that translate requirements (WHAT) into architectural design (HOW).
|
|
13
|
+
|
|
14
|
+
## Core Mission
|
|
15
|
+
- **Mission**: Generate comprehensive technical design document that translates requirements (WHAT) into architectural design (HOW)
|
|
16
|
+
- **Success Criteria**:
|
|
17
|
+
- All requirements mapped to technical components with clear interfaces
|
|
18
|
+
- Appropriate architecture discovery and research completed
|
|
19
|
+
- Design aligns with steering context and existing patterns
|
|
20
|
+
- Visual diagrams included for complex architectures
|
|
21
|
+
|
|
22
|
+
## Execution Protocol
|
|
23
|
+
|
|
24
|
+
You will receive task prompts containing:
|
|
25
|
+
- Feature name and spec directory path
|
|
26
|
+
- File path patterns (NOT expanded file lists)
|
|
27
|
+
- Auto-approve flag (true/false)
|
|
28
|
+
- Mode: generate or merge
|
|
29
|
+
|
|
30
|
+
### Step 0: Expand File Patterns (Subagent-specific)
|
|
31
|
+
|
|
32
|
+
Use Glob tool to expand file patterns, then read all files:
|
|
33
|
+
- Glob(`.red64/steering/*.md`) to get all steering files
|
|
34
|
+
- Read each file from glob results
|
|
35
|
+
- Read other specified file patterns
|
|
36
|
+
|
|
37
|
+
### Step 1-3: Core Task (from original instructions)
|
|
38
|
+
|
|
39
|
+
## Core Task
|
|
40
|
+
Generate technical design document for feature based on approved requirements.
|
|
41
|
+
|
|
42
|
+
## Execution Steps
|
|
43
|
+
|
|
44
|
+
### Step 1: Load Context
|
|
45
|
+
|
|
46
|
+
**Read all necessary context**:
|
|
47
|
+
- `.red64/specs/{feature}/spec.json`, `requirements.md`, `design.md` (if exists)
|
|
48
|
+
- **Entire `.red64/steering/` directory** for complete project memory
|
|
49
|
+
- `.red64/settings/templates/specs/design.md` for document structure
|
|
50
|
+
- `.red64/settings/rules/design-principles.md` for design principles
|
|
51
|
+
|
|
52
|
+
**Validate requirements approval**:
|
|
53
|
+
- If auto-approve flag is true: Auto-approve requirements in spec.json
|
|
54
|
+
- Otherwise: Verify approval status (stop if unapproved, see Safety & Fallback)
|
|
55
|
+
|
|
56
|
+
### Step 2: Discovery & Analysis
|
|
57
|
+
|
|
58
|
+
**Critical: This phase ensures design is based on complete, accurate information.**
|
|
59
|
+
|
|
60
|
+
1. **Classify Feature Type**:
|
|
61
|
+
- **New Feature** (greenfield) → Full discovery required
|
|
62
|
+
- **Extension** (existing system) → Integration-focused discovery
|
|
63
|
+
- **Simple Addition** (CRUD/UI) → Minimal or no discovery
|
|
64
|
+
- **Complex Integration** → Comprehensive analysis required
|
|
65
|
+
|
|
66
|
+
2. **Execute Appropriate Discovery Process**:
|
|
67
|
+
|
|
68
|
+
**For Complex/New Features**:
|
|
69
|
+
- Read and execute `.red64/settings/rules/design-discovery-full.md`
|
|
70
|
+
- Conduct thorough research using WebSearch/WebFetch:
|
|
71
|
+
- Latest architectural patterns and best practices
|
|
72
|
+
- External dependency verification (APIs, libraries, versions, compatibility)
|
|
73
|
+
- Official documentation, migration guides, known issues
|
|
74
|
+
- Performance benchmarks and security considerations
|
|
75
|
+
|
|
76
|
+
**For Extensions**:
|
|
77
|
+
- Read and execute `.red64/settings/rules/design-discovery-light.md`
|
|
78
|
+
- Focus on integration points, existing patterns, compatibility
|
|
79
|
+
- Use Grep to analyze existing codebase patterns
|
|
80
|
+
|
|
81
|
+
**For Simple Additions**:
|
|
82
|
+
- Skip formal discovery, quick pattern check only
|
|
83
|
+
|
|
84
|
+
3. **Retain Discovery Findings for Step 3**:
|
|
85
|
+
- External API contracts and constraints
|
|
86
|
+
- Technology decisions with rationale
|
|
87
|
+
- Existing patterns to follow or extend
|
|
88
|
+
- Integration points and dependencies
|
|
89
|
+
- Identified risks and mitigation strategies
|
|
90
|
+
|
|
91
|
+
### Step 3: Generate Design Document
|
|
92
|
+
|
|
93
|
+
1. **Load Design Template and Rules**:
|
|
94
|
+
- Read `.red64/settings/templates/specs/design.md` for structure
|
|
95
|
+
- Read `.red64/settings/rules/design-principles.md` for principles
|
|
96
|
+
|
|
97
|
+
2. **Generate Design Document**:
|
|
98
|
+
- **Follow specs/design.md template structure and generation instructions strictly**
|
|
99
|
+
- **Integrate all discovery findings**: Use researched information (APIs, patterns, technologies) throughout component definitions, architecture decisions, and integration points
|
|
100
|
+
- If existing design.md found in Step 1, use it as reference context (merge mode)
|
|
101
|
+
- Apply design rules: Type Safety, Visual Communication, Formal Tone
|
|
102
|
+
- Use language specified in spec.json
|
|
103
|
+
|
|
104
|
+
3. **Update Metadata** in spec.json:
|
|
105
|
+
- Set `phase: "design-generated"`
|
|
106
|
+
- Set `approvals.design.generated: true, approved: false`
|
|
107
|
+
- Set `approvals.requirements.approved: true`
|
|
108
|
+
- Update `updated_at` timestamp
|
|
109
|
+
|
|
110
|
+
## Critical Constraints
|
|
111
|
+
- **Type Safety**:
|
|
112
|
+
- Enforce strong typing aligned with the project's technology stack.
|
|
113
|
+
- For statically typed languages, define explicit types/interfaces and avoid unsafe casts.
|
|
114
|
+
- For TypeScript, never use `any`; prefer precise types and generics.
|
|
115
|
+
- For dynamically typed languages, provide type hints/annotations where available (e.g., Python type hints) and validate inputs at boundaries.
|
|
116
|
+
- Document public interfaces and contracts clearly to ensure cross-component type safety.
|
|
117
|
+
- **Latest Information**: Use WebSearch/WebFetch for external dependencies and best practices
|
|
118
|
+
- **Steering Alignment**: Respect existing architecture patterns from steering context
|
|
119
|
+
- **Template Adherence**: Follow specs/design.md template structure and generation instructions strictly
|
|
120
|
+
- **Design Focus**: Architecture and interfaces ONLY, no implementation code
|
|
121
|
+
- **Requirements Traceability IDs**: Use numeric requirement IDs only (e.g. "1.1", "1.2", "3.1", "3.3") exactly as defined in requirements.md. Do not invent new IDs or use alphabetic labels.
|
|
122
|
+
|
|
123
|
+
## Tool Guidance
|
|
124
|
+
- **Read first**: Load all context before taking action (specs, steering, templates, rules)
|
|
125
|
+
- **Research when uncertain**: Use WebSearch/WebFetch for external dependencies, APIs, and latest best practices
|
|
126
|
+
- **Analyze existing code**: Use Grep to find patterns and integration points in codebase
|
|
127
|
+
- **Write last**: Generate design.md only after all research and analysis complete
|
|
128
|
+
|
|
129
|
+
## Output Description
|
|
130
|
+
|
|
131
|
+
**Command execution output** (separate from design.md content):
|
|
132
|
+
|
|
133
|
+
Provide brief summary in the language specified in spec.json:
|
|
134
|
+
|
|
135
|
+
1. **Status**: Confirm design document generated at `.red64/specs/{feature}/design.md`
|
|
136
|
+
2. **Discovery Type**: Which discovery process was executed (full/light/minimal)
|
|
137
|
+
3. **Key Findings**: 2-3 critical insights from discovery that shaped the design
|
|
138
|
+
4. **Next Action**: Approval workflow guidance (see Safety & Fallback)
|
|
139
|
+
|
|
140
|
+
**Format**: Concise Markdown (under 200 words) - this is the command output, NOT the design document itself
|
|
141
|
+
|
|
142
|
+
**Note**: The actual design document follows `.red64/settings/templates/specs/design.md` structure.
|
|
143
|
+
|
|
144
|
+
## Safety & Fallback
|
|
145
|
+
|
|
146
|
+
### Error Scenarios
|
|
147
|
+
|
|
148
|
+
**Requirements Not Approved**:
|
|
149
|
+
- **Stop Execution**: Cannot proceed without approved requirements
|
|
150
|
+
- **User Message**: "Requirements not yet approved. Approval required before design generation."
|
|
151
|
+
- **Suggested Action**: "Run `/red64:spec-design {feature} -y` to auto-approve requirements and proceed"
|
|
152
|
+
|
|
153
|
+
**Missing Requirements**:
|
|
154
|
+
- **Stop Execution**: Requirements document must exist
|
|
155
|
+
- **User Message**: "No requirements.md found at `.red64/specs/{feature}/requirements.md`"
|
|
156
|
+
- **Suggested Action**: "Run `/red64:spec-requirements {feature}` to generate requirements first"
|
|
157
|
+
|
|
158
|
+
**Template Missing**:
|
|
159
|
+
- **User Message**: "Template file missing at `.red64/settings/templates/specs/design.md`"
|
|
160
|
+
- **Suggested Action**: "Check repository setup or restore template file"
|
|
161
|
+
- **Fallback**: Use inline basic structure with warning
|
|
162
|
+
|
|
163
|
+
**Steering Context Missing**:
|
|
164
|
+
- **Warning**: "Steering directory empty or missing - design may not align with project standards"
|
|
165
|
+
- **Proceed**: Continue with generation but note limitation in output
|
|
166
|
+
|
|
167
|
+
**Discovery Complexity Unclear**:
|
|
168
|
+
- **Default**: Use full discovery process (`.red64/settings/rules/design-discovery-full.md`)
|
|
169
|
+
- **Rationale**: Better to over-research than miss critical context
|
|
170
|
+
- **Invalid Requirement IDs**:
|
|
171
|
+
- **Stop Execution**: If requirements.md is missing numeric IDs or uses non-numeric headings (for example, "Requirement A"), stop and instruct the user to fix requirements.md before continuing.
|
|
172
|
+
|
|
173
|
+
**Note**: You execute tasks autonomously. Return final report only when complete.
|
|
174
|
+
think
|