@mytechtoday/augment-extensions 1.4.0 → 1.5.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/augment-extensions/coding-standards/c/CHANGELOG.md +55 -0
- package/augment-extensions/coding-standards/c/LICENSE +22 -0
- package/augment-extensions/coding-standards/c/README.md +167 -0
- package/augment-extensions/coding-standards/c/config/defaults.json +26 -0
- package/augment-extensions/coding-standards/c/config/examples/embedded.yaml +25 -0
- package/augment-extensions/coding-standards/c/config/examples/systems.json +31 -0
- package/augment-extensions/coding-standards/c/config/schema.json +244 -0
- package/augment-extensions/coding-standards/c/docs/API.md +613 -0
- package/augment-extensions/coding-standards/c/docs/CONFIGURATION.md +259 -0
- package/augment-extensions/coding-standards/c/docs/USER_GUIDE.md +567 -0
- package/augment-extensions/coding-standards/c/examples/drivers/Makefile +33 -0
- package/augment-extensions/coding-standards/c/examples/drivers/README.md +192 -0
- package/augment-extensions/coding-standards/c/examples/drivers/dma-example.c +224 -0
- package/augment-extensions/coding-standards/c/examples/drivers/example.dts +64 -0
- package/augment-extensions/coding-standards/c/examples/drivers/platform-driver.c +174 -0
- package/augment-extensions/coding-standards/c/examples/embedded/README.md +167 -0
- package/augment-extensions/coding-standards/c/examples/embedded/gpio-control.c +172 -0
- package/augment-extensions/coding-standards/c/examples/embedded/timer-isr.c +198 -0
- package/augment-extensions/coding-standards/c/examples/embedded/uart-communication.c +212 -0
- package/augment-extensions/coding-standards/c/examples/kernel/Makefile +82 -0
- package/augment-extensions/coding-standards/c/examples/kernel/README.md +168 -0
- package/augment-extensions/coding-standards/c/examples/kernel/char-device.c +198 -0
- package/augment-extensions/coding-standards/c/examples/kernel/proc-file.c +131 -0
- package/augment-extensions/coding-standards/c/examples/kernel/simple-module.c +111 -0
- package/augment-extensions/coding-standards/c/examples/legacy/Makefile +62 -0
- package/augment-extensions/coding-standards/c/examples/legacy/README.md +255 -0
- package/augment-extensions/coding-standards/c/examples/legacy/c89-to-c11-migration.c +268 -0
- package/augment-extensions/coding-standards/c/examples/legacy/compatibility-layer.c +239 -0
- package/augment-extensions/coding-standards/c/examples/networking/Makefile +35 -0
- package/augment-extensions/coding-standards/c/examples/networking/README.md +207 -0
- package/augment-extensions/coding-standards/c/examples/networking/protocol-parser.c +270 -0
- package/augment-extensions/coding-standards/c/examples/networking/tcp-server.c +197 -0
- package/augment-extensions/coding-standards/c/examples/networking/udp-multicast.c +220 -0
- package/augment-extensions/coding-standards/c/examples/realtime/Makefile +53 -0
- package/augment-extensions/coding-standards/c/examples/realtime/README.md +199 -0
- package/augment-extensions/coding-standards/c/examples/realtime/deadline-monitoring.c +260 -0
- package/augment-extensions/coding-standards/c/examples/realtime/priority-scheduling.c +258 -0
- package/augment-extensions/coding-standards/c/examples/systems/Makefile +34 -0
- package/augment-extensions/coding-standards/c/examples/systems/README.md +123 -0
- package/augment-extensions/coding-standards/c/examples/systems/ipc-pipes.c +181 -0
- package/augment-extensions/coding-standards/c/examples/systems/process-management.c +153 -0
- package/augment-extensions/coding-standards/c/examples/systems/signal-handling.c +162 -0
- package/augment-extensions/coding-standards/c/module.json +149 -0
- package/augment-extensions/coding-standards/c/rules/categories/drivers.md +635 -0
- package/augment-extensions/coding-standards/c/rules/categories/embedded.md +510 -0
- package/augment-extensions/coding-standards/c/rules/categories/kernel.md +653 -0
- package/augment-extensions/coding-standards/c/rules/categories/legacy.md +526 -0
- package/augment-extensions/coding-standards/c/rules/categories/networking.md +735 -0
- package/augment-extensions/coding-standards/c/rules/categories/realtime.md +631 -0
- package/augment-extensions/coding-standards/c/rules/categories/systems.md +586 -0
- package/augment-extensions/coding-standards/c/rules/universal/const-correctness.md +275 -0
- package/augment-extensions/coding-standards/c/rules/universal/documentation.md +251 -0
- package/augment-extensions/coding-standards/c/rules/universal/error-handling.md +250 -0
- package/augment-extensions/coding-standards/c/rules/universal/header-guards.md +254 -0
- package/augment-extensions/coding-standards/c/rules/universal/memory-safety.md +233 -0
- package/augment-extensions/coding-standards/c/rules/universal/naming.md +146 -0
- package/augment-extensions/coding-standards/c/src/conflict-detector.ts +461 -0
- package/augment-extensions/coding-standards/c/src/prompt-generator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-evaluator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-override.ts +427 -0
- package/augment-extensions/coding-standards/c/src/template-engine.ts +217 -0
- package/augment-extensions/coding-standards/c/templates/prompts/drivers.txt +191 -0
- package/augment-extensions/coding-standards/c/templates/prompts/embedded.txt +164 -0
- package/augment-extensions/coding-standards/c/templates/prompts/kernel.txt +175 -0
- package/augment-extensions/coding-standards/c/templates/prompts/legacy.txt +280 -0
- package/augment-extensions/coding-standards/c/templates/prompts/networking.txt +259 -0
- package/augment-extensions/coding-standards/c/templates/prompts/realtime.txt +219 -0
- package/augment-extensions/coding-standards/c/templates/prompts/systems.txt +147 -0
- package/augment-extensions/coding-standards/c/tests/integration/category-specific.test.ts +356 -0
- package/augment-extensions/coding-standards/c/tests/integration/end-to-end-workflow.test.ts +377 -0
- package/augment-extensions/coding-standards/c/tests/performance/benchmarks.test.ts +407 -0
- package/augment-extensions/coding-standards/c/tests/unit/config-manager.test.ts +345 -0
- package/augment-extensions/coding-standards/c/tests/unit/conflict-detector.test.ts +294 -0
- package/augment-extensions/coding-standards/c/tests/unit/prompt-generator.test.ts +174 -0
- package/augment-extensions/coding-standards/c/tests/unit/registry.test.ts +313 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-evaluator.test.ts +318 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-override.test.ts +326 -0
- package/augment-extensions/coding-standards/c/tests/unit/template-engine.test.ts +314 -0
- package/augment-extensions/coding-standards/go/CHARACTER-COUNT-REPORT.md +135 -0
- package/augment-extensions/coding-standards/go/PHASE1-COMPLETION.md +146 -0
- package/augment-extensions/coding-standards/go/PHASE4-COMPLETION.md +184 -0
- package/augment-extensions/coding-standards/go/README.md +200 -0
- package/augment-extensions/coding-standards/go/VALIDATION-CHECKLIST.md +154 -0
- package/augment-extensions/coding-standards/go/config/examples/example-cli.json +15 -0
- package/augment-extensions/coding-standards/go/config/examples/example-microservices.json +21 -0
- package/augment-extensions/coding-standards/go/config/examples/example-multi-category.yaml +24 -0
- package/augment-extensions/coding-standards/go/config/examples/example-web.json +15 -0
- package/augment-extensions/coding-standards/go/config/schema.json +110 -0
- package/augment-extensions/coding-standards/go/docs/CATEGORIES.md +221 -0
- package/augment-extensions/coding-standards/go/docs/CONFIGURATION.md +198 -0
- package/augment-extensions/coding-standards/go/docs/TROUBLESHOOTING.md +285 -0
- package/augment-extensions/coding-standards/go/examples/cli/cobra-app.go +287 -0
- package/augment-extensions/coding-standards/go/examples/cloud-native-app.go +217 -0
- package/augment-extensions/coding-standards/go/examples/devops-tool.go +250 -0
- package/augment-extensions/coding-standards/go/examples/distributed-system.go +247 -0
- package/augment-extensions/coding-standards/go/examples/microservices/grpc-service.go +253 -0
- package/augment-extensions/coding-standards/go/examples/rest-api.go +270 -0
- package/augment-extensions/coding-standards/go/examples/web/http-server.go +224 -0
- package/augment-extensions/coding-standards/go/module.json +139 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/api-versioning.md +149 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rate-limiting.md +209 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rest-api-design.md +183 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/cloud-config.md +193 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/health-checks.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/kubernetes.md +180 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/automation.md +179 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/ci-cd-integration.md +147 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/infrastructure-as-code.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/caching.md +150 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/consensus.md +187 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/event-sourcing.md +246 -0
- package/augment-extensions/coding-standards/go/rules/cli/command-parsing.md +264 -0
- package/augment-extensions/coding-standards/go/rules/cli/configuration.md +268 -0
- package/augment-extensions/coding-standards/go/rules/cli/cross-platform.md +324 -0
- package/augment-extensions/coding-standards/go/rules/microservices/distributed-tracing.md +253 -0
- package/augment-extensions/coding-standards/go/rules/microservices/grpc.md +257 -0
- package/augment-extensions/coding-standards/go/rules/microservices/metrics.md +278 -0
- package/augment-extensions/coding-standards/go/rules/microservices/service-discovery.md +249 -0
- package/augment-extensions/coding-standards/go/rules/universal/code-organization.md +221 -0
- package/augment-extensions/coding-standards/go/rules/universal/documentation.md +269 -0
- package/augment-extensions/coding-standards/go/rules/universal/performance.md +323 -0
- package/augment-extensions/coding-standards/go/rules/universal/testing.md +162 -0
- package/augment-extensions/coding-standards/go/rules/web/graceful-shutdown.md +249 -0
- package/augment-extensions/coding-standards/go/rules/web/http-handlers.md +164 -0
- package/augment-extensions/coding-standards/go/rules/web/middleware.md +234 -0
- package/augment-extensions/coding-standards/go/rules/web/routing.md +251 -0
- package/augment-extensions/coding-standards/go/templates/prompts/api.md +160 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cli.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cloud-native.md +121 -0
- package/augment-extensions/coding-standards/go/templates/prompts/devops.md +146 -0
- package/augment-extensions/coding-standards/go/templates/prompts/distributed.md +133 -0
- package/augment-extensions/coding-standards/go/templates/prompts/microservices.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/web.md +181 -0
- package/augment-extensions/coding-standards/go/tests/integration/module-integration.test.ts +164 -0
- package/augment-extensions/coding-standards/go/tests/unit/category-selection.test.ts +147 -0
- package/augment-extensions/coding-standards/go/tests/unit/module-structure.test.ts +154 -0
- package/augment-extensions/coding-standards/go/tests/validate-character-count.ps1 +13 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.ps1 +148 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.sh +135 -0
- package/cli/dist/analysis/ast-parser.d.ts +47 -0
- package/cli/dist/analysis/ast-parser.d.ts.map +1 -0
- package/cli/dist/analysis/ast-parser.js +161 -0
- package/cli/dist/analysis/ast-parser.js.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts +27 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.js +189 -0
- package/cli/dist/analysis/complexity-analyzer.js.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts +23 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.js +237 -0
- package/cli/dist/analysis/dependency-analyzer.js.map +1 -0
- package/cli/dist/analysis/index.d.ts +9 -0
- package/cli/dist/analysis/index.d.ts.map +1 -0
- package/cli/dist/analysis/index.js +25 -0
- package/cli/dist/analysis/index.js.map +1 -0
- package/cli/dist/analysis/security-scanner.d.ts +11 -0
- package/cli/dist/analysis/security-scanner.d.ts.map +1 -0
- package/cli/dist/analysis/security-scanner.js +294 -0
- package/cli/dist/analysis/security-scanner.js.map +1 -0
- package/cli/dist/analysis/types.d.ts +151 -0
- package/cli/dist/analysis/types.d.ts.map +1 -0
- package/cli/dist/analysis/types.js +6 -0
- package/cli/dist/analysis/types.js.map +1 -0
- package/cli/dist/cli.js +24 -0
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/code-analysis.d.ts +11 -0
- package/cli/dist/commands/code-analysis.d.ts.map +1 -0
- package/cli/dist/commands/code-analysis.js +412 -0
- package/cli/dist/commands/code-analysis.js.map +1 -0
- package/modules.md +99 -3
- package/package.json +14 -2
- package/cli/dist/commands/agent.d.ts +0 -37
- package/cli/dist/commands/agent.d.ts.map +0 -1
- package/cli/dist/commands/agent.js +0 -222
- package/cli/dist/commands/agent.js.map +0 -1
- package/cli/dist/commands/beads.d.ts +0 -64
- package/cli/dist/commands/beads.d.ts.map +0 -1
- package/cli/dist/commands/beads.js +0 -377
- package/cli/dist/commands/beads.js.map +0 -1
- package/cli/dist/commands/change.d.ts +0 -54
- package/cli/dist/commands/change.d.ts.map +0 -1
- package/cli/dist/commands/change.js +0 -243
- package/cli/dist/commands/change.js.map +0 -1
- package/cli/dist/commands/clean.d.ts +0 -15
- package/cli/dist/commands/clean.d.ts.map +0 -1
- package/cli/dist/commands/clean.js +0 -63
- package/cli/dist/commands/clean.js.map +0 -1
- package/cli/dist/commands/clone.d.ts +0 -15
- package/cli/dist/commands/clone.d.ts.map +0 -1
- package/cli/dist/commands/clone.js +0 -49
- package/cli/dist/commands/clone.js.map +0 -1
- package/cli/dist/commands/config.d.ts +0 -33
- package/cli/dist/commands/config.d.ts.map +0 -1
- package/cli/dist/commands/config.js +0 -166
- package/cli/dist/commands/config.js.map +0 -1
- package/cli/dist/commands/context.d.ts +0 -38
- package/cli/dist/commands/context.d.ts.map +0 -1
- package/cli/dist/commands/context.js +0 -205
- package/cli/dist/commands/context.js.map +0 -1
- package/cli/dist/commands/create.d.ts +0 -18
- package/cli/dist/commands/create.d.ts.map +0 -1
- package/cli/dist/commands/create.js +0 -178
- package/cli/dist/commands/create.js.map +0 -1
- package/cli/dist/commands/diff.d.ts +0 -19
- package/cli/dist/commands/diff.d.ts.map +0 -1
- package/cli/dist/commands/diff.js +0 -104
- package/cli/dist/commands/diff.js.map +0 -1
- package/cli/dist/commands/doctor.d.ts +0 -14
- package/cli/dist/commands/doctor.d.ts.map +0 -1
- package/cli/dist/commands/doctor.js +0 -62
- package/cli/dist/commands/doctor.js.map +0 -1
- package/cli/dist/commands/export.d.ts +0 -28
- package/cli/dist/commands/export.d.ts.map +0 -1
- package/cli/dist/commands/export.js +0 -135
- package/cli/dist/commands/export.js.map +0 -1
- package/cli/dist/commands/import.d.ts +0 -23
- package/cli/dist/commands/import.d.ts.map +0 -1
- package/cli/dist/commands/import.js +0 -118
- package/cli/dist/commands/import.js.map +0 -1
- package/cli/dist/commands/prompt.d.ts +0 -45
- package/cli/dist/commands/prompt.d.ts.map +0 -1
- package/cli/dist/commands/prompt.js +0 -223
- package/cli/dist/commands/prompt.js.map +0 -1
- package/cli/dist/commands/spec.d.ts +0 -57
- package/cli/dist/commands/spec.d.ts.map +0 -1
- package/cli/dist/commands/spec.js +0 -279
- package/cli/dist/commands/spec.js.map +0 -1
- package/cli/dist/commands/stats.d.ts +0 -18
- package/cli/dist/commands/stats.d.ts.map +0 -1
- package/cli/dist/commands/stats.js +0 -85
- package/cli/dist/commands/stats.js.map +0 -1
- package/cli/dist/commands/task.d.ts +0 -65
- package/cli/dist/commands/task.d.ts.map +0 -1
- package/cli/dist/commands/task.js +0 -282
- package/cli/dist/commands/task.js.map +0 -1
- package/cli/dist/commands/template.d.ts +0 -17
- package/cli/dist/commands/template.d.ts.map +0 -1
- package/cli/dist/commands/template.js +0 -55
- package/cli/dist/commands/template.js.map +0 -1
- package/cli/dist/utils/agent-config.d.ts +0 -129
- package/cli/dist/utils/agent-config.d.ts.map +0 -1
- package/cli/dist/utils/agent-config.js +0 -297
- package/cli/dist/utils/agent-config.js.map +0 -1
- package/cli/dist/utils/beads-graph.d.ts +0 -17
- package/cli/dist/utils/beads-graph.d.ts.map +0 -1
- package/cli/dist/utils/beads-graph.js +0 -150
- package/cli/dist/utils/beads-graph.js.map +0 -1
- package/cli/dist/utils/beads-integration.d.ts +0 -112
- package/cli/dist/utils/beads-integration.d.ts.map +0 -1
- package/cli/dist/utils/beads-integration.js +0 -312
- package/cli/dist/utils/beads-integration.js.map +0 -1
- package/cli/dist/utils/beads-reporter.d.ts +0 -17
- package/cli/dist/utils/beads-reporter.d.ts.map +0 -1
- package/cli/dist/utils/beads-reporter.js +0 -160
- package/cli/dist/utils/beads-reporter.js.map +0 -1
- package/cli/dist/utils/cache-manager.d.ts +0 -55
- package/cli/dist/utils/cache-manager.d.ts.map +0 -1
- package/cli/dist/utils/cache-manager.js +0 -150
- package/cli/dist/utils/cache-manager.js.map +0 -1
- package/cli/dist/utils/change-manager.d.ts +0 -70
- package/cli/dist/utils/change-manager.d.ts.map +0 -1
- package/cli/dist/utils/change-manager.js +0 -412
- package/cli/dist/utils/change-manager.js.map +0 -1
- package/cli/dist/utils/config-manager-enhanced.d.ts +0 -66
- package/cli/dist/utils/config-manager-enhanced.d.ts.map +0 -1
- package/cli/dist/utils/config-manager-enhanced.js +0 -77
- package/cli/dist/utils/config-manager-enhanced.js.map +0 -1
- package/cli/dist/utils/context-manager.d.ts +0 -96
- package/cli/dist/utils/context-manager.d.ts.map +0 -1
- package/cli/dist/utils/context-manager.js +0 -258
- package/cli/dist/utils/context-manager.js.map +0 -1
- package/cli/dist/utils/diff-engine.d.ts +0 -78
- package/cli/dist/utils/diff-engine.d.ts.map +0 -1
- package/cli/dist/utils/diff-engine.js +0 -233
- package/cli/dist/utils/diff-engine.js.map +0 -1
- package/cli/dist/utils/export-system.d.ts +0 -101
- package/cli/dist/utils/export-system.d.ts.map +0 -1
- package/cli/dist/utils/export-system.js +0 -289
- package/cli/dist/utils/export-system.js.map +0 -1
- package/cli/dist/utils/health-checker.d.ts +0 -66
- package/cli/dist/utils/health-checker.d.ts.map +0 -1
- package/cli/dist/utils/health-checker.js +0 -285
- package/cli/dist/utils/health-checker.js.map +0 -1
- package/cli/dist/utils/import-system.d.ts +0 -74
- package/cli/dist/utils/import-system.d.ts.map +0 -1
- package/cli/dist/utils/import-system.js +0 -317
- package/cli/dist/utils/import-system.js.map +0 -1
- package/cli/dist/utils/module-cloner.d.ts +0 -40
- package/cli/dist/utils/module-cloner.d.ts.map +0 -1
- package/cli/dist/utils/module-cloner.js +0 -136
- package/cli/dist/utils/module-cloner.js.map +0 -1
- package/cli/dist/utils/prompt-manager.d.ts +0 -90
- package/cli/dist/utils/prompt-manager.d.ts.map +0 -1
- package/cli/dist/utils/prompt-manager.js +0 -302
- package/cli/dist/utils/prompt-manager.js.map +0 -1
- package/cli/dist/utils/spec-manager.d.ts +0 -65
- package/cli/dist/utils/spec-manager.d.ts.map +0 -1
- package/cli/dist/utils/spec-manager.js +0 -329
- package/cli/dist/utils/spec-manager.js.map +0 -1
- package/cli/dist/utils/stats-collector.d.ts +0 -74
- package/cli/dist/utils/stats-collector.d.ts.map +0 -1
- package/cli/dist/utils/stats-collector.js +0 -164
- package/cli/dist/utils/stats-collector.js.map +0 -1
- package/cli/dist/utils/template-engine.d.ts +0 -47
- package/cli/dist/utils/template-engine.d.ts.map +0 -1
- package/cli/dist/utils/template-engine.js +0 -204
- package/cli/dist/utils/template-engine.js.map +0 -1
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
# C Coding Standards - User Guide
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
1. [Getting Started](#getting-started)
|
|
6
|
+
2. [Configuration](#configuration)
|
|
7
|
+
3. [Using the Extension](#using-the-extension)
|
|
8
|
+
4. [Categories](#categories)
|
|
9
|
+
5. [Rules](#rules)
|
|
10
|
+
6. [Customization](#customization)
|
|
11
|
+
7. [Troubleshooting](#troubleshooting)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
### Installation
|
|
18
|
+
|
|
19
|
+
The C Coding Standards extension is part of the Augment Extensions package. It provides AI-powered coding assistance for C programming across 7 specialized categories.
|
|
20
|
+
|
|
21
|
+
### Quick Start
|
|
22
|
+
|
|
23
|
+
1. **Initialize Configuration**
|
|
24
|
+
|
|
25
|
+
Create a `.augment/c-standards.json` file in your project root:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"c_standards": {
|
|
30
|
+
"version": "1.0.0",
|
|
31
|
+
"categories": ["systems", "embedded"],
|
|
32
|
+
"c_standard": "c11",
|
|
33
|
+
"universal_rules": {
|
|
34
|
+
"naming": "enabled",
|
|
35
|
+
"memory_safety": "enabled",
|
|
36
|
+
"error_handling": "enabled",
|
|
37
|
+
"documentation": "enabled",
|
|
38
|
+
"header_guards": "enabled",
|
|
39
|
+
"const_correctness": "enabled"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
2. **Start Coding**
|
|
46
|
+
|
|
47
|
+
The extension automatically provides context-aware suggestions as you code.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
### Configuration File Location
|
|
54
|
+
|
|
55
|
+
Place your configuration in one of these locations:
|
|
56
|
+
- `.augment/c-standards.json` (JSON format)
|
|
57
|
+
- `.augment/c-standards.yaml` (YAML format)
|
|
58
|
+
|
|
59
|
+
### Configuration Options
|
|
60
|
+
|
|
61
|
+
#### Basic Settings
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"c_standards": {
|
|
66
|
+
"version": "1.0.0",
|
|
67
|
+
"categories": ["systems", "embedded", "kernel"],
|
|
68
|
+
"c_standard": "c11"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Options:**
|
|
74
|
+
- `version` - Configuration version (currently "1.0.0")
|
|
75
|
+
- `categories` - Array of active categories
|
|
76
|
+
- `c_standard` - C standard to follow ("c89", "c99", "c11", "c17", "c23")
|
|
77
|
+
|
|
78
|
+
#### Universal Rules
|
|
79
|
+
|
|
80
|
+
Six universal rules apply to all categories:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"universal_rules": {
|
|
85
|
+
"naming": "enabled",
|
|
86
|
+
"memory_safety": "enabled",
|
|
87
|
+
"error_handling": "enabled",
|
|
88
|
+
"documentation": "warning",
|
|
89
|
+
"header_guards": "enabled",
|
|
90
|
+
"const_correctness": "enabled"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Rule States:**
|
|
96
|
+
- `"enabled"` - Rule violations are errors
|
|
97
|
+
- `"warning"` - Rule violations are warnings
|
|
98
|
+
- `"disabled"` - Rule is not checked
|
|
99
|
+
|
|
100
|
+
#### Category Overrides
|
|
101
|
+
|
|
102
|
+
Customize rules for specific categories:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"category_overrides": {
|
|
107
|
+
"embedded": {
|
|
108
|
+
"allow_dynamic_allocation": false,
|
|
109
|
+
"require_volatile_hardware": true
|
|
110
|
+
},
|
|
111
|
+
"realtime": {
|
|
112
|
+
"max_function_complexity": 10,
|
|
113
|
+
"require_deterministic_paths": true
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### Static Analysis Integration
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"static_analysis": {
|
|
124
|
+
"clang_tidy": true,
|
|
125
|
+
"cppcheck": true,
|
|
126
|
+
"valgrind": false
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Custom Rules
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"custom_rules": {
|
|
136
|
+
"enabled": true,
|
|
137
|
+
"path": ".augment/c-standards/custom-rules/"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Complete Configuration Example
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"c_standards": {
|
|
147
|
+
"version": "1.0.0",
|
|
148
|
+
"categories": ["systems", "embedded", "kernel"],
|
|
149
|
+
"c_standard": "c11",
|
|
150
|
+
"universal_rules": {
|
|
151
|
+
"naming": "enabled",
|
|
152
|
+
"memory_safety": "enabled",
|
|
153
|
+
"error_handling": "enabled",
|
|
154
|
+
"documentation": "warning",
|
|
155
|
+
"header_guards": "enabled",
|
|
156
|
+
"const_correctness": "enabled"
|
|
157
|
+
},
|
|
158
|
+
"category_overrides": {
|
|
159
|
+
"embedded": {
|
|
160
|
+
"allow_dynamic_allocation": false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"static_analysis": {
|
|
164
|
+
"clang_tidy": true,
|
|
165
|
+
"cppcheck": true,
|
|
166
|
+
"valgrind": false
|
|
167
|
+
},
|
|
168
|
+
"custom_rules": {
|
|
169
|
+
"enabled": false,
|
|
170
|
+
"path": ".augment/c-standards/custom-rules/"
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Using the Extension
|
|
179
|
+
|
|
180
|
+
### AI-Powered Suggestions
|
|
181
|
+
|
|
182
|
+
The extension provides context-aware suggestions based on:
|
|
183
|
+
- File path (automatically detects category)
|
|
184
|
+
- Code context
|
|
185
|
+
- Active rules
|
|
186
|
+
- Configuration settings
|
|
187
|
+
|
|
188
|
+
### Code Evaluation
|
|
189
|
+
|
|
190
|
+
Evaluate your code against standards:
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
import { RuleEvaluator } from '@augment/c-standards';
|
|
194
|
+
|
|
195
|
+
const evaluator = new RuleEvaluator(registry, configManager);
|
|
196
|
+
const violations = await evaluator.evaluate(code, {
|
|
197
|
+
filePath: '/project/src/main.c',
|
|
198
|
+
rules: ['universal-naming', 'universal-memory-safety']
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Prompt Generation
|
|
203
|
+
|
|
204
|
+
Generate AI prompts for code assistance:
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
import { PromptGenerator } from '@augment/c-standards';
|
|
208
|
+
|
|
209
|
+
const generator = new PromptGenerator(registry, configManager);
|
|
210
|
+
const prompt = await generator.generatePrompt({
|
|
211
|
+
filePath: '/project/embedded/sensor.c',
|
|
212
|
+
codeContext: 'volatile uint32_t* reg;'
|
|
213
|
+
});
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Categories
|
|
219
|
+
|
|
220
|
+
The extension supports 7 specialized C programming categories:
|
|
221
|
+
|
|
222
|
+
### 1. Systems Programming
|
|
223
|
+
|
|
224
|
+
**Focus:** POSIX compliance, system calls, process management
|
|
225
|
+
|
|
226
|
+
**File Patterns:** `**/systems/**`, `**/posix/**`
|
|
227
|
+
|
|
228
|
+
**Key Rules:**
|
|
229
|
+
- POSIX API usage
|
|
230
|
+
- Error handling for system calls
|
|
231
|
+
- Resource management
|
|
232
|
+
|
|
233
|
+
### 2. Embedded Systems
|
|
234
|
+
|
|
235
|
+
**Focus:** Hardware interaction, resource constraints, real-time behavior
|
|
236
|
+
|
|
237
|
+
**File Patterns:** `**/embedded/**`, `**/firmware/**`
|
|
238
|
+
|
|
239
|
+
**Key Rules:**
|
|
240
|
+
- Volatile for hardware registers
|
|
241
|
+
- No dynamic allocation (configurable)
|
|
242
|
+
- Interrupt safety
|
|
243
|
+
|
|
244
|
+
### 3. Kernel Development
|
|
245
|
+
|
|
246
|
+
**Focus:** Linux kernel style, kernel APIs, module development
|
|
247
|
+
|
|
248
|
+
**File Patterns:** `**/kernel/**`, `**/drivers/kernel/**`
|
|
249
|
+
|
|
250
|
+
**Key Rules:**
|
|
251
|
+
- Kernel coding style
|
|
252
|
+
- Kernel API usage
|
|
253
|
+
- Module initialization
|
|
254
|
+
|
|
255
|
+
### 4. Device Drivers
|
|
256
|
+
|
|
257
|
+
**Focus:** Hardware drivers, DMA, interrupt handling
|
|
258
|
+
|
|
259
|
+
**File Patterns:** `**/drivers/**`
|
|
260
|
+
|
|
261
|
+
**Key Rules:**
|
|
262
|
+
- Driver error handling
|
|
263
|
+
- Resource cleanup
|
|
264
|
+
- Hardware abstraction
|
|
265
|
+
|
|
266
|
+
### 5. Real-time Systems
|
|
267
|
+
|
|
268
|
+
**Focus:** Deterministic execution, timing constraints
|
|
269
|
+
|
|
270
|
+
**File Patterns:** `**/realtime/**`, `**/rtos/**`
|
|
271
|
+
|
|
272
|
+
**Key Rules:**
|
|
273
|
+
- Deterministic paths
|
|
274
|
+
- Priority inversion prevention
|
|
275
|
+
- Timing analysis
|
|
276
|
+
|
|
277
|
+
### 6. Networking
|
|
278
|
+
|
|
279
|
+
**Focus:** Network protocols, byte order, socket programming
|
|
280
|
+
|
|
281
|
+
**File Patterns:** `**/network/**`, `**/net/**`
|
|
282
|
+
|
|
283
|
+
**Key Rules:**
|
|
284
|
+
- Network byte order
|
|
285
|
+
- Socket error handling
|
|
286
|
+
- Protocol compliance
|
|
287
|
+
|
|
288
|
+
### 7. Legacy Code
|
|
289
|
+
|
|
290
|
+
**Focus:** Maintaining compatibility, gradual modernization
|
|
291
|
+
|
|
292
|
+
**File Patterns:** `**/legacy/**`, `**/compat/**`
|
|
293
|
+
|
|
294
|
+
**Key Rules:**
|
|
295
|
+
- Backward compatibility
|
|
296
|
+
- Gradual refactoring
|
|
297
|
+
- Documentation of legacy patterns
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Rules
|
|
302
|
+
|
|
303
|
+
### Universal Rules
|
|
304
|
+
|
|
305
|
+
These 6 rules apply to all categories:
|
|
306
|
+
|
|
307
|
+
#### 1. Naming Conventions
|
|
308
|
+
|
|
309
|
+
**Rule ID:** `universal-naming`
|
|
310
|
+
|
|
311
|
+
**Description:** Use snake_case for functions and variables, UPPER_CASE for macros and constants.
|
|
312
|
+
|
|
313
|
+
**Examples:**
|
|
314
|
+
|
|
315
|
+
✅ Good:
|
|
316
|
+
```c
|
|
317
|
+
int calculate_sum(int a, int b);
|
|
318
|
+
const int MAX_BUFFER_SIZE = 1024;
|
|
319
|
+
#define PI 3.14159
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
❌ Bad:
|
|
323
|
+
```c
|
|
324
|
+
int CalculateSum(int a, int b);
|
|
325
|
+
const int maxBufferSize = 1024;
|
|
326
|
+
#define Pi 3.14159
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
#### 2. Memory Safety
|
|
330
|
+
|
|
331
|
+
**Rule ID:** `universal-memory-safety`
|
|
332
|
+
|
|
333
|
+
**Description:** Always check malloc/calloc return values and free allocated memory.
|
|
334
|
+
|
|
335
|
+
**Examples:**
|
|
336
|
+
|
|
337
|
+
✅ Good:
|
|
338
|
+
```c
|
|
339
|
+
int* ptr = malloc(sizeof(int) * 10);
|
|
340
|
+
if (ptr == NULL) {
|
|
341
|
+
return -1;
|
|
342
|
+
}
|
|
343
|
+
// Use ptr
|
|
344
|
+
free(ptr);
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
❌ Bad:
|
|
348
|
+
```c
|
|
349
|
+
int* ptr = malloc(sizeof(int) * 10);
|
|
350
|
+
*ptr = 5; // No null check
|
|
351
|
+
// Memory leak - no free
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
#### 3. Error Handling
|
|
355
|
+
|
|
356
|
+
**Rule ID:** `universal-error-handling`
|
|
357
|
+
|
|
358
|
+
**Description:** Check return values and handle errors appropriately.
|
|
359
|
+
|
|
360
|
+
#### 4. Documentation
|
|
361
|
+
|
|
362
|
+
**Rule ID:** `universal-documentation`
|
|
363
|
+
|
|
364
|
+
**Description:** Document functions, complex logic, and public APIs.
|
|
365
|
+
|
|
366
|
+
#### 5. Header Guards
|
|
367
|
+
|
|
368
|
+
**Rule ID:** `universal-header-guards`
|
|
369
|
+
|
|
370
|
+
**Description:** Use include guards in all header files.
|
|
371
|
+
|
|
372
|
+
#### 6. Const Correctness
|
|
373
|
+
|
|
374
|
+
**Rule ID:** `universal-const-correctness`
|
|
375
|
+
|
|
376
|
+
**Description:** Use const for read-only data and parameters.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Customization
|
|
381
|
+
|
|
382
|
+
### Creating Custom Rules
|
|
383
|
+
|
|
384
|
+
1. **Enable Custom Rules**
|
|
385
|
+
|
|
386
|
+
```json
|
|
387
|
+
{
|
|
388
|
+
"custom_rules": {
|
|
389
|
+
"enabled": true,
|
|
390
|
+
"path": ".augment/c-standards/custom-rules/"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
2. **Create Rule File**
|
|
396
|
+
|
|
397
|
+
Create a Markdown file in the custom rules directory:
|
|
398
|
+
|
|
399
|
+
```markdown
|
|
400
|
+
# Rule: My Custom Rule
|
|
401
|
+
|
|
402
|
+
## Metadata
|
|
403
|
+
- **ID**: custom-my-rule
|
|
404
|
+
- **Category**: custom
|
|
405
|
+
- **Severity**: WARNING
|
|
406
|
+
|
|
407
|
+
## Description
|
|
408
|
+
Description of your custom rule.
|
|
409
|
+
|
|
410
|
+
## Examples
|
|
411
|
+
|
|
412
|
+
### Bad Example
|
|
413
|
+
\`\`\`c
|
|
414
|
+
// Bad code
|
|
415
|
+
\`\`\`
|
|
416
|
+
|
|
417
|
+
### Good Example
|
|
418
|
+
\`\`\`c
|
|
419
|
+
// Good code
|
|
420
|
+
\`\`\`
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Rule Overrides
|
|
424
|
+
|
|
425
|
+
Override rule severity or enable/disable rules:
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
import { RuleOverrideSystem } from '@augment/c-standards';
|
|
429
|
+
|
|
430
|
+
const overrideSystem = new RuleOverrideSystem(registry, configManager);
|
|
431
|
+
|
|
432
|
+
// Change severity
|
|
433
|
+
overrideSystem.applyOverride('universal-naming', {
|
|
434
|
+
severity: 'WARNING'
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
// Disable rule
|
|
438
|
+
overrideSystem.applyOverride('universal-documentation', {
|
|
439
|
+
enabled: false
|
|
440
|
+
});
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### Custom Templates
|
|
444
|
+
|
|
445
|
+
Create custom prompt templates:
|
|
446
|
+
|
|
447
|
+
```markdown
|
|
448
|
+
# C Coding Standards - {category}
|
|
449
|
+
|
|
450
|
+
## Active Rules
|
|
451
|
+
{rules}
|
|
452
|
+
|
|
453
|
+
## Project-Specific Guidelines
|
|
454
|
+
- Follow our team's coding style
|
|
455
|
+
- Use our custom error handling macros
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## Troubleshooting
|
|
461
|
+
|
|
462
|
+
### Common Issues
|
|
463
|
+
|
|
464
|
+
#### Configuration Not Loading
|
|
465
|
+
|
|
466
|
+
**Problem:** Configuration file is not being loaded.
|
|
467
|
+
|
|
468
|
+
**Solutions:**
|
|
469
|
+
1. Check file location: `.augment/c-standards.json` or `.augment/c-standards.yaml`
|
|
470
|
+
2. Validate JSON/YAML syntax
|
|
471
|
+
3. Check file permissions
|
|
472
|
+
|
|
473
|
+
#### Rules Not Applying
|
|
474
|
+
|
|
475
|
+
**Problem:** Rules are not being applied to code.
|
|
476
|
+
|
|
477
|
+
**Solutions:**
|
|
478
|
+
1. Verify rules are enabled in configuration
|
|
479
|
+
2. Check category matches file path
|
|
480
|
+
3. Reload configuration: `configManager.reload()`
|
|
481
|
+
|
|
482
|
+
#### Performance Issues
|
|
483
|
+
|
|
484
|
+
**Problem:** Slow rule evaluation.
|
|
485
|
+
|
|
486
|
+
**Solutions:**
|
|
487
|
+
1. Reduce number of active categories
|
|
488
|
+
2. Disable unused rules
|
|
489
|
+
3. Use caching: `registry.clearCache()` to reset if needed
|
|
490
|
+
|
|
491
|
+
### Getting Help
|
|
492
|
+
|
|
493
|
+
- Check the [API Documentation](./API.md)
|
|
494
|
+
- Review [Configuration Reference](./CONFIGURATION.md)
|
|
495
|
+
- See [Examples](../examples/)
|
|
496
|
+
|
|
497
|
+
### Debugging
|
|
498
|
+
|
|
499
|
+
Enable debug logging:
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
import { setLogLevel } from '@augment/c-standards';
|
|
503
|
+
|
|
504
|
+
setLogLevel('debug');
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
View configuration:
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
const config = configManager.getConfiguration();
|
|
511
|
+
console.log(JSON.stringify(config, null, 2));
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
List loaded rules:
|
|
515
|
+
|
|
516
|
+
```typescript
|
|
517
|
+
const allRules = registry.getAllRules();
|
|
518
|
+
console.log(`Loaded ${allRules.length} rules`);
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
---
|
|
522
|
+
|
|
523
|
+
## Best Practices
|
|
524
|
+
|
|
525
|
+
### 1. Start with Universal Rules
|
|
526
|
+
|
|
527
|
+
Enable all 6 universal rules first, then add category-specific rules as needed.
|
|
528
|
+
|
|
529
|
+
### 2. Use Appropriate Categories
|
|
530
|
+
|
|
531
|
+
Select categories that match your project type:
|
|
532
|
+
- Embedded firmware → `embedded`
|
|
533
|
+
- Linux kernel module → `kernel`
|
|
534
|
+
- Network application → `systems`, `networking`
|
|
535
|
+
|
|
536
|
+
### 3. Customize Gradually
|
|
537
|
+
|
|
538
|
+
Start with default configuration, then customize based on your team's needs.
|
|
539
|
+
|
|
540
|
+
### 4. Document Overrides
|
|
541
|
+
|
|
542
|
+
When overriding rules, document the reason in your configuration:
|
|
543
|
+
|
|
544
|
+
```json
|
|
545
|
+
{
|
|
546
|
+
"category_overrides": {
|
|
547
|
+
"embedded": {
|
|
548
|
+
"allow_dynamic_allocation": false,
|
|
549
|
+
"_comment": "Disabled for safety-critical embedded systems"
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
### 5. Regular Updates
|
|
556
|
+
|
|
557
|
+
Keep rules and configuration up to date with your project's evolution.
|
|
558
|
+
|
|
559
|
+
---
|
|
560
|
+
|
|
561
|
+
## Next Steps
|
|
562
|
+
|
|
563
|
+
- Read the [API Documentation](./API.md) for programmatic usage
|
|
564
|
+
- Explore [Examples](../examples/) for common patterns
|
|
565
|
+
- Review the [Rule Catalog](./RULES.md) for all available rules
|
|
566
|
+
- Check the [Configuration Reference](./CONFIGURATION.md) for detailed options
|
|
567
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Makefile for Device Driver Examples
|
|
2
|
+
|
|
3
|
+
obj-m += platform-driver.o
|
|
4
|
+
obj-m += dma-example.o
|
|
5
|
+
|
|
6
|
+
KDIR ?= /lib/modules/$(shell uname -r)/build
|
|
7
|
+
PWD := $(shell pwd)
|
|
8
|
+
|
|
9
|
+
all:
|
|
10
|
+
$(MAKE) -C $(KDIR) M=$(PWD) modules
|
|
11
|
+
|
|
12
|
+
clean:
|
|
13
|
+
$(MAKE) -C $(KDIR) M=$(PWD) clean
|
|
14
|
+
rm -f *.dtb
|
|
15
|
+
|
|
16
|
+
# Device tree compilation
|
|
17
|
+
dtb: example.dts
|
|
18
|
+
dtc -I dts -O dtb -o example.dtb example.dts
|
|
19
|
+
@echo "Device tree blob created: example.dtb"
|
|
20
|
+
|
|
21
|
+
# Load modules
|
|
22
|
+
load: all
|
|
23
|
+
sudo insmod platform-driver.ko
|
|
24
|
+
sudo insmod dma-example.ko
|
|
25
|
+
@echo "Drivers loaded"
|
|
26
|
+
|
|
27
|
+
unload:
|
|
28
|
+
-sudo rmmod dma-example
|
|
29
|
+
-sudo rmmod platform-driver
|
|
30
|
+
@echo "Drivers unloaded"
|
|
31
|
+
|
|
32
|
+
.PHONY: all clean dtb load unload
|
|
33
|
+
|