@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,210 +1,298 @@
|
|
|
1
|
+
---
|
|
1
2
|
# Development Practices
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
<!--
|
|
5
|
+
GENERATION INSTRUCTIONS:
|
|
6
|
+
1. Scan for linter/formatter configs (.eslintrc, .prettierrc, pyproject.toml, etc.)
|
|
7
|
+
2. Extract naming patterns from existing code
|
|
8
|
+
3. Find error handling patterns in services/controllers
|
|
9
|
+
4. Locate logging usage and configuration
|
|
10
|
+
5. Check for pre-commit hooks, CI config
|
|
11
|
+
6. Output: 150-300 lines max
|
|
12
|
+
-->
|
|
6
13
|
|
|
7
|
-
**
|
|
8
|
-
**
|
|
9
|
-
**
|
|
14
|
+
**Project**: [Extract from config]
|
|
15
|
+
**Language**: [Detect] | **Framework**: [Detect]
|
|
16
|
+
**Linter**: [Detect] | **Formatter**: [Detect]
|
|
10
17
|
|
|
11
18
|
---
|
|
12
19
|
|
|
13
|
-
##
|
|
20
|
+
## Code Style
|
|
21
|
+
|
|
22
|
+
<!-- Extract from linter config + analyze existing code patterns -->
|
|
23
|
+
|
|
24
|
+
### Naming Conventions
|
|
14
25
|
|
|
15
|
-
|
|
26
|
+
| Element | Convention | Example |
|
|
27
|
+
|---------|------------|---------|
|
|
28
|
+
| Files | `[kebab-case/snake_case/PascalCase]` | `[actual example from codebase]` |
|
|
29
|
+
| Classes | `[PascalCase]` | `[actual example]` |
|
|
30
|
+
| Functions | `[camelCase/snake_case]` | `[actual example]` |
|
|
31
|
+
| Variables | `[camelCase/snake_case]` | `[actual example]` |
|
|
32
|
+
| Constants | `[UPPER_SNAKE_CASE]` | `[actual example]` |
|
|
33
|
+
| Private | `[_prefix/no prefix/#private]` | `[actual example]` |
|
|
34
|
+
|
|
35
|
+
### File Organization
|
|
36
|
+
|
|
37
|
+
```[lang]
|
|
38
|
+
// Source: [representative file path]
|
|
39
|
+
// Standard file structure in this codebase:
|
|
40
|
+
|
|
41
|
+
[Extract typical file structure showing imports, class/function order]
|
|
42
|
+
```
|
|
16
43
|
|
|
17
|
-
|
|
18
|
-
- ✅ Code examples: 5-15 lines (NEVER > 20)
|
|
19
|
-
- ✅ ONE example per pattern
|
|
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
|
|
44
|
+
### Import Order
|
|
25
45
|
|
|
26
|
-
|
|
27
|
-
|
|
46
|
+
<!-- Extract from linter config or consistent patterns -->
|
|
47
|
+
|
|
48
|
+
```[lang]
|
|
49
|
+
// 1. [Standard library / Built-ins]
|
|
50
|
+
// 2. [External packages / Third-party]
|
|
51
|
+
// 3. [Internal modules / Local imports]
|
|
52
|
+
|
|
53
|
+
[Extract example showing import organization]
|
|
54
|
+
```
|
|
28
55
|
|
|
29
56
|
---
|
|
30
57
|
|
|
31
|
-
##
|
|
58
|
+
## Code Quality
|
|
59
|
+
|
|
60
|
+
<!-- Find linter/formatter configuration -->
|
|
61
|
+
|
|
62
|
+
### Commands
|
|
63
|
+
|
|
64
|
+
| Action | Command | Auto-fix |
|
|
65
|
+
|--------|---------|----------|
|
|
66
|
+
| Lint | `[exact command]` | `[fix command]` |
|
|
67
|
+
| Format | `[exact command]` | `[format write command]` |
|
|
68
|
+
| Type check | `[command or N/A]` | - |
|
|
69
|
+
| All checks | `[combined command if exists]` | - |
|
|
32
70
|
|
|
33
|
-
###
|
|
71
|
+
### Configuration Files
|
|
34
72
|
|
|
35
|
-
|
|
|
36
|
-
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
| `[ServerError]` | Internal error | 500 | [file:lines] |
|
|
73
|
+
| Tool | Config File |
|
|
74
|
+
|------|-------------|
|
|
75
|
+
| Linter | `[.eslintrc / .pylintrc / etc.]` |
|
|
76
|
+
| Formatter | `[.prettierrc / pyproject.toml / etc.]` |
|
|
77
|
+
| Type checker | `[tsconfig.json / mypy.ini / etc.]` |
|
|
41
78
|
|
|
42
|
-
###
|
|
79
|
+
### Pre-commit Hooks
|
|
43
80
|
|
|
44
|
-
|
|
45
|
-
# Raise - Source: [file:lines]
|
|
46
|
-
[raise_example]
|
|
81
|
+
<!-- Check for .pre-commit-config.yaml, husky, lint-staged -->
|
|
47
82
|
|
|
48
|
-
|
|
49
|
-
|
|
83
|
+
```bash
|
|
84
|
+
# Setup (if not auto-installed)
|
|
85
|
+
[pre-commit install command or N/A]
|
|
50
86
|
```
|
|
51
87
|
|
|
52
|
-
|
|
88
|
+
**Runs on commit**: [List what runs - lint, format, tests]
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Error Handling
|
|
93
|
+
|
|
94
|
+
<!-- Extract exception classes and handling patterns -->
|
|
95
|
+
|
|
96
|
+
### Exception Types
|
|
53
97
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
98
|
+
| Exception | Use When | Source |
|
|
99
|
+
|-----------|----------|--------|
|
|
100
|
+
| `[ValidationError]` | Invalid input data | `[file:line]` |
|
|
101
|
+
| `[NotFoundError]` | Resource doesn't exist | `[file:line]` |
|
|
102
|
+
| `[UnauthorizedError]` | Auth required/failed | `[file:line]` |
|
|
103
|
+
| `[ForbiddenError]` | Permission denied | `[file:line]` |
|
|
104
|
+
| `[ConflictError]` | State conflict | `[file:line]` |
|
|
105
|
+
|
|
106
|
+
### Pattern
|
|
107
|
+
|
|
108
|
+
```[lang]
|
|
109
|
+
// Source: [file:lines]
|
|
110
|
+
[Extract canonical error throwing/handling pattern]
|
|
62
111
|
```
|
|
63
112
|
|
|
64
|
-
**Rules
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
- ❌ Expose internal details
|
|
113
|
+
**Rules:**
|
|
114
|
+
- Throw specific exceptions from `[exceptions path]`
|
|
115
|
+
- Let `[error handler/middleware]` convert to response
|
|
116
|
+
- ❌ Never catch-and-ignore silently
|
|
69
117
|
|
|
70
118
|
---
|
|
71
119
|
|
|
72
120
|
## Logging
|
|
73
121
|
|
|
74
|
-
|
|
122
|
+
<!-- Find logging configuration and usage patterns -->
|
|
75
123
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
[
|
|
124
|
+
### Setup
|
|
125
|
+
|
|
126
|
+
```[lang]
|
|
127
|
+
// Source: [file:lines]
|
|
128
|
+
[Extract logger initialization/import pattern]
|
|
79
129
|
```
|
|
80
130
|
|
|
81
|
-
###
|
|
131
|
+
### Usage Pattern
|
|
82
132
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| WARNING | Recoverable issues | `[example]` |
|
|
88
|
-
| ERROR | Failures | `[example]` |
|
|
133
|
+
```[lang]
|
|
134
|
+
// Source: [file:lines]
|
|
135
|
+
[Extract example showing structured logging with context]
|
|
136
|
+
```
|
|
89
137
|
|
|
90
|
-
###
|
|
138
|
+
### Levels
|
|
91
139
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
140
|
+
| Level | Use For |
|
|
141
|
+
|-------|---------|
|
|
142
|
+
| `debug` | Development troubleshooting |
|
|
143
|
+
| `info` | Significant operations (startup, requests) |
|
|
144
|
+
| `warn` | Recoverable issues, deprecations |
|
|
145
|
+
| `error` | Failures requiring attention |
|
|
95
146
|
|
|
96
|
-
|
|
97
|
-
[bad_logging]
|
|
98
|
-
```
|
|
147
|
+
### Rules
|
|
99
148
|
|
|
100
|
-
|
|
101
|
-
- ✅
|
|
102
|
-
-
|
|
103
|
-
- ❌
|
|
104
|
-
- ❌ Log in hot paths
|
|
149
|
+
- ✅ Include context: `{ userId, requestId, [relevant ids] }`
|
|
150
|
+
- ✅ Use `[detected logger]` from `[import path]`
|
|
151
|
+
- ❌ No secrets, passwords, tokens in logs
|
|
152
|
+
- ❌ No excessive logging in loops/hot paths
|
|
105
153
|
|
|
106
154
|
---
|
|
107
155
|
|
|
108
|
-
##
|
|
156
|
+
## Async Patterns
|
|
109
157
|
|
|
110
|
-
|
|
158
|
+
<!-- Detect if async/await, promises, or sync patterns used -->
|
|
111
159
|
|
|
112
|
-
**
|
|
113
|
-
```bash
|
|
114
|
-
[VAR1]=[description]
|
|
115
|
-
[VAR2]=[description]
|
|
116
|
-
```
|
|
160
|
+
**Style**: [async/await | Promises | Callbacks | Sync | Mixed]
|
|
117
161
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
[
|
|
162
|
+
```[lang]
|
|
163
|
+
// Source: [file:lines]
|
|
164
|
+
[Extract canonical async pattern]
|
|
121
165
|
```
|
|
122
166
|
|
|
123
|
-
###
|
|
167
|
+
### Error Handling in Async
|
|
124
168
|
|
|
125
|
-
```[
|
|
126
|
-
|
|
127
|
-
[
|
|
169
|
+
```[lang]
|
|
170
|
+
// Source: [file:lines]
|
|
171
|
+
[Extract async error handling - try/catch wrapper, error middleware, etc.]
|
|
128
172
|
```
|
|
129
173
|
|
|
130
|
-
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Configuration & Environment
|
|
177
|
+
|
|
178
|
+
<!-- Find how config is loaded and validated -->
|
|
131
179
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
[
|
|
180
|
+
### Loading Pattern
|
|
181
|
+
|
|
182
|
+
```[lang]
|
|
183
|
+
// Source: [file:lines]
|
|
184
|
+
[Extract config loading/validation pattern]
|
|
135
185
|
```
|
|
136
186
|
|
|
137
|
-
|
|
187
|
+
### Required Variables
|
|
188
|
+
|
|
189
|
+
| Variable | Purpose | Example |
|
|
190
|
+
|----------|---------|---------|
|
|
191
|
+
| `[VAR_NAME]` | [Purpose] | `[example value]` |
|
|
192
|
+
| `[VAR_NAME]` | [Purpose] | `[example value]` |
|
|
138
193
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
194
|
+
### Accessing Config
|
|
195
|
+
|
|
196
|
+
```[lang]
|
|
197
|
+
// Use this pattern to access configuration
|
|
198
|
+
[Extract how to import/use config values]
|
|
199
|
+
```
|
|
144
200
|
|
|
145
201
|
---
|
|
146
202
|
|
|
147
|
-
##
|
|
203
|
+
## Dependencies
|
|
148
204
|
|
|
149
|
-
|
|
205
|
+
<!-- Find package manager and conventions -->
|
|
150
206
|
|
|
151
|
-
|
|
152
|
-
# Install
|
|
153
|
-
[install_command]
|
|
207
|
+
### Adding Dependencies
|
|
154
208
|
|
|
155
|
-
|
|
156
|
-
|
|
209
|
+
```bash
|
|
210
|
+
# Production dependency
|
|
211
|
+
[npm install X / pip install X / etc.]
|
|
157
212
|
|
|
158
|
-
#
|
|
159
|
-
[
|
|
213
|
+
# Dev dependency
|
|
214
|
+
[npm install -D X / pip install X --dev / etc.]
|
|
160
215
|
```
|
|
161
216
|
|
|
162
|
-
###
|
|
217
|
+
### Update Process
|
|
163
218
|
|
|
164
219
|
```bash
|
|
165
|
-
#
|
|
166
|
-
[
|
|
220
|
+
# Check outdated
|
|
221
|
+
[command]
|
|
222
|
+
|
|
223
|
+
# Update
|
|
224
|
+
[command]
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Lock file**: `[package-lock.json / poetry.lock / etc.]` - ✅ Always commit
|
|
228
|
+
|
|
229
|
+
---
|
|
167
230
|
|
|
168
|
-
|
|
169
|
-
[dependency_command]
|
|
231
|
+
## Git Workflow
|
|
170
232
|
|
|
171
|
-
|
|
172
|
-
[db_setup_command]
|
|
233
|
+
<!-- Extract from CONTRIBUTING.md, .github, or infer from history -->
|
|
173
234
|
|
|
174
|
-
|
|
175
|
-
|
|
235
|
+
### Branch Naming
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
[feature/bugfix/hotfix]/[ticket-id]-[short-description]
|
|
176
239
|
```
|
|
177
240
|
|
|
178
|
-
**
|
|
241
|
+
**Examples**: `feature/ABC-123-add-user-auth`, `bugfix/fix-login-redirect`
|
|
179
242
|
|
|
180
|
-
|
|
243
|
+
### Commit Messages
|
|
244
|
+
|
|
245
|
+
<!-- Detect conventional commits, or extract pattern -->
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
[type]([scope]): [description]
|
|
249
|
+
|
|
250
|
+
[body - optional]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Types**: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
|
|
181
254
|
|
|
182
|
-
|
|
255
|
+
### PR Checklist
|
|
183
256
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
| Lint | `[command]` | Auto-fix with `[fix_flag]` |
|
|
188
|
-
| Format | `[command]` | [Notes] |
|
|
189
|
-
| Test | `[command]` | ONLY if user requests |
|
|
190
|
-
| Build | `[command]` | [Notes] |
|
|
257
|
+
- [ ] Linting passes (`[lint command]`)
|
|
258
|
+
- [ ] Tests pass (`[test command]`)
|
|
259
|
+
- [ ] [Other checks from CI or CONTRIBUTING.md]
|
|
191
260
|
|
|
192
261
|
---
|
|
193
262
|
|
|
194
|
-
##
|
|
263
|
+
## Common Patterns
|
|
195
264
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
|
199
|
-
|
|
265
|
+
<!-- Extract recurring patterns specific to this codebase -->
|
|
266
|
+
|
|
267
|
+
| Pattern | When to Use | Example |
|
|
268
|
+
|---------|-------------|---------|
|
|
269
|
+
| `[Helper/Utility name]` | [Use case] | `[file:line]` |
|
|
270
|
+
| `[Decorator/Middleware]` | [Use case] | `[file:line]` |
|
|
271
|
+
| `[Factory/Builder]` | [Use case] | `[file:line]` |
|
|
200
272
|
|
|
201
273
|
---
|
|
202
274
|
|
|
203
|
-
##
|
|
275
|
+
## Don't Do
|
|
276
|
+
|
|
277
|
+
<!-- Extract anti-patterns from linter rules or code review patterns -->
|
|
204
278
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
-
|
|
279
|
+
| ❌ Avoid | ✅ Instead | Why |
|
|
280
|
+
|----------|-----------|-----|
|
|
281
|
+
| `[anti-pattern]` | `[correct pattern]` | [reason] |
|
|
282
|
+
| `[anti-pattern]` | `[correct pattern]` | [reason] |
|
|
283
|
+
| `[anti-pattern]` | `[correct pattern]` | [reason] |
|
|
209
284
|
|
|
210
285
|
---
|
|
286
|
+
|
|
287
|
+
## Quick Reference
|
|
288
|
+
|
|
289
|
+
| Need | Location |
|
|
290
|
+
|------|----------|
|
|
291
|
+
| Linter config | `[path]` |
|
|
292
|
+
| Formatter config | `[path]` |
|
|
293
|
+
| Exception classes | `[path]` |
|
|
294
|
+
| Logger setup | `[path]` |
|
|
295
|
+
| Config loader | `[path]` |
|
|
296
|
+
| Utilities | `[path]` |
|
|
297
|
+
|
|
298
|
+
---
|