@codemieai/code 0.0.33 → 0.0.35
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 +78 -7
- package/bin/codemie-claude-acp.js +21 -0
- package/bin/codemie-opencode.js +11 -0
- package/bin/codemie.js +13 -0
- package/dist/agents/codemie-code/agent.d.ts +38 -4
- package/dist/agents/codemie-code/agent.d.ts.map +1 -1
- package/dist/agents/codemie-code/agent.js +333 -178
- package/dist/agents/codemie-code/agent.js.map +1 -1
- package/dist/agents/codemie-code/index.d.ts +2 -1
- package/dist/agents/codemie-code/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/index.js +36 -7
- package/dist/agents/codemie-code/index.js.map +1 -1
- package/dist/agents/codemie-code/prompts.d.ts +12 -5
- package/dist/agents/codemie-code/prompts.d.ts.map +1 -1
- package/dist/agents/codemie-code/prompts.js +53 -6
- package/dist/agents/codemie-code/prompts.js.map +1 -1
- package/dist/agents/codemie-code/toolMetadata.d.ts.map +1 -1
- package/dist/agents/codemie-code/toolMetadata.js +9 -8
- package/dist/agents/codemie-code/toolMetadata.js.map +1 -1
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts +47 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.d.ts.map +1 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.js +129 -0
- package/dist/agents/codemie-code/tools/assistant-invocation.js.map +1 -0
- package/dist/agents/codemie-code/tools/index.d.ts +70 -4
- package/dist/agents/codemie-code/tools/index.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/index.js +57 -44
- package/dist/agents/codemie-code/tools/index.js.map +1 -1
- package/dist/agents/codemie-code/tools/planning.d.ts +6 -5
- package/dist/agents/codemie-code/tools/planning.d.ts.map +1 -1
- package/dist/agents/codemie-code/tools/planning.js +12 -10
- package/dist/agents/codemie-code/tools/planning.js.map +1 -1
- package/dist/agents/codemie-code/types.d.ts +27 -3
- package/dist/agents/codemie-code/types.d.ts.map +1 -1
- package/dist/agents/codemie-code/types.js +24 -0
- package/dist/agents/codemie-code/types.js.map +1 -1
- package/dist/agents/codemie-code/ui/autocomplete.d.ts +98 -0
- package/dist/agents/codemie-code/ui/autocomplete.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/autocomplete.js +145 -0
- package/dist/agents/codemie-code/ui/autocomplete.js.map +1 -0
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts +112 -0
- package/dist/agents/codemie-code/ui/keyHandlers.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/keyHandlers.js +415 -0
- package/dist/agents/codemie-code/ui/keyHandlers.js.map +1 -0
- package/dist/agents/codemie-code/ui/mentions.d.ts +86 -0
- package/dist/agents/codemie-code/ui/mentions.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/mentions.js +122 -0
- package/dist/agents/codemie-code/ui/mentions.js.map +1 -0
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts +38 -0
- package/dist/agents/codemie-code/ui/terminalCodes.d.ts.map +1 -0
- package/dist/agents/codemie-code/ui/terminalCodes.js +42 -0
- package/dist/agents/codemie-code/ui/terminalCodes.js.map +1 -0
- package/dist/agents/codemie-code/ui/todoPanel.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui/todoPanel.js +3 -4
- package/dist/agents/codemie-code/ui/todoPanel.js.map +1 -1
- package/dist/agents/codemie-code/ui.d.ts +8 -7
- package/dist/agents/codemie-code/ui.d.ts.map +1 -1
- package/dist/agents/codemie-code/ui.js +87 -145
- package/dist/agents/codemie-code/ui.js.map +1 -1
- package/dist/agents/core/AgentCLI.d.ts +5 -0
- package/dist/agents/core/AgentCLI.d.ts.map +1 -1
- package/dist/agents/core/AgentCLI.js +25 -1
- package/dist/agents/core/AgentCLI.js.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.d.ts.map +1 -1
- package/dist/agents/core/BaseAgentAdapter.js +90 -27
- package/dist/agents/core/BaseAgentAdapter.js.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts +7 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.d.ts.map +1 -1
- package/dist/agents/core/extension/BaseExtensionInstaller.js +58 -15
- package/dist/agents/core/extension/BaseExtensionInstaller.js.map +1 -1
- package/dist/agents/core/session/BaseSessionAdapter.d.ts +25 -0
- package/dist/agents/core/session/BaseSessionAdapter.d.ts.map +1 -1
- package/dist/agents/core/session/discovery-types.d.ts +53 -0
- package/dist/agents/core/session/discovery-types.d.ts.map +1 -0
- package/dist/agents/core/session/discovery-types.js +8 -0
- package/dist/agents/core/session/discovery-types.js.map +1 -0
- package/dist/agents/core/types.d.ts +62 -0
- package/dist/agents/core/types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts +27 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.js +63 -0
- package/dist/agents/plugins/claude/claude-acp.plugin.js.map +1 -0
- package/dist/agents/plugins/claude/claude-message-types.d.ts +1 -0
- package/dist/agents/plugins/claude/claude-message-types.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts +44 -1
- package/dist/agents/plugins/claude/claude.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.plugin.js +263 -12
- package/dist/agents/plugins/claude/claude.plugin.js.map +1 -1
- package/dist/agents/plugins/claude/claude.session.d.ts.map +1 -1
- package/dist/agents/plugins/claude/claude.session.js +14 -7
- package/dist/agents/plugins/claude/claude.session.js.map +1 -1
- package/dist/agents/plugins/claude/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/agents/plugins/claude/plugin/README.md +40 -2
- package/dist/agents/plugins/claude/plugin/claude-templates/README.md +5 -5
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/CLAUDE.md.template +177 -436
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/code-review-agent-template.md.template +49 -82
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/refactor-cleaner-agent.md.template +337 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/solution-architect-agent.md.template +129 -419
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/agents/unit-tester-agent.md.template +146 -693
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/api/api-patterns.md.template +110 -138
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/architecture.md.template +197 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/data/database-patterns.md.template +171 -91
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/development/development-practices.md.template +219 -131
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/security/security-practices.md.template +223 -98
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/standards/code-quality.md.template +131 -95
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/testing/testing-patterns.md.template +247 -75
- package/dist/agents/plugins/claude/plugin/commands/README.md +133 -0
- package/dist/agents/plugins/claude/plugin/commands/codemie-init.md +336 -544
- package/dist/agents/plugins/claude/plugin/commands/codemie-subagents.md +233 -504
- package/dist/agents/plugins/claude/plugin/commands/memory-add.md +311 -30
- package/dist/agents/plugins/claude/plugin/commands/memory-refresh.md +218 -39
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js +43 -8
- package/dist/agents/plugins/claude/session/processors/claude.conversations-processor.js.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.d.ts.map +1 -1
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js +68 -40
- package/dist/agents/plugins/claude/session/processors/claude.metrics-processor.js.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.d.ts.map +1 -1
- package/dist/agents/plugins/gemini/gemini.plugin.js +0 -3
- package/dist/agents/plugins/gemini/gemini.plugin.js.map +1 -1
- package/dist/agents/plugins/opencode/index.d.ts +8 -0
- package/dist/agents/plugins/opencode/index.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/index.js +12 -0
- package/dist/agents/plugins/opencode/index.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts +207 -0
- package/dist/agents/plugins/opencode/opencode-message-types.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js +59 -0
- package/dist/agents/plugins/opencode/opencode-message-types.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts +65 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js +184 -0
- package/dist/agents/plugins/opencode/opencode-model-configs.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts +62 -0
- package/dist/agents/plugins/opencode/opencode.paths.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.paths.js +148 -0
- package/dist/agents/plugins/opencode/opencode.paths.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts +35 -0
- package/dist/agents/plugins/opencode/opencode.plugin.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js +338 -0
- package/dist/agents/plugins/opencode/opencode.plugin.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts +77 -0
- package/dist/agents/plugins/opencode/opencode.session.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.session.js +424 -0
- package/dist/agents/plugins/opencode/opencode.session.js.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts +25 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js +96 -0
- package/dist/agents/plugins/opencode/opencode.storage-utils.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts +30 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js +116 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.conversations-processor.js.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts +102 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.d.ts.map +1 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js +584 -0
- package/dist/agents/plugins/opencode/session/processors/opencode.metrics-processor.js.map +1 -0
- package/dist/agents/registry.d.ts +1 -1
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +5 -1
- package/dist/agents/registry.js.map +1 -1
- package/dist/cli/commands/assistants/chat.d.ts +11 -0
- package/dist/cli/commands/assistants/chat.d.ts.map +1 -0
- package/dist/cli/commands/assistants/chat.js +201 -0
- package/dist/cli/commands/assistants/chat.js.map +1 -0
- package/dist/cli/commands/assistants/constants.d.ts +81 -0
- package/dist/cli/commands/assistants/constants.d.ts.map +1 -0
- package/dist/cli/commands/assistants/constants.js +75 -0
- package/dist/cli/commands/assistants/constants.js.map +1 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts +26 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.d.ts.map +1 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js +115 -0
- package/dist/cli/commands/assistants/generators/claude-agent-generator.js.map +1 -0
- package/dist/cli/commands/assistants/index.d.ts +11 -0
- package/dist/cli/commands/assistants/index.d.ts.map +1 -0
- package/dist/cli/commands/assistants/index.js +28 -0
- package/dist/cli/commands/assistants/index.js.map +1 -0
- package/dist/cli/commands/assistants/list.d.ts +11 -0
- package/dist/cli/commands/assistants/list.d.ts.map +1 -0
- package/dist/cli/commands/assistants/list.js +323 -0
- package/dist/cli/commands/assistants/list.js.map +1 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts +5 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.d.ts.map +1 -1
- package/dist/cli/commands/doctor/checks/AgentsCheck.js +29 -0
- package/dist/cli/commands/doctor/checks/AgentsCheck.js.map +1 -1
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +104 -13
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/opencode-metrics.d.ts +13 -0
- package/dist/cli/commands/opencode-metrics.d.ts.map +1 -0
- package/dist/cli/commands/opencode-metrics.js +200 -0
- package/dist/cli/commands/opencode-metrics.js.map +1 -0
- package/dist/cli/commands/self-update.d.ts +3 -0
- package/dist/cli/commands/self-update.d.ts.map +1 -0
- package/dist/cli/commands/self-update.js +55 -0
- package/dist/cli/commands/self-update.js.map +1 -0
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +113 -0
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/skill.d.ts +6 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +196 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +34 -6
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +12 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/env/types.d.ts +13 -0
- package/dist/env/types.d.ts.map +1 -1
- package/dist/env/types.js +1 -1
- package/dist/env/types.js.map +1 -1
- package/dist/migrations/003-remove-hooks-node.migration.d.ts +22 -0
- package/dist/migrations/003-remove-hooks-node.migration.d.ts.map +1 -0
- package/dist/migrations/003-remove-hooks-node.migration.js +103 -0
- package/dist/migrations/003-remove-hooks-node.migration.js.map +1 -0
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +1 -1
- package/dist/migrations/index.js.map +1 -1
- package/dist/providers/plugins/sso/sso.http-client.js +2 -2
- package/dist/providers/plugins/sso/sso.http-client.js.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.d.ts.map +1 -1
- package/dist/providers/plugins/sso/sso.setup-steps.js +14 -10
- package/dist/providers/plugins/sso/sso.setup-steps.js.map +1 -1
- package/dist/skills/core/SkillDiscovery.d.ts +83 -0
- package/dist/skills/core/SkillDiscovery.d.ts.map +1 -0
- package/dist/skills/core/SkillDiscovery.js +237 -0
- package/dist/skills/core/SkillDiscovery.js.map +1 -0
- package/dist/skills/core/SkillManager.d.ts +86 -0
- package/dist/skills/core/SkillManager.d.ts.map +1 -0
- package/dist/skills/core/SkillManager.js +155 -0
- package/dist/skills/core/SkillManager.js.map +1 -0
- package/dist/skills/core/types.d.ts +120 -0
- package/dist/skills/core/types.d.ts.map +1 -0
- package/dist/skills/core/types.js +20 -0
- package/dist/skills/core/types.js.map +1 -0
- package/dist/skills/index.d.ts +12 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/utils/content-loader.d.ts +25 -0
- package/dist/skills/utils/content-loader.d.ts.map +1 -0
- package/dist/skills/utils/content-loader.js +161 -0
- package/dist/skills/utils/content-loader.js.map +1 -0
- package/dist/skills/utils/frontmatter.d.ts +60 -0
- package/dist/skills/utils/frontmatter.d.ts.map +1 -0
- package/dist/skills/utils/frontmatter.js +114 -0
- package/dist/skills/utils/frontmatter.js.map +1 -0
- package/dist/skills/utils/pattern-matcher.d.ts +60 -0
- package/dist/skills/utils/pattern-matcher.d.ts.map +1 -0
- package/dist/skills/utils/pattern-matcher.js +97 -0
- package/dist/skills/utils/pattern-matcher.js.map +1 -0
- package/dist/utils/auth.d.ts +22 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +50 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/cli-updater.d.ts +70 -0
- package/dist/utils/cli-updater.d.ts.map +1 -0
- package/dist/utils/cli-updater.js +339 -0
- package/dist/utils/cli-updater.js.map +1 -0
- package/dist/utils/config.d.ts +6 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +13 -0
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/installation-detector.d.ts +22 -0
- package/dist/utils/installation-detector.d.ts.map +1 -0
- package/dist/utils/installation-detector.js +49 -0
- package/dist/utils/installation-detector.js.map +1 -0
- package/dist/utils/native-installer.d.ts +49 -0
- package/dist/utils/native-installer.d.ts.map +1 -0
- package/dist/utils/native-installer.js +225 -0
- package/dist/utils/native-installer.js.map +1 -0
- package/dist/utils/processes.js +1 -1
- package/dist/utils/profile.d.ts +2 -0
- package/dist/utils/profile.d.ts.map +1 -1
- package/dist/utils/profile.js +5 -0
- package/dist/utils/profile.js.map +1 -1
- package/dist/utils/sdk-client.d.ts +15 -0
- package/dist/utils/sdk-client.d.ts.map +1 -0
- package/dist/utils/sdk-client.js +92 -0
- package/dist/utils/sdk-client.js.map +1 -0
- package/dist/utils/version-utils.d.ts +50 -0
- package/dist/utils/version-utils.d.ts.map +1 -0
- package/dist/utils/version-utils.js +92 -0
- package/dist/utils/version-utils.js.map +1 -0
- package/package.json +11 -3
- package/scripts/copy-mr-skill-to-global.ts +252 -0
- package/scripts/demo-hooks.sh +125 -0
- package/scripts/test-hooks.sh +196 -0
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/INDEX.md +0 -205
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/TEMPLATE_SIZES.md +0 -74
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/layered-architecture.md.template +0 -143
- package/dist/agents/plugins/claude/plugin/claude-templates/templates/guides/architecture/project-structure.md.template +0 -127
- package/dist/agents/plugins/claude/plugin/commands/codemie-pr.md +0 -25
|
@@ -1,207 +1,179 @@
|
|
|
1
|
-
# API Patterns
|
|
2
|
-
|
|
3
|
-
## Quick Summary
|
|
4
|
-
|
|
5
|
-
API endpoint patterns for [PROJECT_NAME]: CRUD operations, validation, authentication, and error responses.
|
|
6
|
-
|
|
7
|
-
**Category**: API
|
|
8
|
-
**Complexity**: Medium
|
|
9
|
-
**Prerequisites**: [FRAMEWORK], HTTP, [AUTH_METHOD]
|
|
10
|
-
|
|
11
1
|
---
|
|
2
|
+
# API Patterns Guide
|
|
12
3
|
|
|
13
|
-
##
|
|
4
|
+
## Overview
|
|
14
5
|
|
|
15
|
-
|
|
6
|
+
<!--
|
|
7
|
+
GENERATION INSTRUCTIONS:
|
|
8
|
+
1. Scan codebase for API routes, controllers, middleware
|
|
9
|
+
2. Extract ACTUAL patterns used (don't invent)
|
|
10
|
+
3. Fill each section with REAL file paths and code
|
|
11
|
+
4. Keep examples minimal (5-15 lines, one per pattern)
|
|
12
|
+
5. Final output: 150-300 lines
|
|
13
|
+
-->
|
|
16
14
|
|
|
17
|
-
**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- ✅ Use file:line references, not full code
|
|
21
|
-
- ✅ Use tables for multiple patterns
|
|
22
|
-
- ❌ NO multiple examples for same pattern
|
|
23
|
-
- ❌ NO verbose explanations
|
|
24
|
-
- ❌ NO copying entire functions
|
|
25
|
-
|
|
26
|
-
**Validate line count after generation**: `wc -l [this-file]`
|
|
27
|
-
**If > 400 lines**: Condense immediately before continuing!
|
|
15
|
+
**Project**: [Extract from package.json/config]
|
|
16
|
+
**Stack**: [Detect framework, language, auth library]
|
|
17
|
+
**Base URL**: [Find in config/env]
|
|
28
18
|
|
|
29
19
|
---
|
|
30
20
|
|
|
31
|
-
##
|
|
21
|
+
## File Structure
|
|
32
22
|
|
|
33
|
-
|
|
34
|
-
[base_url]/
|
|
35
|
-
├── [resource1]/
|
|
36
|
-
│ ├── GET / List all
|
|
37
|
-
│ ├── POST / Create
|
|
38
|
-
│ ├── GET /:id Get one
|
|
39
|
-
│ ├── PUT /:id Update
|
|
40
|
-
│ └── DELETE /:id Delete
|
|
41
|
-
└── [resource2]/
|
|
42
|
-
```
|
|
23
|
+
<!-- Find and document where API code lives -->
|
|
43
24
|
|
|
44
|
-
|
|
25
|
+
| Purpose | Path |
|
|
26
|
+
|---------|------|
|
|
27
|
+
| Routes/Endpoints | `[scan for router files]` |
|
|
28
|
+
| Controllers/Handlers | `[scan for controller pattern]` |
|
|
29
|
+
| Middleware | `[scan for middleware folder]` |
|
|
30
|
+
| Validation | `[scan for validators/schemas]` |
|
|
31
|
+
| Models/Types | `[scan for models/entities]` |
|
|
45
32
|
|
|
46
33
|
---
|
|
47
34
|
|
|
48
|
-
##
|
|
35
|
+
## Endpoint Pattern
|
|
49
36
|
|
|
50
|
-
|
|
37
|
+
<!-- Extract ONE canonical endpoint showing the full pattern -->
|
|
51
38
|
|
|
52
|
-
```[
|
|
53
|
-
|
|
54
|
-
[
|
|
39
|
+
```[detected_language]
|
|
40
|
+
// Source: [actual_file:lines]
|
|
41
|
+
[extract representative endpoint - prefer one with auth + validation]
|
|
55
42
|
```
|
|
56
43
|
|
|
57
|
-
**
|
|
44
|
+
**To add new endpoint, replicate this structure:**
|
|
45
|
+
1. Define route in `[routes_file]`
|
|
46
|
+
2. Add handler in `[controllers_path]`
|
|
47
|
+
3. Add validation in `[validators_path]` (if needed)
|
|
58
48
|
|
|
59
49
|
---
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
## Validation Pattern
|
|
62
52
|
|
|
63
|
-
|
|
64
|
-
# Source: [file:lines]
|
|
65
|
-
[read_endpoint]
|
|
66
|
-
```
|
|
53
|
+
<!-- Find how this codebase validates requests -->
|
|
67
54
|
|
|
68
|
-
**
|
|
55
|
+
**Approach**: [Detect: Zod/Joi/Yup/Pydantic/class-validator/custom]
|
|
69
56
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```[language]
|
|
75
|
-
# Source: [file:lines]
|
|
76
|
-
[update_endpoint]
|
|
57
|
+
```[lang]
|
|
58
|
+
// Source: [actual_file:lines]
|
|
59
|
+
[extract one validation schema example]
|
|
77
60
|
```
|
|
78
61
|
|
|
79
|
-
**
|
|
62
|
+
**Usage:**
|
|
63
|
+
```[lang]
|
|
64
|
+
// How validation is applied to routes
|
|
65
|
+
[extract middleware/decorator usage]
|
|
66
|
+
```
|
|
80
67
|
|
|
81
68
|
---
|
|
82
69
|
|
|
83
|
-
|
|
70
|
+
## Authentication
|
|
84
71
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
[
|
|
72
|
+
<!-- Find auth middleware/guards -->
|
|
73
|
+
|
|
74
|
+
**Method**: [Detect: JWT/Session/API Key/OAuth]
|
|
75
|
+
|
|
76
|
+
```[lang]
|
|
77
|
+
// Source: [actual_file:lines]
|
|
78
|
+
[extract auth middleware]
|
|
88
79
|
```
|
|
89
80
|
|
|
90
|
-
**
|
|
81
|
+
**Protect route:** `[extract exact syntax used]`
|
|
82
|
+
**Access user:** `[extract how user object is accessed]`
|
|
91
83
|
|
|
92
84
|
---
|
|
93
85
|
|
|
94
|
-
##
|
|
86
|
+
## Response Patterns
|
|
87
|
+
|
|
88
|
+
<!-- Find consistent response structures -->
|
|
95
89
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
[
|
|
90
|
+
**Success format:**
|
|
91
|
+
```json
|
|
92
|
+
[extract actual success response structure from code]
|
|
99
93
|
```
|
|
100
94
|
|
|
101
|
-
**
|
|
95
|
+
**Error format:**
|
|
102
96
|
```json
|
|
103
|
-
|
|
104
|
-
"error": {
|
|
105
|
-
"code": "VALIDATION_ERROR",
|
|
106
|
-
"message": "Validation failed",
|
|
107
|
-
"details": [
|
|
108
|
-
{"field": "[field]", "message": "[error]"}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
111
|
-
}
|
|
97
|
+
[extract actual error response structure from code]
|
|
112
98
|
```
|
|
113
99
|
|
|
100
|
+
**Helper/Utility** (if exists): `[path to response helpers]`
|
|
101
|
+
|
|
114
102
|
---
|
|
115
103
|
|
|
116
|
-
##
|
|
104
|
+
## Status Codes
|
|
117
105
|
|
|
118
|
-
|
|
119
|
-
# Source: [file:lines]
|
|
120
|
-
[auth_middleware]
|
|
121
|
-
```
|
|
106
|
+
<!-- Extract from actual handlers OR document conventions found -->
|
|
122
107
|
|
|
123
|
-
|
|
108
|
+
| Operation | Success | Common Errors |
|
|
109
|
+
|-----------|---------|---------------|
|
|
110
|
+
| Create | [find in POST handlers] | [find error codes] |
|
|
111
|
+
| Read | [find in GET handlers] | [find error codes] |
|
|
112
|
+
| Update | [find in PUT/PATCH] | [find error codes] |
|
|
113
|
+
| Delete | [find in DELETE] | [find error codes] |
|
|
124
114
|
|
|
125
115
|
---
|
|
126
116
|
|
|
127
|
-
##
|
|
128
|
-
|
|
129
|
-
```[language]
|
|
130
|
-
# Source: [file:lines]
|
|
131
|
-
[pagination_example]
|
|
132
|
-
```
|
|
117
|
+
## Error Handling
|
|
133
118
|
|
|
134
|
-
|
|
119
|
+
<!-- Find centralized error handling -->
|
|
135
120
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"data": [],
|
|
140
|
-
"pagination": {
|
|
141
|
-
"page": 1,
|
|
142
|
-
"limit": 20,
|
|
143
|
-
"total": 100,
|
|
144
|
-
"pages": 5
|
|
145
|
-
}
|
|
146
|
-
}
|
|
121
|
+
```[lang]
|
|
122
|
+
// Source: [actual_file:lines]
|
|
123
|
+
[extract error handler/middleware or throwing pattern]
|
|
147
124
|
```
|
|
148
125
|
|
|
126
|
+
**Throw errors using:** `[extract exact syntax]`
|
|
127
|
+
|
|
149
128
|
---
|
|
150
129
|
|
|
151
|
-
##
|
|
130
|
+
## Pagination
|
|
152
131
|
|
|
153
|
-
|
|
154
|
-
|--------|------|---------|
|
|
155
|
-
| 400 | Bad Request | Invalid input |
|
|
156
|
-
| 401 | Unauthorized | Missing/invalid token |
|
|
157
|
-
| 403 | Forbidden | Insufficient permissions |
|
|
158
|
-
| 404 | Not Found | Resource doesn't exist |
|
|
159
|
-
| 422 | Unprocessable | Validation failed |
|
|
160
|
-
| 500 | Server Error | Internal error |
|
|
132
|
+
<!-- Find if pagination exists, extract pattern -->
|
|
161
133
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
"error": {
|
|
166
|
-
"code": "[ERROR_CODE]",
|
|
167
|
-
"message": "[human-readable]",
|
|
168
|
-
"details": "[additional info]"
|
|
169
|
-
}
|
|
170
|
-
}
|
|
134
|
+
```[lang]
|
|
135
|
+
// Source: [actual_file:lines]
|
|
136
|
+
[extract pagination implementation]
|
|
171
137
|
```
|
|
172
138
|
|
|
139
|
+
**Params**: [extract actual query param names used]
|
|
140
|
+
**Defaults**: page=`[find]`, limit=`[find]`
|
|
141
|
+
|
|
173
142
|
---
|
|
174
143
|
|
|
175
|
-
##
|
|
144
|
+
## Conventions
|
|
176
145
|
|
|
177
|
-
|
|
178
|
-
# Source: [file:lines]
|
|
179
|
-
[rate_limit_config]
|
|
180
|
-
```
|
|
146
|
+
<!-- Extract by analyzing multiple endpoints -->
|
|
181
147
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
148
|
+
| Aspect | Convention Used |
|
|
149
|
+
|--------|-----------------|
|
|
150
|
+
| Route naming | `[kebab-case/camelCase/snake_case]` |
|
|
151
|
+
| Controller methods | `[naming pattern found]` |
|
|
152
|
+
| Async handling | `[async/await, promises, try/catch wrapper]` |
|
|
153
|
+
| ID parameter | `[id/:id/uuid format]` |
|
|
186
154
|
|
|
187
155
|
---
|
|
188
156
|
|
|
189
|
-
##
|
|
157
|
+
## Anti-Patterns
|
|
190
158
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
|
194
|
-
|
|
195
|
-
|
|
|
196
|
-
| Use consistent naming | Mix conventions |
|
|
197
|
-
| Version your API | Break clients |
|
|
159
|
+
<!-- Document what NOT to do based on codebase patterns -->
|
|
160
|
+
|
|
161
|
+
| ❌ Avoid | ✅ Use Instead | Reason |
|
|
162
|
+
|----------|----------------|--------|
|
|
163
|
+
| [detect inconsistencies or deprecated patterns] | [correct pattern from code] | [why] |
|
|
198
164
|
|
|
199
165
|
---
|
|
200
166
|
|
|
201
|
-
##
|
|
167
|
+
## Quick Reference
|
|
202
168
|
|
|
203
|
-
|
|
204
|
-
- **Models**: `[path/to/models]`
|
|
205
|
-
- **API Docs**: [URL]
|
|
169
|
+
<!-- Condensed lookup table -->
|
|
206
170
|
|
|
207
|
-
|
|
171
|
+
| Task | Syntax | Example |
|
|
172
|
+
|------|--------|---------|
|
|
173
|
+
| Define route | `[extract]` | `[file:line]` |
|
|
174
|
+
| Add validation | `[extract]` | `[file:line]` |
|
|
175
|
+
| Protect route | `[extract]` | `[file:line]` |
|
|
176
|
+
| Return success | `[extract]` | `[file:line]` |
|
|
177
|
+
| Throw error | `[extract]` | `[file:line]` |
|
|
178
|
+
|
|
179
|
+
---
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Architecture Guide
|
|
3
|
+
|
|
4
|
+
<!--
|
|
5
|
+
GENERATION INSTRUCTIONS:
|
|
6
|
+
1. Identify architectural style (layered/modular/hexagonal/clean/microservices)
|
|
7
|
+
2. Detect design patterns by scanning code structures
|
|
8
|
+
3. Map actual dependencies between components
|
|
9
|
+
4. Extract from: imports, folder structure, class relationships
|
|
10
|
+
5. Output: 300 lines max
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
**Project**: [Extract from config]
|
|
14
|
+
**Style**: [Detect: Layered | Modular | Hexagonal | Clean | Microservices | Monolith]
|
|
15
|
+
**Language**: [Detect] | **Framework**: [Detect]
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Architecture Overview
|
|
20
|
+
|
|
21
|
+
<!-- Generate diagram based on detected style -->
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
[Generate ASCII diagram showing main components and their relationships]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Key Decision**: [Extract or infer WHY this architecture - scalability/simplicity/team structure]
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Component Structure
|
|
32
|
+
|
|
33
|
+
<!-- Scan and document actual project organization -->
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
[root]/
|
|
37
|
+
├── [component1]/ [Detected purpose]
|
|
38
|
+
├── [component2]/ [Detected purpose]
|
|
39
|
+
├── [component3]/ [Detected purpose]
|
|
40
|
+
├── [shared/common]/ [Detected purpose]
|
|
41
|
+
└── [entry point]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Design Patterns Detected
|
|
47
|
+
|
|
48
|
+
<!-- Scan codebase for these patterns, document only those found -->
|
|
49
|
+
|
|
50
|
+
| Pattern | Usage | Location |
|
|
51
|
+
|---------|-------|----------|
|
|
52
|
+
| [Repository] | [How it's used] | `[file:line]` |
|
|
53
|
+
| [Factory] | [How it's used] | `[file:line]` |
|
|
54
|
+
| [Singleton] | [How it's used] | `[file:line]` |
|
|
55
|
+
| [Dependency Injection] | [How it's used] | `[file:line]` |
|
|
56
|
+
| [Observer/Event] | [How it's used] | `[file:line]` |
|
|
57
|
+
| [Strategy] | [How it's used] | `[file:line]` |
|
|
58
|
+
|
|
59
|
+
### Primary Pattern: [Most significant pattern]
|
|
60
|
+
|
|
61
|
+
```[lang]
|
|
62
|
+
// Source: [file:lines]
|
|
63
|
+
[Extract canonical example of main pattern]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**When to use**: [Detect from usage context]
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Layer/Module Responsibilities
|
|
71
|
+
|
|
72
|
+
<!-- Adapt based on detected architecture style -->
|
|
73
|
+
|
|
74
|
+
| Component | Responsibility | Depends On | Depended By |
|
|
75
|
+
|-----------|----------------|------------|-------------|
|
|
76
|
+
| [Layer/Module 1] | [Detected role] | [List] | [List] |
|
|
77
|
+
| [Layer/Module 2] | [Detected role] | [List] | [List] |
|
|
78
|
+
| [Layer/Module 3] | [Detected role] | [List] | [List] |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Dependency Rules
|
|
83
|
+
|
|
84
|
+
<!-- Extract from imports analysis -->
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
[Component A] ──► [Component B] ──► [Component C]
|
|
88
|
+
│
|
|
89
|
+
▼
|
|
90
|
+
[Shared/Core]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
| Rule | Enforced By |
|
|
94
|
+
|------|-------------|
|
|
95
|
+
| [e.g., Controllers never import Repositories directly] | [Convention / Linter / DI Container] |
|
|
96
|
+
| [e.g., Domain has no external dependencies] | [Convention / Module boundary] |
|
|
97
|
+
|
|
98
|
+
**Violations to avoid:**
|
|
99
|
+
- ❌ [Detected anti-pattern or rule]
|
|
100
|
+
- ❌ [Detected anti-pattern or rule]
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Data Flow
|
|
105
|
+
|
|
106
|
+
<!-- Trace a typical request through the system -->
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
[Entry] → [Component1] → [Component2] → [Component3] → [Storage/External]
|
|
110
|
+
│ │ │ │
|
|
111
|
+
│ [Transform] [Process] [Persist]
|
|
112
|
+
│ │ │ │
|
|
113
|
+
└───────────┴──────────────┴──────────────┘
|
|
114
|
+
Response
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Example flow** (`[common operation]`):
|
|
118
|
+
1. `[entry point]` receives request
|
|
119
|
+
2. `[component]` validates/transforms
|
|
120
|
+
3. `[component]` executes logic
|
|
121
|
+
4. `[component]` persists/fetches data
|
|
122
|
+
5. Response returns through chain
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Key Abstractions
|
|
127
|
+
|
|
128
|
+
<!-- Find interfaces/base classes that define contracts -->
|
|
129
|
+
|
|
130
|
+
| Abstraction | Purpose | Implementations |
|
|
131
|
+
|-------------|---------|-----------------|
|
|
132
|
+
| `[Interface/Base]` | [Contract purpose] | `[file:line]` |
|
|
133
|
+
| `[Interface/Base]` | [Contract purpose] | `[file:line]` |
|
|
134
|
+
|
|
135
|
+
```[lang]
|
|
136
|
+
// Source: [file:lines]
|
|
137
|
+
[Extract key interface/abstract class]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Adding New Features
|
|
143
|
+
|
|
144
|
+
<!-- Document extension points based on existing patterns -->
|
|
145
|
+
|
|
146
|
+
### To add new [entity/resource/feature]:
|
|
147
|
+
|
|
148
|
+
1. **[Component1]**: Create `[path/pattern]`
|
|
149
|
+
2. **[Component2]**: Create `[path/pattern]`
|
|
150
|
+
3. **[Component3]**: Create `[path/pattern]`
|
|
151
|
+
4. **Wire up**: [How components connect - DI/imports/registration]
|
|
152
|
+
|
|
153
|
+
### To add new [integration/external service]:
|
|
154
|
+
|
|
155
|
+
1. Create adapter in `[path]`
|
|
156
|
+
2. Implement interface `[interface name]`
|
|
157
|
+
3. Register in `[config/di location]`
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Configuration & Environment
|
|
162
|
+
|
|
163
|
+
<!-- Find how config flows through architecture -->
|
|
164
|
+
|
|
165
|
+
| Config Type | Location | Accessed Via |
|
|
166
|
+
|-------------|----------|--------------|
|
|
167
|
+
| Environment | `[.env / env files]` | `[config module/pattern]` |
|
|
168
|
+
| App Config | `[config files]` | `[how injected/imported]` |
|
|
169
|
+
| Secrets | `[secrets handling]` | `[access pattern]` |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Boundaries Summary
|
|
174
|
+
|
|
175
|
+
<!-- Concise rules for AI to follow -->
|
|
176
|
+
|
|
177
|
+
| ✅ DO | ❌ DON'T |
|
|
178
|
+
|-------|----------|
|
|
179
|
+
| [Detected convention] | [Detected anti-pattern] |
|
|
180
|
+
| [Detected convention] | [Detected anti-pattern] |
|
|
181
|
+
| [Detected convention] | [Detected anti-pattern] |
|
|
182
|
+
| Follow existing [pattern] for new code | Introduce new patterns without reason |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Quick Reference
|
|
187
|
+
|
|
188
|
+
| Need | Location | Pattern |
|
|
189
|
+
|------|----------|---------|
|
|
190
|
+
| Entry point | `[path]` | - |
|
|
191
|
+
| Business logic | `[path]` | [pattern] |
|
|
192
|
+
| Data access | `[path]` | [pattern] |
|
|
193
|
+
| External services | `[path]` | [pattern] |
|
|
194
|
+
| Shared utilities | `[path]` | - |
|
|
195
|
+
| Configuration | `[path]` | [pattern] |
|
|
196
|
+
|
|
197
|
+
---
|